[gtk/wip/otte/gleanup: 67/69] GDK-Win32: init_gl(): Default to WGL for now
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/gleanup: 67/69] GDK-Win32: init_gl(): Default to WGL for now
- Date: Thu, 22 Jul 2021 14:33:15 +0000 (UTC)
commit bd69d7e23f5086a7191cacdefd22367bb8169e7d
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Mon Jul 19 10:48:03 2021 +0800
GDK-Win32: init_gl(): Default to WGL for now
Since the shaders need to be updated for using with GLES (libANGLE at
least), default to WGL for now. Unfortunately it is not that common for
Windows to have GLES support, in which the easiest way to obtain such
support is via Google's libANGLE.
gdk/win32/gdkdisplay-win32.c | 25 +++++++------------------
1 file changed, 7 insertions(+), 18 deletions(-)
---
diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c
index 6b286fadb6..ab6544a79b 100644
--- a/gdk/win32/gdkdisplay-win32.c
+++ b/gdk/win32/gdkdisplay-win32.c
@@ -1165,32 +1165,21 @@ gdk_win32_display_init_gl_backend (GdkDisplay *display,
if (GDK_DISPLAY_DEBUG_CHECK (display, GL_WGL))
return gdk_win32_display_init_wgl (display, error);
- /* No env vars set, do the regular GL initialization.
- *
- * We try EGL first if supported, but are very picky about what we accept.
- * If that fails, we try to go with WGL instead.
- * And if that also fails, we try EGL again, but this time accept anything.
- *
- * The idea here is that EGL is the preferred method going forward, but WGL is
- * the tried and tested method that we know works. So if we detect issues with
- * EGL, we want to avoid using it in favor of WGL.
+ /* No env vars set, do the regular GL initialization, first WGL and then EGL,
+ * as WGL is the more tried-and-tested configuration.
*/
-#ifdef GDK_WIN32_ENABLE_EGL
- if (gdk_win32_display_init_egl (display, error))
- return TRUE;
-#endif
- g_clear_error (error);
-
if (gdk_win32_display_init_wgl (display, error))
return TRUE;
g_clear_error (error);
#ifdef GDK_WIN32_ENABLE_EGL
- return gdk_win32_display_init_egl (display, error);
-#else
- return FALSE;
+ if (gdk_win32_display_init_egl (display, error))
+ return TRUE;
#endif
+ g_clear_error (error);
+
+ return gdk_win32_display_init_wgl (display, error);
}
static GdkGLContext *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]