Ensure we don't assert if GLX is not available

Certain X server do not have GLX enabled or supported, such as x2go. We
can handle this case gracefully inside libepoxy.

Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
macos/v1.5.9
Emmanuele Bassi 8 years ago
parent 5df022edb5
commit a15a92c2cb
  1. 6
      src/dispatch_glx.c

@ -57,11 +57,17 @@ epoxy_glx_version(Display *dpy, int screen)
int ret; int ret;
version_string = glXQueryServerString(dpy, screen, GLX_VERSION); version_string = glXQueryServerString(dpy, screen, GLX_VERSION);
if (!version_string)
return 0;
ret = sscanf(version_string, "%d.%d", &server_major, &server_minor); ret = sscanf(version_string, "%d.%d", &server_major, &server_minor);
assert(ret == 2); assert(ret == 2);
server = server_major * 10 + server_minor; server = server_major * 10 + server_minor;
version_string = glXGetClientString(dpy, GLX_VERSION); version_string = glXGetClientString(dpy, GLX_VERSION);
if (!version_string)
return 0;
ret = sscanf(version_string, "%d.%d", &client_major, &client_minor); ret = sscanf(version_string, "%d.%d", &client_major, &client_minor);
assert(ret == 2); assert(ret == 2);
client = client_major * 10 + client_minor; client = client_major * 10 + client_minor;

Loading…
Cancel
Save