The Time class provides static utility functions and variables to manage frame timing, delta time computation, frame rate regulation, and tracking the elapsed game time. It is designed to be a singleton-style class with only static members and no instances.
More...
#include <Time.h>
|
static unsigned int | ComputeDeltaTime () |
| Computes the time elapsed since the last frame (delta time), clamps it to a maximum to prevent instability, and stores it in deltaTime .
|
|
static void | DelayTime () |
| Delays the frame if it finished too early, in order to maintain a consistent frame rate defined by FPS.
|
|
static float | GetGameTime () |
| Returns the total time elapsed since the game started.
|
|
|
static float | deltaTime = 0 |
| Delta time (in seconds) between the current and previous frame.
|
|
The Time class provides static utility functions and variables to manage frame timing, delta time computation, frame rate regulation, and tracking the elapsed game time. It is designed to be a singleton-style class with only static members and no instances.
◆ Time() [1/2]
◆ Time() [2/2]
Time::Time |
( |
const Time & | | ) |
|
|
delete |
◆ ComputeDeltaTime()
unsigned int Time::ComputeDeltaTime |
( |
| ) |
|
|
static |
Computes the time elapsed since the last frame (delta time), clamps it to a maximum to prevent instability, and stores it in deltaTime
.
- Returns
- Delta time in milliseconds (clamped to MAX_DT).
◆ DelayTime()
Delays the frame if it finished too early, in order to maintain a consistent frame rate defined by FPS.
◆ GetGameTime()
float Time::GetGameTime |
( |
| ) |
|
|
static |
Returns the total time elapsed since the game started.
- Returns
- Elapsed game time in seconds.
◆ operator=()
◆ deltaTime
float Time::deltaTime = 0 |
|
static |
Delta time (in seconds) between the current and previous frame.
The documentation for this class was generated from the following files: