pspgl and memory
pspgl and memory
Imagine I have a game, and it displays 480x272 background image to user. At some point I want this image to fade out and a new one to appear. I am going to use pspgl, so these images are going to be textures, and because of pspgl limitations, they have to be 512x512 (closest power of 2). This is going to take 512x512x2 bytes per picture, total of 1MB for two pictures. And if I understand correctly pspgl is going to use another two 512x512x2 pictures to draw on. PSP has 2MB of video memory; does that mean that I'll run out of memory and won't be able to get new textures until I free these?
If i remember correctly, 2 power limitation only occurs on x on PSP, so you can upload a texture of 512x272.
alternatively you can:
1) use compressed texture format
2) use downsampled images for textures (i.e. 512*256) and stretch at draw time
2) use less than 4 bytes for pixel (i.e. something different from RGBA8888)
anyway:
512*512*4 = 1'048'576
1Mb = 1024*1024 = 1048576 bytes
so 2 images at max resolution and color depht would take _exactly_ 2Mb, but at the moment i don't know how exactly the framebuffer is arranged.
alternatively you can:
1) use compressed texture format
2) use downsampled images for textures (i.e. 512*256) and stretch at draw time
2) use less than 4 bytes for pixel (i.e. something different from RGBA8888)
anyway:
512*512*4 = 1'048'576
1Mb = 1024*1024 = 1048576 bytes
so 2 images at max resolution and color depht would take _exactly_ 2Mb, but at the moment i don't know how exactly the framebuffer is arranged.