Drawing To a Canvas With Webassembly (Without Emscripten)

Опубликовано: 30 Сентябрь 2024
на канале: Maniyar
11,134
228

Sources:

"Making really tiny WebAssembly graphics demos" - http://cliffle.com/blog/bare-metal-wasm/ (where I got the HTML and based the C off of)
"Compiling C to WebAssembly without Emscripten" - https://dassur.ma/things/c-to-webasse... (where I got the compiler flags and everything)


Not really sure why I made this, for anyone interested non-gzipped payload was around ~3KB (1KiB was the wasm). If you wanna checkout the code here's a github link: https://github.com/maniyar1/wasm-canv...


If you have questions comment on the video or email me: [email protected]



Chapters:
0:00 Intro
0:40 Boilerplate

1:20 Compiler flags and first compile
2:00 Adding 2-dimensional array and iterating over it
2:42 First run in browser
3:05 First color
4:05 2D array to 1d buffer array
4:50 First real draw
5:00 Final thoughts + playing with the code