Table of Contents

Class OffscreenDeviceHandle

Namespace
Maplibre.NativeFfi
Assembly
Maplibre.NativeFfi.dll

A GPU device that the library creates to render maps offscreen.

public sealed class OffscreenDeviceHandle : IDisposable
Inheritance
OffscreenDeviceHandle
Implements
Inherited Members

Remarks

See mln_offscreen_device in the C API reference.

Properties

Id

The native handle value. It stays readable after release.

public ulong Id { get; }

Property Value

ulong

IsClosed

Whether a release, dispose, or discard has ended the handle.

public bool IsClosed { get; }

Property Value

bool

Methods

Create(OffscreenDeviceOptions?)

Creates a GPU device for rendering maps offscreen.

public static OffscreenDeviceHandle Create(OffscreenDeviceOptions? options = null)

Parameters

options OffscreenDeviceOptions

Returns

OffscreenDeviceHandle

Remarks

MapHandle.AttachOffscreen() creates a device of its own when it gets none. Create one to share it among the sessions on many maps, or to pick a GPU.

In a browser WebGPU build, attach without a device instead.

See mln_offscreen_device_create in the C API reference.

Errors:

  • Status.Unsupported in a browser WebGPU build, or when the device can't render with client_api.
  • Status.NativeError when adapter_index names no GPU, or the platform can't create the device.

Release()

Releases an offscreen device.

public void Release()

Remarks

Render sessions on the device keep working until they detach.

See mln_offscreen_device_release in the C API reference.

ToString()

Names the handle's type, its Id, and whether it is closed.

public override string ToString()

Returns

string