DirectX Version Control

By default, Fastgraph's DirectX libraries use the highest supported version of DirectX available on the user's system. This strategy works well for most programs, but sometimes you may want a program to require a minimum version of DirectX (for example, when using Direct3D managed textures). Or, you might even want to require a specific DirectX version for some reason. In such cases, you can use fg_ddsetversion() to implement Fastgraph's DirectX version control. The two fg_ddsetversion() parameters respectively specify the lowest and highest version of DirectX under which the program can run. To require a specific version of DirectX, specify that version number for both parameters. The fg_ddsetversion() function is available only in Fastgraph's DirectX libraries.

For example, a program that calls fg_ddsetversion(6,7) will run under DirectX 6 or DirectX 7. If the user has an earlier version of DirectX installed, fg_vbinit() will return -1, indicating DirectX is not available. Note that DirectX implementations include support for all previous versions of DirectX. This means a program that calls fg_ddsetversion(5,5) would not only run under DirectX 5, but also under DirectX 6 or later using the DirectX 5 interfaces.

The fg_ddgetversion() function returns the DirectX version number a program is using. It has no parameters, and like fg_ddsetversion(), is available only in Fastgraph's DirectX libraries. Because Fastgraph uses the same DirectDraw interfaces for DirectX versions 2 through 5, if fg_ddgetversion() returns 5 it could mean the program is using DirectX 2 or 3 (there is no DirectX 4). Note that this is true only for DirectDraw programs. Fastgraph requires DirectX 5 or later for Direct3D programs, so a fg_ddgetversion() return value of 5 does in fact mean DirectX 5 in Direct3D programs.

<< Prev

Next >>

Fastgraph Home Page


copyright 2001 Ted Gruber Software, Inc.