aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-04-23 02:10:28 +0200
committerSven Gothel <[email protected]>2010-04-23 02:10:28 +0200
commitb62a3af2d58ff52c0341f04cdc21d069a8051d31 (patch)
tree3c491020bafd650ebe3a09f4bcbc1c6d94c1f1be /src
parent2151f2179cd1ce5f0d42c3514af11a9c235762db (diff)
parent56679ab5373dc47286f741f07aeab4ec1f39c43b (diff)
Merge branch 'master' of github.com:mbien/jogl
Diffstat (limited to 'src')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenDrawable.java24
-rw-r--r--src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java7
-rw-r--r--src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawable.java14
-rw-r--r--src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawable.java34
-rwxr-xr-xsrc/newt/classes/com/jogamp/newt/Window.java2
5 files changed, 37 insertions, 44 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
diff --git a/src/newt/classes/com/jogamp/newt/Window.java b/src/newt/classes/com/jogamp/newt/Window.java
index 3d7d1e5da..d0977f4e4 100755
--- a/src/newt/classes/com/jogamp/newt/Window.java
+++ b/src/newt/classes/com/jogamp/newt/Window.java
@@ -319,8 +319,8 @@ public abstract class Window implements NativeWindow
keyListeners = new ArrayList();
}
synchronized(this) {
+ destructionLock.lock();
try {
- destructionLock.lock();
Display dpy = null;
if( null != screen && 0 != windowHandle ) {
Screen scr = screen;