Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches

Deki Engine timing system. More...

#include <DekiTime.h>

Static Public Member Functions

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.

Detailed Description

Deki Engine timing system.

Provides platform-independent timing functionality for the engine. All time values are in milliseconds for consistency.

Member Function Documentation

◆ 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_timePrevious 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
deltaTimeFrame 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_msFrame 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
providerThe time provider implementation (takes ownership)

The documentation for this class was generated from the following file: