Advertisement

How to get the DX Version

Started by February 14, 2002 07:53 AM
10 comments, last by glnefugio 23 years ago
ok, here goes. i''m no expert - i''m just starting out with directx and this question kinda intrigued me. here''s what i did to get it working:

1) you need to supply dsetup.dll with your program (in the same folder as the .exe should be just fine)
2) you need to include dsetup.h and dsetup.lib
3) the syntax for the whole process is:

DWORD dwVersion;
DWORD dwRevision;
if (DirectXSetupGetVersion(&dwVersion, &dwRevision))
{
printf("DirectX version is %d.%d.%d.%d\n",
HIWORD(dwVersion), LOWORD(dwVersion),
HIWORD(dwRevision), LOWORD(dwRevision));
}

this is taken from the chm help file of the dx8 sdk. moreover, i''ll copypaste some stuff that was said so as to make the picture a little clearer for you:

/////////

The DirectXSetupGetVersion function can be used to retrieve the version and revision numbers before or after the DirectXSetup function is called. If it is called before DirectXSetup is invoked, it gives the version and revision numbers of the DirectX components that are currently installed. If it is called after DirectXSetup is called, but before the computer is restarted, it gives the version and revision numbers of the DirectX components that take effect after the computer is restarted.

The version number in the pdwVersion parameter is composed of the major version number and the minor version number. The major version number is in the 16 most significant bits of the DWORD when this function returns. The minor version number is in the 16 least significant bits of the DWORD when this function returns. The version numbers can be interpreted as follows:

/////////

i got the dx version out of my dx, and i didn''t have dsetup.dll in the windows/system dir.

j p: i stand by you - winXP just isn''t for everyone. recently i tried running a little program of mine that i''m developing currently on a winXP and it crashed. not the os, but i the program really managed to confuse the poor thing. as to the directx version - i know a couple of people who deliberately stick to lower versions of dx because of the graphics card. remember that only the newest graphics and sound cards can take advantage of all the features dx8 offers - this includes the number of conflicts that may arise when you''re using a new version of dx on an old gpu. i myself cannot install the debug version of dx8 because several things won''t run (such as BSPlayer) etc.

i hope this answers your question glnefugio

if you need any of the files, just let ne know and i''ll mail then to you

crispy
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
oh and i forgot: here''s the table according to which the dx version is extracted -

DirectX version Value pointed to by pdwVersion
DirectX 1 0x00000000
DirectX 2 0x00000000
DirectX 3 0x00000000
DirectX 5.0 0x00040005
DirectX 6.0 0x00040006
DirectX 7.0 0x00040007
DirectX 8.0 0x00040008

There is no version 4 of DirectX.

so the output for dx8 would be (in the format introduced in my previous post): "DirectX version is 4.8.0.400" so don''t be confused by the four at the beginning.

make some noise if i left something out

crispy
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared

This topic is closed to new replies.

Advertisement