aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/Animator.java3
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/Animator.java b/src/jogl/classes/com/jogamp/opengl/util/Animator.java
index 10f43a0c1..22832f6bd 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/Animator.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/Animator.java
@@ -157,6 +157,9 @@ public class Animator extends AnimatorBase {
// Pause; Also don't consume CPU unless there is work to be done and not paused
boolean ectCleared = false;
while (!stopIssued && (pauseIssued || drawablesEmpty)) {
+ if( drawablesEmpty ) {
+ pauseIssued = true;
+ }
boolean wasPaused = pauseIssued;
if (DEBUG) {
System.err.println("Animator pause:" + Thread.currentThread() + ": " + toString());
diff --git a/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java b/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
index bda716e97..53a99b640 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
@@ -179,14 +179,14 @@ public abstract class AnimatorBase implements GLAnimatorControl {
throw new IllegalArgumentException("Drawable already added to animator: "+this+", "+drawable);
}
initImpl(false);
- boolean paused = pause();
+ pause();
if( isStarted() ) {
drawable.setExclusiveContextThread( exclusiveContext ? getExclusiveContextThread() : null ); // if already running ..
}
drawables.add(drawable);
drawablesEmpty = drawables.size() == 0;
drawable.setAnimator(this);
- if(paused) {
+ if( isPaused() ) { // either paused by pause() above, or if previously drawablesEmpty==true
resume();
}
final Condition waitForAnimatingAndECTCondition = new Condition() {