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 UIView
s (build on CAEAGLayer
s) 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!