rendering multiple OpenGL views within a single UIView (iOS)
Our company has developed code to render a single (full-screen) 3D scene.
We wish to adapt that code to render two 3D scenes within the same iOS window (two UIViews using OpenGL ES).
I attempted to leverage the approach described by this example code:
That approach shared one context among two or more frame buffers.
During initialization, my current code generates the the frame buffers and checks that they were properly constructed.
Later - right before rendering - we attempt to rebind the frame buffer and color render buffer that corresponds to the target view.
The first attempt for the first view worked fine - but the second attempt for the second view failed.
The CHECK_GL_ERRORS macro above generated the following log message:
2011-05-03 19:13:31.283 TestMorph[79963:40b] OpenGL: +[FrameBufferUtils Set:] [error 1281]
This means that glBindFramebufferOES returned
The manual page for glBindFramebuffer doesn't list that as a possible error.
Can anyone suggest steps to resolve this error (or another way to do what I am ultimately trying to accomplish)?
Re: rendering multiple OpenGL views within a single UIView (
I have resolved my own problem.
The problem appeared to be related to calling: glBindFramebufferOES.
Instead - it was related to other calls where I hadn't detected the error
(specifically either glFrustumf or glRotatef).
My code now creates two distinct scenes in sub-views of the main view.
Thanks for reading.