Quote:Original post by _the_phantom_
yes, you are right, you must free up the textures via OpenGL functions, however I belive the point baldurk was driving at was that you could place the glDeleteTextures() call in the destructor of the class and use that to free the texture on release.
The alternative is that if you have a resource manager of some type on creation you request a handle to a texture from the texture manager and then when you destroy the object it just tells the texture manager it doesnt require it any more, then before you pull up your character selection screen you ask the texture manager to flush all unused textures thus freeing them in one lump (either via driect calls to the glDeleteTextures() function or by destorying objects which do the same job).
Really the best way depends on how your game engine is arranged.
Ahh. Well I'm just going to have to look at how I set it up. Its not like its complicated or anything. Its just that there are a few layers to dig through and I wrote the animation code like a year ago. There are animations, which are made of frames(of corse), which are built from sprites. So I will have to find a solid way of diging down do the sprite information in each frame and freeing every single texture one at a time. It just would have been nice if there was a function like KillThemAll_KillThemAll_In_a_GloryousAndMightyDestructoFunction();