Struct gfx::extra::device::Graphics [] [src]

pub struct Graphics<D: Device, F> {
    pub device: D,
    pub factory: F,
    pub renderer: Renderer<D, D>,
    // some fields omitted
}

A convenient wrapper suitable for single-threaded operation.

Fields

device

Graphics device.

factory

Resource factory.

renderer

Renderer front-end.

Methods

impl<D: Device, F: Factory<D>> Graphics<D, F>

fn clear<O: Output<D>>(&mut self, data: ClearData, mask: Mask, out: &O)

Clear the output with given ClearData.

fn draw<'a, T: ShaderParam<Resources=D>, O: Output<D>>(&'a mut self, batch: &'a RefBatch<T>, out: &O) -> Result<(), DrawError<OutOfBounds>>

Draw a RefBatch batch.

fn draw_core<'a, T: ShaderParam<Resources=D>, O: Output<D>>(&'a mut self, core: &'a CoreBatch<T>, slice: &'a Slice<D>, params: &'a T, out: &O) -> Result<(), DrawError<OutOfBounds>>

Draw a CoreBatch batch.

fn end_frame(&mut self)

Submit the internal command buffer and reset for the next frame.

fn cleanup(&mut self)

Cleanup resources after the frame.

Methods from Deref<Target=Context<D>>

fn new() -> Context<R>

Create a new empty Context

fn make_core<T: ShaderParam<Resources=R>>(&mut self, program: &ProgramHandle<R>, mesh: &Mesh<R>, state: &DrawState) -> Result<CoreBatch<T>, Error>

Produce a new CoreBatch

fn make_batch<T: ShaderParam<Resources=R>>(&mut self, program: &ProgramHandle<R>, params: T, mesh: &Mesh<R>, slice: Slice<R>, state: &DrawState) -> Result<RefBatch<T>, Error>

Produce a new RefBatch

fn bind<'a, T: ShaderParam<Resources=R> + 'a>(&'a self, core: &'a CoreBatch<T>, slice: &'a Slice<R>, params: &'a T) -> CoreBatchFull<'a, T>

Complete a CoreBatch temporarily by turning it into CoreBatchFull

fn get_data<'a, T: ShaderParam<Resources=R> + 'a>(&'a self, core: &CoreBatch<T>, slice: &'a Slice<R>) -> Result<BatchData<'a, T>, OutOfBounds>

Get data from a batch in the format required for Batch

Trait Implementations

impl<D: Device, F> Deref for Graphics<D, F>

type Target = Context<D>

fn deref(&self) -> &Context<D>

impl<D: Device, F> DerefMut for Graphics<D, F>

fn deref_mut(&mut self) -> &mut Context<D>