Added releaseGLObjects(..) and resizeGLObjectBuffers(..) to osgShadow::ShadowTechnique's

This commit is contained in:
Robert Osfield
2016-02-04 17:52:44 +00:00
parent f373bcf23d
commit dcadd69c5a
20 changed files with 346 additions and 15 deletions

View File

@@ -89,6 +89,42 @@ ShadowTechnique(copy,copyop),
{
}
void ShadowMap::resizeGLObjectBuffers(unsigned int maxSize)
{
osg::resizeGLObjectBuffers(_camera, maxSize);
osg::resizeGLObjectBuffers(_texgen, maxSize);
osg::resizeGLObjectBuffers(_texture, maxSize);
osg::resizeGLObjectBuffers(_stateset, maxSize);
osg::resizeGLObjectBuffers(_program, maxSize);
osg::resizeGLObjectBuffers(_ls, maxSize);
for(ShaderList::iterator itr = _shaderList.begin();
itr != _shaderList.end();
++itr)
{
osg::resizeGLObjectBuffers(*itr, maxSize);
}
}
void ShadowMap::releaseGLObjects(osg::State* state) const
{
osg::releaseGLObjects(_camera, state);
osg::releaseGLObjects(_texgen, state);
osg::releaseGLObjects(_texture, state);
osg::releaseGLObjects(_stateset, state);
osg::releaseGLObjects(_program, state);
osg::releaseGLObjects(_ls, state);
for(ShaderList::const_iterator itr = _shaderList.begin();
itr != _shaderList.end();
++itr)
{
osg::releaseGLObjects(*itr, state);
}
}
void ShadowMap::setTextureUnit(unsigned int unit)
{
_shadowTextureUnit = unit;