[][src]Trait simple_game_engine::Application

pub trait Application {
    pub fn on_update(
        &mut self,
        canvas: &mut WindowCanvas,
        input: &InputState,
        elapsed_time: f64
    ) -> UpdateResult; pub fn on_quit(&mut self) -> Result<(), Box<dyn Error>> { ... } }

An application using this framework.

Required methods

pub fn on_update(
    &mut self,
    canvas: &mut WindowCanvas,
    input: &InputState,
    elapsed_time: f64
) -> UpdateResult
[src]

Called once per frame.

Parameters

  • canvas: A draw target representing the visible window.
  • elapsed_time: Duration (in seconds) since the last frame. This can be used to keep time-sensative routines, such as animation, running at a constant speed.
Loading content...

Provided methods

pub fn on_quit(&mut self) -> Result<(), Box<dyn Error>>[src]

Called when the window's close button is clicked. Be aware that this isn't called on std::process::exit, so do any essential cleanup in a Drop implementation instead. Does nothing by default.

Loading content...

Implementors

Loading content...