From Farshid Lashkari, "attached a small change to osgUtil::SceneView that prevents unnecessary calls to glClear when the split stereo separation is 0."

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14875 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield 2015-05-26 17:22:05 +00:00
parent 0f35f31d72
commit 906bb27fa0

View File

@ -1146,14 +1146,15 @@ void SceneView::draw()
_renderStageRight->drawPreRenderStages(_renderInfo,previous);
double separation = _displaySettings->getSplitStereoHorizontalSeparation();
if (separation > 0.0)
{
double left_half_width = (getViewport()->width()-separation)/2.0;
double left_half_width = (getViewport()->width()-separation)/2.0;
clearArea(static_cast<int>(getViewport()->x()+left_half_width),
static_cast<int>(getViewport()->y()),
static_cast<int>(separation),
static_cast<int>(getViewport()->height()),_renderStageLeft->getClearColor());
clearArea(static_cast<int>(getViewport()->x()+left_half_width),
static_cast<int>(getViewport()->y()),
static_cast<int>(separation),
static_cast<int>(getViewport()->height()),_renderStageLeft->getClearColor());
}
_localStateSet->setAttribute(_viewportLeft.get());
_renderStageLeft->draw(_renderInfo,previous);
@ -1196,14 +1197,16 @@ void SceneView::draw()
_renderStageRight->drawPreRenderStages(_renderInfo,previous);
double separation = _displaySettings->getSplitStereoVerticalSeparation();
if (separation > 0.0)
{
double bottom_half_height = (getViewport()->height()-separation)/2.0;
double bottom_half_height = (getViewport()->height()-separation)/2.0;
clearArea(static_cast<int>(getViewport()->x()),
static_cast<int>(getViewport()->y()+bottom_half_height),
static_cast<int>(getViewport()->width()),
static_cast<int>(separation),
_renderStageLeft->getClearColor());
clearArea(static_cast<int>(getViewport()->x()),
static_cast<int>(getViewport()->y()+bottom_half_height),
static_cast<int>(getViewport()->width()),
static_cast<int>(separation),
_renderStageLeft->getClearColor());
}
_localStateSet->setAttribute(_viewportLeft.get());
_renderStageLeft->draw(_renderInfo,previous);