无法创建Direct2D DXGI曲面 [英] Can't create Direct2D DXGI Surface

查看:90
本文介绍了无法创建Direct2D DXGI曲面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在调用此方法:

http://msdn.microsoft.com/zh-cn/library/dd371264(VS.85).aspx

呼叫失败,并显示 E_NOINTERFACE 。该文档对于为什么会发生这种情况尤其无济于事。我已经启用了所有DirectX 11调试功能,这是我所能做到的最好的。我知道我有一个有效的 IDXGISurface1 * (也尝试过 IDXGISurface ),并且其他参数设置正确。关于为什么此调用可能失败的任何想法?

The call fails with E_NOINTERFACE. The documentation is especially unhelpful as to why this may happen. I've enabled all of the DirectX 11 debug stuff and that's the best I got. I know that I have a valid IDXGISurface1* (also tried IDXGISurface) and the other parameters are set correctly. Any ideas as to why this call may fail?

编辑:

我在创建D3D11设备时也遇到了问题。如果我将nullptr作为D3D11CreateDeviceAndSwapChain中的IDXGIAdapter *参数传递,则可以正常工作,但是如果我自己枚举适配器并传递一个指针(返回的唯一指针),则它将失败,并带有无效的参数。 MSDN文档明确指出,如果传递了nullptr,则系统将使用EnumAdapters1的第一个返回值。我正在运行DX11系统。

I also am having problems creating D3D11 devices. If I pass nullptr as the IDXGIAdapter* argument in D3D11CreateDeviceAndSwapChain, it works fine, but if I enumerate the adapters myself and pass in a pointer (the only one returned), it fails with invalid argument. The MSDN documentation explicitly says that if nullptr is passed, then the system uses the first return from EnumAdapters1. I am running a DX11 system.

推荐答案

Direct2D使用D3D10设备而不是D3D11设备。 D3D11设备可能被该E_NOINTERFACE报告为缺少接口。

Direct2D uses D3D10 devices not D3D11 devices. D3D11 device is probably that is reported as lacking interface by that E_NOINTERFACE.

这篇关于无法创建Direct2D DXGI曲面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆