C99 Framework for game development https://banjo.codework-orange.com
  • C 97.8%
  • Objective-C 1.1%
  • CMake 1.1%
Find a file
Kevin d'Orange 3200d54c30
All checks were successful
C++ Compatibility / C++ Compatibility Check (push) Successful in 7s
Documentation / build-docs (push) Successful in 8s
QA / cert (push) Successful in 28s
Build and Test / linux-linux-gcc / shared (push) Successful in 16s
Build and Test / linux-linux-gcc / static (push) Successful in 16s
Build and Test / linux-windows-mingw / shared (push) Successful in 25s
Build and Test / linux-windows-mingw / static (push) Successful in 25s
fix(project): fix license badge (#158)
Reviewed-on: #158
2026-06-16 12:25:27 +02:00
.forgejo/workflows Improve C++ compatibility (#153) 2026-06-09 14:20:16 +02:00
assets/bmp Remove cmake build files 2025-09-15 08:35:40 +02:00
cmake Install target (CMake) 2025-12-03 22:36:58 +01:00
docs Provide SHA and SBOM in releases (#132) 2026-06-02 14:46:55 +02:00
examples feat(graphics): use box-aligned text API (#155) 2026-06-14 08:39:21 +02:00
inc/banjo feat(graphics): use box-aligned text API (#155) 2026-06-14 08:39:21 +02:00
src feat(graphics): use box-aligned text API (#155) 2026-06-14 08:39:21 +02:00
test feat(audio): add runtime backend selection (#152) 2026-06-04 20:45:04 +02:00
.gitattributes Update .gitattributes 2026-02-13 21:51:58 +01:00
.gitignore Documentation update 2026-05-30 15:40:40 +02:00
ACKNOWLEDGEMENTS.md Refactor API naming convention for consistency 2026-05-31 17:54:56 +02:00
BUILDING.md Fullscreen / Resize (#21, #22) (#118) 2026-05-30 15:40:56 +02:00
CHANGELOG.md feat(audio): add runtime backend selection (#152) 2026-06-04 20:45:04 +02:00
CMakeLists.txt fix(build): add position independent code (#156) 2026-06-16 10:57:07 +02:00
CMakePresets.json Wayland Support (#106) 2026-05-30 15:40:44 +02:00
CONTRIBUTING.md feat(audio): add runtime backend selection (#152) 2026-06-04 20:45:04 +02:00
INTEGRATING.md Fullscreen / Resize (#21, #22) (#118) 2026-05-30 15:40:56 +02:00
LICENSE.md Provide SHA and SBOM in releases (#132) 2026-06-02 14:46:55 +02:00
README.md fix(project): fix license badge (#158) 2026-06-16 12:25:27 +02:00

Banjo

A small, low-level game framework in C99, built against the firm and repeated advice of people who knew better.

License: MIT Language: C99 Dependencies: none Platforms: Linux, Windows, macOS, Web

Simple · Minimal · Self-documented · Fast

There is a piece of advice, wise and shouted across the internet over and over, that goes: write games, not engines. Banjo heard it, agreed with every word, thanked everyone warmly for their concern, and went off to build the engine. It is small, written in plain C99, and turns up with the parts of a game already bolted on: a window, a framebuffer to draw on, sound, input, networking, math, and physics. You link one library and run it.

It is shaped by the games built with it, taken in roughly the order the world first made them, from the early 1970s onward, each one wanting something the one before did fine without. Banjo is the young library running along behind, trying to keep up.

What's in the box

Area What it does
Windowing & input Opens a window, in whatever size and shape you like, and tells you everything the keyboard and mouse get up to behind your back, by callback or by polling, whichever keeps you calmer.
2D drawing & bitmaps A framebuffer you paint by hand, one careful pixel at a time: lines, shapes, circles, polylines, BMP loading, blitting with stretch and color-key, a built-in font, and per-pixel shaders for the days you feel you have something to prove.
Audio Real-time sound built from your own samples, with sine, square, triangle, and sawtooth waves thrown in, the four noises behind every beep, bloop, and truly regrettable jingle ever made.
Networking TCP and UDP over IPv4 and IPv6, with broadcast, timeouts, keep-alive, and non-blocking I/O, so two programs can hold a conversation across a network and, when the mood takes them, even listen.
Math Pick-your-precision real numbers, vectors in 2D, 3D, and 4D, matrices, and quaternions with slerp, for turning things through space smoothly and without once having to look the math in the eye.
Physics 1D motion, 2D particles with gravity and drag, 2D rigid bodies with torque, and collision tests: everything you need to make an object fall over and really mean it.
Utilities Seedable PCG32 randomness with distributions, timers and stopwatches, unified data streams, command-line parsing, logging, error handling, and replaceable allocators: the small, quiet parts that hold up the loud, ungrateful ones.

Each subsystem lives in its own header under inc/banjo/, where the same thing is explained again at greater length, and with a much straighter face, in the API reference.

Why Banjo

  • Simple. Plain C99 and a small, flat API. If you can read C, you can read the whole of Banjo, every last function of it, in one afternoon, with time left over for tea and a little quiet smugness.
  • Minimal. No third-party dependencies, the test suite included. Nothing to download, nothing to bundle, and nothing hiding in a corner waiting to break the moment you look away.
  • Self-documented. Every function and type is explained right where it is declared, on the simple grounds that documentation kept anywhere else drifts out of date, stops returning the code's calls, and a release or two later is happily describing a library that no longer exists.
  • Fast. It compiles in moments and starts at once, and behaves the same wherever it happens to wake up: a laptop, a build server, or a browser tab.

Examples

There are numerous self-contained programs in examples. Six are proper tutorials, best taken in order, since each one quietly assumes you made it out of the last one alive:

  1. \ref start.c - open a window, draw something, react to ESC.
  2. \ref event_callbacks.c - keyboard, mouse, and cursor.
  3. \ref drawing_2d.c - every 2D primitive.
  4. \ref load_bmp.c - load and blit a BMP.
  5. \ref audio_pcm.c - make a noise, entirely on purpose.
  6. \ref pong.c - a complete two-player Pong, the oldest game still able to end a friendship.

The rest are short single-API demos across windowing, drawing, sprites, physics, timing, randomness, and networking.

Continuous integration

On every push, Banjo is set upon by a small, tireless team of machines that have never once found any of this boring:

  • Linux and Windows builds (the latter cross-compiled, which the machines think nothing of), each one built, tested, and measured for coverage.
  • The CERT C secure-coding rules enforced by clang-tidy, with every warning promoted on the spot to the rank of error.
  • The documentation rebuilt from scratch, so it can never quietly drift out of step with the code while the code isn't looking.
  • Releases that package themselves into Linux and Windows binaries and a full copy of the API reference, asking no human to so much as stand up.

Platforms

Linux, Windows, and macOS, and the web too, through WebAssembly, for anyone determined to run a game inside the one program already holding forty browser tabs hostage.

Documentation

Where the real explaining is kept: API reference · BUILDING · INTEGRATING · CONTRIBUTING · CHANGELOG · ACKNOWLEDGEMENTS

License

MIT, set out in full in LICENSE: short, permissive, and completely relaxed about the whole thing. Do nearly anything you like with it; just don't stand up in public and claim you wrote it.