Browse Source

Callbacks::draw() must not mutate the state

master
Astro 2 years ago
parent
commit
6eb7c31406
  1. 2
      examples/example00.rs
  2. 2
      src/lib.rs

2
examples/example00.rs

@ -9,7 +9,7 @@ impl Callbacks for Example {
}
fn handle_event(&mut self, ev: Event) {}
fn update(&mut self) {}
fn draw(&mut self, graphics: &mut Graphics) {}
fn draw(&self, graphics: &mut Graphics) {}
fn clean_up(self) {}
}

2
src/lib.rs

@ -21,7 +21,7 @@ pub trait Callbacks {
}
fn handle_event(&mut self, ev: Event);
fn update(&mut self);
fn draw(&mut self, graphics: &mut Graphics);
fn draw(&self, graphics: &mut Graphics);
fn clean_up(self);
}

Loading…
Cancel
Save