IGameTimer Interface |
Namespace: DigitalRune.Game.Timing
The IGameTimer type exposes the following members.
Name | Description | |
---|---|---|
Reset |
Stops the timer and resets the time to zero.
| |
Start |
Starts/resumes the timer.
| |
Stop |
Pauses the timer.
|
Name | Description | |
---|---|---|
AccumulatedTime |
Gets the accumulated time.
| |
Clock |
Gets or sets the clock.
| |
DeltaTime |
Gets the elapsed game time since the last time step.
| |
FrameCount |
Gets the number of frames since the start of the timer (= the number of
TimeChanged events).
| |
IdleTime |
Gets the idle time.
| |
IsRunning |
Gets a value indicating whether the timer is running.
| |
LostTime |
Gets the amount of time dropped in the current time step.
| |
Speed |
Gets or sets the speed ratio at which the game time progresses.
| |
Time |
Gets the game time.
|
Name | Description | |
---|---|---|
Idle |
Occurs when application is idle.
| |
TimeChanged |
Occurs when the game time has advanced.
|
IGameTimers must be attached to a IGameClock. They are updated automatically by handling the clock's TimeChanged event.
A game usually has one IGameClock that is running permanently and acts as the central time source. Each game or game component can further have its own IGameTimer. The IGameTimer controls the timing of the game component. For example: A FixedStepTimer ensures that a game component is updated with a constant frame rate. All IGameTimers are updated by the central IGameClock.
The terms 'time step' and 'frame' in this documentation refer to the TimeChanged event. The TimeChanged event triggers a new time step. (In a game the TimeChanged event usually triggers the "Update" method of a game module which computes and renders the next frame.)