I want to make 2D texture like HelloWorld.cpp
but I don't understand bitmap texture array data.
// Init texture bitmap (32x32x24bpp)
const U32 textureWidth = 32, textureHeight = 32, textureBPP = 3;
const U32 bufferSize = textureWidthtextureHeighttextureBPP/sizeof(U32);
U32 i, j;
for (i = 0; i < textureHeight/2; i++)
for (j = 0; j < 12; j++)
texture[i*24+j] = 0xFFFFFFFF;
for (j = 12; j < 24; j += 3)
texture[i*24+j+0] = SET_ENDIAN32((U32)0xFF0000FF);
texture[i*24+j+1] = SET_ENDIAN32((U32)0x00FF0000);
texture[i*24+j+2] = SET_ENDIAN32((U32)0x0000FF00);
for (i = 0; i < bufferSize/12; i++)
for (j = 0; j < 6; j++)
texture[(bufferSize/12+i)*6+j] = texture[(bufferSize/12-1-i)*6+j];
I think the each value in the texture array means each pixel,
but I don't know how the value like 0xFFFFFFFF, 0xFF0000FF or 0x00FF0000 composes which color.
someone help me understand its pixel format. thanks.
I found that it is easier to change the imageType of texture into IFXTextureObject::IFXTEXTUREMAP_FORMAT_RGBA32.
Log in to post a comment.