记录当前状态机的所有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 StateAttribute> global_default_

本文详细探讨了osg::State的AttributeMap如何存储和管理图形状态中的关键元素,如着色器和视口设置,揭示其在图形渲染过程中的重要性。
最低0.47元/天 解锁文章
553

被折叠的 条评论
为什么被折叠?



