activateTexture static method

void activateTexture(
  1. FlutterAngleTexture texture
)

Implementation

static void activateTexture(FlutterAngleTexture texture) {
  _rawOpenGl.glBindFramebuffer(GL_FRAMEBUFFER, texture.fboId);
  if (Platform.isAndroid) {
    eglMakeCurrent(_display, texture.androidSurface, texture.androidSurface,_baseAppContext);
    return;
  }
  if (texture.metalAsGLTextureId != 0) {
    // Draw to metal interop texture directly
    _rawOpenGl.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,GL_TEXTURE_2D, texture.metalAsGLTextureId, 0);
  }
  else {
    _rawOpenGl.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, texture.rboId);
  }

  //printOpenGLError('activateTextue ${texture.textureId}');
  _activeFramebuffer = texture.fboId;
}