|
lmgl 1.0.0
A lightweight OpenGL graphics engine library written in C++
|
Represents a single element in a buffer layout. More...
#include <buffer.hpp>
Public Member Functions | |
| BufferElement ()=default | |
| Default constructor. | |
| BufferElement (ShaderDataType type, const std::string &name, bool normalized=false) | |
| Parameterized constructor. | |
| unsigned int | get_component_count () const |
| Get the number of components in the buffer element. | |
Public Attributes | |
| std::string | name |
| Name of the buffer element. | |
| ShaderDataType | type |
| Data type of the buffer element. | |
| unsigned int | size |
| Size of the buffer element in bytes. | |
| size_t | offset |
| Offset of the buffer element within the buffer. | |
| bool | normalized |
| Indicates if the data is normalized. | |
Represents a single element in a buffer layout.
This structure defines the properties of a buffer element, including its name, data type, size, offset within the buffer, and whether it is normalized. It is used to describe the layout of vertex attributes in a vertex buffer.
| lmgl::renderer::BufferElement::BufferElement | ( | ShaderDataType | type, |
| const std::string & | name, | ||
| bool | normalized = false ) |
Parameterized constructor.
Initializes a BufferElement with the specified type, name, and normalization flag. Calculates the size based on the ShaderDataType.
| type | Data type of the buffer element. |
| name | Name of the buffer element. |
| normalized | Indicates if the data is normalized (default is false). |
| unsigned int lmgl::renderer::BufferElement::get_component_count | ( | ) | const |
Get the number of components in the buffer element.
This method returns the number of individual components that make up the buffer element based on its ShaderDataType.