aboutsummaryrefslogtreecommitdiff
path: root/src/Platform/OpenGL/OpenGLVertexArray.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Platform/OpenGL/OpenGLVertexArray.h')
-rw-r--r--src/Platform/OpenGL/OpenGLVertexArray.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/Platform/OpenGL/OpenGLVertexArray.h b/src/Platform/OpenGL/OpenGLVertexArray.h
new file mode 100644
index 0000000..6783140
--- /dev/null
+++ b/src/Platform/OpenGL/OpenGLVertexArray.h
@@ -0,0 +1,40 @@
+#pragma once
+
+#include "Rendering/VertexArray.h"
+#include <vector>
+#include <memory>
+
+namespace Donut
+{
+ class VertexBuffer;
+ class IndexBuffer;
+
+ class OpenGLVertexArray
+ : public VertexArray
+ {
+ public:
+ OpenGLVertexArray();
+ virtual ~OpenGLVertexArray();
+
+ virtual void Bind() const override;
+ virtual void Unbind() const override;
+
+ virtual void AddVertexBuffer(const std::shared_ptr<VertexBuffer>& vertexBuffer) override;
+ virtual void SetIndexBuffer(const std::shared_ptr<IndexBuffer>& indexBuffer) override;
+
+ virtual const std::vector<std::shared_ptr<VertexBuffer>>& GetVertexBuffers() const override
+ {
+ return m_VertexBuffers;
+ }
+
+ virtual const std::shared_ptr<IndexBuffer>& GetIndexBuffer() const override
+ {
+ return m_IndexBuffer;
+ }
+ private:
+ uint32_t m_RendererID;
+ uint32_t m_VertexBufferIndex = 0;
+ std::vector<std::shared_ptr<VertexBuffer>> m_VertexBuffers;
+ std::shared_ptr<IndexBuffer> m_IndexBuffer;
+ };
+};