diff --git a/examples/osgmultiplemovies/osgmultiplemovies.cpp b/examples/osgmultiplemovies/osgmultiplemovies.cpp index 8ee1e9711..8bb35883c 100644 --- a/examples/osgmultiplemovies/osgmultiplemovies.cpp +++ b/examples/osgmultiplemovies/osgmultiplemovies.cpp @@ -129,7 +129,7 @@ protected: osg::Vec4Array* c = dynamic_cast(geo->getColorArray()); if (c) (*c)[0] = color; - geo->dirtyDisplayList(); + geo->dirtyGLObjects(); c->dirty(); } @@ -350,7 +350,7 @@ public: (*tex_coords)[2].set(r,b); (*tex_coords)[3].set(r,t); tex_coords->dirty(); - _geo->dirtyDisplayList(); + _geo->dirtyGLObjects(); } } } diff --git a/include/osg/Drawable b/include/osg/Drawable index 9547659f5..71f52cfc0 100644 --- a/include/osg/Drawable +++ b/include/osg/Drawable @@ -235,9 +235,13 @@ class OSG_EXPORT Drawable : public Node /** Return whether to use a local VertexArrayObject for this Drawable.*/ bool getUseVertexArrayObject() const { return _useVertexArrayObject; } - +#ifdef OSG_USE_DEPRECATED_API /** Deprecated, use dirtyGLObjects() instead. */ - virtual void dirtyDisplayList(); + inline void dirtyDisplayList() + { + dirtyGLObjects(); + } +#endif /** Force a recompile on next draw() of any OpenGL objects associated with this geoset.*/ virtual void dirtyGLObjects(); @@ -362,7 +366,7 @@ class OSG_EXPORT Drawable : public Node }; /** Set the DrawCallback which allows users to attach customize the drawing of existing Drawable object.*/ - virtual void setDrawCallback(DrawCallback* dc) { _drawCallback=dc; dirtyDisplayList(); } + virtual void setDrawCallback(DrawCallback* dc) { _drawCallback=dc; dirtyGLObjects(); } /** Get the non const DrawCallback.*/ DrawCallback* getDrawCallback() { return _drawCallback.get(); } diff --git a/src/osg/Drawable.cpp b/src/osg/Drawable.cpp index f82df9df0..7ab550080 100644 --- a/src/osg/Drawable.cpp +++ b/src/osg/Drawable.cpp @@ -257,7 +257,7 @@ Drawable::Drawable(const Drawable& drawable,const CopyOp& copyop): Drawable::~Drawable() { - dirtyDisplayList(); + dirtyGLObjects(); } osg::MatrixList Drawable::getWorldMatrices(const osg::Node* haltTraversalAtNode) const @@ -358,7 +358,7 @@ void Drawable::setSupportsDisplayList(bool flag) { // used to support display lists and display lists switched // on so now delete them and turn useDisplayList off. - dirtyDisplayList(); + dirtyGLObjects(); _useDisplayList = false; } } @@ -380,7 +380,7 @@ void Drawable::setUseDisplayList(bool flag) if (_useDisplayList) { - dirtyDisplayList(); + dirtyGLObjects(); } if (_supportsDisplayList) @@ -433,11 +433,6 @@ void Drawable::setUseVertexBufferObjects(bool flag) _useVertexBufferObjects = flag; } -void Drawable::dirtyDisplayList() -{ - dirtyGLObjects(); -} - void Drawable::dirtyGLObjects() { unsigned int i; diff --git a/src/osg/Geometry.cpp b/src/osg/Geometry.cpp index 068a9f7c0..c0c699391 100644 --- a/src/osg/Geometry.cpp +++ b/src/osg/Geometry.cpp @@ -83,7 +83,7 @@ Geometry::Geometry(const Geometry& geometry,const CopyOp& copyop): Geometry::~Geometry() { // do dirty here to keep the getGLObjectSizeHint() estimate on the ball - dirtyDisplayList(); + dirtyGLObjects(); // no need to delete, all automatically handled by ref_ptr :-) } @@ -159,7 +159,7 @@ void Geometry::setVertexArray(Array* array) _vertexArray = array; - dirtyDisplayList(); + dirtyGLObjects(); dirtyBound(); if (/*_useVertexBufferObjects && */array) addVertexBufferObjectIfRequired(array); @@ -171,7 +171,7 @@ void Geometry::setNormalArray(Array* array, osg::Array::Binding binding) _normalArray = array; - dirtyDisplayList(); + dirtyGLObjects(); if (/*_useVertexBufferObjects && */array) addVertexBufferObjectIfRequired(array); } @@ -182,7 +182,7 @@ void Geometry::setColorArray(Array* array, osg::Array::Binding binding) _colorArray = array; - dirtyDisplayList(); + dirtyGLObjects(); if (/*_useVertexBufferObjects && */array) addVertexBufferObjectIfRequired(array); } @@ -193,7 +193,7 @@ void Geometry::setSecondaryColorArray(Array* array, osg::Array::Binding binding) _secondaryColorArray = array; - dirtyDisplayList(); + dirtyGLObjects(); if (/*_useVertexBufferObjects && */array) addVertexBufferObjectIfRequired(array); } @@ -204,7 +204,7 @@ void Geometry::setFogCoordArray(Array* array, osg::Array::Binding binding) _fogCoordArray = array; - dirtyDisplayList(); + dirtyGLObjects(); if (/*_useVertexBufferObjects && */array) addVertexBufferObjectIfRequired(array); } @@ -224,7 +224,7 @@ void Geometry::setTexCoordArray(unsigned int index,Array* array, osg::Array::Bin _texCoordList[index] = array; - dirtyDisplayList(); + dirtyGLObjects(); if (/*_useVertexBufferObjects && */array) { @@ -248,7 +248,7 @@ void Geometry::setTexCoordArrayList(const ArrayList& arrayList) { _texCoordList = arrayList; - dirtyDisplayList(); + dirtyGLObjects(); /*if (_useVertexBufferObjects)*/ { @@ -270,7 +270,7 @@ void Geometry::setVertexAttribArray(unsigned int index, Array* array, osg::Array _vertexAttribList[index] = array; - dirtyDisplayList(); + dirtyGLObjects(); if (/*_useVertexBufferObjects && */array) addVertexBufferObjectIfRequired(array); } @@ -291,7 +291,7 @@ void Geometry::setVertexAttribArrayList(const ArrayList& arrayList) { _vertexAttribList = arrayList; - dirtyDisplayList(); + dirtyGLObjects(); /*if (_useVertexBufferObjects)*/ { @@ -312,7 +312,7 @@ bool Geometry::addPrimitiveSet(PrimitiveSet* primitiveset) /*if (_useVertexBufferObjects)*/ addElementBufferObjectIfRequired(primitiveset); _primitives.push_back(primitiveset); - dirtyDisplayList(); + dirtyGLObjects(); dirtyBound(); return true; } @@ -328,7 +328,7 @@ bool Geometry::setPrimitiveSet(unsigned int i,PrimitiveSet* primitiveset) /*if (_useVertexBufferObjects)*/ addElementBufferObjectIfRequired(primitiveset); _primitives[i] = primitiveset; - dirtyDisplayList(); + dirtyGLObjects(); dirtyBound(); return true; } @@ -346,7 +346,7 @@ bool Geometry::insertPrimitiveSet(unsigned int i,PrimitiveSet* primitiveset) if (i<_primitives.size()) { _primitives.insert(_primitives.begin()+i,primitiveset); - dirtyDisplayList(); + dirtyGLObjects(); dirtyBound(); return true; } @@ -371,7 +371,7 @@ void Geometry::setPrimitiveSetList(const PrimitiveSetList& primitives) } } - dirtyDisplayList(); dirtyBound(); + dirtyGLObjects(); dirtyBound(); } bool Geometry::removePrimitiveSet(unsigned int i, unsigned int numElementsToRemove) @@ -393,7 +393,7 @@ bool Geometry::removePrimitiveSet(unsigned int i, unsigned int numElementsToRemo _primitives.erase(_primitives.begin()+i,_primitives.end()); } - dirtyDisplayList(); + dirtyGLObjects(); dirtyBound(); return true; } @@ -1180,7 +1180,7 @@ Geometry* osg::createTexturedQuadGeometry(const Vec3& corner,const Vec3& widthVe if (array->getBinding() == binding) return; \ array->setBinding(binding);\ if (ab==3 /*osg::Geometry::BIND_PER_PRIMITIVE*/) _containsDeprecatedData = true; \ - dirtyDisplayList(); + dirtyGLObjects(); #define GET_BINDING(array) (array!=0 ? static_cast(array->getBinding()) : BIND_OFF) @@ -1217,7 +1217,7 @@ void Geometry::setVertexAttribBinding(unsigned int index,AttributeBinding ab) _vertexAttribList[index]->setBinding(binding); - dirtyDisplayList(); + dirtyGLObjects(); } else { @@ -1231,7 +1231,7 @@ void Geometry::setVertexAttribNormalize(unsigned int index,GLboolean norm) { _vertexAttribList[index]->setNormalize(norm!=GL_FALSE); - dirtyDisplayList(); + dirtyGLObjects(); } } diff --git a/src/osgPlugins/Inventor/DeprecatedGeometry.cpp b/src/osgPlugins/Inventor/DeprecatedGeometry.cpp index f32822661..3cace87eb 100644 --- a/src/osgPlugins/Inventor/DeprecatedGeometry.cpp +++ b/src/osgPlugins/Inventor/DeprecatedGeometry.cpp @@ -21,7 +21,7 @@ void deprecated_osg::Geometry::setVertexAttribBinding(unsigned int index,Attribu _vertexAttribList[index]->setBinding(static_cast(ab)); - dirtyDisplayList(); + dirtyGLObjects(); } else { @@ -37,7 +37,7 @@ void deprecated_osg::Geometry::setVertexAttribNormalize(unsigned int index,GLboo { _vertexAttribList[index]->setNormalize(norm!=GL_FALSE); - dirtyDisplayList(); + dirtyGLObjects(); } } diff --git a/src/osgPlugins/gles/glesUtil b/src/osgPlugins/gles/glesUtil index 2afd35d7c..168808532 100644 --- a/src/osgPlugins/gles/glesUtil +++ b/src/osgPlugins/gles/glesUtil @@ -484,7 +484,7 @@ namespace glesUtil { // deduplicate UVs array that were only shared within the geometry deduplicator.deduplicateUVs(geom); - geom.dirtyDisplayList(); + geom.dirtyGLObjects(); } }; } // glesUtil namespace diff --git a/src/osgPlugins/logo/ReaderWriterLOGO.cpp b/src/osgPlugins/logo/ReaderWriterLOGO.cpp index e5ce86a97..0c6951634 100644 --- a/src/osgPlugins/logo/ReaderWriterLOGO.cpp +++ b/src/osgPlugins/logo/ReaderWriterLOGO.cpp @@ -59,7 +59,7 @@ class Logos: public osg::Drawable vp->height() != logos->getViewport()->height() ) { logos->getViewport()->setViewport( vp->x(), vp->y(), vp->width(), vp->height() ); - logos->dirtyDisplayList(); + logos->dirtyGLObjects(); } } return false; diff --git a/src/osgShadow/OccluderGeometry.cpp b/src/osgShadow/OccluderGeometry.cpp index 4266ec517..7ac19699d 100644 --- a/src/osgShadow/OccluderGeometry.cpp +++ b/src/osgShadow/OccluderGeometry.cpp @@ -314,7 +314,7 @@ void OccluderGeometry::setUpInternalStructures() dirtyBound(); - dirtyDisplayList(); + dirtyGLObjects(); } struct IndexVec3PtrPair @@ -860,7 +860,7 @@ void OccluderGeometry::computeShadowVolumeGeometry(const osg::Vec4& lightpos, Sh } - svg.dirtyDisplayList(); + svg.dirtyGLObjects(); svg.dirtyBound(); // osg::Timer_t t1 = osg::Timer::instance()->tick(); diff --git a/src/osgUtil/MeshOptimizers.cpp b/src/osgUtil/MeshOptimizers.cpp index 4eee09a89..79fcef100 100644 --- a/src/osgUtil/MeshOptimizers.cpp +++ b/src/osgUtil/MeshOptimizers.cpp @@ -735,7 +735,7 @@ void VertexCacheVisitor::optimizeVertices(Geometry& geom) else cout << "0.0\n"; #endif - geom.dirtyDisplayList(); + geom.dirtyGLObjects(); } // The main optimization loop @@ -1176,7 +1176,7 @@ void VertexAccessOrderVisitor::optimizeOrder(Geometry& geom) // deduplicate UVs array that were only shared within the geometry deduplicator.deduplicateUVs(geom); - geom.dirtyDisplayList(); + geom.dirtyGLObjects(); } void SharedArrayOptimizer::findDuplicatedUVs(const osg::Geometry& geometry) diff --git a/src/osgUtil/Optimizer.cpp b/src/osgUtil/Optimizer.cpp index dbdff4ea5..86a7e4da1 100644 --- a/src/osgUtil/Optimizer.cpp +++ b/src/osgUtil/Optimizer.cpp @@ -884,7 +884,7 @@ void CollectLowestTransformsVisitor::doTransform(osg::Object* obj,osg::Matrix& m osgUtil::TransformAttributeFunctor tf(matrix); drawable->accept(tf); drawable->dirtyBound(); - drawable->dirtyDisplayList(); + drawable->dirtyGLObjects(); return; } @@ -2444,7 +2444,7 @@ bool Optimizer::MergeGeometryVisitor::mergeGeometry(osg::Geometry& lhs,osg::Geom } lhs.dirtyBound(); - lhs.dirtyDisplayList(); + lhs.dirtyGLObjects(); return true; } @@ -4511,7 +4511,7 @@ void Optimizer::FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor::transf } geometry->dirtyBound(); - geometry->dirtyDisplayList(); + geometry->dirtyGLObjects(); } } diff --git a/src/osgUtil/SmoothingVisitor.cpp b/src/osgUtil/SmoothingVisitor.cpp index 9c72c874a..a24454786 100644 --- a/src/osgUtil/SmoothingVisitor.cpp +++ b/src/osgUtil/SmoothingVisitor.cpp @@ -141,7 +141,7 @@ static void smooth_old(osg::Geometry& geom) } geom.setNormalArray( normals, osg::Array::BIND_PER_VERTEX); - geom.dirtyDisplayList(); + geom.dirtyGLObjects(); }