setWin32WindowTarget method
- 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.invalidArgumentwhenwindowisn't a window, or, in an OpenGL build, already has another pixel format.Status.invalidStatewhenwindowis minimized or has no client area.Status.invalidStatewhenwindowwas minimized before the replacement ran.Status.unsupportedwhen, in a Vulkan build, the new window needs a different color format than the old one. Attach a new session instead.Status.nativeErrorwhen 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,
),
);