VoltAir
|
The definition of a vertex attribute, such as a position vector, or a texture coordinate. More...
Public Member Functions | |
Attribute () | |
Constructor creating an empty attribute definition. More... | |
Attribute (const std::string &name, GLuint size, GLboolean normalized, GLuint type) | |
Constructor creating an attribute with the properties. More... | |
int | getComponentSize () const |
Computes the number of bytes per component. More... | |
Static Public Member Functions | |
static int | getComponentSizeStatic (GLuint type) |
Computes the number of bytes per component for a given GL type. More... | |
Public Attributes | |
std::string | name |
Name of the attribute, as specified in the shader code. More... | |
GLuint | size = 0 |
Number of components per vertex attribute. More... | |
GLboolean | normalized = GL_FALSE |
Specifies whether certain types should be normalized before accessed by shaders. More... | |
GLuint | type = GL_FLOAT |
GL type of each component in the array. More... | |
The definition of a vertex attribute, such as a position vector, or a texture coordinate.
Vertex attributes are defined by their name, and the type of data they contain. For example, 2D texture coordinates are float vectors of width two. Attributes are associated with shaders and meshes. They determine how the data in a mesh should be read by the shader.
Attribute::Attribute | ( | ) |
Constructor creating an empty attribute definition.
Attribute::Attribute | ( | const std::string & | name, |
GLuint | size, | ||
GLboolean | normalized, | ||
GLuint | type | ||
) |
Constructor creating an attribute with the properties.
name | Name of the attribute |
size | Number of components per vertex attribute |
normalized | Specifies whether certain types should be normalized before accessed |
type | GL type of each component in the array |
|
inline |
Computes the number of bytes per component.
|
static |
Computes the number of bytes per component for a given GL type.
type | GL type to get the size of |
std::string Attribute::name |
Name of the attribute, as specified in the shader code.
GLboolean Attribute::normalized = GL_FALSE |
Specifies whether certain types should be normalized before accessed by shaders.
GLuint Attribute::size = 0 |
Number of components per vertex attribute.
GLuint Attribute::type = GL_FLOAT |
GL type of each component in the array.