texture mapping for polygon

Hi All,

I have a qn on texture mapping. I drew my octagon using GL_POLYGON, how do i go abt mapping my bitmap on to the object?

so i have altogether 8 vertices drawn between my glBegin and glEnd.

so how do i do it?
please help.
Thanx alot!

Well, firstly i would like to say that what you did was bad. You should have drawn it using triangles, so as not to cause some complications that can occur. To texture map what you have done isnt much different from texturing a quad, you sinply will have more hassle with glTexCoord that if you did a simple quad. Simply assing a texture coordinate to each vertex and apply the texture.