aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/main.c b/src/main.c
index e2e5e67..6dd4a69 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,17 +1,24 @@
#include "gameCommon.h"
#include "game.h"
-#include <raylib.h>
-int main(int argc, char** argv)
-{
- Game game;
- initGame(&game);
+Game game;
- while (!WindowShouldClose())
- {
- updateGame(&game);
+void updateFrame() {
+ updateGame(&game);
+}
+
+int main(int argc, char ** argv) {
+ initGame(&game);
+
+#ifdef PLATFORM_WEB
+ emscripten_set_main_loop(updateFrame, 0, 1);
+#else
+ while (!WindowShouldClose()) {
+ updateFrame();
}
+#endif
- closeGame(&game);
- return 0;
+ closeGame(&game);
+ return 0;
}
+