invisible rendering
Posted by slajar on Jun 16, 2014; 10:07am
URL: https://forum.jogamp.org/invisible-rendering-tp4032432.html
Hey all,
I have an application with four drawing contexts. as of jogl 2.2 I am using createDummyAutoDrawable() to mke the context working with the same textures. Now I have a major problem.
1. I create a context 1 with a Shader that creates a textures through FBO. That works great.
2. This texture is beeing drawed in context 1.
3. Now the user enables context 2. The texture is also used for drawing in context 2.
4. The context 1 is beeing destroyed since it is not displayable anymore (user hides the context in the application). In this case the context for the Shader is not valid anymore and I get weird problems.
(5. worst case would be that non of my contexts are shown anymore and I still expect the Shader is running)
My question is. What is the best practice for this? Is there some kind of offscreen context that I could use for?
I already tried to used the sharedDrawable from createDummyAutoDrawable, but this is not valid for drawing and Shader.
I had an idea of creating an offscreen 1x1 pixel context that holds all these objects and shaders for the life time of my application. Actually, I don't like the idea since there is a blinking pixel somewhere in the screen. I hope there is a better solution for this.
kind regards
Matthias