bindTexture method

void bindTexture(
  1. dynamic webglType,
  2. dynamic webglTexture
)

Implementation

void bindTexture(webglType, webglTexture) {
  if (currentTextureSlot == null) {
    activeTexture(null);
  }

  BoundTexture? boundTexture = currentBoundTextures[currentTextureSlot];

  if (boundTexture == null) {
    boundTexture = BoundTexture();
    currentBoundTextures[currentTextureSlot!] = boundTexture;
  }

  //if (boundTexture.type != webglType || boundTexture.texture != webglTexture) {
    gl.bindTexture(webglType, webglTexture ?? emptyTextures[webglType]);

    boundTexture.type = webglType;
    boundTexture.texture = webglTexture;
  //}
}