Added s/getClearMask() support to osg::ClearNode, osgUtil::SceneView and the
.osg plugin.
This commit is contained in:
@@ -21,7 +21,8 @@ using namespace osg;
|
||||
*/
|
||||
ClearNode::ClearNode():
|
||||
_requiresClear(true),
|
||||
_clearColor(0.0f,0.0f,0.0f,1.0f)
|
||||
_clearColor(0.0f,0.0f,0.0f,1.0f),
|
||||
_clearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
|
||||
{
|
||||
setCullingActive(false);
|
||||
StateSet* stateset = new StateSet;
|
||||
|
||||
@@ -67,6 +67,18 @@ bool ClearNode_readLocalData(Object& obj, Input& fr)
|
||||
iteratorAdvanced = true;
|
||||
}
|
||||
|
||||
if (fr[0].matchWord("clearMask"))
|
||||
{
|
||||
if (fr[1].isUInt())
|
||||
{
|
||||
unsigned int value=0;
|
||||
fr[1].getUInt(value);
|
||||
es.setClearMask(static_cast<GLbitfield>(value));
|
||||
iteratorAdvanced = true;
|
||||
fr+=2;
|
||||
}
|
||||
}
|
||||
|
||||
return iteratorAdvanced;
|
||||
}
|
||||
|
||||
@@ -86,6 +98,7 @@ bool ClearNode_writeLocalData(const Object& obj, Output& fw)
|
||||
}
|
||||
|
||||
fw.indent() << "clearColor "<<es.getClearColor()<< std::endl;
|
||||
fw.indent() << "clearMask "<<static_cast<unsigned int>(es.getClearMask())<< std::endl;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -615,10 +615,7 @@ void SceneView::cullStage(const osg::Matrixd& projection,const osg::Matrixd& mod
|
||||
if (clearNode->getRequiresClear())
|
||||
{
|
||||
renderStage->setClearColor(clearNode->getClearColor());
|
||||
renderStage->setClearMask(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
|
||||
// really should set clear mask here, but what to? Need
|
||||
// to consider the stencil and accumulation buffers..
|
||||
// will defer to later. Robert Osfield. October 2001.
|
||||
renderStage->setClearMask(clearNode->getClearMask());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user