#158584 - sUPREz - Sat Jun 14, 2008 12:00 am
Hi guys. I have a problem. I'm using glTexImage2D to put my texture into the NDS memory. I made a very little function that puts some pcx texture in memory with the 3 following lines :
(this is the basic code from every devkitpro examples)
The problem is that if I first readd a texture with the same ID, it doesn't erase the previous texture, it only add the new one after all the loaded textures. So my program quickly runs out of memory. I think I just change the pointer to my texture in my int array.
Some websites talks about the glDeleteTextures function but it's only with the full OGL engine, not with the NDS GL engine.
I also found the glResetTextures function but this one clear the entire memory !
How can I erase a specific texture in memory ? I have the pointer to the texture, and I want to destroy it. Please help ! :) Thanks a lot !
Code: |
glGenTextures(1, &texture[i]);
glBindTexture(0, texture[i]); glTexImage2D(0, 0, GL_RGB, TEXTURE_SIZE_128 , TEXTURE_SIZE_128, 0, TEXGEN_TEXCOORD, pcx.image.data8); |
(this is the basic code from every devkitpro examples)
The problem is that if I first readd a texture with the same ID, it doesn't erase the previous texture, it only add the new one after all the loaded textures. So my program quickly runs out of memory. I think I just change the pointer to my texture in my int array.
Some websites talks about the glDeleteTextures function but it's only with the full OGL engine, not with the NDS GL engine.
I also found the glResetTextures function but this one clear the entire memory !
How can I erase a specific texture in memory ? I have the pointer to the texture, and I want to destroy it. Please help ! :) Thanks a lot !