Development

CNA snapshot 009d40f5  ·  Development › Development home  ·  source links pinned to 009d40f5

✓

Evidence basis: source-verified at the pinned commit. Claims on this page were checked by reading the CNA source at commit 009d40f5; unless a sentence says otherwise, nothing here was built or executed. This hub summarises the area; the counts (23 modules, 25 identities, 21 families, 7 platforms, 4 audio implementations) are the site's canonical TARGET facts.

The Development area is the maintainer layer of libcna.com: how CNA is put together, where each behaviour is owned, how to change it safely, and what evidence a change needs. It is written for a human C++ engineer who has to own CNA — including after heavy AI-assisted development — and it stays pinned to one exact source snapshot so every claim can be checked.

ℹ

Start with the Human Takeover path. It explains what you inherited, how to study it in stages, how to investigate unknown behaviour and what evidence a patch needs. The deep subsystem pages support that route; the generated references only locate things.

Four altitudes, one subsystem

The same subsystem is explained at four different altitudes on this site. They are deliberately separate pages: mixing them makes a guide too heavy for a user and an internals page too vague for a maintainer.

AltitudeQuestion it answersWhere it livesExample: the Wayland platform
User / platform guideHow do I select and use it?Documentation, TutorialsNative Platforms guide
ArchitectureHow does it relate to the other layers and axes?Architecture, Architecture mapsPlatform architecture
InternalsHow does the implementation actually work: lifetimes, call flow, ownership, failure modes?InternalsWayland platform internals
Maintainer workflowHow do I change it safely, and which tests prove the change?Maintainer Handbook, TestingModify a platform backend

Every Internals and Handbook page ends with a Related pages block that links its neighbours at the other altitudes.

Choose a path

🧭

Human Takeover

The route from an unfamiliar, AI-developed C++ repository to human-authored, human-reviewed maintenance: inheritance, mental model, staged curriculum, investigation method, worked changes, ownership and threading maps, blast radius and evidence.

🛠

Maintainer Handbook

Task-oriented recipes: fix a renderer bug, change public XNA behaviour, modify a platform backend, add a regression test, change ContentManager or the Content Pipeline, update the C API, debug shutdown, investigate a sample failure, change the build, make a release.

🗺

Repository map & source ownership

Which part of CNA owns a behaviour: the 23 production modules, the physical renderer families, public versus private headers, generated files, third-party boundaries, build and test ownership.

🔨

Build system

The root CMake, the three selectors (platform, audio, renderer), module targets, presets, generated registries, install and export, and the configure-time refusals you should expect.

🧪

Testing

How tests are assembled and discovered, which suite proves which change, what needs a display or GPU, and how to report evidence honestly.

🔍

Debugging cookbook

Narrow a failure to an owner, reproduce it headless or on a second backend, and read lifetime and shutdown problems.

🔬

Internals

Source tours of the runtime, graphics (device, renderer families, draw path), platforms, audio, content, input, the smaller modules and the C API with its language bindings.

📜

Invariants

The constraints that must not be broken silently — construction and destruction order, independent build axes, callback barriers, truthful capabilities — each with the failure it prevents.

The shortest useful mental model

Your Game / public CNA API
          │
          ▼
 runtime/Game ── coordinates time, events, Update and Draw
    │       │
    │       └── graphics/GraphicsDevice ── selected renderer implementation
    │                                      │
    └── platform/IPlatform ────────────────┘
          │       │                         window/surface services
          │       ├── input snapshots
          │       ├── audio platform
          │       └── timing / events / windows
          ▼
      host OS / SDL / headless / terminal

CNA is not one monolithic “backend”. A build chooses a platform (CNA_PLATFORM, 7 implementations), an audio platform (CNA_AUDIO_PLATFORM, 4) and a graphics renderer (CNA_GRAPHICS_RENDERER, 25 public identities over 21 implementation families) independently. The runtime owns orchestration; concrete backends own OS and GPU work. The canonical maintainer model adds the other control paths and the places where the dependency graph is intentionally not acyclic. The three axes are tabulated, straight from the CMake registries, in the selection axes index.

Evidence policy: what these pages do and do not claim

Every architectural claim in this area is tied to a path or symbol in the CNA source at one exact commit, 009d40f5 (branch next, 24 September 2026). Source links carry the full commit hash, never a moving branch; the generated inventories are rebuilt from the Git objects of that commit. Where the source does not establish something, the page says so.

Each page states its evidence basis under the title, using distinct terms that are never silently upgraded into one another:

TermMeaning here
source-verifiedA claim was checked by reading the CNA source at the pinned commit.
tests presentA test that exercises the behaviour exists and is registered in CMake. It is named, not executed, for these pages.
build-verified, runtime-observed, oracle-compared, hardware-observedUsed only when CNA’s own records report it, and then attributed to CNA. The site never claims to have run a build, a test, a GPU or a device.

“The implementation exists” is not “the behaviour is proven correct everywhere”. A page that says a backend was traced from construction to teardown does not say it passes on every driver or host.

Three anchors to start from when you want to check a claim yourself:

What is covered in depth, and what is not

The Development area is a maintainer manual, not a full catalogue, and its depth is uneven by design. A subsystem without a dedicated internals page has simply not been given a deep tour here; that says nothing about how mature it is in CNA. The module index shows, for every module and every renderer directory, whether a dedicated internals page exists.

  • Toured in depth: runtime lifecycle; GraphicsDevice, renderer selection and the indexed-draw path; the EasyGL, OpenGL4, Vulkan, SDL_gpu, Software, Headless and Stub renderer families; all seven platform backends; the audio engine; ContentManager and the Content Pipeline; input events; fourteen further modules (core, math, design, storage, media, FFmpeg video, devices, device host services, diagnostics, inspector, phone, gamer services, graphics extensions, networking); the C API and the C#, Java and Python bindings.
  • Not yet given a dedicated internals page: the remaining renderer families (WebGPU, DirectX 9/11/12, Direct2D, Metal, PortableGL, GDI, FNA3D, the DOM/canvas family, FreeDirect, SDL_Renderer) and the shared renderer helpers; the controller/joystick and touch input paths; the Rust, TypeScript, Swift, Go and Ruby bindings; the tooling and source-audit scripts. The user-facing Renderers guide covers those renderer families from the user’s side.

Pin policy

These pages describe CNA at 009d40f5; CNA moves faster than the pages. Before trusting a trace for a new patch, compare your branch with that snapshot and re-audit the changed paths, as described on Maintenance & pin policy. The user-facing documentation is pinned to the same commit.

The same subsystem is explained at four altitudes. These are the neighbouring pages at each one.

Internals
Internals
Maintainer workflow
Maintainer Handbook · Human Takeover
Tests and validation
Verification & known issues · Testing