hi all:
i complie an example program about jogl,but it can’t run and i can’t find the cause
when i call the net.java.games.jogl.GLCanvas.GLCanvas.display() method and produce the follow errors
Caused by: java.lang.reflect.InvocationTargetException
at java.awt.EventQueue.invokeAndWait(EventQueue.java:851)
at net.java.games.jogl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:228)
… 3 more
Caused by: net.java.games.jogl.GLException: Error swapping buffers
at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.swapBuffers(WindowsOnscreenGLContext.java:155)
at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:296)
at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.invokeGL(WindowsOnscreenGLContext.java:79)
at net.java.games.jogl.GLCanvas$DisplayOnEventDispatchThreadAction.run(GLCanvas.java:266)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Process exited.
who can tell me how this error cause and reslove it ?thanks
This is typically caused by having the window/canvas destroyed before the rendering thread is properly shut down. You need to be really careful with your timing about how and when you manage your display loop and the threads that access it. Errors like this are typically a sign that you’ve messed up something in your own timing and thread access.
thank you Mithrandir !
may be it is,i will modify the order when the thread access as you say!