PSPGL - unloading textures from memory.

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
LarryTM
Posts: 30
Joined: Tue Jul 04, 2006 4:05 am
Contact:

PSPGL - unloading textures from memory.

Post by LarryTM »

Hi,

How to relase memory (or vmemory) from texture data? Im loading level of my game :

Level Data (objects), gamedata and textures :

glGenTextures(1,(unsigned int*)&mojetekstury[1]);
LoadTexture("images parental.png",mojetekstury[1],GL_CLAMP_TO_EDGE,false);
.... etc.

And when the level ends i need to relase memory (or vmemory) because i cant load textures for another level (my console hangsup after loading 3 - 4 textures).

So, how to free console memory and make room for another textures?

/lar
siberianstar
Posts: 70
Joined: Thu Jun 22, 2006 9:24 pm

Post by siberianstar »

glDeleteTextures( int size , int *names );

There is a bug on glDeleteTexture that wasn't freeing the texture from memory, i've fixed it :

open glDeleteTexture.c and replace the line 19 with

__pspgl_texobj_free(tobj);

then recompile pspgl.

NOTE: If you don't fix this bug PSPGL won't free the texture.
LarryTM
Posts: 30
Joined: Tue Jul 04, 2006 4:05 am
Contact:

Post by LarryTM »

Thank you very much! :)
Post Reply