Practical Tools for Simple Design
Loading...
Searching...
No Matches
VertexArray.hpp
1#ifndef CORE_VERTEX_ARRAY_HPP
2#define CORE_VERTEX_ARRAY_HPP
3
4#include "pch.hpp" // IWYU pragma: export
5
6#include "Core/IndexBuffer.hpp"
7#include "Core/VertexBuffer.hpp"
8
9namespace Core {
20public:
22 VertexArray(const VertexArray &) = delete;
23 VertexArray(VertexArray &&other);
24
26
27 VertexArray &operator=(const VertexArray &) = delete;
28 VertexArray &operator=(VertexArray &&other);
29
30 void Bind() const;
31 void Unbind() const;
32
33 void AddVertexBuffer(std::unique_ptr<VertexBuffer> vertexBuffer);
37 void SetIndexBuffer(std::unique_ptr<IndexBuffer> indexBuffer);
38
39 void DrawTriangles() const;
40
41private:
42 GLuint m_ArrayId;
43
44 std::vector<std::unique_ptr<VertexBuffer>> m_VertexBuffers;
45 std::unique_ptr<IndexBuffer> m_IndexBuffer;
46};
47} // namespace Core
48#endif
Wrapper for OpenGL Vertex Array Object.
Definition: VertexArray.hpp:13
void SetIndexBuffer(std::unique_ptr< IndexBuffer > indexBuffer)
Core functionality of the framework
Definition: config.hpp:7