13 #include <boost/unordered_map.hpp>
17 #include <osg/StateAttribute>
43 static std::string loadShaderSource(
const std::string& strFileName);
46 static void saveShaderSource(
const std::string& strFileName,
const std::string& strSource);
48 static std::string fixVersionDirective(
const std::string &shaderString);
51 static unsigned getNumGPUTextureImageUnits();
56 static void bindSingleAttribute(
int shader, std::string uniName,
bool value,
void *hashPtr);
61 static void bindAttributes(osg::Node *node,
int shader,
int contextID);
68 static bool getVPShaderVector(osg::StateSet *ss, osg::State& state,
unsigned int &shaderHash, std::vector<unsigned int> &vertShaderVector, std::vector<unsigned int> &fragShaderVector);
72 static void deleteShaders(std::vector<unsigned int> shaderVector);
77 static bool compileShader(
const char* source,
unsigned int shaderType,
unsigned int &shaderID);
79 static void restoreOpenGLMode(osg::State& state,
int stateToSet);
80 static void restoreOpenGLStateAttribute(osg::State& state, osg::StateAttribute::Type type);
81 static void restoreOpenGLProgram(osg::State& state);
82 static void restoreOpenGLFBO(osg::State& state);