UniShader
1.0.0a
Interface for GPGPU and working with shader programs
|
Texture buffer class. More...
#include <TextureBuffer.h>
Classes | |
class | DataType |
Data type. More... | |
Public Types | |
typedef std::shared_ptr < TextureBuffer > | Ptr |
Shared pointer. | |
typedef std::shared_ptr< const TextureBuffer > | PtrConst |
Shared pointer. | |
Public Member Functions | |
virtual const std::string & | getClassName () const |
Get name of this class. | |
void | connectBuffer (BufferBase::Ptr buffer, unsigned char componentsNumber, DataType dataType) |
Connect buffer to texture buffer and set it as data source. | |
void | disconnectBuffer () |
Disconnect buffer from texture buffer. | |
unsigned char | getComponentsNumber () const |
Get components number. | |
DataType | getDataType () const |
Get data type. | |
char | getTextureUnitIndex () const |
Get texture unit index. | |
void | setComponentsNumber (unsigned char componentsNumber) |
Set components number. | |
void | setDataType (DataType dataType) |
Set data type. | |
bool | prepare () |
Prapare. | |
void | activate () |
Activate. | |
void | deactivate () |
Deactivate. | |
Static Public Member Functions | |
static Ptr | create () |
Create texture buffer. |
Texture buffer class.
Texture buffer is special type of texture that has its data stored in form of graphics card buffer. Texure buffer is therefore one-dimensional array of data.
Advantage of texture buffers over basic one-dimensional textures lies in much bigger capacity.
In GLSL code it is associated with samplerBuffer uniform.
void TextureBuffer::activate | ( | ) |
Activate.
Activate texture buffer by locking a texture unit and modyfying its state. It is possible to activate texture buffer multiple times.
void TextureBuffer::connectBuffer | ( | BufferBase::Ptr | buffer, |
unsigned char | componentsNumber, | ||
DataType | dataType | ||
) |
Connect buffer to texture buffer and set it as data source.
buffer | Buffer. |
componentsNumber | Number of components (elements) packed into single pixel. |
dataType | Data type. |
TextureBuffer::Ptr TextureBuffer::create | ( | ) | [static] |
Create texture buffer.
/return Texture buffer.
void TextureBuffer::deactivate | ( | ) |
Deactivate.
Deactivate texture by releasing texture unit. Texture unit is released only if all Activate() calls were matched by Deactivate().
void TextureBuffer::disconnectBuffer | ( | ) |
Disconnect buffer from texture buffer.
unsigned char TextureBuffer::getComponentsNumber | ( | ) | const |
Get components number.
Get data type.
char TextureBuffer::getTextureUnitIndex | ( | ) | const |
Get texture unit index.
Texture unit index is availible only if texture buffer is active.
bool TextureBuffer::prepare | ( | ) |
Prapare.
Prepare texture buffer for use.
void TextureBuffer::setComponentsNumber | ( | unsigned char | componentsNumber | ) |
Set components number.
componentsNumber | Number of components packed into single pixel. |
void TextureBuffer::setDataType | ( | DataType | dataType | ) |
Set data type.
dataType | Data type used to access data. |