Add custom shell-file support
Hey there,
I've started working on the shell-file support.
What I did:
- Add
shell-fileas an option - Add example with emscripten main loop
emscripten_set_main_loop_arg - Added a wav file that I created with https://sfxr.me/ (so there should not be any copyright issues).
- Comment out the webhacks (are they still needed? I was having trouble with duplicate symbols)
Using emscripten_set_main_loop_arg because of a problem being mention in the raylib docs for html5 [here](
I also had to comment out the webhack). I also noticed that problem myself when trying to have higher framerates than 60FPS.
Also the game got stuck at some point and cause the browser to break. I'm not sure if the latter one is connected to the loop issue but it didn't happen again after I added the emscripten loop in the web build.
The zls formatter got a bit greedy and formatted a bit too much. I'll fix that before I switch over from draft to the actual PR.
Also I'm having some issues with using the build.zig.zon raylib ressource and debugged it with a local repo of raylib.
I'm also going to fix that before I open the actual PR.
Something that I saw in the sokol-zig bindings might be interesting, too.
They actually use emsdk as dependency in their build.zig.zon file and use it from there.
This might help with setting up emsdk easier. I'm not sure if this has to be done in the raylib repo first though.
The build.zig.zon I was referring to is here.
Let me know if I did too much in the PR.
As mentioned above I'll add some fixes but I can also see that I might've added too much to this PR even without the formatter changes. Or maybe just how I added the shell-files option.