Skip to main content

App

Trait App 

Source
pub trait App {
    // Required methods
    fn on_start(&mut self, ctx: &mut EngineContext);
    fn on_update(&mut self, ctx: &mut EngineContext, dt: f32);
    fn on_render(&mut self, ctx: &mut EngineContext);
    fn on_stop(&mut self, ctx: &mut EngineContext);

    // Provided methods
    fn initial_pipeline() -> PipelineFactory
       where Self: Sized { ... }
    fn register_loaders(_registry: &mut LoaderRegistry)
       where Self: Sized { ... }
    fn window_config() -> WindowConfig
       where Self: Sized { ... }
    fn tick_rate(&self) -> f32 { ... }
}

Required Methods§

Source

fn on_start(&mut self, ctx: &mut EngineContext)

Source

fn on_update(&mut self, ctx: &mut EngineContext, dt: f32)

Source

fn on_render(&mut self, ctx: &mut EngineContext)

Source

fn on_stop(&mut self, ctx: &mut EngineContext)

Provided Methods§

Source

fn initial_pipeline() -> PipelineFactory
where Self: Sized,

Source

fn register_loaders(_registry: &mut LoaderRegistry)
where Self: Sized,

Source

fn window_config() -> WindowConfig
where Self: Sized,

Source

fn tick_rate(&self) -> f32

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§