View Full Version : How to access OpenGL Extensions under Windows?

06-03-2014, 11:41 PM
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: http://msdn.microsoft.com/en-us/library/windows/desktop/ee872027%28v=vs.85%29.aspx, 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.

06-04-2014, 01:25 AM
Even the Red book is not what it was once. ;)

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 (http://www.opengl.org/registry). Also, I recommend directly accessing required function with wglGetProcAddress(). If the function returns NULL it means the required extension is not supported.

06-04-2014, 03:18 AM
Thank you, @Aleksandar.