Opengl drawing half circle
<p>I am trying to draw half a circle; When I run my code I don't get any errors but nothing prints out. Can someone please let me know what I am doing wrong? I tried changing the window position but no luck.</p>

<pre><code>#include&lt;GL/glut.h&gt;
#include &lt;math.h&gt;

void DrawHalfCircle()
 {
     glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
     glClear(GL_COLOR_BUFFER_BIT);
     glColor4f(1, 0, 0, 0);
     int number = 20; //number of vertices,
     float radius = 0.4f; // radius of the circle
     float twopi = 2.0f*3.14159f;
    glMatrixMode(GL_MODELVIEW); //operate in model view
    glLoadIdentity();//after every matrixmode, loadidentity is used.
    glTranslatef(0.5f, 0.0f, 0.0f); //to move the position of circle towards +ve x axis
glBegin(GL_TRIANGLE_FAN); //drawing circle using triangle fan
    glColor3f(0.0f, 0.0f, 1.0f); //blue in color
    glVertex2f(0.0f, 0.0f); //placing at the origin
    for (int i = 0; i &lt;= 21; i++)
           glVertex2f(radius*cosf(i*twopi / number), radius*sinf(i*twopi / number));
     glEnd();
     glFlush();
}
</code></pre>

<p>The main</p>

<pre><code> int main()

{
       glutInit(&amp;argc, argv);  //initialize glut
       glutInitWindowSize(640, 480); //width and height
       glutInitWindowPosition(0, 50); //bottom-left corner
       glutCreateWindow("drawing half a circle"); 
       glutDisplayFunc(DrawHalfCircle);
       glutMainLoop(); //loops itself again and again
      return 0;
</code></pre>

<p>}</p>