I’m writing an offline, non-realtime renderer. It creates a GLPbuffer, and uses that to do the rendering. Although this works, there’s one aspect I’m unhappy about. No matter what thread I call display() on, the GLEventListener gets invoked on the event dispatch thread, and I have to do all my rendering within that listener. This means that the event thread (and hence the whole UI) is blocked for as long as it takes to render, which is potentially a long time.
Here are some things that may be significant:
-
I’m doing all the rendering in a GLPbuffer. It doesn’t interact with the UI in any way.
-
The pbuffer’s GLContext is not shared with anything else.
-
This is not the only use of JOGL in this application, so I need to address it in a way that doesn’t mess up other parts of the application (by changing global settings).
The Threading class might be a solution except for the last point. It only offers global settings that change the behavior of the entire application. Also, disableSingleThreading() isn’t even guaranteed to have an effect on all platforms.
So is there any way that, just for this one pbuffer and GLContext, which has no connection to any other use of OpenGL or anything in the UI, I can do rendering from a different thread?
Peter