public void beginShape(int kind) {
    shape = kind;

//    shape_index = shape_index + 1;
//    if (shape_index == -1) {
//      shape_index = 0;
//    }

    if (hints[ENABLE_DEPTH_SORT]) {
      // continue with previous vertex, line and triangle count
      // all shapes are rendered at endDraw();
      shapeFirst = vertexCount;
      shapeLast = 0;

    } else {
      // reset vertex, line and triangle information
      // every shape is rendered at endShape();
      vertexCount = 0;
      if (line != null) line.reset();  // necessary?
      lineCount = 0;
//      pathCount = 0;
      if (triangle != null) triangle.reset();  // necessary?
      triangleCount = 0;
    }

    textureImage = null;
    curveVertexCount = 0;
    normalMode = NORMAL_MODE_AUTO;
//    normalCount = 0;
  }