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) -> Result<(), BlitError> { ... } fn blit_to<O: Output<R>>(&mut self, destination: &O, dest_rect: Rect, source_rect: Rect, mirror: Mirror, mask: Mask) -> Result<(), BlitError> { ... } fn draw<B: Batch<R> + ?Sized>(&mut self, batch: &B) -> Result<(), DrawError<Error>> { ... } fn draw_instanced<B: Batch<R> + ?Sized>(&mut self, batch: &B, count: InstanceCount, base: VertexCount) -> Result<(), DrawError<Error>> { ... } 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) -> Result<(), BlitError>
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) -> Result<(), BlitError>
Blit this stream to another Output
.
fn draw<B: Batch<R> + ?Sized>(&mut self, batch: &B) -> Result<(), DrawError<Error>>
Draw a simple Batch
.
fn draw_instanced<B: Batch<R> + ?Sized>(&mut self, batch: &B, count: InstanceCount, base: VertexCount) -> Result<(), DrawError<Error>>
Draw an instanced Batch
.
count
is the number of instances you wish to draw and
base
is the first instance to draw (instance offset).
fn flush<D>(&mut self, device: &mut D) where D: Device<Resources=R, CommandBuffer=Self::CommandBuffer>
Execute everything and clear the command buffer.
Implementors
impl<'a, R: Resources, C: CommandBuffer<R>, O: Output<R>> Stream<R> for (&'a mut Renderer<R, C>, &'a O)
impl<D: Device, O: Output<D::Resources>> Stream<D::Resources> for OwnedStream<D, O>