Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Working with Direct X and VS2012

I have both Visual Studio 2012 Express for Desktop and for Windows 8, and I wanted to create Direct X applications and games. I know that there is a Windows SDK now, and in VS 2012 exp for win8 the IDE is pre-installed with the SDK (I know that from the new Direct3D project). My question is, if I wanted to develop applications for Windows Desktop (using VS2012exp) does it come Windows SDK or do I need to install Direct X SDK? And how do I know if my graphics card support which version of Direct X? Will any Direct X SDK version work with any Direct X version? As you can see I am a newbie at that stuff and any comment would be helpful. Thanks for your time.

like image 512
Aelgawad Avatar asked Jan 13 '23 17:01

Aelgawad


2 Answers

If I wanted to develop applications for Windows Desktop (using VS2012exp) does it come Windows SDK or do I need to install Direct X SDK?

Yes, with Windows 8 SDK and Visual Studio 2012 (or Windows 8.1 SDK and Visual Studio 2013 preview) you can develop anything:

  • DirectX applications (both, Windows Desktop and Windows Store)
  • for any supported target platform (x86, x64, ARM)
  • for any reasonably modern Windows operating system (starting from Windows 2000/XP)
  • using any of API versions: DirectX 9.3, 10.0, 10.1, 11.0, or 11.1

Note:

  • DirectX 9 API is completely different from 10 and 11, and it is obsolete. Use it only if you targeting Windows versions below Vista.
  • DirectX 11 is more like an improved version of DirectX 10.
  • So in most cases, you will want to program for DirectX 11.1.

And no, you don't need to install DirectX SDK. It was deprecated (latest version - june 2010). Do not use it in new code. Use it only if you need to compile some old code which uses D3DX stuff (such as ID3DXEffect, ID3DXFont, ID3DXLine, ID3DXMesh, ID3DXSprite), e.g. samples from books or different SDK samples.

And how do I know if my graphics card support which version of Direct X?

Well, if we talking about your videocard, you can look at your card vendor's or GPU vendor's site. Or any of informational utilities, such as GPU-Z.

If we talking about end-user hardware, since DirectX 10-11 there are feature levels. So even if you are using latest API (DirectX 11.1 at this moment), you can target old hardware (for example, if you using D3D_FEATURE_LEVEL_9_3, newer features, from D3D_FEATURE_LEVEL_10_0 and higher will be disabled).

Note, that to develop for latest feature level you don't need GPU that supports it. You can run and debug application on WARP device (ivery slow and meant for debugging purposes only, not for end-user release). For example, you can have old DirectX 10 card (Shader model 4.0), but target to DirectX 11 (Shader model 5.0)

Will any Direct X SDK version work with any Direct X version?

Latest DirectX SDK (june 2010) supports DirectX up to 11. No DirectX 11.1 support.

like image 115
Ivan Aksamentov - Drop Avatar answered Jan 21 '23 05:01

Ivan Aksamentov - Drop


I'm a developer in Visual Studio who works with the DirectX tooling (the DX Diagnostic Tool and on the new project templates). You're asking a few different questions in here, but I'll try my best to answer the ones that I can.

1 - What SDKs are needed for DX application development? This link here as the best information on this. Basically as of the June 2010 DirectX SDK the DX SDK was combined with the Windows development SDK so if you install the most recent Windows SDK you'll have the right stuff for developing the newest DX applications. http://blogs.msdn.com/b/chuckw/archive/2013/07/01/where-is-the-directx-sdk-2013-edition.aspx

This link also has more indepth info specific to the issue of DX Desktop apps on Windows 8. http://blogs.msdn.com/b/chuckw/archive/2012/03/23/desktop-games-on-windows-8-consumer-preview.aspx

Note here that you can also install the June 2010 DirectX SDK on your machine, that won't hurt anything, we often install it ourselves as it has some useful sample applications to look at even if they are a bit outdated. http://www.microsoft.com/en-pk/download/details.aspx?id=6812

2 - How do I know what my graphics card supports? I'm not sure if you mean how do I detect this in my DX application at runtime? Or if you mean how do I just look it up quickly for my specific system. To figure out your own GPU it's usually a pretty quick lookup, just find your device name and punch it in online, most stuff released in the last several years supports DX11 so you should be fine here. If you installed the June 2010 SDK that I mentioned above you can use the capability tool mentioned here: http://www.danielmoth.com/Blog/What-DX-Level-Does-My-Graphics-Card-Support-Does-It-Go-To-11.aspx

At runtime DX has code to use to check if the running graphics card has the ability to use advanced DX 11 features. http://msdn.microsoft.com/en-us/library/windows/desktop/hh404562(v=vs.85).aspx#check_support_of_new_direct3d_11.1_features_and_formats

http://msdn.microsoft.com/en-us/library/windows/desktop/ff476876(v=vs.85).aspx

3 - Will any DirectX SDK work with any DX version? So here you basically always want to be using the latest DX SDK as you could see with the link on feature levels above you can target lower levels of DX while still coding using the most recent SDK. Just use the most recent SDK and target feature level 9 if you wanted to create apps that run on DX 9 cards.

like image 23
Ian Huff Avatar answered Jan 21 '23 03:01

Ian Huff