Fixed bug associated with complex RenderBin setup.
This commit is contained in:
@@ -120,10 +120,16 @@ class OSG_EXPORT State : public Referenced
|
||||
|
||||
/** Pop stateset off state stack.*/
|
||||
void popStateSet();
|
||||
|
||||
|
||||
/** pop all statesets off state stack, ensuring it is empty ready for the next frame.
|
||||
* Note, to return OpenGL to default state, one should do any state.popAllStatSets(); state.apply().*/
|
||||
void popAllStateSets();
|
||||
|
||||
/** Insert stateset onto state stack.*/
|
||||
void insertStateSet(unsigned int pos,const StateSet* dstate);
|
||||
|
||||
/** Pop stateset off state stack.*/
|
||||
void removeStateSet(unsigned int pos);
|
||||
|
||||
/** Get the number of StateSet's on the StateSet stack.*/
|
||||
unsigned int getStateSetStackSize() { return _stateStateStack.size(); }
|
||||
|
||||
@@ -46,7 +46,7 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced
|
||||
typedef std::map< const osg::StateSet*, osg::ref_ptr<StateGraph> > ChildList;
|
||||
typedef std::vector< osg::ref_ptr<RenderLeaf> > LeafList;
|
||||
|
||||
StateGraph* _parent;
|
||||
StateGraph* _parent;
|
||||
const osg::StateSet* _stateset;
|
||||
|
||||
int _depth;
|
||||
@@ -279,6 +279,19 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced
|
||||
|
||||
}
|
||||
|
||||
inline static int numToPop(osg::State& state,StateGraph* sg_curr)
|
||||
{
|
||||
int numToPop = 0;
|
||||
// need to pop back all statesets and matrices.
|
||||
while (sg_curr)
|
||||
{
|
||||
if (sg_curr->_stateset) ++numToPop;
|
||||
sg_curr = sg_curr->_parent;
|
||||
}
|
||||
|
||||
return numToPop;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
/// disallow copy construction.
|
||||
|
||||
Reference in New Issue
Block a user