summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-10-27 16:27:35 +0200
committerSven Gothel <[email protected]>2010-10-27 16:27:35 +0200
commite6131c6b2cbf8d1e5a05f0343612f5083b55aaa9 (patch)
tree69f0425b9400408041859562448e10b354778527 /src/jogl/classes/com
parenta42017128a0e5a24b5852151efdf496059ca6a5d (diff)
GLAnimatorControl/Animator: Allow stop() if paused()
Diffstat (limited to 'src/jogl/classes/com')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/Animator.java14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/Animator.java b/src/jogl/classes/com/jogamp/opengl/util/Animator.java
index 2b8876a91..ecb3878ba 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/Animator.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/Animator.java
@@ -40,14 +40,10 @@
package com.jogamp.opengl.util;
-import javax.media.opengl.GLAnimatorControl;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLException;
-import javax.media.opengl.GLProfile;
-import com.jogamp.opengl.impl.Debug;
-import java.util.*;
/** <P> An Animator can be attached to one or more {@link
@@ -154,9 +150,9 @@ public class Animator extends AnimatorBase {
}
}
}
- if ( !shouldStop ) {
+ if ( !shouldStop && !shouldPause) {
display();
- if (!runAsFastAsPossible) {
+ if ( !runAsFastAsPossible) {
// Avoid swamping the CPU
Thread.yield();
}
@@ -219,8 +215,8 @@ public class Animator extends AnimatorBase {
public synchronized void stop() {
boolean started = null != thread;
- if ( !started || !isAnimating ) {
- throw new GLException("Not running (started "+started+" (true), animating "+isAnimating+" (true) )");
+ if ( !started ) {
+ throw new GLException("Not started");
}
shouldStop = true;
notifyAll();
@@ -230,7 +226,7 @@ public class Animator extends AnimatorBase {
// use a couple of heuristics to determine whether we should do
// the blocking wait().
if (!impl.skipWaitForCompletion(thread)) {
- while (isAnimating && thread != null) {
+ while (thread != null) {
try {
wait();
} catch (InterruptedException ie) {