samplerArraySetter method

dynamic samplerArraySetter(
  1. OpenGLContextES gl,
  2. dynamic type,
  3. dynamic unit,
  4. dynamic location,
  5. int size,
)

Implementation

samplerArraySetter(OpenGLContextES gl, type, unit, location, int size) {
  var bindPoint = getBindPointForSamplerType(gl, type);
  var units = Int32List(size);
  for (var ii = 0; ii < size; ++ii) {
    units[ii] = unit + ii;
  }

  return (List textures) {
    // gl.uniform1iv(location, units);
    // textures.forEach((textureOrPair, index) {
    //   gl.activeTexture(gl.TEXTURE0 + units[index]);
    //   var texture = 0;
    //   if (textureOrPair is WebGLTexture) {
    //     texture = textureOrPair;
    //   } else {
    //     texture = textureOrPair.texture;
    //     gl.bindSampler(unit, textureOrPair.sampler);
    //   }
    //   gl.bindTexture(bindPoint, texture);
    // });
  };
}