title: OpenGL GL_POLYGON concave polygon doesn't color in
body: <p>I have a problem when I try to use Polygon in OpenGL. I don't know how to explain this but all my vertices are connected with the beginning one. The problem happens when I try to color the object. I want to draw a simple object.</p>
  
  <pre><code>void TOP (float x1, float y1, float x2, float h,float n)
  {
    float r = x2-x1;
    if(n==1){glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);} // FOR FILL OR NO FILL OBJECT
    glBegin(GL_POLYGON);
       glVertex2f(x1,y1);
       glVertex2f(x2,y1);
       glVertex2f(x2,y1+h/7);
       y1=y1+h/7;
       glVertex2f(x2-r/5,y1+h/7);
       x2=x2-r/5; y1=y1+h/7;
       glVertex2f(x2,y1+2*h/7);
       y1=y1+2*h/7;
        glVertex2f(x2+r/5,y1+h/7);
        y1=y1+h/7; x2=x2+r/5;
        glVertex2f(x2,y1+2*h/7);
  cout&lt;&lt;y1&lt;&lt;endl;
        y1=y1+2*h/7;
         glVertex2f(x2-r/5,y1); x2=x2-r/5;
        glVertex2f(x2,y1-h/7); y1=y1-h/7;
        glVertex2f(x2-r/5,y1);x2=x2-r/5;
        glVertex2f(x2,y1+h/7); y1=y1+h/7;
        glVertex2f(x2-r/5,y1);x2=x2-r/5;
  
         glVertex2f(x2,y1-h/7); y1=y1-h/7;
         glVertex2f(x2-r/5,y1);x2=x2-r/5;
          glVertex2f(x2,y1+h/7); y1=y1+h/7;
           glVertex2f(x2-r/5,y1);x2=x2-r/5;
           glVertex2f(x2,y1-2*h/7);y1=y1-2*h/7;
           glVertex2f(x2+r/5,y1-h/7);y1=y1-h/7; x2=x2+r/5;
           glVertex2f(x2,y1-2*h/7); y1=y1-2*h/7;
           glVertex2f(x2-r/5,y1-h/7); y1=y1-h/7;x2=x2-r/5;
            glVertex2f(x2,y1-h/7);
  
    glEnd();
  }
  </code></pre>
  
  <p>Output:</p>
  
  <p><img src="https://i.stack.imgur.com/BLMSJ.png" alt="http://i.stack.imgur.com/BLMSJ.png"></p>