Trait re_renderer::renderer::Renderer

source ·
pub trait Renderer {
    type RendererDrawData: DrawData;

    // Required methods
    fn create_renderer(ctx: &RenderContext) -> Self;
    fn draw(
        &self,
        render_pipelines: &StaticResourcePoolReadLockAccessor<'_, GpuRenderPipelineHandle, RenderPipeline>,
        phase: DrawPhase,
        pass: &mut RenderPass<'_>,
        draw_data: &Self::RendererDrawData
    ) -> Result<(), DrawError>;
    fn participated_phases() -> &'static [DrawPhase];
}
Expand description

A Renderer encapsulate the knowledge of how to render a certain kind of primitives.

It is an immutable, long-lived datastructure that only holds onto resources that will be needed for each of its Renderer::draw invocations. Any data that might be different per specific Renderer::draw invocation is stored in DrawData.

Required Associated Types§

Required Methods§

source

fn create_renderer(ctx: &RenderContext) -> Self

source

fn draw( &self, render_pipelines: &StaticResourcePoolReadLockAccessor<'_, GpuRenderPipelineHandle, RenderPipeline>, phase: DrawPhase, pass: &mut RenderPass<'_>, draw_data: &Self::RendererDrawData ) -> Result<(), DrawError>

Called once per phase given by Renderer::participated_phases.

source

fn participated_phases() -> &'static [DrawPhase]

Combination of flags indicating in which phases Renderer::draw should be called.

Object Safety§

This trait is not object safe.

Implementors§