File tree Expand file tree Collapse file tree
GeneralsMD/Code/GameEngine/Source/Common Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434
3535#if defined(__EMSCRIPTEN__)
3636#include < emscripten.h>
37- #include < SDL3/SDL.h>
38-
39- extern SDL_Window *TheSDL3Window;
4037
4138// TheSuperHackers @feature githubawn 29/07/2026 A browser tab cannot host a blocking
4239// game loop: the page only paints, delivers input and completes network I/O when
4340// control returns to its event loop. So instead of GameEngine::execute() running the
4441// loop itself, one iteration is handed to emscripten_set_main_loop below and the
45- // browser calls it once per animation frame.
42+ // browser calls it once per animation frame. Window and SDL teardown stays with the
43+ // platform layer that created them; the page tears both down on unload anyway.
4644static void ggcEmscriptenLoopIteration ()
4745{
4846 if (TheGameEngine != nullptr && !TheGameEngine->getQuitting ())
@@ -62,13 +60,6 @@ static void ggcEmscriptenLoopIteration()
6260 TheFramePacer = nullptr ;
6361 delete TheGameEngine;
6462 TheGameEngine = nullptr ;
65-
66- if (TheSDL3Window != nullptr )
67- {
68- SDL_DestroyWindow (TheSDL3Window);
69- TheSDL3Window = nullptr ;
70- }
71- SDL_Quit ();
7263}
7364#endif
7465
You can’t perform that action at this time.
0 commit comments