OpenTK vs XNA vs SlimDX vs SharpDX vs Anything else that I missed?

Started by
3 comments, last by riuthamus 11 years, 4 months ago
Hello-

I am an experienced programmer in C# but have never developed games, and thought I would give it a try as a hobby. I am looking for recommendations on what to use, and the advantages/dis-advantages of all. It would be great to know what is recommended from someone experienced in the game programming world.
Advertisement
with OpenTK and SlimDX (and SharpDX) you just have "translation layers" between C# and OpenGL and DX Api. Using these two usually means studying (or being already familiar) with the APIs from C++ and translating the concepts to C#. You start from these if you want to build the entire game engine from the bottom up.
XNA is slightly higher level and idiomatic and specific for C#. You start talking about models, matrices and higher level concepts.
Talking about C#, it is right also to mention Unity3D, that is much higher level and that uses C# (plus other languages) for scripting,

So it really depends at which level of the graphics "ladder" you want to start... other than that, they're all fine, performant, stable and so on.

They also have a slightly different compatibility matrix.. but, overall, they all have good a portability stories there. But, being yourself a beginner, you shouldnt care at all about portability at this stage and just target the easiest platform: Windows Desktop PC.

Stefano Casillo
TWITTER: [twitter]KunosStefano[/twitter]
AssettoCorsa - netKar PRO - Kunos Simulazioni

In my experience, XNA rewards you the quickest with something running and playable (out of the box: the framework you start with can "run" a game that's just a windowed rendering context drawing a blue square). It's also a great environment to start learning HLSL, and I only moved away from it because I was worried about long-term support and didn't like some of the restrictions created by XNA's profile system.

SlimDX or SharpDX is a great learning experience for DirectX, where you trade speed of development and higher-level starting points for broader and deeper levels of control.

I can't comment on OpenTK as I never tried it.

Hazard Pay :: FPS/RTS in SharpDX (gathering dust, retained for... historical purposes)
DeviantArt :: Because right-brain needs love too (also pretty neglected these days)

I would no longer recommend XNA. Excellent as it is support for it seems to be slowly phasing out and platforms are limited.

Instead I would recommend monogame which is a clone of XNA (most of the classes have the exact same names, parameters and usage etc) but intended for running on the mono runtime (which again is an open source version of .net) but it runs perfectly fine on .net. Monogame under the hood is actually built using both SharpDX (very similar to slimDX, its just an alternative option) or OpenTK and can switch between the 2 without you ever noticing. As a result you gain access to every platform mono can run on:

  • Windows (with either .net or mono, it really doesnt care)
  • OSX (both powerPC and x86)
  • Linux (all architectures with some limitations. x86 is very well supported anyway. Others may need OpenTK to be ported over, usually platforms requiring OpenGL ES)
  • Android (monodroid is required)
  • iOS (monotouch license required)
  • Playstation VIta (some sort of license required yet again)
  • BSD although I think that is an unofficial port
  • Googles Native Client on any x86 system (browser technology, again its an unofficial port).


Porting between XNA and monogame is fairly seamless. Of course by backporting your project from monogame to XNA you then get windows phone 7 and xbox 360. I think windows phone 8 has been ignored by microsoft in XNA but who knows, maybe monogame will go there too?




Choosing between OpenTK/SlimDX/SharpDX and XNA/Monogame is just a case of how low level do you want to go? The prior 3 options are just direct wrappers around either OpenGL or DirectX enabling their usage from .net or mono. XNA/Monogame are much more "engine like" and already have sprite batchers etc implemented aswell as simpler sound API's, mouse and keyboard input and so on.
To give you a background of where we started:

Our project started with XNA. The goal was to get out a simple product that had some relatively nice design and could be released on xbox. As the progressed on our project we noticed more and more problems with the XNA platform when dealing with shaders and new technology. We wanted to take advantage of some of the more refined elements available to PC users but to do that we would have to migrate from the XNA platform.

Several months had passed and we moved into the SlimDX setup. We had access to dx11 as well as many other factors that were rather limiting with the XNA setup. On the flipside, we had to code much more when it came to handling models and mesh rendering. There is almost 0 projects out there that have the option to handle meshes that have animations and textures when it comes to a C#+SlimDX setup. So, expect to spend some time dealing with that if you go that route.

We just recently moved from SlimDX to SharpDX ( since slimdx doesnt seem to be supported much these days ). With this switch we gained all the perks of the SlimDX vs XNA setup as well as gaining access to the new dx11.1 perks. ( which improved our UI setup and reduced fps loss )

I think it was best said already, it really depends on what your overall limitations and goals are for the shaders/graphics.

This topic is closed to new replies.

Advertisement