How to access OpenGL Extensions under Windows?

The book “OpenGL programming guide: the official guide to learning opengl, version 4.3” claims in page 847:

But when I add the code

int nnn=glGetIntegerv(GL_NUM_EXTENSIONS);

, expecting I can be returned number of extensions, I got nothing but a lot of errors. I referred to MSDN document here: glGetIntegerv function (Gl.h) - Win32 apps | Microsoft Learn, but found that there is no GL_NUM_EXTENSIONS token supported. Is the author kidding me? If not, how to access OpenGL Extensions under Windows (using so-called glGetIntegerv or not)? Thank you.

Even the Red book is not what it was once. :wink:

Like everything else needed for the extensions, GL_NUM_EXTENSIONS can find in glext.h. Both glext.h and wglext.h can be downloaded from OpenGL registry. Also, I recommend directly accessing required function with wglGetProcAddress(). If the function returns NULL it means the required extension is not supported.

Thank you, @Aleksandar.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.