Refactored the GL object deletion management to use new osg::GraphicsObjectManager/GLObjectManager base classes, and osg::ContextData container.

This approach unifies much of the code handling the clean up of OpenGL graphics data, avoids lots of local mutexes and static variables that were previously required,
and enables the clean up scheme to be easily extended by users providing their own GraphicsObjectManager subclasses.


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15130 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2015-09-23 09:47:34 +00:00
parent cb3396b0e5
commit 161246d864
37 changed files with 1339 additions and 1374 deletions

View File

@@ -95,10 +95,6 @@ class OSG_EXPORT Drawable : public Node
{
public:
static unsigned int s_numberDrawablesReusedLastInLastFrame;
static unsigned int s_numberNewDrawablesInLastFrame;
static unsigned int s_numberDeletedDrawablesInLastFrame;
Drawable();
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
@@ -355,31 +351,19 @@ class OSG_EXPORT Drawable : public Node
/** Return a OpenGL display list handle a newly generated or reused from display list cache. */
static GLuint generateDisplayList(unsigned int contextID, unsigned int sizeHint = 0);
/** Set the minimum number of display lists to retain in the deleted display list cache. */
static void setMinimumNumberOfDisplayListsToRetainInCache(unsigned int minimum);
/** Get the minimum number of display lists to retain in the deleted display list cache. */
static unsigned int getMinimumNumberOfDisplayListsToRetainInCache();
/** Use deleteDisplayList instead of glDeleteList to allow
* OpenGL display list to be cached until they can be deleted
* by the OpenGL context in which they were created, specified
* by contextID.*/
static void deleteDisplayList(unsigned int contextID,GLuint globj, unsigned int sizeHint = 0);
/** Flush all the cached display list which need to be deleted
* in the OpenGL context related to contextID.*/
static void flushAllDeletedDisplayLists(unsigned int contextID);
/** Set the minimum number of display lists to retain in the deleted display list cache. */
static void setMinimumNumberOfDisplayListsToRetainInCache(unsigned int minimum);
/** Get the minimum number of display lists to retain in the deleted display list cache. */
static unsigned int getMinimumNumberOfDisplayListsToRetainInCache();
/** Flush all the cached display list which need to be deleted
* in the OpenGL context related to contextID.
* Note, unlike flush no OpenGL calls are made, instead the handles are all removed.
* this call is useful for when an OpenGL context has been destroyed. */
static void discardAllDeletedDisplayLists(unsigned int contextID);
/** Flush the cached display list which need to be deleted
* in the OpenGL context related to contextID.*/
static void flushDeletedDisplayLists(unsigned int contextID,double& availableTime);
typedef unsigned int AttributeType;