Posted by
runiter on
Mar 06, 2013; 9:50pm
URL: https://forum.jogamp.org/Javafx-causes-jogl-problem-in-mac-tp4028417p4028535.html
I noticed that the Newt null exception is thrown before the following invoke in JoglNewtAwtCanvas.init() is called:
getNewtWindow().invoke(true, new GLRunnable() {
@Override
public boolean run(final GLAutoDrawable glAutoDrawable) {
_canvasRenderer.init(_settings, true);// true - do swap in renderer.
return true;
}
});
Judging from the exception it appears that Jogl resize() is called before the above invoke, therefore it results in exception. Shouldn't you avoid the use of context in GLWindow.setSize and wait until it's initialized using the invoke code above?
java.lang.RuntimeException: java.lang.NullPointerException
at jogamp.opengl.GLRunnableTask.run(GLRunnableTask.java:65)
at jogamp.opengl.GLDrawableHelper.execGLRunnables(GLDrawableHelper.java:419)
at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:359)
at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:280)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:655)
at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:594)
at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:543)
at jogamp.opengl.GLAutoDrawableBase.defaultWindowResizedOp(GLAutoDrawableBase.java:128)
at com.jogamp.newt.opengl.GLWindow.access$100(GLWindow.java:94)
at com.jogamp.newt.opengl.GLWindow$1.windowResized(GLWindow.java:112)
at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:2374)
at jogamp.newt.WindowImpl.sendWindowEvent(WindowImpl.java:2317)
at jogamp.newt.WindowImpl.setVisibleActionImpl(WindowImpl.java:758)
at jogamp.newt.WindowImpl$SetSizeAction.run(WindowImpl.java:820)
at jogamp.newt.DisplayImpl.runOnEDTIfAvail(DisplayImpl.java:206)
at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:1577)
at jogamp.newt.WindowImpl.setSize(WindowImpl.java:830)
at com.jogamp.newt.opengl.GLWindow.setSize(GLWindow.java:399)
at jogamp.newt.awt.event.AWTParentWindowAdapter$1.run(AWTParentWindowAdapter.java:103)
at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:119)
at jogamp.newt.DefaultEDTUtil$EventDispatchThread.run(DefaultEDTUtil.java:313)
Caused by: java.lang.NullPointerException
at com.ardor3d.framework.jogl.JoglCanvasRenderer.makeCurrentContext(JoglCanvasRenderer.java:75)
at com.ardor3d.framework.jogl.JoglCanvasRenderer.draw(JoglCanvasRenderer.java:192)
at com.ardor3d.framework.jogl.JoglDrawerRunnable.run(JoglDrawerRunnable.java:16)
at jogamp.opengl.GLRunnableTask.run(GLRunnableTask.java:59)
... 20 more