feat: engine skeleton (Build Order step 1) and siege_tests

Engine:
- SdlContext and Window: RAII, throwing constructors, non-movable
- FrameClock (real time, clamped dt) and SimClock (fixed 1/60 s steps,
  speed 0 = planning phase, backlog capped per frame)
- Application owns them in lifetime order, exposes EngineContext, and
  runs the fixed-timestep loop; AppConfig::FromArgs parses --frames,
  --seed and --fullscreen
- Temporary window-surface fill so Wayland maps the window until
  RenderDevice lands in step 2

Build:
- Split into the siege_engine static lib and the siege_deck exe
- check_engine_deps fails the build if Engine/ includes Game/
- ctest smoke test: siege_deck --frames 30 on the offscreen driver
- siege_tests on Catch2 v3.15.3 (nixpkgs + CPM pin), with SimClock,
  FrameClock and AppConfig tests

Docs:
- Decision Log: error handling split, Catch2 for unit tests
- Build Order step 1 done; Engine Overview, Main Loop and Time and
  README updated to match
- AGENTS.md with build, conventions and gotchas for coding agents
- .gitignore: .mcp.json (local CLion MCP port) and Obsidian's
  workspace.json (tab/pane state), now untracked

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-25 00:27:36 +02:00
co-authored by Claude Opus 5.5
parent 45b246c1d7
commit 384f1ed1f2
26 changed files with 1072 additions and 271 deletions
+6 -4
View File
@@ -15,18 +15,20 @@ cmake --build --preset debug
Without direnv, prefix commands with `nix develop --command`.
`siege_deck --frames N` renders N frames and exits, so the smoke test can run
unattended from a script or CI.
`siege_deck --frames N` renders N frames and exits. `ctest --preset debug` runs
the `siege_tests` unit tests, plus `--frames 30` headless (offscreen video
driver) as the `smoke` test, so it can run unattended from a script or CI.
## Layout
| Path | What it is |
|---------------------|------------------------------------------------------|
| `flake.nix` | devShells: `default` (clang), `gcc` |
| `CMakeLists.txt` | dependency pins + the single executable target |
| `CMakeLists.txt` | dependency pins, engine lib, game exe, tests |
| `cmake/Cpm.cmake` | CPM bootstrap — nixpkgs copy, else pinned download |
| `cmake/ImGui.cmake` | defines `imgui::imgui` from either nixpkgs or source |
| `Source/` | `Common.h` (vocabulary types), `Pch.h`, `Main.cpp` |
| `Source/` | `Engine/` (`siege_engine`), `Game/`, `Main.cpp` |
| `Tests/` | `siege_tests` (Catch2), mirrors `Source/` |
| `Assets/` | copied next to the executable after each build |
## How dependencies resolve