Changeset 334 for code/branches/audio/src
- Timestamp:
- Nov 28, 2007, 5:42:23 PM (17 years ago)
- Location:
- code/branches/audio/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/audio/src/audio/Ambient.cc
r330 r334 32 32 ListenerOri[5]=0; 33 33 34 35 // Initialize OpenAL and clear the error bit. 36 37 alutInit(NULL, 0); 38 alGetError(); 39 40 // Load the wav data. 41 42 if(LoadALData() == AL_FALSE) 43 { 44 printf("Error loading sound data."); 45 46 } 47 48 SetListenerValues(); 49 50 // Setup an exit procedure. 51 52 //atexit(KillALData); 53 34 54 std::cout << "Play sone ambient background sound"; 35 55 } … … 42 62 ALsizei freq; 43 63 ALboolean loop; 64 44 65 45 66 alGenBuffers(1, &Buffer); … … 67 88 return AL_TRUE; 68 89 90 69 91 return AL_FALSE; 70 92 } 93 94 void Ambient::SetListenerValues() 95 { 96 alListenerfv(AL_POSITION, ListenerPos); 97 alListenerfv(AL_VELOCITY, ListenerVel); 98 alListenerfv(AL_ORIENTATION, ListenerOri); 99 } 100 101 void Ambient::KillALData() 102 { 103 alDeleteBuffers(1, &Buffer); 104 alDeleteSources(1, &Source); 105 alutExit(); 106 } 107 108 void Ambient::play() 109 { 110 alSourcePlay(Source); 111 112 } 113 114 71 115 72 116 -
code/branches/audio/src/audio/Ambient.h
r330 r334 14 14 public: 15 15 Ambient(); 16 void play(); 16 17 private: 17 18 ALboolean LoadALData(); 18 19 void SetListenerValues(); 20 void KillALData(); 19 21 20 22 ALuint Buffer; -
code/branches/audio/src/audio/CMakeLists.txt
r327 r334 4 4 SET(INC_FILES Ambient.h) 5 5 6 INCLUDE_DIRECTORIES(..)7 6 8 7 ADD_LIBRARY(audio ${SRC_FILES} ${INC_FILES}) 9 8 10 TARGET_LINK_LIBRARIES(../openal/lib) 9 TARGET_LINK_LIBRARIES(audio alut) 10 TARGET_LINK_LIBRARIES(audio openal) 11 12 -
code/branches/audio/src/orxonox/CMakeLists.txt
r327 r334 6 6 ADD_EXECUTABLE(../../bin/main ${SRC_FILES} ${INC_FILES}) 7 7 8 TARGET_LINK_LIBRARIES(../../bin/main ${OGRE_LIBRARIES} ${OIS_LIBRARIES} loader audio)8 TARGET_LINK_LIBRARIES(../../bin/main ${OGRE_LIBRARIES} ${OIS_LIBRARIES} ${OPENAL_LIBRARIES} loader audio) 9 9 10 10 INCLUDE_DIRECTORIES(..) -
code/branches/audio/src/orxonox/orxonox.cc
r327 r334 192 192 { 193 193 audio::Ambient* bgsound = new audio::Ambient(); 194 bgsound->play(); 194 195 195 196 string levelFile = "sp_level_moonstation.oxw";
Note: See TracChangeset
for help on using the changeset viewer.