Hi

we´re using right now a lot of pagelod nodes and sometimes we generate some new 
textures and put them over these nodes so they have the original texture in 
texture id number 0 and the new one in number 1

we want to delete the number one texture, not the original one, so it can be 
replaced by an updated one which sometimes has different resolution, so an 
update of the existing one is not possible, we want to delete and replace by 
another one

this is how we´re putting the new texture over the older one. It has some alpha 
so decal is needed

osg::ref_ptr<osg::StateSet> stateset = geom->getOrCreateStateSet();
osg::ref_ptr<osg::TexEnv> modo_tex = new osg::TexEnv(osg::TexEnv::DECAL);
stateset.get()->setTextureAttributeAndModes(1,new_text,osg::StateAttribute::ON);
stateset.get()->setTextureAttribute(1, modo_tex.get(), 
osg::StateAttribute::OFF);

how would you delete it if you want to replace it in the future????

right now we´re just overwriting it, but we´re having memory leaks....

thanks


_________________________________________________________________
Busca desde cualquier página Web con una protección excepcional. Consigue la 
Barra de herramientas de Windows Live hoy mismo y GRATUITAMENTE.
http://www.toolbar.live.com
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to