ShaderProgram Class Reference

Cg shader encapsulation. More...

#include <shaderLoader.h>

List of all members.

Public Member Functions

void setTextureParameter (string name, unsigned int value)
 Sets a texture parameter of one of the programs.
void setParameter3f (string name, double valueOne, double valueTwo, double valueThree)
 Set a float3 parameter of one of the programs.
void setParameter2f (string name, double valueOne, double valueTwo)
 Set a float3 parameter of one of the programs.
void setParameter1f (string name, double valueOne)
 Set a float3 parameter of one of the programs.
void enableTextureParameters ()
 Enables all texture parameters that have been set.
void disableTextureParameters ()
 Disables all texture parameters that have been set.
void activate ()
 Activates the current program for rendering, updating it's parameters.

Public Attributes

string name
 name of the shader
CGprogram program
 Cg's program variable.
map< string, stringparameterTypeMap
 a map from parameter name to parameter type
map< string, CGparameter > parameterMap
 a map from parameter name to Cg's parameter vairables

Detailed Description

Cg shader encapsulation.

Managed by the ShaderLoader singleton.


Member Function Documentation

void ShaderProgram::activate (  ) 

Activates the current program for rendering, updating it's parameters.

void ShaderProgram::disableTextureParameters (  ) 

Disables all texture parameters that have been set.

void ShaderProgram::enableTextureParameters (  ) 

Enables all texture parameters that have been set.

void ShaderProgram::setParameter1f ( string  name,
double  valueOne 
)

Set a float3 parameter of one of the programs.

Parameters:
name name of the program
valueOne first float value
Remarks:
If no program of the given name exists or if the parameter is of a type different from float, the function returns without making any changes.
void ShaderProgram::setParameter2f ( string  name,
double  valueOne,
double  valueTwo 
)

Set a float3 parameter of one of the programs.

Parameters:
name name of the program
valueOne first float value
valueTwo second float value
Remarks:
If no program of the given name exists or if the parameter is of a type different from float2, the function returns without making any changes.
void ShaderProgram::setParameter3f ( string  name,
double  valueOne,
double  valueTwo,
double  valueThree 
)

Set a float3 parameter of one of the programs.

Parameters:
name name of the program
valueOne first float value
valueTwo second float value
valueThree third float value
Remarks:
If no program of the given name exists or if the parameter is of a type different from float3, the function returns without making any changes.
void ShaderProgram::setTextureParameter ( string  name,
unsigned int  value 
)

Sets a texture parameter of one of the programs.

Parameters:
name name of the program
value id of the texture that is to be set as a parameter
Remarks:
If no program of the given name exists or if the parameter isn't a texture type (1d, 2d, 3d texture), the function returns without making any changes.

Member Data Documentation

name of the shader

a map from parameter name to Cg's parameter vairables

a map from parameter name to parameter type

Cg's program variable.


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

Generated on Wed Jan 20 17:20:25 2010 for FlowVis by  doxygen 1.6.1