May be a very simple question.
I know, there's the glDeleteTextures procedure that does the work, so I can create a "texture manager" that loads and unloads the textures, but is there a way to delete all textures in a simple call?
May be a very simple question.
I know, there's the glDeleteTextures procedure that does the work, so I can create a "texture manager" that loads and unloads the textures, but is there a way to delete all textures in a simple call?
No signature provided yet.
No, i don't think there are other ways. Possibly you can reinitialize the whole rendering context and OpenGL, but that's a little overkill compared to just going through each texture and deleting them 1 by 1.
glDeleteTextures does the work and also can delete all your textures at once if you store all of them in a single Array.
I make my own procedures that will delete those loaded for specific purposes. You can load all your textures into any array like Jimmy states and then simply plug that number into glDeleteTextures yes, but if you want better management be sure to keep those that are needed only at specific times (level specific or splash screens) seperate from those needed all the time. (main menu and in-game menu graphics)
Ok. Then I should use a "texture manager".
Thank you.
No signature provided yet.
This is obvious, but maybe you can use tlist as it is a general purpouse list manager with add, insert and delete metods for any kind of objects.
I was concerned about load/unload textures to the OpenGL library, but your suggestion of using TList makes me think about load and unload the bitmaps from disk. Thank you, fitflend.
No signature provided yet.
Obviously you always want to load the textures straight from disk. But another thing you need to pay attention to is how many textures you use. Each call of glBindTexture() is a slow operation. So for example a tile map, being split each in its own texture would be a huge performance loss.
Bookmarks