Sign in to follow this  

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

This topic is 4692 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
[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
);

Share this post


Link to post
Share on other sites

This topic is 4692 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this