Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Okay, So I would like my engine to detect weather or not it can use DirectX 10, if it can't it defaults to DirectX 9.0c but, the function DirectXSetupGetVersion() will only return Versions 5 through 9. Could someone point me to what could tell me the device capabilities? Thank you for your time.

share|improve this question
    
I knew how to find the device capibilities, I just needed to see if there were Fucntions to get DX version for running on XP, Vista, 7, and 8. –  Matt Jensen Oct 10 '11 at 22:35

2 Answers 2

up vote 6 down vote accepted

Detect the OS version. If you are on XP or below, you are limited to 9. Using the DirectXSetup API isn't terribly useful, instead you should look at device capability bits to determine what features are supported (and to what extent) and tailor your code based on that.

If you are on Vista or above, you can use the D3D11 API. When you initialize D3D11, you can specify and/or query for the feature levels supported. You could also just attempt to initialize D3D10 and see if it fails.

In all cases, you should package the appropriate runtime redistributable(s) with your application installer to ensure the DLLs are available at runtime.

share|improve this answer

Try a LoadLibrary on d3d10.dll - that'll tell you quickly enough if Direct3D 10 is available.

Caveats:

The user could quite easily pop a DLL called "d3d10.dll" in their program folder which would break this.

If you statically link to the Direct3D 10 libs then trying to run the program on XP or below just won't work anyway; Direct3D 10 or above is just not available for these Windows versions.

Direct3D 10 is always gonna be installed anyway on Windows Vista or higher (whether or not it can actually run a Direct3D 10 program is another matter).

I think we need more info, such as what versions of Windows you're targetting, before we can definitively answer this one.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.