microsoft / DirectXTK12

The DirectX Tool Kit (aka DirectXTK12) is a collection of helper classes for writing DirectX 12 code in C++
https://walbourn.github.io/directx-tool-kit-for-directx-12/
MIT License
1.47k stars 393 forks source link

Can't find d3dx12.h from nuget download #40

Closed prog3487 closed 5 years ago

prog3487 commented 5 years ago

I downloaded this project by NuGet package manager in Visual Studio 2017. (2018.8.18.2)

I tried to use DescriptorHeap so included its header(DescriptorHeap.h) but it occurs an error. (can not find d3dx12.h)

d3dx12.h is in Src folder but the Src folder does not exist in NuGet downloaded package. So can not find it. (it only has library files)

walbourn commented 5 years ago

The official way you get D3DX12.H is to download it from GitHub and throw a copy into your project. There's no NuGet for it, although copies of it are included in Visual Studio templates. The official master copy for this header is here, and this is mentioned in Microsoft Docs.

See also the Direct3D Game VS Template which is hosted on directx-vs-templates

I have a copy of the header in the DirectX Tool Kit sources for the internal implementation use. In theory I could copy out the code I need and remove it's use both internally and externally, but it is an 'official' helper.

walbourn commented 5 years ago

I will take not that I don't strictly need to take a hard dependacy on client-code having D3DX12.H, so I'll look at cleaning up that usage in DescriptorHeap.h.

walbourn commented 5 years ago

Note that I updated DescriptorHeap.h in this commit to avoid mandating the use of d3dx12.h by client code, although you probably still want to add it to your codebase.