Stephan, Robert,
thank you, I understand. I change this:
Code:
diffuseImage = osgDB::readImageFile(".\\img1.jpg");
diffuseImage->dirty();
into this:
Code:
osg::ref_ptr<osg::Image> diffuseImage1 = osgDB::readImageFile(".\\img1.jpg");
diffuseImage->setImage(diffuseImage1->s(), diffuseImage1->t(),
diffuseImage1->r(), diffuseImage1->getInternalTextureFormat(),
diffuseImage1->getPixelFormat(), diffuseImage1->getDataType(),
diffuseImage1->data(), diffuseImage1->getAllocationMode());
diffuseImage->dirty();
diffuseImage1->ref();
and it works! I don't understand if diffuseImage1->ref() is a good choice but
without it when I close the program a memory issue arises.
Cheers,
Fabrizio
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=60855#60855
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org