mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-25 05:21:58 +00:00
+set_vidfullscreen is 95% working for -x11 and -glx. only remaining known problem is mouse grabbing.
This commit is contained in:
parent
7df8031c9c
commit
290c2f9c0f
5 changed files with 43 additions and 20 deletions
23
configure.in
23
configure.in
|
@ -286,6 +286,17 @@ if test "x$no_x" = x; then
|
|||
fi
|
||||
AC_SUBST(X_SHM_LIB)
|
||||
|
||||
dnl Check for VIDMODE support
|
||||
AC_ARG_ENABLE(VIDMODE,
|
||||
[ --enable-VIDMODE use XFree86 VIDMODE extension, if available],
|
||||
HAVE_VIDMODE=$enable_VIDMODE, HAVE_VIDMODE=auto)
|
||||
if test "x$HAVE_VIDMODE" != xno; then
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$X_CFLAGS $CPPFLAGS"
|
||||
AC_CHECK_HEADER(X11/extensions/xf86vmode.h, HAVE_VIDMODE=yes, HAVE_VIDMODE=no)
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
fi
|
||||
|
||||
dnl Checks for GLX support
|
||||
AC_ARG_WITH(glx,
|
||||
[ --with-glx[=DIR] use GLX with libraries found in DIR],
|
||||
|
@ -412,6 +423,18 @@ fi
|
|||
AC_SUBST(GLX_CFLAGS)
|
||||
AC_SUBST(GLX_LIBS)
|
||||
|
||||
dnl Make sure VIDMODE works
|
||||
if test "x$HAVE_VIDMODE" = xyes; then
|
||||
AC_CHECK_LIB(Xxf86vm, XF86VidModeSwitchToMode,qwfoo=qwfoo,
|
||||
HAVE_VIDMODE=no HAVE_DGA=no, [$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
|
||||
fi
|
||||
if test "x$HAVE_VIDMODE" != xyes; then
|
||||
VIDMODE_LIBS=""
|
||||
else
|
||||
AC_DEFINE(HAVE_VIDMODE)
|
||||
VIDMODE_LIBS="-lXxf86vm"
|
||||
fi
|
||||
AC_SUBST(VIDMODE_LIBS)
|
||||
|
||||
dnl ==================================================================
|
||||
dnl Checks for system type
|
||||
|
|
|
@ -86,8 +86,8 @@ qf_server_LDADD= -L. -lqfsys_sv $(NET_LIBS)
|
|||
qf_client_mgl_LDADD= $(MGL_LIBS) $(CLIENT_LIBS)
|
||||
qf_client_ggi_LDADD= $(GGI_LIBS) $(CLIENT_LIBS)
|
||||
qf_client_svga_LDADD= $(SVGA_LIBS) $(CLIENT_LIBS)
|
||||
qf_client_x11_LDADD= $(X_PRE_LIBS) $(X_LIBS) -lX11 $(X_EXTRA_LIBS) $(X_SHM_LIB) $(CLIENT_LIBS)
|
||||
qf_client_glx_LDADD= $(GLX_LIBS) $(X_PRE_LIBS) $(X_LIBS) -lX11 $(X_EXTRA_LIBS) $(CLIENT_LIBS)
|
||||
qf_client_x11_LDADD= $(X_PRE_LIBS) $(VIDMODE_LIBS) $(X_LIBS) -lX11 $(X_EXTRA_LIBS) $(X_SHM_LIB) $(CLIENT_LIBS)
|
||||
qf_client_glx_LDADD= $(GLX_LIBS) $(X_PRE_LIBS) $(VIDMODE_LIBS) $(X_LIBS) -lX11 $(X_EXTRA_LIBS) $(CLIENT_LIBS)
|
||||
qf_client_wgl_LDADD= $(CLIENT_LIBS)
|
||||
|
||||
qf_server_DEPENDENCIES=libqfsys_sv.a
|
||||
|
|
|
@ -33,10 +33,10 @@
|
|||
#include <stdlib.h>
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
#if defined(HAS_DGA)
|
||||
#if defined(HAVE_DGA)
|
||||
#include <X11/extensions/xf86dga.h>
|
||||
#endif
|
||||
#if defined(HAS_VIDMODE)
|
||||
#if defined(HAVE_VIDMODE)
|
||||
#include <X11/extensions/xf86vmode.h>
|
||||
#endif
|
||||
|
||||
|
@ -51,7 +51,7 @@
|
|||
int
|
||||
VID_CheckDGA(Display *dpy, int *maj_ver, int *min_ver, int *hasvideo)
|
||||
{
|
||||
#if defined(HAS_DGA)
|
||||
#if defined(HAVE_DGA)
|
||||
int event_base, error_base, dgafeat, dummy;
|
||||
|
||||
if (! XF86DGAQueryExtension(dpy, &event_base, &error_base)) {
|
||||
|
@ -73,7 +73,7 @@ VID_CheckDGA(Display *dpy, int *maj_ver, int *min_ver, int *hasvideo)
|
|||
return 1;
|
||||
#else
|
||||
return 0;
|
||||
#endif // HAS_DGA
|
||||
#endif // HAVE_DGA
|
||||
}
|
||||
|
||||
|
||||
|
@ -85,7 +85,7 @@ VID_CheckDGA(Display *dpy, int *maj_ver, int *min_ver, int *hasvideo)
|
|||
int
|
||||
VID_CheckVMode(Display *dpy, int *maj_ver, int *min_ver)
|
||||
{
|
||||
#if defined(HAS_VIDMODE)
|
||||
#if defined(HAVE_VIDMODE)
|
||||
int event_base, error_base;
|
||||
int dummy;
|
||||
|
||||
|
@ -103,5 +103,5 @@ VID_CheckVMode(Display *dpy, int *maj_ver, int *min_ver)
|
|||
return 1;
|
||||
#else
|
||||
return 0;
|
||||
#endif // HAS_DGA
|
||||
#endif // HAVE_VIDMODE
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
#ifdef HAS_DGA
|
||||
# include <X11/extensions/xf86dga.h>
|
||||
#endif
|
||||
#ifdef HAS_VIDMODE
|
||||
#ifdef HAVE_VIDMODE
|
||||
# include <X11/extensions/xf86vmode.h>
|
||||
#endif
|
||||
#include "dga_check.h"
|
||||
|
@ -97,7 +97,7 @@ cvar_t *vid_fullscreen;
|
|||
extern cvar_t *gl_triplebuffer;
|
||||
extern cvar_t *vid_dga_mouseaccel;
|
||||
|
||||
#ifdef HAS_VIDMODE
|
||||
#ifdef HAVE_VIDMODE
|
||||
static XF86VidModeModeInfo **vidmodes;
|
||||
static int nummodes, hasvidmode = 0;
|
||||
#endif
|
||||
|
@ -163,7 +163,7 @@ VID_Shutdown(void)
|
|||
|
||||
glXDestroyContext(x_disp, ctx);
|
||||
|
||||
#ifdef HAS_VIDMODE
|
||||
#ifdef HAVE_VIDMODE
|
||||
if (hasvidmode) {
|
||||
int i;
|
||||
|
||||
|
@ -480,7 +480,7 @@ void VID_Init(unsigned char *palette)
|
|||
}
|
||||
Con_SafePrintf ("hasdga = %i\nhasdgavideo = %i\n", hasdga, hasdgavideo);
|
||||
#endif
|
||||
#ifdef HAS_VIDMODE
|
||||
#ifdef HAVE_VIDMODE
|
||||
hasvidmode = VID_CheckVMode(x_disp, NULL, NULL);
|
||||
if (hasvidmode) {
|
||||
if (! XF86VidModeGetAllModeLines(x_disp, DefaultScreen(x_disp),
|
||||
|
@ -529,7 +529,7 @@ void VID_Init(unsigned char *palette)
|
|||
attr.event_mask = X_MASK;
|
||||
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
|
||||
|
||||
#ifdef HAS_VIDMODE
|
||||
#ifdef HAVE_VIDMODE
|
||||
if (hasvidmode && vid_fullscreen->value) {
|
||||
int smallest_mode=0, x=MAXINT, y=MAXINT;
|
||||
|
||||
|
@ -566,7 +566,7 @@ void VID_Init(unsigned char *palette)
|
|||
0, visinfo->depth, InputOutput,
|
||||
visinfo->visual, mask, &attr);
|
||||
XMapWindow(x_disp, x_win);
|
||||
#ifdef HAS_VIDMODE
|
||||
#ifdef HAVE_VIDMODE
|
||||
if (hasvidmode && vid_fullscreen->value) {
|
||||
XRaiseWindow(x_disp, x_win);
|
||||
XGrabKeyboard(x_disp, x_win, 1, GrabModeAsync, GrabModeAsync,
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
#include "client.h"
|
||||
#include "input.h"
|
||||
#include "context_x11.h"
|
||||
#ifdef HAS_VIDMODE
|
||||
#ifdef HAVE_VIDMODE
|
||||
# include <X11/extensions/xf86vmode.h>
|
||||
#endif
|
||||
#include "dga_check.h"
|
||||
|
@ -86,7 +86,7 @@ static Visual *x_vis;
|
|||
static XVisualInfo *x_visinfo;
|
||||
static Atom aWMDelete = 0;
|
||||
|
||||
#ifdef HAS_VIDMODE
|
||||
#ifdef HAVE_VIDMODE
|
||||
static XF86VidModeModeInfo **vidmodes;
|
||||
static int nummodes, hasvidmode = 0;
|
||||
#endif
|
||||
|
@ -491,7 +491,7 @@ void VID_Init (unsigned char *palette)
|
|||
// open the display
|
||||
x11_open_display();
|
||||
|
||||
#ifdef HAS_VIDMODE
|
||||
#ifdef HAVE_VIDMODE
|
||||
hasvidmode = VID_CheckVMode(x_disp, NULL, NULL);
|
||||
if (hasvidmode) {
|
||||
if (! XF86VidModeGetAllModeLines(x_disp, DefaultScreen(x_disp),
|
||||
|
@ -587,7 +587,7 @@ void VID_Init (unsigned char *palette)
|
|||
attribs.event_mask = STD_EVENT_MASK;
|
||||
attribs.border_pixel = 0;
|
||||
|
||||
#ifdef HAS_VIDMODE
|
||||
#ifdef HAVE_VIDMODE
|
||||
if (hasvidmode && vid_fullscreen->value) {
|
||||
int smallest_mode=0, x=INT_MAX, y=INT_MAX;
|
||||
|
||||
|
@ -659,7 +659,7 @@ void VID_Init (unsigned char *palette)
|
|||
|
||||
// map the window
|
||||
XMapWindow(x_disp, x_win);
|
||||
#ifdef HAS_VIDMODE
|
||||
#ifdef HAVE_VIDMODE
|
||||
if (hasvidmode && vid_fullscreen->value) {
|
||||
XRaiseWindow(x_disp, x_win);
|
||||
XGrabKeyboard(x_disp, x_win, 1, GrabModeAsync, GrabModeAsync,
|
||||
|
@ -763,7 +763,7 @@ VID_Shutdown(void)
|
|||
{
|
||||
Sys_Printf("VID_Shutdown\n");
|
||||
if (x_disp) {
|
||||
#ifdef HAS_VIDMODE
|
||||
#ifdef HAVE_VIDMODE
|
||||
if (hasvidmode) {
|
||||
int i;
|
||||
|
||||
|
|
Loading…
Reference in a new issue