Changeset 6849 in orxonox.OLD for trunk/src/lib/sound
- Timestamp:
- Jan 30, 2006, 2:57:55 AM (19 years ago)
- Location:
- trunk/src/lib/sound
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/sound/sound_engine.cc
r6847 r6849 311 311 alcMakeContextCurrent(this->context); 312 312 #else*/ 313 printf("!!!!!!!!!!!!!!!!!!%d\n", __LINE__);314 313 this->device = alcOpenDevice(NULL); 315 printf("!!!!!!!!!!!!!!!!!!%d\n", __LINE__); 316 SoundEngine::checkError("Error opening Device", __LINE__); 317 printf("!!!!!!!!!!!!!!!!!!%d\n", __LINE__); 314 this->checkError("Error opening Device", __LINE__); 315 318 316 this->context = alcCreateContext(this->device, NULL); 319 printf("!!!!!!!!!!!!!!!!!!%d\n", __LINE__); 320 SoundEngine::checkError("Error creating Context", __LINE__); 321 //alcMakeContextCurrent(this->context); 322 printf("!!!!!!!!!!!!!!!!!!%d\n", __LINE__); 323 this->checkError("Making Context Current", __LINE__); 317 this->checkALCError("Error creating Context", __LINE__); 318 319 alcMakeContextCurrent(this->context); 320 this->checkALCError("Making Context Current", __LINE__); 324 321 // #endif 325 322 … … 376 373 else 377 374 return true; 375 } 376 377 bool SoundEngine::checkALCError(const char* error, unsigned int line) 378 { 379 ALenum errorCode; 380 if ((errorCode = alcGetError(this->device)) != ALC_NO_ERROR) 381 { 382 PRINTF(1)("Error %s (line:%d): '%s'\n", error, line, SoundEngine::getALCErrorString(errorCode)); 383 return false; 384 } 385 else 386 return true; 387 } 388 389 390 391 void SoundEngine::listDevices() 392 { 393 printf("%s\n",(const char*)alcGetString(NULL, ALC_DEVICE_SPECIFIER)); 378 394 } 379 395 … … 401 417 } 402 418 403 void SoundEngine::listDevices()404 {405 printf("%s\n",(const char*)alcGetString(NULL, ALC_DEVICE_SPECIFIER));406 }407 408 419 409 420 const char* SoundEngine::getALCErrorString(ALenum err) … … 412 423 { 413 424 case ALC_NO_ERROR: 414 return ("AL_NO_ERROR \n");425 return ("AL_NO_ERROR"); 415 426 case ALC_INVALID_DEVICE: 416 return ("ALC_INVALID_DEVICE \n");427 return ("ALC_INVALID_DEVICE"); 417 428 case ALC_INVALID_CONTEXT: 418 return("ALC_INVALID_CONTEXT \n");429 return("ALC_INVALID_CONTEXT"); 419 430 case ALC_INVALID_ENUM: 420 return("ALC_INVALID_ENUM \n");431 return("ALC_INVALID_ENUM"); 421 432 case ALC_INVALID_VALUE: 422 return ("ALC_INVALID_VALUE \n");433 return ("ALC_INVALID_VALUE"); 423 434 case ALC_OUT_OF_MEMORY: 424 return("ALC_OUT_OF_MEMORY \n");435 return("ALC_OUT_OF_MEMORY"); 425 436 }; 426 437 } -
trunk/src/lib/sound/sound_engine.h
r6847 r6849 60 60 // error handling: 61 61 static bool checkError(const char* error, unsigned int line); 62 staticbool checkALCError(const char* error, unsigned int line);62 bool checkALCError(const char* error, unsigned int line); 63 63 static const char* getALErrorString(ALenum err); 64 64 static const char* getALCErrorString(ALenum err);
Note: See TracChangeset
for help on using the changeset viewer.