Reads shader template files and turns them into a concrete shader, based on a list of define's.
More...
#include <shadermanager.hpp>
|
typedef std::map< std::string,
std::string > | DefineMap |
|
|
void | setShaderPath (const std::string &path) |
|
osg::ref_ptr< osg::Shader > | getShader (const std::string &shaderTemplate, const DefineMap &defines, osg::Shader::Type shaderType) |
|
osg::ref_ptr< osg::Program > | getProgram (osg::ref_ptr< osg::Shader > vertexShader, osg::ref_ptr< osg::Shader > fragmentShader) |
|
|
typedef std::map< std::string,
std::string > | TemplateMap |
|
typedef std::pair< std::string,
DefineMap > | MapKey |
|
typedef std::map< MapKey,
osg::ref_ptr< osg::Shader > > | ShaderMap |
|
typedef std::map< std::pair
< osg::ref_ptr< osg::Shader >
, osg::ref_ptr< osg::Shader >
>, osg::ref_ptr< osg::Program > > | ProgramMap |
|
Reads shader template files and turns them into a concrete shader, based on a list of define's.
- Shader templates can get the value of a define with the syntax .
osg::ref_ptr< osg::Program > Shader::ShaderManager::getProgram |
( |
osg::ref_ptr< osg::Shader > |
vertexShader, |
|
|
osg::ref_ptr< osg::Shader > |
fragmentShader |
|
) |
| |
osg::ref_ptr< osg::Shader > Shader::ShaderManager::getShader |
( |
const std::string & |
shaderTemplate, |
|
|
const DefineMap & |
defines, |
|
|
osg::Shader::Type |
shaderType |
|
) |
| |
Create or retrieve a shader instance.
- Parameters
-
shaderTemplate | The filename of the shader template. |
defines | Define values that can be retrieved by the shader template. |
shaderType | The type of shader (usually vertex or fragment shader). |
- Note
- May return NULL on failure.
-
Thread safe.
void Shader::ShaderManager::setShaderPath |
( |
const std::string & |
path | ) |
|
OpenThreads::Mutex Shader::ShaderManager::mMutex |
|
private |
std::string Shader::ShaderManager::mPath |
|
private |
The documentation for this class was generated from the following files: