Hi,
I have a problem changing the data of an RGB to an RGBA image.
The following code works fine until i end the programm. The the delete[]
operator of the image crashes.
What's wrong?
Thanks for help!
Christian
class CTextureInfo
{
public:
osg::Image* m_pImage;
void MakeTranslucent() {
if(pixFrmt == GL_RGB) {
int nWidth = m_pImage->s();
int nHeight = m_pImage->t();
int nDepth = m_pImage->r();
pDataRGBA = new BYTE [nWidth * nHeight * 4];
pDataRGB = (BYTE*)m_pImage->data();
// ... make translucent....
m_pImage->setImage(m_pImage->s(), m_pImage->t(), m_pImage->r(),
GL_RGBA,
GL_RGBA, GL_UNSIGNED_BYTE, pDataRGBA,
osg::Image::USE_NEW_DELETE);
}
}
}
--
Christian Hoffmann
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/