From 55071c68e428354e3858a8bec567c494c5c6f174 Mon Sep 17 00:00:00 2001 From: Molgrum Date: Tue, 13 May 2008 11:16:20 +0000 Subject: [PATCH] Implemented DGA-code similar to Fuhquake, works much better. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2954 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_vidlinuxglx.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/engine/gl/gl_vidlinuxglx.c b/engine/gl/gl_vidlinuxglx.c index d8e415f21..5cdf73952 100644 --- a/engine/gl/gl_vidlinuxglx.c +++ b/engine/gl/gl_vidlinuxglx.c @@ -332,13 +332,20 @@ static void install_grabs(void) CurrentTime); #ifdef USE_DGA - XF86DGADirectVideo(vid_dpy, DefaultScreen(vid_dpy), XF86DGADirectMouse); - dgamouse = 1; -#else - XWarpPointer(vid_dpy, None, vid_window, - 0, 0, 0, 0, - vid.width / 2, vid.height / 2); + // TODO: make this into a cvar, like "in_dgamouse", instead of parameters + // TODO: inform the user when DGA is enabled + if (!COM_CheckParm("-nodga") && !COM_CheckParm("-nomdga")) + { + XF86DGADirectVideo(vid_dpy, DefaultScreen(vid_dpy), XF86DGADirectMouse); + dgamouse = 1; + } + else #endif + { + XWarpPointer(vid_dpy, None, vid_window, + 0, 0, 0, 0, + vid.width / 2, vid.height / 2); + } // XSync(vid_dpy, True); } @@ -399,8 +406,8 @@ static void GetEvent(void) #ifdef USE_DGA if (dgamouse && old_windowed_mouse) { - mouse_x = event.xmotion.x_root; - mouse_y = event.xmotion.y_root; + mouse_x += event.xmotion.x_root; + mouse_y += event.xmotion.y_root; } else #endif