From 7c197cc666ab8f170ed9691c13cf65fb48973b78 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 12 Aug 2019 00:29:18 +0200 Subject: [PATCH] ui/app: support EGL versions >= 2.0 Versions with major > 1 don't exists, but let's handle the version correctly in any case. Signed-off-by: Elias Naur --- ui/app/egl.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/app/egl.go b/ui/app/egl.go index cc944b03..d4496262 100644 --- a/ui/app/egl.go +++ b/ui/app/egl.go @@ -195,13 +195,13 @@ func createContext(disp _EGLNativeDisplayType) (*eglContext, error) { if eglDisp == 0 { return nil, fmt.Errorf("eglGetDisplay(_EGL_DEFAULT_DISPLAY) failed: 0x%x", eglGetError()) } - _, minor, ret := eglInitialize(eglDisp) + major, minor, ret := eglInitialize(eglDisp) if !ret { return nil, fmt.Errorf("eglInitialize failed: 0x%x", eglGetError()) } // sRGB framebuffer support on EGL 1.5 or if EGL_KHR_gl_colorspace is supported. exts := strings.Split(eglQueryString(eglDisp, _EGL_EXTENSIONS), " ") - srgb := minor >= 5 || hasExtension(exts, "EGL_KHR_gl_colorspace") + srgb := major > 1 || minor >= 5 || hasExtension(exts, "EGL_KHR_gl_colorspace") attribs := []_EGLint{ _EGL_RENDERABLE_TYPE, _EGL_OPENGL_ES2_BIT, _EGL_SURFACE_TYPE, _EGL_WINDOW_BIT,