static int GLXExtensionSupported(Display *dpy, const char *extension)
{
- const char *extensionsString, *client_extensions, *pos;
+ const char *extensionsString, *pos;
extensionsString = glXQueryExtensionsString(dpy, DefaultScreen(dpy));
- client_extensions = glXGetClientString(dpy, GLX_EXTENSIONS);
pos = strstr(extensionsString, extension);
- if (pos != NULL && (pos == extensionsString || pos[-1] == ' ') &&
- (pos[strlen(extension)] == ' ' || pos[strlen(extension)] == '\0'))
- return 1;
-
- pos = strstr(client_extensions, extension);
-
if (pos != NULL && (pos == extensionsString || pos[-1] == ' ') &&
(pos[strlen(extension)] == ' ' || pos[strlen(extension)] == '\0'))
return 1;
XMapWindow(disp, winGL);
ret = glXMakeCurrent(disp, winGL, context);
- if (ret) {
+ if (!ret) {
fprintf(stderr, "failed to make context current: %d\n", ret);
}
static int GLXExtensionSupported(Display *dpy, const char *extension)
{
- const char *extensionsString, *client_extensions, *pos;
+ const char *extensionsString, *pos;
extensionsString = glXQueryExtensionsString(dpy, DefaultScreen(dpy));
- client_extensions = glXGetClientString(dpy, GLX_EXTENSIONS);
pos = strstr(extensionsString, extension);
- if (pos != NULL && (pos == extensionsString || pos[-1] == ' ') &&
- (pos[strlen(extension)] == ' ' || pos[strlen(extension)] == '\0'))
- return 1;
-
- pos = strstr(client_extensions, extension);
-
if (pos != NULL && (pos == extensionsString || pos[-1] == ' ') &&
(pos[strlen(extension)] == ' ' || pos[strlen(extension)] == '\0'))
return 1;
glXMakeCurrent(disp, winGL, context);
- get_sync_values = glXGetProcAddress((unsigned char *)"glXGetSyncValuesOML");
- wait_sync = glXGetProcAddress((unsigned char *)"glXWaitForMscOML");
+ get_sync_values = (void *)glXGetProcAddress((unsigned char *)"glXGetSyncValuesOML");
+ wait_sync = (void *)glXGetProcAddress((unsigned char *)"glXWaitForMscOML");
if (!get_sync_values || !wait_sync) {
fprintf(stderr, "failed to get sync values function\n");
static int GLXExtensionSupported(Display *dpy, const char *extension)
{
- const char *extensionsString, *client_extensions, *pos;
+ const char *extensionsString, *pos;
extensionsString = glXQueryExtensionsString(dpy, DefaultScreen(dpy));
- client_extensions = glXGetClientString(dpy, GLX_EXTENSIONS);
pos = strstr(extensionsString, extension);
- if (pos != NULL && (pos == extensionsString || pos[-1] == ' ') &&
- (pos[strlen(extension)] == ' ' || pos[strlen(extension)] == '\0'))
- return 1;
-
- pos = strstr(client_extensions, extension);
-
if (pos != NULL && (pos == extensionsString || pos[-1] == ' ') &&
(pos[strlen(extension)] == ' ' || pos[strlen(extension)] == '\0'))
return 1;