[gtk/wip.win32.fixes: 11/23] glcontext-win32-wgl: Respect user required version, use display as minimum
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip.win32.fixes: 11/23] glcontext-win32-wgl: Respect user required version, use display as minimum
- Date: Wed, 1 Jun 2022 02:26:59 +0000 (UTC)
commit be9b05335a0f88b021363d445a122b61f74385e3
Author: Pablo Correa Gómez <ablocorrea hotmail com>
Date: Sat May 28 00:58:43 2022 +0200
glcontext-win32-wgl: Respect user required version, use display as minimum
By setting and then getting the required version in a context, the code
was not respecting user requirements. Instead, simply get the requested
version by the user clipped by the requirements (display version)
gdk/win32/gdkglcontext-win32-wgl.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
---
diff --git a/gdk/win32/gdkglcontext-win32-wgl.c b/gdk/win32/gdkglcontext-win32-wgl.c
index 231f2a6a01..d7ff4367f2 100644
--- a/gdk/win32/gdkglcontext-win32-wgl.c
+++ b/gdk/win32/gdkglcontext-win32-wgl.c
@@ -548,17 +548,12 @@ gdk_win32_gl_context_wgl_realize (GdkGLContext *context,
* wglCreateContextAttribsARB() may only give us the GL context version
* that we ask for here, and nothing more. So, improve things here by
* asking for the GL version that is reported to us via epoxy_gl_version(),
- * rather than the default GL core 3.2 context. Save this up in our
- * GdkGLContext so that subsequent contexts that are shared with this
- * context are created likewise too.
+ * rather than the default GL core 3.2 context.
*/
- if (share != NULL)
- gdk_gl_context_get_required_version (share, &major, &minor);
- else
- {
- major = display_win32->gl_version / 10;
- minor = display_win32->gl_version % 10;
- }
+ gdk_gl_context_get_clipped_version (context,
+ display_win32->gl_version / 10,
+ display_win32->gl_version % 10,
+ &major, &minor);
if (surface != NULL)
hdc = GDK_WIN32_SURFACE (surface)->hdc;
@@ -626,7 +621,6 @@ gdk_win32_gl_context_wgl_realize (GdkGLContext *context,
/* Ensure that any other context is created with a legacy bit set */
gdk_gl_context_set_is_legacy (context, legacy_bit);
- gdk_gl_context_set_required_version (context, major, minor);
return GDK_GL_API_GL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]