setValueV2f method

dynamic setValueV2f(
  1. dynamic gl,
  2. dynamic v, [
  3. WebGLTextures? textures
])

Implementation

setValueV2f(gl, v, [WebGLTextures? textures]) {
  var cache = this.cache;

  if (v.x != null) {
    if (cache[0] != v.x || cache[1] != v.y) {
      gl.uniform2f(addr, v.x, v.y);

      cache[0] = v.x;
      cache[1] = v.y;
    }
  } else {
    if (arraysEqual(cache, v)) return;

    gl.uniform2fv(addr, v);

    copyArray(cache, v);
  }
}