Gamedev
⟵ back to the homepage Last update: 2022/07/27Maturity
Zig is actively used for game development by both hobbyists for side projects, as well as a few seriously committed individuals who do Zig game development full time.
Libraries and bindings exist for most things, and general purpose engines/frameworks/ecosystems are in early stages of development.
Mach engineGame engine & graphics toolkit for the future. | zig-gamedevLibraries, samples and mini-games written in Zig | zero-graphicsA very minimal OpenGL ES 2.0 library for Zig |
Mach is for creating games, graphical applications, and desktop/mobile/web apps:
| zig-gamedev is a “toolbox of libraries” for game developers. It contains libraries, samples and (in the future) complete mini-games. Project provides cross-platform solution for: graphics, audio, multi-threaded physics, SIMD math, procedural techniques, profiling and more. Sample applications feature raytracing, PBR, mesh shaders, procedural meshes, physics, audio and more. | zero-graphics is an application framework based on OpenGL ES 2.0. Runs on desktop machines, Android phones and the web Opens you a window and let’s you draw things. Comes with a pixel perfect 2d renderer and a basic 3D API. |
DirectX 12/Vulkan/Metal & OpenGL (as fallback) via cutting-edge WebGPU implementation used by Chrome. WebGPU when targetting WebAssembly. | Uses native version of WebGPU API (mach/gpu) for cross-platfrom graphics and DirectX 12 for low-level graphics on Windows | Based on OpenGL ES 2 for as broad-as-possible platform coverage. |
Windows/Linux/Mac; WebAssembly (WebGPU); mobile/VR/console planned | Windows/Linux/Mac | Windows/Linux/Mac; WebAssembly (WebGL); Android |
Communities
#game-dev
in the Zig Programming Language Discord is the primary gathering place to discuss Zig game development.- hexops:matrix.org chat server, all Mach engine discussion takes place here, in addition to general discussions of ECS/AI/GUI systems.
Libraries / tools
Console-specific
Playdate (https://play.date)
Wii
PSP
Oculus Quest
- SpexGuy/Zig-Oculus-Quest - An example application for the Oculus Quest, written in Zig
Android/iOS
- MasterQ32/ZigAndroidTemplate - This repository contains a example on how to create a minimal Android app in Zig.
- kubkon/zig-ios-example - Minimal build.zig for targeting iOS
- kubkon/zig-deploy - Deploy your iOS apps written with Zig!
Virtual consoles
- WASM-4: https://github.com/jsyrjala/jumper and this forum thread
- TIC-80: https://github.com/nesbox/TIC-80 - Release comes with a Zig project ready to go in the examples folder, more instructions here
Graphics APIs
- hexops/mach-gpu-dawn - Google’s Dawn WebGPU implementation, cross-compiled with Zig into a single static library. Powers both Mach engine and zig-gamedev.
- hexops/mach-gpu - WebGPU bindings for Zig, truly cross-platform graphics API with unified low-level graphics & compute backed by Vulkan, Metal, D3D12, and OpenGL (as a best-effort fallback.) Used by both Mach engine and zig-gamedev, with extensive examples here and here.
- zig-gamedev/zgpu - Cross-platform graphics layer built on top of native WebGPU API (Dawn) / mach/gpu bindings.
- MasterQ32/zig-opengl - pragmatic binding to different OpenGL versions, uses the official OpenGL Registry by Khronos to generate the Zig code. Used by zero-graphics.
- ziglibs/zgl - a thin, type-safe binding for OpenGL on top of libepoxy.
- zig-gamedev/z3d12 - helper library for working with DirectX 12
Windowing
- hexops/mach-glfw - Ziggified GLFW bindings that Mach engine uses, with 100% API coverage, zero-fuss installation, cross compilation, and more. Used by Mach engine and zig-gamedev.
- MasterQ32/SDL.zig - shallow wrapper around SDL that provides object API and error handling. Used by zero-graphics.
GUI
- https://github.com/david-vanderson/gui - Immediate mode UI for whole apps or tooling existing apps. SDL and Mach backends. Easy to integrate.
- https://github.com/MasterQ32/TextEditor - A backbone for text editors. No rendering, no input, but everything else.
- TODO: help us populate this section!
Text rendering
- hexops/mach-freetype - Ziggified FreeType 2 bindings that Mach engine uses, with zero-fuss installation, cross compilation, and more.
Image formats
- zigimg/zigimg - for reading and writing different image formats
- TinyVG/sdk - An alternative binary encoded vector graphics format.
- MasterQ32/zig-qoi - Quite OK Image format encoder/decoder written in Zig
Math
- zig-gamedev/zmath - SIMD math library for game developers
- ziglibs/zlm - linear mathemathics library, built around the OpenGL coordinate system and fully generic on the basic data type.
- kooparse/zalgebra - Linear algebra library for games and real-time graphics
Physics
- zig-gamedev/zbullet - Zig bindings and C API for Bullet physics library
- MasterQ32/zig-ode - OpenDynamics Engine build support package
Audio
- zig-gamedev/zaudio - Zig bindings for miniaudio library
- zig-gamedev/zxaudio2 - helper library for working with XAudio2 (Windows library)
Architecture
- hexops/mach-ecs - an Entity Component System for Zig built from first-principles and detailed in this blog series.
- prime32/zig-flecs - Flecs Zig Bindings
- zig-gamedev/zpool - generic pool & handle implementation
Networking
- MasterQ32/zig-mqtt A build package for the awesome mqtt-c project by Liam Bindle.
- MasterQ32/zig-network - smallest-common-subset of socket functions for crossplatform networking, TCP & UDP.
- zig-gamedev/znet - Zig bindings for ENet
Serialization
- ziglibs/s2s - struct to stream | stream to struct, a binary serialization format and library.
- kubkon/protozig - The protozig(uana), or protocol buffers implementation in Zig
Databases
- vrischmann/zig-sqlite - a small wrapper around sqlite’s C API, making it easier to use with Zig.
Configuration
- ziglibs/ini - A teeny tiny ini parser.
- kubkon/zig-yaml - YAML parser for Zig
Scripting
- squeek502/zua - An implementation of Lua 5.1 in Zig, for learning purposes
- Vexu/bog - Small, strongly typed, embeddable language.
- LoLa - an embeddable programming language for game scripting,
- alichay/zig-wasm3 - bindings (and build system integration) for Wasm3 interpreter
Other
- zig-gamedev/zmesh - loading, generating, processing and optimizing triangle meshes
- zig-gamedev/znoise - Zig bindings for FastNoiseLite
- zig-gamedev/ztracy - support for CPU profiling with Tracy
- MasterQ32/zig-assimp - Open Asset Importer Library build package
- kooparse/zgltf - A glTF parser for Zig codebase
Tools
- Mini Pixel - A Simple Editor for Tiny Graphics
Games
- pacman.zig - Simple Pacman clone written in Zig.
Help improve this page
Feel free to improve this page by sending a PR! Please ensure entires on this page are:
- Alphabetically ordered by project name
- Actively maintained (at least one commit in the last 12 months, or broadly used by the community.)