draw method

void draw(
  1. int mode,
  2. int count,
  3. int type,
  4. int offset,
  5. int instanceCount,
  6. bool hasTransforms,
)

Implementation

void draw(int mode, int count, int type, int offset, int instanceCount,
    bool hasTransforms) {
  if (hasTransforms) _gl.beginTransformFeedback(mode);
  if (type != -1) {
    if (instanceCount > 1) {
      _gl.drawElementsInstanced(mode, count, type, offset, instanceCount);
    } else {
      _gl.drawElements(mode, count, type, offset);
    }
  } else {
    if (instanceCount > 1) {
      _gl.drawArraysInstanced(mode, offset, count, instanceCount);
    } else {
      _gl.drawArrays(mode, offset, count);
    }
  }
  if (hasTransforms) _gl.endTransformFeedback();
}