mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-02 16:06:19 +00:00
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 <mail@eliasnaur.com>
This commit is contained in:
+2
-2
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user