Added SceneView::s/getDrawBufferValue(GLenum) to allow customization of what

glDrawBuffer() value is set on each frame.
This commit is contained in:
Robert Osfield
2003-10-17 10:25:59 +00:00
parent 8b0a5035b2
commit 594f25b5d1
2 changed files with 43 additions and 6 deletions

View File

@@ -56,6 +56,8 @@ SceneView::SceneView(DisplaySettings* ds)
_cullMask = 0xffffffff;
_cullMaskLeft = 0xffffffff;
_cullMaskRight = 0xffffffff;
_drawBufferValue = GL_BACK;
}
@@ -640,6 +642,10 @@ void SceneView::draw()
break;
case(osg::DisplaySettings::ANAGLYPHIC):
{
if( _drawBufferValue != GL_NONE)
{
glDrawBuffer(_drawBufferValue);
}
_localStateSet->setAttribute(_viewport.get());
@@ -687,6 +693,11 @@ void SceneView::draw()
break;
case(osg::DisplaySettings::HORIZONTAL_SPLIT):
{
if( _drawBufferValue != GL_NONE)
{
glDrawBuffer(_drawBufferValue);
}
// ensure that all color planes are active.
osg::ColorMask* cmask = static_cast<osg::ColorMask*>(_localStateSet->getAttribute(osg::StateAttribute::COLORMASK));
if (cmask)
@@ -744,6 +755,11 @@ void SceneView::draw()
break;
case(osg::DisplaySettings::VERTICAL_SPLIT):
{
if( _drawBufferValue != GL_NONE)
{
glDrawBuffer(_drawBufferValue);
}
// ensure that all color planes are active.
osg::ColorMask* cmask = static_cast<osg::ColorMask*>(_localStateSet->getAttribute(osg::StateAttribute::COLORMASK));
if (cmask)
@@ -800,6 +816,11 @@ void SceneView::draw()
case(osg::DisplaySettings::RIGHT_EYE):
case(osg::DisplaySettings::LEFT_EYE):
{
if( _drawBufferValue != GL_NONE)
{
glDrawBuffer(_drawBufferValue);
}
// ensure that all color planes are active.
osg::ColorMask* cmask = static_cast<osg::ColorMask*>(_localStateSet->getAttribute(osg::StateAttribute::COLORMASK));
if (cmask)
@@ -829,8 +850,11 @@ void SceneView::draw()
else
{
// Need to restore draw buffer when toggling Stereo off.
glDrawBuffer(GL_BACK);
// Need to restore draw buffer when toggling Stereo off.
if( _drawBufferValue != GL_NONE)
{
glDrawBuffer(_drawBufferValue);
}
_localStateSet->setAttribute(_viewport.get());