No longer tries to VID_Shutdown if VID_Init didn't, prevents a sig11.

This commit is contained in:
Joseph Carter 2000-04-17 14:49:32 +00:00
parent 9cd517debc
commit 46972d9429

View file

@ -1,7 +1,7 @@
/*
gl_vidglx.c
(description)
OpenGL GLX video driver
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999-2000 Nelson Rush.
@ -80,6 +80,8 @@
#define WARP_WIDTH 320
#define WARP_HEIGHT 200
static qboolean vid_initialized = false;
static int screen;
Window x_win;
static GLXContext ctx = NULL;
@ -153,6 +155,9 @@ void D_EndDirectRect (int x, int y, int width, int height)
void
VID_Shutdown(void)
{
if (!vid_initialized)
return;
Con_Printf("VID_Shutdown\n");
glXDestroyContext(x_disp, ctx);
@ -175,6 +180,7 @@ VID_Shutdown(void)
#endif
x11_close_display();
}
static void
signal_handler(int sig)
{
@ -558,6 +564,8 @@ void VID_Init(unsigned char *palette)
Con_SafePrintf ("Video mode %dx%d initialized.\n",
width, height);
vid_initialized = true;
vid.recalc_refdef = 1; // force a surface cache flush
}