zig-wasm-audio-framebuffer is a set of minimalist examples showing how to render pixels and audio samples via WASM in the browser.
From the school of “Give me a damn framebuffer pointer and I’ll manage the rest!”
I wanted to build some simple games for the web and was lost and confused looking at Emscripten and WebGL based game engines. There are some samples in pure Zig as well as ports of a some C games and libs.
Recently updated for 0.13.0, added a NES emulator, setup github pages for demos.
Interesting. It’s ok here on my M1+M3 Macs in Safari and Firefox. Would you mind raising a github issue with a description and the info from https://www.whatsmybrowser.org/
Weird. In order to cope with Doom’s preferred audio frequency I request WebAudio runs at 22050Hz. I wonder if it’s not allowing that on some browsers.
If possible, can you run doom with the Javascript console enabled.
Do you see these two lines in the debug?
The first is it requesting 22050, the second is it reading the current frequency and using it to configure the music synth.
I do see those two lines, and in fact trying it out again now I can report that music speed is back to normal (or, if anything, a tad slower than I remembered). Not sure what caused that.
I was interested to see how hard it would be to get a nice looking terminal emulator via WASM, so here’s a port of libvterm rendering via truetype sending pixels to a browser canvas.
And, because I didn’t know what else to do with that - it plays an Asciinema recording