diff options
author | Kenneth Russel <[email protected]> | 2005-08-18 05:44:58 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-08-18 05:44:58 +0000 |
commit | 967720b06e366cea635090ad0395758f91957d1b (patch) | |
tree | e4f3e7f874ae43e58444ecc032f5ac4ddaee62ae /src/net/java/games | |
parent | 25e37b6d9e27a5d3dc8caed49087f1a1e4904c4e (diff) |
Fixed bug in X11OnscreenGLDrawable.swapBuffers() when surface was not
locked
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JSR-231@349 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net/java/games')
-rw-r--r-- | src/net/java/games/jogl/impl/x11/X11OnscreenGLDrawable.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/net/java/games/jogl/impl/x11/X11OnscreenGLDrawable.java b/src/net/java/games/jogl/impl/x11/X11OnscreenGLDrawable.java index 0b66c51a7..a8308cf13 100644 --- a/src/net/java/games/jogl/impl/x11/X11OnscreenGLDrawable.java +++ b/src/net/java/games/jogl/impl/x11/X11OnscreenGLDrawable.java @@ -92,8 +92,25 @@ public class X11OnscreenGLDrawable extends X11GLDrawable { public void swapBuffers() throws GLException { lockAWT(); - GLX.glXSwapBuffers(display, drawable); + try { + boolean didLock = false; + + if (drawable == 0) { + if (lockSurface() == LOCK_SURFACE_NOT_READY) { + return; + } + + didLock = true; + } + + GLX.glXSwapBuffers(display, drawable); + + if (didLock) { + unlockSurface(); + } + } finally { unlockAWT(); + } } public int lockSurface() throws GLException { |