engine
 
载入中...
搜索中...
未找到
Public 成员函数 | Protected 属性 | 所有成员列表
FSlateRenderer类 参考abstract

Abstract base class for Slate renderers. 更多...

#include <SlateRenderer.h>

Public 成员函数

virtual void AddWidgetRendererUpdate (const struct FRenderThreadUpdateContext &Context, bool bDeferredRenderTargetUpdate)
 Lets the renderer know that we need to render some widgets to a render target. 更多...
 
virtual bool AreShadersInitialized () const
 Returns whether shaders that Slate depends on have been compiled.
 
virtual void BeginFrame () const
 Indicates the start of a new frame to the Renderer. 更多...
 
virtual bool CanRenderResource (UObject &InResourceObject) const
 The default implementation assumes all things are renderable.
 
virtual void ClearScenes ()=0
 Reset the internal Scene tracking.
 
virtual void CopyWindowsToVirtualScreenBuffer (const TArray< FString > &KeypressBuffer)
 Copies all slate windows out to a buffer at half resolution with debug information like the mouse cursor and any keypresses.
 
virtual FSlateUpdatableTexture * CreateUpdatableTexture (uint32 Width, uint32 Height)=0
 Create an updatable texture that can receive new data dynamically 更多...
 
virtual void CreateViewport (const TSharedRef< SWindow > InWindow)=0
 Creates a rendering viewport 更多...
 
 DECLARE_MULTICAST_DELEGATE_OneParam (FOnPostResizeWindowBackbuffer, void *)
 Called on the game thread right after a window backbuffer has been resized 更多...
 
 DECLARE_MULTICAST_DELEGATE_OneParam (FOnPreResizeWindowBackbuffer, void *)
 Called on the game thread right before a window backbuffer is about to be resized 更多...
 
 DECLARE_MULTICAST_DELEGATE_OneParam (FOnSlateWindowDestroyed, void *)
 Called on the game thread right before the slate window handle is destroyed. 更多...
 
 DECLARE_MULTICAST_DELEGATE_TwoParams (FOnBackBufferReadyToPresent, SWindow &, const FTexture2DRHIRef &)
 Callback on the render thread after slate rendering finishes and right before present is called
 
 DECLARE_MULTICAST_DELEGATE_TwoParams (FOnSlateWindowRendered, SWindow &, void *)
 Callback that fires after Slate has rendered each window, each frame
 
virtual void DrawWindows (FSlateDrawBuffer &InWindowDrawBuffer)=0
 Creates necessary resources to render a window and sends draw commands to the rendering thread 更多...
 
virtual void EndFrame () const
 Indicates the end of the current frame to the Renderer. 更多...
 
virtual void FlushCommands () const
 Gives the renderer a chance to wait for any render commands to be completed before returning/
 
void FlushFontCache (const FString &FlushReason)
 Flushes all cached data from the font cache for the current thread
 
 FSlateRenderer (const TSharedRef< FSlateFontServices > &InSlateFontServices)
 Constructor.
 
virtual FIntPoint GenerateDynamicImageResource (const FName InTextureName)
 Creates a dynamic image resource and returns its size 更多...
 
virtual bool GenerateDynamicImageResource (FName ResourceName, uint32 Width, uint32 Height, const TArray< uint8 > &Bytes)
 Creates a dynamic image resource 更多...
 
virtual int32 GetCurrentSceneIndex () const =0
 Get the currently registered scene index (set by RegisterCurrentScene)
 
virtual FSlateDrawBuffer & GetDrawBuffer ()=0
 Returns a draw buffer that can be used by Slate windows to draw window elements
 
virtual ISlateAtlasProvider * GetFontAtlasProvider ()
 Returns the way to access the font atlas information for this renderer
 
TSharedRef< class FSlateFontCache > GetFontCache () const
 Get the font cache to use for the current thread
 
TSharedRef< class FSlateFontMeasure > GetFontMeasureService () const
 Get access to the font measure service (game thread only!)
 
TSharedRef< FSlateFontServices > GetFontServices () const
 Get access to the font services used by this renderer
 
virtual FCriticalSection * GetResourceCriticalSection ()=0
 Necessary to grab before flushing the resource pool, as it may be being accessed by multiple threads when loading.
 
virtual FSlateResourceHandle GetResourceHandle (const FSlateBrush &Brush)=0
 Creates a handle to a Slate resource A handle is used as fast path for looking up a rendering resource for a given brush when adding Slate draw elements This can be cached and stored safely in code. 更多...
 
virtual ISlateAtlasProvider * GetTextureAtlasProvider ()
 Returns the way to access the texture atlas information for this renderer
 
virtual void * GetViewportResource (const SWindow &Window)
 Returns the viewport rendering resource (backbuffer) for the provided window 更多...
 
virtual void InvalidateAllViewports ()
 Removes references to FViewportRHI's. 更多...
 
bool IsViewportFullscreen (const SWindow &Window) const
 Returns whether or not a viewport should be in fullscreen 更多...
 
virtual void LoadStyleResources (const ISlateStyle &Style)
 Loads all the resources used by the specified SlateStyle
 
virtual void MapVirtualScreenBuffer (FMappedTextureBuffer *OutImageData)
 Allows and disallows access to the crash tracker buffer data on the CPU
 
virtual void OnWindowDestroyed (const TSharedRef< SWindow > &InWindow)=0
 Called when a window is destroyed to give the renderer a chance to free resources
 
virtual void OnWindowFinishReshaped (const TSharedPtr< SWindow > &InWindow)
 Called when a window is finished being reshaped
 
virtual void PrepareToTakeScreenshot (const FIntRect &Rect, TArray< FColor > *OutColorData, SWindow *InScreenshotWindow)
 Prepares the renderer to take a screenshot of the UI. 更多...
 
virtual int32 RegisterCurrentScene (FSceneInterface *Scene)=0
 Register the active scene pointer with the renderer. 更多...
 
virtual void ReleaseAccessedResources (bool bImmediatelyFlush)
 A renderer may need to keep a cache of accessed garbage collectible objects alive for the duration of their usage. 更多...
 
virtual void ReleaseDynamicResource (const FSlateBrush &Brush)=0
 Releases a specific resource. 更多...
 
virtual void ReleaseUpdatableTexture (FSlateUpdatableTexture *Texture)=0
 Return an updatable texture to the renderer for release 更多...
 
virtual void ReloadTextureResources ()
 Reloads all texture resources from disk
 
virtual void RemoveDynamicBrushResource (TSharedPtr< FSlateDynamicImageBrush > BrushToRemove)=0
 Queues a dynamic brush for removal when it is safe. 更多...
 
virtual void RequestResize (const TSharedPtr< SWindow > &InWindow, uint32 NewSizeX, uint32 NewSizeY)=0
 Requests that a rendering viewport be resized 更多...
 
virtual void RestoreSystemResolution (const TSharedRef< SWindow > InWindow)=0
 Restore the given window to the resolution settings currently cached by the engine 更多...
 
virtual void SetColorVisionDeficiencyType (EColorVisionDeficiency Type, int32 Severity, bool bCorrectDeficiency, bool bShowCorrectionWithDeficiency)
 Sets which color vision filter to use
 
virtual void SetSystemResolution (uint32 Width, uint32 Height)=0
 Set the resolution cached by the engine 更多...
 
virtual void SetWindowRenderTarget (const SWindow &Window, class IViewportRenderTargetProvider *Provider)
 Pushes the rendering of the specified window to the specified render target
 
virtual void Sync () const
 Gives the renderer a chance to synchronize with another thread in the event that the renderer runs in a multi-threaded environment. 更多...
 
virtual void UpdateFullscreenState (const TSharedRef< SWindow > InWindow, uint32 OverrideResX=0, uint32 OverrideResY=0)=0
 Sets fullscreen state on the window's rendering viewport 更多...
 
virtual ~FSlateRenderer ()
 Virtual destructor.
 

Protected 属性

FCriticalSection ResourceCriticalSection
 Necessary to grab before flushing the resource pool, as it may be being accessed by multiple threads when loading.
 
TSharedPtr< FSlateFontServices > SlateFontServices
 The font services used by this renderer when drawing text
 
FOnSlateWindowRendered SlateWindowRendered
 Callback that fires after Slate has rendered each window, each frame
 

详细描述

Abstract base class for Slate renderers.

成员函数说明

◆ AddWidgetRendererUpdate()

virtual void FSlateRenderer::AddWidgetRendererUpdate ( const struct FRenderThreadUpdateContext &  Context,
bool  bDeferredRenderTargetUpdate 
)
inlinevirtual

Lets the renderer know that we need to render some widgets to a render target.

参数
ContextThe context that describes what we're rendering to
bDeferredRenderTargetUpdateWhether or not the update is deferred until the end of the frame when it is potentially less expensive to update the render target. See GDeferRetainedRenderingRenderThread for more info. Care must be taken to destroy anything referenced in the context when it is safe to do so.

◆ BeginFrame()

virtual void FSlateRenderer::BeginFrame ( ) const
inlinevirtual

Indicates the start of a new frame to the Renderer.

This is usually handled by the engine loop but certain situations (ie, when the main loop is paused) may require manual calls.

◆ CreateUpdatableTexture()

virtual FSlateUpdatableTexture * FSlateRenderer::CreateUpdatableTexture ( uint32  Width,
uint32  Height 
)
pure virtual

Create an updatable texture that can receive new data dynamically

参数
WidthInitial width of the texture
HeightInitial height of the texture
返回
Newly created updatable texture

◆ CreateViewport()

virtual void FSlateRenderer::CreateViewport ( const TSharedRef< SWindow >  InWindow)
pure virtual

Creates a rendering viewport

参数
InWindowThe window to create the viewport for

◆ DECLARE_MULTICAST_DELEGATE_OneParam() [1/3]

FSlateRenderer::DECLARE_MULTICAST_DELEGATE_OneParam ( FOnPostResizeWindowBackbuffer  ,
void *   
)

Called on the game thread right after a window backbuffer has been resized

参数
Pointerto the API specific backbuffer type

◆ DECLARE_MULTICAST_DELEGATE_OneParam() [2/3]

FSlateRenderer::DECLARE_MULTICAST_DELEGATE_OneParam ( FOnPreResizeWindowBackbuffer  ,
void *   
)

Called on the game thread right before a window backbuffer is about to be resized

参数
Pointerto the API specific backbuffer type

◆ DECLARE_MULTICAST_DELEGATE_OneParam() [3/3]

FSlateRenderer::DECLARE_MULTICAST_DELEGATE_OneParam ( FOnSlateWindowDestroyed  ,
void *   
)

Called on the game thread right before the slate window handle is destroyed.


This gives users a chance to release any viewport specific resources they may have active when the window is destroyed

参数
Pointerto the API specific backbuffer type

◆ DrawWindows()

virtual void FSlateRenderer::DrawWindows ( FSlateDrawBuffer &  InWindowDrawBuffer)
pure virtual

Creates necessary resources to render a window and sends draw commands to the rendering thread

参数
WindowDrawBufferThe buffer containing elements to draw

◆ EndFrame()

virtual void FSlateRenderer::EndFrame ( ) const
inlinevirtual

Indicates the end of the current frame to the Renderer.

This is usually handled by the engine loop but certain situations (ie, when the main loop is paused) may require manual calls.

◆ GenerateDynamicImageResource() [1/2]

virtual FIntPoint FSlateRenderer::GenerateDynamicImageResource ( const FName  InTextureName)
inlinevirtual

Creates a dynamic image resource and returns its size

参数
InTextureNameThe name of the texture resource
返回
The size of the loaded texture

◆ GenerateDynamicImageResource() [2/2]

virtual bool FSlateRenderer::GenerateDynamicImageResource ( FName  ResourceName,
uint32  Width,
uint32  Height,
const TArray< uint8 > &  Bytes 
)
inlinevirtual

Creates a dynamic image resource

参数
ResourceNameThe name of the texture resource
WidthThe width of the resource
HeightThe height of the image
BytesThe payload for the resource
返回
true if the resource was successfully generated, otherwise false

◆ GetResourceHandle()

virtual FSlateResourceHandle FSlateRenderer::GetResourceHandle ( const FSlateBrush &  Brush)
pure virtual

Creates a handle to a Slate resource A handle is used as fast path for looking up a rendering resource for a given brush when adding Slate draw elements This can be cached and stored safely in code.

It will become invalid when a resource is destroyed It is expensive to create a resource so do not do it in time sensitive areas

参数
BrushThe brush to get a rendering resource handle
返回
The created resource handle.

◆ GetViewportResource()

virtual void * FSlateRenderer::GetViewportResource ( const SWindow &  Window)
inlinevirtual

Returns the viewport rendering resource (backbuffer) for the provided window

参数
WindowThe window to get the viewport from

◆ InvalidateAllViewports()

virtual void FSlateRenderer::InvalidateAllViewports ( )
inlinevirtual

Removes references to FViewportRHI's.


This has to be done explicitly instead of using the FRenderResource mechanism because FViewportRHI's are managed by the game thread. This is needed before destroying the RHI device.

◆ IsViewportFullscreen()

bool FSlateRenderer::IsViewportFullscreen ( const SWindow &  Window) const

Returns whether or not a viewport should be in fullscreen

@Window The window to check for fullscreen

返回
true if the window's viewport should be fullscreen

◆ PrepareToTakeScreenshot()

virtual void FSlateRenderer::PrepareToTakeScreenshot ( const FIntRect &  Rect,
TArray< FColor > *  OutColorData,
SWindow *  InScreenshotWindow 
)
inlinevirtual

Prepares the renderer to take a screenshot of the UI.

The Rect is portion of the rendered output that will be stored into the TArray of FColors.

◆ RegisterCurrentScene()

virtual int32 FSlateRenderer::RegisterCurrentScene ( FSceneInterface *  Scene)
pure virtual

Register the active scene pointer with the renderer.

This will return the scene internal index that will be used for all subsequent elements drawn.

◆ ReleaseAccessedResources()

virtual void FSlateRenderer::ReleaseAccessedResources ( bool  bImmediatelyFlush)
inlinevirtual

A renderer may need to keep a cache of accessed garbage collectible objects alive for the duration of their usage.

During some operations like ending a game. It becomes important to immediately release game related resources. This should flush any buffer holding onto those referenced objects.

◆ ReleaseDynamicResource()

virtual void FSlateRenderer::ReleaseDynamicResource ( const FSlateBrush &  Brush)
pure virtual

Releases a specific resource.


It is unlikely that you want to call this directly. Use RemoveDynamicBrushResource instead

◆ ReleaseUpdatableTexture()

virtual void FSlateRenderer::ReleaseUpdatableTexture ( FSlateUpdatableTexture *  Texture)
pure virtual

Return an updatable texture to the renderer for release

参数
TextureThe texture we are releasing (should not use this pointer after calling)

◆ RemoveDynamicBrushResource()

virtual void FSlateRenderer::RemoveDynamicBrushResource ( TSharedPtr< FSlateDynamicImageBrush >  BrushToRemove)
pure virtual

Queues a dynamic brush for removal when it is safe.

The brush is not immediately released but you should consider the brush destroyed and no longer usable

参数
BrushToRemoveThe brush to queue for removal which is no longer valid to use

◆ RequestResize()

virtual void FSlateRenderer::RequestResize ( const TSharedPtr< SWindow > &  InWindow,
uint32  NewSizeX,
uint32  NewSizeY 
)
pure virtual

Requests that a rendering viewport be resized

参数
WindowThe window to resize
WidthThe new width of the window
HeightThe new height of the window

◆ RestoreSystemResolution()

virtual void FSlateRenderer::RestoreSystemResolution ( const TSharedRef< SWindow >  InWindow)
pure virtual

Restore the given window to the resolution settings currently cached by the engine

参数
InWindow-> The window to restore to the cached settings

◆ SetSystemResolution()

virtual void FSlateRenderer::SetSystemResolution ( uint32  Width,
uint32  Height 
)
pure virtual

Set the resolution cached by the engine

参数
WidthWidth of the system resolution
HeightHeight of the system resolution

◆ Sync()

virtual void FSlateRenderer::Sync ( ) const
inlinevirtual

Gives the renderer a chance to synchronize with another thread in the event that the renderer runs in a multi-threaded environment.

This function does not return until the sync is complete

◆ UpdateFullscreenState()

virtual void FSlateRenderer::UpdateFullscreenState ( const TSharedRef< SWindow >  InWindow,
uint32  OverrideResX = 0,
uint32  OverrideResY = 0 
)
pure virtual

Sets fullscreen state on the window's rendering viewport

参数
InWindowThe window to update fullscreen state on
OverrideResX0 if no override
OverrideResY0 if no override

该类的文档由以下文件生成: