About Store Forum Documentation Contact



Post Reply 
Dynamically detect DX10+ support
Author Message
Baccari Offline
Member

Post: #1
Dynamically detect DX10+ support
Most ordinary gamers do not know whether their graphic cards support DX10+ or not.

How do I make the game work in both cases by dynamically detecting support for DX10+ and using the appropriate library instead of building 2 executables like it is suggested in the MSVC sample project shipped with Esenthel ?
(This post was last modified: 06-07-2012 02:41 PM by Baccari.)
06-01-2012 01:56 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #2
RE: Detecting DX10+ support dynamicaly
This is a good question, and I would also like to know if it is possible.

On a very related note, when trying to run a DX10+ project on a computer with XP, it immediately crashes saying it can't find "d3d11.dll". It would be nice if there was some way to force DirectX 9 if 10/11 is not available...
06-01-2012 02:08 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #3
RE: Dynamically detect DX10+ support
D.shaderModel() returns the shader model available, but doesn't allow setting. Meaning if you wanted to use DirectX 9 for whatever reason, the most you can do is disable the DirectX 10+ features.

If the user doesn't have Vista/7, it never even gets to that point; it crashes before the main InitPre() function(can't load file).
06-01-2012 06:02 PM
Find all posts by this user Quote this message in a reply
Baccari Offline
Member

Post: #4
RE: Dynamically detect DX10+ support
Linking against both EsenthelEngine.lib and EsenthelEngineDX10+.lib simultaneously is impossible because the functions have the same names in the DX9 and the DX10+ versions.

Doing so will result in MSVC linking only against the library listed first in the linker configuration.

The way I prefer to do it is to get the supported shader model using D.shaderModel() and then using the defines to call the appropriate version of the functions.

This way:

if (D.shaderModel() == SM_5)
#define function_name DX10+_version_name
else
#define function_name DX9_version_name
(This post was last modified: 06-07-2012 03:15 PM by Baccari.)
06-07-2012 03:14 PM
Find all posts by this user Quote this message in a reply
Post Reply