How to share texture between 2 OpenGL contexts?

I successfully view my OpenGL view by drawing an off-screen texture (which is created by an off-frame framebuffer).

draw -> offscreen FBO/Texture ------> onscreen FBO ---> render buffer -> context

Now I want to reuse the external texture to render another OpenGL context.

draw -> offscreen FBO/Texture ----> onscreen FBO ---> render buffer -> context
                             \----> onscreen FBO2---> render buffer2 ->context 2

I tried, but I can’t do anything for context 2. Has anyone got this problem and know how to set up text sharing?

Thank!

UPDATE: I just created a simple project that describes what I am doing with Framebuffer and double contexts. http://www.mediafire.com/?vxv1bubzvio4q7h

+5
source share

All Articles