Improved handling of clean up of osg::Program/osg::Shader on closing of a graphis context.

This commit is contained in:
Robert Osfield
2006-01-16 17:05:17 +00:00
parent 0c9ab51e09
commit 93a2c3d011
5 changed files with 35 additions and 5 deletions

View File

@@ -201,6 +201,16 @@ const char* Shader::getTypename() const
}
void Shader::releaseGLObjects(osg::State* state) const
{
if (!state) _pcsList.setAllElementsTo(0);
else
{
unsigned int contextID = state->getContextID();
_pcsList[contextID] = 0;
}
}
void Shader::compileShader( unsigned int contextID ) const
{
PerContextShader* pcs = getPCS( contextID );