Nebula
|
Singleton object which manages the current game time.
These are the standard time source objects provided by Application layer:
TIMESOURCE_SYSTEM - timing for low level Application layer subsystems TIMESOURCE_GAMEPLAY - timing for the game logic TIMESOURCE_INPUT - extra time source for input handling
Each time source tracks its own time independently from the other time sources, they can also be paused and unpaused independentlty from each other, and they may also run faster or slower then realtime.
You can create custom time sources by using the create interface.
Classes | |
struct | State |
timemanager singleton state More... | |
struct | TimeSourceState |
This struct needs to be structured exactly like the TimeSource struct, just with different qualifiers. More... | |
Functions | |
void | Destroy () |
Destroy the singleton. | |
void | OnActivate () |
called after create | |
void | OnBeginFrame () |
called at beginning of each frame | |
Game::ManagerAPI | Create () |
create the singleton | |
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 | |
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 | |
Variables | |
static State * | state = nullptr |
Game::ManagerAPI Game::TimeManager::Create | ( | ) |
create the singleton
TimeSource *const Game::TimeManager::CreateTimeSource | ( | TimeSourceCreateInfo const & | info | ) |
create a timesource. The global time manager handles the timesources.
void Game::TimeManager::Destroy | ( | ) |
Destroy the singleton.
float Game::TimeManager::GetGlobalTimeFactor | ( | ) |
get the global time scale
TimeSource *const Game::TimeManager::GetTimeSource | ( | uint32_t | TIMESOURCE_HASH | ) |
get a time source by hash
void Game::TimeManager::OnActivate | ( | ) |
called after create
void Game::TimeManager::OnBeginFrame | ( | ) |
called at beginning of each frame
void Game::TimeManager::SetGlobalTimeFactor | ( | float | factor | ) |
set global time scale. This should be used sparingly. You can usually set individual time sources time factor instead.
|
static |