Re: GLException "Unable to create temp OpenGL context for device context" thrown when GLContext.makeCurrent() called
Posted by
Sven Gothel on
Sep 11, 2012; 4:39pm
URL: https://forum.jogamp.org/GLException-Unable-to-create-temp-OpenGL-context-for-device-context-thrown-when-GLContext-makeCurrend-tp4026068p4026103.html
On 09/11/2012 05:46 PM, stepasite [via jogamp] wrote:
> Hi,
>
> thanks for the info. Anyway, I am little bit confused how sharing of contexts
> should look like.
>
> Yes, I can store context for sharing e.g. in init() handler, but when I want
> to share contexts between more canvases before they are displayed, I cannot
> see a way how to do it.
>
> Also when moving canvases in the hierarchy (removing and adding them from/to a
> container) can possibly destroy all existing contexts which means that sharing
> won't suffice and textures, display lists, etc. will be destroyed.
>
> Summed up: exists there a way how to create a context that can be seamlessly
> used for sharing between multiple GLCanvas instances?
Shure .. there is a GLCanvas constructor taking a shared GLContext as an argument.
GLWindow is a bit different, is provides 'setSharedContext(GLContext)'
to avoid explosion of possible constructors etc.
If you like to share things between many GL context,
simple share the 'root' shared one with all of them. Should work.
~Sven