Skip to main content

Renderer

Trait Renderer 

Source
pub trait Renderer: Debug {
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn prepare_frame(&mut self) -> Result<(), Self::Error>;
    fn render(&mut self) -> Result<(), Self::Error>;
    fn resize(&mut self, extent: RenderExtent) -> Result<(), Self::Error>;
}
Expand description

Renderer backend operations driven by the application loop.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Error type returned by renderer operations.

Required Methods§

Source

fn prepare_frame(&mut self) -> Result<(), Self::Error>

Prepares renderer-owned state for the next frame.

Source

fn render(&mut self) -> Result<(), Self::Error>

Renders one frame.

Source

fn resize(&mut self, extent: RenderExtent) -> Result<(), Self::Error>

Resizes renderer-owned swapchain or framebuffer resources.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§