Run the minimal sample
The build you just ran also built the minimal sample. Start it from the Labrador folder:
out\build\x64-debug\samples\minimal\MinimalSample.exeA 1280×720 window opens with the line Hello from the engine. circling a point, and a hint along the bottom. Move the point with the left stick of a gamepad, the arrow keys or WASD. Press B or Escape and the sample asks whether you really want to quit; A or Enter quits, and B or Escape goes back.
The sample copies its content beside the executable when it builds, so it runs from any folder.
What you are looking at
Section titled “What you are looking at”The sample is about 450 lines, and most of them are comments explaining the line below. Three parts are worth knowing before you copy it in the next step.
main.cpp makes the decisions only a game can make: the window’s title and size, where the
content is, and which state runs first. Everything else is the engine’s.
options.window_class_name = L"MinimalSampleWindowClass";// ASCII only: this file gets copied into new projects, and a wide// literal's encoding depends on how the compiler was told to read the// source.options.window_title = L"Labrador - minimal sample";
// One pane, so one view's worth of recording state. The default is four// - four-player split-screen, the widest layout the engine has a client// for - and every view above what a frame draws is a deferred context// and a dynamic vertex buffer created at startup and never used.// A game that fans out says so here; this one does not.options.view_capacity = 1;
app.initialize(instance, show_command);
// 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");
return app.run(std::make_unique<HelloState>(&app));samples/minimal/main.cpp, lines 23–51 at 862e08b
A state is a screen or mode of the game. The engine calls a state’s init() once, then its
update() and draw() every frame. HelloState puts its two lines of text in a scene and
gives the scene one view covering the whole window:
L"Hello from the engine.", font_name, this->position_, resources,
this->hint_ = this->scene_->add(std::make_unique<Label>( L"Left stick, arrows or WASD move it. B or Escape quits.", font_name, labrador::Colour::dark_gray));
// Every add is pending until a tick ends, so that a weapon firing mid-tick// cannot invalidate the loop walking the objects. Nothing has ticked yet// and the first frame is a real frame, so the first tick ends here.this->scene_->end_tick();
// One view, for the whole window, in screen space - the identity camera is// what a list starts with, so this one is never mentioned again. A// split-screen game clears this list and refills it every tick, one entry// per player, and nothing else about the shape changes.samples/minimal/states/hello_state.cpp, lines 87–107 at 862e08b
The question is a second state, pushed on top of the first. ConfirmState knows nothing
about the screen below it. It hands back a bool when it closes, and HelloState decides what
the answer means. While the question is up, HelloState stops updating and dims its greeting,
and because the question does not cover the whole screen, the greeting stays visible underneath.
The other sample
Section titled “The other sample”LineSweeper, the falling-block game, was built too:
out\build\x64-debug\samples\linesweeper\LineSweeperSample.exeExamples lists its controls and the order in which to read its code. It is there to be read, though. The minimal sample is the one you copy, and the next step does that.
Development documentation (unreleased). Built from Labrador 862e08b of 2026-10-08.