Om
1.0.0
A universal framework for multimedia simulation
|
A class that represents the interface for a hardware-executed shading program. More...
#include <omGraphicsDeviceShaderProgram.h>
Public Member Functions | |
virtual Size | getShaderCount () const =0 |
Return the total number of shaders that are attached to this shader program. More... | |
virtual Shared< DeviceShader > | getShader (Index shaderIndex) const =0 |
Return a pointer to the shader object attached at the specified index to the shader program. More... | |
virtual Bool | addShader (const Shared< DeviceShader > &newShader)=0 |
Attach the specified shader to this shader program. More... | |
virtual Bool | removeShader (Index shaderIndex)=0 |
Detach the shader at the specified index from this shader program. More... | |
virtual Bool | removeShader (const DeviceShader *shader)=0 |
Detach the shader with the specified address from this shader program. More... | |
virtual void | clearShaders ()=0 |
Remove all shaders that are attached to this shader program. More... | |
virtual Bool | link (StringOutputStream *linkLog=((void *) 0))=0 |
Link the program's shaders into a useable shader program. More... | |
virtual Bool | isLinked () const =0 |
Return whether or not a link operation has been attempted on this shader program. More... | |
virtual Size | getConstantVariableCount () const =0 |
Return the total number of constant variables that are part of this shader program. More... | |
virtual const ConstantVariable * | getConstantVariable (Index variableIndex) const =0 |
Return a pointer to the constant variable for this shader program at the given index. More... | |
virtual Bool | getConstantVariable (const ShaderSourceString &variableName, const ConstantVariable *&variable) const =0 |
Get the constant variable that is part of this shader program with the specified name. More... | |
virtual Bool | getConstantVariableIndex (const ShaderSourceString &variableName, Index &variableIndex) const =0 |
Get the constant variable index for this shader program with the specified name. More... | |
virtual Size | getTextureVariableCount () const =0 |
Return the total number of texture variables that are part of this shader program. More... | |
virtual const TextureVariable * | getTextureVariable (Index variableIndex) const =0 |
Return a pointer to the texture variable for this shader program at the given index. More... | |
virtual Bool | getTextureVariable (const ShaderSourceString &variableName, const TextureVariable *&variable) const =0 |
Get the texture variable that is part of this shader program with the specified name. More... | |
virtual Bool | getTextureVariableIndex (const ShaderSourceString &variableName, Index &variableIndex) const =0 |
Get the texture variable index for this shader program with the specified name. More... | |
virtual Size | getVertexVariableCount () const =0 |
Return the total number of vertex variables that are part of this shader program. More... | |
virtual const VertexVariable * | getVertexVariable (Index variableIndex) const =0 |
Return a pointer to the vertex variable for this shader program at the given index. More... | |
virtual Bool | getVertexVariable (const ShaderSourceString &variableName, const VertexVariable *&variable) const =0 |
Get the vertex variable that is part of this shader program with the specified name. More... | |
virtual Bool | getVertexVariableIndex (const ShaderSourceString &variableName, Index &variableIndex) const =0 |
Get the vertex variable index for this shader program with the specified name. More... | |
Public Member Functions inherited from om::graphics::devices::DeviceResource | |
virtual | ~DeviceResource () |
Destroy a device object, releasing all internal state. More... | |
GraphicsContext * | getContext () const |
Return a pointer to the graphics context associated with this DeviceResource. More... | |
virtual Bool | isValid () const =0 |
Return whether or not the state of this device resource is valid and able to be used for rendering. More... | |
Protected Member Functions | |
DeviceShaderProgram (devices::GraphicsContext *newContext) | |
Create a device shader program for the specified context. More... | |
Protected Member Functions inherited from om::graphics::devices::DeviceResource | |
DeviceResource (GraphicsContext *newContext) | |
Create a new device object that is associated with the specified graphics context. 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.
|
inlineprotected |
Create a device shader program for the specified context.
|
pure virtual |
Return the total number of shaders that are attached to this shader program.
Implemented in om::graphics::devices::opengl::OpenGLShaderProgram.
|
pure virtual |
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.
Implemented in om::graphics::devices::opengl::OpenGLShaderProgram.
|
pure virtual |
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.
Implemented in om::graphics::devices::opengl::OpenGLShaderProgram.
|
pure virtual |
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.
Implemented in om::graphics::devices::opengl::OpenGLShaderProgram.
|
pure virtual |
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.
Implemented in om::graphics::devices::opengl::OpenGLShaderProgram.
|
pure virtual |
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.
Implemented in om::graphics::devices::opengl::OpenGLShaderProgram.
|
pure virtual |
Link the program's shaders into a useable shader program.
The return value indicates wether or not the link operation was successful. If an error was encountered during the link process, the linker's output is written to the link log parameter.
Implemented in om::graphics::devices::opengl::OpenGLShaderProgram.
|
pure virtual |
Return whether or not a link operation has been attempted on this shader program.
The method does not return whether or not the link operation was successful, use the isValid() method instead to determine that.
Implemented in om::graphics::devices::opengl::OpenGLShaderProgram.
|
pure virtual |
Return the total number of constant variables that are part of this shader program.
Implemented in om::graphics::devices::opengl::OpenGLShaderProgram.
|
pure virtual |
Return a pointer to the constant variable for this shader program at the given index.
Variable indices range from 0 up to the number of constant variables minus one. If an invalid variable index is specified, NULL is returned.
Implemented in om::graphics::devices::opengl::OpenGLShaderProgram.
|
pure virtual |
Get the constant variable that is part of this shader program with the specified name.
The constant variable, if found, is placed in the output reference parameter. The method returns whether or not this shader program has a variable with the given variable name.
Implemented in om::graphics::devices::opengl::OpenGLShaderProgram.
|
pure virtual |
Get the constant variable index for this shader program with the specified name.
The constant variable's index, if found, is placed in the output reference parameter. The method returns whether or not this shader program has a variable with the given variable name.
Implemented in om::graphics::devices::opengl::OpenGLShaderProgram.
|
pure virtual |
Return the total number of texture variables that are part of this shader program.
Implemented in om::graphics::devices::opengl::OpenGLShaderProgram.
|
pure virtual |
Return a pointer to the texture variable for this shader program at the given index.
Variable indices range from 0 up to the number of texture variables minus one. If an invalid variable index is specified, NULL is returned.
Implemented in om::graphics::devices::opengl::OpenGLShaderProgram.
|
pure virtual |
Get the texture variable that is part of this shader program with the specified name.
The texture variable, if found, is placed in the output reference parameter. The method returns whether or not this shader program has a variable with the given variable name.
Implemented in om::graphics::devices::opengl::OpenGLShaderProgram.
|
pure virtual |
Get the texture variable index for this shader program with the specified name.
The texture variable's index, if found, is placed in the output reference parameter. The method returns whether or not this shader program has a variable with the given variable name.
Implemented in om::graphics::devices::opengl::OpenGLShaderProgram.
|
pure virtual |
Return the total number of vertex variables that are part of this shader program.
Implemented in om::graphics::devices::opengl::OpenGLShaderProgram.
|
pure virtual |
Return a pointer to the vertex variable for this shader program at the given index.
Variable indices range from 0 up to the number of vertex variables minus one. If an invalid variable index is specified, NULL is returned.
Implemented in om::graphics::devices::opengl::OpenGLShaderProgram.
|
pure virtual |
Get the vertex variable that is part of this shader program with the specified name.
The vertex variable, if found, is placed in the output reference parameter. The method returns whether or not this shader program has a variable with the given variable name.
Implemented in om::graphics::devices::opengl::OpenGLShaderProgram.
|
pure virtual |
Get the vertex variable index for this shader program with the specified name.
The vertex variable's index, if found, is placed in the output reference parameter. The method returns whether or not this shader program has a variable with the given variable name.
Implemented in om::graphics::devices::opengl::OpenGLShaderProgram.