DemoGL::Reference::Functions::DEMOGL_TextureUpload

DEMOGL_TextureUpload

DEMOGL_TextureUnUpload uploads the texturedata of the texture with the given TextureID to OpenGL so it can be used in texturing operations in OpenGL.

void
DEMOGL_TextureUpload(
	const GLuint iTextureID
);
	
Parameters.
iTextureID
Specifies the TextureID, or texture name, of the texture which should be uploaded to 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 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_TextureUpload: it will remove the texture data from OpenGL so it will not get in the way of other textures who will be used. Upload only textures which are needed in the next frame or in the next few frames. Use PREPARE commands in the script to call Prepare() methods of effectobjects and place calls to DEMOGL_TextureUpload to time texture uploads efficiently.

DemoGL will use hardware generated mipmaps, when the hardware supports the extension GL_SGIS_generate_mipmap.

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_TextureUnUpload Effect object commands

Last changed on 01-jun-2001

©1999-2001 Solutions Design