The OpenGL SuperBible (6th edition) seems to have much better example code, for OpenGL 4.3, than the Red Book (8th edition).

You can download the source from git here:
(In Linux, just type git clone
and download the media files here:

Currently there is a bug in the CmakeLists.txt that prevents linking on Linux systmes, in line 13 you need to change “elif (UNIX)” to “elseif (UNIX)” and you should be fine.

The SuperBible example code is based on glfw and in Linux you also need to install GLX and GL headers and libs.