PDA

View Full Version : WGL_EXT_swap_control extension present? to activate it?



danipellex
07-01-2013, 03:31 AM
Hi,
in my multiplatform OpenGL application, i require WGL_EXT_swap_control extension capability.
I have it running properly on Linux and MacOSX.

In WinXP and Win7, glGetString(GL_EXTENSIONS) returns null (i still dont kwno why), so,
- how to know if WGL_EXT_swap_control extension is present?
- how to enable it?

regards
dani

mbentrup
07-01-2013, 05:39 AM
Hi,
in my multiplatform OpenGL application, i require WGL_EXT_swap_control extension capability.
I have it running properly on Linux and MacOSX.

In WinXP and Win7, glGetString(GL_EXTENSIONS) returns null (i still dont kwno why), so,
- how to know if WGL_EXT_swap_control extension is present?
- how to enable it?

regards
dani

glGetString(GL_EXTENSIONS) is usually only NULL when you have no current OpenGL context. Also WGL_EXT_swap_control is not a GL extension, but a WGL extension, so you should use wglGetExtensionsStringEXT to query if it is available.

This is the only WGL extension that is also available in the GL_EXTENSIONs for historical reasons, so your code would work, but better do it right.

As it is an WGL extension, it's also clear that it is not available on non-Windows OSes, but there is an equivalent GLX_EXT_swap_control extension.