Trait quicksilver::State [−][src]
pub trait State { fn new() -> Self
where
Self: Sized; fn update(&mut self, &mut Window) { ... } fn event(&mut self, &Event, &mut Window) { ... } fn draw(&mut self, window: &mut Window) { ... } }
The structure responsible for managing the game loop state
Required Methods
Provided Methods
fn update(&mut self, &mut Window)
Tick the State forward one frame
Will happen at a fixed rate of 60 ticks per second under ideal conditions. Under non-ideal conditions, the game loop will do its best to still call the update at about 60 TPS.
By default it does nothing
fn event(&mut self, &Event, &mut Window)
Process an incoming event
By default it does nothing
fn draw(&mut self, window: &mut Window)
Draw the state to the screen
Will happen as often as possible, only limited by vysnc
By default it draws a black screen