I3DHDebugStreamOverlay.h Source File

instant3Dhub: I3DHDebugStreamOverlay.h Source File
instant3Dhub
I3DHDebugStreamOverlay.h
Go to the documentation of this file.
1
6#pragma once
7
8#include "CoreMinimal.h"
9
10#include "Engine/Texture2D.h"
11#include "GameFramework/Actor.h"
12#include "Widgets/Layout/SConstraintCanvas.h"
13
14#include "I3DHDebugStreamOverlay.generated.h"
15
16enum class EI3DHDebugStreamOverlayMode
17{
18 Fullscreen,
19 Translucent,
20 PictureInPicture,
21 COUNT
22};
23
24UCLASS()
25class AI3DHDebugStreamOverlay : public AActor
26{
27 GENERATED_BODY()
28
29public:
30 AI3DHDebugStreamOverlay();
31 virtual ~AI3DHDebugStreamOverlay() override;
32
33private:
34 struct FSlateImageBrush* GetImageBrush();
35
36protected:
37 virtual void BeginPlay() override;
38 virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
39
40public:
41 bool IsEnabled()
42 {
43 return bEnabled;
44 }
45
46 void SetEnabled(bool bInEnabled)
47 {
48 bLayoutDirty = true;
49 bEnabled = bInEnabled;
50 }
51
52 EI3DHDebugStreamOverlayMode GetMode()
53 {
54 return Mode;
55 }
56
57 void SetMode(EI3DHDebugStreamOverlayMode InMode)
58 {
59 bLayoutDirty = true;
60 Mode = InMode;
61 }
62
63 void SetTexture(UTexture2D* Texture);
64
65public:
66 virtual void Tick(float DeltaTime) override;
67
68private:
69 void UpdateWidgetComponent();
70 void UpdateLayout();
71
72private:
73 bool bRenderInWorldSpace = false;
74 bool bLayoutDirty = false;
75 bool bEnabled = true;
76 EI3DHDebugStreamOverlayMode Mode = EI3DHDebugStreamOverlayMode::Fullscreen;
77
78 TSharedPtr<struct FSlateImageBrush> ImageBrushInternal; // Use GetImageBrush() to access.
79 TSharedPtr<class SImage> ImageWidget;
80
81 // Screen space rendering.
83 SConstraintCanvas::FSlot* ImageSlot = nullptr;
84
85protected:
86 // World space rendering.
87 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components")
88 TObjectPtr<class UWidgetComponent> WidgetComponent;
89
90 UPROPERTY(EditAnywhere, Category = "Display Settings")
91 float CameraDistance = 100.0f;
92};