how to draw a polygon with different border color

hi
I want to draw a polygon in two ways

1 nly border with transparent inside
2:solid inside and border with different colors.
is that possible?
thanks for help

Yes, you can do it in two quick passes by drawing the interior first with glPolygonMode(GL_FRONT, GL_FILL) then switching to glPolygonMode(GL_FRONT, GL_LINE) and changing your color before drawing it again.

If you’re using the depth test, you might have to use an offset for the second pass. Also, replace GL_FRONT with whatever face(s) you want to draw.

Thanks for reply
What do you mean by a “quick pass” and
“use an offset for the second pass”.
since I m a beginner you know
Regards.