pub struct VertexDesc { /* private fields */ }
Expand description
A descriptor of the contents of one aspect of data for a Vertex; in essence a ‘field’ of a Vertex structure
Such an field is a scalar, vector, or matrix of BufferElementType, starting at a byte offset within the parent structure, and it has a target VertexAttr usage
Implementations§
Source§impl VertexDesc
impl VertexDesc
Sourcepub fn scalar(
attr: VertexAttr,
ele_type: BufferElementType,
byte_offset: u16,
) -> Self
pub fn scalar( attr: VertexAttr, ele_type: BufferElementType, byte_offset: u16, ) -> Self
Create a scalar [VertexDescr] for a VertexAttr of a given BufferElementType, at an offset within its parent data.
Sourcepub fn vec(
attr: VertexAttr,
ele_type: BufferElementType,
len: u8,
byte_offset: u16,
) -> Self
pub fn vec( attr: VertexAttr, ele_type: BufferElementType, len: u8, byte_offset: u16, ) -> Self
Create a vector of ‘len’ [VertexDescr] for a VertexAttr of a given BufferElementType, at an offset within its parent data.
Sourcepub fn mat(
attr: VertexAttr,
ele_type: BufferElementType,
dims: [u8; 2],
byte_offset: u16,
) -> Self
pub fn mat( attr: VertexAttr, ele_type: BufferElementType, dims: [u8; 2], byte_offset: u16, ) -> Self
Create a matrix of ‘dims’ [VertexDescr] for a VertexAttr of a given BufferElementType, at an offset within its parent data.
Sourcepub fn new(
attr: VertexAttr,
ele_type: BufferElementType,
dims: [u8; 2],
byte_offset: u16,
) -> Self
pub fn new( attr: VertexAttr, ele_type: BufferElementType, dims: [u8; 2], byte_offset: u16, ) -> Self
Create a new of ‘dims’ [VertexDescr] for a VertexAttr of a given BufferElementType, at an offset within its parent data.
Sourcepub fn vertex_attr(&self) -> VertexAttr
pub fn vertex_attr(&self) -> VertexAttr
Retrieve the vertex attribute this field is for
Sourcepub fn byte_offset(&self) -> u16
pub fn byte_offset(&self) -> u16
Retrieve the byte_offset within the parent structure for this field
Sourcepub fn dims(&self) -> [u8; 2]
pub fn dims(&self) -> [u8; 2]
Retrieve the dimensions of this field - if scalar, for example, this is [0,0]
Sourcepub fn ele_type(&self) -> BufferElementType
pub fn ele_type(&self) -> BufferElementType
Retrieve the BufferElementType of the field
Sourcepub fn byte_length(&self) -> u32
pub fn byte_length(&self) -> u32
Get the byte length of the field
Trait Implementations§
Source§impl Clone for VertexDesc
impl Clone for VertexDesc
Source§fn clone(&self) -> VertexDesc
fn clone(&self) -> VertexDesc
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more