Class MbglFrontend
- Namespace
- MapLibreNative.Maui
Wraps mbgl_frontend_t*.
Ownership note: once passed to MbglMap, the map takes
ownership of the underlying native pointer and will destroy it via
mbgl_map_destroy. Dispose() becomes a no-op after
MapLibreNative.Maui.MbglFrontend.TransferOwnership() is called. Do not call
Dispose() after Dispose().
public sealed class MbglFrontend : IDisposable
- Inheritance
-
MbglFrontend
Constructors
MbglFrontend(IntPtr, IntPtr, int, int, float, Action)
public MbglFrontend(IntPtr surfaceHandle, IntPtr glContext, int widthPx, int heightPx, float pixelRatio, Action onRender)
Parameters
surfaceHandleIntPtrPlatform-specific surface: HDC (Windows), ANativeWindow* (Android), CAMetalLayer* (Apple)
glContextIntPtrWGL context (Windows) or null (Android/Apple)
widthPxintInitial width in physical pixels
heightPxintInitial height in physical pixels
pixelRatiofloatDevice pixel ratio
onRenderActionCalled by the native layer when a new frame is ready; call Render() inside it.
Methods
Dispose()
public void Dispose()
GetNativeView()
Returns the platform-native view created by the frontend, or IntPtr.Zero.
On Apple platforms this is the MTKView*; cast to UIView and add as subview.
public IntPtr GetNativeView()
Returns
- IntPtr
Render()
Execute the pending render pass. Call from the render thread when onRender fires.
public void Render()
SetSize(int, int)
public void SetSize(int widthPx, int heightPx)