Hi Paulo, It's hard to know what might be going wrong from your explanation, I couldn't guess whether it's a bug in your code, the OSG or just a mis-understanding about how it should function. The copy constructor used by the clone method looks correct, at least in svn/trunk, so would suspect a mis-understand or a bug in how you've set things up at your end. The best way to sort this out would be step through the code with a debugger.
The only other thing that seems a bit odd, is expecting a cloned imaged to generate a different result to the original image as both will have the effectively the same data so should look identical on screen. Robert. On 14 July 2013 10:56, Paulo Silva <[email protected]> wrote: > Hi again, > > well this might not work > > >> _image = >> dynamic_cast<Image*>(source().image()->clone(CopyOp::DEEP_COPY_ALL)); >> >> ... >> >> _tex->setImage(_image.get()); // replace the texture source >> >> > But the following does. I wonder why? > > Image* const img(source().image().get()); > > _image = new Image; > > _image->allocateImage(img->s(), img->t(), img->r(), img->getPixelFormat(), > img->getDataType()); > > memcpy(_image->data(), img->data(), img->getTotalSizeInBytes()); > > ... > > _tex->setImage(_image.get()); // replace the texture source > > > I guess I'll use that for the time being. But it is strange... > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > >
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

