pub trait Draw<P: PhaseItem>:
Send
+ Sync
+ 'static {
// 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 PhaseItem
s.
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
RenderCommand
s. For more details and an example see the RenderCommand
documentation.
Required Methods§
Sourcefn draw<'w>(
&mut self,
world: &'w World,
pass: &mut TrackedRenderPass<'w>,
view: Entity,
item: &P,
)
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
.