finds.dev← search

// the find

andrewrk/tetris

★ 494 · Zig · MIT · updated May 2026

A simple tetris clone written in zig programming language.

A tetris clone written directly against OpenGL via libepoxy and GLFW, with no game engine or framework in between. It's less a game to play and more a reference for how to structure a real-time rendering loop and build system in Zig, written by the language's creator.

The codebase is tiny and flat (main.zig, tetris.zig, pieces.zig, math3d.zig, static_geometry.zig) so you can read the whole thing in one sitting instead of untangling abstraction layers. It does raw OpenGL buffer/shader setup by hand (all_shaders.zig, static_geometry.zig), which is a decent worked example if you want to see what a game engine normally hides from you. build.zig/build.zig.zon show a real example of wiring C library dependencies (GLFW, libepoxy) into the Zig build system, which is still underdocumented territory.

It pins to Zig 0.16.0+, and Zig's stdlib and syntax still break between minor versions pre-1.0, so there's a real chance this doesn't compile against whatever version you have installed without patching it first. It pulls in native system libraries (libepoxy, GLFW) rather than vendoring or using Zig package manager deps for them, so getting it building on Windows or a fresh Linux box isn't a single `zig build` away. There's no test directory anywhere in the tree, so as a Zig reference project it teaches you nothing about how the author tests Zig code. It's also a visually bare-bones implementation (one font bitmap, no sound), so if you came here expecting a playable game rather than a rendering example you'll be underwhelmed.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →