Om
1.0.0
A universal framework for multimedia simulation
|
A class that represents a hardware-executed programmable rendering stage. More...
#include <omGraphicsDeviceShader.h>
Public Member Functions | |
const ShaderType & | getType () const |
Return an object indicating the type of shader this is. More... | |
virtual ShaderSourceString | getSource () const =0 |
Return the source code used by this shader. More... | |
virtual Bool | setSource (const ShaderSourceString &newSource, const ShaderLanguage &newLanguage)=0 |
Set the source code used by the shader. More... | |
virtual Bool | compile (StringOutputStream *compilationLog=((void *) 0))=0 |
Compile the shader's source code and return whether or not the operation was successful. More... | |
virtual Bool | isCompiled () const =0 |
Return whether or not this shader has been compiled. 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 | |
DeviceShader (devices::GraphicsContext *newContext, ShaderType newShaderType) | |
Create a device shader for the specified context with the given shader type. 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... | |
Protected Attributes | |
ShaderType | shaderType |
An enum value that is set by subclasses that specifies the kind of shader this is. More... | |
A class that represents a hardware-executed programmable rendering stage.
A shader is defined by its source code, a string of characters which uses an implementation-defined language to perform graphics operations such as lighting and shading.
|
inlineprotected |
Create a device shader for the specified context with the given shader type.
|
inline |
Return an object indicating the type of shader this is.
|
pure virtual |
Return the source code used by this shader.
This method downloads the shader source code from the driver/GPU and returns a string containing the previously submitted source code, or an empty string if there is no source code or the shader is invalid.
Implemented in om::graphics::devices::opengl::OpenGLShader.
|
pure virtual |
Set the source code used by the shader.
This method replaces the current source code for this shader. The shader must be compiled before the new source code takes effect.
The method allows the user to specify the language of the shader's source code. This allows the implementation to choose the correct compiler for the shader.
If there is an error or the specified language is not supported, FALSE is returned and the source code for the shader is unchanged. Otherwise, the method succeeds and TRUE is returned.
Implemented in om::graphics::devices::opengl::OpenGLShader.
|
pure virtual |
Compile the shader's source code and return whether or not the operation was successful.
If the result of compilation was not successful, the error output of the compilation is sent to the specified string output stream.
Implemented in om::graphics::devices::opengl::OpenGLShader.
|
pure virtual |
Return whether or not this shader has been compiled.
The return value indicates whether or not a compilation operation has been attempted since the last source code change, not whether or not the compilation was without error.
Implemented in om::graphics::devices::opengl::OpenGLShader.
|
protected |
An enum value that is set by subclasses that specifies the kind of shader this is.