|
lmgl 1.0.0
A lightweight OpenGL graphics engine library written in C++
|
Defines the layout of a buffer, consisting of multiple buffer elements. More...
#include <buffer.hpp>
Public Member Functions | |
| BufferLayout () | |
| Default constructor. | |
| BufferLayout (const std::initializer_list< BufferElement > &elements) | |
| Parameterized constructor. | |
| unsigned int | get_stride () const |
| Get the stride of the buffer layout. | |
| const std::vector< BufferElement > & | get_elements () const |
| Get the elements of the buffer layout. | |
| std::vector< BufferElement >::iterator | begin () |
| Iterator support for the buffer layout elements. | |
| std::vector< BufferElement >::iterator | end () |
| End iterator for mutable access. | |
| std::vector< BufferElement >::const_iterator | begin () const |
| Constant iterator support for the buffer layout elements. | |
| std::vector< BufferElement >::const_iterator | end () const |
| Constant end iterator. | |
Defines the layout of a buffer, consisting of multiple buffer elements.
This class manages a collection of BufferElement instances, calculating their offsets and the overall stride of the buffer. It provides methods to access the elements and their properties.
| lmgl::renderer::BufferLayout::BufferLayout | ( | const std::initializer_list< BufferElement > & | elements | ) |
Parameterized constructor.
Initializes the BufferLayout with a list of BufferElement instances. Calculates offsets and stride based on the provided elements.
| elements | Initializer list of BufferElement instances. |
| std::vector< BufferElement >::iterator lmgl::renderer::BufferLayout::begin | ( | ) |
Iterator support for the buffer layout elements.
Provides begin and end iterators for both mutable and constant access to the BufferElement instances in the layout.
| std::vector< BufferElement >::const_iterator lmgl::renderer::BufferLayout::begin | ( | ) | const |
Constant iterator support for the buffer layout elements.
Provides begin and end iterators for constant access to the BufferElement instances in the layout.
| std::vector< BufferElement >::iterator lmgl::renderer::BufferLayout::end | ( | ) |
End iterator for mutable access.
Provides an iterator to the end of the BufferElement instances in the layout.
| std::vector< BufferElement >::const_iterator lmgl::renderer::BufferLayout::end | ( | ) | const |
Constant end iterator.
Provides a constant iterator to the end of the BufferElement instances in the layout.
|
inline |
Get the elements of the buffer layout.
Returns a constant reference to the vector of BufferElement instances that make up the layout.
|
inline |
Get the stride of the buffer layout.
The stride represents the total size in bytes of all elements in the layout.