Skip to main content

ShellHooks

Trait ShellHooks 

Source
pub trait ShellHooks {
    // Required method
    fn frame_input(&mut self, sim: &Sim) -> FrameInput;

    // Provided method
    fn on_frame(&mut self, _sim: &mut Sim, _dt: Duration) { ... }
}
Expand description

Per-frame hooks the game implements. Snapshot production (frame_input) is the only required render coupling: plain data out, no renderer types.

Required Methods§

Source

fn frame_input(&mut self, sim: &Sim) -> FrameInput

Build this frame’s viewport snapshot from sim + UI state.

Provided Methods§

Source

fn on_frame(&mut self, _sim: &mut Sim, _dt: Duration)

Fixed-step systems run inside Sim; this is the per-frame variable-rate hook (tweens, audio triggers, autosave timers).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§