[][src]Struct weldr::DrawContext

pub struct DrawContext {
    pub transform: Mat4,
    pub color: u32,
}

Drawing context used when iterating over all drawing commands of a file via SourceFile::iter().

Fields

transform: Mat4

Current transformation matrix for the drawing command. This is the accumulated transformation of all parent files.

When drawing a primitive (line, triangle, quad), the actual position of vertices is obtained by transforming the local-space positions of the drawing command by this transformation matrix.

let v0 = draw_ctx.transform * cmd.vertices[0];
color: u32

Current color for substitution of color 16.

Trait Implementations

impl Clone for DrawContext[src]

impl Copy for DrawContext[src]

impl Debug for DrawContext[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.