From 990417c9d1517424cf80cf96dc099cc4090ec233 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 16 Feb 2007 15:14:16 +0000 Subject: [PATCH] Fixed typo --- src/osgUtil/RenderStage.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/osgUtil/RenderStage.cpp b/src/osgUtil/RenderStage.cpp index cff65ccc9..ec959ded1 100644 --- a/src/osgUtil/RenderStage.cpp +++ b/src/osgUtil/RenderStage.cpp @@ -736,8 +736,12 @@ void RenderStage::drawInner(osg::RenderInfo& renderInfo,RenderLeaf*& previous, b { copyTexture(renderInfo); } + std::map< osg::Camera::BufferComponent, Attachment>::const_iterator itr; - for(itr = _bufferAttachmentMap.begin(); itr != _bufferAttachmentMap.end(); ++itr){ + for(itr = _bufferAttachmentMap.begin(); + itr != _bufferAttachmentMap.end(); + ++itr) + { if (itr->second._image.valid()) { @@ -910,7 +914,14 @@ void RenderStage::draw(osg::RenderInfo& renderInfo,RenderLeaf*& previous) if (_graphicsContext.valid() && _graphicsContext != callingContext) { - if (!useThread) useContext->releaseContext(); + if (!useThread) + { + // flush any command left in the useContex's FIFO + // to ensure that textures are updated before main thread commenses. + glFlush(); + + useContext->releaseContext(); + } } if (callingContext && useContext != callingContext)