updateBuffer method
dynamic
updateBuffer(
- dynamic buffer,
- dynamic attribute,
- dynamic bufferType
Implementation
updateBuffer(buffer, attribute, bufferType) {
var array = attribute.array;
var updateRange = attribute.updateRange;
gl.bindBuffer(bufferType, buffer);
if (updateRange["count"] == -1) {
// Not using update ranges
gl.bufferSubData(bufferType, 0, array, 0, array.lengthInBytes);
} else {
print(" WebGLAttributes.dart gl.bufferSubData need debug confirm.... ");
gl.bufferSubData(bufferType, updateRange["offset"] * attribute.itemSize,
array, updateRange["offset"], updateRange["count"]);
updateRange["count"] = -1; // reset range
}
}