Trait glitter::vertex_data::VertexDatum [] [src]

pub unsafe trait VertexDatum: Copy {
    fn attrib_type() -> VertexAttributeType;
}

A single value that can be treated as a part of a vertex. Implementors should map to a GLSL primitive that can be used as a vertex attribute. For example, [f32; 2] corresponds to vec2 in memory layout and structure.

Safety

This type will be transmuted to a slice according to the value returned by the attrib_type method. Implementing this method incorrectly will lead to memory unsafety.

Required Methods

Return the data type this datum corresponds to.

Safety

An instance of this type must match the size and memory layout specified by the returned VertexAttributeType. Additionally this function must not painc. Safe code must be able to rely on this property.

Implementations on Foreign Types

impl<T: VertexPrimitive> VertexDatum for [T; 1]
[src]

impl<T: VertexPrimitive> VertexDatum for [T; 2]
[src]

impl<T: VertexPrimitive> VertexDatum for [T; 3]
[src]

impl<T: VertexPrimitive> VertexDatum for [T; 4]
[src]

impl<T: VertexPrimitive> VertexDatum for Vector2<T>
[src]

impl<T: VertexPrimitive> VertexDatum for Vector3<T>
[src]

impl<T: VertexPrimitive> VertexDatum for Vector4<T>
[src]

Implementors