d3dx11.h in Windows 8 sdk

6.2k Views Asked by At

Preamble:
I am making a project with VS 2013 and I tried to #include <d3dx11.h> and it was not found. I did a bit of searching and found this quote

D3DX is not considered the canonical API for using Direct3D in Windows 8 and therefore isn't included with the corresponding Windows SDK. Investigate alternate solutions for working with the Direct3D API.

from this page

I then did some more searching and found this SO question and I tried out the answer but it ended up just breaking all includes. So yes I have done some searching

Question:
How do you use d3dx11 in VS 2013?

2

There are 2 best solutions below

4
On BEST ANSWER
  1. Download and install DirectX SDK

  2. In Visual Studio click on your project > Properties > VC++ Directories:

  3. Include Directories: click a little down-arrow > <Edit...> > ... > navigate to C:\Program Files (x86)\Microsoft DirectX SDK June 2010\Include > Select Folder

  4. Library Directories > same as above but select ...\Lib\x86 > OK

  5. In your code:

#pragma comment(lib, "d3d11.lib")
#pragma comment(lib, "d3dx11.lib")
#pragma comment(lib, "dxgi.lib")

#include <d3d11.h>
#include <D3DX11.h>

1
On

You can use the legacy mode as jaho suggested, or adapt the new "Microsoft" way.

Be aware that replacement technologies for current uses of D3DX11 include DirectXTex and DirectXTK. D3DXMath is replaced by DirectXMath.

DirectXTex looks like a standalone Texture loading library, and actually it was still actively maintained by Microsoft. It contains all "LoadFromDDSFile()"-like functions.