[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-openscenegraph.org
Re: [osg-users] Need help getting the osg::ColorMask I previously set
Hi One things I noticed is you do 'osg::ColorMask mask'. This is wrong you need this to be a pointer to an osg::ColorMask instance FYI If you post a question my code won't compile at least provide the compilation errors... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Judie Sent: Thursday, June 12, 2008 4: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-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Need help getting the osg::ColorMask I previously set
osg::Texture2D* texture2D = dynamic_castosg::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