Jopnal Engine  alpha 0.4
Simple Component Based 2D/3D Game Engine
Public Member Functions | List of all members
jop::VertexBuffer Class Reference

#include <VertexBuffer.hpp>

Inheritance diagram for jop::VertexBuffer:
jop::Buffer

Public Member Functions

 VertexBuffer (const Type type, const Usage usage=Buffer::StaticDraw)
 Constructor. More...
 
 VertexBuffer (const VertexBuffer &other)
 Copy constructor. More...
 
VertexBufferoperator= (const VertexBuffer &other)
 Copy assignment operator. More...
 
 VertexBuffer (VertexBuffer &&other)
 Move constructor. More...
 
VertexBufferoperator= (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...
 
- Public Member Functions inherited from jop::Buffer
 Buffer (const Type type, const Usage usage)
 Constructor. More...
 
 Buffer (const Buffer &other)
 Copy constructor. More...
 
Bufferoperator= (const Buffer &other)
 Copy assignment operator. More...
 
 Buffer (Buffer &&other)
 Move constructor. More...
 
Bufferoperator= (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

- Public Types inherited from jop::Buffer
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 Public Member Functions inherited from jop::Buffer
static void unbind (const Type type)
 Unbind a buffer. More...
 
- Protected Attributes inherited from jop::Buffer
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...
 

Detailed Description

Definition at line 34 of file VertexBuffer.hpp.

Constructor & Destructor Documentation

jop::VertexBuffer::VertexBuffer ( const Type  type,
const Usage  usage = Buffer::StaticDraw 
)

Constructor.

Parameters
typeBuffer type
usageUsage type
jop::VertexBuffer::VertexBuffer ( const VertexBuffer other)

Copy constructor.

jop::VertexBuffer::VertexBuffer ( VertexBuffer &&  other)

Move constructor.

Member Function Documentation

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.

Parameters
dataPointer to the data
sizeSize 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.

Parameters
dataPointer to the data
offsetThe start position in the buffer
sizeSize of the sub data in bytes

The documentation for this class was generated from the following file: