|
StapleGL
Header-only C++20 OpenGL wrapper
|
Vertex buffer layout. More...
#include <vertex_buffer_layout.hpp>
Public Member Functions | |
| vertex_buffer_layout ()=default | |
| vertex_buffer_layout (std::initializer_list< vertex_attribute > attributes) | |
| Construct a new vertex buffer layout object. | |
| constexpr auto | stride () const noexcept -> std::size_t |
| Get the stride of the vertex buffer layout. | |
| constexpr auto | stride_elements () const noexcept -> std::size_t |
| Get the stride of the vertex buffer layout in elements (assuming float-only data). | |
| auto | get_attributes () const noexcept -> std::span< const vertex_attribute > |
| Get the data of the vertex buffer layout as a non-owning view. | |
| auto | operator[] (std::size_t index) const -> const vertex_attribute & |
| Get a single attribute from the vertex buffer layout. | |
Private Attributes | |
| std::vector< vertex_attribute > | m_attributes |
| std::size_t | m_stride {} |
Vertex buffer layout.
Represents a vertex buffer layout, that is, a collection of vertex attributes. Through this class one can specify a layout through which a buffer's data can be interpreted by OpenGL.
Definition at line 78 of file vertex_buffer_layout.hpp.
|
default |
|
inline |
Construct a new vertex buffer layout object.
| attributes | a list of vertex attributes. |
Definition at line 92 of file vertex_buffer_layout.hpp.
|
inlinenoexcept |
Get the data of the vertex buffer layout as a non-owning view.
Definition at line 120 of file vertex_buffer_layout.hpp.
|
inline |
Get a single attribute from the vertex buffer layout.
| index | the index of the attribute to get. |
Definition at line 131 of file vertex_buffer_layout.hpp.
|
inlineconstexprnoexcept |
Get the stride of the vertex buffer layout.
Definition at line 106 of file vertex_buffer_layout.hpp.
|
inlineconstexprnoexcept |
Get the stride of the vertex buffer layout in elements (assuming float-only data).
Definition at line 113 of file vertex_buffer_layout.hpp.
|
private |
Definition at line 81 of file vertex_buffer_layout.hpp.
|
private |
Definition at line 82 of file vertex_buffer_layout.hpp.