]> git.mxchange.org Git - simgear.git/blobdiff - simgear/sound/soundmgr_openal.cxx
add the option to tie a SampleGroup to the listener position and orientation
[simgear.git] / simgear / sound / soundmgr_openal.cxx
index b204aa13fbc4418cf52ad40fbad452a29147c68d..98d7354b364f6ed1808074185d5435397795d27c 100644 (file)
@@ -204,7 +204,7 @@ void SGSoundMgr::update( double dt )
 // run the audio scheduler
 void SGSoundMgr::update_late( double dt ) {
     if (_working) {
-        // alcSuspendContext(_context);
+        alcSuspendContext(_context);
 
         sample_group_map_iterator sample_grp_current = _sample_groups.begin();
         sample_group_map_iterator sample_grp_end = _sample_groups.end();
@@ -222,7 +222,7 @@ void SGSoundMgr::update_late( double dt ) {
             testForALError("update");
             _changed = false;
         }
-        // alcProcessContext(_context);
+        alcProcessContext(_context);
     }
 }
 
@@ -412,8 +412,8 @@ bool SGSoundMgr::load(string &samplepath, void **dbuf, int *fmt,
  */
 void SGSoundMgr::set_orientation( SGQuatd ori )
 {
-    SGVec3d sgv_up = ori.rotate(SGVec3d::e2());
-    SGVec3d sgv_at = ori.rotate(SGVec3d::e3());
+    SGVec3d sgv_up = ori.rotate(SGVec3d::e3());
+    SGVec3d sgv_at = ori.rotate(SGVec3d::e2());
     for (int i=0; i<3; i++) {
        _listener_ori[i] = sgv_at[i];
        _listener_ori[i+3] = sgv_up[i];
@@ -458,6 +458,7 @@ bool SGSoundMgr::testForALCError(string s)
 
 bool SGSoundMgr::testForALUTError(string s)
 {
+#if defined(ALUT_API_MAJOR_VERSION) && ALUT_API_MAJOR_VERSION >= 1
     ALenum error;
     error =  alutGetError ();
     if (error != ALUT_ERROR_NO_ERROR) {
@@ -466,5 +467,6 @@ bool SGSoundMgr::testForALUTError(string s)
                                        << s);
         return true;
     }
+#endif
     return false;
 }