summaryrefslogtreecommitdiff
path: root/engine/xe_sound.cpp
diff options
context:
space:
mode:
authorTyler Murphy <tylermurphy534@gmail.com>2022-09-22 13:36:03 -0400
committerTyler Murphy <tylermurphy534@gmail.com>2022-09-22 13:36:03 -0400
commitcbe1374b032a80bf3d1cf13fd751ea35648c7bea (patch)
treef19871faff2459cb7fa6b7c342ccbc82610a8adc /engine/xe_sound.cpp
parentfinish openal and ALUT (diff)
downloadminecraftvulkan-cbe1374b032a80bf3d1cf13fd751ea35648c7bea.tar.gz
minecraftvulkan-cbe1374b032a80bf3d1cf13fd751ea35648c7bea.tar.bz2
minecraftvulkan-cbe1374b032a80bf3d1cf13fd751ea35648c7bea.zip
sound set volume
Diffstat (limited to 'engine/xe_sound.cpp')
-rw-r--r--engine/xe_sound.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/engine/xe_sound.cpp b/engine/xe_sound.cpp
index 09589fa..07d8e7b 100644
--- a/engine/xe_sound.cpp
+++ b/engine/xe_sound.cpp
@@ -18,7 +18,6 @@ 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);
}
@@ -58,4 +57,8 @@ void XeSound::setLooping(bool looping) {
alSourcei(source, AL_LOOPING, looping ? 1 : 0);
};
+void XeSound::setVolume(float volume) {
+ alSourcef(source, AL_GAIN, volume);
+}
+
} \ No newline at end of file