Follow up on http://khronos.org/cgi-bin/ubb/ultim...c&f=4&t=000121
Got rid of most of the glBegin/glEnd stuff, only polygons needs rewriting. Thought this was relatively easy, but unfortunately it's not.
The game's original code does something like this texture most of its model:
for (i=0 ; i<numVertex ; i++)
Which I've replaced with:
glVertexPointer(3, GL_FLOAT, 0, GetVertex(0));
glTexCoordPointer(2, GL_FLOAT, 0, GetTexture(0));
glDrawArrays(GL_TRIANGLE_FAN, 0, numVertex);
I store the original tex and vertex vector info in some global float arrays accessible via GetVertex () and GetTexture().
The model gets drawn ok, but small triangles and rectangulars are not correctly textured. They appear solid grey. As I move around in the game, the areas that are not correctly textured change all the time, resulting in a very flickery look and feel.
I've also tried to rewrite the polygon code by drawing n-2 triangles (GL_TRIANGLES) for an n polygon. The (not too surprising) result is exactly the same as for GL_TRIANGLE_FAN.
Am I making an obvious mistake?