pub struct DrawContext {
pub transform: Mat4,
pub color: u32,
}
Expand description
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§
Source§impl Clone for DrawContext
impl Clone for DrawContext
Source§fn clone(&self) -> DrawContext
fn clone(&self) -> DrawContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DrawContext
impl Debug for DrawContext
impl Copy for DrawContext
Auto Trait Implementations§
impl Freeze for DrawContext
impl RefUnwindSafe for DrawContext
impl Send for DrawContext
impl Sync for DrawContext
impl Unpin for DrawContext
impl UnwindSafe for DrawContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more