Om
1.0.0
A universal framework for multimedia simulation
|
A class that represents the interface for a hardware-executed shading program. More...
#include <omGraphicsShaderProgramSource.h>
Public Member Functions | |
ShaderProgramSource () | |
Create a new shader program with no shaders and undefined shader language. More... | |
ShaderProgramSource (const ShaderLanguage &newLanguage) | |
Create a new shader program with no shaders for the specified shader language. More... | |
const ShaderLanguage & | getLanguage () const |
Return an object describing the language in which this shader program source is written. More... | |
void | setLanguage (const ShaderLanguage &newLanguage) |
Set an object describing the language in which this shader program source is written. More... | |
Size | getShaderCount () const |
Return the total number of shaders that are attached to this shader program. More... | |
ShaderSource * | getShader (Index shaderIndex) const |
Return a pointer to the shader object attached at the specified index to the shader program. More... | |
Bool | setShader (Index shaderIndex, ShaderSource *newShader) |
Set a pointer to the light at the specified index in this scene. More... | |
Bool | addShader (ShaderSource *newShader) |
Attach the specified shader to this shader program. More... | |
Bool | removeShader (Index shaderIndex) |
Detach the shader at the specified index from this shader program. More... | |
Bool | removeShader (const ShaderSource *shader) |
Detach the shader with the specified address from this shader program. More... | |
void | clearShaders () |
Remove all shaders that are attached to this shader program. More... | |
Size | getParameterCount () const |
Return the number of parameters that this shader program has. More... | |
ShaderParameter & | getParameter (Index parameterIndex) |
Return a reference to the parameter at the specified index in this shader program. More... | |
const ShaderParameter & | getParameter (Index parameterIndex) const |
Return a const reference to the parameter at the specified index in this shader program. More... | |
void | setParameter (Index parameterIndex, const ShaderParameter &newParameter) |
Replace the parameter at the specified index in this shader program. More... | |
void | addParameter (const ShaderParameter &newParameter) |
Add a new parameter to the end of this shader program's list of parameters. More... | |
void | addParameter (const ShaderSourceString ¶meterName, const ShaderParameterUsage &usage, const ShaderParameterValue &value) |
Add a new parameter with the given attributes to the end of this shader program's list of parameters. More... | |
void | removeParameter (Index parameterIndex) |
Remove the parameter at the specified index in this shader program. More... | |
void | clearParameters () |
Clear all parameters from this shader program. More... | |
const ShaderParameterValue & | getParameterValue (Index parameterIndex) const |
Return the value of the parameter in this shader program at the specified index. More... | |
void | setParameterValue (Index parameterIndex, const ShaderParameterValue &newValue) |
Set the value of the parameter in this shader program at the specified index. More... | |
const ShaderParameterValue * | getParameterValue (ShaderParameterUsage::Enum usage) const |
Return a pointer to the value of the parameter in this shader program with the specified usage. More... | |
Bool | setParameterValue (ShaderParameterUsage::Enum usage, const ShaderParameterValue &newValue) |
Set the value of the parameter in this shader program with the specified usage. More... | |
const ShaderParameterValue * | getParameterValue (const ShaderParameterUsage &usage) const |
Return a pointer to the value of the parameter in this shader program with the specified usage. More... | |
Bool | setParameterValue (const ShaderParameterUsage &usage, const ShaderParameterValue &newValue) |
Set the value of the parameter in this shader program with the specified usage. More... | |
RenderMode & | getRenderMode () |
Return a reference to the object that determines the fixed-function rendering mode for this shader program. More... | |
const RenderMode & | getRenderMode () const |
Return a const reference to the object that determines the fixed-function rendering mode for this shader program. More... | |
void | setRenderMode (const RenderMode &newRenderMode) |
Set an object that determines the fixed-function rendering mode for this shader program. More... | |
ShaderBindingSet & | getBindings () |
Return a reference to the object that stores the shader bindings for this shader program. More... | |
const ShaderBindingSet & | getBindings () const |
Return a const reference to the object that stores the shader bindings for this shader program. More... | |
Static Public Attributes | |
static const ResourceType | RESOURCE_TYPE |
The resource type for a shader program source. More... | |
A class that represents the interface for a hardware-executed shading program.
A shader program is made up of one or more Shader objects that describe the different stages of a shading pipeline. A ShaderProgram presents an interface of shader variables that can be used to control the output of the shader. Shader variables can correspond to constants, per-vertex attributes, or textures. A shader program must be successfully linked before it can be used.
om::graphics::materials::ShaderProgramSource::ShaderProgramSource | ( | ) |
Create a new shader program with no shaders and undefined shader language.
om::graphics::materials::ShaderProgramSource::ShaderProgramSource | ( | const ShaderLanguage & | newLanguage | ) |
Create a new shader program with no shaders for the specified shader language.
|
inline |
Return an object describing the language in which this shader program source is written.
|
inline |
Set an object describing the language in which this shader program source is written.
|
inline |
Return the total number of shaders that are attached to this shader program.
|
inline |
Return a pointer to the shader object attached at the specified index to the shader program.
Shader indices range from 0 for the first attached shader to N for the Nth attached shader.
|
inline |
Set a pointer to the light at the specified index in this scene.
Bool om::graphics::materials::ShaderProgramSource::addShader | ( | ShaderSource * | newShader | ) |
Attach the specified shader to this shader program.
The method returns whether or not the new shader was able to be attached. The method can fail if the shader pointer is NULL, the shader was not able to be compiled, or if there was an internal error.
If the method succeeds, the shader program will need to be re-linked before it can be used.
Detach the shader at the specified index from this shader program.
The method returns whether or not the shader was able to be removed.
If the method succeeds, the shader program will need to be re-linked before it can be used.
Bool om::graphics::materials::ShaderProgramSource::removeShader | ( | const ShaderSource * | shader | ) |
Detach the shader with the specified address from this shader program.
The method returns whether or not the shader was able to be removed.
If the method succeeds, the shader program will need to be re-linked before it can be used.
void om::graphics::materials::ShaderProgramSource::clearShaders | ( | ) |
Remove all shaders that are attached to this shader program.
Shaders will need to be attatched to an empty program before it can be used again.
|
inline |
Return the number of parameters that this shader program has.
|
inline |
Return a reference to the parameter at the specified index in this shader program.
|
inline |
Return a const reference to the parameter at the specified index in this shader program.
|
inline |
Replace the parameter at the specified index in this shader program.
void om::graphics::materials::ShaderProgramSource::addParameter | ( | const ShaderParameter & | newParameter | ) |
Add a new parameter to the end of this shader program's list of parameters.
void om::graphics::materials::ShaderProgramSource::addParameter | ( | const ShaderSourceString & | parameterName, |
const ShaderParameterUsage & | usage, | ||
const ShaderParameterValue & | value | ||
) |
Add a new parameter with the given attributes to the end of this shader program's list of parameters.
void om::graphics::materials::ShaderProgramSource::removeParameter | ( | Index | parameterIndex | ) |
Remove the parameter at the specified index in this shader program.
This method maintains the order of the remaining parameters.
void om::graphics::materials::ShaderProgramSource::clearParameters | ( | ) |
Clear all parameters from this shader program.
|
inline |
Return the value of the parameter in this shader program at the specified index.
|
inline |
Set the value of the parameter in this shader program at the specified index.
|
inline |
Return a pointer to the value of the parameter in this shader program 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.
|
inline |
Set the value of the parameter in this shader program 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.
const ShaderParameterValue* om::graphics::materials::ShaderProgramSource::getParameterValue | ( | const ShaderParameterUsage & | usage | ) | const |
Return a pointer to the value of the parameter in this shader program 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::ShaderProgramSource::setParameterValue | ( | const ShaderParameterUsage & | usage, |
const ShaderParameterValue & | newValue | ||
) |
Set the value of the parameter in this shader program 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.
|
inline |
Return a reference to the object that determines the fixed-function rendering mode for this shader program.
|
inline |
Return a const reference to the object that determines the fixed-function rendering mode for this shader program.
|
inline |
Set an object that determines the fixed-function rendering mode for this shader program.
|
inline |
Return a reference to the object that stores the shader bindings for this shader program.
|
inline |
Return a const reference to the object that stores the shader bindings for this shader program.
|
static |
The resource type for a shader program source.