Class ApplicationTimer

java.lang.Object
dev.prozilla.pine.core.state.ApplicationTimer
All Implemented Interfaces:
Lifecycle

public class ApplicationTimer extends Object implements Lifecycle
Manages time tracking, including FPS (frames per second) and UPS (updates per second) calculations.
  • Field Details

    • timeScale

      public float timeScale
      The scale at which time passes.
  • Constructor Details

    • ApplicationTimer

      public ApplicationTimer()
  • Method Details

    • init

      public void init()
      Description copied from interface: Lifecycle
      Initializes the object before the game loop starts.
      Specified by:
      init in interface Lifecycle
    • update

      public void update()
      Updates the timer's delta values and elapsed time values.
      Specified by:
      update in interface Lifecycle
    • incrementFPS

      public void incrementFPS()
    • incrementUPS

      public void incrementUPS()
    • checkCounters

      public void checkCounters()
      Updates FPS and UPS if a whole second has passed.
    • getFPS

      public int getFPS()
      Returns:
      Frames per second
    • getUPS

      public int getUPS()
      Returns:
      Updates per second
    • getCurrentTime

      public double getCurrentTime()
      Returns:
      Time elapsed since GLFW was initialized in seconds.
    • getScaledElapsedTime

      public float getScaledElapsedTime()
    • getDeltaTime

      public float getDeltaTime()
    • getScaledDeltaTime

      public float getScaledDeltaTime()