Login  Register

Re: OpenGL error 1282 at GLContext.release()

Posted by ac on Feb 15, 2012; 8:12pm
URL: https://forum.jogamp.org/OpenGL-error-1282-at-GLContext-release-tp3742304p3748181.html

Ok, with the debug and trace options enabled, I get the following:

glGetString(<int> 0x1F00) = NVIDIA Corporation
glGetError() = 0
glGetString(<int> 0x1F00) = NVIDIA Corporation
glGetString(<int> 0x1F01) = GeForce GTX 570/PCI/SSE2
glGetString(<int> 0x1F02) = 4.2.0
glGetString(<int> 0x1F03) = GL_ARB_base_instance <snip> ...
glBlendEquation(<int> 0x8006)
glGetIntegerv(<int> 0xD33, <[I>, <int> 0x0)
glGetIntegerv(<int> 0x846E, <[I>, <int> 0x0)
glGetIntegerv(<int> 0x846D, <[I>, <int> 0x0)
glGetIntegerv(<int> 0x80A9, <[I>, <int> 0x0)
glClearColor(<float> 0.0, <float> 0.0, <float> 0.0, <float> 0.0)
glClear(<int> 0x100)
glClearColor(<float> 0.8, <float> 0.8, <float> 0.8, <float> 1.0)
glClear(<int> 0x4000)
glBindFramebuffer(<int> 0x8D40, <int> 0x0)
glGetError() = 0
glEnable(<int> 0xBE2)
glBlendEquation(<int> 0x8006)
glBlendFunc(<int> 0x302, <int> 0x303)
glEnable(<int> 0xB71)
glDepthFunc(<int> 0x203)
glDepthMask(<boolean> true)
glGetIntegerv(<int> 0xBA2, <[I>, <int> 0x0)
glViewport(<int> 0x0, <int> 0x0, <int> 0x280, <int> 0x1E0)
glFrontFace(<int> 0x900)
glActiveTexture(<int> 0x84C0)
glClearColor(<float> 0.0, <float> 0.0, <float> 0.0, <float> 0.0)
glClear(<int> 0x500)
glGetError() = 0
glGetError() = 0
glViewport(<int> 0x0, <int> 0x0, <int> 0x280, <int> 0x1E0)
glFlush()
glGetError()Exception in thread "Animation Thread" javax.media.opengl.GLException: No OpenGL context is current on this thread
        at javax.media.opengl.DebugGL4bc.checkContext(DebugGL4bc.java:25888)
        at javax.media.opengl.DebugGL4bc.glGetError(DebugGL4bc.java:9485)
        at javax.media.opengl.TraceGL4bc.glGetError(TraceGL4bc.java:6434)
        at processing.opengl.PGL.glGetError(PGL.java:465)
        at processing.opengl.PGraphicsOpenGL.report(PGraphicsOpenGL.java:4342)
        at processing.opengl.PGraphicsOpenGL.endDraw(PGraphicsOpenGL.java:1523)
        at processing.core.PApplet.handleDraw(PApplet.java:1936)
        at processing.core.PApplet.run(PApplet.java:1812)
        at java.lang.Thread.run(Unknown Source)

So, the first time the renderer tries to release the context, at the end of the first frame, it turns out that it is not current, but... I can assure that we call context.makeCurrent() at the beginning, so it is not clear to me why the context is not current.

On the other hand, until now in Processing we were using a rendering mechanism where the opengl context was manually created inside Processing's animation thread (so we didn't use any GLCanvas object)... this approach was working (although with the error in windows), but from what I read it is recommended that OpenGL runs within AWT's EDT thread. I just changed the rendering logic in Processing, this time using GLCanvas, GLEventListener and no explicit GLContext, and everything appears to work fine, this time without any error.