Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/veandco/sdl2-webassembly-builder

SDL2 WebAssembly Builder using Docker container
https://github.com/veandco/sdl2-webassembly-builder

Last synced: 11 days ago
JSON representation

SDL2 WebAssembly Builder using Docker container

Awesome Lists containing this project

README

        

# SDL2 WebAssembly Builder

![Screenshot](https://github.com/veandco/sdl2-webassembly-builder/raw/master/screenshot.png "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](https://puddleofcode.com/story/definitive-guide-to-rust-sdl2-and-emscriptem) which taught me how to compile
SDL2 into WebAssembly.