comparison src/video/x11/SDL_x11dga.c @ 1361:19418e4422cb

New configure-based build system. Still work in progress, but much improved
author Sam Lantinga <slouken@libsdl.org>
date Thu, 16 Feb 2006 10:11:48 +0000
parents c71e05b4dc2e
children d910939febfa
comparison
equal deleted inserted replaced
1360:70a9cfb4cf1b 1361:19418e4422cb
24 The new fullscreen code makes it very difficult to handle DGA dynamically. 24 The new fullscreen code makes it very difficult to handle DGA dynamically.
25 There will be a completely separate DGA driver that is fullscreen-only. 25 There will be a completely separate DGA driver that is fullscreen-only.
26 */ 26 */
27 27
28 #include "SDL_video.h" 28 #include "SDL_video.h"
29 #include "SDL_cursor_c.h" 29 #include "../SDL_cursor_c.h"
30 #include "SDL_x11dga_c.h" 30 #include "SDL_x11dga_c.h"
31 31
32 /* Global for the error handler */ 32 /* Global for the error handler */
33 int dga_event, dga_error = -1; 33 int dga_event, dga_error = -1;
34 34
35 void X11_EnableDGAMouse(_THIS) 35 void X11_EnableDGAMouse(_THIS)
36 { 36 {
37 #ifdef XFREE86_DGAMOUSE 37 #if SDL_VIDEO_DRIVER_X11_DGAMOUSE
38 int dga_major, dga_minor; 38 int dga_major, dga_minor;
39 int use_dgamouse; 39 int use_dgamouse;
40 const char *env_use_dgamouse; 40 const char *env_use_dgamouse;
41 41
42 /* Check configuration to see if we should use DGA mouse */ 42 /* Check configuration to see if we should use DGA mouse */
43 #ifdef DEFAULT_DGAMOUSE
44 use_dgamouse = 1; 43 use_dgamouse = 1;
45 #else
46 use_dgamouse = 0;
47 #endif
48 env_use_dgamouse = SDL_getenv("SDL_VIDEO_X11_DGAMOUSE"); 44 env_use_dgamouse = SDL_getenv("SDL_VIDEO_X11_DGAMOUSE");
49 if ( env_use_dgamouse ) { 45 if ( env_use_dgamouse ) {
50 use_dgamouse = atoi(env_use_dgamouse); 46 use_dgamouse = atoi(env_use_dgamouse);
51 } 47 }
52 /* Check for buggy X servers */ 48 /* Check for buggy X servers */
59 SDL_NAME(XF86DGAQueryVersion)(SDL_Display, &dga_major, &dga_minor) ) { 55 SDL_NAME(XF86DGAQueryVersion)(SDL_Display, &dga_major, &dga_minor) ) {
60 if ( SDL_NAME(XF86DGADirectVideo)(SDL_Display, SDL_Screen, XF86DGADirectMouse) ) { 56 if ( SDL_NAME(XF86DGADirectVideo)(SDL_Display, SDL_Screen, XF86DGADirectMouse) ) {
61 using_dga |= DGA_MOUSE; 57 using_dga |= DGA_MOUSE;
62 } 58 }
63 } 59 }
64 #endif /* XFREE86_DGAMOUSE */ 60 #endif /* SDL_VIDEO_DRIVER_X11_DGAMOUSE */
65 } 61 }
66 62
67 /* Argh. Glide resets DGA mouse mode when it makes the context current! */ 63 /* Argh. Glide resets DGA mouse mode when it makes the context current! */
68 void X11_CheckDGAMouse(_THIS) 64 void X11_CheckDGAMouse(_THIS)
69 { 65 {
70 #ifdef XFREE86_DGAMOUSE 66 #if SDL_VIDEO_DRIVER_X11_DGAMOUSE
71 int flags; 67 int flags;
72 68
73 if ( using_dga & DGA_MOUSE ) { 69 if ( using_dga & DGA_MOUSE ) {
74 SDL_NAME(XF86DGAQueryDirectVideo)(SDL_Display, SDL_Screen, &flags); 70 SDL_NAME(XF86DGAQueryDirectVideo)(SDL_Display, SDL_Screen, &flags);
75 if ( ! (flags & XF86DGADirectMouse) ) { 71 if ( ! (flags & XF86DGADirectMouse) ) {
79 #endif 75 #endif
80 } 76 }
81 77
82 void X11_DisableDGAMouse(_THIS) 78 void X11_DisableDGAMouse(_THIS)
83 { 79 {
84 #ifdef XFREE86_DGAMOUSE 80 #if SDL_VIDEO_DRIVER_X11_DGAMOUSE
85 if ( using_dga & DGA_MOUSE ) { 81 if ( using_dga & DGA_MOUSE ) {
86 SDL_NAME(XF86DGADirectVideo)(SDL_Display, SDL_Screen, 0); 82 SDL_NAME(XF86DGADirectVideo)(SDL_Display, SDL_Screen, 0);
87 using_dga &= ~DGA_MOUSE; 83 using_dga &= ~DGA_MOUSE;
88 } 84 }
89 #endif /* XFREE86_DGAMOUSE */ 85 #endif /* SDL_VIDEO_DRIVER_X11_DGAMOUSE */
90 } 86 }