It looks silly, but it fixed some initialization issues with FBOs. This is what I wrote in a commit on June 1st: “Delay setup for a few frames. Delaying setup might help on iOS with FBOs”.
I just tested this on Android and the same problem occurred.
Just like on iOS, It crashes when calling img.setFromPixels(pixels);
And if I add pixels.allocate(ofGetWidth(), ofGetHeight(), OF_PIXELS_RGBA); after ofPixels pixels; it doesn’t crash but doesn’t draw properly. All I see is a black screen.
// here are the most commonly used iOS window settings.
//------------------------------------------------------
ofiOSWindowSettings settings;
settings.enableRetina = true; // enables retina resolution if the device supports it.
settings.enableDepth = false; // enables depth buffer for 3d drawing.
settings.enableAntiAliasing = false; // enables anti-aliasing which smooths out graphics on the screen.
settings.numOfAntiAliasingSamples = 4; // number of samples used for anti-aliasing.
settings.enableHardwareOrientation = true; // enables native view orientation.
settings.enableHardwareOrientationAnimation = true; // enables native orientation changes to be animated.
settings.glesVersion = OFXIOS_RENDERER_ES2; // type of renderer to use, ES1, ES2, etc. we need es2 for IMGui
//ofCreateWindow(settings);
ofAppiOSWindow * window = (ofAppiOSWindow *)(ofCreateWindow(settings).get());