Commit da98d71b authored by Sam Lantinga's avatar Sam Lantinga

Removing DGA support for SDL 1.3 - it's still buggy years later, and now

it's deprecated by the developers in favor of the render APIs.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401986
parent 695c12d6
......@@ -911,25 +911,6 @@ AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=ma
fi
have_video=yes
AC_ARG_ENABLE(dga,
AC_HELP_STRING([--enable-dga], [allow use of X11 DGA code [[default=yes]]]),
, enable_dga=yes)
if test x$enable_dga = xyes; then
SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86dga/*.c"
fi
AC_ARG_ENABLE(video-dga,
AC_HELP_STRING([--enable-video-dga], [use DGA 2.0 video driver [[default=yes]]]),
, enable_video_dga=yes)
if test x$enable_dga = xyes -a x$enable_video_dga = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_DGA)
SOURCES="$SOURCES $srcdir/src/video/dga/*.c"
fi
AC_ARG_ENABLE(video-x11-dgamouse,
AC_HELP_STRING([--enable-video-x11-dgamouse], [use X11 DGA for mouse events [[default=yes]]]),
, enable_video_x11_dgamouse=yes)
if test x$enable_dga = xyes -a x$enable_video_x11_dgamouse = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_X11_DGAMOUSE)
fi
AC_ARG_ENABLE(video-x11-vm,
AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]),
, enable_video_x11_vm=yes)
......
......@@ -254,7 +254,6 @@
#undef SDL_VIDEO_DRIVER_COCOA
#undef SDL_VIDEO_DRIVER_CYBERGRAPHICS
#undef SDL_VIDEO_DRIVER_DC
#undef SDL_VIDEO_DRIVER_DGA
#undef SDL_VIDEO_DRIVER_DIRECTFB
#undef SDL_VIDEO_DRIVER_DRAWSPROCKET
#undef SDL_VIDEO_DRIVER_DUMMY
......@@ -278,7 +277,6 @@
#undef SDL_VIDEO_DRIVER_WIN32
#undef SDL_VIDEO_DRIVER_WSCONS
#undef SDL_VIDEO_DRIVER_X11
#undef SDL_VIDEO_DRIVER_X11_DGAMOUSE
#undef SDL_VIDEO_DRIVER_X11_DPMS
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
......
This diff is collapsed.
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/* Handle the event stream, converting DGA events into SDL events */
#include <stdio.h>
#include <X11/Xlib.h>
#include "../Xext/extensions/xf86dga.h"
#include "../SDL_sysvideo.h"
#include "../../events/SDL_events_c.h"
#include "SDL_dgavideo.h"
#include "SDL_dgaevents_c.h"
/* get function pointers... */
#include "../x11/SDL_x11dyn.h"
/* Heheh we're using X11 event code */
extern int X11_Pending(Display * display);
extern void X11_InitKeymap(void);
extern SDLKey X11_TranslateKeycode(Display * display, KeyCode kc);
static int
DGA_DispatchEvent(_THIS)
{
int posted;
SDL_NAME(XDGAEvent) xevent;
XNextEvent(DGA_Display, (XEvent *) & xevent);
posted = 0;
xevent.type -= DGA_event_base;
switch (xevent.type) {
/* Mouse motion? */
case MotionNotify:
{
if (SDL_VideoSurface) {
posted = SDL_PrivateMouseMotion(0, 1,
xevent.xmotion.dx,
xevent.xmotion.dy);
}
}
break;
/* Mouse button press? */
case ButtonPress:
{
posted = SDL_PrivateMouseButton(SDL_PRESSED,
xevent.xbutton.button, 0, 0);
}
break;
/* Mouse button release? */
case ButtonRelease:
{
posted = SDL_PrivateMouseButton(SDL_RELEASED,
xevent.xbutton.button, 0, 0);
}
break;
/* Key press? */
case KeyPress:
{
SDL_keysym keysym;
KeyCode keycode;
XKeyEvent xkey;
SDL_NAME(XDGAKeyEventToXKeyEvent) (&xevent.xkey, &xkey);
keycode = xkey.keycode;
#ifdef DEBUG_XEVENTS
printf("KeyPress (X11 keycode = 0x%X)\n", xkey.keycode);
#endif
/* Get the translated SDL virtual keysym */
keysym.scancode = keycode;
keysym.sym = X11_TranslateKeycode(DGA_Display, keycode);
keysym.mod = KMOD_NONE;
keysym.unicode = 0;
/* Look up the translated value for the key event */
if (SDL_TranslateUNICODE) {
static XComposeStatus state;
char keybuf[32];
if (XLookupString
(&xkey, keybuf, sizeof(keybuf), NULL, &state)) {
/*
* FIXME: XLookupString() may yield more than one
* character, so we need a mechanism to allow for
* this (perhaps null keypress events with a
* unicode value)
*/
keysym.unicode = (Uint8) keybuf[0];
}
}
posted = SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
}
break;
/* Key release? */
case KeyRelease:
{
SDL_keysym keysym;
KeyCode keycode;
XKeyEvent xkey;
SDL_NAME(XDGAKeyEventToXKeyEvent) (&xevent.xkey, &xkey);
keycode = xkey.keycode;
#ifdef DEBUG_XEVENTS
printf("KeyRelease (X11 keycode = 0x%X)\n", xkey.keycode);
#endif
/* Get the translated SDL virtual keysym */
keysym.scancode = keycode;
keysym.sym = X11_TranslateKeycode(DGA_Display, keycode);
keysym.mod = KMOD_NONE;
keysym.unicode = 0;
posted = SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
}
break;
break;
}
return (posted);
}
void
DGA_PumpEvents(_THIS)
{
/* Keep processing pending events */
LOCK_DISPLAY();
while (X11_Pending(DGA_Display)) {
DGA_DispatchEvent(this);
}
UNLOCK_DISPLAY();
}
void
DGA_InitOSKeymap(_THIS)
{
X11_InitKeymap();
}
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#include "SDL_dgavideo.h"
/* Functions to be exported */
extern void DGA_PumpEvents(_THIS);
extern void DGA_InitOSKeymap(_THIS);
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#include <stdio.h>
#include "SDL_mouse.h"
#include "../../events/SDL_events_c.h"
#include "SDL_dgavideo.h"
#include "SDL_dgamouse_c.h"
/* The implementation dependent data for the window manager cursor */
struct WMcursor
{
int unused;
};
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#include "SDL_dgavideo.h"
/* Functions to be exported */
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#ifndef _SDL_dgavideo_h
#define _SDL_dgavideo_h
#include <X11/Xlib.h>
#include <X11/Xproto.h>
#include "SDL_mouse.h"
#include "SDL_mutex.h"
#include "../SDL_sysvideo.h"
#if SDL_VIDEO_DRIVER_X11_DPMS
#include <X11/extensions/dpms.h>
#endif
/* Hidden "this" pointer for the video functions */
#define _THIS SDL_VideoDevice *this
/* Define this if you need the DGA driver to be thread-safe */
#define LOCK_DGA_DISPLAY
#ifdef LOCK_DGA_DISPLAY
#define LOCK_DISPLAY() SDL_mutexP(event_lock)
#define UNLOCK_DISPLAY() SDL_mutexV(event_lock)
#else
#define LOCK_DISPLAY()
#define UNLOCK_DISPLAY()
#endif
/* This is the structure we use to keep track of video memory */
typedef struct vidmem_bucket
{
struct vidmem_bucket *prev;
int used;
int dirty;
Uint8 *base;
unsigned int size;
struct vidmem_bucket *next;
} vidmem_bucket;
/* Private display data */
struct SDL_PrivateVideoData
{
Display *DGA_Display;
Colormap DGA_colormap;
int visualClass;
#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
int SDL_nummodes[NUM_MODELISTS];
SDL_Rect **SDL_modelist[NUM_MODELISTS];
/* Information for the video surface */
Uint8 *memory_base;
int memory_pitch;
SDL_mutex *hw_lock;
int sync_needed;
int was_flipped;
/* Information for hardware surfaces */
vidmem_bucket surfaces;
int surfaces_memtotal;
int surfaces_memleft;
/* Information for double-buffering */
int flip_page;
int flip_yoffset[2];
Uint8 *flip_address[2];
/* Used to handle DGA events */
int event_base;
#ifdef LOCK_DGA_DISPLAY
SDL_mutex *event_lock;
#endif
/* Screensaver settings */
int screensaver_timeout;
BOOL dpms_enabled;
};
/* Old variable names */
#define DGA_Display (this->hidden->DGA_Display)
#define DGA_Screen DefaultScreen(DGA_Display)
#define DGA_colormap (this->hidden->DGA_colormap)
#define DGA_visualClass (this->hidden->visualClass)
#define memory_base (this->hidden->memory_base)
#define memory_pitch (this->hidden->memory_pitch)
#define flip_page (this->hidden->flip_page)
#define flip_yoffset (this->hidden->flip_yoffset)
#define flip_address (this->hidden->flip_address)
#define sync_needed (this->hidden->sync_needed)
#define was_flipped (this->hidden->was_flipped)
#define SDL_nummodes (this->hidden->SDL_nummodes)
#define SDL_modelist (this->hidden->SDL_modelist)
#define surfaces (this->hidden->surfaces)
#define surfaces_memtotal (this->hidden->surfaces_memtotal)
#define surfaces_memleft (this->hidden->surfaces_memleft)
#define hw_lock (this->hidden->hw_lock)
#define DGA_event_base (this->hidden->event_base)
#define event_lock (this->hidden->event_lock)
#define screensaver_timeout (this->hidden->screensaver_timeout)
#define dpms_enabled (this->hidden->dpms_enabled)
#endif /* _SDL_dgavideo_h */
/* vi: set ts=4 sw=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment