diff options
author | Kenneth Russel <[email protected]> | 2005-05-07 00:45:24 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-05-07 00:45:24 +0000 |
commit | 7b17f6f020c4c58c50e42da800a1ceb34a5b3cbf (patch) | |
tree | b3506dd03239e2ebd641b6300d27a1a751effae3 /src/demos/jgears | |
parent | e5f602657d568b8a3ad6ac784f2d8d08921f46af (diff) |
Fixed Issue 151: starting up the Animator before the GLJPanel has been shown result in an error
The root cause of this error was the fact that
WindowsPbufferGLContext.destroyImpl() uses WGL extensions to clean up
resources associated with the pbuffer. Because these extensions are in
the public WGL interface, they are wrapped by the DebugGL. However, an
OpenGL context is not current at the time these routines are called,
and it is illegal to call glGetError() at those points. The DebugGL
pipeline was implicitly calling glGetError() after each of those
calls, leading to the failure.
This bug unmasked a couple of others. The code in the DebugGL needed a
recursion count to make sure that glGetError() didn't get called in an
infinite loop. Also, as a side effect of the fix for Issue 160,
calling getGL() on the GLJPanel outside of GLEventListener.init() was
causing a NullPointerException to be thrown. The GLJPanel has been
fixed to return null in this case, and the specification of
GLDrawable.getGL() has been improved. In order to make the behavior
between the GLCanvas and GLJPanel similar, the GL object is now reset
in the GLDrawable each time the underlying OpenGL context is
recreated. This allows end users to set up e.g. the DebugGL
unconditionally in their GLEventListener.init() method. The JOGL demos
have been changed to reflect this.
The test case in the bug report will be updated with code similar to
the originally submitted test case (i.e., the Animator is started
early) but which now works.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@71 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos/jgears')
-rw-r--r-- | src/demos/jgears/JGears.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/demos/jgears/JGears.java b/src/demos/jgears/JGears.java index 6adc528..ee0690c 100644 --- a/src/demos/jgears/JGears.java +++ b/src/demos/jgears/JGears.java @@ -17,11 +17,6 @@ public class JGears { Frame frame = new Frame("Gear Demo"); GLJPanel drawable = GLDrawableFactory.getFactory().createGLJPanel(new GLCapabilities()); - // Use debug pipeline - // drawable.setGL(new DebugGL(drawable.getGL())); - System.err.println("DRAWABLE GL IS: " + drawable.getGL().getClass().getName()); - System.err.println("DRAWABLE GLU IS: " + drawable.getGLU().getClass().getName()); - drawable.addGLEventListener(new GearRenderer()); frame.add(drawable); frame.setSize(300, 300); @@ -53,6 +48,9 @@ public class JGears { public void init(GLDrawable drawable) { + // Use debug pipeline + // drawable.setGL(new DebugGL(drawable.getGL())); + GL gl = drawable.getGL(); System.err.println("INIT GL IS: " + gl.getClass().getName()); |