Search code examples
c#xnamonogamesharpdx

What's the deal with Monogame, SharpDX, and XNA?


I've been doing research on good tools to create games with, and I came across Monogame, Sharpx, and XNA. I have some questions regarding each:

  1. When I create a new windows project (which advertises that it uses DirectX 12), the code template looks like this:

    using Microsoft.Xna.Framework;
    using Microsoft.Xna.Framework.Graphics;
    using Microsoft.Xna.Framework.Input;
    

I understand Monogame is a re-implementation of XNA, but where is the "re" part? This code shows Monogame using Microsoft's XNA, and doesn't even hint at the usage of DirectX 12.

  1. SharpDX has an advantage of using WinRT (so i've heard), but what exactly does that mean to me? I know that SharpDX is a layer that sits on top of DirectX to allow it to be used in C#, and naturally should use WinRT. What excuse does Monogame have not to use WinRT?

I feel I'm confused at something and want clarity. Keep in mind that I'm a total noob at this stuff, anything helps!


Solution

  • MonoGame is indeed a reimplementation of XNA. It uses Microsoft.Xna.Framework.* namespaces to preserve source code compatibility with XNA projects. MonoGame does not currently support DirectX 12 - the desktop version has DirectX 11 and OpenGL backends.

    It provides simple, cross-platform classes for common game tasks (loading content, rendering, sound playback, etc.) and a pipeline for building runtime-optimized content files. MonoGame is really powerful for most projects and great for quick development, though not a fully featured game engine like Unity. Since it is modelled after XNA (discontinued a few years ago), most XNA samples/tutorials work just fine.

    SharpDX is a low-level wrapper of DirectX types. You should go with it only if you want to get your hands dirty with low-level plumbing, which doesn't appear to be the case.

    The DirectX implementation of MonoGame (used for classic Windows, UWP, and Windows 8 apps) internally uses SharpDX for communicating with DirectX. When it comes to WinRT, it is just an implementation detail of "modern" Windows app platform.