Trait widgetry::SharedAppState [−][src]
pub trait SharedAppState { fn before_event(&mut self) { ... } fn draw_default(&self, _: &mut GfxCtx<'_>) { ... } fn dump_before_abort(&self, _: &Canvas) { ... } fn before_quit(&self, _: &Canvas) { ... } fn free_memory(&mut self) { ... } }
Expand description
Any data that should last the entire lifetime of the application should be stored in the struct implementing this trait.
Provided methods
fn before_event(&mut self)
[src]
fn before_event(&mut self)
[src]Before State::event
is called, call this.
fn draw_default(&self, _: &mut GfxCtx<'_>)
[src]
fn draw_default(&self, _: &mut GfxCtx<'_>)
[src]When DrawBaselayer::DefaultDraw is called, run this.
fn dump_before_abort(&self, _: &Canvas)
[src]
fn dump_before_abort(&self, _: &Canvas)
[src]Will be called if State::event
or State::draw
panics.
fn before_quit(&self, _: &Canvas)
[src]
fn before_quit(&self, _: &Canvas)
[src]Called before a normal exit, like window close
fn free_memory(&mut self)
[src]
fn free_memory(&mut self)
[src]If widgetry determines the video card is low on memory, this may be called. The application should make its best effort to delete any unused Drawables.