mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
Updated Working for Web (HTML5) (markdown)
@ -8,10 +8,11 @@ The complete process to compile for web is detailed below. The main steps to fol
|
||||
|
||||
1. [Install emscripten toolchain](#1-install-emscripten-toolchain)
|
||||
2. [Compile raylib library](#2-compile-raylib-library)
|
||||
3. [Setup raylib game for web](#3-setup-raylib-game-for-web)
|
||||
4. [Compile raylib game for web](#4-compile-raylib-game-for-web)
|
||||
5. [Test raylib game on web](#5-test-raylib-game-on-web)
|
||||
6. [Upload raylib web game to itch.io](#6-upload-raylib-web-game-to-itchio)
|
||||
3. [Build examples for the web (optional step)] (#3-build-examples-for-the-web)
|
||||
4. [Setup raylib game for web](#4-setup-raylib-game-for-web)
|
||||
5. [Compile raylib game for web](#5-compile-raylib-game-for-web)
|
||||
6. [Test raylib game on web](#6-test-raylib-game-on-web)
|
||||
7. [Upload raylib web game to itch.io](#7-upload-raylib-web-game-to-itchio)
|
||||
|
||||
Note that it's VERY important to understand the different steps of the process. If you expect to find an already setup solution, ready to use out-of-the-box, it's very probable that it fails at some point. So, understanding the process is crucial to be able to configure web compilation with ANY build system.
|
||||
|
||||
@ -151,13 +152,15 @@ if (EMSCRIPTEN)
|
||||
endif ()
|
||||
```
|
||||
|
||||
## 3. Build provided examples for the web (optional step)
|
||||
## 3. Build examples for the web (optional step)
|
||||
|
||||
At this point, if you optionally want to compile the provided examples for the web, there is another Makefile to configure. Make sure all paths to emscripten installation (`EMSDK_PATH`) and emscripten required tools (Clang, Python, Node) are correctly configured on `raylib/examples/Makefile`, you must verify [these lines](https://github.com/raysan5/raylib/blob/master/examples/Makefile#L134).
|
||||
|
||||
#### For Windows users :
|
||||
|
||||
Start up Notepad++ for raylib, open the `raylib/examples/Makefile` file, press F6, choose `raylib_makefile`, verify that in the script the web platform is set (`SET PLATFORM=PLATFORM_WEB`) and click OK to run the script. It will compile all the examples for the web.
|
||||
Start up Notepad++ for raylib, open the `raylib/examples/Makefile` file, press F6, choose `raylib_makefile`, verify that in the script the web platform is set (`SET PLATFORM=PLATFORM_WEB`) and click OK to run the script. It will compile all the examples for the web.
|
||||
|
||||
Opening generated `.html` files directly from disk may fail due to web browser security configuration. You can follow steps on 6. [Test raylib game on web](#6-test-raylib-game-on-web)
|
||||
|
||||
## 4. Setup raylib game for web
|
||||
|
||||
|
||||
Reference in New Issue
Block a user