Nebula
Loading...
Searching...
No Matches
Game::Time Namespace Reference

Detailed Description

These are the standard time source objects provided by Application layer:

@item TIMESOURCE_SYSTEM - timing for low level Application layer subsystems @item TIMESOURCE_GAMEPLAY - timing for the game logic @item TIMESOURCE_INPUT - extra time source for input handling

Functions

TimeSource *const CreateTimeSource (TimeSourceCreateInfo const &info)
 create a timesource. The global time manager handles the timesources.
TimeSource *const GetTimeSource (uint32_t TIMESOURCE_HASH)
 get a time source by hash
uint32_t GetNumTimeSources ()
 how many time sources have been created
bool HasTimeSource (uint32_t TIMESOURCE_HASH)
 true when a time source with this hash exists. GetTimeSource asserts on one that does not
TimeSource *const GetTimeSourceByIndex (uint32_t index)
 the time source at an index. The hash table only maps hash to index, so this is what enumerates them
void SetGlobalTimeFactor (float factor)
 set global time scale. This should be used sparingly. You can usually set individual time sources time factor instead.
float GetGlobalTimeFactor ()
 get the global time scale
void Setup ()
 setup the time sources. Called by Game::TimeManager on activate
void Discard ()
 discard the time sources. Called by Game::TimeManager on deactivate
void BeginFrame (Timing::Tick realFrameTicks)
 advance every time source by the real frame time. A fixed source turns real time into available steps
bool ConsumeFixedStep (TimeSource *timeSource)
 consume one fixed step from a fixed time source. Returns false when no steps are left
void AdvanceTimeSource (TimeSource *timeSource, Timing::Time delta)
 add time to the accumulator of a fixed time source.

Function Documentation

◆ AdvanceTimeSource()

void Game::Time::AdvanceTimeSource ( TimeSource * timeSource,
Timing::Time delta )

add time to the accumulator of a fixed time source.

For tests and tools which drive the rate explicitly. Warns in debug when the source's maxStepsPerFrame clamps away part of what was asked for

◆ BeginFrame()

void Game::Time::BeginFrame ( Timing::Tick realFrameTicks)

advance every time source by the real frame time. A fixed source turns real time into available steps

◆ ConsumeFixedStep()

bool Game::Time::ConsumeFixedStep ( TimeSource * timeSource)

consume one fixed step from a fixed time source. Returns false when no steps are left

◆ CreateTimeSource()

TimeSource *const Game::Time::CreateTimeSource ( TimeSourceCreateInfo const & info)

create a timesource. The global time manager handles the timesources.

◆ Discard()

void Game::Time::Discard ( )

discard the time sources. Called by Game::TimeManager on deactivate

◆ GetGlobalTimeFactor()

float Game::Time::GetGlobalTimeFactor ( )

get the global time scale

◆ GetNumTimeSources()

uint32_t Game::Time::GetNumTimeSources ( )

how many time sources have been created

◆ GetTimeSource()

TimeSource *const Game::Time::GetTimeSource ( uint32_t TIMESOURCE_HASH)

get a time source by hash

◆ GetTimeSourceByIndex()

TimeSource *const Game::Time::GetTimeSourceByIndex ( uint32_t index)

the time source at an index. The hash table only maps hash to index, so this is what enumerates them

◆ HasTimeSource()

bool Game::Time::HasTimeSource ( uint32_t TIMESOURCE_HASH)

true when a time source with this hash exists. GetTimeSource asserts on one that does not

◆ SetGlobalTimeFactor()

void Game::Time::SetGlobalTimeFactor ( float factor)

set global time scale. This should be used sparingly. You can usually set individual time sources time factor instead.

◆ Setup()

void Game::Time::Setup ( )

setup the time sources. Called by Game::TimeManager on activate