Internals

CNA snapshot 009d40f5  ·  Development › Internals overview  ·  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 only organises the pages below it.

Internals pages are source tours: they follow one subsystem from construction to teardown through the code as it stands at snapshot 009d40f5, naming the types, functions, ownership rules, failure modes, CMake wiring and tests involved. They answer “how does this actually work?”; the Maintainer Handbook answers “how do I change it safely?”.

How an internals page is organised

A page is only useful to a maintainer if it can answer the same questions for every subsystem. The pages in this section are written to cover, where the subsystem has them:

  1. Purpose and boundary — what the subsystem owns and what it deliberately does not.
  2. Important types and their relationships, and its dependencies.
  3. Construction and ownership — who creates, retains, borrows and destroys each object.
  4. Runtime path and state — the normal call flow and the mutable state it touches.
  5. Threading — which thread may call what, and which barriers are actually proven in the source.
  6. Failures — guards, exceptions, rollback, and whether an attempt can be retried.
  7. Destruction — the order that matters, and why.
  8. Invariants that later edits must not break.
  9. Test evidence and gaps — the tests that exist, what each can and cannot show, and what has no test.
  10. Realistic changes and the other subsystems they touch, and a curated reading order through the source.

Diagrams on these pages describe actual paths in the source, not a wish. A page states its evidence basis under its title: source-verified means checked by reading the pinned source; a test being named means it exists, not that it was run.

The internals map

AreaPagesWhat they establish
RuntimeRuntime module · Startup · One frame · Ownership & shutdownGame construction order, the run loop, and the destruction chain that keeps the platform alive for the longest.
GraphicsRenderer selection · GraphicsDevice · Indexed draw · Textures & targets · Family mapHow an identity becomes a renderer, what GraphicsDevice owns, and what one draw call does from the public API to a backend.
Renderer familiesEasyGL · OpenGL4 · Vulkan · SDL_gpu · Software · Headless · StubThe backend-specific resource translation, draw execution, presentation and teardown of seven of the 21 implementation families.
PlatformsOverview · SDL3 · SDL2 · X11 · Wayland · Win32 · Headless · TerminalWindow, event and input ownership, native handles and surfaces handed to renderers, scaling and shutdown for each of the seven CNA_PLATFORM implementations.
AudioAudio engineSoundEffect and instances, the mixer, and the SDL3, SDL2, Null and ALSA transports with their callback barriers.
ContentContent runtime · Content pipelineHow ContentManager resolves XNB, CNB and loose assets, and how the build-time pipeline produces them.
InputEvents & snapshotsThe split between platform events and the per-frame public snapshots, backend by backend.
ModulesCore · Math · Design · Storage · Media · FFmpeg video · Devices · Device host services · Diagnostics · Inspector · Phone · Gamer services · Graphics extensions · NetworkingOwnership, lifetime and boundary rules of the smaller production modules.
C API & bindingsC API · C# · Java · PythonThe opaque-handle and error boundary of the experimental C ABI, and how three language bindings own native objects.

Which modules and renderer families have a dedicated page, and which do not yet, is tabulated mechanically in the generated module index. The maps one level up — how the layers fit together — are the Architecture maps.

Reading orders by goal

If you need to…Read, in this order
Understand a frame end to endStartup → One frame → Shutdown → GraphicsDevice → Indexed draw
Change or add renderer behaviourRenderer selection → GraphicsDevice → Resources → Indexed draw → the family page → a sibling family for comparison
Work on a platform backendPlatform overview → SDL3 (the default platform) → the backend you will touch → Input events
Change asset loading or authoringContent runtime → Content pipeline → Storage
Reason about teardown and callbacksOwnership map → Thread & callback map → Shutdown → Audio engine
Change a public API that bindings mirrorthe owning module page → C API → a binding page → Update the C API

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

User guide
Documentation
Maintainer workflow
Maintainer Handbook · Human Takeover
Tests and validation
Test architecture
Reference
Module index