Renderer

Trait Renderer 

Source
pub trait Renderer: Send + Sync {
    // Required method
    fn build_scene(&mut self, ctx: &RenderContext<'_>);

    // Provided method
    fn background_color(&self, ctx: &RenderContext<'_>) -> Color { ... }
}
Expand description

Trait for rendering backends.

Implementations can use Vello, wgpu directly, or other rendering engines.

Required Methods§

Source

fn build_scene(&mut self, ctx: &RenderContext<'_>)

Build the scene/command buffer for a frame.

This method is called once per frame and should prepare all drawing commands.

Provided Methods§

Source

fn background_color(&self, ctx: &RenderContext<'_>) -> Color

Get the background color (for clearing).

Implementors§