DEKI/ENGINE docs
Deki 0.19.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches

The engine's clock, independent of the platform. More...

#include <deki/Time.h>

Static Public Member Functions

static void Initialize ()
 Call once at engine startup.
static uint32_t GetTime ()
 Milliseconds since Initialize().
static uint32_t GetElapsed (uint32_t previousTime)
 Milliseconds since previousTime, a value from GetTime().
static void Update (uint32_t deltaTime)
 Call once per frame with the frame's duration in milliseconds.
static uint32_t GetDeltaTime ()
 Duration of the last frame in milliseconds.
static float GetDeltaTimeF ()
 Duration of the last frame in milliseconds, with sub-millisecond precision.
static void UpdateF (float deltaTimeMs)
 Update() with a float duration, for sub-millisecond precision (the editor's frame limiter).
static float GetFPS ()
static void ResetFrameTime ()
 Call after loading a scene, so the next frame's delta does not include the loading time.
static void SetDelayFunction (std::function< void(uint32_t)> fn)
 Sets the platform's sleep function.
static void Delay (uint32_t ms)
 Sleeps ms milliseconds through the delay function; does nothing when none is set.
static void SetTimeProvider (std::unique_ptr< ITimeProvider > provider)
 Sets the platform's time provider and takes ownership of it.

Detailed Description

The engine's clock, independent of the platform.

All times are in milliseconds.

Member Function Documentation

◆ Initialize()

void Deki::Time::Initialize ( )
static

Call once at engine startup.

◆ GetTime()

uint32_t Deki::Time::GetTime ( )
static

Milliseconds since Initialize().

◆ GetElapsed()

uint32_t Deki::Time::GetElapsed ( uint32_t previousTime)
static

Milliseconds since previousTime, a value from GetTime().

◆ Update()

void Deki::Time::Update ( uint32_t deltaTime)
static

Call once per frame with the frame's duration in milliseconds.

◆ GetDeltaTime()

uint32_t Deki::Time::GetDeltaTime ( )
static

Duration of the last frame in milliseconds.

◆ GetDeltaTimeF()

float Deki::Time::GetDeltaTimeF ( )
static

Duration of the last frame in milliseconds, with sub-millisecond precision.

◆ UpdateF()

void Deki::Time::UpdateF ( float deltaTimeMs)
static

Update() with a float duration, for sub-millisecond precision (the editor's frame limiter).

◆ GetFPS()

float Deki::Time::GetFPS ( )
static

◆ ResetFrameTime()

void Deki::Time::ResetFrameTime ( )
static

Call after loading a scene, so the next frame's delta does not include the loading time.

◆ SetDelayFunction()

void Deki::Time::SetDelayFunction ( std::function< void(uint32_t)> fn)
static

Sets the platform's sleep function.

Platform init calls it before RunMainLoop starts.

◆ Delay()

void Deki::Time::Delay ( uint32_t ms)
static

Sleeps ms milliseconds through the delay function; does nothing when none is set.

◆ SetTimeProvider()

void Deki::Time::SetTimeProvider ( std::unique_ptr< ITimeProvider > provider)
static

Sets the platform's time provider and takes ownership of it.

Call it before Initialize().


The documentation for this class was generated from the following file:
  • deki-engine/include/deki/Time.h