// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved. #pragma once #include "Engine/Core/Types/StringView.h" #include "Engine/Scripting/ScriptingType.h" class RenderTask; class SceneRenderTask; class GPUTexture; /// /// The utility class for capturing game screenshots. /// API_CLASS(Static) class FLAXENGINE_API Screenshot { DECLARE_SCRIPTING_TYPE_NO_SPAWN(Screenshot); /// /// Captures the specified render target contents and saves it to the file. /// Remember that downloading data from the GPU may take a while so screenshot may be taken one or more frames later due to latency. /// Staging textures are saved immediately. /// /// The target render target to capture it's contents. /// The custom file location. Use null or empty to use default one. API_FUNCTION() static void Capture(GPUTexture* target, const StringView& path = StringView::Empty); /// /// Captures the specified render task backbuffer contents and saves it to the file. /// Remember that downloading data from the GPU may take a while so screenshot may be taken one or more frames later due to latency. /// /// The target task to capture it's backbuffer. /// The custom file location. Use null or empty to use default one. API_FUNCTION() static void Capture(SceneRenderTask* target = nullptr, const StringView& path = StringView::Empty); /// /// Captures the main render task backbuffer contents and saves it to the file. /// Remember that downloading data from the GPU may take a while so screenshot may be taken one or more frames later due to latency. /// /// The custom file location. Use null or empty to use default one. API_FUNCTION() static void Capture(const StringView& path = StringView::Empty); };