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§
Sourcefn build_scene(&mut self, ctx: &RenderContext<'_>)
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§
Sourcefn background_color(&self, ctx: &RenderContext<'_>) -> Color
fn background_color(&self, ctx: &RenderContext<'_>) -> Color
Get the background color (for clearing).