A struct describing the name and type of each attribute designated as an instance attribute.
More...
#include <instance.hpp>
|
const std::string | mName |
| Name of the attribute.
|
|
const GLint | mLayoutLocation |
| The OpenGL shader attribute location of this attribute.
|
|
const GLuint | mNComponents |
| The number or components or dimensions that represent this attribute.
|
|
const GLenum | mType |
| The underlying OpenGL type of the attribute.
|
|
const std::size_t | mSize |
| The size of the attribute, computed as size of mType * mNComponents.
|
|
|
static std::size_t | GetGLTypeSize (GLenum type) |
| Returns the size of a few known OpenGL component types, throws an error otherwise.
|
|
A struct describing the name and type of each attribute designated as an instance attribute.
◆ InstanceAttributeDescriptor()
ToyMaker::InstanceAttributeDescriptor::InstanceAttributeDescriptor |
( |
const std::string & | name, |
|
|
const GLint | layoutLocation, |
|
|
GLuint | nComponents, |
|
|
GLenum | type = GL_FLOAT ) |
|
inline |
Constructs a new instance attribute descriptor.
- Parameters
-
name | The name of the attribute. |
layoutLocation | The OpenGL attribute location of the attribute. |
nComponents | The number of dimensions this attribute has, a multiplier on the storage size of type. |
type | The actual OpenGL type of the attribute, like GL_FLOAT |
◆ GetGLTypeSize()
static std::size_t ToyMaker::InstanceAttributeDescriptor::GetGLTypeSize |
( |
GLenum | type | ) |
|
|
inlinestaticprivate |
Returns the size of a few known OpenGL component types, throws an error otherwise.
- Parameters
-
type | The OpenGL type of the attribute component. |
- Returns
- std::size_t The attribute component's size, in bytes.
◆ operator==()
Compares two vertex attributes for equality.
- Todo
- code duplicated from VertexAttributeDescriptor. Refactor needed.
- Parameters
-
other | The attribute descriptor this one is being compared to. |
- Return values
-
true | Attributes are the same; |
false | Attributes are different; |
The documentation for this struct was generated from the following file: