diff --git a/engine/gl/gl_videgl.c b/engine/gl/gl_videgl.c index 4025f3215..04453ed6c 100644 --- a/engine/gl/gl_videgl.c +++ b/engine/gl/gl_videgl.c @@ -189,6 +189,8 @@ qboolean EGL_Init (rendererstate_t *info, unsigned char *palette, EGLNativeWindo } */ egldpy = qeglGetDisplay(dpy); + if (egldpy == EGL_NO_DISPLAY) + egldpy = qeglGetDisplay(EGL_DEFAULT_DISPLAY); if (egldpy == EGL_NO_DISPLAY) { Con_Printf(CON_ERROR "EGL: can't get display!\n"); diff --git a/engine/gl/gl_vidlinuxglx.c b/engine/gl/gl_vidlinuxglx.c index d2ffefe24..b5b31ec85 100644 --- a/engine/gl/gl_vidlinuxglx.c +++ b/engine/gl/gl_vidlinuxglx.c @@ -1483,7 +1483,12 @@ qboolean X11VID_Init (rendererstate_t *info, unsigned char *palette, int psl) break; #ifdef USE_EGL case PSL_EGL: - EGL_Init(info, palette, vid_window, vid_dpy); + if (!EGL_Init(info, palette, vid_window, vid_dpy)) + { + Con_Printf("Failed to create EGL context.\n"); + GLVID_Shutdown(); + return false; + } GL_Init(&EGL_Proc); break; #endif