PDA

View Full Version : Loading an image??



Creative Mind
08-20-2009, 10:46 AM
Hello everyone..

I'm new to the forum... and so to OpenGL..

I need to know that is there some way to unload the loaded image..?? Like I've loaded an image using readBMPFile(...), but I want to replace it with another image... Do I need to unload the previous one ??

scratt
08-20-2009, 11:13 AM
If you are asking about getting rid of a texture GPU side then that can be done with glDeleteTextures....
http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/deletetextures.html
...or reallocate the same texture ID with new data, overwriting the old.

Any data CPU side you can delete anytime you like, after the image has been cached to the GPU. Although be aware that if you fill the VRAM then your OpenGL implementation may well look for the texture CPU side again when it swaps data around.