Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6856 in orxonox.OLD for trunk/src/lib/sound


Ignore:
Timestamp:
Jan 30, 2006, 4:07:29 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: testing if this works everywhere

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/sound/sound_engine.cc

    r6850 r6856  
    273273bool SoundEngine::initAudio()
    274274{
    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//  }
    295292
    296293  // INITIALIZING THE DEVICE:
    297   /*
    298   #ifdef AL_VERSION_1_1
    299     ALCchar deviceName[] =
    300 
     294  unsigned char deviceName[] =
    301295  #ifdef __WIN32__
    302296        "Direct3D";
     
    304298        "'( ( devices '( native null ) ) )";
    305299  #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
    315308
    316309  this->context = alcCreateContext(this->device, NULL);
    317   this->checkALCError("Error creating 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__);
    321314  // #endif
    322 
    323   if ((result = alGetError()) != AL_NO_ERROR)
    324     PRINTF(2)("%s\n", SoundEngine::getALErrorString(result));
    325315
    326316  this->setDopplerValues(SOUND_DOPPLER_FACTOR, SOUND_DOPPLER_VELOCITY);
Note: See TracChangeset for help on using the changeset viewer.