Fix window handle retrieval in frame capture system. (#1073)
Capturing screenshots via hydra should work now.
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include <Atom/RPI.Public/Pass/PassFilter.h>
|
||||
#include <Atom/RPI.Public/Pass/RenderPass.h>
|
||||
#include <Atom/RPI.Public/Pass/Specific/SwapChainPass.h>
|
||||
#include <Atom/RPI.Public/ViewportContextManager.h>
|
||||
|
||||
#include <Atom/Utils/DdsFile.h>
|
||||
#include <Atom/Utils/PpmFile.h>
|
||||
@@ -289,11 +290,7 @@ namespace AZ
|
||||
|
||||
bool FrameCaptureSystemComponent::CaptureScreenshot(const AZStd::string& filePath)
|
||||
{
|
||||
AzFramework::NativeWindowHandle windowHandle = nullptr;
|
||||
AzFramework::WindowSystemRequestBus::BroadcastResult(
|
||||
windowHandle,
|
||||
&AzFramework::WindowSystemRequestBus::Events::GetDefaultWindowHandle);
|
||||
|
||||
AzFramework::NativeWindowHandle windowHandle = AZ::RPI::ViewportContextRequests::Get()->GetDefaultViewportContext()->GetWindowHandle();
|
||||
if (windowHandle)
|
||||
{
|
||||
return CaptureScreenshotForWindow(filePath, windowHandle);
|
||||
|
||||
Reference in New Issue
Block a user