Files
UnrealEngineUWP/Engine/Source/Runtime/RenderCore/Public/RenderCaptureInterface.h
Juan Canada f084ece316 Fix copyright issues
#rb none
#jira UE-87461

[CL 11112539 by Juan Canada in Main branch]
2020-01-24 23:36:12 -05:00

48 lines
1.7 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Delegates/DelegateCombinations.h"
class FRHICommandListImmediate;
/**
* Interface for registering render capture plugins and capturing with them.
*/
namespace RenderCaptureInterface
{
/** Call from rendering thread code to begin a capture. */
RENDERCORE_API void BeginCapture(FRHICommandListImmediate* RHICommandList, TCHAR const* Name = TEXT(""));
/** Call from rendering thread code to end a block. */
RENDERCORE_API void EndCapture(FRHICommandListImmediate* RHICommandList);
/** Helper for capturing within a scope. */
class FScopedCapture
{
public:
/** Use this constructor if not on rendering thread. Use bEnable to allow control over the capture frequency. */
RENDERCORE_API FScopedCapture(bool bEnable, TCHAR const* Name = TEXT(""));
/** Use this constructor if on rendering thread. Use bEnable to allow control over the capture frequency. */
RENDERCORE_API FScopedCapture(bool bEnable, FRHICommandListImmediate* RHICommandList, TCHAR const* Name = TEXT(""));
RENDERCORE_API ~FScopedCapture();
private:
bool bCapture;
FRHICommandListImmediate* RHICmdList;
};
/**
* Registration code.
* Any capture plugins should register callbacks with this API.
*/
DECLARE_DELEGATE_TwoParams(FOnBeginCaptureDelegate, FRHICommandListImmediate*, TCHAR const*);
DECLARE_DELEGATE_OneParam(FOnEndCaptureDelegate, FRHICommandListImmediate*);
/** Register capture Begin and End delegates. */
RENDERCORE_API void RegisterCallbacks(FOnBeginCaptureDelegate BeginDelegate, FOnEndCaptureDelegate EndDelegate);
/** Unregister capture delegates. */
RENDERCORE_API void UnregisterCallbacks();
}