Class Cadencer
Schedules fixed-step updates and tracks frames per second (FPS).
class Cadencer
: dlib .core .ownership .Owner;
Constructors
| Name | Description |
|---|---|
this
(updateable, freq, owner)
|
Constructs a Cadencer. |
Fields
| Name | Type | Description |
|---|---|---|
fps
|
int | Current frames per second. |
elapsedTime
|
double | Accumulated time since last update. |
fpsCounter
|
int | Frame counter for FPS calculation. |
fpsTimeCounter
|
double | Accumulated time for FPS calculation. |
timeStep
|
double | Time step between updates (in seconds). |
updateable
|
Updateable | Object that is being updated. |
Methods
| Name | Description |
|---|---|
getTimeStep
()
|
Returns the current time step between updates (in seconds). |
setFrequency
(freq)
|
Sets the update frequency. |
update
(t)
|
Updates the cadencer with the given time information. |
Description
The Cadencer class accumulates time and udates a user-provided
Updateable at a fixed frequency. It also tracks and exposes the
current FPS.
Cadencer by itself doesn't query system time, this should be done
with EventManager.