Changeset 2930
- Timestamp:
- Apr 27, 2009, 1:18:13 PM (16 years ago)
- Location:
- code/branches/sound/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sound/src/CMakeLists.txt
r2724 r2930 141 141 ADD_SUBDIRECTORY(util) 142 142 ADD_SUBDIRECTORY(core) 143 #ADD_SUBDIRECTORY(audio)143 ADD_SUBDIRECTORY(sound) 144 144 ADD_SUBDIRECTORY(network) 145 145 ADD_SUBDIRECTORY(orxonox) -
code/branches/sound/src/sound/SoundBase.h
r2899 r2930 26 26 * 27 27 */ 28 #ifndef _SOUNDBASE_H__ 29 #define _SOUNDBASE_H__ 28 30 29 31 #include <al.h> … … 64 66 }; // class SoundBase 65 67 } // namepsace orxonox 68 69 #endif // _SOUNDBASE_H__ -
code/branches/sound/src/sound/SoundManager.cc
r2899 r2930 30 30 31 31 #include "orxonox/CameraManager.h" 32 #include "orxonox/objects/worldentities/Camera.h" 33 #include "util/Math.h" 32 34 #include "SoundManager.h" 33 35 … … 61 63 this->context_ = alcCreateContext(this->device_, NULL); 62 64 alcMakeContextCurrent(this->context_); 63 ALenum error = alcGetError( );65 ALenum error = alcGetError(this->device_); 64 66 if(error != ALC_NO_ERROR) 65 67 COUT(2) << "OpenAL: Could not create sound context." << std::endl; … … 112 114 Quaternion orient = camera->getOrientation(); 113 115 Vector3 up = orient.xAxis(); // just a wild guess 114 Vec otr3 at = orient.zAxis();116 Vector3 at = orient.zAxis(); 115 117 116 float[3][2] orientation = { { at.x, at.y, at.z },117 { up.x, up.y, up.z }};118 ALfloat* orientation = { at.x, at.y, at.z, 119 up.x, up.y, up.z }; 118 120 119 121 alListenerfv(AL_POSITION, orientation); … … 127 129 } 128 130 129 } // namespace orxonox131 } -
code/branches/sound/src/sound/SoundManager.h
r2899 r2930 25 25 * ... 26 26 */ 27 #ifndef _SOUNDMANGER_H__ 28 #define _SOUNDMANGER_H__ 27 29 28 30 #include <al.h> 29 31 #include <alc.h> 30 32 31 #include < Tickable.h>33 #include <orxonox/objects/Tickable.h> 32 34 33 class SoundBase; 35 namespace orxonox 36 { 37 class SoundBase; 34 38 35 namespace Orxonox36 {37 39 /** 38 40 * The SoundManager class manages the OpenAL device, context and listener … … 41 43 * 42 44 */ 43 class SoundManager : public Tickable 45 class SoundManager : public Tickable 44 46 { 45 47 public: … … 49 51 void removeSound(SoundBase* sound); 50 52 51 v oid tick(float dt);53 virtual void tick(float dt); 52 54 53 55 private: … … 61 63 62 64 }; // class SoundManager 63 } // namespace Orxonox 65 } // namespace orxonox 66 67 #endif // _SOUNDMANAGER_H__
Note: See TracChangeset
for help on using the changeset viewer.