Trait shadiertoy::Game [−][src]
pub trait Game { fn new(_: &mut Window) -> Self; fn draw(&mut self, _: &mut Window); fn event(&mut self, &mut Window, Event) { ... } fn run()
where
Self: Sized, { ... } }
A game, which is hopefully what you're making.
Required Methods
fn new(_: &mut Window) -> Self
Initialize.
fn draw(&mut self, _: &mut Window)
Draw a frame.
Call Window::draw
inside this function.
Provided Methods
fn event(&mut self, &mut Window, Event)
Handle an event.
All input handling goes here.
fn run() where
Self: Sized,
Self: Sized,
Run the game!