setVulkanSurfaceTarget method

Future<void> setVulkanSurfaceTarget(
  1. VulkanSurfaceReplacement replacement
)

Replaces the Vulkan surface that the session presents to.

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

See mln_render_session_set_vulkan_surface_target in the C API reference.

Errors:

  • Status.unsupported when the new surface needs a different color format or pre-rotation support than the old one. Attach a new session instead.

Implementation

Future<void> setVulkanSurfaceTarget(VulkanSurfaceReplacement replacement) =>
    _run(
      (arena, completion) => raw.mln_render_session_set_vulkan_surface_target(
        _handle.raw,
        _writeVulkanSurfaceReplacement(replacement, arena),
        completion,
        nativeDiagnostic,
      ),
    );