The description of a single vertex attribute associated with a vertex layout, giving its size and location id.
More...
#include <vertex.hpp>
|
std::string | mName |
| The name of the attribute, per the shader.
|
|
GLint | mLayoutLocation |
| The layout location ID of the attribute, as specified by the shader.
|
|
GLuint | mNComponents |
| The number of components making up the attribute.
|
|
GLenum | mType |
| The type of component used by the attribute, such as GL_FLOAT or GL_UNSIGNED_BYTE.
|
|
std::size_t | mSize |
| The computed size of the attribute, in bytes.
|
|
|
static std::size_t | GetGLTypeSize (GLenum type) |
| Gets the size of the type of a single component of an attribute.
|
|
The description of a single vertex attribute associated with a vertex layout, giving its size and location id.
◆ VertexAttributeDescriptor()
ToyMaker::VertexAttributeDescriptor::VertexAttributeDescriptor |
( |
const std::string & | name, |
|
|
GLint | layoutLocation, |
|
|
GLuint | nComponents = 1, |
|
|
GLenum | type = GL_FLOAT ) |
|
inline |
Creates a single vertex attribute descriptor.
- Parameters
-
name | The name of the attribute, as seen by the shader. |
layoutLocation | The location ID of the attribute, as specified by the shader. |
nComponents | The number of components making up this attribute. |
type | The type of a single component of the attribute (like GL_FLOAT, GL_UNSIGNED_BYTE, and so on). |
◆ GetGLTypeSize()
static std::size_t ToyMaker::VertexAttributeDescriptor::GetGLTypeSize |
( |
GLenum | type | ) |
|
|
inlinestaticprivate |
Gets the size of the type of a single component of an attribute.
- Parameters
-
type | The GLenum of the component type. |
- Returns
- std::size_t The size of that component type, in bytes.
◆ operator==()
Compares two vertex attribute descriptors for equality.
Mainly used to determine whether the vertex layout requested by a render stage matches the vertex layout associated with some vertex data.
- Parameters
-
other | The vertex descriptor this one is being compared to. |
- Return values
-
true | The other description matches this one. |
false | The other description does not match this one. |
◆ mSize
std::size_t ToyMaker::VertexAttributeDescriptor::mSize |
The computed size of the attribute, in bytes.
Given by : size of mType
* mNComponents
The documentation for this struct was generated from the following file: