withOpenGlTexture<T> method

T withOpenGlTexture<T>(
  1. T use(
    1. ScopedOpenGlTextureFrame view
    )
)

Gets the OpenGL texture of an acquired frame.

See mln_acquired_frame_get_open_gl_texture in the C API reference.

Errors:

  • Status.targetLost when the session failed, or you detached, abandoned, or disposed it.

Implementation

T withOpenGlTexture<T>(T Function(ScopedOpenGlTextureFrame view) use) =>
    _NativeViewScope(
      _state,
      raw.mln_acquired_frame_view_begin,
      raw.mln_acquired_frame_view_end,
    ).use(
      (scope) => use(ScopedOpenGlTextureFrame._(scope, _getOpenGlTexture())),
    );