   checking version of directx through code
  I want to write a graphics engine that supports 9, 10, and 11 but I would like to handle cases where if I'm testing the game on other PCs, it would render with 9 if 10 isn't supported by that graphics card (same goes with 10 and 11). How do I do that through code? Is there a function in the DirectX SDK that allows me to do that?   
  Consider an OS check instead, you can safely assume that a Windows XP user does not have a DirectX exceeding v9.x, likewise you can safely assume that any windows verison higher than Windows XP, eg vista\Win7, has DirectX 10 or higher.To answer your question: No   ;  How do I check between the different versions of Windows? I'm using MS VS 2008.   ;  The easiest thing to do is try to create the higher interfaces in if that fails revert to a lower one until you succeed. So try create a DX11 interface that fails, then try and DX10 and so on.;Quote:Original post by 16bit_portI want to write a graphics engine that supports 9, 10, and 11It's almost totally pointless to support both 10 and 11. 11 has feature levels, which lets you use the same API to target lower-level hardware. So you can you can target 10-level cards just fine, and have the same functionality available that you would have in 10. The only catch is that the user must be using Vista with a specific platform update...see this for more info.;  To check for Windows versions just call VerifyVersionInfo() - http://msdn.microsoft.com/en-us/library/ms725492%28v=VS.85%29.aspx   ;  It not really pointless to support DX10 and DX11 since not every user has a $*** DX11 card. Advance features will require a new card (e.x. HW tesselation support). The DX10 pipeline stages are still supported on DX11 hardware so the baseline would be to support DX10 and if more advance features are required then you would need a new version of the API.   ;  Yes, advanced features required a DX11 card BUT you can use the DX11 API and the 'feature levels' to have the API work on DX9, DX10 and DX11 hardware, you just have to observe the feature set for the required level.So if you want to target both XP and Vista+ users you can either do;- DX9 API only and stay with that feature set- DX9 API for XP users, DX11 API for Vista+ with feature levelsThere is no good reason to use the DX10 API.----And depending on your target audience and release times there might not be much of a point in using the DX9 API; from the Steam Hardware Survey for March 2010 it shows XP (32 and 64bit) as having a market share of 39.23%, down 1.72%, and Win7+Vista at 60.11% with Win7 x64 the most popular with 24.42% and Vista x86 following up with 16.69%.So if your market is more 'hard core' and you are planning for the future even a year away DX9 might not be a good target to have anyway...   