aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authormaficccc@gmail.com <maficccc@gmail.com>2018-03-04 16:26:49 +0100
committermaficccc@gmail.com <maficccc@gmail.com>2018-03-04 16:26:49 +0100
commit8cb324b2da063fb4dac29b4d2a5495fdbe78351a (patch)
tree0fa40ac0df164f9ea1503ed86f854763b3a26e8c /examples
parent85850a955a1c3d6e51f919385679ea9ba4d6a864 (diff)
downloadraylib-8cb324b2da063fb4dac29b4d2a5495fdbe78351a.tar.gz
raylib-8cb324b2da063fb4dac29b4d2a5495fdbe78351a.zip
Fix result of operation is garbage or undefined
Diffstat (limited to 'examples')
-rw-r--r--examples/others/audio_standalone.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/others/audio_standalone.c b/examples/others/audio_standalone.c
index 97c3fd0d..38fe9935 100644
--- a/examples/others/audio_standalone.c
+++ b/examples/others/audio_standalone.c
@@ -76,13 +76,13 @@ int main()
{
// Initialization
//--------------------------------------------------------------------------------------
- unsigned char key;
-
+ static unsigned char key;
+
InitAudioDevice();
-
+
Sound fxWav = LoadSound("resources/audio/weird.wav"); // Load WAV audio file
Sound fxOgg = LoadSound("resources/audio/tanatana.ogg"); // Load OGG audio file
-
+
Music music = LoadMusicStream("resources/audio/guitar_noodling.ogg");
PlayMusicStream(music);
@@ -99,23 +99,23 @@ int main()
PlaySound(fxWav);
key = 0;
}
-
+
if (key == 'd')
{
PlaySound(fxOgg);
key = 0;
}
-
+
UpdateMusicStream(music);
}
-
+
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadSound(fxWav); // Unload sound data
UnloadSound(fxOgg); // Unload sound data
-
+
UnloadMusicStream(music); // Unload music stream data
-
+
CloseAudioDevice();
//--------------------------------------------------------------------------------------