attachVulkanSurface method
- VulkanSurfaceDescriptor descriptor,
- RenderSessionAttachOptions options
Creates a session that renders the map to a Vulkan surface.
See mln_map_attach_vulkan_surface in the
C API reference.
Errors:
Status.unsupportedwhensupportedRenderBackendMask()lacksRenderBackendFlag.vulkan.
Implementation
RenderSessionHandle attachVulkanSurface(
VulkanSurfaceDescriptor descriptor,
RenderSessionAttachOptions options,
) {
final registrations = _NativeRegistrations(_CallbackRoots());
return _attach(
(arena, completion, outSession) => registrations.run(
() => raw.mln_map_attach_vulkan_surface(
_handle.raw,
_writeVulkanSurfaceDescriptor(descriptor, arena),
_writeRenderSessionAttachOptions(options, arena, registrations),
outSession,
completion,
nativeDiagnostic,
),
),
(handle, ready) => _adoptOwned(
handle,
() =>
(RenderSessionHandle._(this, _NativeRenderSession(handle), ready)
.._state.retain(registrations)),
(handle) {
_check(raw.mln_render_session_dispose(handle, nativeDiagnostic));
},
),
);
}