refactor(RHI): 将窗口职责从RHI移到Platform层

- RHIDeviceDesc 删除 windowHandle/width/height/appName
- SwapChainDesc 添加 windowHandle 字段
- RHISwapChain 删除 PollEvents/ShouldClose/SetFullscreen 等窗口相关接口
- OpenGLDevice 删除 CreateRenderWindow,改用 InitializeWithExistingWindow
- 更新所有集成测试使用新API
- 273个单元测试 + 8个集成测试全部通过
This commit is contained in:
2026-03-24 23:00:49 +08:00
parent 9fae910854
commit 7a66913f2b
22 changed files with 66 additions and 379 deletions

View File

@@ -335,7 +335,7 @@ RHIFence* D3D12Device::CreateFence(const FenceDesc& desc) {
RHISwapChain* D3D12Device::CreateSwapChain(const SwapChainDesc& desc) {
auto* swapChain = new D3D12SwapChain();
HWND hwnd = static_cast<HWND>(m_deviceDesc.windowHandle);
HWND hwnd = static_cast<HWND>(desc.windowHandle);
if (swapChain->Initialize(m_factory.Get(), m_commandQueue.Get(), hwnd,
desc.width, desc.height, desc.bufferCount)) {
return swapChain;