CNA

CNA
Website https://cna.openeggbert.com | https://libcna.com
Programming language C++
C++ standard C++23
Built on SDL 3, Sharp Runtime
Reimplements XNA 4.0 API
Licence GPLv3 or later

CNA is a C++ reimplementation of the XNA 4.0 programming model, built on SDL 3 and a pluggable graphics backend layer. It is a framework/runtime and abstraction layer — not a game — designed to preserve XNA-style APIs (Microsoft::Xna::Framework) while using modern C++ internals.

CNA serves as the graphics, input, audio and windowing layer for Mobile Eggbert (C++ version), Galaxy Eggbert, MeshCraft, and Free Eggbert.

Architecture

Game / Application Code
      ↓
CNA API Layer  (Microsoft::Xna::Framework)
      ↓
Graphics backend (SDL_RENDERER / EASYGL / VULKAN)
      ↓
SDL 3 / OpenGL / Vulkan

Features

XNA API Compatibility (incremental): - Core game loop (Game, GameTime) - GraphicsDevice abstraction with backend delegation - SpriteBatch with Begin(...) / Draw(...) / End() workflow - Texture2D abstraction - Input and audio surfaces

Backends: | Backend | Status | | --- | --- | | SDL_RENDERER | Implemented — focused on 2D rendering | | EASYGL | Implemented — OpenGL via EasyGL | | VULKAN | Architecture scaffold present, incomplete |

Platforms: | Platform | Status | | --- | --- | | Linux | Supported | | Windows | Supported (SDL_RENDERER backend) | | Android | Planned | | Web (Emscripten) | Architecture future-friendly |

Role in the stack

Sharp Runtime  (System::* types)
      └── CNA  (XNA-like API)
            ├── Free Direct  (DirectX 3-like API)
            │     └── Free Eggbert
            ├── Mobile Eggbert (C++)
            ├── Galaxy Eggbert
            └── MeshCraft

Build

git submodule update --init --recursive
cmake -S . -B build -DCNA_GRAPHICS_BACKEND=EASYGL
cmake --build build --target CNA CnaTests
ctest --test-dir build --output-on-failure