Trait Application

Source
pub trait Application: Sized + 'static {
    // Required methods
    fn new(context: EngineContext) -> Self;
    fn update(&mut self);
    fn render(&mut self) -> Vec<RenderObject>;
}
Expand description

Application trait for user-defined applications.

Required Methods§

Source

fn new(context: EngineContext) -> Self

Called once at the beginning of the application to create the initial state.

Source

fn update(&mut self)

Called every frame for game logic updates.

Source

fn render(&mut self) -> Vec<RenderObject>

Called every frame to handle rendering.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§