[][src]Struct gfx_graphics::GfxGraphics

pub struct GfxGraphics<'a, R, C> where
    R: Resources + 'a,
    C: CommandBuffer<R> + 'a,
    R::Buffer: 'a,
    R::Shader: 'a,
    R::Program: 'a,
    R::Texture: 'a,
    R::Sampler: 'a, 
{ pub encoder: &'a mut Encoder<R, C>, // some fields omitted }

Used for rendering 2D graphics.

Fields

encoder: &'a mut Encoder<R, C>

Provide access to the gfx::Encoder in case a user needs to update textures for caching, etc.

Methods

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

pub fn new(
    encoder: &'a mut Encoder<R, C>,
    output_color: &'a RenderTargetView<R, Srgba8>,
    output_stencil: &'a DepthStencilView<R, DepthStencil>,
    g2d: &'a mut Gfx2d<R>
) -> Self
[src]

Creates a new object for rendering 2D graphics.

pub fn has_texture_alpha(&self, texture: &Texture<R>) -> bool where
    R: Resources, 
[src]

Returns true if texture has alpha channel.

Trait Implementations

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

type Texture = Texture<R>

The texture type associated with the back-end. 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. Read more

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

Draws a polygon. Read more

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

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

Draws image. Read more

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

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

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

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

Draws deformed image. Read more

Auto Trait Implementations

impl<'a, R, C> Send for GfxGraphics<'a, R, C> where
    <R as Resources>::Buffer: Send + Sync,
    <R as Resources>::DepthStencilView: Send + Sync,
    <R as Resources>::Fence: Send + Sync,
    <R as Resources>::Mapping: Send,
    <R as Resources>::PipelineStateObject: Send + Sync,
    <R as Resources>::Program: Send + Sync,
    <R as Resources>::RenderTargetView: Send + Sync,
    <R as Resources>::Sampler: Send + Sync,
    <R as Resources>::Shader: Send + Sync,
    <R as Resources>::ShaderResourceView: Send + Sync,
    <R as Resources>::Texture: Send + Sync,
    <R as Resources>::UnorderedAccessView: Send + Sync

impl<'a, R, C> Sync for GfxGraphics<'a, R, C> where
    C: Sync,
    <R as Resources>::Buffer: Send + Sync,
    <R as Resources>::DepthStencilView: Send + Sync,
    <R as Resources>::Fence: Send + Sync,
    <R as Resources>::Mapping: Send,
    <R as Resources>::PipelineStateObject: Send + Sync,
    <R as Resources>::Program: Send + Sync,
    <R as Resources>::RenderTargetView: Send + Sync,
    <R as Resources>::Sampler: Send + Sync,
    <R as Resources>::Shader: Send + Sync,
    <R as Resources>::ShaderResourceView: Send + Sync,
    <R as Resources>::Texture: Send + Sync,
    <R as Resources>::UnorderedAccessView: Send + Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.