summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/HOWTO.md55
1 files changed, 55 insertions, 0 deletions
diff --git a/doc/HOWTO.md b/doc/HOWTO.md
index a31ea3a..097f2fa 100644
--- a/doc/HOWTO.md
+++ b/doc/HOWTO.md
@@ -66,6 +66,61 @@ See `doc/HEADLESS_MODE.md`.
```
Measures demo vs external library size. See `doc/SIZE_MEASUREMENT.md`.
+### WSL (Windows Subsystem for Linux)
+
+Requires **WSL2** with a Ubuntu/Debian distro. Two modes:
+
+#### Mode 1: Native Linux Build
+
+Install system packages:
+```bash
+sudo apt-get update
+sudo apt-get install -y \
+ build-essential cmake git python3 \
+ libglfw3-dev libxinerama-dev libxcursor-dev libxi-dev libxrandr-dev
+```
+
+Install `wgpu-native` (no apt package; download prebuilt from GitHub):
+```bash
+curl -L -o wgpu_linux.zip \
+ https://github.com/gfx-rs/wgpu-native/releases/download/v0.19.4.1/wgpu-linux-x86_64-release.zip
+unzip wgpu_linux.zip -d wgpu_tmp
+sudo cp wgpu_tmp/libwgpu_native.so /usr/local/lib/
+sudo cp wgpu_tmp/wgpu.h wgpu_tmp/webgpu.h /usr/local/include/
+sudo ldconfig
+rm -rf wgpu_linux.zip wgpu_tmp
+```
+
+Build and run:
+```bash
+cmake -S . -B build
+cmake --build build -j4
+./build/demo64k
+```
+
+> **Note:** Display output requires WSLg (built into Windows 11; also available on
+> updated Windows 10 builds via the Microsoft Store WSL update). Vulkan GPU
+> passthrough must be enabled — check `wsl --version` to confirm WSLg is active.
+
+#### Mode 2: Cross-Compile Windows `.exe` from WSL
+
+Install the MinGW-w64 cross-compiler:
+```bash
+sudo apt-get install -y mingw-w64
+```
+
+Fetch prebuilt Windows libraries (GLFW, wgpu-native DLLs):
+```bash
+./scripts/fetch_win_deps.sh
+```
+
+Build:
+```bash
+./scripts/build_win.sh
+```
+
+Output: `build_win/demo64k.exe` — copy to Windows and run directly.
+
---
## Testing