Fixed ShaderComposer::releaseGLObjects(State*) const method as it's const was missing.
Rewrote the ShaderComposer::releaseGLObjects() const method to pass on the releaseGLObjects() calls to any associated Program or Shader objects.
This commit is contained in:
parent
29ce4f616d
commit
653af27d02
@ -39,7 +39,7 @@ class OSG_EXPORT ShaderComposer : public osg::Object
|
||||
virtual osg::Shader* composeMain(const Shaders& shaders);
|
||||
virtual void addShaderToProgram(Program* program, const Shaders& shaders);
|
||||
|
||||
void releaseGLObjects(osg::State* state);
|
||||
virtual void releaseGLObjects(osg::State* state) const;
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -37,10 +37,21 @@ ShaderComposer::~ShaderComposer()
|
||||
OSG_INFO<<"ShaderComposer::~ShaderComposer() "<<this<<std::endl;
|
||||
}
|
||||
|
||||
void ShaderComposer::releaseGLObjects(osg::State* state)
|
||||
void ShaderComposer::releaseGLObjects(osg::State* state) const
|
||||
{
|
||||
_programMap.clear();
|
||||
_shaderMainMap.clear();
|
||||
for(ProgramMap::const_iterator itr = _programMap.begin();
|
||||
itr != _programMap.end();
|
||||
++itr)
|
||||
{
|
||||
itr->second->releaseGLObjects(state);
|
||||
}
|
||||
|
||||
for(ShaderMainMap::const_iterator itr = _shaderMainMap.begin();
|
||||
itr != _shaderMainMap.end();
|
||||
++itr)
|
||||
{
|
||||
itr->second->releaseGLObjects(state);
|
||||
}
|
||||
}
|
||||
|
||||
osg::Program* ShaderComposer::getOrCreateProgram(const ShaderComponents& shaderComponents)
|
||||
|
Loading…
Reference in New Issue
Block a user