#[repr(packed(1))]pub struct Vertex {
pub pos: [f32; 2],
pub uv: [f32; 2],
pub color: [f32; 4],
pub mode: f32,
}
Expand description
The Vertex
type passed to the vertex shader.
Fields§
§pos: [f32; 2]
The position of the vertex within device coordinates. [-1.0, -1.0] is the left top position of the display.
uv: [f32; 2]
The coordinates of the texture used by this Vertex
.
[0.0, 0.0] is the left top position of the texture.
color: [f32; 4]
A color associated with the Vertex
.
The color is multiplied by the end result of the fragment shader.
When mode
is not 1, the default value is white ([1.0; 4])
mode: f32
The mode with which the Vertex
will be drawn within the fragment shader.
0
for rendering an image.
1
for rendering non-textured 2D geometry.
If any other value is given, the fragment shader will not output any color.
Trait Implementations§
impl Copy for Vertex
Auto Trait Implementations§
impl Freeze for Vertex
impl RefUnwindSafe for Vertex
impl Send for Vertex
impl Sync for Vertex
impl Unpin for Vertex
impl UnwindSafe for Vertex
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