pub trait GameApp: 'static {
type Action: GameAction;
// Required methods
fn init(ctx: &mut Context<Self::Action>) -> Self;
fn update(&mut self, ctx: &mut Context<Self::Action>);
fn render(&mut self, ctx: &mut Context<Self::Action>);
// Provided methods
fn window_title() -> &'static str { ... }
fn window_icon() -> Option<&'static [u8]> { ... }
fn wasm_ready_event() -> Option<&'static str> { ... }
fn internal_resolution() -> (u32, u32) { ... }
fn fixed_update(
&mut self,
_ctx: &mut Context<Self::Action>,
_fixed_time: &FixedTime,
) { ... }
fn ui(
&mut self,
_egui_ctx: &Context,
_ctx: &mut Context<Self::Action>,
_scene_params: &mut SceneParams,
) { ... }
}Required Associated Types§
type Action: GameAction
Required Methods§
fn init(ctx: &mut Context<Self::Action>) -> Self
fn update(&mut self, ctx: &mut Context<Self::Action>)
fn render(&mut self, ctx: &mut Context<Self::Action>)
Provided Methods§
fn window_title() -> &'static str
fn window_icon() -> Option<&'static [u8]>
fn wasm_ready_event() -> Option<&'static str>
fn internal_resolution() -> (u32, u32)
fn fixed_update( &mut self, _ctx: &mut Context<Self::Action>, _fixed_time: &FixedTime, )
fn ui( &mut self, _egui_ctx: &Context, _ctx: &mut Context<Self::Action>, _scene_params: &mut SceneParams, )
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.