Agrarsense
|
#include <UnrealWindow.h>
Public Member Functions | |
FUnrealWindow (int32 Width, int32 Height, FString WindowName="Camera") | |
~FUnrealWindow () | |
void | SetupComponent (UTextureRenderTarget2D *TextureRenderTarget) |
void | ResizeWindow (int32 Width, int32 Height) |
void | DestroyWindow () |
void | UpdateTexture (FTextureResource *Texture) |
void | DrawManually () |
TSharedPtr< FSceneViewport > | GetSceneViewport () |
TSharedPtr< SWindow > | GetSWindow () |
void | SetAutomaticDraw (bool Draw) |
bool | IsDrawing () |
void | AddUWidgetToWindow (UWidget *WidgetToAdd) |
void | RemoveUWidgetFromWindow (UWidget *WidgetToRemove) |
int | GetWindowWidth () |
int | GetWindowHeight () |
Private Member Functions | |
void | OnWindowClosed (const TSharedRef< SWindow > &Window) |
Private Attributes | |
int | WindowWidth = 1280 |
int | WindowHeight = 720 |
int | AddedWidgetCount = 0 |
bool | DrawToScreen = true |
FOnWindowClosed | onWindowClosedDelegate |
TSharedPtr< FUnrealWindowViewportClient > | ViewportClient |
TSharedPtr< SUnrealWindowViewport > | Viewport |
TSharedPtr< FSceneViewport > | SceneViewport |
TSharedPtr< SViewport > | sViewport |
TSharedPtr< SWindow > | sWindow |
TSharedPtr< SOverlay > | FullScreenOverlay |
TArray< FAddedWidgetInfo > | AddedWidgets |
Definition at line 35 of file UnrealWindow.h.
FUnrealWindow::FUnrealWindow | ( | int32 | Width, |
int32 | Height, | ||
FString | WindowName = "Camera" |
||
) |
Create new Unreal Window
width | width of Window |
height | height of Window |
windowName | Window title name |
Definition at line 14 of file UnrealWindow.cpp.
References OnWindowClosed(), onWindowClosedDelegate, ResizeWindow(), SceneViewport, UAgrarsenseSettings::ShouldStartWindowMinimized(), sViewport, sWindow, Viewport, ViewportClient, WindowHeight, and WindowWidth.
FUnrealWindow::~FUnrealWindow | ( | ) |
Definition at line 68 of file UnrealWindow.cpp.
References AddedWidgets, FullScreenOverlay, onWindowClosedDelegate, SceneViewport, sViewport, sWindow, Viewport, and ViewportClient.
void FUnrealWindow::AddUWidgetToWindow | ( | UWidget * | WidgetToAdd | ) |
Add a UWidget to this window.
WidgetToAdd | - The UWidget to add to this window. |
Definition at line 147 of file UnrealWindow.cpp.
References AddedWidgetCount, AddedWidgets, FullScreenOverlay, FAddedWidgetInfo::Index, sWindow, Viewport, and FAddedWidgetInfo::Widget.
void FUnrealWindow::DestroyWindow | ( | ) |
Destroy this Window
Definition at line 124 of file UnrealWindow.cpp.
References sWindow.
Referenced by OnWindowClosed().
void FUnrealWindow::DrawManually | ( | ) |
Definition at line 103 of file UnrealWindow.cpp.
References DrawToScreen, and SceneViewport.
|
inline |
Get FSceneViewport TSharedPtr
Definition at line 83 of file UnrealWindow.h.
References SceneViewport.
|
inline |
Get SWindow TSharedPtr
Definition at line 92 of file UnrealWindow.h.
References sWindow.
|
inline |
Definition at line 138 of file UnrealWindow.h.
References WindowHeight.
|
inline |
Definition at line 133 of file UnrealWindow.h.
References WindowWidth.
|
inline |
Check if this window is currently in the process of drawing to the screen.
Definition at line 115 of file UnrealWindow.h.
References DrawToScreen.
|
private |
On Window closed event from SWindow
Window | Window reference |
Definition at line 119 of file UnrealWindow.cpp.
References DestroyWindow().
Referenced by FUnrealWindow().
void FUnrealWindow::RemoveUWidgetFromWindow | ( | UWidget * | WidgetToRemove | ) |
Remove a UWidget from this window.
WidgetToRemove | - The UWidget to remove from this window. |
Definition at line 188 of file UnrealWindow.cpp.
References AddedWidgets, FullScreenOverlay, and sWindow.
void FUnrealWindow::ResizeWindow | ( | int32 | Width, |
int32 | Height | ||
) |
Resize Window into given size.
width | width of Window |
height | height of Window |
Definition at line 132 of file UnrealWindow.cpp.
References SceneViewport, sWindow, ViewportClient, WindowHeight, and WindowWidth.
Referenced by FUnrealWindow().
|
inline |
Set whether automatic drawing to the screen is enabled. If set to false, you must call DrawManually() whenever you want to draw anything to the window.
draw | - If true, automatic drawing is enabled; if false, manual drawing is required. |
Definition at line 102 of file UnrealWindow.h.
References DrawToScreen, and Viewport.
void FUnrealWindow::SetupComponent | ( | UTextureRenderTarget2D * | TextureRenderTarget | ) |
Setup UTextureRenderTarget2D in order to render to this Window
textureRenderTarget | UTextureRenderTarget2D for rendering into Window |
Definition at line 82 of file UnrealWindow.cpp.
References ViewportClient, WindowHeight, and WindowWidth.
void FUnrealWindow::UpdateTexture | ( | FTextureResource * | Texture | ) |
Definition at line 93 of file UnrealWindow.cpp.
References ViewportClient, WindowHeight, and WindowWidth.
|
private |
Definition at line 154 of file UnrealWindow.h.
Referenced by AddUWidgetToWindow().
|
private |
Definition at line 170 of file UnrealWindow.h.
Referenced by AddUWidgetToWindow(), RemoveUWidgetFromWindow(), and ~FUnrealWindow().
|
private |
Definition at line 156 of file UnrealWindow.h.
Referenced by DrawManually(), IsDrawing(), and SetAutomaticDraw().
|
private |
Definition at line 167 of file UnrealWindow.h.
Referenced by AddUWidgetToWindow(), RemoveUWidgetFromWindow(), and ~FUnrealWindow().
|
private |
Definition at line 158 of file UnrealWindow.h.
Referenced by FUnrealWindow(), and ~FUnrealWindow().
|
private |
Definition at line 163 of file UnrealWindow.h.
Referenced by DrawManually(), FUnrealWindow(), GetSceneViewport(), ResizeWindow(), and ~FUnrealWindow().
|
private |
Definition at line 164 of file UnrealWindow.h.
Referenced by FUnrealWindow(), and ~FUnrealWindow().
|
private |
Definition at line 165 of file UnrealWindow.h.
Referenced by AddUWidgetToWindow(), DestroyWindow(), FUnrealWindow(), GetSWindow(), RemoveUWidgetFromWindow(), ResizeWindow(), and ~FUnrealWindow().
|
private |
Definition at line 161 of file UnrealWindow.h.
Referenced by AddUWidgetToWindow(), FUnrealWindow(), SetAutomaticDraw(), and ~FUnrealWindow().
|
private |
Definition at line 160 of file UnrealWindow.h.
Referenced by FUnrealWindow(), ResizeWindow(), SetupComponent(), UpdateTexture(), and ~FUnrealWindow().
|
private |
Definition at line 152 of file UnrealWindow.h.
Referenced by FUnrealWindow(), GetWindowHeight(), ResizeWindow(), SetupComponent(), and UpdateTexture().
|
private |
Definition at line 151 of file UnrealWindow.h.
Referenced by FUnrealWindow(), GetWindowWidth(), ResizeWindow(), SetupComponent(), and UpdateTexture().