From ff2aac0f31b2532e6b4ab349a712c47541c92eb3 Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Fri, 22 Dec 2023 02:00:33 +0400 Subject: [PATCH] egl: set context version when egl < 1.5 Signed-off-by: p0ryae Fixes #1647. --- CHANGELOG.md | 2 ++ glutin/src/api/egl/context.rs | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 368aa0a386..c33c607a4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Unreleased +- Fixed EGL not setting context version with EGL versions before 1.5 and missing context ext. + # Version 0.31.1 - Fixed `CGLContextObj` having an invalid encoding on newer macOS versions. diff --git a/glutin/src/api/egl/context.rs b/glutin/src/api/egl/context.rs index 04f0d0e43b..bf26d6dae2 100644 --- a/glutin/src/api/egl/context.rs +++ b/glutin/src/api/egl/context.rs @@ -117,6 +117,12 @@ impl Display { attrs.push(egl::CONTEXT_FLAGS_KHR as EGLint); attrs.push(flags as EGLint); } + } else if self.inner.version >= Version::new(1, 3) { + // EGL 1.3 uses that to indicate client version instead of major/minor. + if let Some(version) = version { + attrs.push(egl::CONTEXT_CLIENT_VERSION as EGLint); + attrs.push(version.major as EGLint); + } } attrs.push(egl::NONE as EGLint);