-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
emscripten example broken: missing API functions in emscripten's glfw3 #6240
Comments
It did indeed start breaking on CI a few days machines with Emscripten, but when I tried locally with latest I didn’t repro the issue. It seems odd to me that the Gamepad function would get removed, although perhaps it never worked (i don’t remember testing gamepad on glfw + Emscripten). Would ideally need to investigate recent Emscripten history. |
Hello and thank you for your quick reply! Did you do your local test with a fresh emscripten as well? I'm on 3.1.33 I forgot to mention that I also had to add I should also add that even though it compiled I couldn't run it in the end in any browser as wgpu, as the Readme says, is very experimental. I had success with this other example that uses emscripten but not webgpu (Uh!), I guess just straight webgl? : https://github.com/jnmaloney/WebGui/blob/master/Makefile#L6-L10 |
I did update to 3.1.33 yes.
That's due to a small change I applied to all example on Friday and the local variable was missing from this example, my bad. Both |
I actually just realised that, thank you for mentioning it! I guess it comes down to me being completely new to emscripten and ignoring some of the details... and not reading EXAMPLES.md which mentions these examples support emscripten, oops sorry... my bad on this! |
Looking at this some more, one of the call is actually correctly guarded with an I put everything together in a new repo, it will evolve into my own usecase (some sort of viewer for DSP development) but as of this commit, except for the name and implot, it's pretty much the same as the example https://github.com/Simon-L/303freqgui/tree/951729ec3310664b6a8898b9065361522604140f Should I update this issue's title? |
Issue title is ok, but we need to investigate what changed in Emscripten because it might be a bug there On Feb 25 they did update their emulation layer to GLFW 3.3 API: |
Confirmed a few things now:
Fixed with e39c255. I noticed that Gamepad doesn't work correctly on GLFW+Emscripten (vs it works on SDL+Emscripten) because without |
Version/Branch of Dear ImGui:
Version: Fresh clone from github
Branch: master
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_glfw.cpp + imgui_impl_wgpu.cpp
Operating System: Linux (Debian testing)
My Issue/Question:
Related to: https://github.com/ocornut/imgui/tree/master/examples/example_emscripten_wgpu
At least on my machine the example for emscripten is broken. First time using emscripten here, I followed the example's readme, installed recommended emscripten and ran the source command for the correct env vars etc.
It seems commits (here and here ) to the glfw impl without #ifdef guarding for emscripten cause this error as emscripten ships a special glfw that misses these functions.
Simply commenting these calls (3 lines total) in
imgui_impl_glfw.cpp
fixes the issue.Am I missing something? As even recently emscripten was mentioned in the commit history and the
glfwGetGamepadState
call was added one year ago.The text was updated successfully, but these errors were encountered: