Textured Poly > 4 sides.

BlitzMax Forums/BlitzMax OpenGL Programming/Textured Poly > 4 sides.

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I have the following code...
SetGraphicsDriver GLMax2DDriver()
Graphics 800,600,0

Global w,h
Global tex=LoadTexture("max.png")

glTexParameteri GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR
glTexParameteri GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR
glLoadIdentity
glEnable GL_TEXTURE_2D

While Not KeyHit(KEY_ESCAPE)
	mx=MouseX() ; my=MouseY()
	Cls
	glLoadIdentity
    glBindTexture GL_TEXTURE_2D,tex
	' quad

	glBegin GL_POLYGON
	 glTexCoord2f 0.0, 0.0 ; glVertex2f mx , my
	 glTexCoord2f 1.0, 0.0 ; glVertex2f mx+w , my
	 glTexCoord2f 1.0, 1.0 ; glVertex2f mx+w , my+h
	 glTexCoord2f 0.0, 1.0 ; glVertex2f mx , my+h
	glEnd

	FlushMem
	Flip
	Delay 10
Wend

End

Function LoadTexture(f$)
	Local pm:TPixmap=LoadPixmap(f$)
	w=pm.width ; h=pm.height
	Local texname=bglTexFromPixmap(pm)
	Return texname
End Function

cobbled together from various examples in these forums (so thanks to the people who posted them)
How would I draw the Polygon with more than 4 sides as I don't understand what I would o with the gltexcoord2f statements.
Thanks in advance
<edit> It's OK, I've got it. You can define as many glvertex2f commands but the gltexcoord2f will be associated with the next one... seemingly.