Farsser with SharpDX -SharpDX-toolkit

Topics: Developer Forum, User Forum
Dec 2, 2012 at 4:27 PM
Edited Dec 2, 2012 at 4:29 PM

Hey ,

I just finished porting Farsser to pure SharpDX and its toolkit,so it works on Windows 8 and WinRT as well as WP8 .It works quite well ,of course  the SharpDX toolkit is not feature complete yet(no easy audio and input yet)) ,but i think it is a better course and more powerful step for the engine to work on  DirectX.


So was wondering if anyone needs  something like this...willing to share.

Dec 12, 2012 at 6:53 PM
Edited Dec 13, 2012 at 10:06 AM


Yes. I am interested in your work. Which version of farseer did you port?

I published an application for WP7.1 using farseer 3.3.1.
I planned to publish it too as windows 8 Appstore app,  so I added the monogame layer.
I was also hoping to port it to android, iOs.

But things played out different:

a. the windows 8 app crashes during certification (rendering problems, they sent me the screenshots).
So now I seriously doubt the additional XNA - monogame - directx layer.

b. the mono license for android/iOs is 300-400$ per year per platform.

c.  I don't like the feeling that XNA is be-ing made obsolete (at least it appears that way).

So far for the XNA/monogame/mono crush.

So I decided to focus on native stuff for wp8 and windows 8 appstore apps (i.e. say goodbye to XNA there). Better say goodbye early.

But I still prefer to continue developing the game logic in c#  in combination with the farseer core (without the screensysteem). I just like c# too much.

So my conclusion was to find out if I can use c# in combination with the direct3d layer on wp8.

Hoping that porting WP8 to Windows8 Appstore would be easy

(Since wp8 has less direct3d support then the windows8 appstore, I planned on starting with windows phone 8 instead of windows 8 appstore).

All this preferable in such a way I could reuse parts if I want to publish on WP7.8 if needed (which only has XNA).

And it appears you already did some work on that.

So yes I am interested.

Maybe there is room for two sample projects: a Farseer XNA sample project and an Farseer SharpDx samples project.
"Only" the screensystem differs. The gamelogic and physics could maybe be the same.


Dec 12, 2012 at 8:54 PM


Well i got the Hello World sample to work without any code changes almost ,only problem with SharpDx is there is no easy way of doing input at the moment ,but well that is incoming as far as i know ,also debugview is a bit iffy ,so i tried doing mono ...seems to work well on my surface ,but still not sure about all the stuff.

Dec 13, 2012 at 10:06 AM



Dec 13, 2012 at 10:06 AM
Edited Dec 13, 2012 at 10:09 AM

I just realised I don't need all the directx and XNA stuff for 2D.

I just studied the two microsoft examples (Marble maze) for WP8:

- One uses the C++ DirectXToolkit for 2D drawing the screensystem.

This would be inline with the 2d screensystem in the farseer XNA samples.

The animated objects are done with direct3d.

- The other uses XAML for the GUI. The animated objects are done with direct3d.

Looking at this, made me realise that if I don't need 3d objects, I probably can use XAML for rendering the 2D object shapes as well.

I saw some work on Silverlight/XAML in combination with farseer, but I think it is very straight forward. So I probably only need the farseer core lib and can do the rest using standard XAML.

If this works, it is pretty straight forward to develop 2D games that build on WP7.5, Wp7.8, WP8 and W8RT.

This looks promising. I can code my entire app in C# this way.

I can even use all the sensor/camera/video stuff from WP and W8RT in the apps making it more attractive.

The bad news is that I loose portability to android/iOs. But you can't have it all..

Dec 16, 2012 at 1:54 AM

Have in mind that Farseer Physics have 0 dependency on XNA since all the necessary classes are already included in the distribution. XNA is my favorite platform, that is why all our samples are written in it. Using Farseer Physics with SharpDX should not be a big problem if you use the class library version of Farseer Physics.

May 6, 2013 at 4:01 AM
The current download (3.3.1) does have problems with SharpDX and Windows 8. The Color struct in Microsoft.Xna.Framework.Graphics is forgotten, breaking it. (I'm trying SharpDX.Color; I'll likely forget to post if that fixes it.) Also, the serialization methods break; this one can be fixed by removing the file altogether.
Oct 10, 2013 at 7:55 PM
Where is the Color struct needed? The class library version seems to compile fine without it.