Files
UnrealEngineUWP/Engine/Source/Runtime/TimeManagement/Public/GenlockedCustomTimeStep.h
Marcus Wassmer 3b81cf8201 Merging using //UE5/Main_to_//UE5/Release-Engine-Staging @14384769
autoresolved files
#rb none

[CL 14384911 by Marcus Wassmer in ue5-main branch]
2020-09-24 00:43:27 -04:00

40 lines
1.5 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "FixedFrameRateCustomTimeStep.h"
#include "GenlockedCustomTimeStep.generated.h"
/**
* Class to control the Engine Timestep from a Genlock signal.
*/
UCLASS(Abstract)
class TIMEMANAGEMENT_API UGenlockedCustomTimeStep : public UFixedFrameRateCustomTimeStep
{
GENERATED_BODY()
protected:
/** Blocks until it gets a sync signal. Returns false if unsuccessful */
virtual bool WaitForSync() PURE_VIRTUAL(UGenlockedCustomTimeStep::WaitForSync, return false;);
/** Update FApp CurrentTime, IdleTime and DeltaTime */
void UpdateAppTimes(const double& TimeBeforeSync, const double& TimeAfterSync) const;
public:
//~ UFixedFrameRateCustomTimeStep interface
virtual FFrameRate GetFixedFrameRate() const PURE_VIRTUAL(UGenlockedCustomTimeStep::GetFixedFrameRate, return FFrameRate(24,1););
/** Get the sync rate (not always the same as the fixed frame rate) */
virtual FFrameRate GetSyncRate() const { return GetFixedFrameRate(); };
/** Returns how many syncs occurred since the last tick */
virtual uint32 GetLastSyncCountDelta() const PURE_VIRTUAL(UGenlockedCustomTimeStep::GetLastSyncCountDelta, return 1;);
/** Returns true if the Sync related functions will return valid data */
virtual bool IsLastSyncDataValid() const PURE_VIRTUAL(UGenlockedCustomTimeStep::IsLastSyncDataValid, return false;);
/** Returns how many sync counts are expected between ticks*/
virtual uint32 GetExpectedSyncCountDelta() const;
};