diff options
author | Sven Gothel <[email protected]> | 2010-04-23 02:10:28 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-04-23 02:10:28 +0200 |
commit | b62a3af2d58ff52c0341f04cdc21d069a8051d31 (patch) | |
tree | 3c491020bafd650ebe3a09f4bcbc1c6d94c1f1be /src/jogl | |
parent | 2151f2179cd1ce5f0d42c3514af11a9c235762db (diff) | |
parent | 56679ab5373dc47286f741f07aeab4ec1f39c43b (diff) |
Merge branch 'master' of github.com:mbien/jogl
Diffstat (limited to 'src/jogl')
4 files changed, 36 insertions, 43 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenDrawable.java index 3286367e5..3864fc39c 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenDrawable.java @@ -60,21 +60,19 @@ public class EGLOnscreenDrawable extends EGLDrawable { protected void swapBuffersImpl() { boolean didLock = false; + if (!isSurfaceLocked()) { + // Usually the surface shall be locked within [makeCurrent .. swap .. release] + if (lockSurface() == NativeWindow.LOCK_SURFACE_NOT_READY) { + return; + } + didLock = true; + } try { - if ( !isSurfaceLocked() ) { - // Usually the surface shall be locked within [makeCurrent .. swap .. release] - if (lockSurface() == NativeWindow.LOCK_SURFACE_NOT_READY) { - return; - } - didLock = true; - } - - EGL.eglSwapBuffers(eglDisplay, eglSurface); - + EGL.eglSwapBuffers(eglDisplay, eglSurface); } finally { - if(didLock) { - unlockSurface(); - } + if (didLock) { + unlockSurface(); + } } } diff --git a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java index 5816b2101..cf29d214b 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java @@ -87,11 +87,8 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl { if( NativeWindow.LOCK_SURFACE_NOT_READY == lockSurface() ) { throw new GLException("Couldn't lock surface"); } - try { - // don't remove this block .. locking the surface is essential to update surface data - } finally { - unlockSurface(); - } + // locking the surface is essential to update surface data + unlockSurface(); } } diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawable.java index fe0945139..43c1ff5e0 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawable.java @@ -83,14 +83,14 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl { protected void swapBuffersImpl() { boolean didLock = false; - try { - if ( !isSurfaceLocked() ) { - // Usually the surface shall be locked within [makeCurrent .. swap .. release] - if (lockSurface() == NativeWindow.LOCK_SURFACE_NOT_READY) { - return; - } - didLock = true; + if ( !isSurfaceLocked() ) { + // Usually the surface shall be locked within [makeCurrent .. swap .. release] + if (lockSurface() == NativeWindow.LOCK_SURFACE_NOT_READY) { + return; } + didLock = true; + } + try { long startTime = 0; if (PROFILING) { diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawable.java index 2dabe774c..95dfc0a1c 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawable.java @@ -73,25 +73,23 @@ public abstract class X11GLXDrawable extends GLDrawableImpl { } } - protected void swapBuffersImpl() { - boolean didLock = false; - try { - if ( !isSurfaceLocked() ) { - // Usually the surface shall be locked within [makeCurrent .. swap .. release] - if (lockSurface() == NativeWindow.LOCK_SURFACE_NOT_READY) { - return; - } - didLock=true; - } - - GLX.glXSwapBuffers(component.getDisplayHandle(), component.getSurfaceHandle()); - - } finally { - if(didLock) { - unlockSurface(); - } + protected void swapBuffersImpl() { + boolean didLock = false; + if (!isSurfaceLocked()) { + // Usually the surface shall be locked within [makeCurrent .. swap .. release] + if (lockSurface() == NativeWindow.LOCK_SURFACE_NOT_READY) { + return; + } + didLock = true; + } + try { + GLX.glXSwapBuffers(component.getDisplayHandle(), component.getSurfaceHandle()); + } finally { + if (didLock) { + unlockSurface(); + } + } } - } //--------------------------------------------------------------------------- // Internals only below this point |