EAGLContext, EAGLSharegroups, RenderBuffers, FrameBuffers, oh my!

Posted by quixoto on Stack Overflow See other posts from Stack Overflow or by quixoto
Published on 2010-06-02T17:43:39Z Indexed on 2010/06/03 4:54 UTC
Read the original article Hit count: 364

Hi all, I'm trying to wrap my head around the OpenGL object model on iPhone OS. I'm currently rendering into a few different UIViews (build on CAEAGLayers) on the screen. I currently have each of these as using separate EAGLContext, each of which has a color renderbuffer and a framebuffer.

I'm rendering similar things in them, and I'd like to share textures between these instances to save memory overhead.

My current understanding is that I could use the same setup (some number of contexts, each with a FBO/RBO) but if I spawn the later ones using the EAGLShareGroup of the first one, then I can simply use the texture names (GLuints) from the first one in the later ones. Is this accurate?

If this is the case, I guess the followup question is: what's the benefit to having it be a "sharegroup"? Could I just reuse the same context, and attach multiple FBOs/RBOs to that context? I think I'm struggling with the abstraction layer of a sharegroup, which seems to share "objects" (textures and other named things) but not "state" (matrices, enabled/disabled states) which are owned by the context.

What's the best way to think of this?

Thanks for any enlightenment!

© Stack Overflow or respective owner

Related posts about iphone

Related posts about opengl-es