The book “Interactive Computer Graphics, A Top Down Approach with Shader Based OpenGL, 6th Edition” shows a minimum snippet of fragment shader in page 86 as follows:
But another book “OpenGL Programming Guide, the official guide to learning OpenGL, version 4.3” says in page 675 that in modern version of OpenGL (at least 4.3), the following are all built-in variables we have in a fragment shader:
I can not find any variable named “gl_FragColor” appearing in the list. So, does the second book miss anything, or the first book is out-of-date (although it’s the latest version of the book)? If the latter is true, i.e., the “gl_FragColor” is obsolete, what is the new name of the variable corresponding to “gl_FragColor” in OpenGL version 4.4 that can set the pixel color to red using the code similar to that in the first image? Thank you.