Rendering/tessellation of polygons fails in iOS simulator

I’ve migrated from 0.062 to the github master branch a couple of days ago and have noticed that simple polygons don’t seem to render in the iOS simulator. (Xcode 3.2.6, iOS 4.2). The same code works fine on Mac OS X, although I don’t have a iOS device currently to test with.

For example, attempting to draw this square:

	ofVertex(10, 10);  
	ofVertex(10, 85);  
	ofVertex(85, 85);  
	ofVertex(85, 10);  
	ofVertex(10, 10);  

results in nothing being drawn in the iOS simulator. ofTriangle() and ofRect() don’t suffer the problem as they don’t use ofPath to get drawn.

In the debugger, I’m finding that when the above polygon is tessellated in ofPath::tessellate(), the cachedTessellation mesh has the correct vertices, but has an indices list of {0, 0, 1, 0, 2, 0} which is probably why it doesn’t render (ie. duplicate consecutive indices within the same triangle. The vertices under OS X are the same, but the indices list looks more sensible.)

Lest there was a problem with linking against libs/tess2/lib/osx/tess2.a for the simulator build, I also tried incorporating the tess2 code ( directly into the OF project instead of using tess2.a. Same result.

Has anybody else seen this kind of problem, have suggestions or am I just doing something silly? I don’t really know enough about libtess2 to go digging further…

Thanks in advance,

See Issue-602 for more details and a code-fix.