problems wit swapBuffers()

Hi,

for a progressive rendering algorithm I need the swapBuffers() function, which should work in the new release.
Unfortunately, when I try to use swapBuffers() in a really simple
context (just some geometry and the swap afterwards) it crashes in the display() after calling:
drawable.setAutoSwapBufferMode( false );
drawable.swapBuffers();

I essentially want to make sure the swapping works fine, before I change
my whole system from gl4java to jogl.
What am I doing wrong? Is it not ok to use swapBuffers() in the
display function?
I am running Linux Redhat 9 and the jogl release from 29th of April.

output:
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 11 occurred at PC=0x4D0F6A77
Function=XQueryExtension+0x17
Library=/usr/X11R6/lib/libX11.so.6

Current Java thread:
at net.java.games.jogl.impl.x11.GLX.glXMakeCurrent(Native Method)
at net.java.games.jogl.impl.x11.X11GLContext.free(X11GLContext.java:165)
- locked <0x445f6ca0> (a net.java.games.jogl.impl.x11.X11OnscreenGLContext)
at net.java.games.jogl.impl.x11.X11OnscreenGLContext.free(X11OnscreenGLContext.java:133)
- locked <0x445f6ca0> (a net.java.games.jogl.impl.x11.X11OnscreenGLContext)
at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:271)
- locked <0x445f6ca0> (a net.java.games.jogl.impl.x11.X11OnscreenGLContext)
at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:186)
at net.java.games.jogl.GLCanvas.display(GLCanvas.java:74)
at net.java.games.jogl.GLCanvas.paint(GLCanvas.java:81)
at sun.awt.RepaintArea.paint(RepaintArea.java:177)
at sun.awt.motif.MComponentPeer.handleEvent(MComponentPeer.java:405)
at java.awt.Component.dispatchEventImpl(Component.java:3678)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

Thanks for your help.
cheers,
kristian

No, swapBuffers() should be called outside of the display() method. For example, your rendering loop might look like:

GLCanvas vCanvas = getGLCanvas();
vCanvas.setAutoSwapBufferMode(false);

while (vIsRunning)
{
vCanvas.display();
vCanvas.swapBuffers();
}

Sean

swapBuffers() was written in such a way that it shouldn’t matter whether you call it from within your display() method or not. However, there were bugs up until fairly recently with the context handling that makes this true. I’m not sure whether we did a release yet with the latest code. Please try checking out the code from CVS and building it. We’ll try to do another release on all platforms soon.