Add the use of XQueryExtension() to the DGA and VidMode checks. The game

should no longer crash if the VidMode or DGA extensions are not present at
runtime.
This commit is contained in:
Jeff Teunissen 2000-12-19 02:42:26 +00:00
parent 9f0035bdf9
commit 2f8f1b39b7

View file

@ -56,6 +56,10 @@ VID_CheckDGA (Display * dpy, int *maj_ver, int *min_ver, int *hasvideo)
#ifdef HAVE_DGA #ifdef HAVE_DGA
int event_base, error_base, dgafeat, dummy; int event_base, error_base, dgafeat, dummy;
if (!XQueryExtension (dpy, "XFree86-DGA", &dummy, &dummy, &dummy)) {
return false;
}
if (!XF86DGAQueryExtension (dpy, &event_base, &error_base)) { if (!XF86DGAQueryExtension (dpy, &event_base, &error_base)) {
return false; return false;
} }
@ -97,6 +101,10 @@ VID_CheckVMode (Display * dpy, int *maj_ver, int *min_ver)
int event_base, error_base; int event_base, error_base;
int dummy; int dummy;
if (!XQueryExtension (dpy, "XFree86-VidModeExtension", &dummy, &dummy, &dummy)) {
return false;
}
if (!XF86VidModeQueryExtension (dpy, &event_base, &error_base)) { if (!XF86VidModeQueryExtension (dpy, &event_base, &error_base)) {
return false; return false;
} }