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

Create the state given the window and canvas

Provided Methods

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

Process an incoming event

By default it does nothing

Draw the state to the screen

Will happen as often as possible, only limited by vysnc

By default it draws a black screen

Implementors