Nebula
Loading...
Searching...
No Matches
timesource.h File Reference

Detailed Description

#include "timing/time.h"

Go to the source code of this file.

Classes

struct  Game::TimeSourceCreateInfo
 Used to create a timesource. More...
struct  Game::TimeSource
 An object that keeps track of running time and frame time (delta time). More...

Namespaces

namespace  Game
 Game::EditorState.
namespace  Game::Time
 These are the standard time source objects provided by Application layer:

Macros

#define TIMESOURCE_GAMEPLAY   uint32_t('GPTS')
#define TIMESOURCE_INPUT   uint32_t('IPTS')
#define TIMESOURCE_SYSTEM   uint32_t('SYTS')

Functions

TimeSource *const Game::Time::CreateTimeSource (TimeSourceCreateInfo const &info)
 create a timesource. The global time manager handles the timesources.
TimeSource *const Game::Time::GetTimeSource (uint32_t TIMESOURCE_HASH)
 get a time source by hash
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.
float Game::Time::GetGlobalTimeFactor ()
 get the global time scale
void Game::Time::Setup ()
 setup the time sources. Called by Game::TimeManager on activate
void Game::Time::Discard ()
 discard the time sources. Called by Game::TimeManager on deactivate
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
bool Game::Time::ConsumeFixedStep (TimeSource *timeSource)
 consume one fixed step from a fixed time source. Returns false when no steps are left
void Game::Time::AdvanceTimeSource (TimeSource *timeSource, Timing::Time delta)
 add time to the accumulator of a fixed time source.

Macro Definition Documentation

◆ TIMESOURCE_GAMEPLAY

#define TIMESOURCE_GAMEPLAY   uint32_t('GPTS')

◆ TIMESOURCE_INPUT

#define TIMESOURCE_INPUT   uint32_t('IPTS')

◆ TIMESOURCE_SYSTEM

#define TIMESOURCE_SYSTEM   uint32_t('SYTS')