hephae_render::drawer

Trait Drawer

Source
pub trait Drawer: Component + Sized {
    type Vertex: Vertex;
    type ExtractParam: ReadOnlySystemParam;
    type ExtractData: ReadOnlyQueryData;
    type ExtractFilter: QueryFilter;
    type DrawParam: ReadOnlySystemParam;

    // Required methods
    fn extract(
        param: &SystemParamItem<'_, '_, Self::ExtractParam>,
        query: QueryItem<'_, Self::ExtractData>,
    ) -> Option<Self>;
    fn enqueue(
        &self,
        param: &SystemParamItem<'_, '_, Self::DrawParam>,
        queuer: &mut impl Extend<(f32, <Self::Vertex as Vertex>::PipelineKey, <Self::Vertex as Vertex>::Command)>,
    );
}
Expand description

A render world Component extracted from the main world that will be used to issue VertexCommands.

Required Associated Types§

Source

type Vertex: Vertex

The type of vertex this drawer works with.

Source

type ExtractParam: ReadOnlySystemParam

System parameter to fetch when extracting data from the main world.

Source

type ExtractData: ReadOnlyQueryData

Query item to fetch from entities when extracting from those entities to the render world.

Source

type ExtractFilter: QueryFilter

Additional query filters accompanying ExtractData.

Source

type DrawParam: ReadOnlySystemParam

System parameter to fetch when issuing VertexCommands.

Required Methods§

Source

fn extract( param: &SystemParamItem<'_, '_, Self::ExtractParam>, query: QueryItem<'_, Self::ExtractData>, ) -> Option<Self>

Extracts an instance of this drawer from matching entities, if available.

Source

fn enqueue( &self, param: &SystemParamItem<'_, '_, Self::DrawParam>, queuer: &mut impl Extend<(f32, <Self::Vertex as Vertex>::PipelineKey, <Self::Vertex as Vertex>::Command)>, )

Issues VertexCommands for rendering, in a form of Z-layer, pipeline key, and vertex command.

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§