[gtk+] x11: Query whether we have GLX support



commit 02eb344950547c66a9096094f271b98e94614fcb
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu Feb 16 00:04:50 2017 +0000

    x11: Query whether we have GLX support
    
    Epoxy 1.4 has new ad hoc API that we can use to check whether GLX is
    available on the current system.
    
    If we didn't use this API, we'd have to manually dlopen libGL (or its
    equivalent on different OSes) and check if it had GLX symbols; since
    Epoxy already does all of this internally, we can simply ask it instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=775279

 gdk/x11/gdkglcontext-x11.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c
index d76c29e..5a28f58 100644
--- a/gdk/x11/gdkglcontext-x11.c
+++ b/gdk/x11/gdkglcontext-x11.c
@@ -799,6 +799,9 @@ gdk_x11_screen_init_gl (GdkScreen *screen)
 
   dpy = gdk_x11_display_get_xdisplay (display);
 
+  if (!epoxy_has_glx (dpy))
+    return FALSE;
+
   if (!glXQueryExtension (dpy, &error_base, &event_base))
     return FALSE;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]