Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Final merge of Google Summer of Code 2008 work...

Force Feedback for SDL
by Edgar Simo, mentored by Ryan C. Gordon
  • Loading branch information
slouken committed Aug 25, 2008
1 parent 585b2fa commit e4fd818aa242889c9dcdabae82ebd5b8631074a3
@@ -42,7 +42,7 @@ SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@

DIST = acinclude.m4 autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS docs docs.html include INSTALL Makefile.dc Makefile.minimal Makefile.in README* sdl-config.in sdl.m4 sdl.pc.in SDL.qpg.in SDL.spec SDL.spec.in src test TODO VisualC.html VisualC VisualCE Watcom-OS2.zip Watcom-Win32.zip WhatsNew Xcode

HDRS = SDL.h SDL_audio.h SDL_cdrom.h SDL_compat.h SDL_cpuinfo.h SDL_endian.h SDL_error.h SDL_events.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_pixels.h SDL_platform.h SDL_quit.h SDL_rect.h SDL_rwops.h SDL_scancode.h SDL_stdinc.h SDL_surface.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_types.h SDL_version.h SDL_video.h begin_code.h close_code.h
HDRS = SDL.h SDL_audio.h SDL_cdrom.h SDL_compat.h SDL_cpuinfo.h SDL_endian.h SDL_error.h SDL_events.h SDL_haptic.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_pixels.h SDL_platform.h SDL_quit.h SDL_rect.h SDL_rwops.h SDL_scancode.h SDL_stdinc.h SDL_surface.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_types.h SDL_version.h SDL_video.h begin_code.h close_code.h

LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
@@ -15,13 +15,15 @@ SOURCES = \
src/events/*.c \
src/file/*.c \
src/joystick/*.c \
src/haptic/*.c \
src/stdlib/*.c \
src/thread/*.c \
src/timer/*.c \
src/video/*.c \
src/audio/dummy/*.c \
src/video/dummy/*.c \
src/joystick/dummy/*.c \
src/haptic/dummy/*.c \
src/cdrom/dummy/*.c \
src/thread/generic/*.c \
src/timer/dummy/*.c \
@@ -235,6 +235,14 @@ if test x$enable_joystick != xyes; then
else
SOURCES="$SOURCES $srcdir/src/joystick/*.c"
fi
AC_ARG_ENABLE(haptic,
AC_HELP_STRING([--enable-haptic], [Enable the haptic (force feedback) subsystem [[default=yes]]]),
, enable_haptic=yes)
if test x$enable_haptic != xyes; then
AC_DEFINE(SDL_HAPTIC_DISABLED)
else
SOURCES="$SOURCES $srcdir/src/haptic/*.c"
fi
AC_ARG_ENABLE(cdrom,
AC_HELP_STRING([--enable-cdrom], [Enable the cdrom subsystem [[default=yes]]]),
, enable_cdrom=yes)
@@ -2179,6 +2187,18 @@ case "$host" in
;;
esac
fi
# Set up files for the haptic library
if test x$enable_haptic = xyes; then
if test x$use_input_events = xyes; then
case $ARCH in
linux)
AC_DEFINE(SDL_HAPTIC_LINUX)
SOURCES="$SOURCES $srcdir/src/haptic/linux/*.c"
have_haptic=yes
;;
esac
fi
fi
# Set up files for the cdrom library
if test x$enable_cdrom = xyes; then
case $ARCH in
@@ -2316,6 +2336,13 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau
fi
have_joystick=yes
fi
if test x$enable_haptic = xyes; then
if test x$have_dinput = xyes; then
AC_DEFINE(SDL_HAPTIC_DINPUT)
SOURCES="$SOURCES $srcdir/src/haptic/win32/SDL_syshaptic.c"
have_haptic=yes
fi
fi
# Set up files for the cdrom library
if test x$enable_cdrom = xyes; then
AC_DEFINE(SDL_CDROM_WIN32)
@@ -2457,6 +2484,13 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau
SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
have_joystick=yes
fi
# Set up files for the haptic library
if test x$enable_haptic = xyes; then
AC_DEFINE(SDL_HAPTIC_IOKIT)
SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
have_haptic=yes
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
fi
# Set up files for the cdrom library
if test x$enable_cdrom = xyes; then
AC_DEFINE(SDL_CDROM_MACOSX)
@@ -2565,6 +2599,12 @@ if test x$enable_joystick = xyes; then
SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
fi
fi
if test x$have_haptic != xyes; then
if test x$enable_haptic = xyes; then
AC_DEFINE(SDL_HAPTIC_DISABLED)
fi
SOURCES="$SOURCES $srcdir/src/haptic/dummy/*.c"
fi
if test x$have_cdrom != xyes; then
if test x$enable_cdrom = xyes; then
AC_DEFINE(SDL_CDROM_DISABLED)
@@ -104,14 +104,15 @@ extern "C" {
/* These are the flags which may be passed to SDL_Init() -- you should
specify the subsystems which you will be using in your application.
*/
#define SDL_INIT_TIMER 0x00000001
#define SDL_INIT_AUDIO 0x00000010
#define SDL_INIT_VIDEO 0x00000020
#define SDL_INIT_CDROM 0x00000100
#define SDL_INIT_JOYSTICK 0x00000200
#define SDL_INIT_NOPARACHUTE 0x00100000 /* Don't catch fatal signals */
#define SDL_INIT_EVENTTHREAD 0x01000000 /* Not supported on all OS's */
#define SDL_INIT_EVERYTHING 0x0000FFFF
#define SDL_INIT_TIMER 0x00000001
#define SDL_INIT_AUDIO 0x00000010
#define SDL_INIT_VIDEO 0x00000020
#define SDL_INIT_CDROM 0x00000100
#define SDL_INIT_JOYSTICK 0x00000200
#define SDL_INIT_HAPTIC 0x00001000
#define SDL_INIT_NOPARACHUTE 0x00100000 /* Don't catch fatal signals */
#define SDL_INIT_EVENTTHREAD 0x01000000 /* Not supported on all OS's */
#define SDL_INIT_EVERYTHING 0x0000FFFF

/* This function loads the SDL dynamically linked library and initializes
* the subsystems specified by 'flags' (and those satisfying dependencies)
@@ -149,6 +149,7 @@
#undef SDL_EVENTS_DISABLED
#undef SDL_FILE_DISABLED
#undef SDL_JOYSTICK_DISABLED
#undef SDL_HAPTIC_DISABLED
#undef SDL_LOADSO_DISABLED
#undef SDL_THREADS_DISABLED
#undef SDL_TIMERS_DISABLED
@@ -215,6 +216,10 @@
#undef SDL_JOYSTICK_WINMM
#undef SDL_JOYSTICK_USBHID
#undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
#undef SDL_HAPTIC_DUMMY
#undef SDL_HAPTIC_LINUX
#undef SDL_HAPTIC_IOKIT
#undef SDL_HAPTIC_DINPUT

/* Enable various shared object loading systems */
#undef SDL_LOADSO_BEOS
@@ -89,6 +89,7 @@ typedef unsigned long uintptr_t;

/* Enable various input drivers */
#define SDL_JOYSTICK_DC 1
#define SDL_HAPTIC_DUMMY 1

/* Enable various shared object loading systems */
#define SDL_LOADSO_DUMMY 1
@@ -99,6 +99,7 @@

/* Enable various input drivers */
#define SDL_JOYSTICK_IOKIT 1
#define SDL_HAPTIC_IOKIT 1

/* Enable various shared object loading systems */
#ifdef __ppc__
@@ -47,6 +47,9 @@ typedef unsigned long uintptr_t;
/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */
#define SDL_JOYSTICK_DISABLED 1

/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
#define SDL_HAPTIC_DUMMY 1

/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
#define SDL_LOADSO_DISABLED 1

@@ -118,6 +118,7 @@ typedef unsigned long long uint64_t;

/* Enable various input drivers */
#define SDL_JOYSTICK_OS2 1
#define SDL_HAPTIC_DUMMY 1

/* Enable various shared object loading systems */
#define SDL_LOADSO_OS2 1
@@ -139,8 +139,10 @@ typedef unsigned int uintptr_t;
/* Enable various input drivers */
#ifdef _WIN32_WCE
#define SDL_JOYSTICK_DISABLED 1
#define SDL_HAPTIC_DUMMY 1
#else
#define SDL_JOYSTICK_WINMM 1
#define SDL_JOYSTICK_DINPUT 1
#define SDL_HAPTIC_DINPUT 1
#endif

/* Enable various shared object loading systems */

0 comments on commit e4fd818

Please sign in to comment.