Monogame C# vs DirectX C++

I would like to know more about the comparison between MonoGame(C#) and DirectX(C++).
Specifically on windows 10 UWP.

  • Performance (Memory, FPS, Energy saving on the mobile, …)?
  • Usability (How easy it was to learn and develop with)?
  • Functionality?

And when should I use MonoGame(C#) or DirectX(C++)?
Exception: MonoGame(C#) vs Unity(C#): I think monogame performance is better. Is that correct?

I don’t think you grasp either concept… do some research and ask again…

Sorry for the stupid question!
Because I want to make a game and I’m wondering where to start. MonoGame(C#) or DirectX(C++).
I know that monogame uses both opengl and directx.
I found it: Why C# for game engine?. But I want to know DirectX(C++) more fast than MonoGame(C#)?. How much faster?

Not a stupid question, just a misplaced one, MonoGame/C# and DirectX/C++ are on a completely different playing field…

You could go ahead and develop with RAW DirectX, go for it… but that does not guarantee any speed other than your own capability…

MonoGame is a framework…

I do not have time to explain further today but hopefully someone can explain the concepts to you…

For the record, C# is practically on par speed wise, performance is down to the coder… [Speed and Performance again are two entirely different concepts] we are not in 1990 any longer…

2 Likes

I like it. Thank you very much! :grin:

1 Like

http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=csharpcore&lang2=gpp

so you see it’s about ~1.6 times as fast in these arithmetic programs. In others it may be even faster.

In most small code, like game code, the difference is less.

For gaming this is even less relevant, because your framerate mostly depends on your GPU, unless you run simulations. That means that your CPU has to wait for your GPU anyways in many cases (and vice versa).

What’s also relevant is not only how long the CPU takes to execute code, but also how long it takes you to write that code.

I’d argue that you save a lot of time by writing in c# compared to c++ (no header files, no memory troubles, great functionality with .net). This is even more relevant with monogame, since it takes away all the tedious ground work, like establishing the connection to the graphics card and converting asset files to readable code for the GPU.

If you go the DirectX route you will take a long time until you have a basic triangle on screen. Even more complicated with DirectX12.

On the other hand, if you chose to go with DirectX you will need to learn the whole graphics pipeline from the ground up, which can be exciting, too.

3 Likes

I just noticed you are Vietnamese! a friend is visiting Hanoi next week :stuck_out_tongue:

Ah and Welcome to the forums :slight_smile:

EDIT

Just to add to what @kosmonautgames said above…

MonoGame is faster for development time, as you can have your basic game world setup within a day or two, whereas in DirectX/C++… could be a month or more before you have the same level of development achieved…

1 Like

I would say you have to choose the right tool that fits the bests your skills and your goals(ie you have to know what your game needs to choose too) to achieve them in a reasonable time.
For ex, if C++ is faster, using it (assuming you already know how to create a window, configure the linker, using directx) will take you far more time than just using monogame…

I live and work in Hanoi. I’m working at a game company that uses cocos engine.
Maybe I will use MonoGame for the next project

Thanks everyone. Thank @MrValentine @kosmonautgames @Alkher

1 Like

That is so coincidental!!!

PM me if you don’t mind meeting this friend, I believe he is spending a week there…

I used to have a few Vietnamese friends before but then I moved…

MonoGame is great for cross platform game development, you just complete your project on one platform and then process it for each additional platform… With little work to do… Coco’s I feel is limited in capability… As it is 2D only still, correct?

Also, you have the entire .NET framework at your disposal :slight_smile:

Cocos is in no way limited and you can do 3d if you want. Monogame is a framework. Cocos is a Game engine, so is probably easier to make a game in Cocos. Cocos is also great for cross-platform development.

Cocos not use DirectX directly. It use Angel Project to connect DX with OpenGL ES. And I do not like that.
I want to control the whole logic of the game(graphics) more and remove the unused code that cocos provides. Create weird visual effects and enhance performance.

If you want to go that “low level” the monogame is certainly a great tool. However if you’re really concerned about performance and want to use C or C++. Take a look at Allegro5, SDL or SFML

1990 ?

Straight assembly language is faster then c, c is faster then c++ nananana.
Java is too slow it will be dead in a year.

No seriously they used to say all that.

I would not in good conscious recommend c++ dx to a new person with c# monogame around c++ alone is just difficult to learn just understanding the difference between pointers and references alone is a pain let alone things like double pointers ect. In c# we have all the same stuff like delegates and its safe and easy to use and about 10x easier to explain.

I personally cant stand to look at it anymore i feel like everything takes forever. The syntax bugs me as well. I would have to wrap everything i wrote in c++ to make it work like c#.

If that person were determined to though, i would however recommend the directx toolkit https://directxtk.codeplex.com/ as a starting point not simply diving into straight c++ directx…

If you look at this wrapper its pretty much what they are doing making c++ look like c# xna lol. Not surprising as these are the same guys who wrote xna Hargreaves and Walbourn.