diff options
author | x2048 <codeforsmile@gmail.com> | 2022-12-29 22:44:03 +0100 |
---|---|---|
committer | x2048 <codeforsmile@gmail.com> | 2022-12-29 22:48:36 +0100 |
commit | 61af99adfa32b23c847b44515f947551b9eb05e7 (patch) | |
tree | ea34934cdbe4b86de6344dd4dce7d332627e03a8 | |
parent | a549d0bfed02801d642ef281697f8ac7c3dbc2cf (diff) | |
download | irrlicht-61af99adfa32b23c847b44515f947551b9eb05e7.tar.xz |
Use swap_control from MESA and EXT before SGI
SGI does not support disabling vsync (interval == 0)
-rw-r--r-- | source/Irrlicht/COpenGLExtensionHandler.h | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/source/Irrlicht/COpenGLExtensionHandler.h b/source/Irrlicht/COpenGLExtensionHandler.h index 4f88324..960b7f6 100644 --- a/source/Irrlicht/COpenGLExtensionHandler.h +++ b/source/Irrlicht/COpenGLExtensionHandler.h @@ -3401,33 +3401,32 @@ inline void COpenGLExtensionHandler::extGlSwapInterval(int interval) #endif
#endif
#ifdef _IRR_COMPILE_WITH_X11_DEVICE_
- //TODO: Check GLX_EXT_swap_control and GLX_MESA_swap_control
-#ifdef GLX_SGI_swap_control
- // does not work with interval==0
+#if defined(GLX_MESA_swap_control)
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
- if (interval && pGlxSwapIntervalSGI)
- pGlxSwapIntervalSGI(interval);
+ if (pGlxSwapIntervalMESA)
+ pGlxSwapIntervalMESA(interval);
#else
- if (interval)
- glXSwapIntervalSGI(interval);
+ pGlXSwapIntervalMESA(interval);
#endif
#elif defined(GLX_EXT_swap_control)
-#ifdef _IRR_OPENGL_USE_EXTPOINTER_
Display *dpy = glXGetCurrentDisplay();
GLXDrawable drawable = glXGetCurrentDrawable();
-
+#ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlxSwapIntervalEXT)
pGlxSwapIntervalEXT(dpy, drawable, interval);
#else
pGlXSwapIntervalEXT(dpy, drawable, interval);
#endif
-#elif defined(GLX_MESA_swap_control)
+#elif defined(GLX_SGI_swap_control)
+ // does not work with interval==0
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
- if (pGlxSwapIntervalMESA)
- pGlxSwapIntervalMESA(interval);
+ if (interval && pGlxSwapIntervalSGI)
+ pGlxSwapIntervalSGI(interval);
#else
- pGlXSwapIntervalMESA(interval);
+ if (interval)
+ glXSwapIntervalSGI(interval);
#endif
+ }
#endif
#endif
}
|