MVE - Multi-View Environment mve-devel
|
A timer class for frame-based applications. More...
#include <frame_timer.h>
Public Member Functions | |
FrameTimer (void) | |
std::size_t | get_frame_count (void) const |
Returns the amount of calls to nextFrame. | |
std::size_t | get_max_fps (void) const |
Returns the maximum frames per second. | |
std::size_t | get_time (void) const |
Returns the current time in milli seconds since program start. | |
float | get_time_sec (void) const |
Returns the current time in seconds since program start. | |
void | next_frame (void) |
Called to update the current time and limit FPS. | |
void | set_max_fps (std::size_t fps) |
Sets the desired FPS. | |
A timer class for frame-based applications.
With the get_time() method, the class provides a constant time for each frame. A call to next_frame() updates this time. By setting a max FPS rate, next_frame() also limits the frames by sleeping. The code works with real-world time rather than with CPU time or execution time (like std::clock()).
Definition at line 31 of file frame_timer.h.
|
inline |
Definition at line 77 of file frame_timer.h.
|
inline |
Returns the amount of calls to nextFrame.
Definition at line 110 of file frame_timer.h.
|
inline |
Returns the maximum frames per second.
Definition at line 92 of file frame_timer.h.
|
inline |
Returns the current time in milli seconds since program start.
This time is constant over the whole frame.
Definition at line 98 of file frame_timer.h.
|
inline |
Returns the current time in seconds since program start.
This time is constant over the whole frame.
Definition at line 104 of file frame_timer.h.
|
inline |
Called to update the current time and limit FPS.
Definition at line 116 of file frame_timer.h.
|
inline |