|
Banjo API 1.0.0-rc.2
Low-level C99 game development API
|
A small, low-level game framework in C99, built against the firm and repeated advice of people who knew better.
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.
| 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.
There are 35 self-contained programs in examples/, where, in a rare show of restraint, the source you read is the source you actually compile. Six are proper tutorials, best taken in order, since each one quietly assumes you made it out of the last one alive.
The rest are short single-API demos across windowing, drawing, sprites, physics, timing, randomness, and networking.
On every push, Banjo is set upon by a small, tireless team of machines that have never once found any of this boring:
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.
Where the real explaining is kept: API reference · BUILDING · INTEGRATING · CONTRIBUTING · CHANGELOG · ACKNOWLEDGEMENTS
MIT, set out in full in [LICENSE](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.