title: Setting transparent background color in OpenGL doesn't work
body: <p>I tried setting the background color to a transparent one using the functions - glClearColor() and glClear(). But, the alpha values passed to glClearColor() simply doesn't change anything.</p>
  
  <p>Here is the code I tried running:</p>
  
  <pre><code> #include&lt;GL/glut.h&gt;
  
      void display()
      {
          glClear(GL_COLOR_BUFFER_BIT);
          glMatrixMode(GL_PROJECTION);
          glLoadIdentity();
          gluOrtho2D(0.0,(float)glutGet(GLUT_WINDOW_WIDTH),0.0,(float)glutGet(GLUT_WINDOW_HEIGHT));
  
          glBegin(GL_LINES);
              glVertex2i(200,200);
              glVertex2i(300,305);
          glEnd();
  
          glFlush();
      }
  
      int main(int argc, char *argv[const])
      {
          glutInit(&amp;argc, argv);
          glutInitDisplayMode(GLUT_RGBA | GLUT_ALPHA);
          glutInitWindowSize(1100,620);
          glutInitWindowPosition((glutGet(GLUT_SCREEN_WIDTH)-1100)/2,(glutGet(GLUT_SCREEN_HEIGHT)-620)/2);
          glutCreateWindow("GLUT Programming");
          glClearColor(0.0f,0.0f,0.0f,0.5f);   // I have tried experimenting with this part, but, nothing happens
          glutDisplayFunc(display);
          glutMainLoop();
      }
  </code></pre>
  
  <p>I am using freeglut and freeglut-devel on my machine running Fedora 26, if it helps.</p>
  
  <p><strong>EDIT :</strong></p>
  
  <p>Result I am getting :</p>
  
  <p><a href="https://i.stack.imgur.com/Ys6L5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ys6L5.png" alt="The background color is black and fully opaque"></a></p>
  
  <p>Result I am trying to obtain :</p>
  
  <p><a href="https://i.stack.imgur.com/rHewB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rHewB.png" alt="The background is transparent and the window underneath is visible"></a></p>