OGLplus (0.45.0) a C++ wrapper for OpenGL

oglplus::UniformTpl< T, S, LocationInit, Typechecker, SetOps > Class Template Reference

Template for Uniform, ProgramUniform, LazyUniform, LazyProgramUniform, etc. More...

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

Inheritance diagram for oglplus::UniformTpl< T, S, LocationInit, Typechecker, SetOps >:
Collaboration diagram for oglplus::UniformTpl< T, S, LocationInit, Typechecker, SetOps >:

Public Member Functions

 UniformTpl (const ProgramOps &program, const GLchar *identifier)
 Reference a uniform identified by identifier in the program. More...
 
 UniformTpl (const ProgramOps &program, const String &identifier)
 Reference a uniform identified by identifier in the program. More...
 
 UniformTpl (const ProgramOps &program, String &&identifier)
 Reference a uniform identified by identifier in the program. More...
 
 UniformTpl (const ProgramOps &program, GLint location)
 Reference a uniform identified by location in the program. More...
 
void operator= (const T &value)
 Set the value of the uniform variable. More...
 
 operator bool (void)
 Equivalent to IsActive() More...
 
bool operator! (void)
 Equivalent to !IsActive() More...
 
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...
 
void Set (T v, P...p)
 Set the multiple value(s) of the uniform variable. More...
 
void SetVector (T v, P...p)
 Set the vector value of the uniform variable. More...
 
void SetVector (const T *v)
 Set the vector value of the uniform variable. More...
 
void SetVectors (GLsizei count, const T *v)
 Set multiple scalar or vector values of an uniform variable. More...
 
void SetVectors (const std::vector< T > &v)
 Set multiple scalar or vector values of an uniform variable. More...
 
void SetMatrix (std::size_t count, const T *v)
 Set the matrix components of the uniform variable. More...
 
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, typename S, class LocationInit, class Typechecker, class SetOps>
class oglplus::UniformTpl< T, S, LocationInit, Typechecker, SetOps >

Template for Uniform, ProgramUniform, LazyUniform, LazyProgramUniform, etc.

Note
Do not use directly, use Uniform, ProgramUniform, LazyUniform, LazyProgramUniform, OptionalUniform, OptionalProgramUniform, DirectUniform, DirectProgramUniform, etc. instead.

Constructor & Destructor Documentation

template<typename T, typename S, class LocationInit, class Typechecker, class SetOps>
oglplus::UniformTpl< T, S, LocationInit, Typechecker, SetOps >::UniformTpl ( const ProgramOps program,
const GLchar *  identifier 
)

Reference a uniform identified by identifier in the program.

Related OpenGL symbols:
glGetUniformLocation
template<typename T, typename S, class LocationInit, class Typechecker, class SetOps>
oglplus::UniformTpl< T, S, LocationInit, Typechecker, SetOps >::UniformTpl ( const ProgramOps program,
const String identifier 
)

Reference a uniform identified by identifier in the program.

Related OpenGL symbols:
glGetUniformLocation
template<typename T, typename S, class LocationInit, class Typechecker, class SetOps>
oglplus::UniformTpl< T, S, LocationInit, Typechecker, SetOps >::UniformTpl ( const ProgramOps program,
String &&  identifier 
)

Reference a uniform identified by identifier in the program.

Related OpenGL symbols:
glGetUniformLocation
template<typename T, typename S, class LocationInit, class Typechecker, class SetOps>
oglplus::UniformTpl< T, S, LocationInit, Typechecker, SetOps >::UniformTpl ( const ProgramOps program,
GLint  location 
)

Reference a uniform identified by location in the program.

Related OpenGL symbols:

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, typename S, class LocationInit, class Typechecker, class SetOps>
oglplus::UniformTpl< T, S, LocationInit, Typechecker, SetOps >::operator bool ( void  )

Equivalent to IsActive()

See Also
IsActive
template<typename T, typename S, class LocationInit, class Typechecker, class SetOps>
bool oglplus::UniformTpl< T, S, LocationInit, Typechecker, SetOps >::operator! ( void  )

Equivalent to !IsActive()

See Also
IsActive
template<typename T, typename S, class LocationInit, class Typechecker, class SetOps>
void oglplus::UniformTpl< T, S, LocationInit, Typechecker, SetOps >::operator= ( const T value)

Set the value of the uniform variable.

Related OpenGL symbols:
glUniform glUniformMatrix
void oglplus::UniformSpecOps< T, LocationInit, Typechecker, SetOps >::Set ( GLsizei  count,
const T *  v 
)
inherited

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

Related OpenGL symbols:
glUniform glProgramUniform
void oglplus::UniformSpecOps< T, LocationInit, Typechecker, SetOps >::Set ( const std::vector< T > &  v)
inherited

Set the value(s) of the uniform variable.

Related OpenGL symbols:
glUniform glProgramUniform
void oglplus::UniformSpecOps< T, LocationInit, Typechecker, SetOps >::Set ( v,
P...  p 
)
inherited

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

Related OpenGL symbols:
glUniform glProgramUniform
void oglplus::UniformSpecOps< T, LocationInit, Typechecker, SetOps >::SetMatrix ( std::size_t  count,
const T *  v 
)
inherited

Set the matrix components of the uniform variable.

Note
Consider using Uniform<Matrix<T,M,N>> instead
Related OpenGL symbols:
glUniformMatrix glProgramUniformMatrix
void oglplus::UniformSpecOps< T, LocationInit, Typechecker, SetOps >::SetMatrix ( v,
P...  p 
)
inherited

Set the matrix components of the uniform variable.

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

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
void oglplus::UniformSpecOps< T, LocationInit, Typechecker, SetOps >::SetVector ( const T *  v)
inherited

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
void oglplus::UniformSpecOps< T, LocationInit, Typechecker, SetOps >::SetVectors ( GLsizei  count,
const T *  v 
)
inherited

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
void oglplus::UniformSpecOps< T, LocationInit, Typechecker, SetOps >::SetVectors ( const std::vector< T > &  v)
inherited

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).