updateBuffer method
void
updateBuffer(
- Buffer buffer,
- BufferAttribute<NativeArray<num>> attribute,
- 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
}
}