mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-05 08:51:18 -05:00
Log available swap functions, possible fix for DRI2SwapInterval
This commit is contained in:
parent
a1d1c9e1d9
commit
e4c942c714
@ -180,7 +180,7 @@ void SDRThread::threadMain() {
|
|||||||
if (new_freq < sampleRate / 2) {
|
if (new_freq < sampleRate / 2) {
|
||||||
new_freq = sampleRate / 2;
|
new_freq = sampleRate / 2;
|
||||||
}
|
}
|
||||||
std::cout << "Set frequency: " << new_freq << std::endl;
|
// std::cout << "Set frequency: " << new_freq << std::endl;
|
||||||
break;
|
break;
|
||||||
case SDRThreadCommand::SDR_THREAD_CMD_SET_OFFSET:
|
case SDRThreadCommand::SDR_THREAD_CMD_SET_OFFSET:
|
||||||
offset_changed = true;
|
offset_changed = true;
|
||||||
|
@ -34,7 +34,7 @@ void initGLExtensions() {
|
|||||||
|
|
||||||
const GLubyte *extensions = glGetString(GL_EXTENSIONS);
|
const GLubyte *extensions = glGetString(GL_EXTENSIONS);
|
||||||
|
|
||||||
std::cout << "Supported GL Extensions: " << extensions << std::endl;
|
std::cout << std::endl << "Supported GL Extensions: " << std::endl << extensions << std::endl << std::endl;
|
||||||
|
|
||||||
int interval = 2;
|
int interval = 2;
|
||||||
|
|
||||||
@ -57,28 +57,40 @@ void initGLExtensions() {
|
|||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
dlopen("libglx.so",RTLD_LAZY);
|
dlopen("libglx.so",RTLD_LAZY);
|
||||||
|
|
||||||
void (*glxSwapIntervalEXTFunc) (Display *dpy, GLXDrawable drawable, int interval);
|
void (*glxSwapIntervalEXTFunc) (Display *dpy, GLXDrawable drawable, int interval) = 0;
|
||||||
int (*glxSwapIntervalMESAFunc)(unsigned int interval);
|
int (*glxSwapIntervalMESAFunc)(unsigned int interval) = 0;
|
||||||
int (*glxSwapIntervalSGIFunc) (int interval);
|
int (*glxSwapIntervalSGIFunc) (int interval) = 0;
|
||||||
void (*DRI2SwapIntervalFunc) (Display *dpy, XID drawable, int interval);
|
void (*DRI2SwapIntervalFunc) (Display *dpy, XID drawable, int interval) = 0;
|
||||||
|
|
||||||
glxSwapIntervalEXTFunc = (void (*) (Display *dpy, GLXDrawable drawable, int interval)) dlsym(RTLD_DEFAULT,"glXSwapIntervalEXT");
|
glxSwapIntervalEXTFunc = (void (*) (Display *dpy, GLXDrawable drawable, int interval)) dlsym(RTLD_DEFAULT,"glXSwapIntervalEXT");
|
||||||
glxSwapIntervalMESAFunc = (int (*)(unsigned int interval)) dlsym(RTLD_DEFAULT,"glXSwapIntervalMESA");
|
glxSwapIntervalMESAFunc = (int (*)(unsigned int interval)) dlsym(RTLD_DEFAULT,"glXSwapIntervalMESA");
|
||||||
glxSwapIntervalSGIFunc = (int (*) (int interval)) dlsym(RTLD_DEFAULT,"glXSwapIntervalSGI");
|
glxSwapIntervalSGIFunc = (int (*) (int interval)) dlsym(RTLD_DEFAULT,"glXSwapIntervalSGI");
|
||||||
DRI2SwapIntervalFunc = (void (*) (Display *dpy, XID drawable, int interval)) dlsym(RTLD_DEFAULT,"DRI2SwapInterval");
|
DRI2SwapIntervalFunc = (void (*) (Display *dpy, XID drawable, int interval)) dlsym(RTLD_DEFAULT,"DRI2SwapInterval");
|
||||||
|
|
||||||
|
std::cout << "Available vertical sync SwapInterval functions: " << std::endl;
|
||||||
|
std::cout << "\tglxSwapIntervalEXT: " << ((glxSwapIntervalEXTFunc != 0)?"Yes":"No") << std::endl;
|
||||||
|
std::cout << "\tDRI2SwapInterval: " << ((DRI2SwapIntervalFunc != 0)?"Yes":"No") << std::endl;
|
||||||
|
std::cout << "\tglxSwapIntervalMESA: " << ((glxSwapIntervalMESAFunc != 0)?"Yes":"No") << std::endl;
|
||||||
|
std::cout << "\tglxSwapIntervalSGI: " << ((glxSwapIntervalSGIFunc != 0)?"Yes":"No") << std::endl;
|
||||||
|
|
||||||
if (glxSwapIntervalEXTFunc) {
|
if (glxSwapIntervalEXTFunc) {
|
||||||
Display *dpy = glXGetCurrentDisplay();
|
Display *dpy = glXGetCurrentDisplay();
|
||||||
GLXDrawable drawable = glXGetCurrentDrawable();
|
GLXDrawable drawable = glXGetCurrentDrawable();
|
||||||
glxSwapIntervalEXTFunc(dpy, drawable, interval);
|
glxSwapIntervalEXTFunc(dpy, drawable, interval);
|
||||||
} else if (DRI2SwapInterval) {
|
std::cout << "Using glxSwapIntervalEXT." << std::endl << std::endl;
|
||||||
|
} else if (DRI2SwapIntervalFunc) {
|
||||||
Display *dpy = glXGetCurrentDisplay();
|
Display *dpy = glXGetCurrentDisplay();
|
||||||
GLXDrawable drawable = glXGetCurrentDrawable();
|
GLXDrawable drawable = glXGetCurrentDrawable();
|
||||||
DRI2SwapInterval(dpy, drawable, interval);
|
DRI2SwapIntervalFunc(dpy, drawable, interval);
|
||||||
|
std::cout << "Using DRI2SwapInterval." << std::endl << std::endl;
|
||||||
} else if (glxSwapIntervalMESAFunc) {
|
} else if (glxSwapIntervalMESAFunc) {
|
||||||
glxSwapIntervalMESAFunc(interval);
|
glxSwapIntervalMESAFunc(interval);
|
||||||
|
std::cout << "Using glxSwapIntervalMESA." << std::endl << std::endl;
|
||||||
} else if (glxSwapIntervalSGIFunc) {
|
} else if (glxSwapIntervalSGIFunc) {
|
||||||
glxSwapIntervalSGIFunc(interval);
|
glxSwapIntervalSGIFunc(interval);
|
||||||
|
std::cout << "Using glxSwapIntervalSGI." << std::endl << std::endl;
|
||||||
|
} else {
|
||||||
|
std::cout << "No vertical sync swap interval functions available." << std::endl;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user