I have a subclass or UIView with a CAEAGLLayer backing it. This view is not full screen and is a subview of a container UIView. This container is controlled by a UIViewController in a UINavigationController stack. If I push a new view on the stack then pop it off, everything is fine and I can still see and interact with the OpenGL view. If I push another view on the navigation controller stack then trigger a memory warning, then pop that view, the OpenGL view still exists and renders its backgroundColor but the OpenGL content is not visible. Triggering its draw method on viewDidAppear, I can see that it redraws its content (I can step through its draw method in debugger and context is not null, layer is not null, etc) however, the OpenGL content does not appear after call to presentRenderBuffer:

Obviously something was released when the memory warning occurred, but I still have a UIView and it has a CAEAGLLayer with an EAGLContext (at least they are not nil).

I tried destroying and recreating the framebuffer and renderbuffer before drawing when the view re-appears thinking maybe those had been released.

I tried setting the EAGLLayer.drawableProperties to include kEAGLDrawablePropertyRetainedBacking key set to YES.

Why won't the OpenGL content appear?

One final note: I know GLKView is probably what I should be using but I need to support iOS 4.2.

0

There are 0 best solutions below