Advertisement Jump to content
Sign in to follow this  

Unloading textures?

This topic is 4579 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post

Link to post
Share on other sites
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]);

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!