setValueV1i method

void setValueV1i(
  1. RenderingContext gl,
  2. dynamic v, [
  3. WebGLTextures? textures
])

Implementation

void setValueV1i(RenderingContext gl, v, [WebGLTextures? textures]) {
  final cache = this.cache;

  if (cache[0] == v) return;

  if (v is bool) {
    if (v) {
      gl.uniform1i(addr, 1);
    } else {
      gl.uniform1i(addr, 0);
    }
  } else {
    gl.uniform1i(addr, v.toInt());
  }

  cache[0] = v;
}