sfw/main.cpp

22 lines
414 B
C++
Raw Normal View History

#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif // __EMSCRIPTEN__
#include "game_application.h"
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-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__
2024-01-03 13:55:16 +01:00
memdelete(application);
2023-12-19 15:23:49 +01:00
return 0;
}