Struct gfx::extra::canvas::Canvas [] [src]

pub struct Canvas<W, D: Device, F> {
    pub output: W,
    pub device: D,
    pub factory: F,
    pub renderer: Renderer<D, D>,

A canvas with everything you need to draw on it.



Output window.


Graphics device.


Resource factory.


Renderer front-end.


impl<D: Device, F: Factory<D>, W: Window<D>> Canvas<W, D, F>

fn present(&mut self)

Show what we've been drawing all this time.

Trait Implementations

impl<D: Device, F: Factory<D>, O: Output<D>> Stream<D> for Canvas<O, D, F>

type CommandBuffer = D

type Output = O

fn get_output(&self) -> &O

fn access(&mut self) -> (&mut Renderer<D, D>, &O)

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>