Changeset 350 for code/branches/audio/src
- Timestamp:
- Nov 29, 2007, 5:12:16 PM (17 years ago)
- Location:
- code/branches/audio/src/audio
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/audio/src/audio/AudioBuffer.cc
r349 r350 5 5 AudioBuffer::AudioBuffer(std::string fileName) 6 6 { 7 7 // Load wav data into buffers. 8 alGenBuffers(1, &buffer); 9 10 if(alGetError() != AL_NO_ERROR) 11 loaded=AL_FALSE; 12 13 alutLoadWAVFile((ALbyte*)fileName.c_str(), &format, &data, &size, &freq, &loop); 14 alBufferData(buffer, format, data, size, freq); 15 alutUnloadWAV(format, data, size, freq); 16 17 // Do another error check and return. 18 if(alGetError() != AL_NO_ERROR) 19 loaded=AL_FALSE; 20 21 loaded=AL_TRUE; 8 22 } 9 23 -
code/branches/audio/src/audio/AudioBuffer.h
r349 r350 19 19 private: 20 20 // Buffers hold sound data. 21 ALuint data;21 ALuint buffer; 22 22 // Identifier 23 23 std::string name; 24 // True if AL was able to load data 25 ALboolean loaded; 26 27 ALenum format; 28 ALsizei size; 29 ALvoid* data; 30 ALsizei freq; 31 ALboolean loop; 24 32 }; 25 33 }
Note: See TracChangeset
for help on using the changeset viewer.