Expand description
Window-scoped display scheduling (docs/frames.md). Native frame requests are shared by
one-shot clients, continuous subscriptions and the legacy frame_clock piece. No timers,
no implicit physics clamp, and no native request when there is no demand.
Structs§
- Frame
- A frame opportunity, not confirmation that pixels were presented. All clients of a window
receive the same timestamp.
deltabelongs to this subscription: zero on its first frame and after an explicit pause/resume. It is not clamped; simulation clients choose their policy. - Frame
Clock - A reusable source bound to one window. Capture
current()while building a page, then use it from input handlers or other UI-thread code. A closed window cancels all its registrations. - Frame
Consumer - Legacy
frame_clockregistration. New code should own aFrameHandle. - Frame
Handle - Owns a registration. UI-thread only. Keep it alive for as long as the callback is wanted.
Functions§
- add_
frame_ consumer - frame_
consumer_ count - Number of active subscriptions and pending single-frame clients (paused handles excluded).
- install_
frame_ requester - Install the native scheduler at launch. The requester MUST deliver asynchronously; tests may retain the callback and deliver chosen timestamps manually. Replaces no live registrations.
- remove_
frame_ consumer - request
- Request one frame in the current window. Prefer a captured
FrameClockfrom event handlers. - subscribe
- Subscribe in the current window. Dropping the returned handle cancels the subscription.
- uptime_
secs - How long the app has run, from the frame clock: the span between the first and the latest
frame timestamp a backend delivered. The exit line uses it on wasm, where
Instantdoes not exist;Nonebefore any frame.