DirectX11 Learning Notes 02

Configure the environment for DirectX11

Tools : VS2017.

There are some changes in the VS2017 version:
1. No 32-bit console application, change to C++ Desktop application under
2. There is no need to download the SDK for DirectX11, as Microsoft has already included it since Win8. Just add some link libraries
3. In VS2017, there is no tutorial on DirectX11 for expansion and updates. I don't know why.

Specific steps

  1. Install VS2017 and select the option to develop and use C+ on the universal Windows platform when selecting components+ Game development for
  2. Choose an official tutorial to learn:
  3. Download some official examples and open them in VS, as it is an old version that may cause many errors. Here we need to do two things:
    Configure Link Library: Click here: Project - Properties - Linker - Input - Attach Dependencies - Add as follows:

    D3d11. lib
    D3dcompiler. lib
    Dxguid. lib
    Winmm. lib

    Include the following content in the program:

#include "DirectXMath.h"
#include "DirectXPackedVector.h"
using namespace DirectX; 
using namespace DirectX::PackedVector;
struct mystruct
DirectX::XMFLOAT3 position;
DirectX::PackedVector::HALF packedValue;

Delete: xnamath (has been changed to DirectXMath).

If there are no errors, run it and see the effect.

Official website example:


Update: Found that there seems to be an issue with the 2017 version, rolled back and used 2015:).