com.sun.opengl.utils
Class FPSAnimator

java.lang.Object
  extended bycom.sun.opengl.utils.Animator
      extended bycom.sun.opengl.utils.FPSAnimator

public class FPSAnimator
extends Animator

An Animator subclass which attempts to achieve a target frames-per-second rate to avoid using all CPU time. The target FPS is only an estimate and is not guaranteed.


Field Summary
 
Fields inherited from class com.sun.opengl.utils.Animator
ignoreExceptions, printExceptions
 
Constructor Summary
FPSAnimator(GLAutoDrawable drawable, int fps)
          Creates an FPSAnimator with a given target frames-per-second value and an initial drawable to animate.
FPSAnimator(int fps)
          Creates an FPSAnimator with a given target frames-per-second value.
 
Method Summary
 boolean isAnimating()
          Indicates whether this FPSAnimator is currently running.
 void start()
          Starts this FPSAnimator.
 void stop()
          Stops this FPSAnimator.
 
Methods inherited from class com.sun.opengl.utils.Animator
add, display, drawableIterator, remove, setIgnoreExceptions, setPrintExceptions, setRunAsFastAsPossible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FPSAnimator

public FPSAnimator(int fps)
Creates an FPSAnimator with a given target frames-per-second value.


FPSAnimator

public FPSAnimator(GLAutoDrawable drawable,
                   int fps)
Creates an FPSAnimator with a given target frames-per-second value and an initial drawable to animate.

Method Detail

start

public void start()
Starts this FPSAnimator.

Overrides:
start in class Animator

isAnimating

public boolean isAnimating()
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.

Overrides:
isAnimating in class Animator

stop

public void stop()
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.

Overrides:
stop in class Animator