diff --git a/applications/osgviewer/osgviewer.cpp b/applications/osgviewer/osgviewer.cpp index c61294cf0..2a768e5db 100644 --- a/applications/osgviewer/osgviewer.cpp +++ b/applications/osgviewer/osgviewer.cpp @@ -165,6 +165,13 @@ int main(int argc, char** argv) // add the stats handler viewer.addEventHandler(new osgViewer::StatsHandler); + + unsigned int screenNum; + while (arguments.read("--screen",screenNum)) + { + viewer.setUpViewOnSingleScreen(screenNum); + } + // load the data osg::ref_ptr loadedModel = osgDB::readNodeFiles(arguments); if (!loadedModel) diff --git a/genwrapper.conf b/genwrapper.conf index d8fa09c82..ff18a70c1 100644 --- a/genwrapper.conf +++ b/genwrapper.conf @@ -299,11 +299,16 @@ configure reflector "osgDB::ReadWriteMutex" object-type end - configure reflector "osg::DeleteHandler" object-type end +configure reflector "osg::GraphicsContext" + object-type +end + +suppress reflector "OpenThreads::Mutex" + ############################################################################# # Doxygen doesn't parse ReadFunc and WriteFunc correctly... diff --git a/include/osg/GraphicsContext b/include/osg/GraphicsContext index 5955b691b..a14d7df82 100644 --- a/include/osg/GraphicsContext +++ b/include/osg/GraphicsContext @@ -182,7 +182,7 @@ class OSG_EXPORT GraphicsContext : public Object OperationQueue& getOperationsQueue() { return _operations; } /** Get the operations queue mutex.*/ - OpenThreads::Mutex& getOperationsMutex() { return _operationsMutex; } + OpenThreads::Mutex* getOperationsMutex() { return &_operationsMutex; } /** Get the operations queue block used to mark an empty queue, if you end items into the empty queu you must release this block.*/ osg::Block* getOperationsBlock() { return _operationsBlock.get(); } diff --git a/src/osg/GraphicsThread.cpp b/src/osg/GraphicsThread.cpp index e97ca12e3..4831c5173 100644 --- a/src/osg/GraphicsThread.cpp +++ b/src/osg/GraphicsThread.cpp @@ -213,8 +213,6 @@ void OperationsThread::removeAllOperations() void OperationsThread::run() { - bool contextRealizedInThisThread = false; - // make the graphics context current. GraphicsContext* graphicsContext = dynamic_cast(_parent.get()); if (graphicsContext) diff --git a/src/osgViewer/Viewer.cpp b/src/osgViewer/Viewer.cpp index 69a59f440..c73df4e48 100644 --- a/src/osgViewer/Viewer.cpp +++ b/src/osgViewer/Viewer.cpp @@ -728,7 +728,7 @@ void Viewer::stopThreading() { osg::GraphicsContext* gc = (*citr); - OpenThreads::ScopedLock lock( gc->getOperationsMutex() ); + OpenThreads::ScopedLock lock( *(gc->getOperationsMutex()) ); osg::GraphicsContext::OperationQueue& operations = gc->getOperationsQueue(); for(osg::GraphicsContext::OperationQueue::iterator oitr = operations.begin(); oitr != operations.end(); @@ -758,7 +758,7 @@ void Viewer::stopThreading() { osg::GraphicsContext* gc = (*citr); - OpenThreads::ScopedLock lock( gc->getOperationsMutex() ); + OpenThreads::ScopedLock lock( *(gc->getOperationsMutex()) ); osg::GraphicsContext::OperationQueue& operations = gc->getOperationsQueue(); for(osg::GraphicsContext::OperationQueue::iterator oitr = operations.begin(); oitr != operations.end(); @@ -915,7 +915,7 @@ void Viewer::startThreading() { osg::GraphicsContext* gc = (*citr); - OpenThreads::ScopedLock lock( gc->getOperationsMutex() ); + OpenThreads::ScopedLock lock( *(gc->getOperationsMutex()) ); osg::GraphicsContext::OperationQueue& operations = gc->getOperationsQueue(); for(osg::GraphicsContext::OperationQueue::iterator oitr = operations.begin(); oitr != operations.end(); @@ -1731,7 +1731,7 @@ void Viewer::renderingTraversals() { osg::GraphicsContext* gc = (*itr); - OpenThreads::ScopedLock lock( gc->getOperationsMutex() ); + OpenThreads::ScopedLock lock( *(gc->getOperationsMutex()) ); osg::GraphicsContext::OperationQueue& operations = gc->getOperationsQueue(); for(osg::GraphicsContext::OperationQueue::iterator oitr = operations.begin(); oitr != operations.end(); diff --git a/src/osgWrappers/osg/GraphicsContext.cpp b/src/osgWrappers/osg/GraphicsContext.cpp index 7606665c6..a55364702 100644 --- a/src/osgWrappers/osg/GraphicsContext.cpp +++ b/src/osgWrappers/osg/GraphicsContext.cpp @@ -29,7 +29,7 @@ TYPE_NAME_ALIAS(std::list< osg::ref_ptr< osg::Operation > >, osg::GraphicsContex TYPE_NAME_ALIAS(std::list< osg::Camera * >, osg::GraphicsContext::Cameras); -BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::GraphicsContext) +BEGIN_OBJECT_REFLECTOR(osg::GraphicsContext) I_BaseType(osg::Object); I_Method1(void, add, IN, osg::Operation *, operation, __void__add__Operation_P1, @@ -55,8 +55,8 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::GraphicsContext) __OperationQueue_R1__getOperationsQueue, "Get the operations queue, not you must use the OperationsMutex when accessing the queue. ", ""); - I_Method0(OpenThreads::Mutex &, getOperationsMutex, - __OpenThreads_Mutex_R1__getOperationsMutex, + I_Method0(OpenThreads::Mutex *, getOperationsMutex, + __OpenThreads_Mutex_P1__getOperationsMutex, "Get the operations queue mutex. ", ""); I_Method0(osg::Block *, getOperationsBlock, @@ -261,8 +261,8 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::GraphicsContext) I_SimpleProperty(osg::Block *, OperationsBlock, __osg_Block_P1__getOperationsBlock, 0); - I_SimpleProperty(OpenThreads::Mutex &, OperationsMutex, - __OpenThreads_Mutex_R1__getOperationsMutex, + I_SimpleProperty(OpenThreads::Mutex *, OperationsMutex, + __OpenThreads_Mutex_P1__getOperationsMutex, 0); I_SimpleProperty(osg::GraphicsContext::OperationQueue &, OperationsQueue, __OperationQueue_R1__getOperationsQueue,