1 #ifndef OPENMW_COMPONENTS_SHADERMANAGER_H
2 #define OPENMW_COMPONENTS_SHADERMANAGER_H
11 #include <OpenThreads/Mutex>
23 typedef std::map<std::string, std::string>
DefineMap;
31 osg::ref_ptr<osg::Shader>
getShader(
const std::string& shaderTemplate,
const DefineMap& defines, osg::Shader::Type shaderType);
33 osg::ref_ptr<osg::Program>
getProgram(osg::ref_ptr<osg::Shader> vertexShader, osg::ref_ptr<osg::Shader> fragmentShader);
43 typedef std::pair<std::string, DefineMap>
MapKey;
44 typedef std::map<MapKey, osg::ref_ptr<osg::Shader> >
ShaderMap;
47 typedef std::map<std::pair<osg::ref_ptr<osg::Shader>, osg::ref_ptr<osg::Shader> >, osg::ref_ptr<osg::Program> >
ProgramMap;
OpenThreads::Mutex mMutex
Definition: shadermanager.hpp:50
std::map< std::string, std::string > DefineMap
Definition: shadermanager.hpp:23
std::string mPath
Definition: shadermanager.hpp:37
osg::ref_ptr< osg::Shader > getShader(const std::string &shaderTemplate, const DefineMap &defines, osg::Shader::Type shaderType)
Definition: shadermanager.cpp:104
std::map< std::string, std::string > TemplateMap
Definition: shadermanager.hpp:40
std::map< MapKey, osg::ref_ptr< osg::Shader > > ShaderMap
Definition: shadermanager.hpp:44
std::pair< std::string, DefineMap > MapKey
Definition: shadermanager.hpp:43
ShaderMap mShaders
Definition: shadermanager.hpp:45
Reads shader template files and turns them into a concrete shader, based on a list of define's...
Definition: shadermanager.hpp:18
std::map< std::pair< osg::ref_ptr< osg::Shader >, osg::ref_ptr< osg::Shader > >, osg::ref_ptr< osg::Program > > ProgramMap
Definition: shadermanager.hpp:47
osg::ref_ptr< osg::Program > getProgram(osg::ref_ptr< osg::Shader > vertexShader, osg::ref_ptr< osg::Shader > fragmentShader)
Definition: shadermanager.cpp:149
ProgramMap mPrograms
Definition: shadermanager.hpp:48
void setShaderPath(const std::string &path)
Definition: shadermanager.cpp:19
TemplateMap mShaderTemplates
Definition: shadermanager.hpp:41