Page 1 of 1

loadFromMemory donot use CEGUI::Texture::PF_RGB?

Posted: Wed Jan 07, 2009 09:17
by zzz822163
I get bitmap data: unsigned char *bitmapImage= (unsigned char *)bmp.bmBits;
rttTexture->loadFromMemory(buffer,256, 256, CEGUI::Texture::PF_RGB );
but the picture is not right now,after I conver the data

for (unsigned int src = 0, dst = 0; src < bi.biSizeImage; src +=3, dst +=4)
{

m_ListVideo[dex].data_avi_new[dst+3] = 0xFF;

// copy pixel data over
m_ListVideo[dex].data_avi_new[dst] = bitmapImage[src];
m_ListVideo[dex].data_avi_new[dst+1] = bitmapImage[src+1];
m_ListVideo[dex].data_avi_new[dst+2] = bitmapImage[src+2];
}
rttTexture->loadFromMemory(m_ListVideo[dex].data_avi_new,256, 256, CEGUI::Texture::PF_RGBA );
now the picture is right ,but the FPS from 50 to 10,help me!!

Posted: Thu Jan 08, 2009 09:47
by CrazyEddie
It appears there is a bug in the RGB code on the D3D 9 renderer module, I recall fixing this probably on the D3D 10 version but apparently the others are affected also. I will fix this for the next release.

With regards to the performance issue, if you are converting and loading that buffer every frame it will kill performance. I mentioned in the other thread that this would be slow ;)

Thanks for drawing our attention to the loadFromMemory pixel format bug.

CE.