The correct way to access the newer features is via the GL extension mechanism. You are fine with mesa's GL.h
. What you need is a current version of glext.h
(which does come with the nivida drivers, iirc, but can also be found on the official opengl site). YOu then would have to query a function pointer for any function you plan to call, on your platform probably via glXGetProcAddress()
.
A more convenient way is to use an OpenGL loader library like glew, which will do all this for you.
Note that you could, in theory, #define GL_GLEXT_PROTOTYPES
before including glext.h
and directly call the functions. This is likely to work with the nvidia driver (and some others on your platform), but not guaranteed to work by any spec. And it is never going to work on other platforms, like Windows.