Struct gfx_graphics::GfxGraphics [] [src]

pub struct GfxGraphics<'a, R, C, O> where R: Resources + 'a, C: CommandBuffer<R> + 'a, O: Output<R> + 'a, R::Buffer: 'a, R::ArrayBuffer: 'a, R::Shader: 'a, R::Program: 'a, R::FrameBuffer: 'a, R::Surface: 'a, R::Texture: 'a, R::Sampler: 'a {
    // some fields omitted
}

Used for rendering 2D graphics.

Methods

impl<'a, R, C, O> GfxGraphics<'a, R, C, O> where R: Resources, C: CommandBuffer<R>, O: Output<R>
[src]

fn new(renderer: &'a mut Renderer<R, C>, output: &'a O, g2d: &'a mut Gfx2d<R>) -> Self

Creates a new object for rendering 2D graphics.

fn has_texture_alpha(&self, texture: &Texture<R>) -> bool

Returns true if texture has alpha channel.

Trait Implementations

impl<'a, R, C, O> Graphics for GfxGraphics<'a, R, C, O> where R: Resources, C: CommandBuffer<R>, O: Output<R>, R::Buffer: 'a, R::ArrayBuffer: 'a, R::Shader: 'a, R::Program: 'a, R::FrameBuffer: 'a, R::Surface: 'a, R::Texture: 'a, R::Sampler: 'a
[src]

type Texture = Texture<R>

The texture type associated with the back-end.

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. Read more

fn rectangle<R>(&mut self, r: &Rectangle, rectangle: R, draw_state: &DrawState, transform: [[f64; 3]; 2]) where R: Into<[f64; 4]>

Draws a rectangle.

fn polygon(&mut self, p: &Polygon, polygon: &[[f64; 2]], draw_state: &DrawState, transform: [[f64; 3]; 2])

Draws a polygon.

fn polygon_tween_lerp(&mut self, p: &Polygon, polygons: &[&[[f64; 2]]], tween_factor: f64, draw_state: &DrawState, transform: [[f64; 3]; 2])

Draws a tweened polygon using linear interpolation.

fn image(&mut self, image: &Image, texture: &Self::Texture, draw_state: &DrawState, transform: [[f64; 3]; 2])

Draws image.

fn ellipse<R>(&mut self, e: &Ellipse, rectangle: R, draw_state: &DrawState, transform: [[f64; 3]; 2]) where R: Into<[f64; 4]>

Draws ellipse.

fn line<L>(&mut self, l: &Line, line: L, draw_state: &DrawState, transform: [[f64; 3]; 2]) where L: Into<[f64; 4]>

Draws line.

fn circle_arc<R>(&mut self, c: &CircleArc, rectangle: R, draw_state: &DrawState, transform: [[f64; 3]; 2]) where R: Into<[f64; 4]>

Draws circle arc.

fn deform_image(&mut self, d: &DeformGrid, texture: &Self::Texture, draw_state: &DrawState, transform: [[f64; 3]; 2])

Draws deformed image.