Om  1.0.0
A universal framework for multimedia simulation
Classes | Public Member Functions | List of all members
om::graphics::materials::ShaderConfiguration Class Reference

A class that contains a compile-time configuration for an instance of a shader program. More...

#include <omGraphicsShaderConfiguration.h>

Public Member Functions

 ShaderConfiguration ()
 Create a new shader configuration with no parameters. More...
 
Size getParameterCount () const
 Return the number of shader parameters that this configuration has. More...
 
void addParameter (const ShaderParameterUsage &usage, const ShaderParameterValue &value)
 Add a new shader parameter with the given attributes to the end of this configuration's list of parameters. More...
 
void removeParameter (Index parameterIndex)
 Remove the shader parameter at the specified index in this configuration. More...
 
void clearParameters ()
 Clear all shader parameters from this shader configuration. More...
 
const ShaderParameterUsagegetParameterUsage (Index parameterIndex) const
 Return the semantic usage of the parameter in this configuration at the specified index. More...
 
void setParameterValue (Index parameterIndex, const ShaderParameterUsage &newUsage)
 Set the semantic usage of the parameter in this configuration at the specified index. More...
 
const ShaderParameterValuegetParameterValue (Index parameterIndex) const
 Return the value of the parameter in this configuration at the specified index. More...
 
void setParameterValue (Index parameterIndex, const ShaderParameterValue &newValue)
 Set the value of the parameter in this configuration at the specified index. More...
 
const ShaderParameterValuegetParameterValueWithUsage (const ShaderParameterUsage &usage) const
 Return a pointer to the value of the parameter in this configuration with the specified usage. More...
 
Bool setParameterValueWithUsage (const ShaderParameterUsage &usage, const ShaderParameterValue &newValue)
 Set the value of the parameter in this configuration with the specified usage. More...
 

Detailed Description

A class that contains a compile-time configuration for an instance of a shader program.

The configuration modifies how a shader program is compiled. The parameters contained in the configuration can override a program's default configuration so that the shader can be tailored to suit the current rendering needs, such as to change the number of lights computed for different scenes.

Constructor & Destructor Documentation

om::graphics::materials::ShaderConfiguration::ShaderConfiguration ( )

Create a new shader configuration with no parameters.

Member Function Documentation

Size om::graphics::materials::ShaderConfiguration::getParameterCount ( ) const
inline

Return the number of shader parameters that this configuration has.

void om::graphics::materials::ShaderConfiguration::addParameter ( const ShaderParameterUsage usage,
const ShaderParameterValue value 
)

Add a new shader parameter with the given attributes to the end of this configuration's list of parameters.

void om::graphics::materials::ShaderConfiguration::removeParameter ( Index  parameterIndex)

Remove the shader parameter at the specified index in this configuration.

This method maintains the order of the remaining parameters.

void om::graphics::materials::ShaderConfiguration::clearParameters ( )

Clear all shader parameters from this shader configuration.

const ShaderParameterUsage& om::graphics::materials::ShaderConfiguration::getParameterUsage ( Index  parameterIndex) const
inline

Return the semantic usage of the parameter in this configuration at the specified index.

void om::graphics::materials::ShaderConfiguration::setParameterValue ( Index  parameterIndex,
const ShaderParameterUsage newUsage 
)
inline

Set the semantic usage of the parameter in this configuration at the specified index.

const ShaderParameterValue& om::graphics::materials::ShaderConfiguration::getParameterValue ( Index  parameterIndex) const
inline

Return the value of the parameter in this configuration at the specified index.

void om::graphics::materials::ShaderConfiguration::setParameterValue ( Index  parameterIndex,
const ShaderParameterValue newValue 
)
inline

Set the value of the parameter in this configuration at the specified index.

const ShaderParameterValue* om::graphics::materials::ShaderConfiguration::getParameterValueWithUsage ( const ShaderParameterUsage usage) const

Return a pointer to the value of the parameter in this configuration with the specified usage.

If there is a parameter with that usage, a pointer to its value is returned. Otherwise, the method fails and NULL is returned.

Bool om::graphics::materials::ShaderConfiguration::setParameterValueWithUsage ( const ShaderParameterUsage usage,
const ShaderParameterValue newValue 
)

Set the value of the parameter in this configuration with the specified usage.

If there is a parameter with that usage, its value is set to the new value and TRUE is returned. Otherwise, the method fails and FALSE is returned.


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