MapLibre Native C API
Public C ABI for the MapLibre Native wrapper.
Loading...
Searching...
No Matches
wayland.h File Reference

Go to the source code of this file.

Data Structures

struct  mln_wayland_surface_descriptor
struct  mln_wayland_surface_replacement

Typedefs

typedef struct mln_wayland_surface_descriptor mln_wayland_surface_descriptor
typedef struct mln_wayland_surface_replacement mln_wayland_surface_replacement

Functions

mln_status mln_map_attach_wayland_surface (mln_map map, const mln_wayland_surface_descriptor *descriptor, mln_vulkan_device device, const mln_render_session_attach_options *options, mln_render_session *out_session, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_render_session_set_wayland_surface_target (mln_render_session session, const mln_wayland_surface_replacement *replacement, const mln_completion *completion, mln_diagnostic *out_diagnostic)

Detailed Description

Present the map to a Wayland surface.

Typedef Documentation

◆ mln_wayland_surface_descriptor

typedef struct mln_wayland_surface_descriptor mln_wayland_surface_descriptor

A Wayland surface to present to, for mln_map_attach_wayland_surface().

◆ mln_wayland_surface_replacement

typedef struct mln_wayland_surface_replacement mln_wayland_surface_replacement

Function Documentation

◆ mln_map_attach_wayland_surface()

mln_status mln_map_attach_wayland_surface ( mln_map map,
const mln_wayland_surface_descriptor * descriptor,
mln_vulkan_device device,
const mln_render_session_attach_options * options,
mln_render_session * out_session,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Creates a session that presents the map to a Wayland surface, with a graphics context that the library creates.

A Vulkan build presents with device, or, when device is null, with a device that the library creates. An OpenGL build uses an EGL context on the display, and device must be null. Attach with MLN_RENDER_DRIVER_CORE_WORKER.

The session presents without waiting for the compositor, so demand at most one frame per display refresh.

Keep the surface until a release or replacement of the target, or a detach of the session, completes. Keep the display connected until the session's detach completes. In an OpenGL build, if you also use EGL on the display, initialize it before you attach.

Returns:

Completes with:

  • MLN_STATUS_UNSUPPORTED when the GPU or the Vulkan loader can't present to Wayland.
  • MLN_STATUS_NATIVE_ERROR when the library can't create the graphics context or present to the surface.

◆ mln_render_session_set_wayland_surface_target()

mln_status mln_render_session_set_wayland_surface_target ( mln_render_session session,
const mln_wayland_surface_replacement * replacement,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Replaces the Wayland surface that the session presents to.

Use it to give the session a surface again after mln_render_session_release_target(), to move it to another surface, or to resize it. Once the replacement completes, the session no longer uses the old surface.

Completes with:

  • MLN_STATUS_UNSUPPORTED when, in a Vulkan build, the new surface needs a different color format than the old one. Attach a new session instead.
  • MLN_STATUS_NATIVE_ERROR when the library can't present to the new surface.