]> git.mxchange.org Git - simgear.git/commitdiff
Add support for the MacOS variations of OpenAL.
authorcurt <curt>
Sun, 25 Apr 2004 01:48:08 +0000 (01:48 +0000)
committercurt <curt>
Sun, 25 Apr 2004 01:48:08 +0000 (01:48 +0000)
simgear/sound/Makefile.am
simgear/sound/openal_test1.cxx
simgear/sound/sample_openal.cxx
simgear/sound/sample_openal.hxx
simgear/sound/soundmgr_openal.cxx
simgear/sound/soundmgr_openal.hxx

index da59b2243bf3605df456d1434d88761f8a0f9004..1488f132e530dcab24b5a5f83ac085211108ebed 100644 (file)
@@ -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)
index 91b8c84958a6ea3a93650d358684187f7bf9de2f..90aac164a526bd3d0287e2079d76c53156f9dcbf 100644 (file)
@@ -1,7 +1,14 @@
 #include <stdio.h>
 
-#include <AL/al.h>
-#include <AL/alut.h>
+#if defined( __APPLE__ )
+# define AL_ILLEGAL_ENUM AL_INVALID_ENUM
+# define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION
+# include <OpenAL/al.h>
+# include <OpenAL/alut.h>
+#else
+# include <AL/al.h>
+# include <AL/alut.h>
+#endif
 
 #include <simgear/debug/logstream.hxx>
 
index a4459788731de4e4d277dd9fd50d78290be078da..124cac797db925c0869a27f90f57bba66c00f594 100644 (file)
 // $Id$
 
 
-#include <AL/al.h>
-#include <AL/alut.h>
+#if defined( __APPLE__ )
+# define AL_ILLEGAL_ENUM AL_INVALID_ENUM
+# define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION
+# include <OpenAL/al.h>
+# include <OpenAL/alut.h>
+#else
+# include <AL/al.h>
+# include <AL/alut.h>
+#endif
 
 #include <simgear/debug/logstream.hxx>
 #include <simgear/misc/sg_path.hxx>
@@ -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.");
     }
index c6411cbd72df2d9ca8a8ebf12d7281ee03a3982d..0d907a0b4bc02b57d923ef79511328fb6caa092f 100644 (file)
 
 #include <simgear/compiler.h>
 
-#include <AL/al.h>
+#if defined(__APPLE__)
+# define AL_ILLEGAL_ENUM AL_INVALID_ENUM
+# define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION
+# include <OpenAL/al.h>
+# include <OpenAL/alut.h>
+#else
+# include <AL/al.h>
+# include <AL/alut.h>
+#endif
 
 #include <simgear/debug/logstream.hxx>
 
index 2578f1ccad87c67c0d01a11ca4b23f00b12e609e..7920022538740f0eab48f0b88ffd256f322d693f 100644 (file)
 
 #include <iostream>
 
-#include <AL/al.h>
-#include <AL/alut.h>
-#include <AL/alc.h>
+#if defined(__APPLE__)
+# include <OpenAL/al.h>
+# include <OpenAL/alut.h>
+# include <OpenAL/alc.h>
+#else
+# include <AL/al.h>
+# include <AL/alut.h>
+# include <AL/alc.h>
+#endif
 
 #include <simgear/debug/logstream.hxx>
 #include <simgear/misc/sg_path.hxx>
index 02b732d849e29371a9ca8f2593d2f5dded4b03c8..8fe1f67cce60801f4c0d865fb5d02e50ccba7c65 100644 (file)
 #include STL_STRING
 #include <map>
 
-#include <AL/al.h>
+#if defined( __APPLE__ )
+# include <OpenAL/al.h>
+#else
+# include <AL/al.h>
+#endif
 
 #include "sample_openal.hxx"