sfw/main.cpp

30 lines
471 B
C++
Raw Normal View History

#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif // __EMSCRIPTEN__
#include "game_application.h"
Application *application = NULL;
void handle_frame() {
2024-01-03 13:52:39 +01:00
application->core_loop();
}
2023-12-19 15:23:49 +01:00
int main(int argc, char **argv) {
2024-01-03 13:52:39 +01:00
application = memnew(GameApplication());
2023-12-19 15:23:49 +01:00
#ifdef __EMSCRIPTEN__
emscripten_set_main_loop(handle_frame, 0, 1);
#else
while (application->running) {
2024-01-03 13:52:39 +01:00
application->core_loop();
2023-12-19 15:23:49 +01:00
}
2024-01-03 13:52:39 +01:00
memdelete(application);
2023-12-19 15:23:49 +01:00
#endif // __EMSCRIPTEN__
2023-12-19 15:23:49 +01:00
return 0;
}