We are now going to add the code required to create an OpenGL window. We did this once for RoboRacer2D, but now, we are creating a 3D game and there will be some differences. Here's a look at what we need to do:
Include header files.
Define global variables.
Create the OpenGL window.
Initialize the OpenGL window.
Size the OpenGL window.
Remove the OpenGL window.
Create the Windows event handler.
Create the
WinMain
function.
Notice that we still have to create some code to satisfy Windows. We need an event handler to process Windows events, and we still need a main function to serve as the program entry point and run the main program loop. Everything else in this list is used to set up the OpenGL environment.