In OpenGL, is it possible to release texture data, but keep the same texture id? I want to unload textures when they aren't needed, but load them again later when they are.
There are a lot of objects that store texture IDs. (For example - spritesheets - multiple objects use the same texture ID and represent a part of the image).
glDeleteTextures releases the id, so another texture (image data) can acquire the same ID. I'd have to walk all objects and change the texture IDs they use.
Is there a way to release the texture data only, but keep its ID, so that later I could do only
glTexImage2D on the same ID and keep all references to this ID valid?