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 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(Text::GlyphCacheArrayGL& glyphCache, const Configuration& configuration) explicit
Construct with a reference to a glyph cache instance.
Shared(Text::GlyphCacheArrayGL&& glyphCache, const Configuration& configuration) explicit
Construct with taking over ownership of a glyph cache instance.
Shared(Text::DistanceFieldGlyphCacheArrayGL& glyphCache, const Configuration& configuration) explicit
Construct with a reference to a distance field glyph cache instance.
Shared(Text::DistanceFieldGlyphCacheArrayGL&& glyphCache, const Configuration& configuration) explicit
Construct with taking over ownership of a distance field glyph cache instance.
Shared(NoCreateT) explicit noexcept
Construct without creating the contents.

Function documentation

Magnum::Ui::TextLayerGL::Shared::Shared(Text::GlyphCacheArrayGL& glyphCache, const Configuration& configuration) explicit

Construct with a reference to a glyph cache instance.

The glyphCache is expected to be in scope for the whole shared instance lifetime. Expects that Configuration::flags() do not contain TextLayerSharedFlag::DistanceField, use the Shared(Text::DistanceFieldGlyphCacheArrayGL&, const Configuration&) constructor in that case instead. Use the Shared(Text::GlyphCacheArrayGL&&, const Configuration&) constructor to make the shared state take over the glyph cache instance.

Magnum::Ui::TextLayerGL::Shared::Shared(Text::GlyphCacheArrayGL&& glyphCache, const Configuration& configuration) explicit

Construct with taking over ownership of a glyph cache instance.

Like Shared(Text::GlyphCacheArrayGL&, const Configuration&), but the shared state takes over the glyph cache ownership. You can access the instance using glyphCache() later, although note that casting the returned Text::AbstractGlyphCache reference to a correct type is user responsibility.

Magnum::Ui::TextLayerGL::Shared::Shared(Text::DistanceFieldGlyphCacheArrayGL& glyphCache, const Configuration& configuration) explicit

Construct with a reference to a distance field glyph cache instance.

Implicitly enables TextLayerSharedFlag::DistanceField, allowing use of additional style options. The glyphCache is expected to be in scope for the whole shared instance lifetime. Use the Shared(Text::DistanceFieldGlyphCacheArrayGL&&, const Configuration&) constructor to make the shared state take over the glyph cache instance.

Magnum::Ui::TextLayerGL::Shared::Shared(Text::DistanceFieldGlyphCacheArrayGL&& glyphCache, const Configuration& configuration) explicit

Construct with taking over ownership of a distance field glyph cache instance.

Like Shared(Text::DistanceFieldGlyphCacheArrayGL&, const Configuration&), but the shared state takes over the glyph cache ownership. You can access the instance using glyphCache() later, although note that casting the returned Text::AbstractGlyphCache reference to a correct type is user responsibility.

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.