Re: [osg-users] ImageStream updating

2008-05-23 Thread Robert Osfield
Hi Valary, ImageStream is updated by a background thread. The xine-lib and QuickTime plugins both subclass from ImageStream and OpenThreads::Thread to provide a class that automatically runs updates on itself - this thread updates the image data on the ImageStream and then calls dirty to tell

Re: [osg-users] ImageStream updating

2008-05-23 Thread Валерий Быков
Ok, but there are next difficulty: I use function setImage for setting new image in my thread, and this function deletes old image when it sets new image. Therefore if updating thread updates image while main thread updates texture then... segmentation fault. In this case I must not to delete old

Re: [osg-users] ImageStream updating

2008-05-23 Thread Robert Osfield
Hi Valary, Don't use setImage from within your frame loop until you are switching between some fixed memory like the xine-lib plugin does. It's better to update the data stored in the Image directly and call dirty, or to allocate the image memory separately and disable the deletion of the data