From 8d9c74bc4f9652739143163f6861682999fbfbe5 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Thu, 22 Sep 2022 13:21:30 -0400 Subject: finish openal and ALUT --- engine/xe_sound.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'engine/xe_sound.cpp') diff --git a/engine/xe_sound.cpp b/engine/xe_sound.cpp index d315179..09589fa 100644 --- a/engine/xe_sound.cpp +++ b/engine/xe_sound.cpp @@ -8,20 +8,8 @@ namespace xe { XeSound::XeSound(const std::string& filename) { - // ALvoid *data; - // ALsizei size, freq; - // ALenum format; - // ALboolean loop; - // char *bufferData; - - alutInit(0, NULL); - - std::cout << std::hex << alutGetError() << "\n"; - buffer = alutCreateBufferFromFile(filename.c_str()); - std::cout << std::hex << alutGetError() << "\n"; - alGenSources(1, &source); alSourcef(source, AL_GAIN, 1.f); @@ -30,13 +18,13 @@ XeSound::XeSound(const std::string& filename) { alSource3f(source, AL_VELOCITY, 0, 0, 0); alSourcei(source, AL_LOOPING, AL_FALSE); alSourcei(source, AL_BUFFER, buffer); + alSourcef(source, AL_GAIN, 3.f); } XeSound::~XeSound() { alDeleteSources(1, &source); alDeleteBuffers(1, &buffer); - alutExit(); } void XeSound::play() { -- cgit v1.2.3-freya