ork::UniformSampler Class Reference
[render]

A uniform holding a Texture value. More...

#include <Uniform.h>

Inheritance diagram for ork::UniformSampler:
ork::Uniform ork::Object

List of all members.

Public Member Functions

virtual ~UniformSampler ()
 Deletes this uniform.
virtual UniformType getType () const
 Returns the type of this uniform.
ptr< SamplergetSampler () const
 Returns the sampler used to sample the texture bound to this uniform.
void setSampler (const ptr< Sampler > sampler)
 Sets the sampler used to sample the texture bound to this uniform.
ptr< Textureget () const
 Returns the current value of this uniform.
void set (ptr< Texture > value)
 Sets the value of this uniform.
virtual void setValue (ptr< Value > v)
 Sets the value of this uniform.

Protected Member Functions

 UniformSampler (UniformType type, Program *program, UniformBlock *block, const string &name, GLint location)
 Creates a new uniform.
virtual void setValue ()
 Sets this uniform in its program.

Detailed Description

A uniform holding a Texture value.

In addition to a texture, a UniformSampler can also have a Sampler object to modify the default texture sampling parameters of the bound texture (like the minification of magnification filters).


Constructor & Destructor Documentation

virtual ork::UniformSampler::~UniformSampler (  )  [virtual]

Deletes this uniform.

ork::UniformSampler::UniformSampler ( UniformType  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

ptr<Texture> ork::UniformSampler::get (  )  const

Returns the current value of this uniform.

ptr<Sampler> ork::UniformSampler::getSampler (  )  const

Returns the sampler used to sample the texture bound to this uniform.

Returns:
the sampler used to sample the texture bound to this uniform. May be NULL.
virtual UniformType ork::UniformSampler::getType (  )  const [virtual]

Returns the type of this uniform.

Implements ork::Uniform.

void ork::UniformSampler::set ( ptr< Texture value  ) 

Sets the value of this uniform.

Parameters:
value the new value for this uniform.
void ork::UniformSampler::setSampler ( const ptr< Sampler sampler  ) 

Sets the sampler used to sample the texture bound to this uniform.

Parameters:
sampler a sampler object. May be NULL.
virtual void ork::UniformSampler::setValue (  )  [protected, virtual]

Sets this uniform in its program.

Implements ork::Uniform.

virtual void ork::UniformSampler::setValue ( ptr< Value v  )  [virtual]

Sets the value of this uniform.

Parameters:
v the new value for this uniform. Must be of the same type as this Uniform.

Implements ork::Uniform.


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