Fixed compile errors in example programs.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
diff --git a/test/testgamecontroller.c b/test/testgamecontroller.c
index 7f89c19..29e0308 100644
--- a/test/testgamecontroller.c
+++ b/test/testgamecontroller.c
@@ -214,7 +214,7 @@ WatchGameController(SDL_GameController * gamecontroller)
emscripten_set_main_loop_arg(loop, gamecontroller, 0, 1);
#else
while (!done) {
- loop(gamecontroler);
+ loop(gamecontroller);
}
#endif
diff --git a/test/testgesture.c b/test/testgesture.c
index ea7512d..7f766c5 100644
--- a/test/testgesture.c
+++ b/test/testgesture.c
@@ -269,6 +269,9 @@ void loop()
int main(int argc, char* argv[])
{
+ window = NULL;
+ screen = NULL;
+ quitting = SDL_FALSE;
/* Enable standard application logging */
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
@@ -279,13 +282,8 @@ int main(int argc, char* argv[])
if (SDL_Init(SDL_INIT_VIDEO) < 0 ) return 1;
- if (!(screen = initScreen(WIDTH,HEIGHT)))
- {
- SDL_Quit();
- return 1;
- }
-
- if (!(window = initWindow(NULL,WIDTH,HEIGHT)))
+ if (!(window = initWindow(window, WIDTH, HEIGHT)) ||
+ !(screen = SDL_GetWindowSurface(window)))
{
SDL_Quit();
return 1;
diff --git a/test/testmultiaudio.c b/test/testmultiaudio.c
index 6cfab5a..4f979d5 100644
--- a/test/testmultiaudio.c
+++ b/test/testmultiaudio.c
@@ -54,7 +54,9 @@ void
loop()
{
if(cbd[0].done) {
+#ifdef __EMSCRIPTEN__
emscripten_cancel_main_loop();
+#endif
SDL_PauseAudioDevice(cbd[0].dev, 1);
SDL_CloseAudioDevice(cbd[0].dev);
SDL_FreeWAV(sound);
@@ -145,6 +147,17 @@ test_multi_audio(int devcount)
SDL_Delay(100);
}
+
+#ifndef __EMSCRIPTEN__
+ for (i = 0; i < devcount; i++) {
+ if (cbd[i].dev) {
+ SDL_PauseAudioDevice(cbd[i].dev, 1);
+ SDL_CloseAudioDevice(cbd[i].dev);
+ }
+ }
+
+ SDL_Log("All done!\n");
+#endif
}