diff options
author | x2048 <codeforsmile@gmail.com> | 2022-12-29 23:42:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-29 23:42:52 +0100 |
commit | 2ae816b5a61b0b83c61b5a755491fff27d2a395a (patch) | |
tree | 2179cba1b1129d43554a2fba801316193075d15d | |
parent | afbe41019cbc8fce5b5ea60b022c449a2f16a387 (diff) | |
parent | 61af99adfa32b23c847b44515f947551b9eb05e7 (diff) | |
download | irrlicht-2ae816b5a61b0b83c61b5a755491fff27d2a395a.tar.xz |
Use swap_control from MESA and EXT before SGI (#151)
SGI extension does not support interval == 0 (disabling VSync)
-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
}
|