wasm support

This commit is contained in:
2026-03-25 19:50:21 +01:00
parent 548db30cdd
commit ab52775ba7
12 changed files with 541 additions and 57 deletions

View File

@@ -1,15 +1,27 @@
#include "ui/Application.h"
#include <cstdio>
#ifdef __EMSCRIPTEN__
// Keep app alive for the Emscripten main loop.
static baudline::Application* g_app = nullptr;
#endif
int main(int argc, char** argv) {
baudline::Application app;
static baudline::Application app;
if (!app.init(argc, argv)) {
std::fprintf(stderr, "Failed to initialize application\n");
return 1;
}
#ifdef __EMSCRIPTEN__
g_app = &app;
#endif
app.run();
#ifndef __EMSCRIPTEN__
app.shutdown();
#endif
return 0;
}