clan::StorageBuffer Class Reference

Storage Buffer. More...

#include <storage_buffer.h>

+ Inheritance diagram for clan::StorageBuffer:

Public Member Functions

 StorageBuffer ()
 Constructs a null instance. More...
 
 StorageBuffer (GraphicContext &gc, int size, int stride, BufferUsage usage=usage_dynamic_draw)
 Constructs a buffer. More...
 
 StorageBuffer (GraphicContext &gc, const void *data, int size, int stride, BufferUsage usage=usage_dynamic_draw)
 Constructs a buffer. More...
 
void copy_from (GraphicContext &gc, TransferBuffer &buffer, int dest_pos=0, int src_pos=0, int size=-1)
 Copies data from transfer buffer. More...
 
void copy_to (GraphicContext &gc, TransferBuffer &buffer, int dest_pos=0, int src_pos=0, int size=-1)
 Copies data to transfer buffer. More...
 
StorageBufferProviderget_provider () const
 Get Provider. More...
 
bool is_null () const
 Returns true if this object is invalid. More...
 
 operator bool () const
 
bool operator== (const StorageBuffer &other) const
 Handle comparison operator. More...
 
void throw_if_null () const
 Throw an exception if this object is invalid. More...
 
void upload_data (GraphicContext &gc, const void *data, int size)
 Uploads data to storage buffer. More...
 

Detailed Description

Storage Buffer.

Constructor & Destructor Documentation

clan::StorageBuffer::StorageBuffer ( )

Constructs a null instance.

clan::StorageBuffer::StorageBuffer ( GraphicContext gc,
int  size,
int  stride,
BufferUsage  usage = usage_dynamic_draw 
)

Constructs a buffer.

Parameters
gc= Graphic Context
size= size - use ProgramObject::get_storage_buffer_size() to calcuate this
usage= Buffer Usage
clan::StorageBuffer::StorageBuffer ( GraphicContext gc,
const void *  data,
int  size,
int  stride,
BufferUsage  usage = usage_dynamic_draw 
)

Constructs a buffer.

Parameters
gc= Graphic Context
data= void
size= value
usage= Buffer Usage

Member Function Documentation

void clan::StorageBuffer::copy_from ( GraphicContext gc,
TransferBuffer buffer,
int  dest_pos = 0,
int  src_pos = 0,
int  size = -1 
)

Copies data from transfer buffer.

Referenced by clan::StorageVector< Type >::copy_from().

void clan::StorageBuffer::copy_to ( GraphicContext gc,
TransferBuffer buffer,
int  dest_pos = 0,
int  src_pos = 0,
int  size = -1 
)

Copies data to transfer buffer.

Referenced by clan::StorageVector< Type >::copy_to().

StorageBufferProvider* clan::StorageBuffer::get_provider ( ) const

Get Provider.

Returns
provider
bool clan::StorageBuffer::is_null ( ) const
inline

Returns true if this object is invalid.

clan::StorageBuffer::operator bool ( ) const
inlineexplicit
bool clan::StorageBuffer::operator== ( const StorageBuffer other) const

Handle comparison operator.

void clan::StorageBuffer::throw_if_null ( ) const

Throw an exception if this object is invalid.

void clan::StorageBuffer::upload_data ( GraphicContext gc,
const void *  data,
int  size 
)

Uploads data to storage buffer.

The size specified must match the size of the buffer and is only included to help guard against buffer overruns.

Referenced by clan::StorageVector< Type >::upload_data().


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