Vertex buffer layout.
More...
#include <vertex_buffer_layout.hpp>
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.
- See also
- vertex_attribute
-
shader_data_type
-
vertex_buffer.hpp
- Examples
- batches.cpp, sandbox.cpp, and teapot.cpp.
Definition at line 78 of file vertex_buffer_layout.hpp.
◆ vertex_buffer_layout() [1/2]
staplegl::vertex_buffer_layout::vertex_buffer_layout |
( |
| ) |
|
|
default |
◆ vertex_buffer_layout() [2/2]
staplegl::vertex_buffer_layout::vertex_buffer_layout |
( |
std::initializer_list< vertex_attribute > |
attributes | ) |
|
|
inline |
◆ get_attributes()
auto staplegl::vertex_buffer_layout::get_attributes |
( |
| ) |
const -> std::span<const vertex_attribute>
|
|
inlinenoexcept |
Get the data of the vertex buffer layout as a non-owning view.
- Returns
- std::span<const vertex_attribute>, the data of the vertex buffer layout.
Definition at line 120 of file vertex_buffer_layout.hpp.
◆ operator[]()
auto staplegl::vertex_buffer_layout::operator[] |
( |
std::size_t |
index | ) |
const -> const vertex_attribute& |
|
inline |
Get a single attribute from the vertex buffer layout.
- Parameters
-
index | the index of the attribute to get. |
- Returns
- const vertex_attribute& the attribute at the specified index.
Definition at line 131 of file vertex_buffer_layout.hpp.
◆ stride()
constexpr auto staplegl::vertex_buffer_layout::stride |
( |
| ) |
const -> std::size_t |
|
inlineconstexprnoexcept |
Get the stride of the vertex buffer layout.
- Returns
- std::size_t, the stride of the vertex buffer layout.
Definition at line 106 of file vertex_buffer_layout.hpp.
◆ stride_elements()
constexpr auto staplegl::vertex_buffer_layout::stride_elements |
( |
| ) |
const -> std::size_t |
|
inlineconstexprnoexcept |
Get the stride of the vertex buffer layout in elements (assuming float-only data).
- Returns
- std::size_t, the number of elements in a vertex.
Definition at line 113 of file vertex_buffer_layout.hpp.
◆ m_attributes
◆ m_stride
std::size_t staplegl::vertex_buffer_layout::m_stride {} |
|
private |
The documentation for this class was generated from the following file: