Browser

FixedLoop

Deterministic fixed-step timing for browser and renderer hosts.

The loop owns the timing policy that is easy to get subtly wrong in every game: frame clamping, catch-up limits, interpolation, cancellation, and typed update failures. It does not know about an ECS runtime or renderer.

Functions

source

Source

Wraps a host-specific subscription function in the canonical source type.

start

Source

Starts a fixed-step loop after validating its timing policy.

Update failures and malformed host ticks are delivered to onFailure, then the driver stops. Render defects are deliberately not caught: they are programmer defects, not expected game outcomes.

animationFrames

Source

Adapts requestAnimationFrame to a TickSource without reading global state. The first frame reports zero elapsed time because it establishes the clock.