Hi,

initialize the texture and then reference it, in that order
osg::ref_ptr<osg::Texture2D> lm = new osg::Texture2D;
stateset->setTextureAttributeAndModes( 0,map);

Nick


On Sun, Jun 9, 2013 at 3:02 PM, Gaëtan André <gaetan.an...@gmail.com> wrote:

> Hi,
>
> I am trying to understand how texture ande Image are working
>
> //some initialized texture with contents
> osg::ref_ptr<osg::Texture2D> map
>
> //displays correctly the texture
> osg::StateSet* stateset = HUD_camera->getOrCreateStateSet();
> stateset->setTextureAttributeAndModes( 0,map);
>
> //does not display the texture
> osg::ref_ptr<osg::Texture2D> lm = new osg::Texture2D;
> lm->setImage(map->getImage());
> stateset->setTextureAttributeAndModes( 0,lm);
>
> Why ?
>
> Thank you!
>
> Cheers,
> Gaëtan
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=54501#54501
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
trajce nikolov nick
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to