iShaderProgram Struct Reference
[Common Plugin Classes]
A helper for shaders that which to use the general plugins. More...
#include <csplugincommon/shader/shaderplugin.h>
Public Member Functions | |
virtual void | Activate ()=0 |
Sets this program to be the one used when rendering. | |
virtual bool | Compile (iHierarchicalCache *cacheTo, csRef< iString > *cacheTag=0)=0 |
Compile a program. | |
virtual void | Deactivate ()=0 |
Deactivate program so that it's not used in next rendering. | |
virtual void | GetUsedShaderVars (csBitArray &bits) const =0 |
Request all shader variables used by a certain shader ticket. | |
virtual bool | Load (iShaderDestinationResolver *resolve, const char *program, csArray< csShaderVarMapping > &mappings)=0 |
Loads from raw text. | |
virtual bool | Load (iShaderDestinationResolver *resolve, iDocumentNode *node)=0 |
Loads from a document-node. | |
virtual CacheLoadResult | LoadFromCache (iHierarchicalCache *cache, iBase *previous, iDocumentNode *programNode, csRef< iString > *failReason=0, csRef< iString > *cacheTag=0)=0 |
Loads from a cache. | |
virtual void | ResetState ()=0 |
Reset states to original. | |
virtual void | SetupState (const CS::Graphics::RenderMesh *mesh, CS::Graphics::RenderMeshModes &modes, const csShaderVariableStack &stack)=0 |
Setup states needed for proper operation of the shaderprogram. |
Detailed Description
A helper for shaders that which to use the general plugins.
This is the main program plugin interface
Definition at line 68 of file shaderplugin.h.
Member Function Documentation
virtual void iShaderProgram::Activate | ( | ) | [pure virtual] |
Sets this program to be the one used when rendering.
virtual bool iShaderProgram::Compile | ( | iHierarchicalCache * | cacheTo, | |
csRef< iString > * | cacheTag = 0 | |||
) | [pure virtual] |
Compile a program.
If cacheTo is given, the shader program can store the compiled program so it can later be restored using LoadFromCache().
- Remarks:
- A program can expect that Compile() is only called once, and all calls after the first can fail.
virtual void iShaderProgram::Deactivate | ( | ) | [pure virtual] |
Deactivate program so that it's not used in next rendering.
virtual void iShaderProgram::GetUsedShaderVars | ( | csBitArray & | bits | ) | const [pure virtual] |
Request all shader variables used by a certain shader ticket.
- Parameters:
-
ticket The ticket for which to retrieve the information. bits Bit array with one bit for each shader variable set; if a shader variable is used, the bit corresponding to the name of the variable is note set. Please note: first, the array passed in must initially have enough bits for all possible shader variables, it will not be resized - thus a good size would be the number of strings in the shader variable string set. Second, bits corresponding to unused shader variables will not be reset. It is the responsibility of the caller to do so.
Implemented in csShaderProgram.
virtual bool iShaderProgram::Load | ( | iShaderDestinationResolver * | resolve, | |
const char * | program, | |||
csArray< csShaderVarMapping > & | mappings | |||
) | [pure virtual] |
Loads from raw text.
virtual bool iShaderProgram::Load | ( | iShaderDestinationResolver * | resolve, | |
iDocumentNode * | node | |||
) | [pure virtual] |
Loads from a document-node.
virtual CacheLoadResult iShaderProgram::LoadFromCache | ( | iHierarchicalCache * | cache, | |
iBase * | previous, | |||
iDocumentNode * | programNode, | |||
csRef< iString > * | failReason = 0 , |
|||
csRef< iString > * | cacheTag = 0 | |||
) | [pure virtual] |
Loads from a cache.
Implemented in csShaderProgram.
virtual void iShaderProgram::ResetState | ( | ) | [pure virtual] |
Reset states to original.
virtual void iShaderProgram::SetupState | ( | const CS::Graphics::RenderMesh * | mesh, | |
CS::Graphics::RenderMeshModes & | modes, | |||
const csShaderVariableStack & | stack | |||
) | [pure virtual] |
Setup states needed for proper operation of the shaderprogram.
The documentation for this struct was generated from the following file:
- csplugincommon/shader/shaderplugin.h
Generated for Crystal Space 2.0 by doxygen 1.6.1