Skip to content

Labrador

A 2D game engine for people who want to build games in ordinary C++, and be able to read everything underneath them.
LineSweeper at the end of a match: the well topped out under a TOPPED OUT banner, with thousands of coloured particles drifting across it.

New to programming or to C++? Get started is written for you: it takes a Windows PC with nothing installed to a small game of your own that runs, with every command to copy. Going further than that means learning C++.

  • Windows, and a desktop browser through WebGL2
  • C++20, built with CMake and vcpkg
  • Direct3D 11, Direct3D 12, OpenGL 3.3 and Vulkan renderers
  • MIT licence
  • Early: 0.x releases, no compatibility promised yet
A complete scripted match. 35 seconds, no sound. Download the MP4.
Read a description of the video

Coloured pieces turn and slide into a falling-block well. Completed rows disappear, throwing matching sparks sideways as the score and line count rise. The hold slot keeps one piece in reserve, and the next five pieces appear beside the board. Later the stack reaches the top: a “TOPPED OUT” banner appears and thousands of coloured particles burst across the screen, then fade. The game has no sound or spoken commentary.

LineSweeper mid-game: a falling-block well two-thirds full of coloured blocks, a hold slot, a queue of five next pieces, and the score, lines and level.
A match in progress.
LineSweeper a few frames after clearing four lines: sparks in each block's colour burst sideways out of the well.
Four lines cleared, eight frames later: about nine hundred sparks from a field of up to ten thousand.

Watch the pieces lock, the rows clear and the sparks fade. The stills below the video are exact frames read back from the graphics device; the video is compressed for playback. The Examples page says how the game is built.

Play LineSweeper in a desktop browser. The hosted demo downloads the game only when you click, and plays with a keyboard. Phones are a planned phase, so a phone gets a poster and a recording of the game to tap and watch, not the game itself, until real iPhone checks and the host page’s phone layout pass. Android remains unverified.

Labrador is a small engine with firm opinions. Each one below helps some games and gets in the way of others, so each comes with its price.

Ordinary C++ and standard tools

A game is a C++ program that links two static libraries. Its build file is plain CMake that names the sources, links the engine and puts the content beside the program, which is what building and running it needs, and its install rules stage the folder a player gets. There is no project format, no code generator and no macro dialect between your source and the compiler.

The cost: all behaviour is C++, and every change to it is a compile. There is no visual editor, no scripting language and no hot reload.

The full argument

Your data, your lifetimes

The engine meets a game at a few small interfaces, and what stands behind them is the game’s choice: one class per entity, or one object holding ten thousand particles in a flat array.

The cost: storage and ownership are your decisions. The engine does not manage objects for you, and those interfaces are virtual calls.

The full argument

Built for local 2D games

A scene can be drawn through several cameras into several viewports in one frame, which is what split-screen is. Gamepads come with deadzones, press edges and menu navigation.

The cost: online play and 3D are out of scope for good.

The full argument

Rules you can test without a window

The falling-block sample keeps its whole game in a library that links nothing from the engine, so its tests play complete matches with no window and compare them byte for byte.

The cost: that separation is a design you choose and keep. The engine makes it possible; it does not make it automatic.

The full argument

These lines are the heart of main.cpp in the minimal sample, the project you copy to start a game. They start the engine, load the content and hand it a first state. Above them the file names the window; below them it reports a failed start. Everything it leaves out belongs to the engine.

samples/minimal/main.cpp
Application app(std::move(options));
#if defined(LABRADOR_SAMPLE_PROCESS_OBSERVATIONS)
minimal_observation::ProcessReport process_report(&app, smoke_test,
LABRADOR_OBSERVATION_SOURCE_REVISION);
#endif
app.initialize();
// Everything this sample draws, named in content/manifest.json. A game
// with its own kinds of asset - levels, dialogue, whatever it has -
// teaches them to app.resource_loader() before this line.
//
// Beside the executable, wherever the executable was started from:
// a relative path here is relative to the game, not to the working
// directory (Application::load_manifest), and the build copies the
// content there.
app.load_manifest("./manifest.json");
std::unique_ptr<State> first_state = std::make_unique<HelloState>(&app);
if (smoke_test)
{
first_state = std::make_unique<SmokeTest>(&app, std::move(first_state));
}
return app.run(std::move(first_state));

Knowing these before you start will save you time.

  • Never an editor. Content is JSON in a text editor; behaviour is C++ in your IDE.
  • Never a scripting language. All behaviour is C++, and every change to it is a compile.
  • Never hot reload or reflection-driven property editing. The loop is edit, build, run.
  • Never 3D. Labrador is for 2D games.
  • Never online. Play is local: alone, side by side or split-screen on one machine.
  • Not cross-platform yet. Windows and a desktop browser only.
  • Not every gamepad. XInput-compatible pads on Windows; standard-layout pads in a browser.
  • Not big yet. A small community, no asset store, and a 0.x API.

If you need any of these, Godot or Unreal is the better choice, and the Why page compares them. The design documents say where Labrador is going.

Development documentation (unreleased). Built from Labrador aceb130 of 2026-11-20.

All documentation versions