uploadOpenGLTexture method

void uploadOpenGLTexture(
  1. Map<String, dynamic> textureProperties,
  2. OpenGLTexture texture,
  3. int slot
)

Implementation

void uploadOpenGLTexture(Map<String, dynamic> textureProperties, OpenGLTexture texture, int slot) {
  final frame = info.render["frame"];
  if (_videoTextures[texture] != frame) {
    _videoTextures[texture] = frame;
    texture.update();
  }

  const textureType = WebGL.TEXTURE_2D;

  initTexture(textureProperties, texture);

  state.activeTexture(WebGL.TEXTURE0 + slot);
  state.bindTexture(textureType, textureProperties["__webglTexture"]);
  if(kIsWeb){
    gl.pixelStorei(WebGL.UNPACK_FLIP_Y_WEBGL, texture.flipY ? 1 : 0);
    gl.pixelStorei(WebGL.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha ? 1 : 0);
  }
  gl.pixelStorei(WebGL.UNPACK_ALIGNMENT, texture.unpackAlignment);
}