CoriEngine
Loading...
Searching...
No Matches
GL_Buffers.hpp
Go to the documentation of this file.
1#pragma once
2#include "../Buffers.hpp"
4
5namespace Cori {
6 namespace Graphics {
7 namespace Internal {
9
10 class OpenGLVertexBuffer final : public VertexBuffer, public Profiling::Trackable<OpenGLVertexBuffer, VertexBuffer> {
11 public:
13 ~OpenGLVertexBuffer() override;
14 void Init(const float* vertices, uint32_t size, const DRAW_TYPE drawType) override;
15 void Bind() const override;
16 void Unbind() const override;
17
18 void SetData(const void* data, uint32_t size) const override;
19
20 void SetLayout(const VBLayout& layout) override;
21 const VBLayout& GetLayout() const override { return m_Layout; }
22
23 private:
24 friend class OpenGLVertexArray;
25
26 uint32_t m_ID;
27 VBLayout m_Layout;
28 };
29
30 class OpenGLIndexBuffer final : public IndexBuffer, public Profiling::Trackable<OpenGLIndexBuffer, IndexBuffer> {
31 public:
32 OpenGLIndexBuffer(const uint32_t* indices, uint32_t count);
33 ~OpenGLIndexBuffer() override;
34 void Bind() const override;
35 void Unbind() const override;
36
37 uint32_t GetCount() const override;
38
39 private:
40 friend class OpenGLVertexArray;
41
42 uint32_t m_ID;
43 uint32_t m_Count{ 0 };
44 };
45 }
46 }
47}
OpenGLIndexBuffer(const uint32_t *indices, uint32_t count)
const VBLayout & GetLayout() const override
void SetData(const void *data, uint32_t size) const override
void SetLayout(const VBLayout &layout) override
void Init(const float *vertices, uint32_t size, const DRAW_TYPE drawType) override
For InstanceMetrics to work with a type it should derive from this.
Definition Trackable.hpp:29
Almost everything connected to graphics is in this namespace.
Definition Window.hpp:7
Global engine namespace.