Navigation
API > API/Runtime > API/Runtime/Engine
Inheritance Hierarchy
References
| Module | Engine |
| Header | /Engine/Source/Runtime/Engine/Public/UnrealClient.h |
| Include | #include "UnrealClient.h" |
Syntax
class FViewport :
public FRenderTarget,
protected FRenderResource
Remarks
Encapsulates the I/O of a viewport. The viewport display is implemented using the platform independent RHI.
Variables
| Type | Name | Description | |
|---|---|---|---|
| FString | AppVersionString | The current version of the running instance | |
| uint32: 1 | bHasRequestedToggleFreeze | If a toggle freeze request has been made | |
| uint32: 1 | bHitProxiesCached | True if the hit proxy buffer buffer has up to date hit proxies for this viewport. | |
| uint32: 1 | bIsHDR | If true this viewport is being displayed on a HDR monitor | |
| uint32: 1 | bIsPlayInEditorViewport | If true this viewport is for play in editor | |
| uint32: 1 | bIsSlateViewport | If true this viewport is an FSlateSceneViewport | |
| uint32: 1 | bRequiresHitProxyStorage | True if the viewport client requires hit proxy storage. | |
| bool | bTakeHighResScreenShot | Triggers the taking of a high res screen shot for this viewport. | |
| TArray< FColor > | CachedHitProxyData | Cached hit proxy data. | |
| FHitProxyMap | HitProxyMap | The viewport's hit proxy map. | |
| uint32 | HitProxySize | The size of the region to check hit proxies | |
| uint32 | InitialPositionX | The initial position of the viewport. | |
| uint32 | InitialPositionY | The initial position of the viewport. | |
| uint32 | SizeX | The width of the viewport. | |
| uint32 | SizeY | The height of the viewport. | |
| FViewportClient * | ViewportClient | The viewport's client. | |
| FViewportRHIRef | ViewportRHI | The RHI viewport. | |
| FName | ViewportType | Used internally for testing runtime instance type before casting | |
| EWindowMode::Type | WindowMode | What is the current window mode. |
Constructors
| Type | Name | Description | |
|---|---|---|---|
FViewport
(
FViewportClient* InViewportClient |
Constructor. |
Destructors
| Type | Name | Description | |
|---|---|---|---|
~FViewport () |
Destructor. |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | BeginRenderFrame
(
FRHICommandListImmediate& RHICmdList |
Starts a new rendering frame. Called from the rendering thread. | |
| FIntRect | CalculateViewExtents
(
float AspectRatio, |
Calculates the view inside the viewport when the aspect ratio is locked. | |
| void | CaptureMouse
(
bool bCapture |
||
| void | Invalidates the viewport's cached hit proxies at the end of the frame. | ||
| void | Destroy () |
||
| void | Draw
(
bool bShouldPresent |
Updates the viewport's displayed pixels with the results of calling ViewportClient->Draw. | |
| int32 | DrawStatsHUD
(
FCanvas* InCanvas, |
First chance for viewports to render custom stats text | |
| void | EndRenderFrame
(
FRHICommandListImmediate& RHICmdList, |
Ends a rendering frame. Called from the rendering thread. | |
| void | EnqueueBeginRenderFrame
(
const bool bShouldPresent |
Starts a new rendering frame. | |
| void | EnqueueEndRenderFrame
(
const bool bLockToVsync, |
Ends a rendering frame. Called from the game thread. | |
| void | GetActorsAndModelsInHitProxy
(
FIntRect InRect, |
Returns all actors and models found in the hit proxy within a specified region. | |
| FViewportClient * | GetClient () |
Accessors. | |
| FCanvas * | |||
| float | |||
| FTypedElementHandle | GetElementHandleAtPoint
(
int32 X, |
Returns the dominant element handle at a given point. | |
| void | GetElementHandlesInRect
(
FIntRect InRect, |
Returns all element handles found within a specified region. | |
| HHitProxy * | GetHitProxy
(
int32 X, |
Returns the dominant hit proxy at a given point. | |
| void | GetHitProxyMap
(
FIntRect InRect, |
Copies the hit proxies from an area of the screen into a buffer. | |
| FIntPoint | |||
| void | GetMousePos
(
FIntPoint& MousePosition, |
||
| int32 | GetMouseX () |
||
| int32 | GetMouseY () |
||
| const TArray< FColor > & | GetRawHitProxyData
(
FIntRect InRect |
||
| FIntPoint | Returns dimensions of RenderTarget texture. Can be called on a game thread. | ||
| float | |||
| FViewportFrame * | Retrieves the interface to the viewport's frame, if it has one. | ||
| const FViewportRHIRef & | Accessors for RHI resources | ||
| FName | |||
| void * | GetWindow () |
||
| EWindowMode::Type | |||
| bool | HasFocus () |
||
| bool | New MouseCapture/MouseLock API. | ||
| void | Take a high-resolution screenshot and save to disk. | ||
| void | Invalidate () |
Invalidates cached hit proxies and the display. | |
| void | Invalidates the viewport's displayed pixels. | ||
| void | Invalidates cached hit proxies | ||
| bool | Returns true if the mouse cursor is currently visible | ||
| bool | |||
| bool | |||
| bool | IsFullscreen () |
||
| bool | Returns whether rendering is globally enabled or disabled. | ||
| bool | Returns true if this viewport should be rendered in HDR | ||
| bool | IsKeyboardAvailable
(
int32 ControllerID |
||
| bool | IsMouseAvailable
(
int32 ControllerID |
||
| bool | IsPenActive () |
||
| bool | Returns true if the viewport is for play in editor | ||
| bool | Returns true if this is an FSlateSceneViewport | ||
| bool | |||
| bool | Should return true, if stereo rendering is allowed in this viewport | ||
| bool | |||
| void | LockMouseToViewport
(
bool bLock |
||
| void | MoveWindow
(
int32 NewPosX, |
||
| void | ProcessInput
(
float DeltaTime |
||
| void | SetGameRenderingEnabled
(
bool bIsEnabled, |
Globally enables/disables rendering | |
| void | SetHDRMode
(
bool bHDR |
Sets HDR Status of Viewport | |
| void | SetInitialSize
(
FIntPoint InitialSizeXY |
Sets the initial size of this viewport. Will do nothing if the viewport has already been sized | |
| void | SetMouse
(
int32 x, |
||
| void | SetPlayInEditorViewport
(
bool bInPlayInEditorViewport |
Sets this viewport as a play in editor viewport | |
| void | Sets PreCapture coordinates from the current position of the slate cursor. | ||
| void | SetRequiresVsync
(
bool bShouldVsync |
Indicate that the viewport should be block for vsync. | |
| void | SetSoftwareCursorPosition
(
FVector2D Position |
||
| bool | SetUserFocus
(
bool bFocus |
||
| void | SetViewportClient
(
FViewportClient* InViewportClient |
Sets a viewport client if one wasn't provided at construction time. | |
| void | ShowCursor
(
bool bVisible |
||
| void | ShowSoftwareCursor
(
bool bVisible |
||
| bool | Trigger a high res screenshot. | ||
| bool | UpdateMouseCursor
(
bool bSetCursor |
||
| void | Update the render target surface RHI to the current back buffer | ||
| void | UpdateViewportRHI
(
bool bDestroyed, |
Updates the viewport RHI with the current viewport state. | |
| FIntPoint | ViewportToVirtualDesktopPixel
(
FVector2D ViewportCoordinate |
Transforms a coordinate in the local space of this viewport into a virtual desktop pixel. | |
| 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 |
Overridden from FRenderTarget
| Type | Name | Description | |
|---|---|---|---|
| FRHIGPUMask | GetGPUMask
(
FRHICommandListImmediate& RHICmdList |
Returns the GPU nodes on which to render this viewport. | |
| FIntPoint | GetSizeXY () |
Properties. | |
| bool | Returns if there is a command to freezeReturns if there is a command to toggle freezing | ||
| void | Handles freezing/unfreezing of rendering |
Overridden from FRenderResource
| Type | Name | Description | |
|---|---|---|---|
| void | InitRHI
(
FRHICommandListBase& RHICmdList |
Initializes the RHI resources used by this resource. | |
| void | ReleaseRHI () |
Releases the RHI resources used by this resource. |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FHitProxyMap | A map from 2D coordinates to cached hit proxies. |
Typedefs
| Name | Description |
|---|---|
| FOnViewportResized | Delegate type for viewport resize events ( Params: FViewport* Viewport, uint32 ) |
Constants
| Name | Description |
|---|---|
| bIsGameRenderingEnabled | True if we should draw game viewports (has no effect on Editor viewports) |
| PresentAndStopMovieDelay | Delay in frames to disable present (but still render scene) and stopping of a movie. |
| ViewportResizedEvent | Send when a viewport is resized |