Moved setting of TexturePoolSize into State.

This commit is contained in:
Robert Osfield 2009-09-23 14:54:13 +00:00
parent d56499025b
commit 0c0f96ac3d
2 changed files with 2 additions and 7 deletions

View File

@ -11,6 +11,7 @@
* OpenSceneGraph Public License for more details. * OpenSceneGraph Public License for more details.
*/ */
#include <osg/State> #include <osg/State>
#include <osg/Texture>
#include <osg/Notify> #include <osg/Notify>
#include <osg/GLU> #include <osg/GLU>
#include <osg/GLExtensions> #include <osg/GLExtensions>
@ -227,6 +228,7 @@ void State::setInitialViewMatrix(const osg::RefMatrix* matrix)
void State::setMaxTexturePoolSize(unsigned int size) void State::setMaxTexturePoolSize(unsigned int size)
{ {
_maxTexturePoolSize = size; _maxTexturePoolSize = size;
osg::Texture::getTextureObjectManager(getContextID())->setMaxTexturePoolSize(size);
osg::notify(osg::NOTICE)<<"_maxTexturePoolSize="<<_maxTexturePoolSize<<std::endl; osg::notify(osg::NOTICE)<<"_maxTexturePoolSize="<<_maxTexturePoolSize<<std::endl;
} }

View File

@ -846,13 +846,6 @@ bool SceneView::cullStage(const osg::Matrixd& projection,const osg::Matrixd& mod
osg::ref_ptr<RefMatrix> proj = new osg::RefMatrix(projection); osg::ref_ptr<RefMatrix> proj = new osg::RefMatrix(projection);
osg::ref_ptr<RefMatrix> mv = new osg::RefMatrix(modelview); osg::ref_ptr<RefMatrix> 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. // collect any occluder in the view frustum.
if (_camera->containsOccluderNodes()) if (_camera->containsOccluderNodes())
{ {