Hi folks, OK, I understand what Mike means by the baseline behaviour. And as you also wrote: "the apply of the default setting is done by apply a default constructed StateAttribute" this is exactly what I meant by a "fresh" state attribute. So we are speaking about the same things.
If I would fine some bug, I will post it, of course ;) I wouldn't try to start now a discussion about the meaning of restore or disapply method, since it seems that I am currently not able to state out why such kind of behaviour is needed. However, there could be cases where such a behaviour would leak attributes (as for example with the draw buffer setting, which is happily stored by OpenGL in the FBO context, hence it doesn't really leak out ;). As soon as I would come across such a non-default case, I would then let you know, guys ;) cheers, Art --- Robert Osfield <[EMAIL PROTECTED]> schrieb am Fr, 23.5.2008: > Von: Robert Osfield <[EMAIL PROTECTED]> > Betreff: Re: [osg-users] empty geode + shader + uniform = bug ? > An: [EMAIL PROTECTED], "OpenSceneGraph Users" > <osg-users@lists.openscenegraph.org> > Datum: Freitag, 23. Mai 2008, 17:02 > Hi Art, > > As I previous explain before the apply of the default > setting is done > by apply a default constructed StateAttribute, this applies > to > osg::Program just as it does any other StateAttribute. > This default > constructed StateAttribute is applied when all other > entries of that > specific type of attribute are popped off the stack. > > Inside osg::State you have the strcuture below, please not > the > global_default_attribute member - this is the one that > holds the clone > and does the apply back to default. > > struct AttributeStack > { > typedef std::pair<const > StateAttribute*,StateAttribute::OverrideValue> > AttributePair; > typedef std::vector<AttributePair> > AttributeVec; > > AttributeStack() > { > changed = false; > last_applied_attribute = 0L; > global_default_attribute = 0L; > } > > /** apply an attribute if required, passing in > attribute > and appropriate attribute stack */ > bool changed; > const StateAttribute* last_applied_attribute; > ref_ptr<const StateAttribute> > global_default_attribute; > AttributeVec attributeVec; > }; > > So.. please review osg::State thoroughly. If there is a > bug then > please highlight it, but.. don't keep asking for > something that > already exists just not in the form you are expecting it. > > Robert. __________________________________________________________ Gesendet von Yahoo! Mail. Dem pfiffigeren Posteingang. http://de.overview.mail.yahoo.com _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org