From 998efee8c3856192f7b11991ae5d2320582dbc8e Mon Sep 17 00:00:00 2001 From: Spoike Date: Mon, 18 Apr 2005 05:35:23 +0000 Subject: [PATCH] Trying to fix bsd gl support. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@960 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_vidlinuxglx.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/engine/gl/gl_vidlinuxglx.c b/engine/gl/gl_vidlinuxglx.c index aeae97c6..cfd9d102 100644 --- a/engine/gl/gl_vidlinuxglx.c +++ b/engine/gl/gl_vidlinuxglx.c @@ -482,7 +482,8 @@ printf("GLVID_Shutdown"); if (old_windowed_mouse) uninstall_grabs(); - qglXDestroyContext(vid_dpy, ctx); + if (ctx) + qglXDestroyContext(vid_dpy, ctx); #ifdef WITH_VMODE if (origionalapplied) @@ -822,6 +823,12 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette) #endif ctx = qglXCreateContext(vid_dpy, visinfo, NULL, True); + if (!ctx) + { + Con_Printf("Failed to create GLX context.\n"); + GLVID_Shutdown(); + return false; + } qglXMakeCurrent(vid_dpy, vid_window, ctx);