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