Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 29, 2007, 5:12:16 PM (16 years ago)
Author:
nicolape
Message:
  • Added CmakeLists so that it works on my machine for testing
  • Fixed a Bug in AudioBuffer
Location:
code/branches/audio/src/audio
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/audio/src/audio/AudioBuffer.cc

    r349 r350  
    55        AudioBuffer::AudioBuffer(std::string fileName)
    66        {
    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;
    822        }
    923       
  • code/branches/audio/src/audio/AudioBuffer.h

    r349 r350  
    1919        private:
    2020                // Buffers hold sound data.
    21                 ALuint data;
     21                ALuint buffer;
    2222                // Identifier
    2323                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;
    2432        };
    2533}
Note: See TracChangeset for help on using the changeset viewer.