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


Public 成员函数 | |
| DX12WindowSurface (DX12Render *render) | |
| ~DX12WindowSurface () override | |
| void | ApplyViewport () const |
| void | DrawTextAndPresent (const std::vector< ui::TextNode * > &texts, float originX=0.0f, float originY=0.0f) |
| void | Init (HWND window, int width, int height, unsigned sampleCount, unsigned sampleQuality, const DirectX::XMFLOAT4 &clearColor) |
| bool | IsInitialized () const |
| void | PrepareFrame () |
| void | Resize (int width, int height) |
| void | Shutdown () |
Public 成员函数 继承自 z8::DX12Common | |
| DX12Common (DX12Render *) | |
| virtual | ~DX12Common ()=default |
Public 属性 | |
| DX12SwapChain | SwapChain |
| DX12RenderTarget | ColorTarget |
| DX12TextRenderer | TextRenderer |
| D3D12_VIEWPORT | Viewport {} |
| D3D12_RECT | Scissor {} |
| int | Width = 1 |
| int | Height = 1 |
| float | DpiScale = 1.0f |
Public 属性 继承自 z8::DX12Common | |
| DX12Device * | Ctx |
| DX12Render * | Render |
Private 成员函数 | |
| void | RefreshViewport () |
Private 属性 | |
| DirectX::XMFLOAT4 | ClearColor {} |
| unsigned | SampleCount = 1 |
| unsigned | SampleQuality = 0 |
| bool | Initialized = false |
| HWND | Window = nullptr |
一个 HWND 对应的完整颜色呈现表面。
Surface 统一拥有交换链、后备缓冲 RTV、MSAA 颜色纹理和 DirectWrite 包装, 并固化 ResizeBuffers 前后的释放顺序。Command queue、RootSignature 与 PSO 仍由 DX12Render 共享,避免每个 Floating window 重复创建全局设备资源。
|
explicit |
|
override |

| void DX12WindowSurface::ApplyViewport | ( | ) | const |

| void DX12WindowSurface::DrawTextAndPresent | ( | const std::vector< ui::TextNode * > & | texts, |
| float | originX = 0.0f, | ||
| float | originY = 0.0f ) |


| void DX12WindowSurface::Init | ( | HWND | window, |
| int | width, | ||
| int | height, | ||
| unsigned | sampleCount, | ||
| unsigned | sampleQuality, | ||
| const DirectX::XMFLOAT4 & | clearColor ) |


|
inline |

| void DX12WindowSurface::PrepareFrame | ( | ) |


|
private |

调用者需先同步共享命令队列,确保旧尺寸资源不再被 GPU 使用。


| void DX12WindowSurface::Shutdown | ( | ) |


|
private |
| DX12RenderTarget z8::DX12WindowSurface::ColorTarget |
| float z8::DX12WindowSurface::DpiScale = 1.0f |
| int z8::DX12WindowSurface::Height = 1 |
|
private |
|
private |
| D3D12_RECT z8::DX12WindowSurface::Scissor {} |
| DX12SwapChain z8::DX12WindowSurface::SwapChain |
| DX12TextRenderer z8::DX12WindowSurface::TextRenderer |
| D3D12_VIEWPORT z8::DX12WindowSurface::Viewport {} |
| int z8::DX12WindowSurface::Width = 1 |