🌐 Browser Demos

CNA compiles to WebAssembly via Emscripten and its WEBGL2 renderer (an EasyGL profile, the Emscripten default) renders via WebGL 2. The demos below run directly in a modern browser — no installation required. They also double as manual smoke tests for the Emscripten/WebGL 2 target: if they load and respond to input, that target is healthy. They are prebuilt binaries whose CNA revision is not recorded, so they show what CNA can do, not the behavior of the documented snapshot; twelve more browser builds and the samples gallery are on the Demos page.

🏠

House 3D Demo

Live

A 3D procedural house scene built entirely from CNA primitives: exterior walls, a pitched roof, windows, a door, interior floors, and surrounding ground. The player can walk and jump with full gravity. Rendered via BasicEffect and the EasyGL renderer, compiled to WebAssembly with Emscripten.

Validates 3D matrix transforms, camera projection, per-vertex lighting, player physics, and the game loop — all running in-browser at interactive frame rates.

🎨

CNA 2D Demo

Live

A 2D sprite demo exercising the SpriteBatch API: texture loading, draw calls with position/rotation/scale, tinted sprites, and layered rendering. Runs in the browser via the same Emscripten/WebGL 2 pipeline as the 3D demo.

Acts as a manual regression check for 2D rendering correctness on the Emscripten target. Also validates the content loading pipeline for PNG textures under WebAssembly.

📌

Note: the documented snapshot contains 18 workflow files (24 jobs), including focused Emscripten multi-renderer, platform, Apple/Metal, C API header-level and subsystem gates; the Windows Direct3D lanes remain manual, no workflow builds the C API library or runs the XNA oracle corpus, and the platform workflow covers X11 and Wayland only through SDL3 on a private Xvfb and a private headless Weston. Those workflows do not continuously launch these hosted demo files or cover every browser, renderer and driver combination. Treat a successful local browser run as separate visual evidence, not as an implication from the repository CI matrix.

🎯 Verification against the real XNA runtime

Unit tests verify individual types in isolation. What they cannot verify is whether CNA behaves the way the real XNA runtime behaved, or whether the full programming model hangs together when actual game code drives it. Three things address that. They are checked mechanically rather than by eye, but they differ a great deal in how strong and how automated they are, and the honest boundaries are stated below and on the Verification page, which holds the proof.

🎯

Pixel-exact against real XNA

CNA maintains an XNA oracle corpus: 39 scenes (256×256, HiDef) under tools/xna-oracle/, with reference images captured by running the genuine Microsoft XNA 4.0 runtime — under Wine with DXVK on Linux, not on Windows. The repository records all 39 scenes as pixel-exact on the DIRECTX9 oracle path — the same Wine and DXVK stack at --tolerance 0, every RGBA channel of every one of the 65,536 pixels per scene.

This is the strongest correctness claim on the site: not "looks right", but byte-identical to what the original runtime produced — for these 39 scenes, on that host. The DIRECTX9 renderer exists largely to make this comparison possible — it uniquely targets pixel-exact XNA 4.0 authenticity. The boundaries matter: the last consolidated dated divergence report covers 31 of the 39 scenes and later per-scene notes record the rest, no 39-scene run was executed for this documentation, the result has not been repeated on native Windows, no CI workflow runs it, and no other renderer is held to this bar — EasyGL and Software have a CTest on two line scenes only (the EasyGL test fails on any pixel difference; the Software test only if a scene does not render), Software was measured at 18 of 39 byte-exact (30 within one channel value), and FNA3D's gate only requires that the scenes render. Seven further unbound-texture scenes and a 17-format channel-expansion table were captured the same way but are outside every diff denominator.

🔄

Differential testing against FNA

A real running FNA build lives under tools/fna-reference/ and dumps its observable behaviour as JSON. tools/cna-reference/ produces the C++ counterpart dump, and scripts/compare-fna-reference.py diffs the two — a manual developer workflow covering enums, render-state presets, PackedVector types and Viewport maths, not a CI gate. New since alpha.1: FNA-produced compiled-effect fixtures (reflection, state and 8×8 pixels for seven effects) that CNA's tests replay.

Where XNA's documented behaviour is ambiguous, this settles it empirically instead of by interpretation. A separate compile-time CNAEXT purity check turns non-XNA declarations into [[deprecated]] warnings under -Werror; today it is wired up for the Devices and Sensors namespaces, and a signature-freeze test pins the Input namespace's public API.

💾

Real ported games

Separate projects drive CNA with real game code rather than test harnesses; their figures belong to the repository revision named, not to the documented snapshot:

  • cna-craft — about 13,800 lines of C/C++ (cna-lab revision 49e3cd5b): a port of fogleman/Craft, a voxel game, onto CNA.
  • cna-extended — about 102,000 lines (revision 5775ecc97): a C++23 port of MonoGame.Extended plus a non-upstream World3DEXT 3D scene layer.
  • cna-samples — 91 of Microsoft’s XNA 4.0 samples and games ported to C++ (revision 5db32e6), 90 of them playable in the browser; see below.
  • cna-dotnet-samples — the same Microsoft samples as unchanged original C# on CNA.NET: 84 programs built from byte-identical upstream source (revision 1e6d763).

Alongside them, CNA itself ships 25 cna_demo_* programs in its module example directories — 2D, audio, XACT, input, devices, avatar, GamerServices and networking demos — plus cna_house3d_demo and the new cna_inspector_demo.

🔬

More checks since alpha.1

The evidence set has grown around the oracle corpus: 32 renderer-neutral parity fixtures are registered for four renderer families (EasyGL, WebGPU, SDL_GPU and Direct3D 11), judged by the fixtures' own assertions rather than by real XNA; a Content Pipeline oracle in which genuine XNA pipeline assemblies produced a 128-type API inventory and a 152-case differential record; a glTF conformance corpus of 148 assets with renderer-owned goldens; and a bounded-memory test runner plus GPU-test isolation that make the very large suite runnable.

These are CNA-recorded results. They establish determinism and regression protection for the named renderers, not equivalence with a reference renderer, and none is run by the repository's workflows.

What the oracle corpus actually looks like

Four of the 39 scenes. Every one of these frames was drawn by the real Microsoft XNA 4.0 runtime — they are the reference images, not CNA screenshots. CNA's DIRECTX9 renderer is recorded as reproducing each of them byte for byte. The full set is described on the verification page.

A triangle on a cornflower-blue background with red, green and blue vertex colours blended smoothly across its face.

Vertex-coloured triangle.

A quad with only its left half drawn — a red block above a white block — the right half discarded by the alpha test.

Alpha test discarding half a quad.

A square shading from bright orange-brown at the top to near-black at the bottom, on cornflower blue.

Fresnel-weighted environment reflection.

A brown square on a black background, the topmost sprite after back-to-front depth sorting.

Back-to-front sprite sorting.

📌

The honest framing: CNA is a research-grade porting-experiment framework, not yet a ship-a-commercial-game framework. What the evidence on this page supports is that the XNA programming model works, that rendering matches the original runtime where it has been measured (DIRECTX9, 39 scenes, under Wine with DXVK), and that the test suite is large and real (11,380 static test definitions across 813 CNA-owned test sources, none of which is a pass count). It does not yet support a claim that any commercial title has shipped on it.

🏃 Real-World Validation — Speedy Blupi

Unit tests verify individual types and subsystems in isolation. What they cannot verify is whether the full XNA programming model hangs together when real game code drives it. The Speedy Blupi port is a real-game case study of that question — evidence for the CNA revision it was built with, not for the documented snapshot. Speedy Blupi on the Demos page

🎮

What Speedy Blupi validates

Speedy Blupi is a classic action game: the 2013 Windows Phone edition was decompiled, moved from XNA 4.0 through MonoGame, translated from C# to about 32,000 lines of C++ and then ported onto CNA by the OpenEggbert project (mobile-eggbert). Running it exercises the full stack simultaneously:

  • SpriteBatch — layered sprite rendering with correct depth ordering
  • Input handling — keyboard, touch and accelerometer state each frame
  • Audio — SoundEffect and MediaPlayer for per-event sounds and music
  • Content loading and saves — loose PNG and WAV assets through ContentManager, and game state through IsolatedStorage
  • Game loop semantics — fixed-timestep Update / variable-timestep Draw
✅

What it proves

Real-world XNA-style game code runs on CNA at the revision it was ported to. The port was a translation, not a copy: the game's classes were rewritten from C# to C++ one by one, and the project keeps a list of open issues (sound timing, fullscreen, transparency). It shows that:

  • CNA's API shape is close enough to XNA 4.0 that a ~32,000-line game could be translated class by class instead of redesigned.
  • The framework can run a multi-system game loop on desktop and in the browser; the project's own notes, not CNA's CI, are the evidence for how well.
  • Audio, input and rendering subsystems interoperate when driven by real game state, again for the revision it was built with.
📱

Platform targets

The Speedy Blupi port records these project targets:

  • Linux x86_64 — builds from source with CNA's SDL_RENDERER backend (its README default); Windows builds are documented
  • Android — a Gradle/NDK project exists; no APK has been published
  • WebAssembly — a playable Emscripten build is hosted at speedyblupi.com (an early, May 2026 CNA revision using SDL_RENDERER; predates alpha.1 and the documented snapshot)

Consumer-project results are useful evidence for that project's pinned revision, not a continuous platform gate for the documented snapshot. CNA itself has no Android workflow.

📚 Sample Applications — cna-samples

The cna-samples repository contains direct C++ ports of Microsoft’s original XNA Game Studio 4.0 samples and games. Each one follows the original C# source as closely as possible — the point is to test CNA’s API against what real XNA code actually demanded, not to write flattering new demos. All figures below are tied to the repository revision 5db32e6 (3 October 2026) and to CNA next at that date, not to the documented snapshot.

The C++ port of the relevant XNA 4.0 samples is practically complete: 91 sample and game projects have a finished C++ CNA version. They include Platformer, MarbleMaze, RolePlayingGame, ShipGame, CatapultWars, HoneycombRush, NinjAcademy, GameStateManagement, Audio3D, NetRumble and the avatar samples, spanning 2D primitives, collision, AI and pathfinding, particles, complete 2D and 3D games, 3D audio, avatars, networking and touch gestures. Shader-driven samples such as BloomSample, ShadowMapping, NormalMapping and SkinningSample work because the official Effect binaries produced by XNA’s own content build load through CNA’s compiled-effect path.

The plan audits 153 entries (SAMPLE-001 to SAMPLE-153), and that number is the size of the audit list, not a count of 153 XNA 4.0 games: 8 relevant XNA 4.0 C# programs remain to be finished (among them the peer-to-peer and network-prediction samples and the Windows Phone RolePlayingGame), and 54 entries are not port targets at all — XNA 3.x or older content, Silverlight and Windows Forms tools, Visual Basic and C++ projects, asset and art packs, duplicates, and samples built on retired platform services.

90 C++ builds are playable in your browser at samples.libcna.com: real XNA sample code compiled to WebAssembly and run by CNA, not screenshots. Each was run in Chrome when its port was completed; one of them (PerformanceUtility) is marked partial, and three completed ports have no browser build by design (StockEffects is a content tool; NetRumble and the client-server sample need native networking).

▪

PrimitivesSample

Ported

Port of the original XNA Game Studio 4.0 Primitives Sample demonstrating 2D primitive rendering: lines, triangles, rectangles, and circles drawn using SpriteBatch and procedurally generated textures.

Validates: SpriteBatch.Begin/End, pixel-texture creation, 2D coordinate mapping, and the basic game loop with variable-size window support.

⌖

Primitives3D

Ported

Port of the original XNA Game Studio 4.0 3D Primitives Sample demonstrating 3D shape rendering: box, sphere, cylinder, torus, and teapot primitives rendered with BasicEffect lighting and per-object transform matrices.

Validates: BasicEffect with ambient/diffuse/specular lighting, VertexBuffer/IndexBuffer management, view/projection matrix setup, and the 3D rendering pipeline end-to-end.

🏆

CatapultWars

Ported

Port of the original XNA Game Studio 4.0 Catapult Wars — a complete two-player turn-based artillery game with scoring, animated sprites, and game-state screens.

Validates: a full game loop end-to-end, not just an isolated API — sprite animation, input handling, scoring, and screen transitions working together.

📌

GameStateManagement

Ported

Port of Microsoft's Game State Management sample: a reusable screen-stack framework (menus, gameplay, pause, transitions) used as the foundation for many of the other official XNA sample games.

Validates: a layered GameComponent/screen architecture on top of CNA's Game base class.

🧩

Pathfinding & FlockingSample

Ported

Ports of the XNA AI sample pair covering grid-based pathfinding and boid-style flocking/steering behavior, alongside related ports (ChaseAndEvade, WaypointSample, AimingSample, FuzzyLogic).

Validates: math-heavy gameplay code (vectors, steering forces, grid search) ported faithfully from C# to C++23.

🔊

Audio3D & GesturesSample

Ported

Ports covering positional 3D audio playback and touch gesture recognition (tap, drag, pinch, flick) — the two least-graphics-focused corners of the XNA API surface.

Validates: SoundEffect3D-style positional audio and Microsoft::Xna::Framework::Input::Touch gesture handling outside of pure rendering code.

🏎

Racing Game Kit

Ported, not hosted
The C++ CNA port of Microsoft's XNA 4.0 Racing Game Kit: a car on the race track

Microsoft’s XNA 4.0 Racing Game Kit — a full 3D racing game with menus, tracks, highscores and post-processing — has a complete C++ CNA port, tracked in its own plan beside the 91 sample ports. It was requalified on Linux on 3 October 2026; a local browser run passed; on Android it runs on the emulator, and a debug build has raced on one phone, so Android is still described as in progress.

It is not hosted on samples.libcna.com, because its original content is not treated as redistributable by the CNA sample gallery. Watch it on YouTube (“Racing Game on CNA and in web browser”) or read the gallery’s Racing Game page.

#

The original C# samples, unchanged

CNA.NET, beta

The same Microsoft samples also run from their original C# source through CNA.NET, CNA’s C# binding: cna-dotnet-samples keeps the upstream game code byte-for-byte and adds only a project file and host. 83 sample projects (84 programs) build and run on Linux, single-threaded in headless Chromium and on the x86_64 Android emulator, and on a physical Mac mini M4 (osx-arm64) all 84 start, load their content and keep running on the SOFTWARE and METAL renderers (a smoke run, not a pixel comparison); 83 of the 91 C++ ports therefore also exist as unchanged C#, and 26 programs were compared pixel for pixel with their C++ port and match.

These are runs recorded in CNA.NET’s campaign ledgers, not CI; no C# build is hosted publicly. See Migrating C# games to CNA.NET.

🔗

Repository: All sample ports live at github.com/libcna/cna-samples. Each sample includes build instructions and mirrors the structure of the original XNA sample project. Additional XNA 4.0 sample ports are added as API coverage expands.

🖥 Platform Validation

CNA is built on SDL3, which provides the portability layer. The table below reflects current validated state — "validated" means demos or game code has been built and run on real hardware or a real browser, not merely that the code compiles.

Platform Renderer Status Notes
Linux x86_64 OPENGLES3 (EasyGL), VULKAN, SOFTWARE, SDL_RENDERER, OPENGL33 Validated Primary source and CI platform: SDL3 with several renderers, the SDL3 window suite on SDL’s X11 and Wayland drivers, and an SDL-free Headless build with ALSA audio all run automatically under virtual servers. The workflows exercise configured slices, not every renderer or test definition. OPENGLES3 is the Linux default.
Android SDL_RENDERER Partial Source and CMake/NDK integration exist, including Android sensor paths and a Gradle demo project. In this snapshot, Android lifecycle, Back-button, portrait and content fixes were found and checked on the Android emulator by running real samples and games (mostly through CNA.NET), and the C++ Racing Game has run on one phone in a debug build. There is no Android workflow lane and no preset, so do not read this as qualification on physical devices.
WebAssembly / Browser WEBGL2 (EasyGL), WEBGPU Validated The 90 sample builds at samples.libcna.com, the hosted demos and the CNA Car Simulator and Street builds are playable WebGL 2 examples, each run in a desktop browser when it was published. A workflow builds one bundle containing the WebGL 2 and WebGPU renderers and inspects it; it does not run them, so it does not substitute for testing in target browsers.
Windows SDL_RENDERER, DIRECTX9, DIRECTX11 Partial Native MSVC and MinGW-w64 cross-build paths exist; windows come from SDL3’s Windows driver. The native-MSVC Direct3D 11 and SDL3 platform lanes are manually dispatched (their recorded run on GitHub’s Windows image passed), and Direct3D 11 was validated on one physical Windows 11 machine. Report a concrete configured build or runtime run rather than treating source support as continuous Windows validation.
macOS METAL, OPENGL33, SDL_GPU, WEBGPU, FNA3D, SOFTWARE, SDL_RENDERER Tested on one Mac macOS 13.3 and later. CNA’s own qualification ran every renderer listed here through its full test suite on a physical Mac mini M4 (Apple silicon, macOS 27) with no failing case; the console was locked, so on-screen presentation was not observed, and no Intel Mac was run. The C++ sample ports pass CNA’s automated renderer matrix on METAL, OPENGL33 and WEBGPU (91 of 91) and on SDL_GPU and FNA3D (90 of 91; LensFlare needs occlusion queries those drivers lack), and 248 of 248 cna-examples demos render on Metal. CI builds and tests on GitHub’s macos-26 runners.
iOS SDL_RENDERER, METAL Experimental iOS 16.3 and later, allow-listed to SDL_RENDERER and METAL, with networking configured off. In CNA’s own iOS Simulator runs (iPhone 17 profile) a METAL pixel probe read back exact pixels in 8 of 8 launches; the device app is final-linked and has never run on a physical iPhone or iPad, so there is no device pixel, input or audio evidence.
⚠

Renderer note: CNA snapshot c1c316b9 exposes 14 identities across 12 implementation families. A default build contains one selected with CNA_GRAPHICS_RENDERER; an opt-in CNA_GRAPHICS_RENDERERS build can contain several compatible families and select one before device creation. This page demonstrates only a tiny subset, so do not generalize its output or capabilities to the full inventory. See Renderers for the source-audited matrix and Runtime Renderer Selection for the multi-renderer boundary.