diff --git a/src/osg/State.cpp b/src/osg/State.cpp index f98eab98e..bb24ec646 100644 --- a/src/osg/State.cpp +++ b/src/osg/State.cpp @@ -11,6 +11,7 @@ * OpenSceneGraph Public License for more details. */ #include +#include #include #include #include @@ -227,6 +228,7 @@ void State::setInitialViewMatrix(const osg::RefMatrix* matrix) void State::setMaxTexturePoolSize(unsigned int size) { _maxTexturePoolSize = size; + osg::Texture::getTextureObjectManager(getContextID())->setMaxTexturePoolSize(size); osg::notify(osg::NOTICE)<<"_maxTexturePoolSize="<<_maxTexturePoolSize< proj = new osg::RefMatrix(projection); osg::ref_ptr mv = new osg::RefMatrix(modelview); - osg::State* state = _renderInfo.getState(); - if (state->getMaxTexturePoolSize()!=0) - { - osg::Texture::getTextureObjectManager(state->getContextID())->setMaxTexturePoolSize(state->getMaxTexturePoolSize()); - } - - // collect any occluder in the view frustum. if (_camera->containsOccluderNodes()) {