Lerul Ler
Lerul Ler

Reputation: 339

How to draw filled gl_quads Open_GL

So it's my first time working with OpenGL library and so far I have this code:

glColor3f(1, 0.1, 0.1);
glBegin(GL_QUADS);
glVertex2f(1.0, 1.0);
glVertex2f(0.3, 0.7);
glVertex2f(0.55, 0.45);
glVertex2f(1.0, 0.45);
glEnd();

It is drawing an empty "form" only with red edges, I want it filled with color inside as well. enter image description here

Upvotes: 1

Views: 4672

Answers (1)

Anedar
Anedar

Reputation: 4265

The command you are looking for is

glPolygonMode(GL_FRONT, GL_FILL);

See https://www.opengl.org/sdk/docs/man2/xhtml/glPolygonMode.xml

Upvotes: 4

Related Questions