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

@@ -228,21 +228,6 @@ class OSG_EXPORT Program : public osg::StateAttribute
/** Query InfoLog from a glProgram */
bool getGlProgramInfoLog(unsigned int contextID, std::string& log) const;
/** Mark internal glProgram for deletion.
* Deletion requests are queued until they can be executed
* in the proper GL context. */
static void deleteGlProgram(unsigned int contextID, GLuint program);
/** flush all the cached glPrograms which need to be deleted
* in the OpenGL context related to contextID.*/
static void flushDeletedGlPrograms(unsigned int contextID,double currentTime, double& availableTime);
/** discard all the cached glPrograms 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 discardDeletedGlPrograms(unsigned int contextID);
struct ActiveVarInfo {
ActiveVarInfo() : _location(-1), _type(Uniform::UNDEFINED), _size(-1) {}
ActiveVarInfo( GLint loc, GLenum type, GLint size ) : _location(loc), _type(type), _size(size) {}
@@ -409,7 +394,7 @@ class OSG_EXPORT Program : public osg::StateAttribute
PerContextProgram& operator=(const PerContextProgram&); // disallowed
};
struct OSG_EXPORT ProgramObjects : public osg::Referenced
struct OSG_EXPORT ProgramObjects : public osg::GraphicsObject
{
typedef std::vector< osg::ref_ptr<PerContextProgram> > PerContextPrograms;