![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <UnrealClient.h>
Inheritance diagram for FViewport:Classes | |
| class | FHitProxyMap |
Static Public Member Functions | |
| static ENGINE_API FIntRect | CalculateViewExtents (float AspectRatio, float DesiredAspectRatio, const FIntRect &ViewRect, const FIntPoint &DestSize) |
| static ENGINE_API void | SetGameRenderingEnabled (bool bIsEnabled, int32 PresentAndStopMovieDelay=0) |
| static bool | IsGameRenderingEnabled () |
Static Public Member Functions inherited from FRenderTarget | |
| static float | GetEngineDisplayGamma () |
Public Attributes | |
| FString | AppVersionString |
Static Public Attributes | |
| static ENGINE_API FOnViewportResized | ViewportResizedEvent |
Protected Attributes | |
| FViewportClient * | ViewportClient |
| FHitProxyMap | HitProxyMap |
| TArray< FColor > | CachedHitProxyData |
| FViewportRHIRef | ViewportRHI |
| uint32 | InitialPositionX |
| uint32 | InitialPositionY |
| uint32 | SizeX |
| uint32 | SizeY |
| uint32 | HitProxySize |
| EWindowMode::Type | WindowMode |
| uint32 | bRequiresHitProxyStorage: 1 |
| uint32 | bHitProxiesCached: 1 |
| uint32 | bHasRequestedToggleFreeze: 1 |
| uint32 | bIsPlayInEditorViewport: 1 |
| uint32 | bIsSlateViewport: 1 |
| uint32 | bIsHDR: 1 |
| FName | ViewportType |
| bool | bTakeHighResScreenShot |
Protected Attributes inherited from FRenderTarget | |
| FTextureRHIRef | RenderTargetTextureRHI |
Protected Attributes inherited from FRenderResource | |
| ERenderResourceState | ResourceState = ERenderResourceState::Default |
Static Protected Attributes | |
| static ENGINE_API bool | bIsGameRenderingEnabled = true |
| static int32 | PresentAndStopMovieDelay = 0 |
Additional Inherited Members | |
Protected Types inherited from FRenderResource | |
| enum class | EInitPhase : uint8 { Pre , Default , MAX } |
Static Protected Member Functions inherited from FRenderResource | |
| static RENDERCORE_API FRHICommandListBase & | GetImmediateCommandList () |
| static RENDERCORE_API void | ReleaseRHIForAllResources () |
| static RENDERCORE_API void | InitPreRHIResources () |
| static RENDERCORE_API void | ChangeFeatureLevel (ERHIFeatureLevel::Type NewFeatureLevel) |
| static RENDERCORE_API FName | SetScopeName (FName Name) |
Encapsulates the I/O of a viewport. The viewport display is implemented using the platform independent RHI.
| FViewport::FViewport | ( | FViewportClient * | InViewportClient | ) |
|
virtual |
|
virtual |
Starts a new rendering frame. Called from the rendering thread.
Reimplemented in FDummyViewport, and FSceneViewport.
Calculates the view inside the viewport when the aspect ratio is locked. Used for creating cinematic bars.
| Aspect | [in] ratio to lock to |
| ViewRect | [in] unconstrained view rectangle |
|
static |
Calculates the view inside the viewport when the aspect ratio is locked. Used for creating cinematic bars.
| AspectRatio | [in] ratio to lock to |
| DesiredAspectRatio | [in] the aspect ratio of the viewport |
| ViewRect | [in] unconstrained view rectangle |
| DestSize | [in] the size of the the viewport |
Reimplemented in FSceneViewport.
| FViewport::DECLARE_MULTICAST_DELEGATE_TwoParams | ( | FOnViewportResized | , |
| FViewport * | , | ||
| uint32 | |||
| ) |
delegate type for viewport resize events ( Params: FViewport* Viewport, uint32 )
|
virtual |
Invalidates the viewport's cached hit proxies at the end of the frame.
Reimplemented in FDummyViewport, and FSceneViewport.
Implemented in FDummyViewport.
Updates the viewport's displayed pixels with the results of calling ViewportClient->Draw.
| bShouldPresent | Whether we want this frame to be presented |
|
inlinevirtual |
First chance for viewports to render custom stats text
| InCanvas | - Canvas for rendering |
| InX | - Starting X for drawing |
| InY | - Starting Y for drawing |
|
virtual |
Ends a rendering frame. Called from the rendering thread.
| bPresent | Whether the frame should be presented to the screen |
| bLockToVsync | Whether the GPU should block until VSYNC before presenting |
Reimplemented in FDummyViewport, and FSceneViewport.
Starts a new rendering frame. Called from the game thread thread.
| bShouldPresent | Whether the frame will be presented to the screen |
Starts a new rendering frame. Called from the game thread thread.
Reimplemented in FSceneViewport.
|
virtual |
Ends a rendering frame. Called from the game thread.
| bPresent | Whether the frame should be presented to the screen |
Reimplemented in FSceneViewport.
| void FViewport::EnumerateHitProxiesInRect | ( | FIntRect | InRect, |
| TFunctionRef< bool(HHitProxy *)> | InCallback | ||
| ) |
Enumerate all valid hit proxies found within a specified region. InRect must be entirely within the viewport's client area. If the hit proxies are not cached, this will call ViewportClient->Draw with a hit-testing canvas.
| void FViewport::GetActorsAndModelsInHitProxy | ( | FIntRect | InRect, |
| TSet< AActor * > & | OutActors, | ||
| TSet< UModel * > & | OutModels | ||
| ) |
Returns all actors and models found in the hit proxy within a specified region. InRect must be entirely within the viewport's client area. If the hit proxies are not cached, this will call ViewportClient->Draw with a hit-testing canvas.
|
inline |
Reimplemented in FDummyViewport, and FSceneViewport.
| FTypedElementHandle FViewport::GetElementHandleAtPoint | ( | int32 | X, |
| int32 | Y | ||
| ) |
Returns the dominant element handle at a given point. If X,Y are outside the client area of the viewport, returns an invalid handle.
| void FViewport::GetElementHandlesInRect | ( | FIntRect | InRect, |
| FTypedElementListRef | OutElementHandles | ||
| ) |
Returns all element handles found within a specified region. InRect must be entirely within the viewport's client area. If the hit proxies are not cached, this will call ViewportClient->Draw with a hit-testing canvas.
|
overridevirtual |
Returns the GPU nodes on which to render this viewport.
Reimplemented from FRenderTarget.
Returns the dominant hit proxy at a given point. If X,Y are outside the client area of the viewport, returns NULL. Caution is required as calling Invalidate after this will free the returned HHitProxy.
Copies the hit proxies from an area of the screen into a buffer. InRect must be entirely within the viewport's client area. If the hit proxies are not cached, this will call ViewportClient->Draw with a hit-testing canvas.
|
inline |
|
pure virtual |
Implemented in FDummyViewport, and FSceneViewport.
Implemented in FDummyViewport, and FSceneViewport.
Implemented in FDummyViewport, and FSceneViewport.
Returns dimensions of RenderTarget texture. Can be called on a game thread.
Reimplemented in FSceneViewport.
Implements FRenderTarget.
|
pure virtual |
Retrieves the interface to the viewport's frame, if it has one.
Implemented in FDummyViewport, and FSceneViewport.
|
inline |
Accessors for RHI resources
|
inline |
Implemented in FDummyViewport, and FSceneViewport.
|
inlinevirtual |
Reimplemented in FSceneViewport.
Reimplemented in FSceneViewport.
|
overridevirtual |
Returns if there is a command to freeze
Returns if there is a command to toggle freezing
Reimplemented from FRenderTarget.
|
protected |
Take a high-resolution screenshot and save to disk.
|
overrideprotectedvirtual |
Initializes the RHI resources used by this resource. Called when entering the state where both the resource and the RHI have been initialized. This is only called by the rendering thread.
Reimplemented from FRenderResource.
Reimplemented in FDummyViewport.
| void FViewport::Invalidate | ( | ) |
Invalidates cached hit proxies and the display.
Invalidates the viewport's displayed pixels.
Implemented in FDummyViewport, and FSceneViewport.
| void FViewport::InvalidateHitProxy | ( | ) |
Invalidates cached hit proxies
Returns true if the mouse cursor is currently visible
Reimplemented in FSceneViewport.
Reimplemented in FSceneViewport.
Returns whether rendering is globally enabled or disabled.
|
inline |
Returns true if this viewport should be rendered in HDR
|
inline |
Returns true if the viewport is for play in editor
|
inline |
Returns true if this is an FSlateSceneViewport
Reimplemented in FSceneViewport.
Should return true, if stereo rendering is allowed in this viewport
Reimplemented in FSceneViewport.
Implemented in FDummyViewport, and FSceneViewport.
Reimplemented in FSceneViewport.
|
pure virtual |
Implemented in FDummyViewport, and FSceneViewport.
Implemented in FDummyViewport, and FSceneViewport.
|
overridevirtual |
Handles freezing/unfreezing of rendering
Reimplemented from FRenderTarget.
|
overrideprotectedvirtual |
Releases the RHI resources used by this resource. Called when leaving the state where both the resource and the RHI have been initialized. This is only called by the rendering thread.
Reimplemented from FRenderResource.
|
static |
Globally enables/disables rendering
| bIsEnabled | true if drawing should occur |
| PresentAndStopMovieDelay | Number of frames to delay before enabling bPresent in RHIEndDrawingViewport, and before stopping the movie |
Sets the initial size of this viewport. Will do nothing if the viewport has already been sized
| InitialSizeXY | The initial size of the viewport |
Implemented in FDummyViewport, and FSceneViewport.
Sets this viewport as a play in editor viewport
Sets PreCapture coordinates from the current position of the slate cursor.
Reimplemented in FSceneViewport.
Indicate that the viewport should be block for vsync.
Reimplemented in FSceneViewport.
Reimplemented in FSceneViewport.
Implemented in FDummyViewport, and FSceneViewport.
|
virtual |
Sets a viewport client if one wasn't provided at construction time.
| InViewportClient | - The viewport client to set. |
Reimplemented in FSceneViewport.
Reimplemented in FSceneViewport.
| bool FViewport::TakeHighResScreenShot | ( | ) |
Trigger a high res screenshot. Returns true if the screenshot can be taken, and false if it can't. The screenshot can fail if the requested multiplier makes the screen too big for the GPU to cope with
| void FViewport::UpdateRenderTargetSurfaceRHIToCurrentBackBuffer | ( | ) |
Update the render target surface RHI to the current back buffer
|
protectedvirtual |
Updates the viewport RHI with the current viewport state.
| bDestroyed | - True if the viewport has been destroyed. |
Reimplemented in FSceneViewport.
|
pure virtual |
Transforms a coordinate in the local space of this viewport into a virtual desktop pixel.
| ViewportCoordiante | Normalized coordniate in the rate [0..1]; (0,0) is upper left and (1,1) is lower right. |
Implemented in FDummyViewport, and FSceneViewport.
|
pure virtual |
Transforms a virtual desktop pixel (the origin is in the primary screen's top left corner) to the local space of this viewport
| VirtualDesktopPointPx | Coordinate on the virtual desktop in pixel units. Desktop is considered virtual because multiple monitors are supported. |
Implemented in FDummyViewport, and FSceneViewport.
| FString FViewport::AppVersionString |
The current version of the running instance
|
protected |
If a toggle freeze request has been made
|
protected |
True if the hit proxy buffer buffer has up to date hit proxies for this viewport.
true if we should draw game viewports (has no effect on Editor viewports)
|
protected |
If true this viewport is being displayed on a HDR monitor
|
protected |
if true this viewport is for play in editor
|
protected |
If true this viewport is an FSlateSceneViewport
|
protected |
True if the viewport client requires hit proxy storage.
|
protected |
Triggers the taking of a high res screen shot for this viewport.
|
protected |
The viewport's hit proxy map.
|
protected |
The size of the region to check hit proxies
|
protected |
The initial position of the viewport.
|
protected |
The initial position of the viewport.
|
staticprotected |
Delay in frames to disable present (but still render scene) and stopping of a movie. This is useful to keep playing a movie while driver caches things on the first frame, which can be slow.
|
protected |
The width of the viewport.
|
protected |
The height of the viewport.
|
protected |
The viewport's client.
|
static |
Send when a viewport is resized
|
protected |
The RHI viewport.
|
protected |
Used internally for testing runtime instance type before casting
|
protected |
What is the current window mode.