new_editor: close legacy d2d host path

This commit is contained in:
2026-04-22 02:14:26 +08:00
parent 35e7602eb8
commit 36c4ae414b
19 changed files with 876 additions and 1894 deletions

View File

@@ -66,7 +66,8 @@ D3D12WindowRenderLoopResizeResult D3D12WindowRenderLoop::ApplyResize(UINT width,
}
D3D12WindowRenderLoopPresentResult D3D12WindowRenderLoop::Present(
const ::XCEngine::UI::UIDrawData& drawData) const {
const ::XCEngine::UI::UIDrawData& drawData,
const std::filesystem::path* captureOutputPath) {
D3D12WindowRenderLoopPresentResult result = {};
if (m_uiRenderer == nullptr) {
result.warning = "window render loop has no ui renderer.";
@@ -127,6 +128,17 @@ D3D12WindowRenderLoopPresentResult D3D12WindowRenderLoop::Present(
return result;
}
if (captureOutputPath != nullptr) {
std::string captureError = {};
if (!m_windowRenderer->CaptureCurrentBackBufferToPng(*captureOutputPath, captureError)) {
result.captureError = captureError.empty()
? "failed to capture the current D3D12 back buffer."
: std::move(captureError);
} else {
result.captureSucceeded = true;
}
}
if (!m_windowRenderer->PresentFrame()) {
const std::string& error = m_windowRenderer->GetLastError();
result.warning = error.empty()