Erasing texture from memory

how do you erase a texture from memory ?



i'm always loading new textures and at some point i don't have any memory left, how do i delete the old ones ?

You may want to implement your own TextureManager, or in the least double index the cahcing so you can call TextureManager.releaseTexture

thanks.

TextureState.delete() for deleting from GL memory, TextureManager.releaseTexture() for deleting from TextureManager cache.

deleting from TextureManager cache also deletes from GL memory right ?

No.  You can release from the texturemanager's cache and yet still be using it in your application, so it does not force a delete.

so if you create a texture and delete it from TextureManager catch after asigning it to something. The texture will be released from GL memory as soon as nothing is using it ?



all those textures are stored in graphics card memory right ? would it be much slower if they move to RAM ?