To use a shader you must first add source code to it and then compile it. Once a shader has been compiled, no more source code can be appended to it and it cannot be compiled again. You need to create a new shader to do this. To be able to use a shader, you need to attach it to a ShaderProgram object. It is allowed to attach a not compiled shader to a ShaderProgram. However, when the ShaderProgram object gets linked, all shaders attached to it must have been compiled, or else you'll get an assert in the debug build of the library.
For details on shading language peculiarities, limitations and dependencies, see the "Related Pages".
|
Public Types |
| enum | ShaderType { VertexShader = 0,
FragmentShader
} |
| | The available shader types. More...
|
Public Member Functions |
| wxString | GetSource () const |
| | Returns the source code of this shader.
|
| ShaderType | GetShaderType () const |
| | Returns the type of this shader.
|
| const ShadingLanguage & | GetShadingLanguage () const |
| | Returns the shading language used by this shader.
|
| const ShadingLanguageCaps & | GetShadingLanguageCaps () const |
| | Returns the shading language capabilities of the language of this shader.
|
| void | AppendSource (const wxString &source) |
| | Appends the given source code part to this shader.
|
| void | AppendSource (const wxFileName &fileName) |
| | Loads the given text file and appends it as source code to this shader.
|
| void | AppendSource (wxInputStream &inputStream) |
| | Reads shader source code from the given text input stream and appends it to this shader.
|
| wxString | Compile () |
| | Compiles the shader.
|
| bool | IsCompiled () const |
| | Returns true if this shader has already been compiled.
|
| bool | IsActive () const |
| | Returns true if this shader is attached to the currently active shader program.
|