Navigation
API > API/Runtime > API/Runtime/Engine
Encapsulates the I/O of a viewport. The viewport display is implemented using the platform independent RHI.
| Name | FViewport |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Public/UnrealClient.h |
| Include Path | #include "UnrealClient.h" |
Syntax
class FViewport :
public FRenderTarget ,
protected FRenderResource
Inheritance Hierarchy
- FRenderTarget → FViewport
- FRenderResource → FViewport
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FViewport
(
FViewportClient* InViewportClient |
Constructor. | UnrealClient.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FViewport() |
Destructor. | UnrealClient.h |
Classes
| Name | Remarks |
|---|---|
| FHitProxyMap | A map from 2D coordinates to cached hit proxies. |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FOnViewportResized | TMulticastDelegate_TwoParams< void, FViewport *, uint32 > | Delegate type for viewport resize events ( Params: FViewport* Viewport, uint32 ) | UnrealClient.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| bIsGameRenderingEnabled | bool | True if we should draw game viewports (has no effect on Editor viewports) | UnrealClient.h |
| PresentAndStopMovieDelay | int32 | Delay in frames to disable present (but still render scene) and stopping of a movie. | UnrealClient.h |
| ViewportResizedEvent | FOnViewportResized | Send when a viewport is resized | UnrealClient.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AppVersionString | FString | The current version of the running instance | UnrealClient.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void BeginRenderFrame
(
FRHICommandListImmediate& RHICmdList |
Starts a new rendering frame. Called from the rendering thread. | UnrealClient.h | |
FIntRect CalculateViewExtents
(
float AspectRatio, |
Calculates the view inside the viewport when the aspect ratio is locked. | UnrealClient.h | |
virtual void CaptureMouse
(
bool bCapture |
UnrealClient.h | ||
virtual void DeferInvalidateHitProxy() |
Invalidates the viewport's cached hit proxies at the end of the frame. | UnrealClient.h | |
void Destroy() |
UnrealClient.h | ||
void Draw
(
bool bShouldPresent |
Updates the viewport's displayed pixels with the results of calling ViewportClient->Draw. | UnrealClient.h | |
virtual int32 DrawStatsHUD
(
FCanvas* InCanvas, |
First chance for viewports to render custom stats text | UnrealClient.h | |
virtual void EndRenderFrame
(
FRHICommandListImmediate& RHICmdList, |
Ends a rendering frame. Called from the rendering thread. | UnrealClient.h | |
virtual void EnqueueBeginRenderFrame
(
const bool bShouldPresent |
Starts a new rendering frame. | UnrealClient.h | |
virtual void EnqueueEndRenderFrame
(
const bool bLockToVsync, |
Ends a rendering frame. Called from the game thread. | UnrealClient.h | |
void EnumerateHitProxiesInRect
(
FIntRect InRect, |
Enumerate all valid hit proxies found within a specified region. | UnrealClient.h | |
void GetActorsAndModelsInHitProxy
(
FIntRect InRect, |
Returns all actors and models found in the hit proxy within a specified region. | UnrealClient.h | |
FViewportClient * GetClient() |
Accessors. | UnrealClient.h | |
virtual FCanvas * GetDebugCanvas() |
UnrealClient.h | ||
virtual float GetDesiredAspectRatio() |
UnrealClient.h | ||
FTypedElementHandle GetElementHandleAtPoint
(
int32 X, |
Returns the dominant element handle at a given point. | UnrealClient.h | |
void GetElementHandlesInRect
(
FIntRect InRect, |
Returns all element handles found within a specified region. | UnrealClient.h | |
HHitProxy * GetHitProxy
(
int32 X, |
Returns the dominant hit proxy at a given point. | UnrealClient.h | |
void GetHitProxyMap
(
FIntRect InRect, |
Copies the hit proxies from an area of the screen into a buffer. | UnrealClient.h | |
FIntPoint GetInitialPositionXY() |
UnrealClient.h | ||
void GetMousePos
(
FIntPoint& MousePosition, |
UnrealClient.h | ||
int32 GetMouseX() |
UnrealClient.h | ||
int32 GetMouseY() |
UnrealClient.h | ||
| UnrealClient.h | |||
virtual FIntPoint GetRenderTargetTextureSizeXY() |
Returns dimensions of RenderTarget texture. Can be called on a game thread. | UnrealClient.h | |
virtual float GetTabletPressure() |
UnrealClient.h | ||
FViewportFrame * GetViewportFrame() |
Retrieves the interface to the viewport's frame, if it has one. | UnrealClient.h | |
const FViewportRHIRef & GetViewportRHI() |
Accessors for RHI resources | UnrealClient.h | |
FName GetViewportType() |
UnrealClient.h | ||
void * GetWindow() |
UnrealClient.h | ||
virtual EWindowMode::Type GetWindowMode() |
UnrealClient.h | ||
virtual bool HasFocus() |
UnrealClient.h | ||
virtual bool HasMouseCapture() |
New MouseCapture/MouseLock API. | UnrealClient.h | |
void Invalidate() |
Invalidates cached hit proxies and the display. | UnrealClient.h | |
void InvalidateDisplay() |
Invalidates the viewport's displayed pixels. | UnrealClient.h | |
void InvalidateHitProxy() |
Invalidates cached hit proxies | UnrealClient.h | |
virtual bool IsCursorVisible() |
Returns true if the mouse cursor is currently visible | UnrealClient.h | |
virtual bool IsExclusiveFullscreen() |
UnrealClient.h | ||
virtual bool IsForegroundWindow() |
UnrealClient.h | ||
virtual bool IsFullscreen() |
UnrealClient.h | ||
bool IsHDRViewport() |
Returns true if this viewport should be rendered in HDR | UnrealClient.h | |
virtual bool IsKeyboardAvailable
(
int32 ControllerID |
UnrealClient.h | ||
virtual bool IsMouseAvailable
(
int32 ControllerID |
UnrealClient.h | ||
virtual bool IsPenActive() |
UnrealClient.h | ||
bool IsPlayInEditorViewport() |
Returns true if the viewport is for play in editor | UnrealClient.h | |
bool IsSlateViewport() |
Returns true if this is an FSlateSceneViewport | UnrealClient.h | |
virtual bool IsSoftwareCursorVisible() |
UnrealClient.h | ||
virtual bool IsStereoRenderingAllowed() |
Should return true, if stereo rendering is allowed in this viewport | UnrealClient.h | |
bool KeyState
(
FKey Key |
UnrealClient.h | ||
virtual void LockMouseToViewport
(
bool bLock |
UnrealClient.h | ||
void MoveWindow
(
int32 NewPosX, |
UnrealClient.h | ||
void ProcessInput
(
float DeltaTime |
UnrealClient.h | ||
void SetHDRMode
(
bool bHDR |
Sets HDR Status of Viewport | UnrealClient.h | |
void SetInitialSize
(
FIntPoint InitialSizeXY |
Sets the initial size of this viewport. Will do nothing if the viewport has already been sized | UnrealClient.h | |
void SetMouse
(
int32 x, |
UnrealClient.h | ||
void SetPlayInEditorViewport
(
bool bInPlayInEditorViewport |
Sets this viewport as a play in editor viewport | UnrealClient.h | |
virtual void SetPreCaptureMousePosFromSlateCursor() |
Sets PreCapture coordinates from the current position of the slate cursor. | UnrealClient.h | |
virtual void SetRequiresVsync
(
bool bShouldVsync |
Indicate that the viewport should be block for vsync. | UnrealClient.h | |
virtual void SetSoftwareCursorPosition
(
FVector2D Position |
UnrealClient.h | ||
bool SetUserFocus
(
bool bFocus |
UnrealClient.h | ||
virtual void SetViewportClient
(
FViewportClient* InViewportClient |
Sets a viewport client if one wasn't provided at construction time. | UnrealClient.h | |
virtual void ShowCursor
(
bool bVisible |
UnrealClient.h | ||
virtual void ShowSoftwareCursor
(
bool bVisible |
UnrealClient.h | ||
bool TakeHighResScreenShot () |
Trigger a high res screenshot. | UnrealClient.h | |
virtual bool UpdateMouseCursor
(
bool bSetCursor |
UnrealClient.h | ||
void UpdateRenderTargetSurfaceRHIToCurrentBackBuffer() |
Update the render target surface RHI to the current back buffer | UnrealClient.h | |
FIntPoint ViewportToVirtualDesktopPixel
(
FVector2D ViewportCoordinate |
Transforms a coordinate in the local space of this viewport into a virtual desktop pixel. | UnrealClient.h | |
FVector2D VirtualDesktopPixelToViewport
(
FIntPoint VirtualDesktopPointPx |
Transforms a virtual desktop pixel (the origin is in the primary screen's top left corner) to the local space of this viewport | UnrealClient.h |
Overridden from FRenderTarget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FRHIGPUMask GetGPUMask
(
FRHICommandListImmediate& RHICmdList |
Returns the GPU nodes on which to render this viewport. | UnrealClient.h | |
virtual FIntPoint GetSizeXY() |
Properties. | UnrealClient.h | |
virtual bool HasToggleFreezeCommand() |
Returns if there is a command to freezeReturns if there is a command to toggle freezing | UnrealClient.h | |
virtual void ProcessToggleFreezeCommand() |
Handles freezing/unfreezing of rendering | UnrealClient.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void HighResScreenshot() |
Take a high-resolution screenshot and save to disk. | UnrealClient.h | |
virtual void UpdateViewportRHI
(
bool bDestroyed, |
Updates the viewport RHI with the current viewport state. | UnrealClient.h |
Overridden from FRenderResource
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void InitRHI
(
FRHICommandListBase& RHICmdList |
UnrealClient.h | ||
virtual void ReleaseRHI() |
UnrealClient.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FIntRect CalculateViewExtents
(
float AspectRatio, |
Calculates the view inside the viewport when the aspect ratio is locked. | UnrealClient.h | |
static bool IsGameRenderingEnabled() |
Returns whether rendering is globally enabled or disabled. | UnrealClient.h | |
static void SetGameRenderingEnabled
(
bool bIsEnabled, |
Globally enables/disables rendering | UnrealClient.h |