Class Cadencer

Schedules fixed-step updates and tracks frames per second (FPS).

class Cadencer
  : dlib.core.ownership.Owner;

Constructors

NameDescription
this (updateable, freq, owner) Constructs a Cadencer.

Fields

NameTypeDescription
fps intCurrent frames per second.
elapsedTime doubleAccumulated time since last update.
fpsCounter intFrame counter for FPS calculation.
fpsTimeCounter doubleAccumulated time for FPS calculation.
timeStep doubleTime step between updates (in seconds).
updateable UpdateableObject that is being updated.

Methods

NameDescription
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.