|
lmgl 1.0.0
A lightweight OpenGL graphics engine library written in C++
|
Class representing a Vertex Array Object (VAO) in OpenGL. More...
#include <vertex_array.hpp>
Public Member Functions | |
| VertexArray () | |
| Constructs a new Vertex Array Object (VAO) | |
| ~VertexArray () | |
| Destructor to clean up the VAO. | |
| void | bind () const |
| Binds the Vertex Array Object for rendering. | |
| void | unbind () const |
| Unbinds the Vertex Array Object. | |
| void | add_vertex_buffer (const std::shared_ptr< VertexBuffer > &vertex_buffer) |
| Adds a Vertex Buffer to the Vertex Array Object. | |
| void | set_index_buffer (const std::shared_ptr< IndexBuffer > &index_buffer) |
| Sets the Index Buffer for the Vertex Array Object. | |
| const std::vector< std::shared_ptr< VertexBuffer > > & | get_vertex_buffers () const |
| Retrieves the list of Vertex Buffers associated with the Vertex Array Object. | |
| const std::shared_ptr< IndexBuffer > & | get_index_buffer () const |
| Retrieves the Index Buffer associated with the Vertex Array Object. | |
Class representing a Vertex Array Object (VAO) in OpenGL.
This class encapsulates the functionality of a VAO, allowing for the management of vertex and index buffers used in rendering operations.
| void lmgl::renderer::VertexArray::add_vertex_buffer | ( | const std::shared_ptr< VertexBuffer > & | vertex_buffer | ) |
Adds a Vertex Buffer to the Vertex Array Object.
This method associates a Vertex Buffer with the VAO, allowing it to be used for rendering.
| vertexBuffer | A shared pointer to the Vertex Buffer to be added. |
| void lmgl::renderer::VertexArray::bind | ( | ) | const |
Binds the Vertex Array Object for rendering.
This method makes the VAO active so that subsequent rendering commands use it.
| const std::shared_ptr< IndexBuffer > & lmgl::renderer::VertexArray::get_index_buffer | ( | ) | const |
Retrieves the Index Buffer associated with the Vertex Array Object.
This method returns a shared pointer to the Index Buffer.
| const std::vector< std::shared_ptr< VertexBuffer > > & lmgl::renderer::VertexArray::get_vertex_buffers | ( | ) | const |
Retrieves the list of Vertex Buffers associated with the Vertex Array Object.
This method returns a constant reference to a vector containing shared pointers to the Vertex Buffers.
| void lmgl::renderer::VertexArray::set_index_buffer | ( | const std::shared_ptr< IndexBuffer > & | index_buffer | ) |
Sets the Index Buffer for the Vertex Array Object.
This method associates an Index Buffer with the VAO, enabling indexed rendering.
| indexBuffer | A shared pointer to the Index Buffer to be set. |
| void lmgl::renderer::VertexArray::unbind | ( | ) | const |
Unbinds the Vertex Array Object.
This method deactivates the VAO, preventing it from being used in subsequent rendering commands.