Basic elements of the OpenGL 4 renderer
To be able to use OpenGL in our code, we need access to its functions and extensions. Unfortunately, the graphics card vendors do not create these functions in an easy-to-use way. They are stored as function pointers, which will be hard to use.
To translate the function pointers back to more human-readable function names, several helper libraries exist. We will use the Glad tool for this translation.
The OpenGL loader generator Glad
Glad is a free and open source loader generator; all parts to make OpenGL fully available for us are included. Glad supports all OpenGL versions, even back to the first version (1.0), plus the mobile variant OpenGL for Embedded Systems (ES) and the platform-specific APIs for Microsoft Windows and the X Window System of Unix.
You can access the web service at https://glad.dav1d.de, which should open this screen:
Figure 2.2: The Glad web service, version selection
Select OpenGL...