setValueV2f method

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

Implementation

void setValueV2f(RenderingContext gl, v, [WebGLTextures? textures]) {
  final 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);
  }
}