See README for details about the port.
There are 3 examples, showing the 3 combinations currently available with ImGui.
To build the examples, do the following:
# create a build folder
mkdir /tmp/imgui
emcc --shell-file shell.html --use-port=../../ports/ImGui/imgui.py:backend=glfw:renderer=opengl3 main_glfw_opengl3.cpp -o /tmp/imgui/index.html
# create a build folder
mkdir /tmp/imgui
emcc --shell-file shell.html --use-port=../../ports/ImGui/imgui.py:backend=glfw:renderer=wgpu main_glfw_wgpu.cpp -o /tmp/imgui/index.html
# create a build folder
mkdir /tmp/imgui
emcc --shell-file shell.html --use-port=../../ports/ImGui/imgui.py:backend=sdl2:renderer=opengl3 main_sdl2_opengl3.cpp -o /tmp/imgui/index.html
Each example is built into the /tmp/imgui
folder. You can then "run" each example with something like this:
cd /tmp/imgui
python3 -m http.server 8080
then point your browser to http://localhost:8080
Note
At this moment, the WebGPU example can only run in Chrome and Edge, which are the only browsers fully supporting WebGPU.