libito itoLoadTexture problem
Posted: Sun Jun 06, 2004 7:08 am
I know I should probably be using gslib for graphics but PS2Menu uses libito and I don't feel like doing a rewrite to use gslib at the moment. Anyway, I'm adding (or trying to) JPG and BMP viewer support. Both are working well enough so I end up with a plain RGB24 bitmap (u8 array). The problem I'm having is when I use itoLoadTexture to load it so I can use a sprite to dsplay it, the sprite never displays. I've experimentally set the texture buffer to the screen buffer and LoadTexture is moving the data properly (though the bottom half of the graphic is cut off). Is there something wrong with my code?
zoom is used with the original buffer to scale the graphic down so it can better fit in VRAM. The output is okay because I checked it by using itoPoint to draw the image. If I add a regular itoSprite command under the itoTextureSprite, it doesn't show up either.
Code: Select all
void PutImage(void)
{
itoGsFinish();
itoSwitchFrameBuffers();
itoVSync();
}
///--------cut
itoSetTextureBufferBase( itoGetZBufferBase() ); //zbuffer isn't used
itoLoadTexture(buffer, 0, 512, ITO_RGB24, 0, 0, info.width/zoom, info.height/zoom);
PutImage();
while (!end)
{
itoSetTexture(0, 512, ITO_RGB24, ITO_TEXTURE_512,ITO_TEXTURE_512);
itoTextureSprite(ITO_RGBA(0x80,0x80,0x80,0xFF), 50,50, 0, 0,50+(info.width/zoom),50+(info.height/zoom), info.width/zoom,info.height/zoom, 0);
PutImage();
//gamepad handling
}