osg::Texture2D* texture2D = dynamic_cast<osg::Texture2D*>(stateset->getTextureAttribute(unit,osg::StateA ttribute::TEXTURE)); if (texture2D) ...
The above is from osgUtil::Optimizer and shows how the TextureAtlasBuilder gets the Texture2D StateAttribute. You can use a similar method to get any StateAttribute. For non-texture state, use getAttribute(), for example, and of course you don't need a 'unit' parameter. -Paul > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Judie > Sent: Thursday, June 12, 2008 2:50 PM > To: osg-users@lists.openscenegraph.org > Subject: [osg-users] Need help getting the osg::ColorMask I > previously set > > CODE: > > > osg::StateSet *stateSet = group->getOrCreateStateSet(); > > > osg::StateSet::AttributeList& attributes = stateSet- > >getAttributeList(); > > > osg::StateSet::AttributeList::iterator aitr = NULL; > > > for(aitr= attributes.begin(); aitr!=attributes.end(); ++aitr) { > > > osg::StateAttribute::Type temp = (*aitr).first.first; > > > if(temp == osg::StateAttribute::COLORMASK) > { > > > osg::ColorMask mask = (*aitr).second.second; > > > This won't compile. How can I get the osg::ColorMask from the > osg::StateSet::AttributeList::iterator? > > Thanks, > > Judie > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-opensce negraph.org _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org