RobLoach / pntr_app

Application wrapper for pntr.
https://robloach.github.io/pntr_app/
zlib License
5 stars 1 forks source link

Add Emscripten Web Target #58

Closed konsumer closed 11 months ago

konsumer commented 12 months ago

This is the beginning of ideas for pure-web target.

It's not currently calling pntr_load_sound_from_memory, so later when it calls pntr_play_sound it won't work, not sure why.

This shows some of the basic ideas of it, though, like canvas is the canvas, and you can use Module.pntr_sounds to track sounds. I also updated the README.

Functions can be implemented in js or c, but js needs ; on very line, I think due to minification.

konsumer commented 12 months ago

I think this is RTM. It has sounds and plain canvas call to draw. I had to modify the demo to not call play on the sound immediately in Init, since web requires user-interaction before play:

    #ifndef EMSCRIPTEN
    pntr_play_sound(appData->music, true);
    #endif