Skip to content

About

The public gallery of XNA 4.0 samples ported to C++ with CNA and compiled to WebAssembly.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

120 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

samples.libcna.com

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.

Layout

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.

Adding a sample

  1. 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; Primitives3D was 93.5 MB as Debug and is 7.3 MB as a non-threaded Release WASM. MarbleMaze, HoneycombRush, NinjAcademy and CatapultWars need their original background System.Threading.Thread paths and are built with threads enabled. Each launch.html registers a service worker scoped to its game directory; coi-sw.js supplies 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.
  2. Copy the bundle files into a directory named after the sample. A .data file exists only when the sample packages runtime content; Bounce has no runtime content and needs three files.
  3. Crop a representative screenshot to the game canvas — no browser chrome, no Emscripten shell — and save it plus a thumbnail under assets/img/.
  4. Write <Sample>.html from the original XNA documentation: what the sample teaches, its controls, and a direct source link to https://github.com/libcna/cna-samples/tree/develop/samples/<Sample>.
  5. Add a card to the last gallery page (index.html, then page-2.html, etc.), creating a new page-N.html after each group of 12. Update the shown sample ranges, page links at the top and bottom, and rel="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.

Checking a bundle before publishing it

# 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.js

Site icon

favicon.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.

C++ and C# routes

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.

Partial browser implementation

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.

Licence

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.

About

The public gallery of XNA 4.0 samples ported to C++ with CNA and compiled to WebAssembly.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages