MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mbgl::style::CustomLayerHost Class Referenceabstract

#include <custom_layer.hpp>

Public Member Functions

virtual ~CustomLayerHost ()=default
 
virtual void initialize ()=0
 
virtual void render (const CustomLayerRenderParameters &)=0
 
virtual void contextLost ()=0
 
virtual void deinitialize ()=0
 

Detailed Description

Definition at line 25 of file custom_layer.hpp.

Constructor & Destructor Documentation

◆ ~CustomLayerHost()

virtual mbgl::style::CustomLayerHost::~CustomLayerHost ( )
virtualdefault

Member Function Documentation

◆ contextLost()

virtual void mbgl::style::CustomLayerHost::contextLost ( )
pure virtual

Called when the system has destroyed the underlying GL context. The deinitialize function will not be called in this case, however initialize will be called instead to prepare for a new render.

◆ deinitialize()

virtual void mbgl::style::CustomLayerHost::deinitialize ( )
pure virtual

Destroy any GL state needed by the custom layer, and deallocate context, if necessary. This method is called once, from the main thread, at a point when the GL context is active.

Note that it may be called even when the initialize function has not been called.

◆ initialize()

virtual void mbgl::style::CustomLayerHost::initialize ( )
pure virtual

Initialize any GL state needed by the custom layer. This method is called once, from the main thread, at a point when the GL context is active but before rendering for the first time.

Resources that are acquired in this method must be released in the deinitialize function.

◆ render()

virtual void mbgl::style::CustomLayerHost::render ( const CustomLayerRenderParameters )
pure virtual

Render the layer. This method is called once per frame. The implementation should not make any assumptions about the GL state (other than that the correct context is active). It may make changes to the state, and is not required to reset values such as the depth mask, stencil mask, and corresponding test flags to their original values. Make sure that you are drawing your fragments with a z value of 1 to take advantage of the opaque fragment culling in case there are opaque layers above your custom layer.


The documentation for this class was generated from the following file: