Om
1.0.0
A universal framework for multimedia simulation
|
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 ShaderParameterUsage & | getParameterUsage (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 ShaderParameterValue & | getParameterValue (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 ShaderParameterValue * | getParameterValueWithUsage (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... | |
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.
om::graphics::materials::ShaderConfiguration::ShaderConfiguration | ( | ) |
Create a new shader configuration with no parameters.
|
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.
|
inline |
Return the semantic usage of the parameter in this configuration at the specified index.
|
inline |
Set the semantic usage of the parameter in this configuration at the specified index.
|
inline |
Return the value of the parameter in this configuration at the specified index.
|
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.