diff options
author | Sven Gothel <[email protected]> | 2012-10-08 01:55:22 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-10-08 01:55:22 +0200 |
commit | 455fed40391afe10ce5ffb9146ca325af63b0a49 (patch) | |
tree | 925ecae592d59fffe89780100619b455efd9c80e /src/jogl/classes/com/jogamp | |
parent | d10dae464ef9309a92eb9b49323fe1db93c3fc9f (diff) |
Fix GLDrawable.swapBuffer() implementation in AWT/SWT GLCanvas and GLAutoDrawableBase
Simply lock drawable and issue drawable.swapBuffers(), no need to make context current.
Diffstat (limited to 'src/jogl/classes/com/jogamp')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java b/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java index 24971ff97..73d3cd01e 100644 --- a/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java +++ b/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java @@ -153,24 +153,16 @@ public class GLCanvas extends Canvas implements GLAutoDrawable { }; /* Swaps buffers, assuming the GLContext is current */ - private final Runnable swapBuffersAction = new Runnable() { + private final Runnable swapBuffersOnEDTAction = new Runnable() { @Override public void run() { - drawable.swapBuffers(); - } - }; - - /* Swaps buffers, making the GLContext current first */ - private final Runnable makeCurrentAndSwapBuffersOnEDTAction = new Runnable() { - @Override - public void run() { - final RecursiveLock _lock = lock; - _lock.lock(); - try { - helper.invokeGL(drawable, context, swapBuffersAction, initAction); - } finally { - _lock.unlock(); - } + final RecursiveLock _lock = lock; + _lock.lock(); + try { + drawable.swapBuffers(); + } finally { + _lock.unlock(); + } } }; @@ -627,7 +619,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable { @Override public void swapBuffers() throws GLException { - runInGLThread(makeCurrentAndSwapBuffersOnEDTAction); + runInGLThread(swapBuffersOnEDTAction); } @Override |