![]() |
Jopnal Engine
alpha 0.4
Simple Component Based 2D/3D Game Engine
|
#include <VertexBuffer.hpp>
Public Member Functions | |
VertexBuffer (const Type type, const Usage usage=Buffer::StaticDraw) | |
Constructor. More... | |
VertexBuffer (const VertexBuffer &other) | |
Copy constructor. More... | |
VertexBuffer & | operator= (const VertexBuffer &other) |
Copy assignment operator. More... | |
VertexBuffer (VertexBuffer &&other) | |
Move constructor. More... | |
VertexBuffer & | operator= (VertexBuffer &&other) |
Move assignment operator. More... | |
void | setData (const void *data, const std::size_t size) |
Set the buffer data. More... | |
void | setSubData (const void *data, const std::size_t offset, const std::size_t size) |
Set buffer sub data. More... | |
![]() | |
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... | |
Additional Inherited Members | |
![]() | |
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... | |
![]() | |
static void | unbind (const Type type) |
Unbind a buffer. More... | |
![]() | |
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 VertexBuffer.hpp.
jop::VertexBuffer::VertexBuffer | ( | const Type | type, |
const Usage | usage = Buffer::StaticDraw |
||
) |
Constructor.
type | Buffer type |
usage | Usage type |
jop::VertexBuffer::VertexBuffer | ( | const VertexBuffer & | other | ) |
Copy constructor.
jop::VertexBuffer::VertexBuffer | ( | VertexBuffer && | other | ) |
Move constructor.
VertexBuffer& jop::VertexBuffer::operator= | ( | const VertexBuffer & | other | ) |
Copy assignment operator.
VertexBuffer& jop::VertexBuffer::operator= | ( | VertexBuffer && | other | ) |
Move assignment operator.
void jop::VertexBuffer::setData | ( | const void * | data, |
const std::size_t | size | ||
) |
Set the buffer data.
data | Pointer to the data |
size | Size of the buffer data in bytes |
void jop::VertexBuffer::setSubData | ( | const void * | data, |
const std::size_t | offset, | ||
const std::size_t | size | ||
) |
Set buffer sub data.
data | Pointer to the data |
offset | The start position in the buffer |
size | Size of the sub data in bytes |