]> git.mxchange.org Git - simgear.git/blobdiff - simgear/sound/soundmgr_openal.cxx
Maik JUSTUS: fix/implement directional sound
[simgear.git] / simgear / sound / soundmgr_openal.cxx
index df67e9df89754020fb352bf58a96d842b9dee358..d29b7fb1ae01d404df063dfd961c2f5f9bfea336 100644 (file)
 //
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //
 // $Id$
 
+#ifdef HAVE_CONFIG_H
+#  include <simgear_config.h>
+#endif
+
 #include <simgear/compiler.h>
 
 #if defined(__APPLE__)
@@ -59,6 +63,11 @@ extern "C" int isinf (double);
 #  endif
 #endif
 
+#if defined (__CYGWIN__)
+#include <ieeefp.h>
+#endif
+
+
 #include STL_IOSTREAM
 
 #include <simgear/debug/logstream.hxx>
@@ -87,8 +96,13 @@ SGSoundMgr::SGSoundMgr() {
         SG_LOG( SG_GENERAL, SG_ALERT, "Audio initialization failed!" );
         SG_LOG( SG_GENERAL, SG_ALERT, "   "+string(alutGetErrorString(error)));
         working = false;
+        context = 0;
+    }
+    else
+    {
+        working = true;
+        context = alcGetCurrentContext();
     }
-    context = alcGetCurrentContext();
 #else
     if ( (dev = alcOpenDevice( NULL )) != NULL
             && ( context = alcCreateContext( dev, NULL )) != NULL ) {