无法创建 Direct2D DXGI 曲面
我正在调用此方法:
http://msdn.microsoft .com/en-us/library/dd371264(VS.85).aspx
调用失败,并显示 E_NOINTERFACE
。该文档对于为什么会发生这种情况特别没有帮助。我已经启用了所有 DirectX 11 调试功能,这是我得到的最好的结果。我知道我有一个有效的 IDXGISurface1*
(也尝试过 IDXGISurface
)并且其他参数设置正确。关于为什么此调用可能失败的任何想法?
编辑:
我在创建 D3D11 设备时也遇到问题。如果我在 D3D11CreateDeviceAndSwapChain 中将 nullptr 作为 IDXGIAdapter* 参数传递,则它可以正常工作,但如果我自己枚举适配器并传入一个指针(唯一返回的指针),则它会因参数无效而失败。 MSDN 文档明确指出,如果传递 nullptr,则系统使用 EnumAdapters1 的第一个返回值。我正在运行 DX11 系统。
I'm calling this method:
http://msdn.microsoft.com/en-us/library/dd371264(VS.85).aspx
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?
Edit:
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Direct2D 仅在您创建 Direct3D 10.1 设备时才起作用,但它可以与 Direct3D 11 共享表面。您所需要做的就是创建这两个设备并将所有 Direct2D 内容渲染到您之间共享的纹理他们。我在自己的应用程序中使用此技术,将 Direct2D 与 Direct3D 11 结合使用。它会产生少量成本,但每帧成本很小且恒定。
您需要使用的过程的基本概要是:
这并不简单,但效果很好,而且这也是他们希望您在它们之间进行互操作的方式。 Windows 8 看起来将引入完整的 D3D11 兼容性,因此它会像您期望的那样简单。
Direct2D only works when you create a Direct3D 10.1 device, but it can share surfaces with Direct3D 11. All you need to do is create both devices and render all of your Direct2D content to a texture that you share between them. I use this technique in my own applications to use Direct2D with Direct3D 11. It incurs a slight cost, but it is small and constant per frame.
A basic outline of the process you will need to use is:
It's not trivial, but it works well, and it is the way that they intended you to interoperate between them. Windows 8 looks like it will introduce full D3D11 compatibility, so it will be just as simple as you expect.
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.