title: I am getting "Unhandled exception at 0x10005655 (glut32.dll) in glut_demo.exe: 0xC0000005: Access violation reading location 0x00000020."
body: <p>When i run my project in visual studio 2013 I am getting this error.
  "Unhandled exception at 0x10005655 (glut32.dll) in glut_demo.exe: 0xC0000005: Access violation reading location 0x00000020."</p>
  
  <p>the code is right here:</p>
  
  <pre><code>#include&lt;GL\glut.h&gt;
  
  
  const GLsizei windowWidth = 500;
  const GLsizei windowHeight = 500;
  
  GLvoid drawScene(GLvoid)
  {
      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  
      glMatrixMode(GL_MODELVIEW);
      glLoadIdentity();
  
  
  
  
      glFlush();
  
      //this line is modified in diff window interfaces.
      glutSwapBuffers();
  
  }
  
  GLvoid timerLoop(int value)
  {
  
      glutPostOverlayRedisplay();
  
      glutTimerFunc(1, timerLoop, 0);
  }
  
  int main(int argc, char *argv[])
  {
      // initialize glut
      glutInit(&amp;argc, argv);
  
      glutInitDisplayMode(GLUT_DOUBLE);
  
      int windowID = glutCreateWindow("OpenGL CUBE demo");
  
      glutReshapeWindow(windowWidth, windowHeight);
  
      glutDisplayFunc(drawScene);
  
      glutTimerFunc(1, timerLoop, 0);
  
      glutMainLoop();
  
      //it never reacheas here.
      return 0;
  }
  </code></pre>