Image Component Library (ICL)
|
An fps limiter can be used to limit online applications FPS. More...
#include <FPSLimiter.h>
Public Member Functions | |
FPSLimiter (float maxFPS, int fpsEstimationInterval=10) | |
creates new FPSLimiter instance with given parameter More... | |
virtual | ~FPSLimiter () |
virtual destructor More... | |
void | setMaxFPS (float maxFPS) |
sets max fps value More... | |
float | getMaxFPS () const |
returns max fps value More... | |
float | wait () const |
waits as long as necessary to reached desired FPS rate More... | |
virtual void | tic () const |
as FPSEstimator::tic(), but with preceding wait()-call More... | |
virtual float | getFPSVal () const |
as FPSEstimator::getFPSVal(), but with preceding wait()-call More... | |
virtual std::string | getFPSString (const std::string &fmt="%3.4f fps", int bufferSize=30) const |
as FPSEstimator::getFpsString, but with preceding wait()-call More... | |
virtual void | showFPS (const std::string &text="") const |
as FPSEstimator::showPPS, but with preceding wait()-call More... | |
Public Member Functions inherited from icl::utils::FPSEstimator | |
FPSEstimator (int n=2) | |
Constructor. More... | |
virtual | ~FPSEstimator () |
virtual destructor More... | |
void | reset (int n) |
Sets a new averaging interval. More... | |
Private Attributes | |
float | m_maxFPS |
Time | m_lastTime |
bool | m_waitOff |
An fps limiter can be used to limit online applications FPS.
icl::utils::FPSLimiter::FPSLimiter | ( | float | maxFPS, |
int | fpsEstimationInterval = 10 |
||
) |
creates new FPSLimiter instance with given parameter
|
inlinevirtual |
virtual destructor
|
virtual |
as FPSEstimator::getFpsString, but with preceding wait()-call
Reimplemented from icl::utils::FPSEstimator.
|
virtual |
as FPSEstimator::getFPSVal(), but with preceding wait()-call
Reimplemented from icl::utils::FPSEstimator.
|
inline |
returns max fps value
|
inline |
sets max fps value
|
virtual |
as FPSEstimator::showPPS, but with preceding wait()-call
Reimplemented from icl::utils::FPSEstimator.
|
virtual |
as FPSEstimator::tic(), but with preceding wait()-call
Reimplemented from icl::utils::FPSEstimator.
float icl::utils::FPSLimiter::wait | ( | ) | const |
waits as long as necessary to reached desired FPS rate
returns time actually waited (in microseconds)
|
mutableprivate |
|
private |
|
mutableprivate |