Oh yeah, more DGA removal
authorSam Lantinga
Wed, 26 Jul 2006 04:20:59 +0000
changeset 1947180f563d72a8
parent 1946 103760c3a5dc
child 1948 d646f6e1a439
Oh yeah, more DGA removal
src/video/x11/SDL_x11dga.c
src/video/x11/SDL_x11dga_c.h
     1.1 --- a/src/video/x11/SDL_x11dga.c	Wed Jul 26 03:57:45 2006 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,95 +0,0 @@
     1.4 -/*
     1.5 -    SDL - Simple DirectMedia Layer
     1.6 -    Copyright (C) 1997-2006 Sam Lantinga
     1.7 -
     1.8 -    This library is free software; you can redistribute it and/or
     1.9 -    modify it under the terms of the GNU Lesser General Public
    1.10 -    License as published by the Free Software Foundation; either
    1.11 -    version 2.1 of the License, or (at your option) any later version.
    1.12 -
    1.13 -    This library is distributed in the hope that it will be useful,
    1.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 -    Lesser General Public License for more details.
    1.17 -
    1.18 -    You should have received a copy of the GNU Lesser General Public
    1.19 -    License along with this library; if not, write to the Free Software
    1.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    1.21 -
    1.22 -    Sam Lantinga
    1.23 -    slouken@libsdl.org
    1.24 -*/
    1.25 -#include "SDL_config.h"
    1.26 -
    1.27 -/* This is currently only used to enable DGA mouse.
    1.28 -   The new fullscreen code makes it very difficult to handle DGA dynamically.
    1.29 -   There will be a completely separate DGA driver that is fullscreen-only.
    1.30 -*/
    1.31 -
    1.32 -#include "SDL_video.h"
    1.33 -#include "../SDL_cursor_c.h"
    1.34 -#include "SDL_x11dga_c.h"
    1.35 -
    1.36 -/* Global for the error handler */
    1.37 -int dga_event, dga_error = -1;
    1.38 -
    1.39 -void
    1.40 -X11_EnableDGAMouse(_THIS)
    1.41 -{
    1.42 -#if SDL_VIDEO_DRIVER_X11_DGAMOUSE
    1.43 -    int dga_major, dga_minor;
    1.44 -    int use_dgamouse;
    1.45 -    const char *env_use_dgamouse;
    1.46 -
    1.47 -    /* Check configuration to see if we should use DGA mouse */
    1.48 -    use_dgamouse = 1;
    1.49 -    env_use_dgamouse = SDL_getenv("SDL_VIDEO_X11_DGAMOUSE");
    1.50 -    if (env_use_dgamouse) {
    1.51 -        use_dgamouse = atoi(env_use_dgamouse);
    1.52 -    }
    1.53 -    /* Check for buggy X servers */
    1.54 -    if (use_dgamouse && BUGGY_XFREE86( ==, 4000)) {
    1.55 -        use_dgamouse = 0;
    1.56 -    }
    1.57 -    /* Only use DGA mouse if the cursor is not showing (in relative mode) */
    1.58 -    if (use_dgamouse && local_X11 && !(using_dga & DGA_MOUSE) &&
    1.59 -        SDL_NAME(XF86DGAQueryExtension) (SDL_Display, &dga_event, &dga_error)
    1.60 -        && SDL_NAME(XF86DGAQueryVersion) (SDL_Display, &dga_major,
    1.61 -                                          &dga_minor)) {
    1.62 -        if (SDL_NAME(XF86DGADirectVideo)
    1.63 -            (SDL_Display, SDL_Screen, XF86DGADirectMouse)) {
    1.64 -            using_dga |= DGA_MOUSE;
    1.65 -        }
    1.66 -    }
    1.67 -#endif /* SDL_VIDEO_DRIVER_X11_DGAMOUSE */
    1.68 -}
    1.69 -
    1.70 -/* Argh.  Glide resets DGA mouse mode when it makes the context current! */
    1.71 -void
    1.72 -X11_CheckDGAMouse(_THIS)
    1.73 -{
    1.74 -#if SDL_VIDEO_DRIVER_X11_DGAMOUSE
    1.75 -    int flags;
    1.76 -
    1.77 -    if (using_dga & DGA_MOUSE) {
    1.78 -        SDL_NAME(XF86DGAQueryDirectVideo) (SDL_Display, SDL_Screen, &flags);
    1.79 -        if (!(flags & XF86DGADirectMouse)) {
    1.80 -            SDL_NAME(XF86DGADirectVideo) (SDL_Display, SDL_Screen,
    1.81 -                                          XF86DGADirectMouse);
    1.82 -        }
    1.83 -    }
    1.84 -#endif
    1.85 -}
    1.86 -
    1.87 -void
    1.88 -X11_DisableDGAMouse(_THIS)
    1.89 -{
    1.90 -#if SDL_VIDEO_DRIVER_X11_DGAMOUSE
    1.91 -    if (using_dga & DGA_MOUSE) {
    1.92 -        SDL_NAME(XF86DGADirectVideo) (SDL_Display, SDL_Screen, 0);
    1.93 -        using_dga &= ~DGA_MOUSE;
    1.94 -    }
    1.95 -#endif /* SDL_VIDEO_DRIVER_X11_DGAMOUSE */
    1.96 -}
    1.97 -
    1.98 -/* vi: set ts=4 sw=4 expandtab: */
     2.1 --- a/src/video/x11/SDL_x11dga_c.h	Wed Jul 26 03:57:45 2006 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,34 +0,0 @@
     2.4 -/*
     2.5 -    SDL - Simple DirectMedia Layer
     2.6 -    Copyright (C) 1997-2006 Sam Lantinga
     2.7 -
     2.8 -    This library is free software; you can redistribute it and/or
     2.9 -    modify it under the terms of the GNU Lesser General Public
    2.10 -    License as published by the Free Software Foundation; either
    2.11 -    version 2.1 of the License, or (at your option) any later version.
    2.12 -
    2.13 -    This library is distributed in the hope that it will be useful,
    2.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    2.16 -    Lesser General Public License for more details.
    2.17 -
    2.18 -    You should have received a copy of the GNU Lesser General Public
    2.19 -    License along with this library; if not, write to the Free Software
    2.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    2.21 -
    2.22 -    Sam Lantinga
    2.23 -    slouken@libsdl.org
    2.24 -*/
    2.25 -#include "SDL_config.h"
    2.26 -
    2.27 -#include "SDL_x11video.h"
    2.28 -
    2.29 -/* Different DGA access states */
    2.30 -#define DGA_GRAPHICS	0x01
    2.31 -#define DGA_KEYBOARD	0x02
    2.32 -#define DGA_MOUSE	0x04
    2.33 -
    2.34 -extern void X11_EnableDGAMouse(_THIS);
    2.35 -extern void X11_CheckDGAMouse(_THIS);
    2.36 -extern void X11_DisableDGAMouse(_THIS);
    2.37 -/* vi: set ts=4 sw=4 expandtab: */