Platforms
The same game code builds for every platform. You don't write platform code: the engine owns the window, the GPU, input, audio, files and threads on each one, and your game is the same three functions everywhere.
| Platform | Build with | GPU | Notes |
|---|---|---|---|
| macOS | hz/hzbuild macos | Metal | |
| Windows | hz/hzbuild windows | D3D12 | --vulkan for Vulkan |
| Linux | hz/hzbuild linux | Vulkan | Wayland or X11 |
| Web | hz/hzbuild wasm | WebGPU | any browser with WebGPU |
| iOS | hz/hzbuild ios | Metal | runs on a connected device |
| Android | hz/hzbuild android | Vulkan | phones, Quest, Pico; Windows hosts |
| PC VR | hz/hzbuild run --xr | OpenXR, Windows and Linux |
Your own machine's platform is the default, so most of the time it's just hz/hzbuild run.
The web
The web build runs the real engine: same renderer, same threads, same physics, compiled to WebAssembly and drawing with WebGPU. hz/hzbuild wasm run serves it to your browser.
Phones get a single-threaded build (hz/hzbuild wasm ios). Publishing makes both, and the page picks the right one for each player. If your game uses lanes the way these docs describe, it runs on both without changes.
Phones
Kaigen games run natively on iOS and Android, or in the mobile browser. Things to plan for:
- Touch: the
touch_controlsgameplay block, andinput->touchesfor anything custom. - The notch:
os_get_safe_area()keeps UI out from under it. - Orientation:
orientation landscape(orportrait) inhzproject.hzt. - Pixels: a phone screen has a lot of them.
hz_set_max_dpr(1.25f), as the template does, renders at a density the eye can actually see, and the renderer's automatic quality does the rest.
Worth knowing
--offscreenruns the game with the real GPU but no window: great for scripted screenshots without the game stealing your focus. Desktop only.--no-gpuruns with no GPU at all, for servers and tests.- Building for Android and iOS devices needs the Pro plan. Desktop, web and PC VR are on every plan.