2023-12-18 17:06:11 +01:00
|
|
|
#ifdef __EMSCRIPTEN__
|
|
|
|
#include <emscripten.h>
|
|
|
|
#endif // __EMSCRIPTEN__
|
|
|
|
|
|
|
|
#include "game_application.h"
|
2023-12-31 16:20:14 +01:00
|
|
|
|
2023-12-19 15:23:49 +01:00
|
|
|
int main(int argc, char **argv) {
|
2024-01-03 14:01:29 +01:00
|
|
|
Application *application = memnew(GameApplication());
|
2023-12-18 17:06:11 +01:00
|
|
|
|
2023-12-19 15:23:49 +01:00
|
|
|
#ifdef __EMSCRIPTEN__
|
2024-01-03 18:39:58 +01:00
|
|
|
emscripten_set_main_loop(&Application::main_loop_static, 0, 1);
|
2023-12-19 15:23:49 +01:00
|
|
|
#else
|
|
|
|
while (application->running) {
|
2024-01-03 18:39:58 +01:00
|
|
|
application->main_loop();
|
2023-12-19 15:23:49 +01:00
|
|
|
}
|
|
|
|
#endif // __EMSCRIPTEN__
|
2023-12-18 17:06:11 +01:00
|
|
|
|
2024-01-03 13:55:16 +01:00
|
|
|
memdelete(application);
|
|
|
|
|
2023-12-19 15:23:49 +01:00
|
|
|
return 0;
|
2023-12-18 17:06:11 +01:00
|
|
|
}
|