diff options
author | Benjamin Otte <otte@redhat.com> | 2023-04-25 21:30:32 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2023-04-27 02:13:32 +0200 |
commit | 919c90182fd0bdcb34a055ec24dc497b622ecc8f (patch) | |
tree | 22e4d288073673380b1a1f71c6f8e0beaf43c161 /gdk | |
parent | ab2a548479824d3796236c85e5610e964a9689d7 (diff) | |
download | gtk+-919c90182fd0bdcb34a055ec24dc497b622ecc8f.tar.gz |
win32: Pass the version properly through the creation stack
We were using major/minor instead of GdkGLVersion.
And we were resetting back to 0 and ignoring the required min version
which we should not do.
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/win32/gdkglcontext-win32-wgl.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/gdk/win32/gdkglcontext-win32-wgl.c b/gdk/win32/gdkglcontext-win32-wgl.c index 80995fdcce..60097ecd01 100644 --- a/gdk/win32/gdkglcontext-win32-wgl.c +++ b/gdk/win32/gdkglcontext-win32-wgl.c @@ -340,8 +340,7 @@ create_wgl_context_with_attribs (HDC hdc, HGLRC hglrc_base, GdkGLContext *share, int flags, - int major, - int minor, + GdkGLVersion *version, gboolean *is_legacy) { HGLRC hglrc; @@ -356,8 +355,8 @@ create_wgl_context_with_attribs (HDC hdc, int attribs[] = { WGL_CONTEXT_PROFILE_MASK_ARB, profile, - WGL_CONTEXT_MAJOR_VERSION_ARB, *is_legacy ? 3 : major, - WGL_CONTEXT_MINOR_VERSION_ARB, *is_legacy ? 0 : minor, + WGL_CONTEXT_MAJOR_VERSION_ARB, gdk_gl_version_get_major (version), + WGL_CONTEXT_MINOR_VERSION_ARB, gdk_gl_version_get_minor (version), WGL_CONTEXT_FLAGS_ARB, flags, 0 }; @@ -373,13 +372,12 @@ create_wgl_context_with_attribs (HDC hdc, } static HGLRC -create_wgl_context (HDC hdc, - GdkGLContext *share, - int flags, - int major, - int minor, - gboolean *is_legacy, - gboolean hasWglARBCreateContext) +create_wgl_context (HDC hdc, + GdkGLContext *share, + int flags, + GdkGLVersion *version, + gboolean *is_legacy, + gboolean hasWglARBCreateContext) { /* We need a legacy context for *all* cases */ HGLRC hglrc_base = wglCreateContext (hdc); @@ -415,8 +413,7 @@ create_wgl_context (HDC hdc, hglrc_base, share, flags, - major, - minor, + version, is_legacy); /* return the legacy context we have if it could be setup properly, in case the 3.0+ context creation failed */ @@ -429,7 +426,7 @@ create_wgl_context (HDC hdc, hglrc_base, share, flags, - 0, 0, + version, is_legacy); *is_legacy = TRUE; @@ -581,8 +578,7 @@ gdk_win32_gl_context_wgl_realize (GdkGLContext *context, hglrc = create_wgl_context (hdc, share, flags, - gdk_gl_version_get_major (&version), - gdk_gl_version_get_minor (&version), + &version, &legacy_bit, display_win32->hasWglARBCreateContext); |