A demo utlizing c++, sdl2, sdl2-image and wasm generated from emscripten on a custom html document
-
Install Emscripten:
-
Clone this repo:
git clone https://github.com/Kiyeo/dvd-video-sdl2-wasm cd dvd-video-sdl2-wasm
-
Build index.js and index.wasm:
emcc dvd.cpp -s USE_SDL=2 -s USE_SDL_IMAGE=2 -O3 -o index.js --preload-file ./ --use-preload-plugins
-
Run a webserver and open localhost:
with Python 2:
python -m SimpleHTTPServer 8080
with Python 3:
python -m http.server 8080
and then open the following URL:
-
You should see the classic dvd video logo:
NOTE: The gh-pages branch contains the compiled code
Compile locally
g++ dvd.cpp -lSDL2 -lSDL2_image -O3