summaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-11-22 12:46:19 +0100
committerSven Gothel <[email protected]>2010-11-22 12:46:19 +0100
commit4c3e9e258fae1161949dd14828c09f387bfd53d9 (patch)
treea8b287153f6afbf166db85506af4c3790590663d /src/newt/classes/com
parent6a3ccca96e6d4c27c372b4b9ba1e8fcee6def402 (diff)
GLAnimatorControl pause()/resume() don't fail fast, return a boolean instead to simplify usage.
Diffstat (limited to 'src/newt/classes/com')
-rw-r--r--src/newt/classes/com/jogamp/newt/opengl/GLWindow.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index da22a6217..0f96facbd 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -89,11 +89,11 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
if (GLWindow.this.helper.isExternalAnimatorRunning()) {
// Pause animations before initiating safe destroy.
GLAnimatorControl ctrl = GLWindow.this.helper.getAnimator();
- ctrl.pause();
-
+ boolean isPaused = ctrl.pause();
destroy();
-
- ctrl.resume();
+ if(isPaused) {
+ ctrl.resume();
+ }
} else if (GLWindow.this.window.isSurfaceLockedByOtherThread()) {
// Surface is locked by another thread
// Flag that destroy should be performed on the next
@@ -386,9 +386,8 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
public synchronized boolean pauseRenderingAction() {
boolean animatorPaused = false;
GLAnimatorControl ctrl = GLWindow.this.getAnimator();
- if ( null!=ctrl && ctrl.isStarted() && !ctrl.isPaused()) {
- animatorPaused = true;
- ctrl.pause();
+ if ( null!=ctrl ) {
+ animatorPaused = ctrl.pause();
}
return animatorPaused;
}