Trait gate::App [] [src]

pub trait App<A: AppAssetId> {
    fn advance(&mut self, seconds: f64, audio: &mut Audio<A>) -> bool;
fn input(
        &mut self,
        event: KeyEvent,
        key: KeyCode,
        audio: &mut Audio<A>
    ) -> bool;
fn render(&mut self, renderer: &mut Renderer<A>); fn start(&mut self, _audio: &mut Audio<A>) { ... } }

Trait that a user can implement to specify application behavior, passed into gate::run(...).

Required Methods

Advances the app state by a given amount of seconds (usually a fraction of a second).

Invoked when user input is received (currently only keyboard presses/releases).

Render the app in its current state.

Provided Methods

Invoked when the application is first started, default behavior is a no-op.

Implementors