title: Background colour in opengl
body: <p>I want to change the background color of the window after pressing the button, but my program doesn't work, can somebody tell me why?</p>
  <pre class="lang-c prettyprint-override"><code>int main(int argc, char* argv[])
  {
    glutInit(&amp;argc, argv);
    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
    glutInitWindowSize(800, 600);
    glutInitWindowPosition(300,50);
    glutCreateWindow(&quot;GLRect&quot;);
          
    glClearColor(1.0f, 0.0f, 0.0f, 1.0f);   &lt;---
      
    glutDisplayFunc(RenderScene);
    glutReshapeFunc(ChangeSize);
    glutMainLoop();
      
    system(&quot;pause&quot;);
    glClearColor(0.0f, 1.0f, 0.0f, 1.0f);   &lt;---
      
    return 0;
  }
  </code></pre>