pub trait GameScene {
// Required methods
fn fixed_update(&mut self, dt: f32, input: &InputState);
fn render(&mut self, alpha: f32, ctx: &mut GameRenderContext<'_>);
// Provided method
fn update(&mut self, _dt: f32, _input: &InputState) { ... }
}Expand description
Real-time game or engine scene embedded inside an euv viewport or paired with an euv HUD overlay.
Required Methods§
Sourcefn fixed_update(&mut self, dt: f32, input: &InputState)
fn fixed_update(&mut self, dt: f32, input: &InputState)
Advances deterministic physics, AI, or ECS state by one fixed simulation step dt.
§Arguments
&Self- Mutable scene state.f32- Fixed simulation timestep in seconds.&InputState- Real-time polled keyboard and pointer state.
Sourcefn render(&mut self, alpha: f32, ctx: &mut GameRenderContext<'_>)
fn render(&mut self, alpha: f32, ctx: &mut GameRenderContext<'_>)
Emits immediate-mode geometry or blits an external engine RGBA8 framebuffer into ctx.
§Arguments
&Self- Mutable scene state.f32- Interpolation alpha in[0.0, 1.0].&mut GameRenderContext<'_>- Viewport-local draw surface.
Provided Methods§
Sourcefn update(&mut self, _dt: f32, _input: &InputState)
fn update(&mut self, _dt: f32, _input: &InputState)
Advances variable-rate camera, animation, or visual interpolation state.
§Arguments
&Self- Mutable scene state.f32- Variable frame delta time in seconds.&InputState- Real-time polled input state.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".