setWin32WindowTarget method

Future<void> setWin32WindowTarget(
  1. Win32WindowReplacement replacement
)

Replaces the Win32 window that the session presents to.

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

See mln_render_session_set_win32_window_target in the C API reference.

Errors:

  • Status.invalidArgument when window isn't a window, or, in an OpenGL build, already has another pixel format.
  • Status.invalidState when window is minimized or has no client area.
  • Status.invalidState when window was minimized before the replacement ran.
  • Status.unsupported when, in a Vulkan build, the new window needs a different color format than the old one. Attach a new session instead.
  • Status.nativeError when the library can't present to the new window.

Implementation

Future<void> setWin32WindowTarget(Win32WindowReplacement replacement) => _run(
  (arena, completion) => raw.mln_render_session_set_win32_window_target(
    _handle.raw,
    _writeWin32WindowReplacement(replacement, arena),
    completion,
    nativeDiagnostic,
  ),
);