Game

Trait Game 

Source
pub trait Game {
    // Required methods
    fn render<'o>(&'o mut self, render_handle: RenderHandle<'o>);
    fn update(&mut self, engine_handle: &mut Engine);

    // Provided methods
    fn on_close(&self) { ... }
    fn on_resize(
        &mut self,
        _new_window_size: Vec2<u32>,
        _engine_handle: &mut Engine,
    ) { ... }
}
Expand description

The Trait needed for structs to be used in with the Engine

Required Methods§

Source

fn render<'o>(&'o mut self, render_handle: RenderHandle<'o>)

Rendering code goes here

Source

fn update(&mut self, engine_handle: &mut Engine)

Updating code goes here

Provided Methods§

Source

fn on_close(&self)

Things to do when the window closes

Source

fn on_resize( &mut self, _new_window_size: Vec2<u32>, _engine_handle: &mut Engine, )

Implementors§