Hi Dirk,

Dirk Reiners schrieb:

        Hi Oliver,

On Wed, 2005-08-10 at 18:30 +0200, Oliver Kutter wrote:
But after changing the size 2-3 times, it crashed. It doesn't crash when I clear the following lines:

// this is the size of the particles
_iVpSize = (int)sqrt((double)_mgr.getParticles().getNumber());

// change the texture chunk
beginEditCP (_tcInput, TextureChunk::ImageFieldMask); {
   if (_iVpSize == 8)  _tcInput->setImage(_imIndices[0]);
   if (_iVpSize == 16) _tcInput->setImage(_imIndices[1]);
   if (_iVpSize == 32) _tcInput->setImage(_imIndices[2]);
   if (_iVpSize == 64) _tcInput->setImage(_imIndices[3]);
_tcInput[1]->imageContentChanged(); // I wonder if this is necessary?!
} endEditCP (_tcInput, TextureChunk::ImageFieldMask);

Do I have to change anything else?

No, that should be fine. But it's probably freeing the image when you're
changing it.

The easiest fix is to use an ImageRefPtr instead of an ImagePtr for your
_imIndices array. If you don't have that (1.4 and earlier) you can use
RefPtr<ImagePtr> and #include <OSGRefPtr.h>. Sideline: it would be more
efficient (but using more texture memory) to use separate TextureChunks
instead of Images.
Now I have sperate TextureChunks, but that works partially only. Am I right, that I have to remove the old TextureChunks (->subChunk) and add the new ones (->addChunk)? But what happend to these old ones? Are they deleted, when they are remove from the scene? Do I have to re-create them?

Bye,
Oliver


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to