OpenGL manages the textures available for texturing. When you want to use a texture, its data should be uploaded to OpenGL.
Because current videocards have limited
memory, not always all textures in an application will fit in the videocard's memory. When you upload every texture to OpenGL
using DEMOGL_TextureUpload, probably textures you don't
use at the moment are stored on the videocard while others now needed are not, resulting in stalls in the rendering. To avoid
this, you can do the reverse of DEMOGL_TextureUpload with
DEMOGL_TextureUnUpload: it will remove the texture data from OpenGL so it will not get in the way of other textures
who will be used. UnUpload only textures which are not needed in the next frame or in the next few frames.
DemoGL keeps references to uploaded textures, how many times it's uploaded. When you unupload a texture which is uploaded twice
the texture is not removed from OpenGL but the upload references are decreased with one. When no upload reference exists anymore,
the texture is fysically removed from OpenGL.