attachOpenGlBorrowedTexture method
- OpenGlBorrowedTextureDescriptor descriptor,
- RenderSessionAttachOptions options
Creates a session that renders the map into a ring of your OpenGL textures.
See mln_map_attach_open_gl_borrowed_texture in the
C API reference.
Errors:
Status.unsupportedwhenopenGlSupportedContextProviderMask()lacks the context's platform, or when the target supports none of theproducer_sync_kindsinoptions.
Implementation
RenderSessionHandle attachOpenGlBorrowedTexture(
OpenGlBorrowedTextureDescriptor descriptor,
RenderSessionAttachOptions options,
) {
final registrations = _NativeRegistrations(_CallbackRoots());
return _attach(
(arena, completion, outSession) => registrations.run(
() => raw.mln_map_attach_open_gl_borrowed_texture(
_handle.raw,
_writeOpenGlBorrowedTextureDescriptor(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));
},
),
);
}