ork::Uniform Class Reference
[render]

An abstract uniform variable of a Program. More...

#include <Uniform.h>

Inheritance diagram for ork::Uniform:
ork::Object 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 > ork::UniformMatrix< U, T, 4, 4, V, W >

List of all members.

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

Programprogram
 The Program to which this uniform belongs.
UniformBlockblock
 The UniformBlock to which this uniform belongs.
string name
 The name of this uniform.
GLint location
 The location of this uniform.

Detailed Description

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


Constructor & Destructor Documentation

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.

Parameters:
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.

Member Function Documentation

string ork::Uniform::getName (  )  const

Returns the name of this uniform.

virtual UniformType ork::Uniform::getType (  )  const [pure virtual]
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]
virtual void ork::Uniform::setValue ( ptr< Value v  )  [pure virtual]

Member Data Documentation

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.

The Program to which this uniform belongs.


Generated on Mon Oct 18 09:36:10 2010 for ork by  doxygen 1.6.1