pub trait App<T: 'static = ()> {
    const HANDEDNESS: Handedness;

    fn sample_count(&self) -> SampleCount;

    fn register_logger(&mut self) { ... }
fn register_panic_hook(&mut self) { ... }
fn create_window(
        &mut self,
        builder: WindowBuilder
    ) -> (EventLoop<UserResizeEvent<T>>, Window) { ... }
fn create_iad<'a>(
        &'a mut self
    ) -> Pin<Box<dyn Future<Output = Result<InstanceAdapterDevice>> + 'a>> { ... }
fn create_base_rendergraph(
        &mut self,
        renderer: &Renderer
    ) -> BaseRenderGraph { ... }
fn scale_factor(&self) -> f32 { ... }
fn setup(
        &mut self,
        window: &Window,
        renderer: &Arc<Renderer>,
        routines: &Arc<DefaultRoutines>,
        surface_format: TextureFormat
    ) { ... }
fn handle_event(
        &mut self,
        window: &Window,
        renderer: &Arc<Renderer>,
        routines: &Arc<DefaultRoutines>,
        base_rendergraph: &BaseRenderGraph,
        surface: Option<&Arc<Surface>>,
        resolution: UVec2,
        event: Event<'_, T>,
        control_flow: impl FnOnce(ControlFlow)
    ) { ... } }

Associated Constants

The handedness of the coordinate system of the renderer.

Required methods

Determines the sample count used, this may change dynamically. This function is what the framework actually calls, so overriding this will always use the right values.

It is called on main events cleared and things are remade if this changes.

Provided methods

Determines the scale factor used

RedrawRequested/RedrawEventsCleared will only be fired if the window size is non-zero. As such you should always render in RedrawRequested and use MainEventsCleared for things that need to keep running when minimized.

Implementors