Magnum::Ui::TextLayerGL::Shared class

Shared state for the OpenGL implementation of the text layer.

Contains fonts, shader instances and style data. In order to use the layer it's expected that setGlyphCache() was called and at least one font was added with addFont(). In order to update or draw the layer it's expected that setStyle() was called.

Base classes

class Magnum::Ui::TextLayer::Shared
Shared state for the text layer.

Constructors, destructors, conversion operators

Shared(const Configuration& configuration) explicit
Constructor.
Shared(NoCreateT) explicit noexcept
Construct without creating the contents.

Public functions

auto setGlyphCache(Text::GlyphCacheGL& cache) -> Shared&
Set a glyph cache instance.
auto setGlyphCache(Text::GlyphCacheGL&& cache) -> Shared&
Set a glyph cache instance and take over its ownership.

Function documentation

Magnum::Ui::TextLayerGL::Shared::Shared(NoCreateT) explicit noexcept

Construct without creating the contents.

Doesn't touch any GL state. Move over a created instance to make it useful. Passing a non-created instance to the TextLayerGL constructor has undefined behavior and will likely crash.

Shared& Magnum::Ui::TextLayerGL::Shared::setGlyphCache(Text::GlyphCacheGL& cache)

Set a glyph cache instance.

Returns Reference to self (for method chaining)

Has to be called before any addFont(), is expected to be called exactly once. Use the setGlyphCache(Text::GlyphCacheGL&&) overload to make the shared state take over the glyph cache instance.

Shared& Magnum::Ui::TextLayerGL::Shared::setGlyphCache(Text::GlyphCacheGL&& cache)

Set a glyph cache instance and take over its ownership.

Returns Reference to self (for method chaining)

Like setGlyphCache(Text::GlyphCacheGL&), but the shared state takes over the glyph cache ownership. You can access the instance using glyphCache() later.