#[repr(C)]pub struct QuadData {
pub color: [f32; 4],
pub src_rect: [f32; 4],
pub dst_rect: [f32; 4],
pub offset: [f32; 2],
pub rotation: f32,
}
Expand description
Data we need for each quad instance. DrawParam gets turned into this, eventually. We have to be quite particular about layout since this gets fed straight to the shader.
Fields§
§color: [f32; 4]
Color to blend the result texture with.
src_rect: [f32; 4]
Source region on the texture to draw, coordinates range from 0 to 1
dst_rect: [f32; 4]
Destination rectangle in your render target to draw the texture on, coordinates are whatever you set in your transform and viewport.
offset: [f32; 2]
Rotation offset – A point within your dst_rect
to rotate around,
coordinates range from 0 to 1
rotation: f32
Rotation, in radians, CCW.
Implementations§
Trait Implementations§
Source§impl PartialOrd for QuadData
impl PartialOrd for QuadData
impl Copy for QuadData
impl Pod for QuadData
impl StructuralPartialEq for QuadData
Auto Trait Implementations§
impl Freeze for QuadData
impl RefUnwindSafe for QuadData
impl Send for QuadData
impl Sync for QuadData
impl Unpin for QuadData
impl UnwindSafe for QuadData
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