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(double frameTime)
Undocumented in source. Be warned that the author may not have intended to support it.
update
void update(double dt, double updateTime)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

deltaTime
double deltaTime;

Stores last delta time passed into update()

fps
double 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
double secondsAccumulator;

Accumulates time before reaching update interval

timeLimit
double 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
double updateInterval;

fps will be updated each updateInterval seconds

updateTime
double updateTime;

Stores update time passed trough update every updateInterval

Meta