deleteTexture static method

Future<void> deleteTexture(
  1. FlutterAngleTexture texture
)

Implementation

static Future<void> deleteTexture(FlutterAngleTexture texture) async {
  if (Platform.isAndroid) {
    return;
  }
  assert(_activeFramebuffer != null, 'There is no active FlutterGL Texture to delete');
  if (_activeFramebuffer == texture.fboId) {
    _rawOpenGl.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, 0);

    Pointer<Uint32> fbo = calloc();
    fbo.value = texture.fboId;
    _rawOpenGl.glDeleteBuffers(1, fbo);
    calloc.free(fbo);
  }
  worker.dispose();
  await _channel.invokeMethod('deleteTexture', {"textureId": texture.textureId,"location": texture.loc});
}