UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FViewport Class Referenceabstract

#include <UnrealClient.h>

+ Inheritance diagram for FViewport:

Classes

class  FHitProxyMap
 

Public Member Functions

 DECLARE_MULTICAST_DELEGATE_TwoParams (FOnViewportResized, FViewport *, uint32)
 
ENGINE_API FViewport (FViewportClient *InViewportClient)
 
virtual ENGINE_API ~FViewport ()
 
virtual voidGetWindow ()=0
 
virtual void MoveWindow (int32 NewPosX, int32 NewPosY, int32 NewSizeX, int32 NewSizeY)=0
 
virtual void Destroy ()=0
 
virtual bool HasMouseCapture () const
 
virtual bool HasFocus () const
 
virtual bool IsForegroundWindow () const
 
virtual void CaptureMouse (bool bCapture)
 
virtual void LockMouseToViewport (bool bLock)
 
virtual void ShowCursor (bool bVisible)
 
virtual bool UpdateMouseCursor (bool bSetCursor)
 
virtual void ShowSoftwareCursor (bool bVisible)
 
virtual void SetSoftwareCursorPosition (FVector2D Position)
 
virtual bool IsSoftwareCursorVisible () const
 
virtual bool IsCursorVisible () const
 
virtual bool SetUserFocus (bool bFocus)=0
 
virtual bool KeyState (FKey Key) const =0
 
virtual int32 GetMouseX () const =0
 
virtual int32 GetMouseY () const =0
 
virtual void GetMousePos (FIntPoint &MousePosition, const bool bLocalPosition=true)=0
 
virtual float GetTabletPressure ()
 
virtual bool IsPenActive ()
 
virtual void SetMouse (int32 x, int32 y)=0
 
virtual bool IsFullscreen () const
 
virtual bool IsExclusiveFullscreen () const
 
virtual EWindowMode::Type GetWindowMode () const
 
virtual void ProcessInput (float DeltaTime)=0
 
virtual FVector2D VirtualDesktopPixelToViewport (FIntPoint VirtualDesktopPointPx) const =0
 
virtual FIntPoint ViewportToVirtualDesktopPixel (FVector2D ViewportCoordinate) const =0
 
virtual FCanvasGetDebugCanvas ()
 
virtual void SetRequiresVsync (bool bShouldVsync)
 
virtual void SetPreCaptureMousePosFromSlateCursor ()
 
virtual ENGINE_API void EnqueueBeginRenderFrame (const bool bShouldPresent)
 
virtual ENGINE_API void EnqueueEndRenderFrame (const bool bLockToVsync, const bool bShouldPresent)
 
virtual ENGINE_API void BeginRenderFrame (FRHICommandListImmediate &RHICmdList)
 
virtual ENGINE_API void EndRenderFrame (FRHICommandListImmediate &RHICmdList, bool bPresent, bool bLockToVsync)
 
virtual ENGINE_API FRHIGPUMask GetGPUMask (FRHICommandListImmediate &RHICmdList) const override
 
virtual bool IsKeyboardAvailable (int32 ControllerID) const
 
virtual bool IsMouseAvailable (int32 ControllerID) const
 
virtual float GetDesiredAspectRatio () const
 
virtual void InvalidateDisplay ()=0
 
ENGINE_API void Draw (bool bShouldPresent=true)
 
virtual ENGINE_API void DeferInvalidateHitProxy ()
 
ENGINE_API void InvalidateHitProxy ()
 
ENGINE_API void Invalidate ()
 
ENGINE_API const TArray< FColor > & GetRawHitProxyData (FIntRect InRect)
 
ENGINE_API void GetHitProxyMap (FIntRect InRect, TArray< HHitProxy * > &OutMap)
 
ENGINE_API HHitProxyGetHitProxy (int32 X, int32 Y)
 
ENGINE_API void GetActorsAndModelsInHitProxy (FIntRect InRect, TSet< AActor * > &OutActors, TSet< UModel * > &OutModels)
 
ENGINE_API FTypedElementHandle GetElementHandleAtPoint (int32 X, int32 Y)
 
ENGINE_API void GetElementHandlesInRect (FIntRect InRect, FTypedElementListRef OutElementHandles)
 
ENGINE_API void EnumerateHitProxiesInRect (FIntRect InRect, TFunctionRef< bool(HHitProxy *)> InCallback)
 
virtual FViewportFrameGetViewportFrame ()=0
 
ENGINE_API FIntRect CalculateViewExtents (float AspectRatio, const FIntRect &ViewRect)
 
virtual ENGINE_API void SetViewportClient (FViewportClient *InViewportClient)
 
virtual FIntPoint GetSizeXY () const override
 
FIntPoint GetInitialPositionXY () const
 
FViewportClientGetClient () const
 
virtual ENGINE_API void ProcessToggleFreezeCommand () override
 
virtual ENGINE_API bool HasToggleFreezeCommand () override
 
const FViewportRHIRefGetViewportRHI () const
 
void UpdateRenderTargetSurfaceRHIToCurrentBackBuffer ()
 
virtual int32 DrawStatsHUD (FCanvas *InCanvas, const int32 InX, const int32 InY)
 
ENGINE_API void SetInitialSize (FIntPoint InitialSizeXY)
 
bool IsPlayInEditorViewport () const
 
void SetPlayInEditorViewport (bool bInPlayInEditorViewport)
 
bool IsSlateViewport () const
 
bool IsHDRViewport () const
 
void SetHDRMode (bool bHDR)
 
ENGINE_API bool TakeHighResScreenShot ()
 
virtual bool IsStereoRenderingAllowed () const
 
virtual FIntPoint GetRenderTargetTextureSizeXY () const
 
FName GetViewportType () const
 
- Public Member Functions inherited from FRenderTarget
ENGINE_API FRenderTarget ()
 
virtual ENGINE_API ~FRenderTarget ()
 
virtual ENGINE_API const FTextureRHIRefGetRenderTargetTexture () const
 
virtual ENGINE_API FUnorderedAccessViewRHIRef GetRenderTargetUAV () const
 
virtual ENGINE_API FRDGTextureRef GetRenderTargetTexture (FRDGBuilder &GraphBuilder) const
 
virtual ENGINE_API const FTextureRHIRefGetShaderResourceTexture () const
 
virtual ENGINE_API float GetDisplayGamma () const
 
virtual EDisplayColorGamut GetDisplayColorGamut () const
 
virtual EDisplayOutputFormat GetDisplayOutputFormat () const
 
virtual bool GetSceneHDREnabled () const
 
virtual ENGINE_API bool ReadPixels (TArray< FColor > &OutImageData, FReadSurfaceDataFlags InFlags=FReadSurfaceDataFlags(RCM_UNorm, CubeFace_MAX), FIntRect InSrcRect=FIntRect(0, 0, 0, 0))
 
ENGINE_API bool ReadPixelsPtr (FColor *OutImageBytes, FReadSurfaceDataFlags InFlags=FReadSurfaceDataFlags(RCM_UNorm, CubeFace_MAX), FIntRect InSrcRect=FIntRect(0, 0, 0, 0))
 
ENGINE_API bool ReadFloat16Pixels (TArray< FFloat16Color > &OutImageData, ECubeFace CubeFace)
 
virtual ENGINE_API bool ReadFloat16Pixels (TArray< FFloat16Color > &OutImageData, FReadSurfaceDataFlags InFlags=FReadSurfaceDataFlags(RCM_UNorm, CubeFace_MAX), FIntRect InSrcRect=FIntRect(0, 0, 0, 0))
 
virtual ENGINE_API bool ReadLinearColorPixels (TArray< FLinearColor > &OutImageData, FReadSurfaceDataFlags InFlags=FReadSurfaceDataFlags(RCM_MinMax, CubeFace_MAX), FIntRect InSrcRect=FIntRect(0, 0, 0, 0))
 
ENGINE_API bool ReadLinearColorPixelsPtr (FLinearColor *OutImageBytes, FReadSurfaceDataFlags InFlags=FReadSurfaceDataFlags(RCM_MinMax, CubeFace_MAX), FIntRect InSrcRect=FIntRect(0, 0, 0, 0))
 

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 Member Functions

virtual ENGINE_API void UpdateViewportRHI (bool bDestroyed, uint32 NewSizeX, uint32 NewSizeY, EWindowMode::Type NewWindowMode, EPixelFormat PreferredPixelFormat)
 
void HighResScreenshot ()
 
virtual ENGINE_API void ReleaseRHI () override
 
virtual ENGINE_API void InitRHI (FRHICommandListBase &RHICmdList) override
 
- Protected Member Functions inherited from FRenderResource
void SetFeatureLevel (const FStaticFeatureLevel InFeatureLevel)
 
const FStaticFeatureLevel GetFeatureLevel () const
 
bool HasValidFeatureLevel () const
 
template<typename T >
FBufferRHIRef CreateRHIBuffer (FRHICommandListBase &RHICmdList, T &InOutResourceObject, uint32 ResourceCount, EBufferUsageFlags InBufferUsageFlags, const TCHAR *InDebugName)
 
void SetInitPhase (EInitPhase InInitPhase)
 
RENDERCORE_API FRenderResource ()
 
RENDERCORE_API FRenderResource (ERHIFeatureLevel::Type InFeatureLevel)
 
RENDERCORE_API FRenderResource (const FRenderResource &)
 
RENDERCORE_API FRenderResource (FRenderResource &&)
 
RENDERCORE_API FRenderResourceoperator= (const FRenderResource &Other)
 
RENDERCORE_API FRenderResourceoperator= (FRenderResource &&Other)
 
virtual RENDERCORE_API ~FRenderResource ()
 
virtual RENDERCORE_API void InitResource (FRHICommandListBase &RHICmdList)
 
virtual RENDERCORE_API void ReleaseResource ()
 
RENDERCORE_API void UpdateRHI (FRHICommandListBase &RHICmdList)
 
virtual FString GetFriendlyName () const
 
bool IsInitialized () const
 
int32 GetListIndex () const
 
EInitPhase GetInitPhase () const
 
void SetOwnerName (FName InOwnerName)
 
FName GetOwnerName () const
 
void SetResourceName (FName InResourceName)
 
FName GetResourceName () const
 

Protected Attributes

FViewportClientViewportClient
 
FHitProxyMap HitProxyMap
 
TArray< FColorCachedHitProxyData
 
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 FRHICommandListBaseGetImmediateCommandList ()
 
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)
 

Detailed Description

Encapsulates the I/O of a viewport. The viewport display is implemented using the platform independent RHI.

Constructor & Destructor Documentation

◆ FViewport()

FViewport::FViewport ( FViewportClient InViewportClient)

◆ ~FViewport()

FViewport::~FViewport ( )
virtual

Member Function Documentation

◆ BeginRenderFrame()

void FViewport::BeginRenderFrame ( FRHICommandListImmediate RHICmdList)
virtual

Starts a new rendering frame. Called from the rendering thread.

Reimplemented in FDummyViewport, and FSceneViewport.

◆ CalculateViewExtents() [1/2]

FIntRect FViewport::CalculateViewExtents ( float  AspectRatio,
const FIntRect ViewRect 
)

Calculates the view inside the viewport when the aspect ratio is locked. Used for creating cinematic bars.

Parameters
Aspect[in] ratio to lock to
ViewRect[in] unconstrained view rectangle
Returns
constrained view rectangle

◆ CalculateViewExtents() [2/2]

FIntRect FViewport::CalculateViewExtents ( float  AspectRatio,
float  DesiredAspectRatio,
const FIntRect ViewRect,
const FIntPoint DestSize 
)
static

Calculates the view inside the viewport when the aspect ratio is locked. Used for creating cinematic bars.

Parameters
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
Returns
constrained view rectangle

◆ CaptureMouse()

virtual void FViewport::CaptureMouse ( bool  bCapture)
inlinevirtual

Reimplemented in FSceneViewport.

◆ DECLARE_MULTICAST_DELEGATE_TwoParams()

FViewport::DECLARE_MULTICAST_DELEGATE_TwoParams ( FOnViewportResized  ,
FViewport ,
uint32   
)

delegate type for viewport resize events ( Params: FViewport* Viewport, uint32 )

◆ DeferInvalidateHitProxy()

void FViewport::DeferInvalidateHitProxy ( )
virtual

Invalidates the viewport's cached hit proxies at the end of the frame.

Reimplemented in FDummyViewport, and FSceneViewport.

◆ Destroy()

virtual void FViewport::Destroy ( )
pure virtual

Implemented in FDummyViewport.

◆ Draw()

void FViewport::Draw ( bool  bShouldPresent = true)

Updates the viewport's displayed pixels with the results of calling ViewportClient->Draw.

Parameters
bShouldPresentWhether we want this frame to be presented

◆ DrawStatsHUD()

virtual int32 FViewport::DrawStatsHUD ( FCanvas InCanvas,
const int32  InX,
const int32  InY 
)
inlinevirtual

First chance for viewports to render custom stats text

Parameters
InCanvas- Canvas for rendering
InX- Starting X for drawing
InY- Starting Y for drawing
Returns
- Y for next stat drawing

◆ EndRenderFrame()

void FViewport::EndRenderFrame ( FRHICommandListImmediate RHICmdList,
bool  bPresent,
bool  bLockToVsync 
)
virtual

Ends a rendering frame. Called from the rendering thread.

Parameters
bPresentWhether the frame should be presented to the screen
bLockToVsyncWhether the GPU should block until VSYNC before presenting

Reimplemented in FDummyViewport, and FSceneViewport.

◆ EnqueueBeginRenderFrame()

void FViewport::EnqueueBeginRenderFrame ( const bool  bShouldPresent)
virtual

Starts a new rendering frame. Called from the game thread thread.

Parameters
bShouldPresentWhether the frame will be presented to the screen

Starts a new rendering frame. Called from the game thread thread.

Reimplemented in FSceneViewport.

◆ EnqueueEndRenderFrame()

void FViewport::EnqueueEndRenderFrame ( const bool  bLockToVsync,
const bool  bShouldPresent 
)
virtual

Ends a rendering frame. Called from the game thread.

Parameters
bPresentWhether the frame should be presented to the screen

Reimplemented in FSceneViewport.

◆ EnumerateHitProxiesInRect()

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.

◆ GetActorsAndModelsInHitProxy()

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.

◆ GetClient()

FViewportClient * FViewport::GetClient ( ) const
inline

◆ GetDebugCanvas()

virtual FCanvas * FViewport::GetDebugCanvas ( )
inlinevirtual
Returns
A canvas that can be used while this viewport is being drawn to render debug elements on top of everything else

Reimplemented in FDummyViewport, and FSceneViewport.

◆ GetDesiredAspectRatio()

virtual float FViewport::GetDesiredAspectRatio ( ) const
inlinevirtual
Returns
aspect ratio that this viewport should be rendered at

◆ GetElementHandleAtPoint()

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.

◆ GetElementHandlesInRect()

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.

◆ GetGPUMask()

FRHIGPUMask FViewport::GetGPUMask ( FRHICommandListImmediate RHICmdList) const
overridevirtual

Returns the GPU nodes on which to render this viewport.

Reimplemented from FRenderTarget.

◆ GetHitProxy()

HHitProxy * FViewport::GetHitProxy ( int32  X,
int32  Y 
)

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.

◆ GetHitProxyMap()

void FViewport::GetHitProxyMap ( FIntRect  InRect,
TArray< HHitProxy * > &  OutMap 
)

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.

◆ GetInitialPositionXY()

FIntPoint FViewport::GetInitialPositionXY ( ) const
inline

◆ GetMousePos()

virtual void FViewport::GetMousePos ( FIntPoint MousePosition,
const bool  bLocalPosition = true 
)
pure virtual

Implemented in FDummyViewport, and FSceneViewport.

◆ GetMouseX()

virtual int32 FViewport::GetMouseX ( ) const
pure virtual

Implemented in FDummyViewport, and FSceneViewport.

◆ GetMouseY()

virtual int32 FViewport::GetMouseY ( ) const
pure virtual

Implemented in FDummyViewport, and FSceneViewport.

◆ GetRawHitProxyData()

const TArray< FColor > & FViewport::GetRawHitProxyData ( FIntRect  InRect)

◆ GetRenderTargetTextureSizeXY()

virtual FIntPoint FViewport::GetRenderTargetTextureSizeXY ( ) const
inlinevirtual

Returns dimensions of RenderTarget texture. Can be called on a game thread.

Reimplemented in FSceneViewport.

◆ GetSizeXY()

virtual FIntPoint FViewport::GetSizeXY ( ) const
inlineoverridevirtual

Implements FRenderTarget.

◆ GetTabletPressure()

virtual float FViewport::GetTabletPressure ( )
inlinevirtual

◆ GetViewportFrame()

virtual FViewportFrame * FViewport::GetViewportFrame ( )
pure virtual

Retrieves the interface to the viewport's frame, if it has one.

Returns
The viewport's frame interface.

Implemented in FDummyViewport, and FSceneViewport.

◆ GetViewportRHI()

const FViewportRHIRef & FViewport::GetViewportRHI ( ) const
inline

Accessors for RHI resources

◆ GetViewportType()

FName FViewport::GetViewportType ( ) const
inline

◆ GetWindow()

virtual void * FViewport::GetWindow ( )
pure virtual

Implemented in FDummyViewport, and FSceneViewport.

◆ GetWindowMode()

virtual EWindowMode::Type FViewport::GetWindowMode ( ) const
inlinevirtual

◆ HasFocus()

virtual bool FViewport::HasFocus ( ) const
inlinevirtual

Reimplemented in FSceneViewport.

◆ HasMouseCapture()

virtual bool FViewport::HasMouseCapture ( ) const
inlinevirtual

Reimplemented in FSceneViewport.

◆ HasToggleFreezeCommand()

bool FViewport::HasToggleFreezeCommand ( )
overridevirtual

Returns if there is a command to freeze

Returns if there is a command to toggle freezing

Reimplemented from FRenderTarget.

◆ HighResScreenshot()

void FViewport::HighResScreenshot ( )
protected

Take a high-resolution screenshot and save to disk.

◆ InitRHI()

void FViewport::InitRHI ( FRHICommandListBase RHICmdList)
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.

◆ Invalidate()

void FViewport::Invalidate ( )

Invalidates cached hit proxies and the display.

◆ InvalidateDisplay()

virtual void FViewport::InvalidateDisplay ( )
pure virtual

Invalidates the viewport's displayed pixels.

Implemented in FDummyViewport, and FSceneViewport.

◆ InvalidateHitProxy()

void FViewport::InvalidateHitProxy ( )

Invalidates cached hit proxies

◆ IsCursorVisible()

virtual bool FViewport::IsCursorVisible ( ) const
inlinevirtual

Returns true if the mouse cursor is currently visible

Returns
True if the mouse cursor is currently visible, otherwise false.

Reimplemented in FSceneViewport.

◆ IsExclusiveFullscreen()

virtual bool FViewport::IsExclusiveFullscreen ( ) const
inlinevirtual

◆ IsForegroundWindow()

virtual bool FViewport::IsForegroundWindow ( ) const
inlinevirtual

Reimplemented in FSceneViewport.

◆ IsFullscreen()

virtual bool FViewport::IsFullscreen ( ) const
inlinevirtual

◆ IsGameRenderingEnabled()

static bool FViewport::IsGameRenderingEnabled ( )
inlinestatic

Returns whether rendering is globally enabled or disabled.

Returns
true if rendering is globally enabled, otherwise false.

◆ IsHDRViewport()

bool FViewport::IsHDRViewport ( ) const
inline

Returns true if this viewport should be rendered in HDR

◆ IsKeyboardAvailable()

virtual bool FViewport::IsKeyboardAvailable ( int32  ControllerID) const
inlinevirtual
Returns
whether or not this Controller has a keyboard available to be used

◆ IsMouseAvailable()

virtual bool FViewport::IsMouseAvailable ( int32  ControllerID) const
inlinevirtual
Returns
whether or not this Controller has a mouse available to be used

◆ IsPenActive()

virtual bool FViewport::IsPenActive ( )
inlinevirtual

◆ IsPlayInEditorViewport()

bool FViewport::IsPlayInEditorViewport ( ) const
inline

Returns true if the viewport is for play in editor

◆ IsSlateViewport()

bool FViewport::IsSlateViewport ( ) const
inline

Returns true if this is an FSlateSceneViewport

◆ IsSoftwareCursorVisible()

virtual bool FViewport::IsSoftwareCursorVisible ( ) const
inlinevirtual

Reimplemented in FSceneViewport.

◆ IsStereoRenderingAllowed()

virtual bool FViewport::IsStereoRenderingAllowed ( ) const
inlinevirtual

Should return true, if stereo rendering is allowed in this viewport

Reimplemented in FSceneViewport.

◆ KeyState()

virtual bool FViewport::KeyState ( FKey  Key) const
pure virtual

Implemented in FDummyViewport, and FSceneViewport.

◆ LockMouseToViewport()

virtual void FViewport::LockMouseToViewport ( bool  bLock)
inlinevirtual

Reimplemented in FSceneViewport.

◆ MoveWindow()

virtual void FViewport::MoveWindow ( int32  NewPosX,
int32  NewPosY,
int32  NewSizeX,
int32  NewSizeY 
)
pure virtual

Implemented in FDummyViewport, and FSceneViewport.

◆ ProcessInput()

virtual void FViewport::ProcessInput ( float  DeltaTime)
pure virtual

Implemented in FDummyViewport, and FSceneViewport.

◆ ProcessToggleFreezeCommand()

void FViewport::ProcessToggleFreezeCommand ( )
overridevirtual

Handles freezing/unfreezing of rendering

Reimplemented from FRenderTarget.

◆ ReleaseRHI()

void FViewport::ReleaseRHI ( )
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.

◆ SetGameRenderingEnabled()

void FViewport::SetGameRenderingEnabled ( bool  bIsEnabled,
int32  InPresentAndStopMovieDelay = 0 
)
static

Globally enables/disables rendering

Parameters
bIsEnabledtrue if drawing should occur
PresentAndStopMovieDelayNumber of frames to delay before enabling bPresent in RHIEndDrawingViewport, and before stopping the movie

◆ SetHDRMode()

void FViewport::SetHDRMode ( bool  bHDR)
inline

Sets HDR Status of Viewport

◆ SetInitialSize()

void FViewport::SetInitialSize ( FIntPoint  InitialSizeXY)

Sets the initial size of this viewport. Will do nothing if the viewport has already been sized

Parameters
InitialSizeXYThe initial size of the viewport

◆ SetMouse()

virtual void FViewport::SetMouse ( int32  x,
int32  y 
)
pure virtual

Implemented in FDummyViewport, and FSceneViewport.

◆ SetPlayInEditorViewport()

void FViewport::SetPlayInEditorViewport ( bool  bInPlayInEditorViewport)
inline

Sets this viewport as a play in editor viewport

◆ SetPreCaptureMousePosFromSlateCursor()

virtual void FViewport::SetPreCaptureMousePosFromSlateCursor ( )
inlinevirtual

Sets PreCapture coordinates from the current position of the slate cursor.

Reimplemented in FSceneViewport.

◆ SetRequiresVsync()

virtual void FViewport::SetRequiresVsync ( bool  bShouldVsync)
inlinevirtual

Indicate that the viewport should be block for vsync.

Reimplemented in FSceneViewport.

◆ SetSoftwareCursorPosition()

virtual void FViewport::SetSoftwareCursorPosition ( FVector2D  Position)
inlinevirtual

Reimplemented in FSceneViewport.

◆ SetUserFocus()

virtual bool FViewport::SetUserFocus ( bool  bFocus)
pure virtual

Implemented in FDummyViewport, and FSceneViewport.

◆ SetViewportClient()

void FViewport::SetViewportClient ( FViewportClient InViewportClient)
virtual

Sets a viewport client if one wasn't provided at construction time.

Parameters
InViewportClient- The viewport client to set.

◆ ShowCursor()

virtual void FViewport::ShowCursor ( bool  bVisible)
inlinevirtual

Reimplemented in FSceneViewport.

◆ ShowSoftwareCursor()

virtual void FViewport::ShowSoftwareCursor ( bool  bVisible)
inlinevirtual

Reimplemented in FSceneViewport.

◆ TakeHighResScreenShot()

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

◆ UpdateMouseCursor()

virtual bool FViewport::UpdateMouseCursor ( bool  bSetCursor)
inlinevirtual

◆ UpdateRenderTargetSurfaceRHIToCurrentBackBuffer()

void FViewport::UpdateRenderTargetSurfaceRHIToCurrentBackBuffer ( )

Update the render target surface RHI to the current back buffer

◆ UpdateViewportRHI()

void FViewport::UpdateViewportRHI ( bool  bDestroyed,
uint32  NewSizeX,
uint32  NewSizeY,
EWindowMode::Type  NewWindowMode,
EPixelFormat  PreferredPixelFormat 
)
protectedvirtual

Updates the viewport RHI with the current viewport state.

Parameters
bDestroyed- True if the viewport has been destroyed.

Reimplemented in FSceneViewport.

◆ ViewportToVirtualDesktopPixel()

virtual FIntPoint FViewport::ViewportToVirtualDesktopPixel ( FVector2D  ViewportCoordinate) const
pure virtual

Transforms a coordinate in the local space of this viewport into a virtual desktop pixel.

Parameters
ViewportCoordianteNormalized coordniate in the rate [0..1]; (0,0) is upper left and (1,1) is lower right.
Returns
the transformed coordinate. It is in virtual desktop pixels.

Implemented in FDummyViewport, and FSceneViewport.

◆ VirtualDesktopPixelToViewport()

virtual FVector2D FViewport::VirtualDesktopPixelToViewport ( FIntPoint  VirtualDesktopPointPx) const
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

Parameters
VirtualDesktopPointPxCoordinate on the virtual desktop in pixel units. Desktop is considered virtual because multiple monitors are supported.
Returns
The transformed pixel. It is normalized to the range [0, 1]

Implemented in FDummyViewport, and FSceneViewport.

Member Data Documentation

◆ AppVersionString

FString FViewport::AppVersionString

The current version of the running instance

◆ bHasRequestedToggleFreeze

uint32 FViewport::bHasRequestedToggleFreeze
protected

If a toggle freeze request has been made

◆ bHitProxiesCached

uint32 FViewport::bHitProxiesCached
protected

True if the hit proxy buffer buffer has up to date hit proxies for this viewport.

◆ bIsGameRenderingEnabled

bool FViewport::bIsGameRenderingEnabled = true
staticprotected

true if we should draw game viewports (has no effect on Editor viewports)

◆ bIsHDR

uint32 FViewport::bIsHDR
protected

If true this viewport is being displayed on a HDR monitor

◆ bIsPlayInEditorViewport

uint32 FViewport::bIsPlayInEditorViewport
protected

if true this viewport is for play in editor

◆ bIsSlateViewport

uint32 FViewport::bIsSlateViewport
protected

If true this viewport is an FSlateSceneViewport

◆ bRequiresHitProxyStorage

uint32 FViewport::bRequiresHitProxyStorage
protected

True if the viewport client requires hit proxy storage.

◆ bTakeHighResScreenShot

bool FViewport::bTakeHighResScreenShot
protected

Triggers the taking of a high res screen shot for this viewport.

◆ CachedHitProxyData

TArray<FColor> FViewport::CachedHitProxyData
protected

Cached hit proxy data.

◆ HitProxyMap

FHitProxyMap FViewport::HitProxyMap
protected

The viewport's hit proxy map.

◆ HitProxySize

uint32 FViewport::HitProxySize
protected

The size of the region to check hit proxies

◆ InitialPositionX

uint32 FViewport::InitialPositionX
protected

The initial position of the viewport.

◆ InitialPositionY

uint32 FViewport::InitialPositionY
protected

The initial position of the viewport.

◆ PresentAndStopMovieDelay

int32 FViewport::PresentAndStopMovieDelay = 0
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.

◆ SizeX

uint32 FViewport::SizeX
protected

The width of the viewport.

◆ SizeY

uint32 FViewport::SizeY
protected

The height of the viewport.

◆ ViewportClient

FViewportClient* FViewport::ViewportClient
protected

The viewport's client.

◆ ViewportResizedEvent

FViewport::FOnViewportResized FViewport::ViewportResizedEvent
static

Send when a viewport is resized

◆ ViewportRHI

FViewportRHIRef FViewport::ViewportRHI
protected

The RHI viewport.

◆ ViewportType

FName FViewport::ViewportType
protected

Used internally for testing runtime instance type before casting

◆ WindowMode

EWindowMode::Type FViewport::WindowMode
protected

What is the current window mode.


The documentation for this class was generated from the following files: