I'm working on a C++ graphics library using OpenGL. I'm on Windows, which only supports OpenGL 1.1, and I therefore have to manually load the functions from the 4.6 version. My first thought was to use GLAD, which I've used before and does all the work for you in a single function call, but that isn't the approach I want to take. I have bad habit of wanting to know how everything works internally, so I then thought of making my own loader to fit into the library. Loading the functions worked just fine, but when I got to defining the accompanying macros, I got a little stuck. Unlike the functions, where the declaration of them is stated clearly in a standard, the macros doesn't seem to have any place, where their hexadecimal values are stated. For example, how am I supposed to know what hexadecimal value GL_COLOR_BUFFER_BIT
needs to have. I can look in the original OpenGL 1.1 header file, but that doesn't work with other newer macros like GL_VERTEX_SHADER
.
I have searched the internet to find some standard, reference or registry, where the values of these macros may be - but with no luck. GLAD seems to have all of these values magically, but how, I don't know. Can anyone with knowledge of OpenGL please explain this and maybe provide a link. I know how OpenGL works, but I'm new to OpenGL loaders.