There are several wrong things with your code.First of all no glutDisplayMode is called.Just type glutDisplayMode(GLUT_RGBA | GLUT_DOUBLEBUFFER); after glutInit();Now the only thing that you must do is to call glutSwapBuffer(); each frame.The next error is pure logical.You are putting the camera 5 units forward and you are drawing the cube from -2 to 2.You cannot see it cause it’s far behind your back.Change the third parameter of LookAt with -5.That’s all