XNA 4.0 Compatibility

API coverage table - current state, subject to change

How this page measures coverage. The numbers below are not estimates. Every public type in FNA — the reference C# reimplementation of XNA 4.0 — was enumerated and checked against CNA's public headers. That gives a defensible answer to "does this type exist," which is what the table reports. It does not tell you the type behaves correctly; for that, see Verification & Known Issues, which lists every gap that is currently known.

Coverage at a glance

XNA 4.0 public types present in CNA, per namespace:

NamespaceTypes presentNotes
Microsoft.Xna.Framework42 / 42Game, GameTime, all math and bounding-volume types.
….Graphics91 / 91Every XNA 4.0 graphics type exists. Behavioural gaps are listed separately.
….Graphics.PackedVector18 / 18Complete, including IEEE 754 half-float types.
….Audio19 / 19Includes a real XACT runtime (.xgs/.xwb/.xsb parsing).
….Input17 / 17Keyboard, Mouse, GamePad incl. rumble and trigger motors.
….Input.Touch8 / 8Touch panel and gesture recognition.
….Media25 / 25 shellsPresent, but 14 of the 24 classes are API-shaped shells that throw. See below.
….Storage3 / 3Real filesystem-backed save data.
….Content4 / 12 major gapNo .xnb pipeline — a deliberate architectural choice. See below.
Total227 / 245  (92.7%)

Two namespaces sit outside that comparison because FNA does not implement them at all, while CNA does: Microsoft.Xna.Framework.Net (23 types, backed by real UDP networking over ENet) and Microsoft.Xna.Framework.GamerServices (54 types, a local-only facade). CNA additionally implements the Windows-Phone Microsoft.Devices.Sensors namespace, with genuine Android NDK sensor access.

Present is not the same as working. Three areas have a large gap between the two, and you should know about them before porting:

AreaThe gap
Content pipeline CNA cannot read .xnb files. ContentReader, ContentTypeReaderManager and the ContentSerializer* attributes do not exist. Assets are loaded as raw files (.png, .wav, .ogg, .dds…) plus JSON descriptors for fonts, models and shaders.
Custom shaders Effect's compiled-bytecode constructor throws NotImplementedException. The five stock effects work on every backend; custom HLSL must be hand-rewritten as GLSL/SPIR-V using the CNA-only ShaderEffect.
Media library Song, MediaPlayer, Video and VideoPlayer are genuinely implemented (FFmpeg-backed video, SDL3_mixer audio). But MediaLibrary and the whole catalogue tree — Album, Artist, Genre, Picture, Playlist and their collections — are shells whose members throw.

Status legend for the per-class tables below:

Implemented   Partial   In Progress   Planned

Microsoft.Xna.Framework

ClassStatusNotes
GameImplementedFull lifecycle: Initialize, LoadContent, Update, Draw, UnloadContent.
GameTimeImplementedElapsedGameTime, TotalGameTime, IsRunningSlowly.
GameComponentImplemented
DrawableGameComponentImplemented
GameComponentCollectionImplemented
GameServiceContainerImplemented
GameWindowImplementedTitle, resize events, AllowUserResizing.
GraphicsDeviceInformationImplemented
FrameworkDispatcherImplemented
LaunchParametersImplemented
TitleContainerImplemented
TitleLocationImplemented
ColorImplementedPredefined colours including CornflowerBlue.
Vector2Implemented
Vector3Implemented
Vector4Implemented
MatrixImplemented
QuaternionImplemented
PointImplemented
RectangleImplemented
BoundingBoxImplemented
BoundingSphereImplemented
BoundingFrustumImplemented
PlaneImplemented
RayImplemented
MathHelperImplementedTrig, Clamp, Lerp, etc.
CurveImplemented
CurveKeyImplemented
CurveKeyCollectionImplemented

Microsoft.Xna.Framework.Graphics

ClassStatusNotes
GraphicsDeviceImplementedClear, Present, render targets, blend/depth/rasterizer/sampler states, scissor, viewport, DrawPrimitives, DrawIndexedPrimitives, DrawInstancedPrimitives, GetBackBufferData.
GraphicsDeviceManagerImplementedAuto-reset, fullscreen toggle, preferred display modes.
SpriteBatchImplementedAll SpriteSortMode values, transform matrix, custom Effect, blend/sampler states, DrawString.
Texture2DImplementedLoad from file, GetData/SetData, SaveAsPng/SaveAsJpeg, all mip levels, 18 PackedVector pixel formats.
RenderTarget2DImplementedSubclass of Texture2D. FBO + depth renderbuffer (EasyGL); off-screen image (Vulkan).
EffectImplementedEffectParameter with all Get/Set overloads. IEffectMatrices, IEffectFog, IEffectLights.
BasicEffectImplementedFull lighting, fog, texture, vertex color support.
AlphaTestEffectImplemented
DualTextureEffectImplemented
EnvironmentMapEffectImplemented
SkinnedEffectImplemented
SpriteEffectImplemented
SpriteFontImplementedFull glyph model, MeasureString, DrawString (3 overloads). Loaded from .font.json.
ModelImplementedModel::Draw with bone transforms, IEffectMatrices binding. Loaded from .model.json.
VertexBuffer / DynamicVertexBufferImplementedAll four VertexPosition* types supported.
IndexBuffer / DynamicIndexBufferImplemented16-bit and 32-bit index formats.
OcclusionQueryImplementedEasyGL: GL_ANY_SAMPLES_PASSED; others stub.
VertexDeclarationImplemented
BlendState / DepthStencilState / RasterizerState / SamplerStateImplementedAll wired to backend Apply* methods.
ViewportImplementedProject / Unproject fully implemented.
Texture3D / TextureCubeImplementedSetData/GetData implemented on EasyGL, Vulkan, and Bgfx backends.

Microsoft.Xna.Framework.Graphics.PackedVector

ClassStatusNotes
Alpha8Implemented8-bit alpha channel.
Bgr565Implemented16-bit BGR.
Bgra4444Implemented16-bit BGRA, 4 bits per channel.
Bgra5551Implemented16-bit BGRA, 5-5-5-1.
Byte4Implemented32-bit, 4 unsigned bytes.
HalfSingleImplemented16-bit IEEE 754 half-float.
HalfVector2Implemented32-bit, 2x half-float.
HalfVector4Implemented64-bit, 4x half-float.
NormalizedByte2Implemented16-bit, 2x signed normalized byte.
NormalizedByte4Implemented32-bit, 4x signed normalized byte.
NormalizedShort2Implemented32-bit, 2x signed normalized short.
NormalizedShort4Implemented64-bit, 4x signed normalized short.
Rg32Implemented32-bit, 2x unsigned normalized short (16-16).
Rgba1010102Implemented32-bit, 10-10-10-2 packed RGBA.
Rgba64Implemented64-bit, 4x unsigned normalized short.
Short2Implemented32-bit, 2x signed int16.
Short4Implemented64-bit, 4x signed int16.

All 17 PackedVector types include full Pack/Unpack with correct IEEE 754 rounding and edge-case handling (subnormals, ±∞, ±0, NaN).

Microsoft.Xna.Framework.Storage

ClassStatusNotes
StorageDeviceImplementedNative filesystem; full XNA API shape.
StorageContainerImplementedNative filesystem backed.
StorageDeviceNotConnectedExceptionImplemented

Microsoft.Xna.Framework.GamerServices

Ported in full (kicked off 2026-06-30, landed 2026-07-07, 132/132 tasks closed, hardening pass ongoing). Not binary-compatible with real Xbox Live — reimplements the public API shape with local/synthetic semantics, the same approach FNA itself uses for this namespace.

ClassStatusNotes
GuideImplementedReal message-box overlay (SpriteBatch-based) and captured-text keyboard input via TextInputEXT, not stubs.
GamerServicesComponentImplementedRegisters with Game.Components; drives live local gamer services.
GamerServicesNotAvailableExceptionImplementedException type present.
Gamer / SignedInGamer / GamerProfile / FriendGamer / FriendCollectionImplementedComplete XNA-shaped API surface with local/synthetic semantics.
LeaderboardReader / LeaderboardWriter / LeaderboardEntryImplementedDisk-persisted, not in-memory-only.
AchievementsImplementedDisk-persisted.
AvatarAnimation / AvatarDescription / AvatarRendererImplementedPorted from a decompiled real Microsoft XNA 4.0 reference assembly — FNA itself never implemented Avatar. Toy-like, Xbox-Avatar-inspired stylization with fully original CNA geometry/textures (no proprietary Xbox Avatar assets used, not even as private reference).

Microsoft.Xna.Framework.Net

Complete NetworkSession API surface (5 enums + 18 classes). Real networking for NetworkSessionType::SystemLink, backed by ENet (reliable UDP, vendored) — hosting, joining, LAN discovery, AppData relay, disconnect handling, and StartGame/EndGame state broadcast all run over a genuine transport, not a stub. Every other NetworkSessionType remains a synthetic (non-networked) stub, matching upstream XNA/FNA behavior. Verified real networking across four platforms: Linux (native ENet/UDP, genuine two-process loopback test), Windows (native ENet/UDP via WinSock2, cross-compiled with MinGW-w64, verified under Wine), Web/Emscripten (real ENet traffic over actual WebSocket connections — client-only, browsers cannot open listening sockets), Android NDK (native ENet/UDP via bionic libc, verified on a real x86_64 emulator).

ClassStatusNotes
NetworkSessionImplementedReal ENet-backed SystemLink hosting/joining/state broadcast.
AvailableNetworkSession / AvailableNetworkSessionCollectionImplementedReal LAN discovery.
NetworkSessionPropertiesImplemented
NetworkSessionType / NetworkSessionState / NetworkSessionEndReason / NetworkSessionJoinErrorImplementedEnums.
NetworkSessionJoinException / NetworkSessionEndedEventArgsImplemented

Xbox Live-exclusive session types (PlayerMatch, Ranked, Invite) stay documented, tested-as-unsupported stubs — no synthetic offline approximation is attempted for those.

Microsoft.Xna.Framework.Input

ClassStatusNotes
Keyboard / KeyboardStateImplementedFull Keys enum, all standard keys.
Mouse / MouseStateImplementedPosition, all buttons, scroll wheel.
GamePad / GamePadStateImplementedAll 4 players, axes, buttons, D-pad, triggers, thumbsticks with dead-zone handling.
TouchPanel / TouchLocationImplemented~98% behavior — byte-faithful FNA gesture-pipeline port (Tap, FreeDrag, Flick, Pinch...PinchComplete), wired end-to-end and tested with a deterministic clock. Documented deviations only: event-driven vs poll-based GetState(); MaximumTouchCount reports 4 and GetState() caps at 8, both intentionally matching FNA.
TextInputEXTImplementedIME text input integration.

Microsoft.Xna.Framework.Audio

ClassStatusNotes
SoundEffectImplementedLoad from file, play, volume control.
SoundEffectInstanceImplementedPer-instance playback state, pitch, pan, volume.
DynamicSoundEffectInstanceImplementedRuntime audio buffer submission.
SoundBank / WaveBankImplemented~97% functional. Real .xgs/.xsb/.xwb parser + SDL3_mixer playback; category/lifecycle/3D/instance-limit and fade (category- and cue-level) all real. Remaining gaps are documented accepted deviations (no HRTF/elevation, no AttackTime/ReleaseTime envelope tracking), not missing implementation.
SongImplementedMP3, OGG, WAV, FLAC, OPUS, AAC, WMA playback.
MediaPlayerImplementedPlay, pause, stop, volume, repeat.
AudioEmitter / AudioListenerPartialData structures implemented; full 3D spatial audio not complete.
AudioEngineImplementedReal category/cue instance-limit enforcement with fade in/out, continuous RPC volume/pitch curve re-evaluation, stereo pan crossfeed — matches FAudio's actual shipped behavior rather than a "corrected" reimplementation.
MicrophonePlannedAPI present, no implementation.

Microsoft.Xna.Framework.Content

ClassStatusNotes
ContentManagerImplementedExtensible ContentTypeReader<T> pattern. Loaders for Texture2D, SpriteFont, Model, Effect, SoundEffect, Song, Video. Uses JSON descriptors, not XNB.

Note: IServiceProvider / ServiceProvider in CNA is simplified compared to XNA. Game.Services is available but not all XNA services are pre-registered. The ContentManager constructor accepts a IServiceProvider reference.

Microsoft.Xna.Framework.Media

ClassStatusNotes
Video / VideoPlayerPartialFFmpeg-based YUV→RGBA decode to Texture2D. MP4, OGV, WEBM, MKV, AVI, MOV. Linux/Windows only (excluded on Emscripten/Android).
MediaLibraryStubPhoto/playlist query APIs stub only.

Is it actually usable?

Type-presence percentages only go so far. The most direct evidence that CNA's XNA surface holds up under real code is the sibling cna-samples repository, which ports Microsoft's official XNA Game Studio 4.0 sample collection to C++ on CNA.

ResultDetail
63 of 86 official XNA samples building Including Platformer, MarbleMaze, RolePlayingGame, CatapultWars, HoneycombRush, GameStateManagement, Audio3D and the networking samples.
The remaining 23 blocked Overwhelmingly blocked on one thing: they ship custom .fx shaders. BloomSample, ShadowMapping, NormalMapping, SkinningSample, PerPixelLighting and friends all need HLSL that CNA cannot compile.

That single dependency — compiled shader bytecode — is the clearest measure of what stands between CNA and a drop-in XNA experience. Everything else in those 23 samples already works.

Beyond the samples, CNA Craft (a voxel game ported from fogleman/Craft) runs on CNA's VertexBuffer/BasicEffect/Texture2D API on the desktop and in the browser via WebAssembly.

C++ API differences from C# XNA

While CNA mirrors XNA's API surface, there are necessary differences due to the C++ language:

  • No garbage collection: Resources are managed with RAII and std::unique_ptr / std::shared_ptr. Objects must be explicitly managed by the caller.
  • No properties: C# properties become getter/setter methods (e.g. getGraphicsDeviceProperty() instead of the C# GraphicsDevice property).
  • No events: C# event delegates are replaced with virtual method overrides or callbacks where applicable.
  • Namespace syntax: Microsoft::Xna::Framework with :: instead of ..
  • No extension methods, LINQ, or generics as they exist in C#.

Known gaps and limitations

The headline gaps are below. The Verification & Known Issues page carries the complete, current list, including every open rendering bug.

  • XNB content pipeline — not supported. CNA loads raw assets plus JSON descriptors. A compiled .xnb file cannot be read at all, so porting a game means re-authoring its content.
  • Compiled .fx shader bytecodeEffect's bytecode constructor throws. Custom shaders must be hand-written as GLSL/SPIR-V through ShaderEffect. This is the single biggest practical barrier to porting an existing XNA game.
  • MediaLibrary and the media catalogueAlbum, Artist, Genre, Picture, Playlist and their collections are shells that throw. Song and video playback is real.
  • BoundingFrustum::Intersects(Ray) — throws NotImplementedException; the other overloads work.
  • Xbox LIVE services — leaderboards, gamertag lookup and the Guide message box throw or no-op, because the service they need no longer exists. FNA stubs these out for the same reason.
  • SDL_Renderer is 2D-only — by design. Every 3D entry point throws. Use EasyGL, Vulkan or bgfx for 3D.
  • macOS — not a target. SDL3 supports it, but CNA has no macOS toolchain file, CI job, or build evidence.

Intentionally excluded from CNA

  • Real Xbox Live server-side services (authentication against Microsoft's servers, matchmaking, cloud-synced achievements/leaderboards) — GamerServices and Net are ported with local/synthetic semantics instead (see above), the same approach FNA itself uses; genuine Xbox Live server integration is out of scope.
  • Non-SystemLink NetworkSessionType values (PlayerMatch, Ranked, Invite) — documented, tested-as-unsupported stubs; no synthetic offline approximation.
  • XNB binary content pipeline — replaced by JSON descriptors; XNB import is not planned.
  • Windows Phone sensor emulation — the Accelerometer class works where SDL3 supports it; Phone-specific emulation is excluded.
  • Direct3D-specific APIsGraphicsAdapter enumeration returns a stub on non-Windows platforms.

Reference resources