https://github.com/natanielf/cgl
Conway's Game of Life in WebAssembly and WebGL
https://github.com/natanielf/cgl
conways-game-of-life emscripten wasm webassem
Last synced: 2 months ago
JSON representation
Conway's Game of Life in WebAssembly and WebGL
- Host: GitHub
- URL: https://github.com/natanielf/cgl
- Owner: natanielf
- License: mit
- Created: 2024-08-22T16:57:06.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-26T01:19:52.000Z (about 1 year ago)
- Last Synced: 2025-06-04T21:55:11.585Z (about 1 year ago)
- Topics: conways-game-of-life, emscripten, wasm, webassem
- Language: C
- Homepage:
- Size: 45.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Conway's Game of Life in WebAssembly
## Environment Setup
- Install the [Emscripten SDK (emsdk)](https://emscripten.org/docs/getting_started/downloads.html)
```sh
source path/to/emsdk/emsdk_env.sh
```
## Build
```sh
emcc -Wall -sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2 main.c cgl.c -o main.js
```
## Run
```sh
python3 -m http.server
```
Open http://0.0.0.0:8000/ in your browser.
## References
- https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life
- https://developer.mozilla.org/en-US/docs/WebAssembly/C_to_Wasm
- https://emscripten.org/docs/getting_started/Tutorial.html
- https://emscripten.org/docs/api_reference/emscripten.h.html
- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/range
- https://www.geeksforgeeks.org/dynamically-allocate-2d-array-c/
- https://en.cppreference.com/w/c/numeric/random/srand
- https://en.cppreference.com/w/c/numeric/random/rand
- https://emscripten.org/docs/porting/multimedia_and_graphics/OpenGL-support.html
- https://emscripten.org/docs/porting/multimedia_and_graphics/EGL-Support-in-Emscripten.html
- https://github.com/emscripten-core/emscripten/blob/main/test/third_party/glbook/Common/esUtil.c
- https://github.com/emscripten-core/emscripten/blob/main/test/minimal_webgl
- https://doublejump.github.io/webgl-with-webassembly/index.html