SDL audio support

This commit is contained in:
gbeauche 2004-07-19 19:42:21 +00:00
parent eed5724b80
commit 4f78562642
2 changed files with 17 additions and 3 deletions

View File

@ -28,6 +28,7 @@ AC_ARG_WITH(dgcc, [ --with-dgcc=COMPILER use C++ COMPILER to compi
dnl SDL options.
AC_ARG_ENABLE(sdl-static, [ --enable-sdl-static use SDL static libraries for linking [default=no]], [WANT_SDL_STATIC=$enableval], [WANT_SDL_STATIC=no])
AC_ARG_ENABLE(sdl-video, [ --enable-sdl-video use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=no])
AC_ARG_ENABLE(sdl-audio, [ --enable-sdl-audio use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no])
dnl Checks for programs.
AC_PROG_CC
@ -98,13 +99,16 @@ AC_CHECK_LIB(posix4, sem_init)
dnl Do we need SDL?
WANT_SDL=no
SDL_SUPPORT="none"
if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
WANT_SDL=yes
WANT_XF86_DGA=no
WANT_XF86_VIDMODE=no
WANT_FBDEV_DGA=no
SDL_SUPPORT="video"
SDL_SUPPORT="$SDL_SUPPORT video"
fi
if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
WANT_SDL=yes
SDL_SUPPORT="$SDL_SUPPORT audio"
fi
if [[ "x$WANT_SDL" = "xyes" ]]; then
AC_PATH_PROG(sdl_config, "sdl-config")
@ -121,6 +125,9 @@ if [[ "x$WANT_SDL" = "xyes" ]]; then
else
WANT_SDL=no
fi
SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"`
else
SDL_SUPPORT="none"
fi
dnl We need X11, if not using SDL.
@ -343,8 +350,8 @@ if [[ "x$WANT_SDL" = "xyes" ]]; then
AC_DEFINE(USE_SDL, 1, [Define to enble SDL support.])
fi
if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
VIDEOSRCS="../SDL/video_sdl.cpp"
AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support.])
VIDEOSRCS="../SDL/video_sdl.cpp"
KEYCODES="../SDL/keycodes"
if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
@ -356,6 +363,10 @@ else
KEYCODES="keycodes"
EXTRASYSSRCS="$EXTRASYSSRCS clip_unix.cpp"
fi
if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
AC_DEFINE(USE_SDL_AUDIO, 1, [Define to enable SDL audio support])
AUDIOSRC="../SDL/audio_sdl.cpp"
fi
SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"

View File

@ -483,6 +483,9 @@ int main(int argc, char **argv)
int sdl_flags = 0;
#ifdef USE_SDL_VIDEO
sdl_flags |= SDL_INIT_VIDEO;
#endif
#ifdef USE_SDL_AUDIO
sdl_flags |= SDL_INIT_AUDIO;
#endif
assert(sdl_flags != 0);
if (SDL_Init(sdl_flags) == -1) {