class new in Git master
#include <Magnum/Ui/BaseLayerGL.h>
BaseLayerGL OpenGL implementation of the base 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::
Base classes
- class BaseLayer new in Git master
- Base layer.
Public types
- class Shared
- Shared state for the OpenGL implementation of the base layer.
Constructors, destructors, conversion operators
- BaseLayerGL(LayerHandle handle, Shared& shared) explicit
- Constructor.
Public functions
- auto shared() -> Shared&
- Shared state used by this layer.
- auto shared() const -> const Shared&
-
auto setTexture(GL::
Texture2DArray& texture) -> BaseLayerGL& - Set a texture to draw with.
-
auto setTexture(GL::
Texture2DArray&& texture) -> BaseLayerGL& - Set a texture to draw with, taking over its ownership.
Protected functions
-
void doComposite(AbstractRenderer& renderer,
const Containers::
StridedArrayView1D<const Vector2>& compositingRectOffsets, const Containers:: StridedArrayView1D<const Vector2>& compositingRectSizes, std:: size_t offset, std:: size_t count) override - Composite previously rendered contents.
-
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:: BaseLayerGL:: BaseLayerGL(LayerHandle handle,
Shared& shared) explicit
Constructor.
Parameters | |
---|---|
handle | Layer handle returned from AbstractUserInterface:: |
shared | Shared state containing 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::
Shared& Magnum:: Ui:: BaseLayerGL:: shared()
Shared state used by this layer.
Reference to the instance passed to BaseLayerGL::
BaseLayerGL& Magnum:: Ui:: BaseLayerGL:: setTexture(GL:: Texture2DArray& texture)
Set a texture to draw with.
Returns | Reference to self (for method chaining) |
---|
Expects that the layer was constructed with a shared state that has BaseLayerSharedFlag::texture
is expected to stay alive for as long as the layer is drawn. Use setTexture(GL::
BaseLayerGL& Magnum:: Ui:: BaseLayerGL:: setTexture(GL:: Texture2DArray&& texture)
Set a texture to draw with, taking over its ownership.
Returns | Reference to self (for method chaining) |
---|
Compared to setTexture(GL::
void Magnum:: Ui:: BaseLayerGL:: doComposite(AbstractRenderer& renderer,
const Containers:: StridedArrayView1D<const Vector2>& compositingRectOffsets,
const Containers:: StridedArrayView1D<const Vector2>& compositingRectSizes,
std:: size_t offset,
std:: size_t count) override protected
Composite previously rendered contents.
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. See AbstractLayer::
void Magnum:: Ui:: BaseLayerGL:: 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::