Why is my OpenGL ES view sometimes empty in iOS 4.3?

My Guess-A-Sketch application has problems with drawing in ios 4.3. I have a canvas for painting that appears in black. The strange thing that I discovered if I adjust the frame size in the ogl representation a bit seems to work. The version that I have in the appstore does not work, so I need to do an update to fix .. although this seems like an error. Has anyone else seen this? Very annoying! even when I set the frame to fix the view flickers black when I have animated transformations on a view that was smooth in previous versions of ios

+3
source share
4 answers

You may have encountered the issue mentioned in this answer . In iOS 4.2, the way buffers are rendered has been changed to improve performance. From the OpenGL ES Programming Guide :

In iOS 4.2 and later, Core Animation renderbuffers rotational performance has been greatly improved and is now the preferred way to rotate content between landscape and portrait. For better performance, ensure the rendering buffers height and width are a few 32 pixels.

iOS 4.2 , OpenBL ES 32, ( ). , , , .

, , 32 .

+2

, , 4.2.2, 4.3. openGL, os UIScrollView, , , , , , , . 4.3 .

.

+1

, 32, ... , Raintained backing true. .

OpenGLES2DView.m:

eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:
                                    [NSNumber numberWithBool:YES], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat, nil];
0

, .

To fix this, I just pointed backgroundColorfor my Open GL view. I have no idea how this works, here, but it solved this problem for me.

Hope this helps.

By the way, this particular problem seems to be fixed on iOS 5.

0
source

All Articles