Vertex Array Object (VAO) wrapper.
More...
#include <vertex_array.hpp>
|
static void | unbind () |
| Unbind the vertex array object.
|
|
Vertex Array Object (VAO) wrapper.
Vertex Array Objects are OpenGL objects that store all of the state needed to supply vertex data, that is, an index buffer (also called an Element Buffer Object) and one or more vertex buffers.
Rendering using VAOs is advised as it simplifies the process of rendering multiple objects with different vertex data and different rendering modes.
- See also
- https://www.khronos.org/opengl/wiki/Vertex_Specification#Vertex_Array_Object
-
vertex_buffer.hpp
-
index_buffer.hpp
-
vertex_buffer_layout.hpp
- Examples
- batches.cpp, sandbox.cpp, and teapot.cpp.
Definition at line 51 of file vertex_array.hpp.
◆ iterator_t
Iterator type returned from add_vertex_buffer.
Definition at line 111 of file vertex_array.hpp.
◆ vertex_array() [1/3]
staplegl::vertex_array::vertex_array |
( |
| ) |
|
|
inlinenoexcept |
◆ ~vertex_array()
staplegl::vertex_array::~vertex_array |
( |
| ) |
|
|
inline |
◆ vertex_array() [2/3]
staplegl::vertex_array::vertex_array |
( |
const vertex_array & |
| ) |
|
|
delete |
◆ vertex_array() [3/3]
staplegl::vertex_array::vertex_array |
( |
vertex_array && |
other | ) |
|
|
inlinenoexcept |
Construct a new vertex array object from another one.
constructs a VAO by stealing the ID and the attached VBOs and EBOs from another VAO.
- Parameters
-
other | the vertex array object to copy from. |
Definition at line 76 of file vertex_array.hpp.
◆ add_vertex_buffer()
Add a vertex buffer to the vertex array object.
- Parameters
-
vbo | the vertex buffer object to add. |
- Returns
- iterator_t an iterator to the newly added vertex buffer, it is guaranteed to be valid for the lifetime of the vertex array object, useful to keep track of the individual VBOs.
- See also
- vertex_buffer.hpp
- Examples
- batches.cpp, sandbox.cpp, and teapot.cpp.
Definition at line 223 of file vertex_array.hpp.
◆ bind()
void staplegl::vertex_array::bind |
( |
| ) |
const |
|
inline |
◆ buffers_data()
constexpr auto staplegl::vertex_array::buffers_data |
( |
| ) |
-> std::list<vertex_buffer>& |
|
inlineconstexpr |
Get the vertex buffer object at the specified index.
- Returns
- std::list<vertex_buffer>& the vertex buffer object at the specified index.
Definition at line 172 of file vertex_array.hpp.
◆ clear_instance_buffer()
void staplegl::vertex_array::clear_instance_buffer |
( |
| ) |
|
|
inline |
◆ id()
constexpr auto staplegl::vertex_array::id |
( |
| ) |
const -> uint32_t |
|
inlineconstexpr |
Get the vertex array object id.
- Returns
- uint32_t the vertex array object id.
Definition at line 165 of file vertex_array.hpp.
◆ index_data()
constexpr auto staplegl::vertex_array::index_data |
( |
| ) |
-> index_buffer& |
|
inlineconstexpr |
◆ instanced_data()
constexpr auto staplegl::vertex_array::instanced_data |
( |
| ) |
-> std::optional<vertex_buffer_inst>& |
|
inlineconstexpr |
Get the instance buffer object.
- Returns
- std::optional<vertex_buffer_inst>& the instance buffer object.
- Examples
- batches.cpp.
Definition at line 179 of file vertex_array.hpp.
◆ operator=() [1/2]
◆ operator=() [2/2]
Move assignment operator.
- Parameters
-
other | the vertex array object to move from. |
- Returns
- vertex_array& a reference to the moved vertex array object.
Definition at line 93 of file vertex_array.hpp.
◆ set_index_buffer()
void staplegl::vertex_array::set_index_buffer |
( |
index_buffer && |
ibo | ) |
|
|
inline |
◆ set_instance_buffer()
◆ unbind()
void staplegl::vertex_array::unbind |
( |
| ) |
|
|
inlinestatic |
◆ attrib_index
uint32_t staplegl::vertex_array::attrib_index {} |
|
private |
◆ m_id
std::uint32_t staplegl::vertex_array::m_id {} |
|
private |
◆ m_index_buffer
◆ m_instanced_vbo
◆ m_vertex_buffers
std::list<vertex_buffer> staplegl::vertex_array::m_vertex_buffers |
|
private |
The documentation for this class was generated from the following file: