Added more comprehensive releaseGLObjects(State*=0) throughout Nodes,
Drawables,StateSet, and osgDB::Registry. Added cleanup_frame() from to osgProducer::OsgCamerGroup to help with proper clean of OpenGL objects before exit, and modified osgviewer, osghangglider, osgwindows examples to do the extra frame call to cleanup_frame() before exit.
This commit is contained in:
@@ -238,10 +238,9 @@ class OSG_EXPORT Drawable : public Object
|
||||
*/
|
||||
virtual void compileGLObjects(State& state) const;
|
||||
|
||||
/**
|
||||
if osg::State object is supplied: release any OpenGL display lists associated with graphics context specified
|
||||
or
|
||||
if state pointer is NULL: release all display lists for all graphics contexts */
|
||||
/** If State is non-zero, this function releases OpenGL objects for
|
||||
* the specified graphics context. Otherwise, releases OpenGL objexts
|
||||
* for all graphics contexts. */
|
||||
virtual void releaseGLObjects(State* state=0) const;
|
||||
|
||||
struct UpdateCallback : public virtual osg::Object
|
||||
|
||||
@@ -132,6 +132,11 @@ class OSG_EXPORT Geode : public Node
|
||||
return _bbox;
|
||||
}
|
||||
|
||||
/** If State is non-zero, this function releases any associated OpenGL objects for
|
||||
* the specified graphics context. Otherwise, releases OpenGL objexts
|
||||
* for all graphics contexts. */
|
||||
virtual void releaseGLObjects(osg::State* = 0) const;
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~Geode();
|
||||
|
||||
@@ -120,6 +120,12 @@ class OSG_EXPORT Group : public Node
|
||||
return _children.size(); // node not found.
|
||||
}
|
||||
|
||||
/** If State is non-zero, this function releases any associated OpenGL objects for
|
||||
* the specified graphics context. Otherwise, releases OpenGL objexts
|
||||
* for all graphics contexts. */
|
||||
virtual void releaseGLObjects(osg::State* = 0) const;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~Group();
|
||||
|
||||
@@ -248,6 +248,12 @@ class OSG_EXPORT Node : public Object
|
||||
void dirtyBound();
|
||||
|
||||
|
||||
/** If State is non-zero, this function releases any associated OpenGL objects for
|
||||
* the specified graphics context. Otherwise, releases OpenGL objexts
|
||||
* for all graphics contexts. */
|
||||
virtual void releaseGLObjects(osg::State* = 0) const;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
/** Node destructor. Note, is protected so that Nodes cannot
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
|
||||
namespace osg {
|
||||
|
||||
// forward declare
|
||||
class State;
|
||||
|
||||
/** META_Object macro define the standard clone, isSameKindAs and className methods.
|
||||
* Use when subclassing from Object to make it more convenient to define
|
||||
* the standard pure virtual clone, isSameKindAs and className methods
|
||||
@@ -102,6 +105,11 @@ class OSG_EXPORT Object : public Referenced
|
||||
inline const Referenced* getUserData() const { return _userData.get(); }
|
||||
|
||||
|
||||
/** If State is non-zero, this function releases any associated OpenGL objects for
|
||||
* the specified graphics context. Otherwise, releases OpenGL objexts
|
||||
* for all graphics contexts. */
|
||||
virtual void releaseGLObjects(osg::State* = 0) const {}
|
||||
|
||||
protected:
|
||||
|
||||
/** Object destructor. Note, is protected so that Objects cannot
|
||||
|
||||
Reference in New Issue
Block a user