Changeset 499 for trunk/thune/gl/audio.c
- Timestamp:
- 12/05/07 03:12:00 (12 months ago)
- Files:
-
- 1 modified
-
trunk/thune/gl/audio.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/thune/gl/audio.c
r458 r499 55 55 56 56 static int _audioUp = 0; 57 #if 0 57 //#define OPEN_DEVICE 1 58 #ifdef OPEN_DEVICE 58 59 static ALCdevice* _adevice = 0; 59 60 static ALCcontext* _acontext = 0; … … 62 63 63 64 64 #define MUSIC_BUFFERS 265 #define MUSIC_BUFFERS 3 65 66 static ALuint _musicSource = 0; 66 67 static ALfloat _musicGain = 1.0f; … … 76 77 #define OGG_BIG_ENDIAN 1 77 78 #endif 78 #define OGG_BUFFER_SIZE (4096 * 4) 79 80 /* 81 OGG_BUFFER_SIZE is set to hold one second of data in each music buffer. 82 If aud_update() is not called before all buffers are played then OpenAL 83 will stop the sound source. 84 */ 85 #define OGG_BUFFER_SIZE (44100 * 2) 79 86 static char _oggPCM[ OGG_BUFFER_SIZE ]; 80 87 … … 141 148 int aud_startup() 142 149 { 143 #if 0150 #ifdef OPEN_DEVICE 144 151 _adevice = alcOpenDevice( 0 ); 145 152 if( ! _adevice ) … … 150 157 alutInitWithoutContext( 0, 0 ); 151 158 #else 152 alutInit( 0, 0 ); 159 if( alutInit( 0, 0 ) == AL_FALSE ) 160 return 0; 153 161 #endif 154 162 … … 175 183 alDeleteBuffers( MUSIC_BUFFERS, _musicBuffers ); 176 184 177 #if 0185 #ifdef OPEN_DEVICE 178 186 // Could not use alutExit() on my box (FC3/Shuttle XPC) since 179 187 // alcMakeContextCurrent(0) -> _alLockMixerPause() will hangup. 180 188 alcDestroyContext( _acontext ); 181 189 alcCloseDevice( _adevice ); 182 #e ndif190 #else 183 191 alutExit(); 192 #endif 184 193 } 185 194 }
