62 void sleepFor(std::chrono::steady_clock::duration span);
65 int m_targetFramerate = 0;
66 std::chrono::steady_clock::time_point m_frameStart;
69 std::chrono::steady_clock::time_point m_deadline;
71 void* m_timer =
nullptr;
void endFrame()
Marks the end of a frame and waits as necessary to match the target framerate.
FrameLimiter()
Ask Windows for a 1 ms scheduler tick for as long as the limiter lives.
void beginFrame()
Marks the start of a frame, before any work is done.
int targetFramerate() const
The cap in effect, in frames per second.
Definition frame_limiter.h:51
void setTargetFramerate(int framerate)
Set the desired target framerate (frames per second).
Definition frame_limiter.h:44