Magnum::Ui::TextLayerGL class new in Git master

OpenGL implementation of the text layer.

The layer assumes RendererGL is set on the user interface (or UserInterfaceGL used, which does so automatically), see its documentation for more information about GL state expectations. The layer produces geometry in a counter-clockwise winding, so GL::Renderer::Feature::FaceCulling can stay enabled when drawing it.

Base classes

class TextLayer new in Git master
Text layer.

Public types

class Shared
Shared state for the OpenGL implementation of the text layer.

Constructors, destructors, conversion operators

TextLayerGL(LayerHandle handle, Shared& shared) explicit
Constructor.

Public functions

auto shared() -> Shared&
Shared state used by this layer.
auto shared() const -> const Shared&

Protected functions

void doDraw(const Containers::StridedArrayView1D<const UnsignedInt>& dataIds, std::size_t offset, std::size_t count, const Containers::StridedArrayView1D<const UnsignedInt>& clipRectIds, const Containers::StridedArrayView1D<const UnsignedInt>& clipRectDataCounts, std::size_t clipRectOffset, std::size_t clipRectCount, const Containers::StridedArrayView1D<const Vector2>& nodeOffsets, const Containers::StridedArrayView1D<const Vector2>& nodeSizes, const Containers::StridedArrayView1D<const Float>& nodeOpacities, Containers::BitArrayView nodesEnabled, const Containers::StridedArrayView1D<const Vector2>& clipRectOffsets, const Containers::StridedArrayView1D<const Vector2>& clipRectSizes) override
Draw a sub-range of visible layer data.

Function documentation

Magnum::Ui::TextLayerGL::TextLayerGL(LayerHandle handle, Shared& shared) explicit

Constructor.

Parameters
handle Layer handle returned from AbstractUserInterface::createLayer()
shared Shared state containing font and style data

The shared state is expected to be kept in scope for the whole class lifetime. In order to draw the layer it's expected that Shared::setStyle() was called.

Shared& Magnum::Ui::TextLayerGL::shared()

Shared state used by this layer.

Reference to the instance passed to TextLayerGL::TextLayerGL(LayerHandle, Shared&).

const Shared& Magnum::Ui::TextLayerGL::shared() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void Magnum::Ui::TextLayerGL::doDraw(const Containers::StridedArrayView1D<const UnsignedInt>& dataIds, std::size_t offset, std::size_t count, const Containers::StridedArrayView1D<const UnsignedInt>& clipRectIds, const Containers::StridedArrayView1D<const UnsignedInt>& clipRectDataCounts, std::size_t clipRectOffset, std::size_t clipRectCount, const Containers::StridedArrayView1D<const Vector2>& nodeOffsets, const Containers::StridedArrayView1D<const Vector2>& nodeSizes, const Containers::StridedArrayView1D<const Float>& nodeOpacities, Containers::BitArrayView nodesEnabled, const Containers::StridedArrayView1D<const Vector2>& clipRectOffsets, const Containers::StridedArrayView1D<const Vector2>& clipRectSizes) override protected

Draw a sub-range of visible layer data.

It's possible for a subclass to override this function to perform extra GL state changes and then delegate to the parent implementation. As the implementation doesn't track current GL state in any way at the moment, the state should be reset back to the previous afterwards. Note that blending and scissor enabled state is already taken care of by LayerFeature::DrawUsesBlending and LayerFeature::DrawUsesScissor. See AbstractLayer::doDraw() for more information about how this function is called.