draw method

  1. @override
void draw(
  1. Mesh mesh
)
override

Draws a triangle list with indices.

Implementation

@override
void draw(Mesh mesh) {
  if (mesh is! _WGLMesh) return; // Error handling.

  _context.bindVertexArray(mesh._vaoHandle);

  _context.drawElements(
      web_gl.WebGL.TRIANGLES, mesh.indexCount, web_gl.WebGL.UNSIGNED_INT, 0);

  _context.bindVertexArray(null);
}