Struct graphics_tree::GraphicsTree

source ·
pub struct GraphicsTree { /* private fields */ }
Expand description

A graphics backend that stores and optimizes commands

Implementations§

source§

impl GraphicsTree

source

pub fn new() -> GraphicsTree

Creates a new graphics tree.

source

pub fn is_empty(&self) -> bool

Returns true if graphics tree is empty.

source

pub fn clear(&mut self)

Clears all graphics.

source

pub fn draw<F, T, G>(&self, texture_buffer: &mut TextureBuffer<F, T>, g: &mut G)
where T: ImageSize + CreateTexture<F>, G: Graphics<Texture = T>,

Draws graphics to backend.

Trait Implementations§

source§

impl Graphics for GraphicsTree

§

type Texture = Texture

The texture type associated with the back-end. Read more
source§

fn clear_color(&mut self, color: Color)

Clears background with a color. Read more
source§

fn clear_stencil(&mut self, value: u8)

Clears stencil buffer with a value, usually 0. Read more
source§

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

Renders list of 2d triangles using a solid color. Read more
source§

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

Same as tri_list, but with individual vertex colors. Read more
source§

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

Renders list of 2d triangles using a color and a texture. Read more
source§

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

Same as tri_list_uv, but with individual vertex colors. Read more
source§

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

Draws a rectangle. Read more
source§

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

Draws a polygon. Read more
source§

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

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

Draws image. Read more
source§

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

Draws ellipse. Read more
source§

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

Draws line. Read more
source§

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

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.