Callbacks::draw() must not mutate the state
This commit is contained in:
父節點
0effe28bfa
當前提交
6eb7c31406
|
@ -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) {}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
載入中…
新增問題並參考