2.9.16
Coherent GT
A modern user interface library for games
Coherent::UIGT::UISystemRenderer Class Referenceabstract

Encapsulates the rendering backend of the UI system. More...

#include <Coherent/Coherent/UIGT/UISystem.h>

Public Member Functions

virtual ViewRendererCreateViewRenderer (View *view, NativeRenderTarget nativeTextureTarget, unsigned width, unsigned height, unsigned sampleCount)=0
 Creates a renderer for a View. More...
 
virtual ViewRendererCreateViewRenderer (View *view)=0
 Creates a renderer for a View. Render texture is postponed until rendering. Make sure to use the ViewRenderer::PaintToTexture API. More...
 
virtual void FreeTransientRenderingResources ()=0
 For DirectX only - to allow device reset.
 
virtual bool RecreateTransientRenderingResources ()=0
 For DirectX only - to re-create resources after a reset. More...
 
virtual void BeginRendering ()=0
 Starts a rendering block and sets all needed state. Use this method with EndRendering as an optimization. You can put different ViewRenderer Paint methods and mouse queries in a Begin/End rendering block to minimize state changes. Using those methods is optional.
 
virtual void EndRendering ()=0
 Ends a rendering block.
 
virtual void Destroy ()=0
 Destroys the renderer. More...
 

Detailed Description

Encapsulates the rendering backend of the UI system.

Note
it is safe to call these methods from a rendering thread

Member Function Documentation

◆ CreateViewRenderer() [1/2]

virtual ViewRenderer* Coherent::UIGT::UISystemRenderer::CreateViewRenderer ( View view,
NativeRenderTarget  nativeTextureTarget,
unsigned  width,
unsigned  height,
unsigned  sampleCount 
)
pure virtual

Creates a renderer for a View.

Parameters
viewthe View for which to create a renderer
nativeTextureTargetthe texture where to draw
widththe width of the texture
heightthe height of the texture
sampleCountthe number of samples of the texture when using MSAA. Set to 1 if not using MSAA
Returns
the renderer for this view

◆ CreateViewRenderer() [2/2]

virtual ViewRenderer* Coherent::UIGT::UISystemRenderer::CreateViewRenderer ( View view)
pure virtual

Creates a renderer for a View. Render texture is postponed until rendering. Make sure to use the ViewRenderer::PaintToTexture API.

Parameters
viewthe View for which to create a renderer
Returns
the renderer for this view

◆ Destroy()

virtual void Coherent::UIGT::UISystemRenderer::Destroy ( )
pure virtual

Destroys the renderer.

Note
you can't Paint views after this

◆ RecreateTransientRenderingResources()

virtual bool Coherent::UIGT::UISystemRenderer::RecreateTransientRenderingResources ( )
pure virtual

For DirectX only - to re-create resources after a reset.

Returns
true if recreation succeeded