🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Unloading textures?
This might seem like a very stupid question, but it isn't covered in any of the tutorials I've seen.
When OpenGL loads a texture, is there any way to specify to it to throw that texture out? I'm writing a game, and some of the textures are only used once, and once they're done, they're never used again.
The gl command for doing that is
glDeleteTextures(GLsizei n, const GLuint *textureNames);
It works exactly as glGenTextures, but in reverse.
so if your glGenTextures was
glGenTextures(1, &texture[0]);
then the glDeleteTextures will be
glDeleteTextures(1, &texture[0]);
glDeleteTextures(GLsizei n, const GLuint *textureNames);
It works exactly as glGenTextures, but in reverse.
so if your glGenTextures was
glGenTextures(1, &texture[0]);
then the glDeleteTextures will be
glDeleteTextures(1, &texture[0]);
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement