Added FlushDeletedGLObjectsOperation.
This commit is contained in:
@@ -96,6 +96,16 @@ struct OSG_EXPORT BlockAndFlushOperation : public GraphicsOperation, public Open
|
||||
virtual void operator () (GraphicsContext*);
|
||||
};
|
||||
|
||||
|
||||
struct OSG_EXPORT FlushDeletedGLObjectsOperation : public GraphicsOperation
|
||||
{
|
||||
FlushDeletedGLObjectsOperation(double availableTime, bool keep=false);
|
||||
|
||||
virtual void operator () (GraphicsContext*);
|
||||
|
||||
double _availableTime;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include <osg/GraphicsThread>
|
||||
#include <osg/GraphicsContext>
|
||||
#include <osg/GLObjects>
|
||||
#include <osg/Notify>
|
||||
|
||||
using namespace osg;
|
||||
@@ -110,3 +111,19 @@ void BlockAndFlushOperation::operator () (GraphicsContext*)
|
||||
glFlush();
|
||||
Block::release();
|
||||
}
|
||||
|
||||
FlushDeletedGLObjectsOperation::FlushDeletedGLObjectsOperation(double availableTime, bool keep):
|
||||
GraphicsOperation("FlushDeletedGLObjectsOperation",keep)
|
||||
{
|
||||
}
|
||||
|
||||
void FlushDeletedGLObjectsOperation::operator () (GraphicsContext* context)
|
||||
{
|
||||
State* state = context->getState();
|
||||
unsigned int contextID = state ? state->getContextID() : 0;
|
||||
const FrameStamp* frameStamp = state ? state->getFrameStamp() : 0;
|
||||
double currentTime = frameStamp ? frameStamp->getReferenceTime() : 0.0;
|
||||
double availableTime = _availableTime;
|
||||
|
||||
flushDeletedGLObjects(contextID, currentTime, availableTime);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user