static void RenderStrip(Tesselator tess, HalfEdge halfEdge, int size)
{
/* Render as many CCW triangles as possible in a strip starting from
* edge "e". The strip *should* contain exactly "size" triangles
* (otherwise we've goofed up somewhere).
*/
tess.CallBegin(Tesselator.TriangleListType.TriangleStrip);
tess.CallVertex(halfEdge.originVertex.clientIndex);
tess.CallVertex(halfEdge.directionVertex.clientIndex);
while (!halfEdge.leftFace.Marked())
{
halfEdge.leftFace.marked = true;
--size;
halfEdge = halfEdge.Dprev;
tess.CallVertex(halfEdge.originVertex.clientIndex);
if (halfEdge.leftFace.Marked()) break;
halfEdge.leftFace.marked = true;
--size;
halfEdge = halfEdge.nextEdgeCCWAroundOrigin;
tess.CallVertex(halfEdge.directionVertex.clientIndex);
}
if (size != 0)
{
throw new Exception();
}
tess.CallEnd();
}