Re: NCDF problem with VirtualUniverse
Posted by InteractiveMesh on Nov 20, 2012; 11:12am
URL: https://forum.jogamp.org/NCDF-problem-with-VirtualUniverse-tp4027031p4027070.html
The thread on which GraphicsConfigTemplate3D.getBestConfiguration() is called will be blocked until the Renderer instance will release it after finding the best configuration via JoglPipeline methods on the J3D-Renderer-x thread.
JoglPipeline.getBestConfiguration() calls JoglPipeline.getDefaultProfile() which calls GLProfile.getMaxFixedFunc(true) where in the deep JAWTUtil's static initializer calls EventQueue.invokeAndWait() if not invoked on the EDT.
So, if GraphicsConfigTemplate3D.getBestConfiguration() is called on the EDT (most likely in this case) a deadlock will arise because EventQueue.invokeAndWait() will never return. I can reproduce this behavior.
Short term work-around: Don't create a GraphicsConfiguration instance for Canvas3D by using a GraphicsConfigTemplate3D or calling SimpleUniverse. getPreferredConfiguration() on the EDT.
I suggest to introduce a member 'glProfile' instead of calling 'getDefaultProfile()' several times:
private GLProfile glProfile = null;
/** Constructor for singleton JoglPipeline instance */
protected JoglPipeline() {
glProfile = GLProfile.getMaxFixedFunc(true);
}
August