10#include "SD/export.hpp"
24 m_frame_time =
now - m_last_time;
27 if (m_frame_time > 0.25)
29 m_accumulator += m_frame_time;
35 m_frame_work_time =
static_cast<float>(
glfwGetTime() - m_work_start) - m_gpu_wait_time;
36 m_gpu_wait_time = 0.0f;
41 if (m_accumulator >= m_fixed_time_step) {
42 m_accumulator -= m_fixed_time_step;
57 double m_last_time = 0.0;
58 double m_accumulator = 0.0;
59 double m_fixed_time_step = 1.0 / 60.0;
60 double m_work_start = 0.0;
61 float m_frame_work_time = 0.0f;
62 float m_gpu_wait_time = 0.0f;
63 double m_frame_time = 0.0;
Definition Application.hpp:22
Tracks frame timing, fixed timestep accumulation, and CPU work time.
Definition FrameTimer.hpp:21
void add_gpu_wait_time(float t)
Definition FrameTimer.hpp:48
void begin()
Definition FrameTimer.hpp:22
void end_work()
Definition FrameTimer.hpp:34
float get_frame_time() const
Definition FrameTimer.hpp:51
bool consume_fixed_step()
Returns true if a fixed step should run. Call in a loop.
Definition FrameTimer.hpp:40
void set_fixed_time_step(double step)
Definition FrameTimer.hpp:54
float get_frame_work_time() const
Definition FrameTimer.hpp:52
void begin_work()
Definition FrameTimer.hpp:32
double get_fixed_time_step() const
Definition FrameTimer.hpp:53
consteval U64 type_id_of()
Definition type_id.hpp:6