|
Developer Documentation
|
#include <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... | |
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 71 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 468 of file UniformPool.cc.
|
private |
Add or update a matrix type uniform in pool.
| _mat | uniform specifier |
Definition at line 432 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 136 of file UniformPool.cc.
|
private |
Add or update a vector type uniform in pool.
| _vec | uniform specifier |
Definition at line 333 of file UniformPool.cc.
|
private |
Add or update a vector type uniform in pool.
| _vec | uniform specifier |
Definition at line 366 of file UniformPool.cc.
|
private |
Add or update a vector type uniform in pool.
| _vec | uniform specifier |
Definition at line 399 of file UniformPool.cc.
| void GLSL::UniformPool::bind | ( | PtrProgram | _prog | ) | const |
Send all stored uniforms to program.
| _prog | receiving GLSL program |
Definition at line 103 of file UniformPool.cc.
| void GLSL::UniformPool::bind | ( | GLuint | _prog | ) | const |
Send all stored uniforms to program.
| _prog | opengl program id |
Definition at line 111 of file UniformPool.cc.
| void GLSL::UniformPool::clear | ( | void | ) |
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 122 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 512 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 528 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 545 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 563 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 579 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 595 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 612 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 630 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 647 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 663 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 680 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 698 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 715 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 751 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 762 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 733 of file UniformPool.cc.