FpsHelper

Helper for measuring frames per second and setting static FPS. Usually needs to be located as field of game class.

Members

Functions

sleepAfterFrame
void sleepAfterFrame(float frameTime)
Undocumented in source. Be warned that the author may not have intended to support it.
update
void update(float dt)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

deltaTime
float deltaTime;

Stores last delta time passed into update()

fps
float fps;

Stores actual FPS value

fpsTicks
size_t fpsTicks;

Stores amount of updates between

fpsUpdated
Signal!(FpsHelper*) fpsUpdated;
Undocumented in source.
limitFps
bool limitFps;
Undocumented in source.
maxFps
uint maxFps;
Undocumented in source.
secondsAccumulator
float secondsAccumulator;

Accumulates time before reaching update interval

timeLimit
float timeLimit;

Delta time value will clamped to meet interval [0;timeLimit]. This can prevent from value lags when entering hibernation or resizing the window.

updateInterval
float updateInterval;

fps will be updated each updateInterval seconds

Meta