Class encapsulating Uniform shader variable functionality.
More...
#include </home/chochlik/devel/oglplus/include/oglplus/uniform.hpp>
|
| DirectUniform (const ProgramOps &program, GLint location) |
| Construction from a const reference to program and a location .
|
|
| 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::DirectUniform< T, Typecheck >
Class encapsulating Uniform shader variable functionality.
The difference between Uniform and DirectUniform is, that Uniform is initialized by the name of the uniform variable in the GLSL program. Direct uniform is initialized by the location (binding) of the variable in the program.
- See Also
- Uniform
-
ProgramUniform
-
LazyUniform
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