OGLplus (0.45.0) a C++ wrapper for OpenGL

oglplus::UniformSpecOps< T, LocationInit, Typechecker, SpecOpsWrapper > Class Template Reference

Base template for Uniform and ProgramUniform. More...

#include </home/chochlik/devel/oglplus/include/oglplus/uniform.hpp>

Inheritance diagram for oglplus::UniformSpecOps< T, LocationInit, Typechecker, SpecOpsWrapper >:
Collaboration diagram for oglplus::UniformSpecOps< T, LocationInit, Typechecker, SpecOpsWrapper >:

Public Member Functions

void Set (T value)
 Set the value of the uniform variable. More...
 
void Set (GLsizei count, const T *v)
 Set the multiple value(s) of the uniform variable. More...
 
void Set (const std::vector< T > &v)
 Set the value(s) of the uniform variable. More...
 
template<typename... P>
void Set (T v, P...p)
 Set the multiple value(s) of the uniform variable. More...
 
template<typename... P>
void SetVector (T v, P...p)
 Set the vector value of the uniform variable. More...
 
template<std::size_t Cols>
void SetVector (const T *v)
 Set the vector value of the uniform variable. More...
 
template<std::size_t Cols>
void SetVectors (GLsizei count, const T *v)
 Set multiple scalar or vector values of an uniform variable. More...
 
template<std::size_t Cols>
void SetVectors (const std::vector< T > &v)
 Set multiple scalar or vector values of an uniform variable. More...
 
template<std::size_t Cols, std::size_t Rows>
void SetMatrix (std::size_t count, const T *v)
 Set the matrix components of the uniform variable. More...
 
template<std::size_t Cols, typename... P>
void SetMatrix (T v, 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...
 

Detailed Description

template<typename T, class LocationInit, class Typechecker, class SpecOpsWrapper>
class oglplus::UniformSpecOps< T, LocationInit, Typechecker, SpecOpsWrapper >

Base template for Uniform and ProgramUniform.

Note
Do not use this class directly use Uniform, ProgramUniform or one of the other derived uniform classes instead.

Member Function Documentation

Program::ActiveVariableInfo oglplus::UniformOps< LocationInit , Typechecker >::Info ( void  )
inherited

Returns a Program::ActiveVariableInfo for this uniform.

Note that this is a rather inefficient operation.

bool oglplus::UniformOps< LocationInit , Typechecker >::IsActive ( void  )
inherited

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.

Referenced by oglplus::UniformTpl< aux::AdjustUniformType< oglplus::Vector< GLint, 2 > >::Type, oglplus::Vector< GLint, 2 >, Unspecified, Unspecified, Unspecified< aux::AdjustUniformType< oglplus::Vector< GLint, 2 > >::Type > >::operator bool(), and oglplus::UniformTpl< aux::AdjustUniformType< oglplus::Vector< GLint, 2 > >::Type, oglplus::Vector< GLint, 2 >, Unspecified, Unspecified, Unspecified< aux::AdjustUniformType< oglplus::Vector< GLint, 2 > >::Type > >::operator!().

template<typename T, class LocationInit, class Typechecker, class SpecOpsWrapper>
void oglplus::UniformSpecOps< T, LocationInit, Typechecker, SpecOpsWrapper >::Set ( T  value)
template<typename T, class LocationInit, class Typechecker, class SpecOpsWrapper>
void oglplus::UniformSpecOps< T, LocationInit, Typechecker, SpecOpsWrapper >::Set ( GLsizei  count,
const T v 
)

Set the multiple value(s) of the uniform variable.

Related OpenGL symbols:
glUniform glProgramUniform
template<typename T, class LocationInit, class Typechecker, class SpecOpsWrapper>
void oglplus::UniformSpecOps< T, LocationInit, Typechecker, SpecOpsWrapper >::Set ( const std::vector< T > &  v)

Set the value(s) of the uniform variable.

Related OpenGL symbols:
glUniform glProgramUniform
template<typename T, class LocationInit, class Typechecker, class SpecOpsWrapper>
template<typename... P>
void oglplus::UniformSpecOps< T, LocationInit, Typechecker, SpecOpsWrapper >::Set ( T  v,
P...  p 
)

Set the multiple value(s) of the uniform variable.

Related OpenGL symbols:
glUniform glProgramUniform
template<typename T, class LocationInit, class Typechecker, class SpecOpsWrapper>
template<std::size_t Cols, std::size_t Rows>
void oglplus::UniformSpecOps< T, LocationInit, Typechecker, SpecOpsWrapper >::SetMatrix ( std::size_t  count,
const T v 
)

Set the matrix components of the uniform variable.

Note
Consider using Uniform<Matrix<T,M,N>> instead
Related OpenGL symbols:
glUniformMatrix glProgramUniformMatrix
template<typename T, class LocationInit, class Typechecker, class SpecOpsWrapper>
template<std::size_t Cols, typename... P>
void oglplus::UniformSpecOps< T, LocationInit, Typechecker, SpecOpsWrapper >::SetMatrix ( T  v,
P...  p 
)

Set the matrix components of the uniform variable.

Note
Consider using Uniform<Matrix<T,M,N>> instead
Related OpenGL symbols:
glUniformMatrix glProgramUniformMatrix
template<typename T, class LocationInit, class Typechecker, class SpecOpsWrapper>
template<typename... P>
void oglplus::UniformSpecOps< T, LocationInit, Typechecker, SpecOpsWrapper >::SetVector ( T  v,
P...  p 
)

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
template<typename T, class LocationInit, class Typechecker, class SpecOpsWrapper>
template<std::size_t Cols>
void oglplus::UniformSpecOps< T, LocationInit, Typechecker, SpecOpsWrapper >::SetVector ( const T v)

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
template<typename T, class LocationInit, class Typechecker, class SpecOpsWrapper>
template<std::size_t Cols>
void oglplus::UniformSpecOps< T, LocationInit, Typechecker, SpecOpsWrapper >::SetVectors ( GLsizei  count,
const T v 
)

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
template<typename T, class LocationInit, class Typechecker, class SpecOpsWrapper>
template<std::size_t Cols>
void oglplus::UniformSpecOps< T, LocationInit, Typechecker, SpecOpsWrapper >::SetVectors ( const std::vector< T > &  v)

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

Copyright © 2010-2014 Matúš Chochlík, University of Žilina, Žilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Wed Apr 30 2014 by Doxygen (version 1.8.4).