Win10上DirectX的SDK在哪裡? (Where is the SDK for DirectX on Win10?)


問題描述

Win10上DirectX的SDK在哪裡? (Where is the SDK for DirectX on Win10?)

剛剛有人告訴我,我正在使用的 SDK(2010 年 6 月)不再使用,我需要使用他們包含在 Win10 中的任何新 SDK。那麼它在哪裡?

我正在嘗試啟動圖形演示解決方案,但由於鏈接器錯誤,我無法調用 D3D11 函數,這對我來說意味著我需要包含庫等。

如果有人能幫我解決這個問題,這樣我就可以開始了,那麼我會很好的。


參考解法

方法 1:

The MSDN page Where is the DirectX SDK? tells you to use the Windows SDK, specifically the Windows 8.0 SDK, Windows 8.1 SDK, or Windows 10 SDK to do DirectX development (which is assumed to be Direct3D 11 or Direct2D/DirectWrite). Direct3D 12 requires the Windows 10 SDK.

If you are using Visual Studio 2013, Visual Studio 2015, or Visual Studio 2017 RC, then you already have the Windows 8.1 SDK and optionally the Windows 10 SDK.

An important detail is that the D3DX library (D3DX9, D3DX10, and D3DX11) is deprecated and only available in the legacy DirectX SDK. That means D3DX11 is not part of the Windows SDK, and you shouldn't use it.

For HLSL, you use D3DCompile directly or the FXC that comes with the Windows SDK. For math, you use DirectXMath that comes with the Windows SDK. If you are using legacy Effects 11, you can use the version from GitHub. I recommend you also take a look at DirectX Tool Kit for DirectX 11 and it's tutorials. For a complete list of replacements for D3DX, see Living without D3DX.

If you really want to continue to use the legacy DirectX SDK components with Visual Studio 2012 or later, you can but you should note the details at the bottom of the MSDN page above. Notably you have to reverse the include/lib path order when you add the legacy DirectX SDK to your project.

For a complete catalog of where the various bits of the old DirectX SDK ended up, see DirectX SDKs of a certain age, DirectX SDK Tools Catalog, DirectX SDK Samples Catalog, as well as the Living without D3DX article above.

The Direct3D 11 Debug Device for Windows 10 is not installed by any Windows SDK or by the legacy DirectX SDK. It is a windows optional feature. See Direct3D SDK Debug Layer Tricks.

The actual "DirectX Runtime" has been part of the operating system since Windows XP Service Pack 2. The legacy DirectX SDK never installs "DirectX" on any modern version of Windows, and only deploys some optional side‑by‑side stuff. It's not required at all if you using the Windows SDK. See Not So Direct Setup.

(by Bella RoseChuck Walbourn)

參考文件

  1. Where is the SDK for DirectX on Win10? (CC BY‑SA 2.5/3.0/4.0)

#direct3d #graphics #C++






相關問題

OpenGL ES 或 Direct3D 中的表面究竟是什麼? (What exactly is a surface in OpenGL ES or Direct3D?)

您可以將一個進程的 Direct3D 窗口渲染到另一個進程的 HWND 中嗎? (Can you render a Direct3D window for one process into another process' HWND?)

OpenGL等圖形庫的目的是什麼? (What is the purpose of a graphics library such as OpenGL?)

Win32 的 CoreImage (CoreImage for Win32)

在 3D 圖形庫中對 I-Section 進行建模 (Modelling an I-Section in a 3D Graphics Library)

編譯器不允許我使用“DDSTextureLoader.h”和“WICTextureLoader.h” (Compiler won't let me use "DDSTextureLoader.h" and "WICTextureLoader.h")

在新紋理上切割具有圓形形狀的 Direct3D 紋理或更改部分像素的 Alpha 值 (cut Direct3D texture with circular shape on a new texture OR change Alpha value of a part of pixels)

Win10上DirectX的SDK在哪裡? (Where is the SDK for DirectX on Win10?)

GLSL / HLSL 著色器中的星球大戰全息效果 (Star Wars holographic effect in GLSL / HLSL shader)

使用 Direct3D 繪製帶有圓角末端的線條 (Drawing lines with rounded endings with Direct3D)

類文件中出現未解析的外部符號 (Unresolved External Symbol Occuring with Class Files)

錯誤,不運行程序(Windows) (error, not run program (windows))







留言討論