[][src]Trait doryen_rs::Engine

pub trait Engine {
    fn update(&mut self, api: &mut dyn DoryenApi);
fn render(&mut self, api: &mut dyn DoryenApi);
fn resize(&mut self, api: &mut dyn DoryenApi); fn init(&mut self, _api: &mut dyn DoryenApi) { ... } }

This is the trait you must implement to update and render your game. See App::set_engine

Required methods

fn update(&mut self, api: &mut dyn DoryenApi)

This is called 60 times per second and is independant of the framerate. Put your world update logic in there.

fn render(&mut self, api: &mut dyn DoryenApi)

This is called before drawing the console on the screen. The framerate depends on the screen frequency, the graphic cards and on whether you activated vsync or not. The framerate is not reliable so don't update time related stuff in this function.

fn resize(&mut self, api: &mut dyn DoryenApi)

This is called when the screen changes size

Loading content...

Provided methods

fn init(&mut self, _api: &mut dyn DoryenApi)

Called before the first game loop for one time initialization

Loading content...

Implementors

Loading content...