summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2005-08-29 15:40:31 +0000
committerKenneth Russel <[email protected]>2005-08-29 15:40:31 +0000
commit8c99f91eeca27b410ac81bcdfc19f46b517bde1c (patch)
tree72c6c86d0b5f4985c86fdfc22a4a10084ac47640 /src
parentd8be0742b129cc21589c1963a8dd389519449d55 (diff)
Added isAnimating() on request of AK77 on JOGL forums
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JSR-231@355 232f8b59-042b-4e1e-8c03-345bb8c30851
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. */