strokePolygon(poly, fill = false) {
		const points = poly.points;
		const len = points.length;

		this.translate(poly.pos.x, poly.pos.y);

		if (fill === false && this.lineWidth > 1) {
			const radius = this.lineWidth / 2;
			for (let i = 0; i < len - 1; i++) {
				const curPoint = points[i];
				const nextPoint = points[i + 1];
				this.fillEllipse(nextPoint.x, nextPoint.y, radius, radius);
				this.strokeLine(curPoint.x, curPoint.y, nextPoint.x, nextPoint.y);
			}
			const lastPoint = points[len - 1];
			const firstPoint = points[0];
			if (!lastPoint.equals(firstPoint)) {
				this.fillEllipse(firstPoint.x, firstPoint.y, radius, radius);
				this.strokeLine(lastPoint.x, lastPoint.y, firstPoint.x, firstPoint.y);
			}
		} else {
			this.setCompositor("primitive");
			this.path2D.beginPath();
			for (let i = 0; i < len - 1; i++) {
				const curPoint = points[i];
				const nextPoint = points[i + 1];
				this.path2D.moveTo(curPoint.x, curPoint.y);
				this.path2D.lineTo(nextPoint.x, nextPoint.y);
			}
			this.path2D.closePath();
			if (fill === false) {
				this.currentCompositor.drawVertices(this.gl.LINES, this.path2D.points);
			} else {
				// draw all triangles
				this.currentCompositor.drawVertices(
					this.gl.TRIANGLES,
					this.path2D.triangulatePath(),
				);
			}
		}

		this.translate(-poly.pos.x, -poly.pos.y);
	}
Stroke a Polygon on the screen with a specified color
@param {Polygon} poly - the shape to draw
@param {boolean} [fill=false] - also fill the shape with the current color if true