Deki Engine timing system.
More...
#include <DekiTime.h>
|
| static void | Initialize () |
| | Initialize the timing system Should be called once at engine startup.
|
| static uint32_t | GetTime () |
| | Get current time in milliseconds.
|
| static uint32_t | GetElapsed (uint32_t previous_time) |
| | Get elapsed time since a previous timestamp.
|
| static void | Update (uint32_t deltaTime) |
| | Update the timing system Should be called once per frame.
|
| static uint32_t | GetDeltaTime () |
| | Get the last frame delta time.
|
| static float | GetDeltaTimeF () |
| | Get the last frame delta time as float (high precision).
|
| static void | UpdateF (float delta_time_ms) |
| | Update with float delta time for high precision (used by editor FPS limiter).
|
| static float | GetFPS () |
| | Get frames per second.
|
| static void | ResetFrameTime () |
| | Reset frame time after loading Call after loading a scene to prevent huge deltaTime from accumulated loading time.
|
| static void | SetDelayFunction (std::function< void(uint32_t)> fn) |
| | Register the platform-specific sleep implementation.
|
| static void | Delay (uint32_t ms) |
| | Sleep for ms milliseconds using the registered delay function.
|
| static void | SetTimeProvider (std::unique_ptr< ITimeProvider > provider) |
| | Set the platform-specific time provider.
|
Deki Engine timing system.
Provides platform-independent timing functionality for the engine. All time values are in milliseconds for consistency.
◆ Initialize()
| void DekiTime::Initialize |
( |
| ) |
|
|
static |
Initialize the timing system Should be called once at engine startup.
◆ GetTime()
| uint32_t DekiTime::GetTime |
( |
| ) |
|
|
static |
Get current time in milliseconds.
- Returns
- Current time since initialization in milliseconds
◆ GetElapsed()
| uint32_t DekiTime::GetElapsed |
( |
uint32_t | previous_time | ) |
|
|
static |
Get elapsed time since a previous timestamp.
- Parameters
-
| previous_time | Previous time value from GetTime() |
- Returns
- Elapsed time in milliseconds
◆ Update()
| void DekiTime::Update |
( |
uint32_t | deltaTime | ) |
|
|
static |
Update the timing system Should be called once per frame.
- Parameters
-
| deltaTime | Frame delta time in milliseconds |
◆ GetDeltaTime()
| uint32_t DekiTime::GetDeltaTime |
( |
| ) |
|
|
static |
Get the last frame delta time.
- Returns
- Delta time of last frame in milliseconds
◆ GetDeltaTimeF()
| float DekiTime::GetDeltaTimeF |
( |
| ) |
|
|
static |
Get the last frame delta time as float (high precision).
- Returns
- Delta time of last frame in milliseconds with sub-ms precision
◆ UpdateF()
| void DekiTime::UpdateF |
( |
float | delta_time_ms | ) |
|
|
static |
Update with float delta time for high precision (used by editor FPS limiter).
- Parameters
-
| delta_time_ms | Frame delta time in milliseconds (float for sub-ms precision) |
◆ GetFPS()
| float DekiTime::GetFPS |
( |
| ) |
|
|
static |
Get frames per second.
- Returns
- Current FPS
◆ ResetFrameTime()
| void DekiTime::ResetFrameTime |
( |
| ) |
|
|
static |
Reset frame time after loading Call after loading a scene to prevent huge deltaTime from accumulated loading time.
◆ SetDelayFunction()
| void DekiTime::SetDelayFunction |
( |
std::function< void(uint32_t)> | fn | ) |
|
|
static |
Register the platform-specific sleep implementation.
Called during platform init before RunMainLoop begins.
◆ Delay()
| void DekiTime::Delay |
( |
uint32_t | ms | ) |
|
|
static |
Sleep for ms milliseconds using the registered delay function.
No-op if no function has been registered.
◆ SetTimeProvider()
| void DekiTime::SetTimeProvider |
( |
std::unique_ptr< ITimeProvider > | provider | ) |
|
|
static |
Set the platform-specific time provider.
Must be called before Initialize().
- Parameters
-
| provider | The time provider implementation (takes ownership) |
The documentation for this class was generated from the following file: