Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

smart_idiot

I want to kill textures.

This topic is 6413 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

I am making a simple platform game engine (sort of) and I want to have diffrent textures in diffrent levels. I refrence most of the 2D textures with a GLuint texture[TEXTURE_MAX] array. If I create a new texture refrencing a part of the array, is the old texture overwritten, destroyed, or does it stay in memory and take it space? In any case, HOW DO I KILL IT?

Share this post


Link to post
Share on other sites
Advertisement
well if you bind any texture use "glBindTexture" and then call "glTexImage" it will remove that texture from texture memory and insert the new texture in it''s place. however, it does not touch the bitmap {texture} that you send to it. i''m not sure if you need to call "glBindTexture" again to solidify this action, but i do.

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

Share this post


Link to post
Share on other sites
1.) OpenGL maintains a copy of your texture array in system/video ram
2.) You can free the memory you allocated for your array at any time after you passed it to gl
3.) If you want gl to kill its copy of the texture, use glDeleteTextures()

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!