openframeworks / openframeworks/openFrameworks

ofFbo not compatible with presentViewController on iOS

Open
#5,033 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

iOS
Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

tested on 0.9.3 and master, based on example iosNativeExample :

  1. use ofFbo to draw the image in ImageApp
  2. ofFbo fbo; in ImageApp.h
  3. fbo.allocate(image.getWidth(),image.getHeight()); at the end of ImageApp::setup()
  4. fbo.begin(); image.draw(0, 0); fbo.end(); at the end of ImageApp::update()
  5. fbo.draw(x,y,image.getWidth(),image.getHeight()); instead of image.draw(x, y); in ImageApp::draw()
    http://pastebin.com/raw/xLLcNDPi
  6. use presentViewController in MyAppViewController button4Pressed
  7. [self.parentViewController presentViewController:viewController animated:YES completion:nil];
    http://pastebin.com/raw/W25JXyA3

When tested on iPhone 6 plus ios 9.1 or 9.3.1, and on simulators, pressing on Image button in main screen leads to a gray screen (nothing displayed).
When commenting the usage of ofFbo, the image display just fine (as well as all indicators of the test).

The minimal change to reproduce it is to have to call ofFbo::begin() and ofFbo::end() in update to reproduce the problem.
The problem can be reproduced with all 4 cases of this example.

If using the regular NavigationViewController pushController in button4Pressed, ofFbo usage works.
OpenGL ES1 or ES2 : no impact on bug.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in the iosNativeExample using ImageApp and MyAppViewController, with ofFbo::begin() and ofFbo::end() in update and presentViewController in button4Pressed. Compare this with the working pushController path and verify behavior on the listed iOS devices or simulators. Done means the image and indicators display after presentation while retaining ofFbo usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, ios
Domain
computer-graphics, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.