[][src]Trait starstruck::primitive::Vertex

pub trait Vertex: Debug + Copy + Send + Sync {
    fn stride() -> usize;
fn attributes() -> Vec<AttributeDesc>; }

This trait is used to represent a Vertex. A vertex is a 3 dimensional point in space and is used bu the GPU to create primitives (most often triangles) that is then used to calculate our pixels. A vertex can also have some metadata attached to it like colors or texture coordinates.

Required methods

fn stride() -> usize

Returns the stride size for this kind of vertex. This is the exact size in bytes for a single vertex.

fn attributes() -> Vec<AttributeDesc>

Attributes contains some additional info sent to the GPU.

Loading content...

Implementors

Loading content...