Hymn to Beauty
C++ 3D Engine
OpenGLGeometryBinding.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "../Interface/GeometryBinding.hpp"
4
5#include <glad/glad.h>
6#include <cstdint>
7
8namespace Video {
9
10class VertexDescription;
11class Buffer;
12
15 public:
17
23 OpenGLGeometryBinding(const VertexDescription* vertexDescription, const Buffer* vertexBuffer, IndexType indexType = IndexType::NONE, const Buffer* indexBuffer = nullptr);
24
27
29
32 GLuint GetVertexArray() const;
33
35
38 GLenum GetIndexType() const;
39
41
44 uintptr_t GetIndexBufferOffset() const;
45
46 private:
47 OpenGLGeometryBinding(const OpenGLGeometryBinding& other) = delete;
48
49 GLuint vertexArray;
50 GLenum indexType;
51 uintptr_t indexBufferOffset = 0u;
52};
53
54}
A buffer containing GPU accessible data.
Definition: Buffer.hpp:8
Binds together a vertex description with buffers.
Definition: GeometryBinding.hpp:8
IndexType
The type of values in the index buffer.
Definition: GeometryBinding.hpp:11
OpenGL implementation of GeometryBinding.
Definition: OpenGLGeometryBinding.hpp:14
GLuint GetVertexArray() const
Get the vertex array object.
Definition: OpenGLGeometryBinding.cpp:59
uintptr_t GetIndexBufferOffset() const
Get the offset into the index buffer.
Definition: OpenGLGeometryBinding.cpp:67
OpenGLGeometryBinding(const VertexDescription *vertexDescription, const Buffer *vertexBuffer, IndexType indexType=IndexType::NONE, const Buffer *indexBuffer=nullptr)
Create new OpenGL geometry binding.
Definition: OpenGLGeometryBinding.cpp:9
~OpenGLGeometryBinding() final
Destructor.
Definition: OpenGLGeometryBinding.cpp:55
GLenum GetIndexType() const
Get the type of the values in the index buffer.
Definition: OpenGLGeometryBinding.cpp:63
Describes how a vertex buffer is accessed by a shader.
Definition: VertexDescription.hpp:8
Definition: Editor.hpp:18