pub trait App {
type Args: Sized + Parser;
// Required method
fn new(window: &mut Window, args: Self::Args) -> Result<Self>
where Self: Sized;
// Provided methods
fn handle_event(
&mut self,
window: &mut Window,
event: WindowEvent,
) -> Result<()> { ... }
fn update(&mut self, window: &mut Window) -> Result<()> { ... }
}Expand description
Implementations of this trait can be run with app_main to manage a GLFW window.
Required Associated Types§
Required Methods§
Provided Methods§
sourcefn handle_event(
&mut self,
window: &mut Window,
event: WindowEvent,
) -> Result<()>
fn handle_event( &mut self, window: &mut Window, event: WindowEvent, ) -> Result<()>
Handles a single GLFW event.
This function is called in a loop to consume any pending events before every call to update().