mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-28 14:53:16 +00:00
context_x11.c: whitespace.
dga_check.c: Make sure that the version of the VidMode extension at runtime is the same version we compiled with, to deal with a structure change that occurred between VidMode extension versions 1 and 2. If a version 3 is developed, this will have to be fixed again.
This commit is contained in:
parent
549bbbdb1b
commit
443944c48b
2 changed files with 23 additions and 15 deletions
|
@ -40,6 +40,11 @@
|
|||
#endif
|
||||
#ifdef HAVE_VIDMODE
|
||||
# include <X11/extensions/xf86vmode.h>
|
||||
# ifdef X_XF86VidModeSetClientVersion
|
||||
# define VIDMODE_VERSION 2
|
||||
# else
|
||||
# define VIDMODE_VERSION 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include "dga_check.h"
|
||||
|
@ -54,7 +59,8 @@ qboolean
|
|||
VID_CheckDGA (Display * dpy, int *maj_ver, int *min_ver, int *hasvideo)
|
||||
{
|
||||
#ifdef HAVE_DGA
|
||||
int event_base, error_base, dgafeat, dummy;
|
||||
int event_base, error_base, dgafeat;
|
||||
int dummy, dummy_major, dummy_minor, dummy_video;
|
||||
|
||||
if (!XQueryExtension (dpy, "XFree86-DGA", &dummy, &dummy, &dummy)) {
|
||||
return false;
|
||||
|
@ -65,16 +71,16 @@ VID_CheckDGA (Display * dpy, int *maj_ver, int *min_ver, int *hasvideo)
|
|||
}
|
||||
|
||||
if (!maj_ver)
|
||||
maj_ver = &dummy;
|
||||
maj_ver = &dummy_major;
|
||||
if (!min_ver)
|
||||
min_ver = &dummy;
|
||||
min_ver = &dummy_minor;
|
||||
|
||||
if (!XF86DGAQueryVersion (dpy, maj_ver, min_ver)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!hasvideo)
|
||||
hasvideo = &dummy;
|
||||
hasvideo = &dummy_video;
|
||||
|
||||
if (!XF86DGAQueryDirectVideo (dpy, DefaultScreen (dpy), &dgafeat)) {
|
||||
*hasvideo = 0;
|
||||
|
@ -101,9 +107,9 @@ VID_CheckDGA (Display * dpy, int *maj_ver, int *min_ver, int *hasvideo)
|
|||
qboolean
|
||||
VID_CheckVMode (Display * dpy, int *maj_ver, int *min_ver)
|
||||
{
|
||||
#if defined(HAVE_VIDMODE)
|
||||
#ifdef HAVE_VIDMODE
|
||||
int event_base, error_base;
|
||||
int dummy;
|
||||
int dummy, dummy_major, dummy_minor;
|
||||
|
||||
if (!XQueryExtension (dpy, "XFree86-VidModeExtension", &dummy, &dummy, &dummy)) {
|
||||
return false;
|
||||
|
@ -113,14 +119,16 @@ VID_CheckVMode (Display * dpy, int *maj_ver, int *min_ver)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (maj_ver == NULL)
|
||||
maj_ver = &dummy;
|
||||
if (min_ver == NULL)
|
||||
min_ver = &dummy;
|
||||
if (!maj_ver)
|
||||
maj_ver = &dummy_major;
|
||||
if (!min_ver)
|
||||
min_ver = &dummy_minor;
|
||||
|
||||
if (!XF86VidModeQueryVersion (dpy, maj_ver, min_ver)) {
|
||||
if (!XF86VidModeQueryVersion (dpy, maj_ver, min_ver))
|
||||
return false;
|
||||
|
||||
if ((!maj_ver) || (*maj_ver != VIDMODE_VERSION))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
#else
|
||||
|
|
Loading…
Reference in a new issue