new_editor: close legacy d2d host path
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user