Hello
I'm doing a simple 2D lib (using only hardware routines), but I need some more informations. In fact, I would like to let the choice to the user if he want to put a texture in RAM or in VRAM.
- With RAM I have to call malloc. The problem is that malloc will return an address which is not 16 byte aligned, like required by sceGuTexImage, and the image sometimes won't be drawn correctly. A bad thing to do is to allocate texSize + 16 and align this address by hand.
- Also, when a heap compression will occur, this will be problematic as my textures are stored by their address. What should I do instead?
- Heap compression will also be an issue if I'll implement a VRAM memory manager.
So if someone has experience about that (VRAM manager, handles in RAM, etc.), I would appreciate any help.
Textures in RAM
Textures in RAM
Sorry for my bad english
Oldschool library for PSP - PC version released
Oldschool library for PSP - PC version released
Thank you, I'll try it.
In fact, I just realize I'm a real n00b, but I can't find this information on Internet. Is memory allocated with malloc locked?
In fact, I just realize I'm a real n00b, but I can't find this information on Internet. Is memory allocated with malloc locked?
Sorry for my bad english
Oldschool library for PSP - PC version released
Oldschool library for PSP - PC version released
There's no automatic heap compression in any of the memory managers supplied with the pspsdk, so pointers becoming invalid behind your back is not an issue. If you create your own memory manager for vram and implement heap compression, you probably want your vram resource class (which stores the pointer to vram) to be involved in the compression process. Or you can use double indirection (pointer to the pointer to vram).
Just some ideas to think about.
Just some ideas to think about.
Paco
Thank you very much, that's exactly what I need.
For VRAM management and compression, I'll try later.
For VRAM management and compression, I'll try later.
Sorry for my bad english
Oldschool library for PSP - PC version released
Oldschool library for PSP - PC version released