Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do we still need DirectX SDK to develop dx application in windows10?

Most courses said that we need the directX SDK. However they are early in 2012, the age of Windows 7. And I see that some of directX's header files and lib files has been included in windows kits (C:\Program Files (x86)\Windows Kits). And some name has been changed (XNAmath.h to DirectXMath.h).

So I wonder if SDK is necessary?
Can I write code only with windows kits?

like image 968
FireFLO Avatar asked Dec 01 '22 12:12

FireFLO


1 Answers

As the person who did the work to merge the DirectX SDK into the Windows SDK, I've addressed this question many times here and elsewhere.

If you have Visual Studio 2012, 2013, or 2015 then you already have the Windows 8.x SDK which supports development for DirectX 11. With VS 2015, you can optionally install the Windows 10 SDK which is needed to develop for DirectX 12.

Visual Studio 2017 and later come with Windows 10 SDK which supports both DirectX 11 & DirectX 12 development.

The official status of the legacy DirectX SDK is addressed on Microsoft Docs.

More detail is covered in this blog post: Where is the DirectX SDK (2021 Edition)?.

With the transition to the Windows SDK, some stuff was 'left behind' and I've moved a lot of that stuff to various GitHub projects. For a complete survey of what ended up where, see these blog posts:

  • Living without D3DX
  • DirectX SDK Tools Catalog
  • DirectX SDK Samples Catalog
  • DirectX SDKs of a certain age

At this point in time, there are only really two usesone use for the legacy DirectX SDK as covered in The Zombie DirectX SDK:

  • You are developing for Windows XP. This requires the Windows 7.1 SDK because the Windows 8.x SDK and Windows 10 SDK do not support Windows XP and this predates the merge of DirectX. With VS 2012-2017 the Windows XP toolset includes the Windows 7.1A SDK (see this post). While the basic Direct3D 9 header has been in the Windows SDK for many years, there's really no Direct3D 9 utility code anywhere except in the legacy DirectX SDK in the D3DX library.

  • You are wanting to use XAudio on Windows 7 which requires XAudio 2.7, which is only available in the legacy DirectX SDK. XAudio 2.8 is included with Windows 8 and Windows 10 and the headers are in the Windows 8.x SDK. See this post.. The best option is to use XAudio2Redist which provides XAudio 2.9 on Windows 7 SP1, Windows 8.0, and Windows 8.1 while using the built-in OS version on Windows 10. This avoids any requirement to use the legacy DirectX SDK for audio.

Old tutorials and books for Direct3D 11 use the D3DX11 utility library and xnamath or D3DXmath. You can use the legacy DirectX SDK with the Windows 8.x SDK or Windows 10 SDK, but it's tricky due to the inverted include/lib path order. See Microsoft Docs for details. Instead, I recommend using the replacements for D3DX listed above such as the DirectX Tool Kit for DX11 and DirectXMath.

UPDATE: While it is still a good idea to stop using legacy D3DX9/D3DX10/D3DX11 in projects, there is now an easy option for using these in modern versions of Visual Studio that does not require the legacy DirectX SDK, does not require the use of the legacy DirectX End-User Runtime installer, and does not require fiddling around with VC++ Directories project settings. Instead, you can just use this NuGet package. See this post for more details.

If you are using Direct3D 10.x, then you should upgrade to Direct3D 11. The API is extremely similar, Direct3D 11 is supported on a broader set of platforms and hardware, and you can use the replacements for D3DX11 to remove any lingering legacy DirectX dependency.

The main change from Windows 8.x to Windows 10 w.r.t. to DirectX development is how you get the "Developer Runtime". Instead of getting it from an SDK, you enable a Windows optional feature called "Graphics Tools". It's worth noting that there's no support for the Direct3D 9 debug device on Windows 8.0, Windows 8.1, or Windows 10. See Visual Studio 2015 and Graphics Tools for Windows 10.

like image 83
Chuck Walbourn Avatar answered Dec 09 '22 12:12

Chuck Walbourn