single GLContext (not shared context) for multiple GLWindows?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

single GLContext (not shared context) for multiple GLWindows?

andemark
Hi All.  Thanks for all the great work on JOGL :-)

I am trying to take advantage of Newt and GLWindow for a Swing and JOGL based application, and am looking for the smartest way to share lots of buffered data, textures, compute shader data, and VAOs for rendering different parts of a large GPU-computed data set.  While a single GLWindow and multiple viewports works fine, it all gets painful trying to layout a Swing UI around the viewports.

So I've tried to use a set of GLWindows and a single GLContext.

Has anyone successfully implemented a GLContext singleton and use in multiple GLWindows?

GLWindow glWindow.setContext(...) called before the glWindow is visible leads to "GLWindow.LifecycleHook.setVisiblePost: ... - Null drawable, but valid context - NEWT-GLWindow".

After visibility, it seems to only lead to "...being incorrectly used with a different GLContext than that which created it" or " makeCurrent() failed with new drawable X11OnscreenGLXDrawable..."

I can try and strip things down to a minimal test case, but before I go too far down that road, I'd like to know I'm not being silly, or redundant.

Thanks for any advice!

 - Mark
Reply | Threaded
Open this post in threaded view
|

Re: single GLContext (not shared context) for multiple GLWindows?

gouessej
Administrator
Hey

Why not using shared contexts?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: single GLContext (not shared context) for multiple GLWindows?

andemark
I have dozens of VAOs, and creating and binding  new ones for each GLWindow using a shared context makes things a bit unmanageable...

So I was hoping to avoid that, and avoid restructuring things to make that even possible.

It does seem like a single context shared across multiple Newt GLWindows would be the ideal solution, unless I'm missing something...

Thanks for your thoughts,

  - Mark