Original Post
Hiya... I have a slight probably with texturing user defined polygons with more than 3 points and I'm not quite sure how to go about it. Basically, the below code is used to draw a predefined polygon. Before starting, I bind a texture to it. Basically, is there a way of automatically generating texture coordinates?
// Bind the lake texture
tex_lake.Use();
// Start of lake polygon
glBegin(GL_POLYGON);
// Set normal
glNormal3f(0.0f, 1.0f, 0.0f);
// Draw all points in lake
for (count = 0; count < polygon_size; count++)
{
// Draw current point
glVertex3f(polygon[count].x, 0.0f, polygon[count].y);
} // for
// End polygon
glEnd();