DemoGL::Reference::Functions::DEMOGL_TextureUnUpload

DEMOGL_TextureUnUpload

DEMOGL_TextureUnUpload removes the texture with the given TextureID from OpenGL.

void
DEMOGL_TextureUnUpload(
	const GLuint iTextureID
);
	
Parameters.
iTextureID
Specifies the TextureID, or texture name, of the texture which should be unuploaded from OpenGL. A TextureID is returned by the several texture creation functions.

Return values.

Remarks.
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.

Example.

Requirements.
DemoGL v1.3 (build 0112 or higher)

See also. DEMOGL_TextureDelete, DEMOGL_TextureUpload

Last changed on 20-jan-2001

©1999-2001 Solutions Design