GLException: Error Swapping Buffers

GLException: Error Swapping Buffers

I keep getting something like this when my program exits. I do try to stop the animator, but Ctrl^C seems to break things too…

Is there some synchronization that I’m not doing for JOGL?

Any help appreciated,

Kev

I am getting the same error as well.

Here is the stack trace:

net.java.games.jogl.GLException: Error swapping buffers
      at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.swapBuffers(WindowsOnscreenGLContext.java:140)
      at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:193)
      at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:196)
      at net.java.games.jogl.GLCanvas.display(GLCanvas.java:91)
      at net.java.games.jogl.Animator$1.run(Animator.java:104)
      at java.lang.Thread.run(Unknown Source)

Hope this helps,

Zak

It doesn’t exactly help, but its sorta good to know I’m not he only one :wink:

I’ve found upgrading my driver has preventing it just hanging the VM. I now get the exception then an end.

Running with ATI Radeon Mobility 9000, WinXP.

Kev

I can confirm this.
When I terminate my Java application (which uses a GlCanvas in an AWT frame) in the console with ^C the above error is reported.
When I quit the application gently via its exit method (which stops the Animator), it quits cleanly without an error.

But … I get strange errors when hitting the ALT key during the application which sets an keylistener to the GlCanvas; please see http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=jogl;action=display;num=1058949563
(and I still haven’t got the slightest idea why)

I get this if I try to access the GL object from another thread. I’ve just designed my game around it and throw RuntimeExceptions if something does a GL thing at the wrong time, making it easier to spot the causes.

As for exiting, have you tried setting a shutdown hook to exit cleanly regardless of how the JVM goes down?

[quote]As for exiting, have you tried setting a shutdown hook to exit cleanly regardless of how the JVM goes down?
[/quote]
As I’ve said elsewhere, I’ve been updating the Magician bindings. I’ve really struggled with the “proper shutdown” problem (WinXP, Sun JDK 1.4.x). I had thought my implementation was working, but it was failing silently.

Running the registered shutdown Runnables is the last thing the JVM does, meaning the AWT stuff has already gone bye-bye. So my GLComponent’s destoy() method, which deletes the GL context then unlocks AWT, fails. Sometimes with an error 170 (resource not ready), sometimes with an ABEND.

There’s probably a simple solution, but I haven’t been clever enough to find it.