Emscripten: resize canvas to 0x0 in DestroyWindow
authorCharlie Birks <charlie@daftgames.net>
Tue, 29 Jan 2019 12:19:23 +0000
changeset 12578b127ca09e7fe
parent 12577 32d2fe2bc966
child 12579 8dc4e45fbe2b
Emscripten: resize canvas to 0x0 in DestroyWindow
Closest we can get to actually destroying it
src/video/emscripten/SDL_emscriptenvideo.c
     1.1 --- a/src/video/emscripten/SDL_emscriptenvideo.c	Tue Jan 29 12:19:06 2019 +0000
     1.2 +++ b/src/video/emscripten/SDL_emscriptenvideo.c	Tue Jan 29 12:19:23 2019 +0000
     1.3 @@ -293,6 +293,10 @@
     1.4              data->egl_surface = EGL_NO_SURFACE;
     1.5          }
     1.6  #endif
     1.7 +
     1.8 +        /* We can't destroy the canvas, so resize it to zero instead */
     1.9 +        emscripten_set_canvas_element_size(NULL, 0, 0);
    1.10 +
    1.11          SDL_free(window->driverdata);
    1.12          window->driverdata = NULL;
    1.13      }