Exception on GLAutodrawable.display()

Hi all,
Im a n00b when it comes to JOGL, but I’ve been using LWJGL for yonks. Ive recently built a JOGL platform for my rendering engine and Im not quite sure why im getting this exception:


Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: Attempt to make the same context current twice on thread Thread[AWT-EventQueue-0,6,main]
        at com.sun.opengl.impl.GLContextLock.lock(GLContextLock.java:83)
        at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:131)
        at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:209)
        at javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:265)
        at javax.media.opengl.GLCanvas.display(GLCanvas.java:130)
        at com.volatileengine.renderer.jogl.JOGLRenderer.showSurfaces(JOGLRenderer.java:115)
        at com.volatileengine.renderer.AbstractPlatform.render(AbstractPlatform.java:56)
        at com.volatileengine.renderer.jogl.JOGLPlatform.access$300(JOGLPlatform.java:20)
        at com.volatileengine.renderer.jogl.JOGLPlatform$1.display(JOGLPlatform.java:53)

Unfortunetly, I can’t use an Animator because of the architecture of my engine, I need control on when to call display(). Hence why im calling GLcanvas.display() from JOGLRenderer.showSurfaces(…);

Is there something Im missing ?

DP :slight_smile:

bump

Can anybody at least tell me the conditions under which exception is thrown?

DP :slight_smile:

I think it is likely that your game engine is raising some sort of OpenGL error which is preventing correct releasing of the OpenGL context. Also, are you using the latest JOGL nightly build? I believe in one of the recent release candidates some failure modes were fixed in the GLCanvas / GLContext code to release the context more cleanly in the case of errors.

Have you tried installing a DebugGL? See the JOGL demos’ source code for examples of how to install it.

Thanks for your reply ken. I pretty sure no GL error is being thrown as it works fine in LWJGL. All I did was copy/paste my GL code from LWJGL and instead of calling GL11, im calling gl…

I’ll have a look at DebugGL…thanks.