Test 1
This commit is contained in:
@@ -8,8 +8,9 @@ Sound::Sound(const char* inWavPath, bool inLooping):
|
||||
buffer_id(0),
|
||||
source_id(0),
|
||||
is_looping(inLooping)
|
||||
|
||||
{
|
||||
isPlaying = false;
|
||||
|
||||
const char* path = inWavPath;
|
||||
|
||||
FILE *fp = fopen(path, "rb"); // Open the WAVE file
|
||||
@@ -121,6 +122,7 @@ void Sound::SetPos(const Vec3f& inPos, const Vec3f& inVel)
|
||||
|
||||
void Sound::Play()
|
||||
{
|
||||
isPlaying = true;
|
||||
alSourcePlay(source_id);
|
||||
int e = alGetError(); // != AL_NO_ERROR) return;
|
||||
}
|
||||
@@ -134,6 +136,12 @@ void Sound::Pause()
|
||||
|
||||
void Sound::Stop()
|
||||
{
|
||||
isPlaying = false;
|
||||
alSourceStop(source_id);
|
||||
}
|
||||
|
||||
bool Sound::IsPlaying()
|
||||
{
|
||||
return isPlaying;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user