Moved setEndBarrierOperation(..) implementation into .cpp and added support for stoppig and starting threading if required.

This commit is contained in:
Robert Osfield 2012-01-24 17:30:44 +00:00
parent b0b98d49b8
commit d350ea5395
2 changed files with 11 additions and 1 deletions

View File

@ -111,7 +111,7 @@ class OSGVIEWER_EXPORT ViewerBase : public virtual osg::Object
* or NO_OPERATION. NO_OPERATION is the default. Per BarrierOperation::operator()(), * or NO_OPERATION. NO_OPERATION is the default. Per BarrierOperation::operator()(),
* a glFlush() command, glFinish() command, or no additional OpenGL command will be * a glFlush() command, glFinish() command, or no additional OpenGL command will be
* issued before entering the end barrier. */ * issued before entering the end barrier. */
void setEndBarrierOperation(const osg::BarrierOperation::PreBlockOp& op) { _endBarrierOperation = op; } void setEndBarrierOperation(osg::BarrierOperation::PreBlockOp op);
/** Get the end barrier operation. */ /** Get the end barrier operation. */
osg::BarrierOperation::PreBlockOp getEndBarrierOperation() const { return _endBarrierOperation; } osg::BarrierOperation::PreBlockOp getEndBarrierOperation() const { return _endBarrierOperation; }

View File

@ -179,6 +179,16 @@ void ViewerBase::setEndBarrierPosition(BarrierPosition bp)
if (_threadingModel!=SingleThreaded) startThreading(); if (_threadingModel!=SingleThreaded) startThreading();
} }
void ViewerBase::setEndBarrierOperation(osg::BarrierOperation::PreBlockOp op)
{
if (_endBarrierOperation == op) return;
if (_threadsRunning) stopThreading();
_endBarrierOperation = op;
if (_threadingModel!=SingleThreaded) startThreading();
}
void ViewerBase::stopThreading() void ViewerBase::stopThreading()
{ {