mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 15:45:38 +00:00
app/internal/egl: try EGL_DEFAULT_DISPLAY is eglGetDisplay fails
Fixes #77 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -93,6 +93,12 @@ func NewContext(disp NativeDisplayType) (*Context, error) {
|
||||
return nil, err
|
||||
}
|
||||
eglDisp := eglGetDisplay(disp)
|
||||
// eglGetDisplay can return EGL_NO_DISPLAY yet no error
|
||||
// (EGL_SUCCESS), in which case a default EGL display might be
|
||||
// available.
|
||||
if eglDisp == nilEGLDisplay {
|
||||
eglDisp = eglGetDisplay(EGL_DEFAULT_DISPLAY)
|
||||
}
|
||||
if eglDisp == nilEGLDisplay {
|
||||
return nil, fmt.Errorf("eglGetDisplay failed: 0x%x", eglGetError())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user