From: curt Date: Sun, 25 Apr 2004 01:48:08 +0000 (+0000) Subject: Add support for the MacOS variations of OpenAL. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cc43c745b296b5c3e02adebfcd22d0e15ea5ab01;p=simgear.git Add support for the MacOS variations of OpenAL. --- diff --git a/simgear/sound/Makefile.am b/simgear/sound/Makefile.am index da59b224..1488f132 100644 --- a/simgear/sound/Makefile.am +++ b/simgear/sound/Makefile.am @@ -21,7 +21,7 @@ noinst_PROGRAMS = openal_test1 openal_test2 openal_test1_SOURCES = openal_test1.cxx openal_test2_SOURCES = openal_test2.cxx -openal_test1_LDADD = -lsgdebug -lopenal +openal_test1_LDADD = -lsgdebug $(openal_LIBS) openal_test2_LDADD = \ $(top_builddir)/simgear/sound/libsgsound.a \ -lsgdebug -lsgmisc -lsgstructure $(openal_LIBS) diff --git a/simgear/sound/openal_test1.cxx b/simgear/sound/openal_test1.cxx index 91b8c849..90aac164 100644 --- a/simgear/sound/openal_test1.cxx +++ b/simgear/sound/openal_test1.cxx @@ -1,7 +1,14 @@ #include -#include -#include +#if defined( __APPLE__ ) +# define AL_ILLEGAL_ENUM AL_INVALID_ENUM +# define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION +# include +# include +#else +# include +# include +#endif #include diff --git a/simgear/sound/sample_openal.cxx b/simgear/sound/sample_openal.cxx index a4459788..124cac79 100644 --- a/simgear/sound/sample_openal.cxx +++ b/simgear/sound/sample_openal.cxx @@ -21,8 +21,15 @@ // $Id$ -#include -#include +#if defined( __APPLE__ ) +# define AL_ILLEGAL_ENUM AL_INVALID_ENUM +# define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION +# include +# include +#else +# include +# include +#endif #include #include @@ -86,8 +93,13 @@ SGSoundSample::SGSoundSample( const char *path, const char *file ) : } // Load the sample file +#if defined (__APPLE__) + alutLoadWAVFile( (ALbyte *)samplepath.c_str(), + &format, &data, &size, &freq ); +#else alutLoadWAVFile( (ALbyte *)samplepath.c_str(), &format, &data, &size, &freq, &loop ); +#endif if (alGetError() != AL_NO_ERROR) { throw sg_exception("Failed to load wav file."); } diff --git a/simgear/sound/sample_openal.hxx b/simgear/sound/sample_openal.hxx index c6411cbd..0d907a0b 100644 --- a/simgear/sound/sample_openal.hxx +++ b/simgear/sound/sample_openal.hxx @@ -34,7 +34,15 @@ #include -#include +#if defined(__APPLE__) +# define AL_ILLEGAL_ENUM AL_INVALID_ENUM +# define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION +# include +# include +#else +# include +# include +#endif #include diff --git a/simgear/sound/soundmgr_openal.cxx b/simgear/sound/soundmgr_openal.cxx index 2578f1cc..79200225 100644 --- a/simgear/sound/soundmgr_openal.cxx +++ b/simgear/sound/soundmgr_openal.cxx @@ -25,9 +25,15 @@ #include -#include -#include -#include +#if defined(__APPLE__) +# include +# include +# include +#else +# include +# include +# include +#endif #include #include diff --git a/simgear/sound/soundmgr_openal.hxx b/simgear/sound/soundmgr_openal.hxx index 02b732d8..8fe1f67c 100644 --- a/simgear/sound/soundmgr_openal.hxx +++ b/simgear/sound/soundmgr_openal.hxx @@ -42,7 +42,11 @@ #include STL_STRING #include -#include +#if defined( __APPLE__ ) +# include +#else +# include +#endif #include "sample_openal.hxx"