Changeset 6856 in orxonox.OLD for trunk/src/lib/sound
- Timestamp:
- Jan 30, 2006, 4:07:29 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/sound/sound_engine.cc
r6850 r6856 273 273 bool SoundEngine::initAudio() 274 274 { 275 ALenum result; 276 PRINTF(3)("Initialisazing openAL sound engine\n"); 277 const char* defaultDevice =(const char*) alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER); 278 const char* deviceList = (const char*)alcGetString(NULL,ALC_DEVICE_SPECIFIER); 279 const char* devWalk = deviceList; 280 // if (alcIsExtensionPresent(NULL, (const ALCchar*)"ALC_ENUMERATION_EXT") == AL_TRUE) 281 { // try out enumeration extension 282 PRINTF(3)("Enumeration-extension found\n"); 283 284 PRINTF(3)("Default device: %s\n", defaultDevice); 285 do 286 { 287 PRINTF(3)("%s\n", devWalk); 288 devWalk += strlen(devWalk)+1; 289 } 290 while (devWalk[0] != '\0'); 291 292 293 294 } 275 // ALenum result; 276 // PRINTF(3)("Initialisazing openAL sound engine\n"); 277 // const char* defaultDevice =(const char*) alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER); 278 // const char* deviceList = (const char*)alcGetString(NULL,ALC_DEVICE_SPECIFIER); 279 // const char* devWalk = deviceList; 280 // // if (alcIsExtensionPresent(NULL, (const ALCchar*)"ALC_ENUMERATION_EXT") == AL_TRUE) 281 // { // try out enumeration extension 282 // PRINTF(3)("Enumeration-extension found\n"); 283 // 284 // PRINTF(3)("Default device: %s\n", defaultDevice); 285 // do 286 // { 287 // PRINTF(3)("%s\n", devWalk); 288 // devWalk += strlen(devWalk)+1; 289 // } 290 // while (devWalk[0] != '\0'); 291 // } 295 292 296 293 // INITIALIZING THE DEVICE: 297 /* 298 #ifdef AL_VERSION_1_1 299 ALCchar deviceName[] = 300 294 unsigned char deviceName[] = 301 295 #ifdef __WIN32__ 302 296 "Direct3D"; … … 304 298 "'( ( devices '( native null ) ) )"; 305 299 #endif 306 // 307 this->device = alcOpenDevice(deviceName); 308 309 this->context = alcCreateContext(this->device, NULL); 310 311 alcMakeContextCurrent(this->context); 312 #else*/ 313 this->device = alcOpenDevice(NULL); 314 this->checkError("Error opening Device", __LINE__); 300 301 this->device = alcOpenDevice(deviceName); 302 this->checkALCError("opening Device", __LINE__); 303 printf("%p\n", this->device); 304 305 printf("Audio-Specifier: %s\n", (const char*)alcGetString(this->device, ALC_DEVICE_SPECIFIER)); 306 printf("Audio-Extensions: %s\n", (const char*)alcGetString(this->device, ALC_EXTENSIONS)); 307 315 308 316 309 this->context = alcCreateContext(this->device, NULL); 317 this->checkALCError(" Errorcreating Context", __LINE__);318 319 //alcMakeContextCurrent(this->context);320 this->checkALCError(" Making Context Current", __LINE__);310 this->checkALCError("creating Context", __LINE__); 311 312 alcMakeContextCurrent(this->context); 313 this->checkALCError("making Context Current", __LINE__); 321 314 // #endif 322 323 if ((result = alGetError()) != AL_NO_ERROR)324 PRINTF(2)("%s\n", SoundEngine::getALErrorString(result));325 315 326 316 this->setDopplerValues(SOUND_DOPPLER_FACTOR, SOUND_DOPPLER_VELOCITY);
Note: See TracChangeset
for help on using the changeset viewer.