summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/net/java/games/jogl/Animator.java8
-rwxr-xr-xsrc/net/java/games/jogl/FPSAnimator.java8
2 files changed, 16 insertions, 0 deletions
diff --git a/src/net/java/games/jogl/Animator.java b/src/net/java/games/jogl/Animator.java
index ac6248487..c1f311e04 100644
--- a/src/net/java/games/jogl/Animator.java
+++ b/src/net/java/games/jogl/Animator.java
@@ -213,6 +213,14 @@ public class Animator {
thread.start();
}
+ /** Indicates whether this animator is currently running. This
+ should only be used as a heuristic to applications because in
+ some circumstances the Animator may be in the process of
+ shutting down and this method will still return true. */
+ public synchronized boolean isAnimating() {
+ return (thread != null);
+ }
+
/** Stops this animator. In most situations this method blocks until
completion, except when called from the animation thread itself
or in some cases from an implementation-internal thread like the
diff --git a/src/net/java/games/jogl/FPSAnimator.java b/src/net/java/games/jogl/FPSAnimator.java
index 311a9b722..9d596fe86 100755
--- a/src/net/java/games/jogl/FPSAnimator.java
+++ b/src/net/java/games/jogl/FPSAnimator.java
@@ -77,6 +77,14 @@ public class FPSAnimator extends Animator {
}, 0, delay);
}
+ /** Indicates whether this FPSAnimator is currently running. This
+ should only be used as a heuristic to applications because in
+ some circumstances the FPSAnimator may be in the process of
+ shutting down and this method will still return true. */
+ public synchronized boolean isAnimating() {
+ return (timer != null);
+ }
+
/** Stops this FPSAnimator. Due to the implementation of the
FPSAnimator it is not guaranteed that the FPSAnimator will be
completely stopped by the time this method returns. */