From 55cb101be1802e6efb0c09778168a0445eb309c5 Mon Sep 17 00:00:00 2001 From: Spoike Date: Tue, 12 Mar 2013 23:00:29 +0000 Subject: [PATCH] ------------------------------------------------------------------------ r4213 | acceptthis | 2013-02-17 18:22:59 +0000 (Sun, 17 Feb 2013) | 1 line Try to use a default display if all else fails. ------------------------------------------------------------------------ git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4210 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_videgl.c | 2 ++ engine/gl/gl_vidlinuxglx.c | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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