7#include "Framework/Application/SlateApplication.h"
8#include "Widgets/SWidget.h"
9#include "Blueprint/UserWidget.h"
10#include "Widgets/SOverlay.h"
22 bool SupportMinimize =
false;
24#ifdef EngineAllowRenderingMinimized
27 SupportMinimize =
true;
32 .SupportsMinimize(SupportMinimize)
34 .Title(FText::FromString(WindowName))
35 .ScreenPosition(FVector2D(0, 0))
37 .AutoCenter(EAutoCenter::PreferredWorkArea)
38 .UseOSWindowBorder(
true)
39 .SaneWindowPlacement(
false)
40 .SizingRule(ESizingRule::UserSized);
42#ifdef EngineAllowRenderingMinimized
45 sWindow->AllowRenderingMinimized =
true;
49 FSlateApplication::Get().AddWindow(
sWindow.ToSharedRef());
108 UE_LOG(LogTemp, Warning, TEXT(
"UnrealWindow.cpp: We are already drawing automatically, we should not draw manually!"));
128 sWindow->RequestDestroyWindow();
149 if (!WidgetToAdd || !
sWindow.IsValid())
175 WidgetToAdd->TakeWidget()
180 WidgetInfo.
Widget = WidgetToAdd;
196 int32 WidgetIndexToRemove = -1;
197 for (int32 Index = 0; Index <
AddedWidgets.Num(); ++Index)
201 WidgetIndexToRemove = Index;
206 if (WidgetIndexToRemove != -1)
TSharedPtr< FUnrealWindowViewportClient > ViewportClient
void UpdateTexture(FTextureResource *Texture)
FOnWindowClosed onWindowClosedDelegate
void SetupComponent(UTextureRenderTarget2D *TextureRenderTarget)
TSharedPtr< SUnrealWindowViewport > Viewport
void AddUWidgetToWindow(UWidget *WidgetToAdd)
void OnWindowClosed(const TSharedRef< SWindow > &Window)
TArray< FAddedWidgetInfo > AddedWidgets
FUnrealWindow(int32 Width, int32 Height, FString WindowName="Camera")
void ResizeWindow(int32 Width, int32 Height)
TSharedPtr< SWindow > sWindow
TSharedPtr< FSceneViewport > SceneViewport
TSharedPtr< SViewport > sViewport
TSharedPtr< SOverlay > FullScreenOverlay
void RemoveUWidgetFromWindow(UWidget *WidgetToRemove)
static bool ShouldStartWindowMinimized()