Commit d8baad7e483ff04c0bbd7fa8d6d49dce243376df

Joseph Kogut 2019-02-27T14:15:40

emscripten: use emscripten_get_screen_size api

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/src/video/emscripten/SDL_emscriptenvideo.c b/src/video/emscripten/SDL_emscriptenvideo.c
index b38862e..a376b50 100644
--- a/src/video/emscripten/SDL_emscriptenvideo.c
+++ b/src/video/emscripten/SDL_emscriptenvideo.c
@@ -137,14 +137,7 @@ Emscripten_VideoInit(_THIS)
 
     /* Use a fake 32-bpp desktop mode */
     mode.format = SDL_PIXELFORMAT_RGB888;
-
-    mode.w = EM_ASM_INT_V({
-        return screen.width;
-    });
-
-    mode.h = EM_ASM_INT_V({
-        return screen.height;
-    });
+    emscripten_get_screen_size(&mode.w, &mode.h);
 
     mode.refresh_rate = 0;
     mode.driverdata = NULL;