Trait bevy::render::render_phase::Draw

pub trait Draw<P>: Send + Sync + 'static
where P: PhaseItem,
{ // Required method fn draw<'w>( &mut self, world: &'w World, pass: &mut TrackedRenderPass<'w>, view: Entity, item: &P ); // Provided method fn prepare(&mut self, world: &World) { ... } }
Expand description

A draw function used to draw PhaseItems.

The draw function can retrieve and query the required ECS data from the render world.

This trait can either be implemented directly or implicitly composed out of multiple modular RenderCommands. For more details and an example see the RenderCommand documentation.

Required Methods§

fn draw<'w>( &mut self, world: &'w World, pass: &mut TrackedRenderPass<'w>, view: Entity, item: &P )

Draws a PhaseItem by issuing zero or more draw calls via the TrackedRenderPass.

Provided Methods§

fn prepare(&mut self, world: &World)

Prepares the draw function to be used. This is called once and only once before the phase begins. There may be zero or more draw calls following a call to this function. Implementing this is optional.

Implementors§

§

impl<P, C> Draw<P> for RenderCommandState<P, C>
where P: PhaseItem, C: RenderCommand<P> + Send + Sync + 'static, <C as RenderCommand<P>>::Param: ReadOnlySystemParam,