Direct3D Texture Map Management

In Direct3D programs, fg_tmdefine() stores texture maps either in video memory or system memory, depending on the DirectX version being used, and whether the program is using Direct3D hardware acceleration or Direct3D software rendering. Texture maps always reside in video memory when using Direct3D hardware acceleration under DirectX 5, and they always reside in system memory when using Direct3D software rendering with any version of DirectX.

When using Direct3D hardware acceleration under DirectX 6 or later, fg_tmdefine() creates Direct3D managed textures. Managed textures reside in video memory when being used, but may be displaced to system memory as other textures are needed. When a displaced texture is needed again, it is automatically brought back into video memory. The fg_tmevict() function moves all Direct3D managed textures from video memory to system memory. This can be useful, for example, to clear all textures from video memory at the start of a new level in a game. The fg_tmevict() function has no parameters and no return value. It is meaningful only when using Fastgraph's DirectX libraries with Direct3D hardware acceleration under DirectX 6 or later. It does nothing when using DirectX 5 or earlier, when using Direct3D software rendering, or when using Fastgraph's native libraries.

<< Prev

Next >>

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.