[][src]Struct luminance::vertex::VertexAttribDesc

pub struct VertexAttribDesc {
    pub ty: VertexAttribType,
    pub dim: VertexAttribDim,
    pub unit_size: usize,
    pub align: usize,
}

Vertex attribute format.

Vertex attributes (such as positions, colors, texture UVs, normals, etc.) have all a specific format that must be passed to the GPU. This type gathers information about a single vertex attribute and is completly agnostic of the rest of the attributes used to form a vertex.

A type is associated with a single value of type VertexAttribDesc via the VertexAttrib trait. If such an implementor exists for a type, it means that this type can be used as a vertex attribute.

Fields

ty: VertexAttribType

Type of the attribute. See VertexAttribType for further details.

dim: VertexAttribDim

Dimension of the attribute. It should be in 1–4. See VertexAttribDim for further details.

unit_size: usize

Size in bytes that a single element of the attribute takes. That is, if your attribute has a dimension set to 2, then the unit size should be the size of a single element (not two).

align: usize

Alignment of the attribute. The best advice is to respect what Rust does, so it’s highly recommended to use ::std::mem::align_of to let it does the job for you.

Methods

impl VertexAttribDesc[src]

pub fn normalize(self) -> Self[src]

Normalize a vertex attribute format’s type.

Trait Implementations

impl Eq for VertexAttribDesc[src]

impl Clone for VertexAttribDesc[src]

impl PartialEq<VertexAttribDesc> for VertexAttribDesc[src]

impl Copy for VertexAttribDesc[src]

impl Hash for VertexAttribDesc[src]

impl Debug for VertexAttribDesc[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]