Karma Engine
Loading...
Searching...
No Matches
OpenGLVertexArray.h
1#pragma once
2
3#include "Karma/Renderer/VertexArray.h"
4#include "Platform/OpenGL/OpenGLShader.h"
5
6namespace Karma
7{
8 class KARMA_API OpenGLVertexArray : public VertexArray
9 {
10 public:
12 virtual ~OpenGLVertexArray();
13
14 virtual void Bind() const override;
15 virtual void UnBind() const override;
16
17 virtual void AddVertexBuffer(const std::shared_ptr<VertexBuffer>& vertexBuffer) override;
18 virtual void SetIndexBuffer(const std::shared_ptr<IndexBuffer>& indexBuffer) override;
19
20 virtual void SetMesh(std::shared_ptr<Mesh> mesh) override;
21 virtual void SetMaterial(std::shared_ptr<Material> material) override;
22
23 virtual void SetShader(std::shared_ptr<Shader> shader) override {}
24
25 virtual const std::vector<std::shared_ptr<VertexBuffer>>& GetVertexBuffers() const override { return m_VertexBuffers; }
26 virtual const IndexBuffer* GetIndexBuffer() const override { return m_IndexBuffer.get(); }
27
28 virtual std::shared_ptr<Material> GetMaterial() const override { return m_Materials.at(0); }
29
30 virtual void UpdateProcessAndSetReadyForSubmission() const override;
31
32 private:
33 uint32_t m_RendererID;
34
35 std::vector<std::shared_ptr<VertexBuffer>> m_VertexBuffers;
36 std::shared_ptr<IndexBuffer> m_IndexBuffer;
37
38 // Material relevant members
39 std::vector<std::shared_ptr<Material>> m_Materials;
40 std::vector<std::shared_ptr<OpenGLShader>> m_Shaders;
41 std::shared_ptr<OpenGLShader> m_Shader;
42
43 };
44}
Definition Buffer.h:181
Definition OpenGLVertexArray.h:9
Definition VertexArray.h:13