【问题标题】:What SDK should I use for DirectX 11?我应该为 DirectX 11 使用什么 SDK?
【发布时间】:2014-08-20 23:59:22
【问题描述】:

我很困惑我需要什么才能使用最新版本的 DirectX SDK。

有 DirectX SDK(2010 年 6 月),它显然已被弃用,还有适用于 Windows 8.1 的 Windows SDK。

令人困惑的是,我不知道适用于 8.1 的 Windows SDK 是否可以使用 Windows 7 和 Visual Studio 2013 for Desktop,或者我是否必须将 DirectX SDK(2010 年 6 月)与 Windows 7 和适用于桌面的 Visual Studio 2013。

另外,如果我使用 Windows SDK for 8.1,我如何将它包含在我的 Visual Studio 项目中。有什么帮助吗?

【问题讨论】:

    标签: c++ visual-studio winapi windows-7 directx


    【解决方案1】:

    DirectX SDK 已从 7.0 版开始集成到 Windows SDK 中。除非您需要某些已弃用的功能,例如 DXUT,特别是运行时着色器编译器,否则只要使用 Windows SDK 运行就可以了。

    但是,如果您想使用 DirectX SDK 的已弃用功能,则需要包含两个 SDK,并将 Windows SDK 设置为比 DX SDK 具有更高的优先级。如果您同时包含两者并看到重新定义警告,那么您将它们包含在错误的顺序中。

    【讨论】:

      【解决方案2】:

      如果您拥有适用于 Windows 桌面的 Visual Studio 2013 Express(或 VS 2013 Pro 或更高版本),那么您拥有 Windows 8.1 SDK 并将默认将其用于任何 C++ 项目。要支持 Windows 8.0、Windows 7 和/或 Windows Vista 等“低级”系统,您需要设置 _WIN32_WINNT 预处理器符号 appropriately(对于 Windows 7 或更高版本,_WIN32_WINNT=0x0601)。您不需要做任何其他特别的事情,您可以在所有这些平台上使用 DirectX 11.0、DirectXMath、XInput 9.1.0 等,而无需使用旧版 DirectX SDK。 HLSL compiler (D3DCompile #47) DLL 在 Windows 8.x SDK 中可用,只需将其复制到您的应用程序文件夹中即可用于 Win32 桌面应用程序,尽管在 Windows 8.1 上它也已经是操作系统的一部分。

      Where is the DirectX SDK (2013 Edition)?

      Where is the DirectX SDK?

      理想情况下,您应该避免使用 D3DX11,而是使用在 Windows Vista 或更高版本上支持 Win32 桌面应用程序的众多 alternatives 中的任何一个。

      当然,您仍然可以将旧版 DirectX SDK 与 Windows 8.x SDK 一起使用(不幸的是,您必须在 Windows Vista/Windows 7 上使用 XAudio 2.7;XAudio 2.8 是Windows 8.x),但您需要记住 include/lib 路径顺序是颠倒的,因为 DirectX SDK 中的标头现在比 Windows 8.x SDK 中的标头旧。 MSDN 对此进行了介绍。请记住,如果您使用 D3DX、XAudio 2.7、XInput 1.3、XACT、D3DCompiler #43 等旧版 DirectX SDK 组件,那么您还需要依赖旧版 DirectSetup 部署。在这种情况下,建议您使用 REDIST 的 refreshed version,而不是旧版 DirectX SDK 中提供的那个。

      顺便说一句,如果您尝试使用“v120_xp”平台工具集以 Windows XP 为目标,那么您实际上使用的是 Windows 7.1 SDK 而不是 Windows 8.x SDK,因为 Windows 8.x SDK 不支持 Windows XP。请参阅此post 了解此场景的许多注意事项,或者保持理智,让 Windows XP 离开 :)

      【讨论】:

      • 注意我上面说的是“DirectX 11.0”。您可以在带有 KB 2670838 的 Windows 7 SP1 上使用 DirectX 11.1,但请记住,并非所有 DirectX 11.1 功能都可在 Windows 7 上使用,并且较旧的 Windows 7 和 Windows Vista 安装仅具有 DirectX 11.0。有关详细信息,请参阅此 postMSDN
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-12
      • 1970-01-01
      • 2015-08-24
      • 2022-01-15
      • 2017-07-12
      • 1970-01-01
      相关资源
      最近更新 更多