An abstract uniform variable of a Program. More...
#include <Uniform.h>
Public Member Functions | |
virtual | ~Uniform () |
Deletes this uniform. | |
virtual UniformType | getType () const =0 |
Returns the type of this uniform. | |
string | getName () const |
Returns the name of this uniform. | |
virtual void | setValue (ptr< Value > v)=0 |
Sets the value of this uniform. | |
Protected Member Functions | |
Uniform (const char *type, Program *program, UniformBlock *block, const string &name, GLint location) | |
Creates a new uniform. | |
virtual void | setValue ()=0 |
Sets this uniform in its program. | |
volatile void * | mapBuffer (GLint offset) const |
Maps the GPUBuffer of the uniform block of this uniform into memory. | |
Protected Attributes | |
Program * | program |
The Program to which this uniform belongs. | |
UniformBlock * | block |
The UniformBlock to which this uniform belongs. | |
string | name |
The name of this uniform. | |
GLint | location |
The location of this uniform. |
An abstract uniform variable of a Program.
The uniform value can be set at any time, and affects only the program that contains this uniform (unless this uniform belongs to a UniformBlock whose Buffer is shared between different programs, in which case setting the value of this uniform also changes its value for the other programs).
virtual ork::Uniform::~Uniform | ( | ) | [virtual] |
Deletes this uniform.
ork::Uniform::Uniform | ( | const char * | type, | |
Program * | program, | |||
UniformBlock * | block, | |||
const string & | name, | |||
GLint | location | |||
) | [protected] |
Creates a new uniform.
type | the type of this uniform. | |
program | the Program to which this uniform belongs. | |
block | UniformBlock to which this uniform belongs. Maybe NULL. | |
name | the name of the uniform in the GLSL shader code. | |
location | the location of this uniform. For an uniform inside a block, this location is an offset inside the uniform block buffer. |
string ork::Uniform::getName | ( | ) | const |
Returns the name of this uniform.
virtual UniformType ork::Uniform::getType | ( | ) | const [pure virtual] |
Returns the type of this uniform.
Implemented in ork::Uniform1< U, T, R, V, W >, ork::Uniform2< U, T, R, V, W >, ork::Uniform3< U, T, R, V, W >, ork::Uniform4< U, T, R, V, W >, ork::UniformMatrix< U, T, C, R, V, W >, ork::UniformSampler, ork::UniformMatrix< U, T, 3, 3, V, W >, and ork::UniformMatrix< U, T, 4, 4, V, W >.
volatile void* ork::Uniform::mapBuffer | ( | GLint | offset | ) | const [protected] |
Maps the GPUBuffer of the uniform block of this uniform into memory.
virtual void ork::Uniform::setValue | ( | ) | [protected, pure virtual] |
Sets this uniform in its program.
Implemented in ork::Uniform1< U, T, R, V, W >, ork::Uniform2< U, T, R, V, W >, ork::Uniform3< U, T, R, V, W >, ork::Uniform4< U, T, R, V, W >, ork::UniformMatrix< U, T, C, R, V, W >, ork::UniformSampler, ork::UniformMatrix< U, T, 3, 3, V, W >, and ork::UniformMatrix< U, T, 4, 4, V, W >.
Sets the value of this uniform.
v | the new value for this uniform. Must be of the same type as this Uniform. |
Implemented in ork::Uniform1< U, T, R, V, W >, ork::Uniform2< U, T, R, V, W >, ork::Uniform3< U, T, R, V, W >, ork::Uniform4< U, T, R, V, W >, ork::UniformMatrix< U, T, C, R, V, W >, ork::UniformSampler, ork::UniformMatrix< U, T, 3, 3, V, W >, and ork::UniformMatrix< U, T, 4, 4, V, W >.
UniformBlock* ork::Uniform::block [protected] |
The UniformBlock to which this uniform belongs.
Maybe NULL.
GLint ork::Uniform::location [protected] |
The location of this uniform.
For an uniform inside a block, this location is an offset inside the uniform block buffer.
string ork::Uniform::name [protected] |
The name of this uniform.
Program* ork::Uniform::program [protected] |
The Program to which this uniform belongs.