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) {
  var frame = info.render["frame"];
  if (_videoTextures[texture] != frame) {
    _videoTextures[texture] = frame;
    texture.update();
  }

  var textureType = gl.TEXTURE_2D;

  initTexture(textureProperties, texture);

  state.activeTexture(gl.TEXTURE0 + slot);
  state.bindTexture(textureType, textureProperties["__webglTexture"]);

  gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, texture.flipY ? 1 : 0);
  gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha ? 1 : 0);
  gl.pixelStorei(gl.UNPACK_ALIGNMENT, texture.unpackAlignment);
}