gpt4 book ai didi

c++ - E_FAIL D3D11CreateDevice

转载 作者:行者123 更新时间:2023-11-28 00:48:36 26 4
gpt4 key购买 nike

ID3D11Device* md3dDevice;
ID3D11DeviceContext* md3dImmediateContext;
D3D_DRIVER_TYPE md3dDriverType = D3D_DRIVER_TYPE_HARDWARE;
HRESULT hr = D3D11CreateDevice(
0,
md3dDriverType,
0,
D3D11_CREATE_DEVICE_DEBUG,
0, 0,
D3D11_SDK_VERSION,
&md3dDevice,
&featureLevel,
&md3dImmediateContext);ID3D11Device* md3dDevice;

当我包含 D3D11_CREATE_DEVICE_DEBUG 标志(没有标志时工作正常)时,我从这个函数中得到一个 e_fail。我认为这与我的调试运行时有关,所以我按照此线程中的说明重新安装了 dx sdk:What can cause D3D11CreateDevice() to fail with E_FAIL?它并没有解决问题。

我还在 dxdiag 中看到零调试级别:

--------------------
DirectX Debug Levels
--------------------
Direct3D: 0/4 (retail)
DirectDraw: 0/4 (retail)
DirectInput: 0/5 (retail)
DirectMusic: 0/5 (retail)
DirectPlay: 0/9 (retail)
DirectSound: 0/5 (retail)
DirectShow: 0/6 (retail)

如有任何帮助,我们将不胜感激。

最佳答案

您通过 "What can cause D3D11CreateDevice() to fail with E_FAIL?" 链接的线程我认为确实包含了您问题的答案。

我引用 Chuck Walbourn 的话:

The latest version of the SDK Debug Layer is not in the legacy DirectX SDK (June 2010) release. You need to install the standalone Windows 8.0 SDK, Visual Studio 2012, or you can just install the VS 2012 Remote Debugging Tools package.

http://blogs.msdn.com/b/chuckw/archive/2013/02/26/directx-11-1-and-windows-7-update.aspx

对我来说,安装 VS 2012 远程调试工具包解决了这个问题!

关于c++ - E_FAIL D3D11CreateDevice,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15180533/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com