Main monorepo for @zig-gamedev libs and example applications
MIT License
Libraries - Getting Started - Sample applications - Others using zig-gamedev
We build game development ecosystem for Zig programming language, every day since July 2021. Please consider supporting the project. We create:
zig build
Download the latest archive or clone/submodule with Git.
Note: If using Git then you will need Git LFS to be installed.
Our main branch is currenly tracking Zig 0.13.0-dev.351+64ef45eb0. Or you can use the unstable zig-0.14.0 branch.
zigup is recommended for managing compiler versions. To switch to the compiler version after branch checkout:
zigup $(< .zigversion)
Alternatively, you can download and install manually using the links below:
OS/Arch | Download link |
---|---|
Windows x86_64 | zig-windows-x86_64-0.13.0-dev.351+64ef45eb0.zip |
Linux x86_64 | zig-linux-x86_64-0.13.0-dev.351+64ef45eb0.tar.xz |
macOS x86_64 | zig-macos-x86_64-0.13.0-dev.351+64ef45eb0.tar.xz |
macOS aarch64 | zig-macos-aarch64-0.13.0-dev.351+64ef45eb0.tar.xz |
To get started on Windows/Linux/macOS try out physically based rendering (wgpu) sample:
zig build physically_based_rendering_wgpu-run
To get a list of all available build steps:
zig build -l
Note: Libs are being migrated from libs/ folder in this repo to each their own repository under the zig-gamedev GitHub organisation. See migration tracking PR.
Library | Description |
---|---|
zaudio | Cross-platform audio using miniaudio |
zbullet | Build package, C API and bindings for Bullet physics |
zflecs | Build package and bindings for flecs ECS |
zemscripten | Build package and shims for Emscripten emsdk |
zglfw | Build package & bindings for GLFW |
zgpu | Small helper library built on top of Dawn native WebGPU implementation |
zgui | Build package and bindings for Dear Imgui, Test engine, ImPlot, ImGuizmo and imgui-node-editor |
zjobs | Generic job queue implementation |
zmath | SIMD math library for game developers |
zmesh | Loading, generating, processing and optimizing triangle meshes |
znoise | Build package & bindings for FastNoiseLite |
zopengl | OpenGL loader (supports 4.2 Core Profile and ES 2.0 Profile) |
zopenvr | Bindings for OpenVR |
zphysics | Build package, C API and bindings for Jolt Physics |
zpix | Support for GPU profiling with PIX for Windows |
zpool | Generic pool & handle implementation |
zsdl | Bindings for SDL2 and SDL3 |
zstbi | Image reading, writing and resizing with stb libraries |
ztracy | Support for CPU profiling with Tracy |
zwindows | Windows development SDK for Zig game developers |
Some of the sample applications are listed below. More can be found in samples directory.
physically based rendering (wgpu): This sample implements physically-based rendering (PBR) and image-based lighting (IBL) to achive realistic looking rendering results.zig build physically_based_rendering_wgpu-run
audio experiments (wgpu): This sample lets the user experiment with audio and observe data that feeds the hardware.zig build audio_experiments_wgpu-run
bullet physics test (wgpu): This sample application demonstrates how to use full 3D physics engine in your Zig programs.zig build bullet_physics_test_wgpu-run
procedural mesh (wgpu): This sample shows how to efficiently draw several procedurally generated meshes.zig build procedural_mesh_wgpu-run
gui test (wgpu): This sample shows how to use our zgui library.zig build gui_test_wgpu-run
Some of the sample applications are listed below. More can be found in samples directory. They can be built and run on Windows and Linux (Wine + VKD3D-Proton 2.8+):
bindless: This sample implements physically based shading and image based lighting to achieve realistic looking rendering results. It uses bindless textures and HLSL 6.6 dynamic resources.zig build bindless-run
rasterization: This sample application shows how GPU rasterizes triangles in slow motion.zig build rasterization-run
simple raytracer: This sample implements basic hybrid renderer. It uses rasterization to resolve primary rays and raytracing (DXR) for shadow rays.zig build simple_raytracer-run
mesh shader test: This sample shows how to use DirectX 12 Mesh Shader.zig build mesh_shader_test-run