Karma Engine
Loading...
Searching...
No Matches
OpenGLBuffer.h
1#pragma once
2
3#include "Karma/Renderer/Buffer.h"
4
5namespace Karma
6{
7 class KARMA_API OpenGLVertexBuffer : public VertexBuffer
8 {
9 public:
10 OpenGLVertexBuffer(float* vertices, uint32_t size);
11 virtual ~OpenGLVertexBuffer();
12
13 virtual void Bind() const override;
14 virtual void UnBind() const override;
15
16 virtual const BufferLayout& GetLayout() const override
17 {
18 return m_Layout;
19 }
20 virtual void SetLayout(const BufferLayout& layout) override;
21
22 private:
23 uint32_t m_RendererID;
24 BufferLayout m_Layout;
25 };
26
27 class KARMA_API OpenGLIndexBuffer : public IndexBuffer
28 {
29 public:
30 OpenGLIndexBuffer(uint32_t* indices, uint32_t count);
31 virtual ~OpenGLIndexBuffer();
32
33 virtual void Bind() const override;
34 virtual void UnBind() const override;
35
36 virtual uint32_t GetCount() const override { return m_Count; }
37
38 private:
39 uint32_t m_RendererID;
40 uint32_t m_Count;
41 };
42
43 class KARMA_API OpenGLImageBuffer : public ImageBuffer
44 {
45 public:
46 static void SetUpImageBuffer(const char* filenames);
47 static void BindTexture();// Experimental, need right OpenGLTexture abstraction
48
49 private:
50 static unsigned int m_ImageBufferID;
51 };
52
53 struct KARMA_API OpenGLUniformBuffer : public UniformBufferObject
54 {
55 public:
56 OpenGLUniformBuffer(std::vector<ShaderDataType> dataTypes, uint32_t bindingPointIndex);
57 uint32_t GetUniformsID() const { return m_UniformsID; }
58 virtual ~OpenGLUniformBuffer();
59
60 virtual void UploadUniformBuffer() override;
61
62 private:
63 void GenerateUniformBufferObject();
64 void BindUniformBufferObject() const;
65
66 private:
67 uint32_t m_UniformsID;
68 };
69}
Definition Buffer.h:111
Definition Buffer.h:194
Definition Buffer.h:181
Definition OpenGLBuffer.h:44
Definition OpenGLBuffer.h:28
Definition OpenGLBuffer.h:8
Definition Buffer.h:167
Definition OpenGLBuffer.h:54
Definition Buffer.h:220