pub struct Runtime { /* private fields */ }Expand description
Coordinates frame-scoped input with a fixed-rate simulation clock.
Implementations§
Source§impl Runtime
impl Runtime
Sourcepub fn new(config: RuntimeConfig, started_at: Instant) -> Self
pub fn new(config: RuntimeConfig, started_at: Instant) -> Self
Starts a runtime clock at started_at with no accumulated simulation debt.
Sourcepub fn handle_input(&mut self, event: InputEvent)
pub fn handle_input(&mut self, event: InputEvent)
Adds one ordered native input transition to the current snapshot.
Sourcepub fn handle_window_event(&mut self, event: WindowEvent)
pub fn handle_window_event(&mut self, event: WindowEvent)
Applies the input and rendering-lifecycle parts of one platform window event.
Redraw, metrics, and close policy remain with the application. Lower-level input, suspend, and resume methods remain available when an application uses a different coordination shape.
Sourcepub const fn input(&self) -> &InputSnapshot
pub const fn input(&self) -> &InputSnapshot
Returns the held state and transitions accumulated for the current frame.
Sourcepub fn begin_frame(&mut self, now: Instant) -> RuntimeFrame<'_>
pub fn begin_frame(&mut self, now: Instant) -> RuntimeFrame<'_>
Begins a scoped frame with fixed simulation work, input, and render interpolation.
Dropping the returned frame automatically ends the input snapshot, including on early return.
Sourcepub fn suspend(&mut self)
pub fn suspend(&mut self)
Pauses frame timing and releases every held input control.
The fractional fixed-step accumulator is preserved so rendering can resume without a small
interpolation jump. Calls to Self::begin_frame while suspended schedule no updates.