From Paul Martz, "his pretty much wraps up the OcclusionQueryNode work. I might make some additional modifications if testing reveals any issues, otherwise it's ready for 2.4."

This commit is contained in:
Robert Osfield
2008-01-10 11:02:21 +00:00
parent a46eb79311
commit 9d010e14fe
3 changed files with 162 additions and 83 deletions

View File

@@ -41,6 +41,9 @@ public:
virtual osg::BoundingSphere computeBound() const;
virtual void releaseGLObjects( osg::State* state = 0 ) const;
// When disabled, OQN doesn't perform occlusion queries, and simply
// renders its children.
void setQueriesEnabled( bool enable=true );
@@ -79,6 +82,16 @@ public:
void traverseQuery( const osg::Camera* camera, osg::NodeVisitor& nv );
void traverseDebug( osg::NodeVisitor& nv );
// Delete unused query IDs for this contextID.
static void flushDeletedQueryObjects( unsigned int contextID, double currentTime, double& availableTime );
// discard all the cached query objects 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 discardDeletedQueryObjects( unsigned int contextID );
protected:
virtual ~OcclusionQueryNode();