Add .github/workflows/deploy-wasm.yml that:
- Installs Emscripten SDK on ubuntu-latest
- Builds example_sdl2_opengl3 with Makefile.emscripten using -sSINGLE_FILE
(all WASM+JS embedded in a single .html file, no separate .wasm/.js)
- Uses custom shell_imgui_xl.html with loading spinner and WebGL context
loss handling
- Deploys to gh-pages/wasm/ directory via peaceiris/actions-gh-pages
The resulting live demo at turtle-pb.github.io/imgui_xl/wasm/index.html
will show the ACTUAL Dear ImGui demo window running in the browser via
WebAssembly — not a canvas simulation, but real compiled C++ ImGui.
Triggers on pushes to master that touch ImGui source files, the SDL2/
OpenGL3 backend, the example, or the shell template.
Also supports manual workflow_dispatch.
- in Firefox, scrollbar would appear => adding overflow: hidden fixes this issue
- when the canvas has the focus, Chrome draws a very small blue outline, setting it to none fixes this issue
Without tabindex, the canvas element is not focusable in the DOM, so pongasoft/emscripten-glfw's focus/blur listeners on the canvas
never fire. This means glfwSetWindowFocusCallback is never called etc.
Ref: https://github.com/pongasoft/emscripten-glfw/issues/29