redraw after reshape, swapBuffer() gives Exception

Hi another problem I have with the new (great) version of jogl:

When I resize my Window, the content will be drawn grey, that means nothing is painted after the reshape call, but the display funtion is called.

When I resize agein, the window is cleared…again the window is grey…and so on.

The old release does not have this problem…does anybody have an idea?

Another stupid question:

I set setAutoSwapBufferMode(false) and called glDrawable.swapBuffers() at the end of my display function, this gives me the exception:

net.java.games.jogl.GLException: Surface already unlocked
at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.unlockSurface(WindowsOnscreenGLContext.java:192)
at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.free(WindowsOnscreenGLContext.java:134)
at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:271)
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.windows.WComponentPeer.handleEvent(WComponentPeer.java:260)
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)

What I’m doing wrong?

Thanks alot…

Could you please file an issue (Issue Tracker off the JOGL web page) and attach a test case?

I guess this is something same/similar to the issue #78 I filed few days ago.

Yuri

His test program pushes the same context on the stack twice by calling swapbuffers in display() and is then freed twice, the second time obviously produces the surface locking error since it is already free from the first time it was popped off the stack.

The code in GLContext.invokeGL() which keeps track of which GLDrawables are in the process of rendering on the current thread was buggy. This code was added to enable swapBuffers() to be exposed and to allow the setRenderingThread() optimization to be handled in the same way as calling one drawable’s display() method while executing display() of another. However it became too complicated which led to bugs.

The code has been restructured and simplified; the new code works properly with the test case from Issue 80 and I believe it will also fix Issue 78. Please retest with nightly builds dated April 31 or later. The fix will be present in the forthcoming JOGL 1.1 beta 04.

Many thanks!!!

swapBuffer() works now fine without Exception.

But the reshape problem is still alive, or can’t you see the problem on your machine?

I don’t see the reshape problem. What videocard are you using?

Hmmm… happens on my Notebook with Intel 82852/82855 GM/GME Graphics Controller under Windows XP Professional.

I checked out my other PC with NVIDOS RIVA TNT2 and there this problem occurs not…

I installed latest driver on my Notebook without any change, somtimes after resizing the window, the content is not drawn (or visible), what I’m wondering about is, that this happens not with the Release 2003 build of jogl, what has changed???

It’s hard to know what could have triggered this change. JOGL’s internal GL context handling has been rewritten and there have definitely been some bugs (including the one you pointed out above). The other major change on the Windows side is the use of the OS’s recommended pixel format. I wonder whether something could be going wrong here. Could you try copying the DefaultGLCapabilitiesChooser into a new file, comment out the first “if” block (dealing with the variable windowSystemRecommendedChoice), and use that chooser instead of the default one? If so, please post and let us know whether there is any change in behavior.

I can confirm that updating to current CVS version of JOGL fixes Issue #78.

Yuri