FSlateRenderer

Abstract base class for Slate renderers.

Windows
MacOS
Linux

References

Module

SlateCore

Header

/Engine/Source/Runtime/SlateCore/Public/Rendering/SlateRenderer.h

Include

#include "Rendering/SlateRenderer.h"

Syntax

class FSlateRenderer

Remarks

Abstract base class for Slate renderers.

Variables

Name Description

Protected variable

FOnBackBufferRe...

 

OnBackBufferReadyToPresentDelegate

Protected variable

FOnSlateWindowD...

 

OnSlateWindowDestroyedDelegate

Protected variable

FOnPostResizeWi...

 

PostResizeBackBufferDelegate

Protected variable

FOnPreResizeWin...

 

PreResizeBackBufferDelegate

Protected variable

FCriticalSectio...

 

ResourceCriticalSection

Necessary to grab before flushing the resource pool, as it may be being accessed by multiple threads when loading.

Protected variable

TSharedPtr< FSl...

 

SlateFontServices

The font services used by this renderer when drawing text

Protected variable

FOnSlateWindowR...

 

SlateWindowRendered

Callback that fires after Slate has rendered each window, each frame

Constructors

Name Description

Public function

FSlateRenderer

(
    const TSharedRef< FSlateFontService...
)

Constructor.

Destructors

Name Description

Public function Virtual

~FSlateRenderer()

Virtual destructor.

Functions

Name Description

Public function Virtual

void

 

AddWidgetRendererUpdate

(
    const FRenderThreadUpdateContext& ...,
    bool bDeferredRenderTargetUpdate
)

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

Public function Virtual Const

bool

 

AreShadersInitialized()

Returns whether shaders that Slate depends on have been compiled.

Public function Virtual Const

void

 

BeginFrame()

Indicates the start of a new frame to the Renderer.

Public function Virtual Const

bool

 

CanRenderResource

(
    UObject& InResourceObject
)

The default implementation assumes all things are renderable.

Public function

void

 

ClearScenes()

Reset the internal Scene tracking.

Public function Virtual

void

 

CopyWindowsToVirtualScreenBuffer

(
    const TArray< FString >& KeypressB...
)

Copies all slate windows out to a buffer at half resolution with debug information like the mouse cursor and any keypresses.

Public function

FSlateUpdata...

 

CreateUpdatableTexture

(
    uint32 Width,
    uint32 Height
)

Create an updatable texture that can receive new data dynamically

Public function

void

 

CreateViewport

(
    const TSharedRef< SWindow > InWindo...
)

Creates a rendering viewport

Public function

void

 

Destroy()

Public function Virtual

void

 

DestroyCachedFastPathElementData

(
    FSlateCachedElementData* Eleme...
)

Public function Virtual

void

 

DestroyCachedFastPathRenderingData

Public function

void

 

DrawWindows

(
    FSlateDrawBuffer& InWindowDrawBuff...
)

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

Public function Virtual Const

void

 

EndFrame()

Indicates the end of the current frame to the Renderer.

Public function Virtual Const

void

 

FlushCommands()

Gives the renderer a chance to wait for any render commands to be completed before returning/

Public function

void

 

FlushFontCache

(
    const FString& FlushReason
)

Flushes all cached data from the font cache for the current thread

Public function Virtual

FIntPoint

 

GenerateDynamicImageResource

(
    const FName InTextureName
)

Creates a dynamic image resource and returns its size

Public function Virtual

bool

 

GenerateDynamicImageResource

(
    FName ResourceName,
    FSlateTextureDataRef TextureData
)

Public function Virtual

bool

 

GenerateDynamicImageResource

(
    FName ResourceName,
    uint32 Width,
    uint32 Height,
    const TArray< uint8 >& Bytes
)

Creates a dynamic image resource

Public function Const

int32

 

GetCurrentSceneIndex()

Get the currently registered scene index (set by RegisterCurrentScene)

Public function

FSlateDrawBu...

 

GetDrawBuffer()

Returns a draw buffer that can be used by Slate windows to draw window elements

Public function Virtual

ISlateAtlasP...

 

GetFontAtlasProvider()

Returns the way to access the font atlas information for this renderer

Public function Const

TSharedRef< ...

 

GetFontCache()

Get the font cache to use for the current thread

Public function Const

TSharedRef< ...

 

GetFontMeasureService()

Get access to the font measure service (game thread only!)

Public function Const

TSharedRef< ...

 

GetFontServices()

Get access to the font services used by this renderer

Public function

FCriticalSec...

 

GetResourceCriticalSection()

Necessary to grab before flushing the resource pool, as it may be being accessed by multiple threads when loading.

Public function

FSlateResour...

 

GetResourceHandle

(
    const FSlateBrush& Brush
)

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.

Public function Virtual

ISlateAtlasP...

 

GetTextureAtlasProvider()

Returns the way to access the texture atlas information for this renderer

Public function Virtual

void *

 

GetViewportResource

(
    const SWindow& Window
)

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

Public function Virtual Const

bool

 

HasLostDevice()

Public function

bool

 

Initialize()

Public function Virtual

void

 

InvalidateAllViewports()

Removes references to FViewportRHI's.

Public function Const

bool

 

IsViewportFullscreen

(
    const SWindow& Window
)

Returns whether or not a viewport should be in fullscreen

The window to check for fullscreen

Public function Virtual

void

 

LoadStyleResources

(
    const ISlateStyle& Style
)

Loads all the resources used by the specified SlateStyle

Public function Virtual

void

 

MapVirtualScreenBuffer

(
    FMappedTextureBuffer* OutImage...
)

Allows and disallows access to the crash tracker buffer data on the CPU

Public function

FOnBackBuffe...

 

OnBackBufferReadyToPresent()

Public function

FOnPostResiz...

 

OnPostResizeWindowBackBuffer()

Public function

FOnPreResize...

 

OnPreResizeWindowBackBuffer()

Public function

FOnSlateWind...

 

OnSlateWindowDestroyed()

Public function

FOnSlateWind...

 

OnSlateWindowRendered()

Public function

void

 

OnWindowDestroyed

(
    const TSharedRef< SWindow >& InWin...
)

Called when a window is destroyed to give the renderer a chance to free resources

Public function Virtual

void

 

OnWindowFinishReshaped

(
    const TSharedPtr< SWindow >& InWin...
)

Called when a window is finished being reshaped

Public function Virtual

void

 

PrepareToTakeScreenshot

(
    const FIntRect& Rect,
    TArray< FColor >* OutColorData
)

Prepares the renderer to take a screenshot of the UI.

Public function

int32

 

RegisterCurrentScene

(
    FSceneInterface* Scene
)

Register the active scene pointer with the renderer.

Public function 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.

Public function

void

 

ReleaseDynamicResource

(
    const FSlateBrush& Brush
)

Releases a specific resource.

Public function

void

 

ReleaseUpdatableTexture

(
    FSlateUpdatableTexture* Textur...
)

Return an updatable texture to the renderer for release

Public function Virtual

void

 

ReloadTextureResources()

Reloads all texture resources from disk

Public function

void

 

RemoveDynamicBrushResource

Queues a dynamic brush for removal when it is safe.

Public function

void

 

RequestResize

(
    const TSharedPtr< SWindow >& InWin...,
    uint32 NewSizeX,
    uint32 NewSizeY
)

Requests that a rendering viewport be resized

Public function

void

 

RestoreSystemResolution

(
    const TSharedRef< SWindow > InWindo...
)

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

Public function Virtual

void

 

SetColorVisionDeficiencyType

(
    EColorVisionDeficiency Type,
    int32 Severity,
    bool bCorrectDeficiency,
    bool bShowCorrectionWithDeficiency
)

Sets which color vision filter to use

Public function

void

 

SetSystemResolution

(
    uint32 Width,
    uint32 Height
)

Set the resolution cached by the engine

Public function Virtual

void

 

SetWindowRenderTarget

(
    const SWindow& Window,
    IViewportRenderTargetProvider*...
)

Pushes the rendering of the specified window to the specified render target

Public function Virtual Const

void

 

Sync()

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

Public function Virtual

void

 

UnmapVirtualScreenBuffer()

Public function

void

 

UpdateFullscreenState

(
    const TSharedRef< SWindow > InWindo...,
    uint32 OverrideResX,
    uint32 OverrideResY
)

Sets fullscreen state on the window's rendering viewport

Typedefs

Name

Description

FOnBackBufferReadyToPresent

Callback on the render thread after slate rendering finishes and right before present is called

FOnPostResizeWindowBackbuffer

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

FOnPreResizeWindowBackbuffer

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

FOnSlateWindowDestroyed

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

FOnSlateWindowRendered

Callback that fires after Slate has rendered each window, each frame

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss