We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如果要在D3D11 上进行2D绘制, 使用Direct2D将是一个不错的选择,因为D2D就是由D3D实现的,可以实现几乎无缝地交互协同工作. 微软在Direct2D and Direct3D Interoperability Overview中提到了这两种协同:
如同题目所述: 直接协同. 微软在文中是用一种"共享"的办法, 利用D3D 10作为中介让D3D11与D2D协同, 简直太麻烦了. 文中提到
With DirectX 11.1 or later, Direct2D supports interoperability with Direct3D 11 as well.
这里应该指的是版本号而非指特性等级.因为我在Win7的虚拟机(虚拟显卡只支持到10.1)也能够工作. 这里推荐的方法是(使用 Direct2D 1.1, 下面只包括D2D端必要数据)
+--------------+ +--------------+ | | QI | | +--------------> | ID3D11Device*+----------> IDXGIDevice1 | | | | | | | +--------------+ +--+-----------+ | | | | | | +-----------------+ +----+----+ +--------+ +----------------+ v | | | D3D11 | | D2D1.1 +-----> ID2D1Factory1 +----+----->+ ID2D1Device | +---+-----+ +--------+ +----------------+ | | | +-+---------------+ | | | v | +-------------------------+ ++-------------------+ +-------->+ ID3D11Texture2D** | | | +--------------+----------+ | ID2D1DeviceContext | | | | | +--------+-----------+ | QI +---------------+ | +---->+ IDXGISurface +--------------->+ +---------------+ | | v +----------+-----------+ | ID2D1Bitmap1*** | +----------+-----------+ | | v +---------------------+-----------+ | | | ID2D1DeviceContext::SetTarget | | | +---------------------------------+
*: 创建ID3D11Device: 记得D3D11_CREATE_DEVICE_BGRA_SUPPORT **: 创建ID3D11Texture2D: 记得MipLevels=1 ***: ID2D1DeviceContext::CreateBitmapFromDxgiSurface
这样全局可以共享一个ID2D1DeviceContext, 文本所使用的代码在NoteFL/D3D11/D3D11InteropWithD2D/main.cpp 这里,懒得渲染字体什么的了, 画个圈圈意思一下就行:
The text was updated successfully, but these errors were encountered:
dustpg
No branches or pull requests
进行协同
如果要在D3D11 上进行2D绘制, 使用Direct2D将是一个不错的选择,因为D2D就是由D3D实现的,可以实现几乎无缝地交互协同工作.
微软在Direct2D and Direct3D Interoperability Overview中提到了这两种协同:
直接协同
如同题目所述: 直接协同. 微软在文中是用一种"共享"的办法, 利用D3D 10作为中介让D3D11与D2D协同, 简直太麻烦了. 文中提到
这里应该指的是版本号而非指特性等级.因为我在Win7的虚拟机(虚拟显卡只支持到10.1)也能够工作. 这里推荐的方法是(使用 Direct2D 1.1, 下面只包括D2D端必要数据)
*: 创建ID3D11Device: 记得D3D11_CREATE_DEVICE_BGRA_SUPPORT
**: 创建ID3D11Texture2D: 记得MipLevels=1
***: ID2D1DeviceContext::CreateBitmapFromDxgiSurface
这样全局可以共享一个ID2D1DeviceContext, 文本所使用的代码在NoteFL/D3D11/D3D11InteropWithD2D/main.cpp 这里,懒得渲染字体什么的了, 画个圈圈意思一下就行:
The text was updated successfully, but these errors were encountered: