setOpenGlBorrowedTextureTarget method

Future<void> setOpenGlBorrowedTextureTarget(
  1. OpenGlBorrowedTextureReplacement replacement
)

Replaces the OpenGL textures that a borrowed ring renders into.

Use it to resize the ring, or to give the session textures again after RenderSessionHandle.releaseTarget(). Release every acquired frame first. Once the replacement completes, the session no longer uses the old textures.

See mln_render_session_set_open_gl_borrowed_texture_target in the C API reference.

Implementation

Future<void> setOpenGlBorrowedTextureTarget(
  OpenGlBorrowedTextureReplacement replacement,
) => _run(
  (arena, completion) =>
      raw.mln_render_session_set_open_gl_borrowed_texture_target(
        _handle.raw,
        _writeOpenGlBorrowedTextureReplacement(replacement, arena),
        completion,
        nativeDiagnostic,
      ),
);