From aa833acfd3a6a4a2777a00e767456df7b3fdd1ce Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 20 Jul 2004 05:37:59 +0000 Subject: [PATCH] Added support for releasing GLObjects, and renamed DisplayListVisitor the GLObjectVisitor to better fit its function, and added support for releasing objects as well as compiling them. --- include/osg/Drawable | 5 +- include/osg/FragmentProgram | 7 +- include/osg/StateAttribute | 8 ++- include/osg/StateSet | 5 +- include/osg/Texture | 7 +- include/osg/VertexProgram | 7 +- include/osgDB/DatabasePager | 21 +++++- include/osgGL2/ProgramObject | 7 +- include/osgText/Font | 2 - .../{DisplayListVisitor => GLObjectsVisitor} | 15 +++-- src/osg/Drawable.cpp | 34 ++++++++-- src/osg/FragmentProgram.cpp | 5 ++ src/osg/Geode.cpp | 2 +- src/osg/StateSet.cpp | 28 +++++++- src/osg/Texture.cpp | 6 +- src/osg/VertexProgram.cpp | 5 ++ src/osgDB/DatabasePager.cpp | 41 ++++++++---- src/osgGL2/ProgramObject.cpp | 5 ++ ...ayListVisitor.cpp => GLObjectsVisitor.cpp} | 65 +++++++++++-------- src/osgUtil/GNUmakefile | 2 +- src/osgUtil/SceneView.cpp | 10 +-- 21 files changed, 214 insertions(+), 73 deletions(-) rename include/osgUtil/{DisplayListVisitor => GLObjectsVisitor} (84%) rename src/osgUtil/{DisplayListVisitor.cpp => GLObjectsVisitor.cpp} (53%) diff --git a/include/osg/Drawable b/include/osg/Drawable index e8d638b44..bfdf7011c 100644 --- a/include/osg/Drawable +++ b/include/osg/Drawable @@ -254,8 +254,11 @@ class SG_EXPORT Drawable : public Object /** Immediately compile this drawable into an OpenGL Display List. Note I, operation is ignored if _useDisplayList to false. Note II, compile is not intended to be overridden in subclasses.*/ - virtual void compile(State& state) const; + virtual void compileGLObjects(State& state) const; + /** release any OpenGL display lists associated with graphics context specified + in osg::State object is supplied, or release all display lists for all graphics contexts if state pointer is NULL*/ + virtual void releaseGLObjects(State* state=0) const; struct UpdateCallback : public virtual osg::Object { diff --git a/include/osg/FragmentProgram b/include/osg/FragmentProgram index 602bbf133..9b995a830 100644 --- a/include/osg/FragmentProgram +++ b/include/osg/FragmentProgram @@ -201,7 +201,12 @@ class SG_EXPORT FragmentProgram : public StateAttribute virtual void apply(State& state) const; - virtual void compile(State& state) const { apply(state); } + virtual void compileGLObjects(State& state) const { apply(state); } + + /** release an OpenGL objects in specified graphics context if State + object is passed, otherwise release OpenGL objexts for all graphics context if + State object pointer NULL.*/ + virtual void releaseGLObjects(State* state=0) const; /** Extensions class which encapsulates the querring of extensions and * associated function pointers, and provide convinience wrappers to diff --git a/include/osg/StateAttribute b/include/osg/StateAttribute index 1985e4122..2df62429a 100644 --- a/include/osg/StateAttribute +++ b/include/osg/StateAttribute @@ -229,7 +229,13 @@ class SG_EXPORT StateAttribute : public Object virtual void apply(State&) const = 0; /** default to nothing to compile - all state is applied immediately. */ - virtual void compile(State&) const {} + virtual void compileGLObjects(State&) const {} + + /** release an OpenGL objects in specified graphics context if State + object is passed, otherwise release OpenGL objexts for all graphics context if + State object pointer NULL.*/ + virtual void releaseGLObjects(State* =0) const {} + protected: diff --git a/include/osg/StateSet b/include/osg/StateSet index e0874763b..96269e37d 100644 --- a/include/osg/StateSet +++ b/include/osg/StateSet @@ -221,7 +221,10 @@ class SG_EXPORT StateSet : public Object /** call compile on all StateAttributes contained within this StateSet.*/ - void compile(State& state) const; + void compileGLObjects(State& state) const; + + /** call release on all StateAttributes contained within this StateSet.*/ + virtual void releaseGLObjects(State* state=0) const; protected : diff --git a/include/osg/Texture b/include/osg/Texture index 7a4c64eb5..8166b6303 100644 --- a/include/osg/Texture +++ b/include/osg/Texture @@ -319,7 +319,12 @@ class SG_EXPORT Texture : public osg::StateAttribute virtual void apply(State& state) const = 0; /** Calls apply(state) to compile the texture. */ - virtual void compile(State& state) const; + virtual void compileGLObjects(State& state) const; + + /** release an OpenGL objects in specified graphics context if State + object is passed, otherwise release OpenGL objexts for all graphics context if + State object pointer NULL.*/ + virtual void releaseGLObjects(State* state=0) const; /** Extensions class which encapsulates the querring of extensions and * associated function pointers, and provide convinience wrappers to diff --git a/include/osg/VertexProgram b/include/osg/VertexProgram index a163491e9..bc2a893d6 100644 --- a/include/osg/VertexProgram +++ b/include/osg/VertexProgram @@ -193,7 +193,12 @@ class SG_EXPORT VertexProgram : public StateAttribute virtual void apply(State& state) const; - virtual void compile(State& state) const { apply(state); } + virtual void compileGLObjects(State& state) const { apply(state); } + + /** release an OpenGL objects in specified graphics context if State + object is passed, otherwise release OpenGL objexts for all graphics context if + State object pointer NULL.*/ + virtual void releaseGLObjects(State* state=0) const; /** Extensions class which encapsulates the querring of extensions and * associated function pointers, and provide convinience wrappers to diff --git a/include/osgDB/DatabasePager b/include/osgDB/DatabasePager index e3f26b3ee..52d5c3f76 100644 --- a/include/osgDB/DatabasePager +++ b/include/osgDB/DatabasePager @@ -140,6 +140,21 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl /** get whether the removed subgraphs should be deleted in the database thread or not.*/ bool getDeleteRemovedSubgraphsInDatabaseThread() const { return _deleteRemovedSubgraphsInDatabaseThread; } + + /** set whether newly loaded textures should have their UnrefImageDataAfterApply set to a specified value.*/ + void setUnrefImageDataAfterApplyPolicy(bool changeAutoUnRef, bool valueAutoUnRef) { _changeAutoUnRef = changeAutoUnRef; _valueAutoUnRef = valueAutoUnRef; } + + /** get whether newly loaded textures should have their UnrefImageDataAfterApply set to a specified value.*/ + void getUnrefImageDataAfterApplyPolicy(bool& changeAutoUnRef, bool& valueAutoUnRef) const { changeAutoUnRef = _changeAutoUnRef; valueAutoUnRef = _valueAutoUnRef; } + + + /** set whether newly loaded textures should have their MaxAnisotopy set to a specified value.*/ + void setMaxAnisotropyPolicy(bool changeAnisotropy, float valueAnisotropy) { _changeAnisotropy = changeAnisotropy; _valueAnisotropy = valueAnisotropy; } + + /** set whether newly loaded textures should have their MaxAnisotopy set to a specified value.*/ + void getMaxAnisotropyPolicy(bool& changeAnisotropy, float& valueAnisotropy) const { changeAnisotropy = _changeAnisotropy; valueAnisotropy = _valueAnisotropy; } + + /** Iterate through the active PagedLOD nodes children removing * children which havn't been visited since specified expiryTime. * note, should be only be called from the update thread. */ @@ -220,7 +235,11 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl DatabaseRequestList _dataToCompileList; OpenThreads::Mutex _dataToCompileListMutex; - + + bool _changeAutoUnRef; + bool _valueAutoUnRef; + bool _changeAnisotropy; + float _valueAnisotropy; bool _deleteRemovedSubgraphsInDatabaseThread; ObjectList _childrenToDeleteList; diff --git a/include/osgGL2/ProgramObject b/include/osgGL2/ProgramObject index 0ef779b9e..10911126b 100644 --- a/include/osgGL2/ProgramObject +++ b/include/osgGL2/ProgramObject @@ -86,7 +86,12 @@ class OSGGL2_EXPORT ProgramObject : public osg::StateAttribute * be pending. */ virtual void apply(osg::State& state) const; - virtual void compile(osg::State& state) const { apply(state); } + virtual void compileGLObjects(osg::State& state) const { apply(state); } + + /** release an OpenGL objects in specified graphics context if State + object is passed, otherwise release OpenGL objexts for all graphics context if + State object pointer NULL.*/ + virtual void releaseGLObjects(osg::State* state=0) const; // data access methods. diff --git a/include/osgText/Font b/include/osgText/Font index 084afea5e..921771574 100644 --- a/include/osgText/Font +++ b/include/osgText/Font @@ -25,8 +25,6 @@ #include -//#define OSG_FONT_USE_LUMINANCE_ALPHA - namespace osgText { class Font; diff --git a/include/osgUtil/DisplayListVisitor b/include/osgUtil/GLObjectsVisitor similarity index 84% rename from include/osgUtil/DisplayListVisitor rename to include/osgUtil/GLObjectsVisitor index 9efb0e659..2539b7ddb 100644 --- a/include/osgUtil/DisplayListVisitor +++ b/include/osgUtil/GLObjectsVisitor @@ -11,8 +11,8 @@ * OpenSceneGraph Public License for more details. */ -#ifndef OSGUTIL_DISPLAYLISTVISITOR -#define OSGUTIL_DISPLAYLISTVISITOR 1 +#ifndef OSGUTIL_GLOBJECTSVISITOR +#define OSGUTIL_GLOBJECTSVISITOR 1 #include #include @@ -26,7 +26,7 @@ namespace osgUtil { * with option to immediately compile osg::Drawable OpenGL Display lists and * osg::StateAttribute's. */ -class OSGUTIL_EXPORT DisplayListVisitor : public osg::NodeVisitor +class OSGUTIL_EXPORT GLObjectsVisitor : public osg::NodeVisitor { public: @@ -36,7 +36,9 @@ class OSGUTIL_EXPORT DisplayListVisitor : public osg::NodeVisitor SWITCH_ON_DISPLAY_LISTS = 0x1, SWITCH_OFF_DISPLAY_LISTS = 0x2, COMPILE_DISPLAY_LISTS = 0x4, - COMPILE_STATE_ATTRIBUTES = 0x8 + COMPILE_STATE_ATTRIBUTES = 0x8, + RELEASE_DISPLAY_LISTS = 0x10, + RELEASE_STATE_ATTRIBUTES = 0x20 }; typedef unsigned int Mode; @@ -45,7 +47,7 @@ class OSGUTIL_EXPORT DisplayListVisitor : public osg::NodeVisitor * with set specified display list mode. Default mode is to * gset->setUseDisplayList(true). */ - DisplayListVisitor(Mode mode=COMPILE_DISPLAY_LISTS|COMPILE_STATE_ATTRIBUTES); + GLObjectsVisitor(Mode mode=COMPILE_DISPLAY_LISTS|COMPILE_STATE_ATTRIBUTES); /** Set the operational mode of how the visitor should set up osg::Drawable's.*/ void setMode(Mode mode) { _mode = mode; } @@ -74,6 +76,9 @@ class OSGUTIL_EXPORT DisplayListVisitor : public osg::NodeVisitor */ virtual void apply(osg::Geode& node); + void apply(osg::Drawable& drawable); + void apply(osg::StateSet& stateset); + protected: Mode _mode; diff --git a/src/osg/Drawable.cpp b/src/osg/Drawable.cpp index 9e0b1f6d5..b8e082b2c 100644 --- a/src/osg/Drawable.cpp +++ b/src/osg/Drawable.cpp @@ -199,7 +199,7 @@ void Drawable::dirtyBound() } } -void Drawable::compile(State& state) const +void Drawable::compileGLObjects(State& state) const { if (!_useDisplayList) return; @@ -216,12 +216,6 @@ void Drawable::compile(State& state) const glDeleteLists( globj, 1 ); } - - if (_stateset.valid()) - { - _stateset->compile(state); - } - globj = glGenLists( 1 ); glNewList( globj, GL_COMPILE ); @@ -234,6 +228,32 @@ void Drawable::compile(State& state) const } +void Drawable::releaseGLObjects(State* state) const +{ + if (!_useDisplayList) return; + + if (state) + { + // get the contextID (user defined ID of 0 upwards) for the + // current OpenGL context. + unsigned int contextID = state->getContextID(); + + // get the globj for the current contextID. + GLuint& globj = _globjList[contextID]; + + // call the globj if already set otherwise comple and execute. + if( globj != 0 ) + { + glDeleteLists( globj, 1 ); + globj = 0; + } + } + else + { + const_cast(this)->dirtyDisplayList(); + } +} + void Drawable::setSupportsDisplayList(bool flag) { // if value unchanged simply return. diff --git a/src/osg/FragmentProgram.cpp b/src/osg/FragmentProgram.cpp index d7889a003..cd61704a8 100644 --- a/src/osg/FragmentProgram.cpp +++ b/src/osg/FragmentProgram.cpp @@ -177,6 +177,11 @@ void FragmentProgram::apply(State& state) const } } +void FragmentProgram::releaseGLObjects(State* state) const +{ + const_cast(this)->dirtyFragmentProgramObject(); +} + typedef buffered_value< ref_ptr > BufferedExtensions; static BufferedExtensions s_extensions; diff --git a/src/osg/Geode.cpp b/src/osg/Geode.cpp index 5abf1a93e..ab6db1935 100644 --- a/src/osg/Geode.cpp +++ b/src/osg/Geode.cpp @@ -190,6 +190,6 @@ void Geode::compileDrawables(State& state) itr!=_drawables.end(); ++itr) { - (*itr)->compile(state); + (*itr)->compileGLObjects(state); } } diff --git a/src/osg/StateSet.cpp b/src/osg/StateSet.cpp index bc2124422..a09bbff44 100644 --- a/src/osg/StateSet.cpp +++ b/src/osg/StateSet.cpp @@ -752,13 +752,13 @@ const StateSet::RefAttributePair* StateSet::getTextureAttributePair(unsigned int } -void StateSet::compile(State& state) const +void StateSet::compileGLObjects(State& state) const { for(AttributeList::const_iterator itr = _attributeList.begin(); itr!=_attributeList.end(); ++itr) { - itr->second.first->compile(state); + itr->second.first->compileGLObjects(state); } for(TextureAttributeList::const_iterator taitr=_textureAttributeList.begin(); @@ -769,7 +769,29 @@ void StateSet::compile(State& state) const itr!=taitr->end(); ++itr) { - itr->second.first->compile(state); + itr->second.first->compileGLObjects(state); + } + } +} + +void StateSet::releaseGLObjects(State* state) const +{ + for(AttributeList::const_iterator itr = _attributeList.begin(); + itr!=_attributeList.end(); + ++itr) + { + itr->second.first->releaseGLObjects(state); + } + + for(TextureAttributeList::const_iterator taitr=_textureAttributeList.begin(); + taitr!=_textureAttributeList.end(); + ++taitr) + { + for(AttributeList::const_iterator itr = taitr->begin(); + itr!=taitr->end(); + ++itr) + { + itr->second.first->releaseGLObjects(state); } } } diff --git a/src/osg/Texture.cpp b/src/osg/Texture.cpp index c6891711f..cffa3e574 100644 --- a/src/osg/Texture.cpp +++ b/src/osg/Texture.cpp @@ -1046,11 +1046,15 @@ void Texture::applyTexImage2D_subload(State& state, GLenum target, const Image* #include -void Texture::compile(State& state) const +void Texture::compileGLObjects(State& state) const { apply(state); } +void Texture::releaseGLObjects(State* state) const +{ + const_cast(this)->dirtyTextureObject(); +} typedef buffered_value< ref_ptr > BufferedExtensions; static BufferedExtensions s_extensions; diff --git a/src/osg/VertexProgram.cpp b/src/osg/VertexProgram.cpp index 85014d768..8a45e308a 100644 --- a/src/osg/VertexProgram.cpp +++ b/src/osg/VertexProgram.cpp @@ -177,6 +177,11 @@ void VertexProgram::apply(State& state) const } } +void VertexProgram::releaseGLObjects(State* state) const +{ + const_cast(this)->dirtyVertexProgramObject(); +} + typedef buffered_value< ref_ptr > BufferedExtensions; static BufferedExtensions s_extensions; diff --git a/src/osgDB/DatabasePager.cpp b/src/osgDB/DatabasePager.cpp index b1e66749b..ef7dc31f9 100644 --- a/src/osgDB/DatabasePager.cpp +++ b/src/osgDB/DatabasePager.cpp @@ -28,6 +28,12 @@ DatabasePager::DatabasePager() _threadPriorityDuringFrame = PRIORITY_MIN; _threadPriorityOutwithFrame = PRIORITY_MIN; + _changeAutoUnRef = false; + _valueAutoUnRef = false; + _changeAnisotropy = false; + _valueAnisotropy = 1.0f; + + #if 1 _deleteRemovedSubgraphsInDatabaseThread = true; #else @@ -209,11 +215,13 @@ void DatabasePager::signalEndFrame() class FindCompileableGLObjectsVisitor : public osg::NodeVisitor { public: - FindCompileableGLObjectsVisitor(DatabasePager::DataToCompile& dataToCompile, bool unrefImageOnApply, bool clientStorageHint): - osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN), - _dataToCompile(dataToCompile), - _unrefImageOnApply(unrefImageOnApply), - _clientStorageHint(clientStorageHint) + FindCompileableGLObjectsVisitor(DatabasePager::DataToCompile& dataToCompile, + bool changeAutoUnRef, bool valueAutoUnRef, + bool changeAnisotropy, float valueAnisotropy): + osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN), + _dataToCompile(dataToCompile), + _changeAutoUnRef(changeAutoUnRef), _valueAutoUnRef(valueAutoUnRef), + _changeAnisotropy(changeAnisotropy), _valueAnisotropy(valueAnisotropy) { } @@ -247,8 +255,8 @@ public: osg::Texture* texture = dynamic_cast(stateset->getTextureAttribute(i,osg::StateAttribute::TEXTURE)); if (texture) { - texture->setUnRefImageDataAfterApply(_unrefImageOnApply); - //texture->setClientStorageHint(_clientStorageHint); + if (_changeAutoUnRef) texture->setUnRefImageDataAfterApply(_valueAutoUnRef); + if (_changeAnisotropy) texture->setMaxAnisotropy(_valueAnisotropy); foundTextureState = true; } } @@ -274,8 +282,10 @@ public: } DatabasePager::DataToCompile& _dataToCompile; - bool _unrefImageOnApply; - bool _clientStorageHint; + bool _changeAutoUnRef; + bool _valueAutoUnRef; + bool _changeAnisotropy; + float _valueAnisotropy; }; @@ -367,7 +377,10 @@ void DatabasePager::run() ++itr; // find all the compileable rendering objects - FindCompileableGLObjectsVisitor frov(dtc, true, true); + FindCompileableGLObjectsVisitor frov(dtc, + _changeAutoUnRef, _valueAutoUnRef, + _changeAnisotropy, _valueAnisotropy); + databaseRequest->_loadedModel->accept(frov); if (!dtc.first.empty() || !dtc.second.empty()) @@ -499,7 +512,7 @@ public: if ((*titr)->referenceCount()==1) { osg::Texture* texture = const_cast(titr->get()); - texture->dirtyTextureObject(); + texture->releaseGLObjects(); objectsToDelete.push_back(texture); } } @@ -511,7 +524,7 @@ public: if ((*ditr)->referenceCount()==1) { osg::Drawable* drawable = const_cast(ditr->get()); - drawable->dirtyDisplayList(); + drawable->releaseGLObjects(); objectsToDelete.push_back(drawable); } } @@ -725,7 +738,7 @@ void DatabasePager::compileGLObjects(osg::State& state, double& availableTime) ++itr) { //osg::notify(osg::INFO)<<" Compiling stateset "<<(*itr).get()<compile(state); + (*itr)->compileGLObjects(state); elapsedTime = timer.delta_s(start_tick,timer.tick()); } // remove the compiled stateset from the list. @@ -742,7 +755,7 @@ void DatabasePager::compileGLObjects(osg::State& state, double& availableTime) ++itr) { //osg::notify(osg::INFO)<<" Compiling drawable "<<(*itr).get()<compile(state); + (*itr)->compileGLObjects(state); elapsedTime = timer.delta_s(start_tick,timer.tick()); } // remove the compiled drawables from the list. diff --git a/src/osgGL2/ProgramObject.cpp b/src/osgGL2/ProgramObject.cpp index 1e8ee5cb7..c8971b1a1 100644 --- a/src/osgGL2/ProgramObject.cpp +++ b/src/osgGL2/ProgramObject.cpp @@ -183,6 +183,11 @@ void ProgramObject::dirtyShaderObjects() } } +void ProgramObject::releaseGLObjects(osg::State* state) const +{ + const_cast(this)->dirtyShaderObjects(); +} + void ProgramObject::addShader( ShaderObject* shadObj ) { diff --git a/src/osgUtil/DisplayListVisitor.cpp b/src/osgUtil/GLObjectsVisitor.cpp similarity index 53% rename from src/osgUtil/DisplayListVisitor.cpp rename to src/osgUtil/GLObjectsVisitor.cpp index 6053668c8..6008c5c05 100644 --- a/src/osgUtil/DisplayListVisitor.cpp +++ b/src/osgUtil/GLObjectsVisitor.cpp @@ -10,13 +10,13 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * OpenSceneGraph Public License for more details. */ -#include +#include #include using namespace osg; using namespace osgUtil; -DisplayListVisitor::DisplayListVisitor(Mode mode) +GLObjectsVisitor::GLObjectsVisitor(Mode mode) { setTraversalMode(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN); @@ -26,55 +26,68 @@ DisplayListVisitor::DisplayListVisitor(Mode mode) } -void DisplayListVisitor::apply(osg::Node& node) +void GLObjectsVisitor::apply(osg::Node& node) { - if ((_mode&COMPILE_STATE_ATTRIBUTES) && node.getStateSet() && _state.valid()) + if (node.getStateSet()) { - node.getStateSet()->compile(*_state); + apply(*(node.getStateSet())); } traverse(node); } -void DisplayListVisitor::apply(osg::Geode& node) +void GLObjectsVisitor::apply(osg::Geode& node) { - if (_mode&COMPILE_STATE_ATTRIBUTES && _state.valid()) + if (node.getStateSet()) { - if (node.getStateSet()) - { - node.getStateSet()->compile(*_state); - } + apply(*(node.getStateSet())); + } - for(unsigned int i=0;igetStateSet()) { - drawable->getStateSet()->compile(*_state); + apply(*(drawable->getStateSet())); } } } +} +void GLObjectsVisitor::apply(osg::Drawable& drawable) +{ if (_mode&SWITCH_OFF_DISPLAY_LISTS) { - for(unsigned int i=0;isetUseDisplayList(false); - } + drawable.setUseDisplayList(false); } + if (_mode&SWITCH_ON_DISPLAY_LISTS) { - for(unsigned int i=0;isetUseDisplayList(true); - } + drawable.setUseDisplayList(true); } if (_mode&COMPILE_DISPLAY_LISTS && _state.valid()) { - for(unsigned int i=0;icompile(*_state); - } + drawable.compileGLObjects(*_state); + } + + if (_mode&RELEASE_DISPLAY_LISTS) + { + drawable.releaseGLObjects(_state.get()); + } +} + +void GLObjectsVisitor::apply(osg::StateSet& stateset) +{ + if (_mode&COMPILE_STATE_ATTRIBUTES && _state.valid()) + { + stateset.compileGLObjects(*_state); + } + if (_mode&RELEASE_STATE_ATTRIBUTES) + { + stateset.releaseGLObjects(_state.get()); } } diff --git a/src/osgUtil/GNUmakefile b/src/osgUtil/GNUmakefile index b94bc5fc8..35bfe8cf9 100644 --- a/src/osgUtil/GNUmakefile +++ b/src/osgUtil/GNUmakefile @@ -6,7 +6,7 @@ CXXFILES = \ CubeMapGenerator.cpp\ CullVisitor.cpp\ DelaunayTriangulator.cpp\ - DisplayListVisitor.cpp\ + GLObjectsVisitor.cpp\ DisplayRequirementsVisitor.cpp\ HalfWayMapGenerator.cpp\ HighlightMapGenerator.cpp\ diff --git a/src/osgUtil/SceneView.cpp b/src/osgUtil/SceneView.cpp index 9cb37530c..46c0fc8b8 100644 --- a/src/osgUtil/SceneView.cpp +++ b/src/osgUtil/SceneView.cpp @@ -12,7 +12,7 @@ */ #include #include -#include +#include #include #include @@ -82,17 +82,17 @@ void SceneView::setDefaults() _renderStage = new RenderStage; - DisplayListVisitor::Mode dlvMode = DisplayListVisitor::COMPILE_DISPLAY_LISTS|DisplayListVisitor::COMPILE_STATE_ATTRIBUTES; + GLObjectsVisitor::Mode dlvMode = GLObjectsVisitor::COMPILE_DISPLAY_LISTS|GLObjectsVisitor::COMPILE_STATE_ATTRIBUTES; #ifdef __sgi - dlvMode = DisplayListVisitor::COMPILE_STATE_ATTRIBUTES; + dlvMode = GLObjectsVisitor::COMPILE_STATE_ATTRIBUTES; #endif // sgi's IR graphics has a problem with lighting and display lists, as it seems to store // lighting state with the display list, and the display list visitor doesn't currently apply // state before creating display lists. So will disable the init visitor default, this won't // affect functionality since the display lists will be created as and when needed. - DisplayListVisitor* dlv = new DisplayListVisitor(dlvMode); + GLObjectsVisitor* dlv = new GLObjectsVisitor(dlvMode); dlv->setNodeMaskOverride(0xffffffff); _initVisitor = dlv; @@ -139,7 +139,7 @@ void SceneView::init() _initVisitor->reset(); _initVisitor->setFrameStamp(_frameStamp.get()); - DisplayListVisitor* dlv = dynamic_cast(_initVisitor.get()); + GLObjectsVisitor* dlv = dynamic_cast(_initVisitor.get()); if (dlv) dlv->setState(_state.get()); if (_frameStamp.valid())