Developer Documentation
|
#include <OpenFlipper/libs_required/ACG/ShaderUtils/UniformPool.hh>
Classes | |
struct | UniformBase |
struct | UniformBuf |
struct | UniformMat |
struct | UniformVecf |
struct | UniformVeci |
struct | UniformVecui |
Public Member Functions | |
UniformPool () | |
Constructor. | |
UniformPool (const UniformPool &_pool) | |
Copy Constructor. | |
virtual | ~UniformPool () |
Destructor. | |
void | bind (PtrProgram _prog) const |
Send all stored uniforms to program. More... | |
void | bind (GLuint _prog) const |
Send all stored uniforms to program. More... | |
void | setUniform (const char *_name, GLint _value) |
Set int uniform to specified value. More... | |
void | setUniform (const char *_name, const ACG::Vec2i &_value) |
Set ivec2 uniform to specified value. More... | |
void | setUniform (const char *_name, const ACG::Vec3i &_value) |
Set ivec3 uniform to specified value. More... | |
void | setUniform (const char *_name, const ACG::Vec4i &_value) |
Set ivec4 uniform to specified value. More... | |
void | setUniform (const char *_name, GLuint _value) |
Set uint uniform to specified value. More... | |
void | setUniform (const char *_name, const ACG::Vec2ui &_value) |
Set uvec2 uniform to specified value. More... | |
void | setUniform (const char *_name, const ACG::Vec3ui &_value) |
Set uvec3 uniform to specified value. More... | |
void | setUniform (const char *_name, const ACG::Vec4ui &_value) |
Set uvec4 uniform to specified value. More... | |
void | setUniform (const char *_name, GLfloat _value) |
Set float uniform to specified value. More... | |
void | setUniform (const char *_name, const ACG::Vec2f &_value) |
Set vec2 uniform to specified value. More... | |
void | setUniform (const char *_name, const ACG::Vec3f &_value) |
Set vec3 uniform to specified value. More... | |
void | setUniform (const char *_name, const ACG::Vec4f &_value) |
Set vec4 uniform to specified value. More... | |
void | setUniform (const char *_name, const ACG::GLMatrixf &_value, bool _transposed=false) |
Set 4x4fMatrix uniform to specified value. More... | |
void | setUniformMat3 (const char *_name, const ACG::GLMatrixf &_value, bool _transposed=false) |
Set 3x3fMatrix uniform to specified value. More... | |
void | setUniform (const char *_name, GLint *_values, int _count) |
Set int array uniform to specified values. More... | |
void | setUniform (const char *_name, GLfloat *_values, int _count) |
Set float array uniform to specified values. More... | |
void | addPool (const UniformPool &_src) |
Add all uniforms of a pool to this pool. More... | |
void | clear () |
Clear the pool. More... | |
bool | empty () const |
returns if the pool is empty More... | |
QString | toString () const |
print to string for debugging More... | |
UniformPool & | operator= (const UniformPool &_other) |
copy More... | |
Private Types | |
typedef std::list< UniformBase * > | UniformList |
typedef UniformList::iterator | UniformListIt |
Private Member Functions | |
UniformListIt | findEntry (std::string _name) |
Search the pool for an existing value for a uniform name. More... | |
void | addVecf (const UniformVecf &_vec) |
Add or update a vector type uniform in pool. More... | |
void | addVeci (const UniformVeci &_vec) |
Add or update a vector type uniform in pool. More... | |
void | addVecui (const UniformVecui &_vec) |
Add or update a vector type uniform in pool. More... | |
void | addMatrix (const UniformMat &_mat) |
Add or update a matrix type uniform in pool. More... | |
void | addBuf (const char *_name, void *_values, int _count, bool _integer) |
Add or update an array type uniform in pool. More... | |
Private Attributes | |
UniformList | pool_ |
list of uniform params | |
GLSL uniform pool.
A uniform pool collects values for shader uniforms
Definition at line 64 of file UniformPool.hh.
|
private |
Add or update an array type uniform in pool.
_name | Uniform name |
_values | array data |
_count | array size (in dwords) |
_integer | integer/float array |
Definition at line 570 of file UniformPool.cc.
|
private |
Add or update a matrix type uniform in pool.
_mat | uniform specifier |
Definition at line 534 of file UniformPool.cc.
void GLSL::UniformPool::addPool | ( | const UniformPool & | _src | ) |
Add all uniforms of a pool to this pool.
_src | source uniform pool |
Definition at line 149 of file UniformPool.cc.
|
private |
Add or update a vector type uniform in pool.
_vec | uniform specifier |
Definition at line 435 of file UniformPool.cc.
|
private |
Add or update a vector type uniform in pool.
_vec | uniform specifier |
Definition at line 468 of file UniformPool.cc.
|
private |
Add or update a vector type uniform in pool.
_vec | uniform specifier |
Definition at line 501 of file UniformPool.cc.
void GLSL::UniformPool::bind | ( | PtrProgram | _prog | ) | const |
Send all stored uniforms to program.
_prog | receiving GLSL program |
Definition at line 116 of file UniformPool.cc.
void GLSL::UniformPool::bind | ( | GLuint | _prog | ) | const |
Send all stored uniforms to program.
_prog | opengl program id |
Definition at line 124 of file UniformPool.cc.
void GLSL::UniformPool::clear | ( | ) |
Clear the pool.
Definition at line 86 of file UniformPool.cc.
bool GLSL::UniformPool::empty | ( | ) | const |
|
private |
Search the pool for an existing value for a uniform name.
_name | Name of the uniform |
Definition at line 135 of file UniformPool.cc.
UniformPool & GLSL::UniformPool::operator= | ( | const UniformPool & | _other | ) |
copy
Definition at line 81 of file UniformPool.cc.
void GLSL::UniformPool::setUniform | ( | const char * | _name, |
GLint | _value | ||
) |
Set int uniform to specified value.
_name | Name of the uniform |
_value | New value of the uniform |
Definition at line 614 of file UniformPool.cc.
void GLSL::UniformPool::setUniform | ( | const char * | _name, |
const ACG::Vec2i & | _value | ||
) |
Set ivec2 uniform to specified value.
_name | Name of the uniform |
_value | New value of the uniform |
Definition at line 630 of file UniformPool.cc.
void GLSL::UniformPool::setUniform | ( | const char * | _name, |
const ACG::Vec3i & | _value | ||
) |
Set ivec3 uniform to specified value.
_name | Name of the uniform |
_value | New value of the uniform |
Definition at line 647 of file UniformPool.cc.
void GLSL::UniformPool::setUniform | ( | const char * | _name, |
const ACG::Vec4i & | _value | ||
) |
Set ivec4 uniform to specified value.
_name | Name of the uniform |
_value | New value of the uniform |
Definition at line 665 of file UniformPool.cc.
void GLSL::UniformPool::setUniform | ( | const char * | _name, |
GLuint | _value | ||
) |
Set uint uniform to specified value.
_name | Name of the uniform |
_value | New value of the uniform |
Definition at line 681 of file UniformPool.cc.
void GLSL::UniformPool::setUniform | ( | const char * | _name, |
const ACG::Vec2ui & | _value | ||
) |
Set uvec2 uniform to specified value.
_name | Name of the uniform |
_value | New value of the uniform |
Definition at line 697 of file UniformPool.cc.
void GLSL::UniformPool::setUniform | ( | const char * | _name, |
const ACG::Vec3ui & | _value | ||
) |
Set uvec3 uniform to specified value.
_name | Name of the uniform |
_value | New value of the uniform |
Definition at line 714 of file UniformPool.cc.
void GLSL::UniformPool::setUniform | ( | const char * | _name, |
const ACG::Vec4ui & | _value | ||
) |
Set uvec4 uniform to specified value.
_name | Name of the uniform |
_value | New value of the uniform |
Definition at line 732 of file UniformPool.cc.
void GLSL::UniformPool::setUniform | ( | const char * | _name, |
GLfloat | _value | ||
) |
Set float uniform to specified value.
_name | Name of the uniform |
_value | New value of the uniform |
Definition at line 749 of file UniformPool.cc.
void GLSL::UniformPool::setUniform | ( | const char * | _name, |
const ACG::Vec2f & | _value | ||
) |
Set vec2 uniform to specified value.
_name | Name of the uniform |
_value | New value of the uniform |
Definition at line 765 of file UniformPool.cc.
void GLSL::UniformPool::setUniform | ( | const char * | _name, |
const ACG::Vec3f & | _value | ||
) |
Set vec3 uniform to specified value.
_name | Name of the uniform |
_value | New value of the uniform |
Definition at line 782 of file UniformPool.cc.
void GLSL::UniformPool::setUniform | ( | const char * | _name, |
const ACG::Vec4f & | _value | ||
) |
Set vec4 uniform to specified value.
_name | Name of the uniform |
_value | New value of the uniform |
Definition at line 800 of file UniformPool.cc.
void GLSL::UniformPool::setUniform | ( | const char * | _name, |
const ACG::GLMatrixf & | _value, | ||
bool | _transposed = false |
||
) |
Set 4x4fMatrix uniform to specified value.
_name | Name of the uniform |
_value | Matrix to be set |
_transposed | Is the matrix transposed? |
Definition at line 817 of file UniformPool.cc.
void GLSL::UniformPool::setUniform | ( | const char * | _name, |
GLint * | _values, | ||
int | _count | ||
) |
Set int array uniform to specified values.
_name | Name of the uniform to be set |
_values | Pointer to an array with the new values |
_count | Number of values in the given array |
Definition at line 853 of file UniformPool.cc.
void GLSL::UniformPool::setUniform | ( | const char * | _name, |
GLfloat * | _values, | ||
int | _count | ||
) |
Set float array uniform to specified values.
_name | Name of the uniform to be set |
_values | Pointer to an array with the new values |
_count | Number of values in the given array |
Definition at line 864 of file UniformPool.cc.
void GLSL::UniformPool::setUniformMat3 | ( | const char * | _name, |
const ACG::GLMatrixf & | _value, | ||
bool | _transposed = false |
||
) |
Set 3x3fMatrix uniform to specified value.
_name | Name of the uniform |
_value | Matrix to be set |
_transposed | Is the matrix transposed? |
Definition at line 835 of file UniformPool.cc.
QString GLSL::UniformPool::toString | ( | ) | const |
print to string for debugging
Definition at line 100 of file UniformPool.cc.