#[repr(C)]pub struct Vertex2D {
pub x: f32,
pub y: f32,
pub u: f32,
pub v: f32,
pub r: u8,
pub g: u8,
pub b: u8,
pub a: u8,
}
Expand description
Vertex describing a 2D point with a texture coordinate and a color.
Fields§
§x: f32
The horizontal coordinate of the position of this vertex.
y: f32
The vertical coordinate of the position of this vertex.
u: f32
The horizontal texture coordinate of this vertex, 0 referring to the left edge, and 1 referring to the right edge of the texture.
v: f32
The vertical texture coordinate of this vertex, 0 referring to the top edge, and 1 referring to the bottom edge of the texture.
r: u8
The red channel of the vertex color, which is multiplied with the texture’s red channel (or used as is, if no texture is used).
g: u8
The green channel of the vertex color, which is multiplied with the texture’s green channel (or used as is, if no texture is used).
b: u8
The blue channel of the vertex color, which is multiplied with the texture’s blue channel (or used as is, if no texture is used).
a: u8
The alpha channel of the vertex color, which is multiplied with the texture’s alpha channel (or used as is, if no texture is used).
Implementations§
Trait Implementations§
impl Copy for Vertex2D
impl Pod for Vertex2D
Auto Trait Implementations§
impl Freeze for Vertex2D
impl RefUnwindSafe for Vertex2D
impl Send for Vertex2D
impl Sync for Vertex2D
impl Unpin for Vertex2D
impl UnwindSafe for Vertex2D
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
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self
.