Added releaseGLObjects(State*) support into osg::FrameBufferObject, osg::RenderBin and osg::RenderStage
to ensure proper clean up of FBO's on closing a graphics context.
This commit is contained in:
@@ -242,6 +242,14 @@ namespace osg
|
||||
|
||||
static int getMaxSamples(unsigned int contextID, const FBOExtensions *ext);
|
||||
|
||||
/** 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 objexts
|
||||
* for all graphics contexts. */
|
||||
virtual void releaseGLObjects(osg::State* = 0) const;
|
||||
|
||||
protected:
|
||||
virtual ~RenderBuffer();
|
||||
RenderBuffer &operator=(const RenderBuffer &) { return *this; }
|
||||
@@ -451,6 +459,14 @@ namespace osg
|
||||
* in the OpenGL context related to contextID.*/
|
||||
static void discardDeletedFrameBufferObjects(unsigned int contextID);
|
||||
|
||||
/** 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 objexts
|
||||
* for all graphics contexts. */
|
||||
virtual void releaseGLObjects(osg::State* = 0) const;
|
||||
|
||||
protected:
|
||||
virtual ~FrameBufferObject();
|
||||
FrameBufferObject& operator = (const FrameBufferObject&) { return *this; }
|
||||
|
||||
@@ -148,6 +148,11 @@ class OSGUTIL_EXPORT RenderBin : public osg::Object
|
||||
|
||||
void copyLeavesFromStateGraphListToRenderLeafList();
|
||||
|
||||
/** 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* state= 0) const;
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~RenderBin();
|
||||
|
||||
@@ -253,7 +253,12 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin
|
||||
/** clear the references to any dependent cameras.*/
|
||||
void clearReferencesToDependentCameras();
|
||||
|
||||
protected:
|
||||
/** 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* state= 0) const;
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~RenderStage();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user