Package dev.prozilla.pine.core.state
Class ApplicationTimer
java.lang.Object
dev.prozilla.pine.core.state.ApplicationTimer
- All Implemented Interfaces:
Lifecycle
Manages time tracking, including FPS (frames per second) and UPS (updates per second) calculations.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
timeScale
public float timeScaleThe 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. -
update
public void update()Updates the timer's delta values and elapsed time values. -
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()
-