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

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 ShaderLanguagegetLanguage () 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...
 
ShaderSourcegetShader (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...
 
ShaderParametergetParameter (Index parameterIndex)
 Return a reference to the parameter at the specified index in this shader program. More...
 
const ShaderParametergetParameter (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 &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. 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 ShaderParameterValuegetParameterValue (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 ShaderParameterValuegetParameterValue (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 ShaderParameterValuegetParameterValue (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...
 
RenderModegetRenderMode ()
 Return a reference to the object that determines the fixed-function rendering mode for this shader program. More...
 
const RenderModegetRenderMode () 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...
 
ShaderBindingSetgetBindings ()
 Return a reference to the object that stores the shader bindings for this shader program. More...
 
const ShaderBindingSetgetBindings () 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...
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Member Function Documentation

const ShaderLanguage& om::graphics::materials::ShaderProgramSource::getLanguage ( ) const
inline

Return an object describing the language in which this shader program source is written.

void om::graphics::materials::ShaderProgramSource::setLanguage ( const ShaderLanguage newLanguage)
inline

Set an object describing the language in which this shader program source is written.

Size om::graphics::materials::ShaderProgramSource::getShaderCount ( ) const
inline

Return the total number of shaders that are attached to this shader program.

ShaderSource* om::graphics::materials::ShaderProgramSource::getShader ( Index  shaderIndex) const
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.

Bool om::graphics::materials::ShaderProgramSource::setShader ( Index  shaderIndex,
ShaderSource newShader 
)
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.

Bool om::graphics::materials::ShaderProgramSource::removeShader ( Index  shaderIndex)

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.

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

Return the number of parameters that this shader program has.

ShaderParameter& om::graphics::materials::ShaderProgramSource::getParameter ( Index  parameterIndex)
inline

Return a reference to the parameter at the specified index in this shader program.

const ShaderParameter& om::graphics::materials::ShaderProgramSource::getParameter ( Index  parameterIndex) const
inline

Return a const reference to the parameter at the specified index in this shader program.

void om::graphics::materials::ShaderProgramSource::setParameter ( Index  parameterIndex,
const ShaderParameter newParameter 
)
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.

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

Return the value of the parameter in this shader program at the specified index.

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

Set the value of the parameter in this shader program at the specified index.

const ShaderParameterValue* om::graphics::materials::ShaderProgramSource::getParameterValue ( ShaderParameterUsage::Enum  usage) const
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.

Bool om::graphics::materials::ShaderProgramSource::setParameterValue ( ShaderParameterUsage::Enum  usage,
const ShaderParameterValue newValue 
)
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.

RenderMode& om::graphics::materials::ShaderProgramSource::getRenderMode ( )
inline

Return a reference to the object that determines the fixed-function rendering mode for this shader program.

const RenderMode& om::graphics::materials::ShaderProgramSource::getRenderMode ( ) const
inline

Return a const reference to the object that determines the fixed-function rendering mode for this shader program.

void om::graphics::materials::ShaderProgramSource::setRenderMode ( const RenderMode newRenderMode)
inline

Set an object that determines the fixed-function rendering mode for this shader program.

ShaderBindingSet& om::graphics::materials::ShaderProgramSource::getBindings ( )
inline

Return a reference to the object that stores the shader bindings for this shader program.

const ShaderBindingSet& om::graphics::materials::ShaderProgramSource::getBindings ( ) const
inline

Return a const reference to the object that stores the shader bindings for this shader program.

Member Data Documentation

const ResourceType om::graphics::materials::ShaderProgramSource::RESOURCE_TYPE
static

The resource type for a shader program source.


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