Afegit "int JA_SetVolume(int volume);"

This commit is contained in:
2022-08-28 08:16:30 +02:00
parent 1623654564
commit 1ba349f6c3
3 changed files with 18 additions and 5 deletions

View File

@@ -16,7 +16,7 @@ int main(int argc, char **argv) {
int channel = -1;
JA_PlayMusic(music, true);
int volume = 128;
bool should_exit = false;
while(!should_exit) {
while(SDL_PollEvent(&event)) {
@@ -41,6 +41,12 @@ int main(int argc, char **argv) {
case SDL_SCANCODE_6: // Si pulsem la tecla '6' stopem definitivament el wav infinit
JA_StopChannel(channel);
break;
case SDL_SCANCODE_UP:
volume = JA_SetVolume(volume+16);
break;
case SDL_SCANCODE_DOWN:
volume = JA_SetVolume(volume-16);
break;
}
}