Class encapsulating ProgramUniform shader variable functionality.
More...
#include </home/chochlik/devel/oglplus/include/oglplus/uniform.hpp>
|
| LazyProgramUniform (const ProgramOps &program, String identifier) |
| Construction from a const reference to program and an identifier.
|
|
| operator bool (void) |
| Equivalent to IsActive() More...
|
|
bool | operator! (void) |
| Equivalent to !IsActive() More...
|
|
void | Set (aux::AdjustUniformType< T >::Typevalue) |
| Set the value of the uniform variable. More...
|
|
void | Set (GLsizei count, const aux::AdjustUniformType< T >::Type *v) |
| Set the multiple value(s) of the uniform variable. More...
|
|
void | Set (const std::vector< aux::AdjustUniformType< T >::Type > &v) |
| Set the value(s) of the uniform variable. More...
|
|
void | Set (aux::AdjustUniformType< T >::Typev, P...p) |
| Set the multiple value(s) of the uniform variable. More...
|
|
void | SetVector (aux::AdjustUniformType< T >::Typev, P...p) |
| Set the vector value of the uniform variable. More...
|
|
void | SetVector (const aux::AdjustUniformType< T >::Type *v) |
| Set the vector value of the uniform variable. More...
|
|
void | SetVectors (GLsizei count, const aux::AdjustUniformType< T >::Type *v) |
| Set multiple scalar or vector values of an uniform variable. More...
|
|
void | SetVectors (const std::vector< aux::AdjustUniformType< T >::Type > &v) |
| Set multiple scalar or vector values of an uniform variable. More...
|
|
void | SetMatrix (std::size_t count, const aux::AdjustUniformType< T >::Type *v) |
| Set the matrix components of the uniform variable. More...
|
|
void | SetMatrix (aux::AdjustUniformType< T >::Typev, P...p) |
| Set the matrix components of the uniform variable. More...
|
|
bool | IsActive (void) |
| Tests if this Uniform is initialized and can be used. More...
|
|
GLint | Location (void) const |
| Returns the location of this uniform in a program.
|
|
Program::ActiveVariableInfo | Info (void) |
| Returns a Program::ActiveVariableInfo for this uniform. More...
|
|
template<typename T, class Typecheck = NoTypecheck>
class oglplus::LazyProgramUniform< T, Typecheck >
Class encapsulating ProgramUniform shader variable functionality.
The difference between ProgramUniform and LazyProgramUniform is, that ProgramUniform tries to get the location (binding) of the GLSL uniform variable in a Program during construction and LazyProgramUniform postpones this initialization until the value is actually needed at the cost of having to internally store the identifer in a String.
- See Also
- Uniform
-
LazyProgramUniform
Returns a Program::ActiveVariableInfo for this uniform.
Note that this is a rather inefficient operation.
Tests if this Uniform is initialized and can be used.
For Uniform and ProgramUniform this function always returns true as these cannot be in uninitialized state. For LazyUniform, LazyProgramUniform, OptionalUniform, etc. this function returns true if the uniform is active and can be used for subsequent value-setting operations. If this function returns false then trying to set a value or any other operation on the uniform besides destruction throws an exception.
Equivalent to IsActive()
- See Also
- IsActive
Equivalent to !IsActive()
- See Also
- IsActive
Set the vector value of the uniform variable.
This function can be used to set uniform variables with 2, 3 or 4 -component vector types with the same underlying type as is the template parameter of the Uniform or ProgramUniform class. For example Uniform<GLfloat>::SetVector() can be used to set the values of GLSL uniforms with vec2, vec3 or vec4 type, Uniform<GLint>::SetVector() can be used to set the values of GLSL uniforms with ivec2, ivec3 or ivec4 type, etc.
- Note
- Consider using Uniform<Vector<T,N>>Set() instead of Uniform<T>::SetVector<N>().
-
This function is not intended for setting arrays of uniform variables.
- Related OpenGL symbols:
- glUniform glProgramUniform
Set the vector value of the uniform variable.
This function can be used to set uniform variables with 2, 3 or 4 -component vector types with the same underlying type as is the template parameter of the Uniform or ProgramUniform class.
For example Uniform<GLfloat>::SetVector() can be used to set the values of GLSL uniforms with vec2, vec3 or vec4 type, Uniform<GLint>::SetVector() can be used to set the values of GLSL uniforms with ivec2, ivec3 or ivec4 type, etc.
- Note
- Consider using Uniform<Vector<T,N>>Set() instead of Uniform<T>::SetVector<N>().
-
This function is not intended for setting arrays of uniform variables.
- Related OpenGL symbols:
- glUniform glProgramUniform
Set multiple scalar or vector values of an uniform variable.
This function can be used to set multiple values of an uniform array variable with scalar or vector type with 2, 3 or 4 -components with the same underlying type as is the template parameter of the Uniform or ProgramUniform class.
For example Uniform<GLfloat>::SetVector() can be used to set the values of GLSL uniforms with vec2, vec3 or vec4 type, Uniform<GLint>::SetVector() can be used to set the values of GLSL uniforms with ivec2, ivec3 or ivec4 type, etc.
- Note
- Consider using Uniform<T>::Set() or Uniform<Vector<T,N>>Set() instead of SetVectors.
- Related OpenGL symbols:
- glUniform glProgramUniform
Set multiple scalar or vector values of an uniform variable.
This function can be used to set multiple values of an uniform array variable with scalar or vector type with 2, 3 or 4 -components with the same underlying type as is the template parameter of the Uniform or ProgramUniform class.
For example Uniform<GLfloat>::SetVector() can be used to set the values of GLSL uniforms with vec2, vec3 or vec4 type, Uniform<GLint>::SetVector() can be used to set the values of GLSL uniforms with ivec2, ivec3 or ivec4 type, etc.
- Note
- Consider using Uniform<T>::Set() or Uniform<Vector<T,N>>Set() instead of SetVectors.
- Related OpenGL symbols:
- glUniform glProgramUniform
The documentation for this class was generated from the following file:
- /home/chochlik/devel/oglplus/include/oglplus/uniform.hpp