diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2022-03-30 10:23:49 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2022-03-30 16:09:18 +0800 |
commit | 89d87e34827ff6d954cbc45b8e9e42b4ec17a987 (patch) | |
tree | 2a15e6fa944c8d0cbe12fd0b058f2d1cd04d2058 | |
parent | 04c9c6b4284110746089adadc12701b7f3bbf379 (diff) | |
download | gtk+-89d87e34827ff6d954cbc45b8e9e42b4ec17a987.tar.gz |
inspector/general.c: Check whether GL context supports WGL
We may well be using an EGL context that does not support Desktop (W)GL on
Windows, such as in the case of using libANGLE. So, check whether WGL is
supported for this running instance before trying to query WGL extensions.
This will get rid of warning messages from libepoxy.
-rw-r--r-- | gtk/inspector/general.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gtk/inspector/general.c b/gtk/inspector/general.c index ad52422fa3..f456ea0da4 100644 --- a/gtk/inspector/general.c +++ b/gtk/inspector/general.c @@ -45,12 +45,12 @@ #ifdef GDK_WINDOWING_WIN32 #include "win32/gdkwin32.h" +#include "gdkglcontextprivate.h" #include <epoxy/wgl.h> -#endif - #ifdef GDK_WIN32_ENABLE_EGL #include <epoxy/egl.h> #endif +#endif #ifdef GDK_WINDOWING_MACOS #include "macos/gdkmacos.h" @@ -387,7 +387,8 @@ init_gl (GtkInspectorGeneral *gen) else #endif #ifdef GDK_WINDOWING_WIN32 - if (GDK_IS_WIN32_DISPLAY (gen->display)) + if (GDK_IS_WIN32_DISPLAY (gen->display) && + gdk_gl_backend_can_be_used (GDK_GL_WGL, NULL)) { int gl_version; char *version; |