Trait gfx::extra::stream::Stream
[−]
[src]
pub trait Stream<R: Resources> {
type CommandBuffer: CommandBuffer<R>;
type Output: Output<R>;
fn get_output(&self) -> &Self::Output;
fn access(&mut self) -> (&mut Renderer<R, Self::CommandBuffer>, &Self::Output);
fn get_aspect_ratio(&self) -> f32 { ... }
fn clear(&mut self, data: ClearData) { ... }
fn blit_on<I: Output<R>>(&mut self, source: &I, source_rect: Rect, dest_rect: Rect, mirror: Mirror, mask: Mask) { ... }
fn blit_to<O: Output<R>>(&mut self, destination: &O, dest_rect: Rect, source_rect: Rect, mirror: Mirror, mask: Mask) { ... }
fn draw<B: Batch<R>>(&mut self, batch: &B) -> Result<(), DrawError<B>> { ... }
fn draw_instanced<B: Batch<R>>(&mut self, batch: &B, count: InstanceCount, base: VertexCount) -> Result<(), DrawError<B>> { ... }
fn flush<D>(&mut self, device: &mut D) where D: Device<Resources=R, CommandBuffer=Self::CommandBuffer> { ... }
}
Render stream abstraction.
Associated Types
type CommandBuffer: CommandBuffer<R>
Command buffer type to constraint the Renderer
.
type Output: Output<R>
Constrained Output
type.
Required Methods
fn get_output(&self) -> &Self::Output
Get the output only.
fn access(&mut self) -> (&mut Renderer<R, Self::CommandBuffer>, &Self::Output)
Access both of the stream components.
Provided Methods
fn get_aspect_ratio(&self) -> f32
Get width/height aspect, needed for projections.
fn clear(&mut self, data: ClearData)
Clear the canvas.
fn blit_on<I: Output<R>>(&mut self, source: &I, source_rect: Rect, dest_rect: Rect, mirror: Mirror, mask: Mask)
Blit on this stream from another Output
.
fn blit_to<O: Output<R>>(&mut self, destination: &O, dest_rect: Rect, source_rect: Rect, mirror: Mirror, mask: Mask)
Blit this stream to another Output
.
fn draw<B: Batch<R>>(&mut self, batch: &B) -> Result<(), DrawError<B>>
Draw a simple Batch
.
fn draw_instanced<B: Batch<R>>(&mut self, batch: &B, count: InstanceCount, base: VertexCount) -> Result<(), DrawError<B>>
Draw an instanced Batch
.
fn flush<D>(&mut self, device: &mut D) where D: Device<Resources=R, CommandBuffer=Self::CommandBuffer>
Execute everything and clear the command buffer.