Texture mapping to polygons

How do I map textures to polygons other than right parallelograms? For example in

glBegin(GL_POLYGON);
glVertex2i(-10, 0);
glVertex2i(10, 0);
glVertex2i(15, 10);
glVertex2i(0, 15);
glVertex2i(-15, 10);
glEnd();

where would I put the calls to glTexCoord2f? Assume I have loaded the texture, which is a sqaure shape.

in front of the calls to glVertex I believe

Would that distort the texture? The texture is a square, and wouldn’t calling glTexCoord five times distort the texture?

It depends on what you pass to glTexCoord2f. 0.0, 0.0 being the lower left, and 1.0, 1.0 being the upper right. And anything between 0 and 1 being somewhere in between.

So in answer to your question, it will distort the image if all you use are 0s or 1s, but if you calculate the appropriate tex coords, you can do it w/o distorting the texture.

Ohhhhh. Thank you–but wait, would the rest of the texture still be displayed even if I don’t include it in glTexCoord?

I belive it clips off what you dont use. I always liekd the saying “think of the coordinates as the cookie cutter and think of the texture as the dough.”

Ok, I figured everything out. Thank you all for helping.