A small Vulkan rendering engine written in Zig, built around a layered architecture (swapchain, renderer and pluggable render systems) that transparently handles window resizes and swapchain recreation.
The project ships two interchangeable application roots;
src/main.zig picks which one to run at build time via
the -Dapp= build option (see build.zig):
CustomUiApp(current default) — a minimal app demonstrating a custom immediate-mode UI: a nested flex-style screen-space panel drawn bysrc/systems/UiRenderSystem.zig, plus the Dear ImGui debug overlay. No 3D scene, camera or lighting.TutorialApp— the full 3D scene: it rendersGameObjects (two ceramic vases on a flat quad "floor", lit by six colored point lights spinning around the scene and rendered as camera-facing billboards), with the camera driven by a WASD + QE + arrow-key keyboard controller. Model assets are loaded from Wavefront.objfiles embedded at build time from themodels/directory and parsed by the C++ tinyobjloader library through a small C-ABI shim undersrc/wrapper/tinyobj/— see that directory'sREADME.mdfor the C↔C++ boundary rationale.
To switch between them, pass the -Dapp= build option:
-Dapp=custom (the default) runs CustomUiApp, -Dapp=tutorial runs
TutorialApp — e.g. zig build run -Dapp=tutorial.
src/systems/UiRenderSystem.zig is a
small custom 2D overlay render system with an immediate-mode API: each
frame the caller resets the queue with beginFrame(), pushes filled
rectangles in pixel coordinates with rect(x, y, w, h, color) or builds
a per-frame nested row/column flex tree with container calls and
flexRect(...), then records the draws with
render(commandBuffer, extent). No retained widget state is kept
between frames. The pipeline binds no vertex buffers — the quad is
generated procedurally in
shaders/ui.vert from gl_VertexIndex, with the
per-rect position/size/color delivered as push constants — and uses
alpha blending with depth testing disabled so the UI always draws on
top.
Setup using nix
nix develop
Or even
nix develop --command zig build run
Run the test suite and the spell checker before pushing changes:
nix develop --command zig build test --summary all
nix develop --command codebook-lsp lint --unique -s .
The spell-check step uses codebook and
respects the project dictionary in codebook.toml. CI runs both steps as part
of the build test workflow.
nix develop --command cloc src shaders models docs