How to tell if the version of DirectX you need is installed?

Started by
3 comments, last by lack o comments 19 years, 2 months ago
How do you do this? ace
Advertisement
Start > Run > (type) dxdiag

that will tell you everything about what DX version you have installed.
DirectXSetupGetVersion.
I mean at run time. How can i check that it is installed. Since i don't want to ship DX with every demo i make, i simply want to see if it is there before trying to use it. Therefore preventing crashes.

ace
[edit]Oh, I see Oluseyi already has a link. Oops [/edit]

Someone goes to an awful lot of trouble to write documentation for DirectX. Please, read it =)

Quote:
Checks whether the Microsoft Direct3D runtime version is compatible with the D3DX utility library version.

Syntax

BOOL WINAPI D3DXCheckVersion( UINT D3DSdkVersion,
UINT D3DXSdkVersion
);
Parameters

D3DSdkVersion
[in] D3D_SDK_VERSION version of the Direct3D runtime.
D3DXSdkVersion
[out] D3DX_SDK_VERSION version of the D3DX utility library.
Return Value

Returns TRUE if the the Direct3D runtime version is compatible with the D3DX utility library version; otherwise FALSE is returned.


Remarks

Use this function for initialization of your application as follows.

HRESULT CD3DXMyApplication::Initialize(HINSTANCE hInstance, LPCSTR szWindowName,
LPCSTR szClassName, UINT uWidth, UINT uHeight)
{
HRESULT hr;

if (!D3DXCheckVersion(D3D_SDK_VERSION, D3DX_SDK_VERSION))
return E_FAIL;
.
.
.
}


Function Information

Header d3dx9core.h
Import library d3dx9.lib
Minimum operating systems Windows 98



There is another function related to this, but it's too long to list all of it here.

Quote:
INT DirectXSetupGetVersion( DWORD *pdwVersion,
DWORD *pdwRevision
);

This topic is closed to new replies.

Advertisement