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 | |
virtual | ~FPSLimiter () |
virtual destructor | |
void | setMaxFPS (float maxFPS) |
sets max fps value | |
float | getMaxFPS () const |
returns max fps value | |
float | wait () const |
waits as long as necessary to reached desired FPS rate | |
virtual void | tic () const |
as FPSEstimator::tic(), but with preceding wait()-call | |
virtual float | getFPSVal () const |
as FPSEstimator::getFPSVal(), but with preceding wait()-call | |
virtual std::string | getFPSString (const std::string &fmt="%3.4f fps", int bufferSize=30) const |
as FPSEstimator::getFpsString, but with preceding wait()-call | |
virtual void | showFPS (const std::string &text="") const |
as FPSEstimator::showPPS, but with preceding wait()-call | |
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
virtual icl::utils::FPSLimiter::~FPSLimiter | ( | ) | [inline, virtual] |
virtual destructor
virtual std::string icl::utils::FPSLimiter::getFPSString | ( | const std::string & | fmt = "%3.4f fps" , |
int | bufferSize = 30 |
||
) | const [virtual] |
as FPSEstimator::getFpsString, but with preceding wait()-call
Reimplemented from icl::utils::FPSEstimator.
virtual float icl::utils::FPSLimiter::getFPSVal | ( | ) | const [virtual] |
as FPSEstimator::getFPSVal(), but with preceding wait()-call
Reimplemented from icl::utils::FPSEstimator.
float icl::utils::FPSLimiter::getMaxFPS | ( | ) | const [inline] |
returns max fps value
void icl::utils::FPSLimiter::setMaxFPS | ( | float | maxFPS | ) | [inline] |
sets max fps value
virtual void icl::utils::FPSLimiter::showFPS | ( | const std::string & | text = "" | ) | const [virtual] |
as FPSEstimator::showPPS, but with preceding wait()-call
Reimplemented from icl::utils::FPSEstimator.
virtual void icl::utils::FPSLimiter::tic | ( | ) | const [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)
Time icl::utils::FPSLimiter::m_lastTime [mutable, private] |
float icl::utils::FPSLimiter::m_maxFPS [private] |
bool icl::utils::FPSLimiter::m_waitOff [mutable, private] |