I had a bit of trouble tracking down where the ImageStream object is handled, and I think I've worked it out, but it's quite odd, even for a demo.

As far as I can tell, an Image is created from the provided file name and held in a pointer. That image is cast to an imagestream for some housework. A texture is created and the image is set as it's source - this is all a pointer, as far as I can tell, not the refPtr I expected to see.

Then, the main thread seems to forget about the image/s, and moves on. It then goes into a visitor, which finds any images and makes a ref pointer list to them. Is that about right? So there's a ref pointer and a raw pointer floating around at once? And for a while, only a pointer? Isn't that a pretty nasty situation? Am I missing some C++ kung-fu to make refPtrs in the texture or earlier?

Is there an example with a 'better' management of image/stream objects?

Regards,

Bruce Wheaton
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to