Prepare GLFW



OpenGL doesn't actually draw to a computer screen, it renders to a frame buffer.
It is the job of the individual machine to draw the contents of the frame buffer
onto a region on the screen. Various libraries support doing this. One option is
to use the windowing capabilities provided by the operating system, such as the
Microsoft Windows API. This is generally impractical and requires a lot of low-
level coding. GLUT is historically a popular option; however, it is deprecated. A
modernized extension is freeglut. Other related options are CPW, GLOW, and GLUI.

One of the most popular options, and the one recommended for this class, is GLFW,
which has built-in support for Windows, Macintosh, Linux, ... etc. It must be
compiled for the machine on which it will run. Compiling GLFW requires downloading
and installing CMake first. Follow the following steps to compile GLFW.

1. Download the GLFW (GLFW 3.3.7) source code at www.glfw.org (if you download the
   pre-compiled binaries "glfw-3.3.7.bin.WIN64.zip", you don't have to go through
   the following steps, simply uncompress the zip file).

2. If you are on Windows or macOS, download the installer, 

      cmake-3.24.0-rc2-windows-x86_64.msi,

   from this site, and then double-click the installer to have CMake installed on 
   your machine. The default path for CMake is "C:\Program Files\CMake". If you
   are on a Unix-like system such as Linux, install its CMake package. 

3. Follow the compilation guide, or the following steps to have GLFW compiled.

4. Run cmake-gui.exe, which should be in the "bin" subfolder of "CMake".
   A GUI similar to what is shown below will appear. The top two entries are the
   GLFW source code location and the desired build destination folder (where the
   resulting binaries should be placed; e.g., you may set it to be "glfw-build").
   You should set these two values first. If the desired build destination folder
   you specify does not exist, it will be created for you (see instructions for
   how to run CMake on UNIX).

   
   CMake-gui

5. Click "configure" - if some of the options highlight in red, click "configure"
   again.

6. Click "generate".
 
CMake produces several files in the "build" folder specified. One of the files in
that folder is named "GLFW.sln". This is a Visual Studio project file. Use Visual
Studio to open it and compile (build) GLFW as a 64-bit application.

The resulting build produces two items that we need:

* the glfw3.lib file produced by the above compilation steps (if you downloaded
  "glfw-3.3.7.bin.WIN64.zip", then simply take the glfw3.lib file from the folder
  "lib-vc20xx" that matches the version of your Visual Studio)

* the "GLFW" folder in the originally downloaded GLFW source code (it is found in
  the "include" folder, and it contains two header files that we will use)