EAGLContext, EAGLSharegroups, RenderBuffers, FrameBuffers, oh my!

I am trying to wrap my head around the OpenGL object model on an iPhone OS. I am currently drawing several different UIView(based on CAEAGLayers) on the screen. Currently, I use each of them as a separate one EAGLContext, each of which has color rendering and framebuffer.

I reproduce similar things in them, and I would like to split the textures between these instances in order to save memory overhead.

My real understanding is that I could use the same setting (a number of contexts, each of which has FBO / RBO), but if I create later ones using the EAGLShareGroupfirst, then I can just use the texture names (GLuints ) from the first to later. That's for sure?

If so, I assume the following question: what is the use of having a β€œgroup”? Can I just reuse the same context and attach multiple FBOs / RBOs to this context? I think I'm struggling with the abstraction level of the sharegroup group, which seems to separate the β€œobjects” (textures and other named things), but not the β€œstate” (matrices, enabled / disabled states) that belong to the context.

What is the best way to think about this?

Thanks for any enlightenment!

+3
source share
1 answer

Correctly. When two EAGLContextare created with the same EAGLSharegroup, they have the same kind of buffer objects, textures, rendering, and framebuffers. If your contexts use OpenGL ES 2.0, they will also share shaders and program objects.

, , . , , , , EAGLContext -, , , . , youre, color renderbuffer.

+4

Source: https://habr.com/ru/post/1748206/


All Articles