Skip to main content

Module frame

Module frame 

Source
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. delta belongs to this subscription: zero on its first frame and after an explicit pause/resume. It is not clamped; simulation clients choose their policy.
FrameClock
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.
FrameConsumer
Legacy frame_clock registration. New code should own a FrameHandle.
FrameHandle
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 FrameClock from 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 Instant does not exist; None before any frame.
Day API ↩ Guides· daybrite.dev