glGetString(GL_EXTENSIONS) vs wglGetExtensionsStringEXT

Viewed 353

I have thought that WGL extensions list can be retrieved only using wglGetExtensionsStringEXT. During debugging I have noticed that gl extensions list retrieved using glGetString(GL_EXTENSIONS) contains WGL_EXT_swap_control. I'm suprised. Is it an exception ? Could explain that ? I expect that glGetString(GL_EXTENSIONS) will not return any WGL extension.

1 Answers

The WGL_EXT_extensions_string function does state that implementations can advertise WGL extensions in the OpenGL extension string. This is due to the fact that, before this extension came into being, that's how WGL extensions worked: they were specified as part of the OpenGL extension string. So implementations would still advertise those extensions in their OpenGL strings.

Indeed, the WGL_EXT_extensions_string function specifically mentions WGL_EXT_swap_interval, since it (among others) predated WGL_EXT_extensions_string.

Related