VertexSpecification

A VertexSpecification's role is to describe a Vertex structure. You must instantiate it with a compile-time struct describing your vertex format.

Constructors

this
this(GLProgram program)

Creates a vertex specification. The program is used to find the attribute location.

Members

Functions

unuse
void unuse()

Unuse this vertex specification. If you are using a VAO, you don't need to call it, since the attributes would be tied to the VAO activation.

use
void use()

Use this vertex specification.

vertexSize
size_t vertexSize()

Returns the size of the Vertex; this size can be computer after you added all your attributes

Examples

struct MyVertex
{
    vec3f position;
    vec4f diffuse;
    float shininess;
    @Normalized vec2i uv;
    vec3f normal;
}

Member names MUST match those used in the vertex shader as attributes.

Meta