Game timing and frame rate management. More...
Functions | |
| void | Time_PreUpdate () |
| [PreUpdate] Updates the time system values | |
| void | Time_UpdateFPS () |
| [Utility] Updates the FPS counter | |
| void | Time_SetTimeScale (float scale) |
| [Utility] Sets the time scale. | |
| void | Time_ResetTotalTime () |
| [Utility] Resets the total time elapsed in the program. | |
Variables | |
| TimeSystem | time |
| [Data] The initialization of the time system | |
| const TimeSystem *const | Time = &time |
| Global read-only time system pointer for other modules. | |
Game timing and frame rate management.
Handles game timing, delta time calculation, and frame rate tracking to ensure consistent gameplay across different hardware.
| void Time_PreUpdate | ( | ) |
[PreUpdate] Updates the time system values
Called at the beginning of each frame to calculate delta time and other time-related metrics. Caps deltaTime to prevent spiral of death if the game freezes temporarily.
| void Time_ResetTotalTime | ( | ) |
[Utility] Resets the total time elapsed in the program.
Zeroes out the accumulated program time, useful for timing specific operations or resetting game timers.
| void Time_SetTimeScale | ( | float | scale | ) |
[Utility] Sets the time scale.
Adjusts the game's time scale, which can speed up or slow down the entire game. A value of 1.0 is normal speed, while 2.0 would be double speed and 0.5 would be half speed.
| scale | The scale to set the time to. |
| void Time_UpdateFPS | ( | ) |
[Utility] Updates the FPS counter
Calculates average FPS over different time scales to monitor performance metrics for the game.
| TimeSystem time |
[Data] The initialization of the time system
| const TimeSystem* const Time = &time |
Global read-only time system pointer for other modules.