|
MapLibre Native C API
Public C ABI for the MapLibre Native wrapper.
|
Go to the source code of this file.
Data Structures | |
| struct | mln_metal_surface_descriptor |
| struct | mln_vulkan_surface_descriptor |
| struct | mln_webgpu_surface_descriptor |
| struct | mln_opengl_surface_descriptor |
Typedefs | |
| typedef struct mln_metal_surface_descriptor | mln_metal_surface_descriptor |
| typedef struct mln_vulkan_surface_descriptor | mln_vulkan_surface_descriptor |
| typedef struct mln_webgpu_surface_descriptor | mln_webgpu_surface_descriptor |
| typedef struct mln_opengl_surface_descriptor | mln_opengl_surface_descriptor |
Public C API declarations for surface render targets.
| typedef struct mln_metal_surface_descriptor mln_metal_surface_descriptor |
Metal attachment options for a native surface.
| typedef struct mln_opengl_surface_descriptor mln_opengl_surface_descriptor |
OpenGL attachment options for a native surface.
| typedef struct mln_vulkan_surface_descriptor mln_vulkan_surface_descriptor |
Vulkan attachment options for a native surface.
| typedef struct mln_webgpu_surface_descriptor mln_webgpu_surface_descriptor |
WebGPU attachment options for a native surface.
| mln_status mln_map_attach_metal_surface | ( | mln_map | map, |
| const mln_metal_surface_descriptor * | descriptor, | ||
| const mln_render_session_attach_options * | options, | ||
| mln_render_session * | out_session, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Starts attachment of a Metal surface target.
The descriptor and options are copied before return. An accepted attachment retains the Metal layer and device before return. The completion reports target initialization. A caller driver requires service on a thread where the Metal context is usable.
Returns:
Completes with:
| mln_status mln_map_attach_opengl_surface | ( | mln_map | map, |
| const mln_opengl_surface_descriptor * | descriptor, | ||
| const mln_render_session_attach_options * | options, | ||
| mln_render_session * | out_session, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Starts attachment of an OpenGL surface target.
WGL, EGL, and existing WebGL contexts require MLN_RENDER_DRIVER_CALLER_GRAPHICS_THREAD. A transferred WebGL canvas requires MLN_RENDER_DRIVER_CORE_WORKER. Context ownership remains independent.
Returns:
Completes with:
| mln_status mln_map_attach_vulkan_surface | ( | mln_map | map, |
| const mln_vulkan_surface_descriptor * | descriptor, | ||
| const mln_render_session_attach_options * | options, | ||
| mln_render_session * | out_session, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Starts attachment of a Vulkan surface target.
The descriptor and options are copied before return. The completion runs only after the selected driver creates the swapchain.
Returns:
Completes with:
| mln_status mln_map_attach_webgpu_surface | ( | mln_map | map, |
| const mln_webgpu_surface_descriptor * | descriptor, | ||
| const mln_render_session_attach_options * | options, | ||
| mln_render_session * | out_session, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Starts attachment of a WebGPU surface target.
Browser targets require MLN_RENDER_DRIVER_CALLER_GRAPHICS_THREAD in the agent that created the WebGPU objects.
Returns:
Completes with:
| mln_metal_surface_descriptor mln_metal_surface_descriptor_default | ( | void | ) |
Returns Metal surface descriptor defaults for this C API version.
| mln_opengl_surface_descriptor mln_opengl_surface_descriptor_default | ( | void | ) |
Returns OpenGL surface descriptor defaults for this C API version.
| mln_status mln_render_session_set_metal_surface_target | ( | mln_render_session | session, |
| const mln_metal_surface_descriptor * | descriptor, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Starts an ordered Metal surface replacement.
The descriptor is copied before return, and the session retains the replacement layer and device.
Returns:
Completes with:
| mln_status mln_render_session_set_opengl_surface_target | ( | mln_render_session | session, |
| const mln_opengl_surface_descriptor * | descriptor, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Starts an ordered OpenGL surface replacement.
The descriptor is copied before return. The replacement must name the share group this session attached with.
Returns:
Completes with:
| mln_status mln_render_session_set_vulkan_surface_target | ( | mln_render_session | session, |
| const mln_vulkan_surface_descriptor * | descriptor, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Starts an ordered Vulkan surface replacement.
The descriptor is copied before return. The replacement must name the context this session attached with.
Returns:
Completes with:
| mln_status mln_render_session_set_webgpu_surface_target | ( | mln_render_session | session, |
| const mln_webgpu_surface_descriptor * | descriptor, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Starts an ordered WebGPU surface replacement.
The descriptor is copied before return. The replacement must name the device and queue this session attached with.
Returns:
Completes with:
| mln_vulkan_surface_descriptor mln_vulkan_surface_descriptor_default | ( | void | ) |
Returns Vulkan surface descriptor defaults for this C API version.
| mln_webgpu_surface_descriptor mln_webgpu_surface_descriptor_default | ( | void | ) |
Returns WebGPU surface descriptor defaults for this C API version.