Class FramePacer

Class Documentation

class FramePacer

Declaration: final

CPU-only monotonic scheduling.

The owner checks due() before rendering and records the actual frame start; missed deadlines never accumulate catch-up frames. This value is unsynchronized and neither sleeps nor calls native adapters.

Public Types

using Clock = std::chrono::steady_clock

Public Functions

explicit FramePacer(FramePacingOptions options = {})

Reject nonpositive/nonfinite targets and periods outside the clock’s duration range, including when disabled.

Round positive periods up to a clock tick so quantization cannot exceed the requested rate.

inline const FramePacingOptions &options() const noexcept

Declaration: [[nodiscard]]

bool due(Clock::time_point now) const noexcept

Declaration: [[nodiscard]]

Clock::time_point next_frame_at() const noexcept

Declaration: [[nodiscard]]

void frame_started(Clock::time_point now) noexcept