Code: Select all
void sceGuTexImage ( int mipmap,
int width,
int height,
int tbw,
const void * tbp
)
Set current texturemap.
Textures may reside in main RAM, but it has a huge speed-penalty. Swizzle textures to get maximum speed.
Note:
Data must be aligned to 1 quad word (16 bytes)
Parameters:
mipmap - Mipmap level
width - Width of texture (must be a power of 2)
height - Height of texture (must be a power of 2)
tbw - Texture Buffer Width (block-aligned)
tbp - Texture buffer pointer (16 byte aligned)
How should the pixel data look like in my array? Currently I am reading a bitmap to an unsigned char array
Code: Select all
int j = 0;
for (i=0; i < (int)width * (int)height; i++)
{
fread(&rgb, sizeof(rgb), 1, l_file);
l_texture[j+0] = rgb.rgbtRed; // Red component
l_texture[j+1] = rgb.rgbtGreen; // Green component
l_texture[j+2] = rgb.rgbtBlue; // Blue component
j += 3; // Go to the next position
}