mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-09-03 13:47:53 -04:00
vsync patch for OSX
This commit is contained in:
parent
a3fac1e932
commit
c0e6ecb3eb
@ -2,6 +2,10 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#include <OpenGL/OpenGL.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
PFNWGLGETEXTENSIONSSTRINGEXTPROC wglGetExtensionsStringEXT = NULL;
|
PFNWGLGETEXTENSIONSSTRINGEXTPROC wglGetExtensionsStringEXT = NULL;
|
||||||
@ -41,22 +45,23 @@ void initGLExtensions() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
long l_interval= interval;
|
// OSX is just ON / OFF
|
||||||
CGLSetParameter (CGLGetCurrentContext(), kCGLCPSwapInterval, &l_interval);
|
const GLint gl_interval = 1;
|
||||||
|
CGLSetParameter (CGLGetCurrentContext(), kCGLCPSwapInterval, &gl_interval);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
char* pcDummy = NULL;
|
char* glext_str = NULL;
|
||||||
|
|
||||||
glXSwapIntervalSGIFunc glXSwapIntervalSGI = 0;
|
glXSwapIntervalSGIFunc glXSwapIntervalSGI = 0;
|
||||||
glXSwapIntervalMESAFunc glXSwapIntervalMESA = 0;
|
glXSwapIntervalMESAFunc glXSwapIntervalMESA = 0;
|
||||||
|
|
||||||
pcDummy = (char*)glXQueryExtensionsString (glXGetCurrentDisplay(), 0);
|
glext_str = (char*)glXQueryExtensionsString (glXGetCurrentDisplay(), 0);
|
||||||
if (strstr (pcDummy, "GLX_SGI_swap_control") != NULL) {
|
if (strstr (glext_str, "GLX_SGI_swap_control") != NULL) {
|
||||||
glXSwapIntervalSGI = (glXSwapIntervalSGIFunc) dlsym(RTLD_DEFAULT,"glXSwapIntervalSGI") && glXSwapIntervalSGI (interval);
|
glXSwapIntervalSGI = (glXSwapIntervalSGIFunc) dlsym(RTLD_DEFAULT,"glXSwapIntervalSGI") && glXSwapIntervalSGI (interval);
|
||||||
|
|
||||||
} else if (strstr(pcDummy, "GLX_MESA_swap_control") != NULL) {
|
} else if (strstr(glext_str, "GLX_MESA_swap_control") != NULL) {
|
||||||
glXSwapIntervalMESA = (glXSwapIntervalMESAFunc) dlsym(RTLD_DEFAULT,"glXSwapIntervalMESA") && glXSwapIntervalMESA (interval);
|
glXSwapIntervalMESA = (glXSwapIntervalMESAFunc) dlsym(RTLD_DEFAULT,"glXSwapIntervalMESA") && glXSwapIntervalMESA (interval);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user