Compile C/C++ raylib game Into WebAssembly

Published: 17 March 2023
on channel: Programming With Nick
18,288
570

Raylib WebAssembly Tutorial: How to Convert Your C/C++ Game into WebAssembly for Online Play. Learn how to compile your raylib game into WebAssembly and make it playable directly in a web browser with this step-by-step tutorial. No prior WebAssembly experience required!

🔗C++ Snake Project: https://github.com/educ8s/Cpp-Retro-S...
🔗C Snake Project: https://github.com/raysan5/raylib-gam...

⌨️Command for C++ Project: emcc -o snake.html main.cpp -Wall -std=c++14 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result -Os -I. -I C:/raylib/raylib/src -I C:/raylib/raylib/src/external -L. -L C:/raylib/raylib/src -s USE_GLFW=3 -s ASYNCIFY -s TOTAL_MEMORY=67108864 -s FORCE_FILESYSTEM=1 --preload-file Graphics --preload-file Sounds --shell-file C:/raylib/raylib/src/shell.html C:/raylib/raylib/src/web/libraylib.a -DPLATFORM_WEB -s 'EXPORTED_FUNCTIONS=["_free","_malloc","_main"]'-s EXPORTED_RUNTIME_METHODS=ccall

⌨️Command for C Project: emcc -o snake_c.html main.c -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result -Os -I. -I C:/raylib/raylib/src -I C:/raylib/raylib/src/external -L. -L C:/raylib/raylib/src -s USE_GLFW=3 -s ASYNCIFY -s TOTAL_MEMORY=67108864 -s FORCE_FILESYSTEM=1 --shell-file C:/raylib/raylib/src/shell.html C:/raylib/raylib/src/web/libraylib.a -DPLATFORM_WEB -s 'EXPORTED_FUNCTIONS=["_free","_malloc","_main"]'-s EXPORTED_RUNTIME_METHODS=ccall

0:00 Intro
0:26 How to share your game
1:22 Convert to WebAssebly
2:44 Conversion process
3:57 Installing Python
4:27 Installing Emscripten
6:49 Compiling raylib with Emscripten
10:05 Compiling a C++ game for the web
13:51 Compiling a C game for the web


Watch video Compile C/C++ raylib game Into WebAssembly online without registration, duration hours minute second in high quality. This video was added by user Programming With Nick 17 March 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 18,288 once and liked it 570 people.