fix: simplify RenderDocCapture usage with TriggerCapture

- Remove BeginCapture/EndCapture complexity for manual frame capture
- Use TriggerCapture for single frame capture (simpler API)
- Move TriggerCapture before Present to ensure frame is captured
- Add SetForegroundWindow/SetFocus before TriggerCapture
- Remove default capture path in Initialize to allow SetCaptureFilePath to work
This commit is contained in:
2026-03-23 19:40:50 +08:00
parent 067c82c3a9
commit 79422cfddd
3 changed files with 28 additions and 65 deletions

View File

@@ -29,7 +29,6 @@ bool RenderDocCapture::Initialize(void* device, void* window) {
m_api->SetCaptureOptionU32(2, 1);
m_api->SetCaptureOptionU32(8, 1);
m_api->SetCaptureOptionU32(9, 1);
m_api->SetCaptureFilePathTemplate(".\\captures");
m_initialized = true;
Logger::Get().Info(LogCategory::General, "RenderDocCapture initialized successfully");
@@ -176,6 +175,10 @@ void RenderDocCapture::TriggerCapture() {
if (!m_isLoaded || !m_api) {
return;
}
if (m_window) {
SetForegroundWindow((HWND)m_window);
SetFocus((HWND)m_window);
}
m_api->TriggerCapture();
}