Moved resizeGLObjects/releaseGLObjects out of Referenced to avoid multiple inheritance warnings

This commit is contained in:
Robert Osfield
2019-01-12 11:27:18 +00:00
parent 46b07141e8
commit fe98c3d7f5
4 changed files with 37 additions and 13 deletions

View File

@@ -42,6 +42,14 @@ struct OSG_EXPORT GraphicsOperation : public Operation
virtual void operator () (Object* object);
virtual void operator () (GraphicsContext* context) = 0;
/** Resize any per context GLObject buffers to specified size. */
virtual void resizeGLObjectBuffers(unsigned int /*maxSize*/) {}
/** If State is non-zero, this function releases any associated OpenGL objects for
* the specified graphics context. Otherwise, releases OpenGL objects
* for all graphics contexts. */
virtual void releaseGLObjects(osg::State* = 0) const {}
};

View File

@@ -115,7 +115,7 @@ class OSG_EXPORT Referenced
/** Remove Observer that is observing this object.*/
void removeObserver(Observer* observer) const;
#if 0
/** Resize any per context GLObject buffers to specified size. */
virtual void resizeGLObjectBuffers(unsigned int /*maxSize*/) {}
@@ -123,7 +123,7 @@ class OSG_EXPORT Referenced
* the specified graphics context. Otherwise, releases OpenGL objects
* for all graphics contexts. */
virtual void releaseGLObjects(osg::State* = 0) const {}
#endif
public:
friend class DeleteHandler;

View File

@@ -38,7 +38,7 @@ struct LessDepthSortFunctor
/** StateGraph - contained in a renderBin, defines the scene to be drawn.
*/
class OSGUTIL_EXPORT StateGraph : public osg::Referenced
class OSGUTIL_EXPORT StateGraph : public osg::Object
{
public:
@@ -66,7 +66,6 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced
bool _dynamic;
StateGraph():
osg::Referenced(false),
_parent(NULL),
_stateset(NULL),
_depth(0),
@@ -78,7 +77,6 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced
}
StateGraph(StateGraph* parent,const osg::StateSet* stateset):
osg::Referenced(false),
_parent(parent),
_stateset(stateset),
_depth(0),
@@ -95,7 +93,13 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced
~StateGraph() {}
StateGraph* cloneType() const { return new StateGraph; }
virtual osg::Object* cloneType() const { return new StateGraph(); }
virtual StateGraph* cloneStateGraph() const { return new StateGraph(); }
virtual osg::Object* clone(const osg::CopyOp&) const { return new StateGraph(); }
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const StateGraph*>(obj)!=0L; }
virtual const char* libraryName() const { return "osgUtil"; }
virtual const char* className() const { return "StateGraph"; }
void setUserData(osg::Referenced* obj) { _userData = obj; }
osg::Referenced* getUserData() { return _userData.get(); }
@@ -345,7 +349,7 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced
private:
/// disallow copy construction.
StateGraph(const StateGraph&):osg::Referenced() {}
StateGraph(const StateGraph&) : osg::Object() {}
/// disallow copy operator.
StateGraph& operator = (const StateGraph&) { return *this; }