Donner SVG 0.8.0
0.8.0 ยท ebf353960.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
UiTextureRegistration.h File Reference

Registering renderer-produced textures with the UI texture registry. More...

Include dependency graph for UiTextureRegistration.h:

Classes

struct  donner::editor::UiTextureBacking
 Runtime handles keeping one UI texture registration's backing reachable. More...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.
namespace  donner::svg
 Donner SVG library, which can load, manipulate and render SVG files.

Functions

bool donner::editor::HasUiTextureRegistry ()
 True when a UI renderer is installed, so a texture registered now will have an identifier draw data can carry.
ImTextureID donner::editor::RegisterUiSnapshotTexture (const svg::RendererTextureSnapshot &snapshot, UiTextureBacking *backing)
 Registers snapshot with the UI texture registry and returns the identifier draw data carries for it, or zero when there is no UI renderer, snapshot is not a backend snapshot, or the registration is refused.
bool donner::editor::RetireUiTexture (ImTextureID texture, UiTextureBacking *backing)
 Retires the registration texture names and transfers backing to the renderer until that exact registration generation is released.

Detailed Description

Registering renderer-produced textures with the UI texture registry.

Function Documentation

◆ HasUiTextureRegistry()

bool donner::editor::HasUiTextureRegistry ( )

True when a UI renderer is installed, so a texture registered now will have an identifier draw data can carry.

Callers that cache textures before the interface exists use this to tell a failed registration apart from there being nothing to register with yet.

◆ RegisterUiSnapshotTexture()

ImTextureID donner::editor::RegisterUiSnapshotTexture ( const svg::RendererTextureSnapshot & snapshot,
UiTextureBacking * backing )

Registers snapshot with the UI texture registry and returns the identifier draw data carries for it, or zero when there is no UI renderer, snapshot is not a backend snapshot, or the registration is refused.

The alpha interpretation comes from the snapshot.

A texture of the device the interface is drawn on is registered directly; one rendered on a different device is registered from the export its producer took, so a snapshot that only borrows a producer's frame target cannot be registered at all.

Parameters
snapshotSnapshot to register.
backingReceives the handles keeping the registration's backing reachable.

◆ RetireUiTexture()

bool donner::editor::RetireUiTexture ( ImTextureID texture,
UiTextureBacking * backing )

Retires the registration texture names and transfers backing to the renderer until that exact registration generation is released.

Returns false without consuming backing when the UI renderer is unavailable or the registry refuses the retirement.

Parameters
textureIdentifier to retire.
backingBacking handles to retain through the registration's retirement window.