4 ms·
Emscripten[1] comes with SDL support (cf its test suite [2]). Not sure how complete it is. [1] http://kripken.github.io/emscripten-site/ http://kripken.github.
by cygx 10y ago
Emscripten[1] comes with SDL support (cf its test suite [2]). Not sure how complete it is.
[1] http://kripken.github.io/emscripten-site/ http://kripken.github.io/emscripten-site/
[2] https://github.com/kripken/emscripten/blob/master/tests/hello_image_sdl.c https://github.com/kripken/emscripten/blob/master/tests/hell...
- vitovito 10y agoThe original SDL support was a JavaScript implementation of just enough of 1.x to get things compiling. SDL2 cross-compiles to JavaScript properly and should be used by most things now.
- scrame 10y agoso emscripten provides the sdl binding? I was assuming it'd cover libc, but does that mean it's part of the ecosystem or the compiler? I feel like I'm just asking dumb toolchain questions because I'm missing something fundamental about targeting an executable build to the browser.
- corysama 10y agoI think this is what you are missing. https://kripken.github.io/emscripten-site/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html https://kripken.github.io/emscripten-site/docs/porting/conne...
- dividuum 10y agoEmscripten also allows access to WebGL, which is pretty neat. I'm writing (and selling, you should check out https://info-beamer.com/pi https://info-beamer.com/pi) a software to make it easy to build animated information screens. I'm also embedding Lua to make everything scriptable. As a proof of concept I cross-compiled the existing open source software (https://github.com/dividuum/info-beamer https://github.com/dividuum/info-beamer) to JS with emscripten two years ago. Here's the demo site: https://dividuum.de/experiments/info-beamer-js/ https://dividuum.de/experiments/info-beamer-js/. What you see is a C program with an embedded Lua VM running very simple Lua code (https://github.com/dividuum/info-beamer/blob/master/samples/shader/node.lua https://github.com/dividuum/info-beamer/blob/master/samples/...) to transform a loaded PNG image through a GLSL in a WebGL context. It's pretty amazing that these things are possible. I'm also pretty sure a lot has improved in emscripten since then. Maybe I should give that another try...