|
libpsynth 0.2.1
|
A class for counting time and forcing update rates. More...
#include <timer.hpp>
Public Types | |
| typedef int | tick_type |
| typedef size_t | frame_type |
Public Member Functions | |
| timer () | |
| Constructor. | |
| timer (int fpsrate) | |
| Constructor which sets a frames per second rate. | |
| ~timer () | |
| Destructor. | |
| void | force_fps (int fpsrate) |
| Makes the timer force a frames per second update rate. | |
| void | reset () |
| Resets the timer counts. | |
| void | update () |
| Updates the timer. | |
| tick_type | ticks () |
Returns the milliseconds elapsed between the last call to update() and the creation of the Timer or the last rest call. | |
| tick_type | delta_ticks () |
Returns the milliseconds elapsed between the last two update() calls. | |
| frame_type | frames () |
| Returns the number of total updates since start. | |
A class for counting time and forcing update rates.
| typedef size_t psynth::base::timer::frame_type |
| typedef int psynth::base::timer::tick_type |
| psynth::base::timer::timer | ( | ) |
Constructor.
| psynth::base::timer::timer | ( | int | fpsrate | ) |
Constructor which sets a frames per second rate.
| fpsrate | The frames per second rate of the timer. |
| psynth::base::timer::~timer | ( | ) |
Destructor.
| tick_type psynth::base::timer::delta_ticks | ( | ) | [inline] |
Returns the milliseconds elapsed between the last two update() calls.
| void psynth::base::timer::force_fps | ( | int | fpsrate | ) |
Makes the timer force a frames per second update rate.
This means that every call to update() will cause a sleep to force a rate of updates per second as near as possible to the desired one.
| fpsrate | The desired fpsrate. Set it to -1 if you no longer want to have a fixed fpsrate. |
| frame_type psynth::base::timer::frames | ( | ) | [inline] |
Returns the number of total updates since start.
| void psynth::base::timer::reset | ( | ) |
Resets the timer counts.
| tick_type psynth::base::timer::ticks | ( | ) | [inline] |
Returns the milliseconds elapsed between the last call to update() and the creation of the Timer or the last rest call.
| void psynth::base::timer::update | ( | ) |
Updates the timer.
1.7.4