|
SDEngine
Game Engine
|
Tracks frame timing, fixed timestep accumulation, and CPU work time. More...
#include <FrameTimer.hpp>
Public Member Functions | |
| void | begin () |
| void | begin_work () |
| void | end_work () |
| bool | consume_fixed_step () |
| Returns true if a fixed step should run. Call in a loop. | |
| void | add_gpu_wait_time (float t) |
| float | get_frame_time () const |
| float | get_frame_work_time () const |
| double | get_fixed_time_step () const |
| void | set_fixed_time_step (double step) |
Private Attributes | |
| double | m_last_time = 0.0 |
| double | m_accumulator = 0.0 |
| double | m_fixed_time_step = 1.0 / 60.0 |
| double | m_work_start = 0.0 |
| float | m_frame_work_time = 0.0f |
| float | m_gpu_wait_time = 0.0f |
| double | m_frame_time = 0.0 |
Tracks frame timing, fixed timestep accumulation, and CPU work time.
|
inline |
|
inline |
|
inline |
Returns true if a fixed step should run. Call in a loop.
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |