lmgl 1.0.0
A lightweight OpenGL graphics engine library written in C++
Loading...
Searching...
No Matches
vertex_array.hpp
Go to the documentation of this file.
1
13
14#pragma once
15
16#include "buffer.hpp"
17
18#include <memory>
19#include <vector>
20
21namespace lmgl {
22
23namespace renderer {
24
35 public:
38
41
49 void bind() const;
50
58 void unbind() const;
59
67 void add_vertex_buffer(const std::shared_ptr<VertexBuffer> &vertex_buffer);
68
76 void set_index_buffer(const std::shared_ptr<IndexBuffer> &index_buffer);
77
85 const std::vector<std::shared_ptr<VertexBuffer>> &get_vertex_buffers() const;
86
94 const std::shared_ptr<IndexBuffer> &get_index_buffer() const;
95
96 private:
98 unsigned int m_renderer_id;
99
101 std::vector<std::shared_ptr<VertexBuffer>> m_vertex_buffers;
102
104 std::shared_ptr<IndexBuffer> m_index_buffer;
105};
106
107} // namespace renderer
108
109} // namespace lmgl
Defines classes and structures for managing vertex and index buffers in OpenGL.
VertexArray()
Constructs a new Vertex Array Object (VAO)
Definition vertex_array.cpp:30
void unbind() const
Unbinds the Vertex Array Object.
Definition vertex_array.cpp:36
void add_vertex_buffer(const std::shared_ptr< VertexBuffer > &vertex_buffer)
Adds a Vertex Buffer to the Vertex Array Object.
Definition vertex_array.cpp:38
void set_index_buffer(const std::shared_ptr< IndexBuffer > &index_buffer)
Sets the Index Buffer for the Vertex Array Object.
Definition vertex_array.cpp:54
const std::vector< std::shared_ptr< VertexBuffer > > & get_vertex_buffers() const
Retrieves the list of Vertex Buffers associated with the Vertex Array Object.
Definition vertex_array.cpp:61
~VertexArray()
Destructor to clean up the VAO.
Definition vertex_array.cpp:32
const std::shared_ptr< IndexBuffer > & get_index_buffer() const
Retrieves the Index Buffer associated with the Vertex Array Object.
Definition vertex_array.cpp:63
void bind() const
Binds the Vertex Array Object for rendering.
Definition vertex_array.cpp:34
Namespace for rendering-related classes and functions.
Definition buffer.cpp:9
Forward declarations for Assimp Material structure.
Definition model_loader.cpp:12