Skip to content

veandco/sdl2-webassembly-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SDL2 WebAssembly Builder

Screenshot

This is a container to build SDL2 programs into WebAssembly so it can be displayed in a website. It's still very much in-progress and I'm no expert so any improvement is appreciated!

Usage

The image can be built by running:

docker build -t emscripten-sdl2 .

Then you can make changes to src/main.c (and src/Makefile if needed).

After that, the WebAssembly can be generated by running:

./build.sh

Finally, you can view the result by running:

cd dist
python -m http.server

NOTE: if you have Python 2, use python -m SimpleHTTPServer instead.

and go to http://localhost:8000 in the browser!

Credits

Many thanks to Michał Kalbarczyk's blog post which taught me how to compile SDL2 into WebAssembly.

About

SDL2 WebAssembly Builder using Docker container

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published