Skip to content

kiyeo/dvd-video-sdl2-wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

dvd-video-sdl2-wasm

A demo utlizing c++, sdl2, sdl2-image and wasm generated from emscripten on a custom html document

Instructions:

  1. Install Emscripten:

    http://emscripten.org

  2. Clone this repo:

    git clone https://github.com/Kiyeo/dvd-video-sdl2-wasm
    cd dvd-video-sdl2-wasm
    
  3. 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
    
  4. 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:

    http://localhost:8080/

  5. You should see the classic dvd video logo:

    image

NOTE: The gh-pages branch contains the compiled code

Compile locally

g++ dvd.cpp -lSDL2 -lSDL2_image -O3