UniShader  1.0.0a
Interface for GPGPU and working with shader programs
 All Classes Functions Typedefs Enumerations Enumerator
Classes | Public Types | Public Member Functions | Static Public Member Functions
TextureBuffer Class Reference

Texture buffer class. More...

#include <TextureBuffer.h>

Inheritance diagram for TextureBuffer:
SignalSender ObjectBase

List of all members.

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.

Detailed Description

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.


Member Function Documentation

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.

Parameters:
bufferBuffer.
componentsNumberNumber of components (elements) packed into single pixel.
dataTypeData type.
See also:
disconnectBuffer().

Create texture buffer.

/return Texture buffer.

Deactivate.

Deactivate texture by releasing texture unit. Texture unit is released only if all Activate() calls were matched by Deactivate().

Disconnect buffer from texture buffer.

See also:
connectBuffer()
unsigned char TextureBuffer::getComponentsNumber ( ) const

Get components number.

Returns:
Number of components packed into single pixel.

Get data type.

Returns:
Data type used to access data.

Get texture unit index.

Texture unit index is availible only if texture buffer is active.

Returns:
Texture unit index.

Prapare.

Prepare texture buffer for use.

Returns:
True if prepared successfully.
void TextureBuffer::setComponentsNumber ( unsigned char  componentsNumber)

Set components number.

Parameters:
componentsNumberNumber of components packed into single pixel.

Set data type.

Parameters:
dataTypeData type used to access data.

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