Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to draw polygons in OpenGL that have an outline drawn with a black pen and another fill color

How can I draw a shape like this in OpenGL?

enter image description here
I mean, I know how to draw polygons in OpenGL. I want to know how to make the outline black and the fill color ( for example ) yellow?

like image 432
Sepideh Abadpour Avatar asked Sep 13 '13 22:09

Sepideh Abadpour


1 Answers

You have 5 vertices. Draw a GL_POLYGON with them and then then a GL_LINE_LOOP.

Note that GL_POLYGON is only valid for convex polygons.

like image 57
genpfault Avatar answered Oct 26 '22 06:10

genpfault