ChangeFaces method

void ChangeFaces(
  1. List<int> faces
)

Implementation

void ChangeFaces(List<int> faces) {
  assert(_vertices != null);
  if (_vertices.length < 3 * 256) {
    _faces = Uint8List.fromList(faces);
    _indexBufferType = GL_UNSIGNED_BYTE;
  } else if (_vertices.length < 3 * 65536) {
    _faces = Uint16List.fromList(faces);
    _indexBufferType = GL_UNSIGNED_SHORT;
  } else {
    _faces = Uint32List.fromList(faces);
    _indexBufferType = GL_UNSIGNED_INT;
  }

  _cgl.bindVertexArray(_vao);
  _cgl.ChangeElementArrayBuffer(_indexBuffer!, _faces as TypedData);
}