The main window is created through GLUT calls and in the same way as done in our previous examples including the Hello World program. The only difference here is capturing the window handle returned by GLUT with the call to glutCreateWindow. The window handle is an integer that GLUT uses when we need to indentify a window. In particular, we use the handle in creating subwindows to tell GLUT the window they are part of.
We also register with GLUT a display and a reshape function. The functions are associated with a window and, in particular, the current window. Since we have not yet created other (sub)windows and, in turn, changed the current window, the functions are attached to the main window.