updateBuffer method

void updateBuffer(
  1. Buffer buffer,
  2. BufferAttribute<NativeArray<num>> attribute,
  3. int bufferType
)

Implementation

void updateBuffer(Buffer buffer, BufferAttribute attribute, int bufferType) {
  final updateRange = attribute.updateRange;

  gl.bindBuffer(bufferType, buffer);

  if (updateRange!["count"] == -1) {
    // Not using update ranges
    gl.bufferSubData(bufferType, 0, attribute.array);
  }
  else {
    console.info(" WebGLAttributes.dart gl.bufferSubData need debug confirm.... ");
    gl.bufferSubData(bufferType, updateRange["offset"]! * attribute.itemSize, attribute.array);
    updateRange["count"] = -1; // reset range
  }
}