![]() |
Jopnal Engine
alpha 0.4
Simple Component Based 2D/3D Game Engine
|
#include <Buffer.hpp>
Public Types | |
| enum | Type { Type::ArrayBuffer, Type::ElementArrayBuffer, Type::UniformBuffer } |
| Enum class consisting of buffer types. More... | |
| enum | Usage { StaticDraw, DynamicDraw, StreamDraw } |
| Enum of usage types. More... | |
Public Member Functions | |
| Buffer (const Type type, const Usage usage) | |
| Constructor. More... | |
| Buffer (const Buffer &other) | |
| Copy constructor. More... | |
| Buffer & | operator= (const Buffer &other) |
| Copy assignment operator. More... | |
| Buffer (Buffer &&other) | |
| Move constructor. More... | |
| Buffer & | operator= (Buffer &&other) |
| Move assignment operator. More... | |
| virtual | ~Buffer ()=0 |
| Virtual destructor. More... | |
| void | bind () const |
| Bind this buffer. More... | |
| void | clear () |
| Clear this buffer. More... | |
| void | destroy () |
| Destroy this buffer. More... | |
| std::size_t | getAllocatedSize () const |
| Get the allocated size in bytes. More... | |
Static Public Member Functions | |
| static void | unbind (const Type type) |
| Unbind a buffer. More... | |
Protected Attributes | |
| std::size_t | m_bytesAllocated |
| Size of the allocated buffer. More... | |
| unsigned int | m_buffer |
| Buffer's OpenGL handle. More... | |
| const int | m_bufferType |
| Type of the buffer. More... | |
| const int | m_usage |
| The usage type. More... | |
Definition at line 34 of file Buffer.hpp.
|
strong |
Enum class consisting of buffer types.
| Enumerator | |
|---|---|
| ArrayBuffer |
Array buffer (vertex data) |
| ElementArrayBuffer |
Element buffer (index data) |
| UniformBuffer |
Uniform buffer. |
Definition at line 40 of file Buffer.hpp.
| enum jop::Buffer::Usage |
Enum of usage types.
| Enumerator | |
|---|---|
| StaticDraw |
Static buffer, use when the data rarely changes. |
| DynamicDraw |
Dynamic buffer, use when the data changes often. |
| StreamDraw |
Stream buffer, use when the data changes all the time. |
Definition at line 49 of file Buffer.hpp.
Constructor.
| type | Buffer type |
| usage | Usage type |
| jop::Buffer::Buffer | ( | const Buffer & | other | ) |
Copy constructor.
| jop::Buffer::Buffer | ( | Buffer && | other | ) |
Move constructor.
|
pure virtual |
Virtual destructor.
| void jop::Buffer::bind | ( | ) | const |
Bind this buffer.
| void jop::Buffer::clear | ( | ) |
Clear this buffer.
The buffer itself won't be destroyed, only the data.
| void jop::Buffer::destroy | ( | ) |
Destroy this buffer.
| std::size_t jop::Buffer::getAllocatedSize | ( | ) | const |
Get the allocated size in bytes.
|
static |
Unbind a buffer.
| type | The buffer type to unbind |
|
mutableprotected |
Buffer's OpenGL handle.
Definition at line 115 of file Buffer.hpp.
|
protected |
Type of the buffer.
Definition at line 116 of file Buffer.hpp.
|
protected |
Size of the allocated buffer.
Definition at line 114 of file Buffer.hpp.
|
protected |
The usage type.
Definition at line 117 of file Buffer.hpp.
1.8.11