|
slot 0.0.1
A real time UI render framework
|
#include <DX12TextRenderer.h>


Public 成员函数 | |
| DX12TextRenderer (DX12Render *render) | |
| void | Draw (const std::vector< ui::TextNode * > &texts, int bufferIndex, float originX, float originY) |
| void | Init (ID3D12Resource *const buffers[2], DXGI_FORMAT format, float dpiScale) |
| void | PrepareResize () |
| void | Resize (ID3D12Resource *const buffers[2], DXGI_FORMAT format, float dpiScale) |
| void | Shutdown () |
Public 成员函数 继承自 z8::DX12Common | |
| DX12Common (DX12Render *) | |
| virtual | ~DX12Common ()=default |
Private 成员函数 | |
| void | CreateDevices () |
| void | CreateTargets (ID3D12Resource *const buffers[2], DXGI_FORMAT format, float dpiScale) |
| IDWriteTextFormat * | GetFormat (const ui::TextNode &node) |
Private 属性 | |
| ComPtr< ID3D11Device > | D3D11Device |
| ComPtr< ID3D11DeviceContext > | D3D11Context |
| ComPtr< ID3D11On12Device > | D3D11On12Device |
| ComPtr< ID2D1Factory3 > | D2DFactory |
| ComPtr< ID2D1Device2 > | D2DDevice |
| ComPtr< ID2D1DeviceContext2 > | D2DContext |
| ComPtr< IDWriteFactory > | WriteFactory |
| ComPtr< ID3D11Resource > | WrappedBuffers [2] |
| ComPtr< ID2D1Bitmap1 > | Targets [2] |
| std::unordered_map< unsigned, ComPtr< IDWriteTextFormat > > | Formats |
| bool | Initialized = false |
额外继承的成员函数 | |
Public 属性 继承自 z8::DX12Common | |
| DX12Device * | Ctx |
| DX12Render * | Render |
在 DX12 UI 几何之后绘制 DirectWrite 文字的互操作通道。
D3D11On12 只包装当前交换链缓冲,不拥有其生命周期;Resize 前必须释放包装, 绘制后必须 Flush,保证 Direct2D 提交发生在 DX12 Present 之前。
|
explicit |
|
private |

|
private |

| void DX12TextRenderer::Draw | ( | const std::vector< ui::TextNode * > & | texts, |
| int | bufferIndex, | ||
| float | originX, | ||
| float | originY ) |


|
private |

| void DX12TextRenderer::Init | ( | ID3D12Resource *const | buffers[2], |
| DXGI_FORMAT | format, | ||
| float | dpiScale ) |
为任意 WindowSurface 的两个交换链缓冲建立 DirectWrite 包装目标。


| void DX12TextRenderer::PrepareResize | ( | ) |

| void DX12TextRenderer::Resize | ( | ID3D12Resource *const | buffers[2], |
| DXGI_FORMAT | format, | ||
| float | dpiScale ) |


| void DX12TextRenderer::Shutdown | ( | ) |
按 Direct2D → wrapped resource → D3D11On12 的依赖顺序显式释放。

|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |