Trait graphics::Graphics [] [src]

pub trait Graphics {
    type Texture: ImageSize;
    fn clear_color(&mut self, color: [f32; 4]);
    fn clear_stencil(&mut self, value: u8);
    fn tri_list<F>(&mut self, draw_state: &DrawState, color: &[f32; 4], f: F) where F: FnMut(&mut FnMut(&[f32]));
    fn tri_list_uv<F>(&mut self, draw_state: &DrawState, color: &[f32; 4], texture: &Self::Texture, f: F) where F: FnMut(&mut FnMut(&[f32], &[f32]));
}

Implemented by all graphics back-ends.

Associated Types

type Texture: ImageSize

The texture type associated with the back-end.

Required Methods

fn clear_color(&mut self, color: [f32; 4])

Clears background with a color.

fn clear_stencil(&mut self, value: u8)

Clears stencil buffer with a value.

fn tri_list<F>(&mut self, draw_state: &DrawState, color: &[f32; 4], f: F) where F: FnMut(&mut FnMut(&[f32]))

Renders list of 2d triangles.

fn tri_list_uv<F>(&mut self, draw_state: &DrawState, color: &[f32; 4], texture: &Self::Texture, f: F) where F: FnMut(&mut FnMut(&[f32], &[f32]))

Renders list of 2d triangles.

A texture coordinate is assigned per vertex. The texture coordinates refers to the current texture.

Implementors