summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-01-27 04:32:01 +0100
committerSven Gothel <[email protected]>2013-01-27 04:32:01 +0100
commit02104525a63aed70c51b825be0e8c83ed17cfa31 (patch)
tree2e3d1b0509df2dd750ec344e5e2d0ce62bdc5a85 /src/jogl/classes/com/jogamp
parent07fb6ebb3fa95e8d722505883a13c62e13c7f953 (diff)
Animator: API doc cleanup, isPaused()==true if drawablesEmpty (Animator == FPSAnimator behavior), resume after add ifPaused()
- GLAnimatorControl: Refine API doc - Animator.run(): - if( drawablesEmpt) { pausedIssued = true; } - Same behavior as FPSAnimator - AnimatorBase.add(..) - consider paused case if no drawablesEmpty, i.e. if ( isPaused() ) { resume(); }
Diffstat (limited to 'src/jogl/classes/com/jogamp')
-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() {