windows-10 - 在windows10中开发dx应用还需要DirectX SDK吗?

标签 windows-10 direct3d

大多数类(class)都说我们需要directX SDK。然而,它们是在 2012 年初,Windows 7 的时代。
而且我看到一些 DirectX 的头文件和 lib 文件已经包含在 windows 工具包中 (C:\Program Files (x86)\Windows Kits) .并且某些名称已更改(XNAmath.h 为 DirectXMath.h)。

所以我想知道是否需要SDK?
我可以只使用 Windows 工具包编写代码吗?

最佳答案

作为将 DirectX SDK 合并到 Windows SDK 中的工作人员,我已经在这里和其他地方多次解决了这个问题。

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.


旧版 DirectX SDK 的官方状态在 Microsoft Docs 上得到解决。 .
这篇博文涵盖了更多细节:Where is the DirectX SDK (2021 Edition)? .
随着向 Windows SDK 的过渡,有些东西被“抛在了后面”,我已经将很多东西转移到了各种 GitHub 项目中。有关最终结果的完整调查,请参阅这些博客文章:
  • Living without D3DX
  • DirectX SDK Tools Catalog
  • DirectX SDK Samples Catalog
  • DirectX SDKs of a certain age

  • 目前,旧版 DirectX SDK 只有两种用途,如 The Zombie DirectX SDK 所述。 :
  • 您正在为 Windows XP 进行开发。这需要 Windows 7.1 SDK,因为 Windows 8.x SDK 和 Windows 10 SDK 不支持 Windows XP,这早于 DirectX 的合并。在 VS 2012-2017 中,Windows XP 工具集包括 Windows 7.1A SDK(参见 this post)。尽管基本的 Direct3D 9 header 已在 Windows SDK 中存在多年,但除了 D3DX 中的旧版 DirectX SDK 之外,任何地方都没有真正的 Direct3D 9 实用程序代码。图书馆。
  • 您想要在需要 XAudio 2.7 的 Windows 7 上使用 XAudio,它仅在旧版 DirectX SDK 中可用。 XAudio 2.8 包含在 Windows 8 和 Windows 10 中, header 位于 Windows 8.x SDK 中。见 this post .. 最好的选择是使用 XAudio2Redist它在 Windows 7 SP1、Windows 8.0 和 Windows 8.1 上提供 XAudio 2.9,同时在 Windows 10 上使用内置操作系统版本。这避免了对音频使用旧版 DirectX SDK 的任何要求。

  • Direct3D 11 的旧教程和书籍使用 D3DX11实用程序库和 xnamath 或 D3DXmath。您可以将旧版 DirectX SDK 与 Windows 8.x SDK 或 Windows 10 SDK 一起使用,但由于颠倒的 include/lib 路径顺序,这很棘手。有关详细信息,请参阅 Microsoft Docs。相反,我建议使用上面列出的 D3DX 替代品,例如 DirectX Tool Kit for DX11DirectXMath .

    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.


    从 Windows 8.x 到 Windows 10 w.r.t. 的主要变化DirectX 开发是您获得“开发人员运行时”的方式。不是从 SDK 获取它,而是启用名为“图形工具”的 Windows 可选功能。值得注意的是,Windows 8.0、Windows 8.1 或 Windows 10 不支持 Direct3D 9 调试设备。请参阅 Visual Studio 2015 and Graphics Tools for Windows 10 .

    关于windows-10 - 在windows10中开发dx应用还需要DirectX SDK吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38156330/

    相关文章:

    python-2.7 - 如何在spyder上安装IB API?

    c++ - SetWindowPos 在笔记本电脑上使用放大的对话框

    delphi - list 和 GetVersionEx

    c++ - 没有顶点缓冲漫反射的着色纹理

    c# - 投影矩阵导致裁剪空间深度计算不准确?

    windows - 如何在 DXGI 中获取监视器/输出的当前显示模式(分辨率、刷新率)?

    c# - UWP ComboBox 不再具有打开/关闭动画(内部版本 14393)

    powershell - 容器尝试Powershell时在CreateProcess期间遇到错误

    具有 16 位颜色深度的 C++ Direct3D9 GetFrontBufferData

    c++ - 异常(exception):设备为nullptr。 D3D11中的读取访问冲突