Hymn to Beauty
C++ 3D Engine
Buffer.hpp
Go to the documentation of this file.
1#pragma once
2
3namespace Video {
4
5struct BufferAllocation;
6
8class Buffer {
9 public:
11 enum class BufferUsage {
17 COUNT
18 };
19
21
25 this->bufferUsage = bufferUsage;
26 }
27
29 virtual ~Buffer() {}
30
32
36 virtual void Reset(BufferUsage bufferUsage, const BufferAllocation& allocation) = 0;
37
39
42 virtual unsigned int GetSize() const = 0;
43
45
49 return bufferUsage;
50 }
51
52 protected:
55
56 private:
57 Buffer(const Buffer& other) = delete;
58};
59
60}
A buffer containing GPU accessible data.
Definition: Buffer.hpp:8
virtual void Reset(BufferUsage bufferUsage, const BufferAllocation &allocation)=0
Reset the buffer.
BufferUsage
How the buffer is going to be used.
Definition: Buffer.hpp:11
@ INDEX_BUFFER
The buffer will be used as an index buffer.
@ COUNT
The number of different buffer usages.
@ VERTEX_STORAGE_BUFFER
The buffer will be used as both vertex and storage buffer.
@ UNIFORM_BUFFER
The buffer will be used as a uniform buffer.
@ STORAGE_BUFFER
The buffer will be used as a storage buffer.
@ VERTEX_BUFFER
The buffer will be used as a vertex buffer.
BufferUsage bufferUsage
How the buffer will be used.
Definition: Buffer.hpp:54
BufferUsage GetBufferUsage() const
Get how the buffer is to be used.
Definition: Buffer.hpp:48
virtual ~Buffer()
Destructor.
Definition: Buffer.hpp:29
virtual unsigned int GetSize() const =0
Get the size of the buffer.
Buffer(BufferUsage bufferUsage)
Create a new buffer.
Definition: Buffer.hpp:24
Definition: Editor.hpp:18
An allocation.
Definition: BufferAllocator.hpp:36