globjects::Uniform< T > Class Template Reference

Wraps access to typed global GLSL variables. More...

`#include <globjects/include/globjects/AbstractUniform.h>`

## Public Member Functions

| Uniform (gl::GLint location)
| Uniform (gl::GLint location, const T &value)
| Uniform (const std::string &name)
| Uniform (const std::string &name, const T &value)
void | set (const T &value)
const T & | value () const

## Protected Member Functions

virtual | ~Uniform ()
virtual void | updateAt (const Program *program, gl::GLint location) const override

## Protected Attributes

T | m_value
| The uniforms value, explictly required when relinking programs. More...

## Detailed Description

### template<typename T>
class globjects::Uniform< T >

Wraps access to typed global GLSL variables.

The Uniform class wraps access to typed global GLSL variables (uniforms). These are stored in the OpenGL program objects itself.

Supported OpenGL uniform setters are wrapped via specialized template set implementations. Note that unsupported uniform types result in compile time errors due to the default implementation of set.

Simple usage of an Uniform:

Uniform<float> * u = new Uniform<float>("u_ratio");
u->set(1.618f);
program->addUniform(u);

See also
  AbstractUniform
  Program
  http://www.opengl.org/wiki/Uniform

## Constructor & Destructor Documentation

## Uniform() [1/4]

template<typename T >

globjects::Uniform< T >::Uniform | ( | gl::GLint | location | ) |

## Uniform() [2/4]

template<typename T >

globjects::Uniform< T >::Uniform | ( | gl::GLint | location,
|  | const T & | value
| ) |  |

## Uniform() [3/4]

template<typename T >

globjects::Uniform< T >::Uniform | ( | const std::string & | name | ) |

## Uniform() [4/4]

template<typename T >

globjects::Uniform< T >::Uniform | ( | const std::string & | name,
|  | const T & | value
| ) |  |

## ~Uniform()

template<typename T >

virtual globjects::Uniform< T >::~Uniform | ( |  | ) |

protected virtual

## Member Function Documentation

## set()

template<typename T >

void globjects::Uniform< T >::set | ( | const T & | value | ) |

## value()

template<typename T >

const T& globjects::Uniform< T >::value | ( |  | ) | const

## updateAt()

template<typename T >

virtual void globjects::Uniform< T >::updateAt | ( | const Program * | program,
|  | gl::GLint | location
| ) |  | const

override protected virtual

## Member Data Documentation

## m_value

template<typename T >

T globjects::Uniform< T >::m_value

protected

The uniforms value, explictly required when relinking programs.

The documentation for this class was generated from the following files:

- AbstractUniform.h
- Uniform.h