Class FPSAnimator

java.lang.Object
com.jogamp.opengl.util.AnimatorBase
com.jogamp.opengl.util.FPSAnimator
All Implemented Interfaces:
FPSCounter, GLAnimatorControl

public class FPSAnimator extends AnimatorBase
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.

The Animator execution thread does not run as a daemon thread, so it is able to keep an application from terminating.
Call stop() to terminate the animation and it's execution thread.

  • Constructor Details

    • FPSAnimator

      public FPSAnimator(int fps)
      Creates an FPSAnimator with a given target frames-per-second value. Equivalent to FPSAnimator(null, fps).
    • FPSAnimator

      public FPSAnimator(int fps, boolean scheduleAtFixedRate)
      Creates an FPSAnimator with a given target frames-per-second value and a flag indicating whether to use fixed-rate scheduling. Equivalent to FPSAnimator(null, fps, scheduleAtFixedRate).
    • FPSAnimator

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

      public FPSAnimator(GLAutoDrawable drawable, int fps, boolean scheduleAtFixedRate)
      Creates an FPSAnimator with a given target frames-per-second value, an initial drawable to animate, and a flag indicating whether to use fixed-rate scheduling.
  • Method Details