Trait crayon::application::Application
[−]
[src]
pub trait Application { fn on_update(&mut self, _: &Context) -> Result<()> { ... } fn on_render(&mut self, _: &Context) -> Result<()> { ... } fn on_post_update(&mut self, _: &Context, _: &FrameInfo) -> Result<()> { ... } fn on_receive_event(
&mut self,
_: &Context,
_: ApplicationEvent
) -> Result<()> { ... } fn on_exit(&mut self, _: &Context) -> Result<()> { ... } }
Application
is a user-friendly facade to building application, which defines a number
of event functions that get executed in a pre-determined order.
Provided Methods
fn on_update(&mut self, _: &Context) -> Result<()>
Application::on_update
is called every frame. Its the main workhorse
function for frame updates.
fn on_render(&mut self, _: &Context) -> Result<()>
Application::on_render
is called before we starts rendering the scene.
fn on_post_update(&mut self, _: &Context, _: &FrameInfo) -> Result<()>
Application::on_post_update
is called after camera has rendered the scene.
fn on_receive_event(&mut self, _: &Context, _: ApplicationEvent) -> Result<()>
Application::on_update
is called when receiving application event.
fn on_exit(&mut self, _: &Context) -> Result<()>
Application::on_exit
is called when exiting.