title: OpenGL GLUT window very slow, why?
body: <h1>The problem</h1>
  
  <p>I have just now begun working with OpenGL using GLUT. The code below compiles and displays two wireframe cubes and a sphere. The problem is that when I attempt to drag or resize the window it induces a noticeable delay before  following my mouse.</p>
  
  <p>This problem does not occur on my colleague's computer, same code.</p>
  
  <p>I am working with Visual Studio 2012 c++ express on a Windows 7 computer.
  I am a not an experienced programmer.</p>
  
  <h1>The code</h1>
  
  <pre><code>    // OpenGLHandin1.cpp : Defines the entry point for the console application.
  //
  
  #include "stdafx.h"
  #include &lt;GL/glut.h&gt;
  
  void initView(int argc, char * argv[]){
      //init here
      glutInit(&amp;argc, argv);
      //Simple buffer
      glutInitDisplayMode( GLUT_SINGLE | GLUT_RGBA );
      glutInitWindowPosition(100,100);
      glutInitWindowSize(800,400);
      glutCreateWindow("Handin 2");
  }
  void draw(){
  
      glClearColor(0,0,0,1);
      glClear(GL_COLOR_BUFFER_BIT);
      //Background color
  
      glPushMatrix();
      glLoadIdentity();
      glTranslatef(0.6, 0, 0);
  
      glColor3f(0.8,0,0);
      glutWireCube(1.1); //Draw the cube
      glPopMatrix();
  
      glPushMatrix();
      glLoadIdentity();
      glTranslatef(-0.5, 0, -0.2);
  
      glColor3f(0,0.8,0);
      glutWireCube(1.1); //Draw the cube
      glPopMatrix();
  
      glPushMatrix();
      glLoadIdentity();
      glTranslatef(0, 1.2, 0);
      glRotatef(90, 1, 0, 0);
  
      glColor3f(1,1,1);
      glutWireSphere(0.6, 20, 20); //Draw the sphere
      glPopMatrix();
  
      //draw here
      //glutSwapBuffers();
      glutPostRedisplay();
      glFlush();
  
  }
  void reshape (int w, int h){
      glViewport(0,0,w ,h);
      glMatrixMode(GL_PROJECTION);
      glLoadIdentity();
      gluPerspective(45, (float)w/(float)h, 1.5, 10);
      gluLookAt(1.5, 2.5, 4, 
                0, 0.6, 0, 
                0, 1, 0); //Orient the camera
      glRotatef(5, 0, 0, 1);
      glMatrixMode(GL_MODELVIEW);
  }
  int main(int argc, char * argv[])
  {
      initView(argc,argv);
      glutDisplayFunc(draw);
      glutReshapeFunc(reshape);
      glutMainLoop();
  }
  </code></pre>