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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user