【发布时间】:2016-02-18 12:44:18
【问题描述】:
我有一个用 C# 编写的 Xamarin Forms 应用程序,并使用 DirectX 工具包和对 C++ 的互操作调用。
该应用程序是 Windows 8.1 应用程序,在 Windows 8.1 上运行良好,并且已在我的 Windows 10 计算机上运行。
但有一天,我启动了 Visual Studio 2015 并打算在 Windows 10 上运行该应用程序。它只是不知从哪里崩溃了。我认为 Windows 10 更新可能是问题所在?
无论如何,这里有一些来自 DirectX Tool Kit for Windows8.1 的代码:
ThrowIfFailed(
D3D11CreateDevice(
nullptr, // Specify null to use the default adapter.
D3D_DRIVER_TYPE_HARDWARE,
0,
creationFlags, // Optionally set debug and Direct2D compatibility flags.
featureLevels, // List of feature levels this app can support.
ARRAYSIZE(featureLevels),
D3D11_SDK_VERSION, // Always set this to D3D11_SDK_VERSION for Windows Store apps.
&device, // Returns the Direct3D device created.
NULL, // Returns feature level of device created.
&context // Returns the device immediate context.
)
);
// Get D3D11.1 device
ThrowIfFailed(
device.As(&m_d3dDevice)
);
D3D11CreateDevice 似乎返回 null(设备和上下文) 并且在 device.As(&m_d3dDevice) 中崩溃并且错误消息说可能缺少某些 SDK 组件。
有谁知道问题出在哪里?我必须安装任何 DirectX SDK 吗?为什么我之前可以运行该应用程序?
谢谢!
【问题讨论】:
-
您需要提供准确的错误信息
标签: c++ directx windows-8.1 windows-10 toolkit