Skip to content

Class UiRenderer

Namespace: Apogee.UI
Assembly: Apogee.UI.dll

Draws what RmlUi hands the host onto the frame's output, as a pass of the render graph: use it as (part of) the of SceneRenderer.Render. RmlUi compiles geometry once and renders it many times; the renderer keeps the compiled vertices and indices in memory and, when a frame is built, packs the geometry that frame draws into per-frame upload buffers (as the ImGui backend does), so nothing on the GPU depends on when RmlUi releases or re-renders a piece of geometry. Textures are images in the bindless heap, and the handle RmlUi holds for one is its bindless index (0 is the white texel that untextured geometry samples).

public sealed class UiRenderer : IRenderOverlay, IDisposable

Inheritance

object ← UiRenderer

Implements

IRenderOverlay, IDisposable

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Constructors

UiRenderer(GraphicsDevice, UiSystem, ShaderLibrary?, string?, int)

public UiRenderer(GraphicsDevice device, UiSystem ui, ShaderLibrary? shaders = null, string? cacheDirectory = null, int framesInFlight = 2)

Parameters

device GraphicsDevice

ui UiSystem

shaders ShaderLibrary?

cacheDirectory string?

framesInFlight int

Properties

GeometryCount

The geometry RmlUi has compiled and not released.

public int GeometryCount { get; }

Property Value

int

LastEffects

What the last frame's effects were: clip mask operations, layers that were pushed, and composites (a filter chain counts once).

public (int Masks, int Layers, int Composites) LastEffects { get; }

Property Value

(int Masks, int Layers, int Composites)

LastFrame

What the last frame drew: calls of RenderGeometry, vertices and triangles packed into the buffers.

public (int Draws, int Vertices, int Triangles) LastFrame { get; }

Property Value

(int Draws, int Vertices, int Triangles)

Shaders

The library the shader comes from (its errors are what the dev overlay shows when an edit does not compile).

public ShaderLibrary Shaders { get; }

Property Value

ShaderLibrary

TextureCount

The textures on the GPU: images of documents and glyph atlases.

public int TextureCount { get; }

Property Value

int

Methods

AddPasses(RenderGraph, ImageHandle, Frame)

Adds the passes that draw onto output, which holds the tone-mapped image by now and is left as it is.

public void AddPasses(RenderGraph graph, ImageHandle output, Frame frame)

Parameters

graph RenderGraph

output ImageHandle

frame Frame

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()