Mercurial > sdl-ios-xcode
diff src/video/x11/SDL_x11dga.c @ 1895:c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 10 Jul 2006 21:04:37 +0000 |
parents | d910939febfa |
children |
line wrap: on
line diff
--- a/src/video/x11/SDL_x11dga.c Thu Jul 06 18:01:37 2006 +0000 +++ b/src/video/x11/SDL_x11dga.c Mon Jul 10 21:04:37 2006 +0000 @@ -33,7 +33,8 @@ /* Global for the error handler */ int dga_event, dga_error = -1; -void X11_EnableDGAMouse(_THIS) +void +X11_EnableDGAMouse(_THIS) { #if SDL_VIDEO_DRIVER_X11_DGAMOUSE int dga_major, dga_minor; @@ -43,18 +44,20 @@ /* Check configuration to see if we should use DGA mouse */ use_dgamouse = 1; env_use_dgamouse = SDL_getenv("SDL_VIDEO_X11_DGAMOUSE"); - if ( env_use_dgamouse ) { + if (env_use_dgamouse) { use_dgamouse = atoi(env_use_dgamouse); } /* Check for buggy X servers */ - if ( use_dgamouse && BUGGY_XFREE86(==, 4000) ) { + if (use_dgamouse && BUGGY_XFREE86( ==, 4000)) { use_dgamouse = 0; } /* Only use DGA mouse if the cursor is not showing (in relative mode) */ - if ( use_dgamouse && local_X11 && !(using_dga & DGA_MOUSE) && - SDL_NAME(XF86DGAQueryExtension)(SDL_Display, &dga_event, &dga_error) && - SDL_NAME(XF86DGAQueryVersion)(SDL_Display, &dga_major, &dga_minor) ) { - if ( SDL_NAME(XF86DGADirectVideo)(SDL_Display, SDL_Screen, XF86DGADirectMouse) ) { + if (use_dgamouse && local_X11 && !(using_dga & DGA_MOUSE) && + SDL_NAME(XF86DGAQueryExtension) (SDL_Display, &dga_event, &dga_error) + && SDL_NAME(XF86DGAQueryVersion) (SDL_Display, &dga_major, + &dga_minor)) { + if (SDL_NAME(XF86DGADirectVideo) + (SDL_Display, SDL_Screen, XF86DGADirectMouse)) { using_dga |= DGA_MOUSE; } } @@ -62,26 +65,31 @@ } /* Argh. Glide resets DGA mouse mode when it makes the context current! */ -void X11_CheckDGAMouse(_THIS) +void +X11_CheckDGAMouse(_THIS) { #if SDL_VIDEO_DRIVER_X11_DGAMOUSE int flags; - if ( using_dga & DGA_MOUSE ) { - SDL_NAME(XF86DGAQueryDirectVideo)(SDL_Display, SDL_Screen, &flags); - if ( ! (flags & XF86DGADirectMouse) ) { - SDL_NAME(XF86DGADirectVideo)(SDL_Display,SDL_Screen,XF86DGADirectMouse); + if (using_dga & DGA_MOUSE) { + SDL_NAME(XF86DGAQueryDirectVideo) (SDL_Display, SDL_Screen, &flags); + if (!(flags & XF86DGADirectMouse)) { + SDL_NAME(XF86DGADirectVideo) (SDL_Display, SDL_Screen, + XF86DGADirectMouse); } } #endif } -void X11_DisableDGAMouse(_THIS) +void +X11_DisableDGAMouse(_THIS) { #if SDL_VIDEO_DRIVER_X11_DGAMOUSE - if ( using_dga & DGA_MOUSE ) { - SDL_NAME(XF86DGADirectVideo)(SDL_Display, SDL_Screen, 0); + if (using_dga & DGA_MOUSE) { + SDL_NAME(XF86DGADirectVideo) (SDL_Display, SDL_Screen, 0); using_dga &= ~DGA_MOUSE; } #endif /* SDL_VIDEO_DRIVER_X11_DGAMOUSE */ } + +/* vi: set ts=4 sw=4 expandtab: */