diff --git a/src/osg/GraphicsThread.cpp b/src/osg/GraphicsThread.cpp index 4831c5173..2e137303b 100644 --- a/src/osg/GraphicsThread.cpp +++ b/src/osg/GraphicsThread.cpp @@ -217,7 +217,7 @@ void OperationsThread::run() GraphicsContext* graphicsContext = dynamic_cast(_parent.get()); if (graphicsContext) { - graphicsContext->makeCurrentImplementation(); + graphicsContext->makeCurrent(); } osg::notify(osg::INFO)<<"Doing run "<width) / double(traits->height); - double aspectRatioChange = newAspectRatio / aspectRatio; - - if (aspectRatioChange != 1.0) - { - _camera->getProjectionMatrix() *= osg::Matrix::scale(1.0/aspectRatioChange,1.0,1.0); - } - } - camera->setViewport(new osg::Viewport(0, 0, traits->width, traits->height)); GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT; camera->setDrawBuffer(buffer); camera->setReadBuffer(buffer); - addSlave(camera.get(), osg::Matrixd::translate( translate_x, 0.0, 0.0), osg::Matrixd() ); + double newAspectRatio = double(traits->width) / double(traits->height); + double aspectRatioChange = newAspectRatio / aspectRatio; + addSlave(camera.get(), osg::Matrixd::translate( translate_x - aspectRatioChange, 0.0, 0.0) * osg::Matrix::scale(1.0/aspectRatioChange,1.0,1.0), osg::Matrixd() ); + translate_x -= aspectRatioChange * 2.0; } } diff --git a/src/osgViewer/Viewer.cpp b/src/osgViewer/Viewer.cpp index 1a04d9af1..7064a43da 100644 --- a/src/osgViewer/Viewer.cpp +++ b/src/osgViewer/Viewer.cpp @@ -927,7 +927,7 @@ struct ViewerCompileOperation : public osg::Operation // OpenThreads::ScopedLock lock(mutex); // osg::notify(osg::NOTICE)<<"Compile "<makeCurrentImplementation(); + // context->makeCurrent(); osgUtil::GLObjectsVisitor compileVisitor; compileVisitor.setState(context->getState()); @@ -990,7 +990,7 @@ Viewer::ThreadingModel Viewer::suggestBestThreadingModel() int numProcessors = OpenThreads::GetNumberOfProcessors(); - + if (contexts.size()==1) { if (numProcessors==1) return SingleThreaded;