BEFORE:
AFTER:
The major change is the use of log10 to determine the volume gradiation along a logarithmic scale as opposed to a linear scale because DirectSound's SetVolume function takes an input paramater that scales in the same way that decibels are scaled.
I also use MY_DSBVOLUME_MIN, defined as -5000, instead of the DSBVOLUME_MIN, defined in dsound.h as -10000, because -10000 is just way too silent for a lower bound and I found -5000 to be a better minimum bound for the volume range to avoid an annoying silence for the lower 50% of the volume slider.
AFTER:
The major change is the use of log10 to determine the volume gradiation along a logarithmic scale as opposed to a linear scale because DirectSound's SetVolume function takes an input paramater that scales in the same way that decibels are scaled.
I also use MY_DSBVOLUME_MIN, defined as -5000, instead of the DSBVOLUME_MIN, defined in dsound.h as -10000, because -10000 is just way too silent for a lower bound and I found -5000 to be a better minimum bound for the volume range to avoid an annoying silence for the lower 50% of the volume slider.