Jump to content
  • Advertisement
Sign in to follow this  
AKrotkov

Unloading textures?

This topic is 4483 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
Advertisement
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 GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!