UniShader
1.0.0a
Interface for GPGPU and working with shader programs
|
#include <Buffer.h>
Public Types | |
typedef std::shared_ptr < Buffer< T > > | Ptr |
Shared pointer. | |
typedef std::shared_ptr< const Buffer< T > > | PtrConst |
Shared pointer. | |
Public Member Functions | |
virtual const std::string & | getClassName () const |
Get name of this class. | |
bool | getDataCopy (std::vector< T > &vec) const |
Get data copy. | |
bool | getDataCopy (T *arr, unsigned int &size) const |
Get data copy. | |
std::string | getString (unsigned int begin=0, unsigned int count=0, std::ostringstream &format=std::ostringstream()) const |
Get string. | |
bool | setData (const std::vector< T > &vec) |
Set data. | |
bool | setData (const T *arr, unsigned int size) |
Set data. | |
Static Public Member Functions | |
static Ptr | create () |
Create buffer. |
Buffer class.
Templated buffer class is interface for manipulating buffer objects. It is allowed to use buffer only for input or output at a time. Using buffer as both input and output at the same time can result in undefined behaviour.
Create buffer.
bool Buffer< T >::getDataCopy | ( | std::vector< T > & | vec | ) | const |
Get data copy.
Copies buffer data from graphics card memory to vector.
vec | Vector storage for data. Passed vector must be empty. |
bool Buffer< T >::getDataCopy | ( | T * | arr, |
unsigned int & | size | ||
) | const |
Get data copy.
Copies buffer data from graphics card memory to array.
arr | Pointer to data. Passed pointer must be NULL. |
size | Size of array in elements. |
std::string Buffer< T >::getString | ( | unsigned int | begin = 0 , |
unsigned int | count = 0 , |
||
std::ostringstream & | format = std::ostringstream() |
||
) | const |
Get string.
Convert values to string. Values are delimited by space.
begin | First index. |
count | Number of elements to convert. |
format | Formated ostrinstream object used for conversion. |
Set data.
vec | Vector with data. |
Set data.
arr | Array with data. |
size | Size of array in elements. |