re_renderer::renderer

Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§