Flask app used to presents the great SDL2 Web portability showed by the siko-dev blog tutorial
python3 app.py
CMAKE & NODEJS
sudo apt-get install cmake nodejs
-
Use the SDK in this github repository or download it
-
Extract it
tar zxf emsdk_portable.tgz
- Go in it
cd emsdk_portable
- Update the EMSDK
./emsdk update
- Install the latest version
./emsdk install latest
- Activate the latest version
./emsdk activate latest
-
Change the NODE_JS variable in the script which contains EMSCRIPTEN's environment variables
-
Usage : Give the access of the different modules (Example: the em++ command)
-
File : You can find it in the SDK directory
-
Example : directory-of-emsdk/.emscripten
NODE_JS = 'nodejs'
-
-
Source
- Usage : Load EMSCRIPTEN environnement in our current environment
source /path/through/emsdk-portable/emsdk_env.sh
- Create your SDL2 project (or use the source code of main.cpp script)
- Build it (without EMSDK option)
gcc main.cpp -o demo `sdl2-config --cflags --libs`
- Build it (with EMSDK)
em++ main.cpp -o demo.html -s USE_SDL=2 -O2
-
demo.js
- Converted game ready to be deploy on the web
-
demo.html
- It will call the generated JS script
-
demo.html.mem
- Memory file
-
demo.html.wasm
- Web assembly file
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
## Initial author - Big thanks (Thanks to Isabelle Garcia and her siko-dev blog tutorial, please use the link below to visit it ! )
https://www.sikorama.fr/2017/05/07/tutoriel-emscripten-et-sdl2/