The public gallery of XNA 4.0 samples ported to C++ with CNA and compiled to WebAssembly. Playable entries run in the browser on WebGL 2; an informational entry may omit its bundle when redistribution rights are unresolved.
index.html gallery page 1: up to 12 cards, thumbnails and names
page-N.html later gallery pages: up to 12 cards each, in the same order
<Sample>.html detail page: full screenshot, description, status/controls, prev/next
<Sample>/ the playable bundle when publication is permitted
assets/site.css the whole stylesheet
assets/img/ screenshots, cropped to the game canvas, plus thumbnails
A detail page's Play button opens the sample in a new tab. Ordinary samples link directly
to <Sample>/<Sample>_cna_samples.html; threaded Marble Maze, Honeycomb Rush, NinjAcademy and Catapult Wars
first open their scoped launch.html pages to prepare cross-origin isolation, then load the unmodified
Emscripten shells.
- Build the sample's WEBGL2 bundle in Release. Disable Emscripten threads for samples
that do not use
System.Threading. A Debug bundle carries DWARF sections and runs to 90 MB or more; GitHub blocks regular Git objects over 100 MB, and the rest is wasted bandwidth anyway. Ordinary samples use-DCNA_SAMPLES_ENABLE_EMSCRIPTEN_THREADS=OFF;Primitives3Dwas 93.5 MB as Debug and is 7.3 MB as a non-threaded Release WASM.MarbleMaze,HoneycombRush,NinjAcademyandCatapultWarsneed their original backgroundSystem.Threading.Threadpaths and are built with threads enabled. Eachlaunch.htmlregisters a service worker scoped to its game directory;coi-sw.jssupplies COOP/COEP headers for its same-origin files on static GitHub Pages. The Emscripten shells are unmodified. The six-file bundles were tested over plain HTTP with clean Chrome profiles,crossOriginIsolated=true, gameplay and pause. - Copy the bundle files into a directory named after the sample. A
.datafile exists only when the sample packages runtime content; Bounce has no runtime content and needs three files. - Crop a representative screenshot to the game canvas — no browser chrome, no Emscripten shell —
and save it plus a thumbnail under
assets/img/. - Write
<Sample>.htmlfrom the original XNA documentation: what the sample teaches, its controls, and a direct source link tohttps://github.com/libcna/cna-samples/tree/develop/samples/<Sample>. - Add a card to the last gallery page (
index.html, thenpage-2.html, etc.), creating a newpage-N.htmlafter each group of 12. Update the shown sample ranges, page links at the top and bottom, andrel="prev"/rel="next"links on adjacent gallery pages. Keep each card on exactly one page, in publication order. Fix the previous/next links on the neighbouring detail pages.
# Release bundles have no DWARF. A non-zero count here means it is a Debug build.
grep -ac debug_info <Sample>/<Sample>_cna_samples.wasm
# Ordinary GitHub Pages bundles cannot use pthreads without an isolation launcher.
# A normal bundle reports 0; MarbleMaze, HoneycombRush, NinjAcademy and CatapultWars use launch.html/coi-sw.js.
grep -aEc 'PThread|shared:true|emscripten_thread' <Sample>/<Sample>_cna_samples.jsfavicon.ico contains 16, 32, 48 and 64 pixel sizes for browsers that request
the conventional root icon. Every root-level gallery and detail page links to
favicon-32.png and apple-touch-icon.png. The icon is a generated geometric
C with an orange game pixel on the site's dark blue background. The playable
Emscripten shells remain unchanged and can use the root favicon.ico.
The playable Web builds in this repository are the C++ ports using CNA's C++ API. They have so far been tested on the Web and Linux desktop. The separate CNA.NET sample collection runs nearly all of the same samples from their original, unchanged C# source through the CNA C# binding. That route has been tested on the Web, desktop and Android; other platforms have not yet been tested.
Racing Game is an informational exception: its screenshot and status page are published, but its
playable Web bundle is withheld because the available source snapshot has no redistribution grant.
Its current C++ source links to cna-samples; the future YouTube destination is shown as
forthcoming rather than linked to an invented URL.
Performance Utility (SAMPLE-104) is explicitly marked 🟡 partially implemented at the owner's
request. Its local profiling tools and command console are playable. Browser account transport
and public SystemLink discovery/join/host/relay are unfinished; the preserved original remote
command cannot connect. The detail page lists this limitation beside Play and links to the sample's
diff.md and CNA's browser network readiness checklist. This entry is not full-network qualification.
Most samples are Microsoft's and retain their original Microsoft Permissive License. Each entry remains subject to the licence or copyright notice present in its source; Racing Game has no available redistribution grant, so its browser bundle is not published. The C++ port and the WebAssembly build are CNA's.