记录当前状态机的所有StateAttribute,比如着色器、视口等。
osg/State
class OSG_EXPORT State : public Referenced
{
typedef std::pair<const StateAttribute*,StateAttribute::OverrideValue> AttributePair;
typedef std::vector<AttributePair> AttributeVec;
struct AttributeStack
{
AttributeStack()
{
changed = false;
last_applied_attribute = 0L;
last_applied_shadercomponent = 0L;
global_default_attribute = 0L;
}
void print(std::ostream& fout) const;
/** apply an attribute if required, passing in attribute and appropriate attribute stack */
bool changed;
const StateAttribute* last_applied_attribute;
const ShaderComponent* last_applied_shadercomponent;
ref_ptr<const StateAttrib