VertexSpecification

A VertexSpecification makes it easy to use Vertex Buffer Object with interleaved attributes. It's role is similar to the OpenGL VAO one. If the user requests it, the VertexSpecification can "take control" of a given VBO and/or IBO and automatically bind/unbind them when the VertexSpecification is used/unused. You have to specify every attribute manually for now.

TODO: Extract vertex specification from a struct at compile-time.

Constructors

this
this(OpenGL gl)

Creates a vertex specification.

Destructor

~this
~this()
Undocumented in source.

Members

Aliases

getVertexSize
deprecated alias getVertexSize = vertexSize

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

Functions

addDummyBytes
void addDummyBytes(int nBytes)

Adds padding space to the vertex specification. This is useful for alignment. TODO: clarify

addGeneric
void addGeneric(GLenum glType, int n, GLuint location, GLboolean normalize)

Adds a generic attribute to the vertex specification.

addGeneric
void addGeneric(GLenum glType, int n, string name, GLboolean normalize)

Adds a generic attribute to the vertex specification.

addLegacy
void addLegacy(VertexAttribute.Role role, GLenum glType, int n)

Adds an non-generic attribute to the vertex specification.

locateAttributes
void locateAttributes(GLProgram program)

Locates all the generic attributes who were given a name

unuse
void unuse()

Unuse this vertex specification.

use
void use(GLProgram program)

Use this vertex specification. Re-loads all the attribute locations before actually using it

use
void use()

Use this vertex specification. You should only call this function after a call on locateAttributes() or use(GLProgram).

vertexSize
size_t vertexSize()
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

IBO
GLBuffer IBO [@property getter]
GLBuffer IBO [@property setter]

This property allows the user to set/unset the used IBO. You can't select another IBO while this VertexSpecification is being used.

VBO
GLBuffer VBO [@property getter]
GLBuffer VBO [@property setter]

This property allows the user to set/unset the used VBO. You can't select another VBO while this VertexSpecification is being used.

Meta