nCine::GLVertexFormat::Attribute class

A single vertex attribute within a vertex format.

Describes one vertex attribute: its shader location index, component count, GL type, normalization, stride, offset and the source vertex buffer object.

Constructors, destructors, conversion operators

Attribute()

Public functions

void Init(std::uint32_t index, GLint size, GLenum type)
Initializes the attribute as enabled with the given index, component count and type.
auto operator==(const Attribute& other) const -> bool
auto operator!=(const Attribute& other) const -> bool
auto IsEnabled() const -> bool
Returns true if the attribute is enabled.
auto GetVbo() const -> const GLBufferObject*
Returns the source vertex buffer object.
auto GetIndex() const -> std::uint32_t
Returns the shader location index of the attribute.
auto GetSize() const -> GLint
Returns the number of components per attribute.
auto GetType() const -> GLenum
Returns the data type of each component (e.g. GL_FLOAT).
auto IsNormalized() const -> bool
Returns true if integer values are normalized to a floating-point range.
auto GetStride() const -> GLsizei
Returns the byte offset between consecutive attributes.
auto GetPointer() const -> const GLvoid*
Returns the byte offset of the first component within the buffer.
auto GetBaseOffset() const -> std::uint32_t
Returns the additional base vertex byte offset.
void SetVboParameters(GLsizei stride, const GLvoid* pointer)
Sets the stride and the byte offset of the attribute within the buffer.
void setVbo(const GLBufferObject* vbo)
Sets the source vertex buffer object.
void SetBaseOffset(std::uint32_t baseOffset)
Sets the additional base vertex byte offset.
void SetSize(GLint size)
Sets the number of components per attribute.
void SetType(GLenum type)
Sets the data type of each component.
void SetNormalized(bool normalized)
Sets whether integer values are normalized to a floating-point range.