Code: Select all
/**
* 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)
*
* @param mipmap - Mipmap level
* @param width - Width of texture (must be a power of 2)
* @param height - Height of texture (must be a power of 2)
* @param tbw - Texture Buffer Width (block-aligned)
* @param tbp - Texture buffer pointer (16 byte aligned)
**/
void sceGuTexImage(int mipmap, int width, int height, int tbw, const void* tbp);
It seams my texture buffer needs to be 16-byte aligned, which it’s currently not and I’m assuming that’s my problem.
I create a texture with something similar to this:
Code: Select all
unsigned int height = 64;
unsigned int width = 64;
unsigned int* pixels = new unsigned int[height*width];
for (u32 y = 0; y < height; y++) {
for (u32 x = 0; x< width; x++) {
pixels[y*_width + x] = 0xFF0000FF;
}
}
pixels = (u32*)((u32)pixels | 0x40000000);
Thanks for any help.