Jump to content
  • Advertisement
Sign in to follow this  
rafalk

.NET vs clear C++ with WinAPI in game programming

This topic is 4129 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everyone, could you tell me what is better - programming in .NET or in clear C++ using WinAPI and DirectX/OpenGL? I heard that many people are migrating to .NET but why? C++ is faster than .NET library. Are there some new libraries for game programming?

Share this post


Link to post
Share on other sites
Advertisement
.NET has something like 98, or 99% of the speed of C++, so for most programming tasks, including most game development, the speed is not much of an issue at all. Also, I hear that the DirectX interface for Managed (.NET) programs is much cleaner.

C++ can be run as a .NET, managed, program, by the way.
Edit: never mind that last statement, you already know that, judging by your use of the word 'clear'.

Share this post


Link to post
Share on other sites
Because C# is a joy to work with. The IDE is leaps and bounds better. You spend far less time fighting the language and more time writing the game.

Share this post


Link to post
Share on other sites
The .Net languages are much, much more productive in general, for a few reasons: no manual memory management, a very rich library, and certain languages (notably C#) have support for first-class functions, which makes certain kinds of programming problems much easier to solve.

I prefer C# for almost all of my utilities and tools these days, unless it's some bit-twiddling or something that I can more comfortably do in C++.

Share this post


Link to post
Share on other sites
I second the C#-praising, but for completeness, .NET comes with a few considerations.

If your target audience is today's Windows user, then there's no contest. However, if you need to accommodate older versions of Windows (pre .NET framework) or other operating systems, then these managed languages will be of no use to you. In particular, for true cross-platformity, the most popular choice is C++ with OpenGL.

Admiral

Share this post


Link to post
Share on other sites
IMHO from a marketing perspective until most of your target audience have the .NET framework already installed by default (i.e. All running Windows Vista) then it's a question of whether you'd like to slap a .NET Framework 2.0 requirement on your product (Though you could mitigate this by installing the framework alongside your game's installation).

As for performance (not to be confused with productivity), if it's a big issue for your game genre then go for C++, otherwise, perhaps you can raise the bar on your game's hardware requirements? :)




Share this post


Link to post
Share on other sites
What has .NET specially that C++ doesn’t have - I have some kind of libraries in mind. What library has .NET which can help in game programming?

Share this post


Link to post
Share on other sites
XNA

Generally both C# and C++ have lots of existing libraries you can pick from for just about anything. You can write games in both languages. You'll just save lots of time if you use C#. I've made the switch in last december and I won't ever go back to C++ unless I get paid lots of money for it ;)

Share this post


Link to post
Share on other sites
Quote:
Original post by Eternal
XNA

Generally both C# and C++ have lots of existing libraries you can pick from for just about anything. You can write games in both languages. You'll just save lots of time if you use C#. I've made the switch in last december and I won't ever go back to C++ unless I get paid lots of money for it ;)


I switched to C# too since January. I really don't understand why I didn't do that earlier on. The advantage you gain against keeping up with C++ is just to big to ignore. The speed advantage you lose using C# + .NET is just trivial now, especially with the incoming Multi-core technologies.

There are some cases which I still need to use C++ to gain access to certain libraries only available to C++, but then I just write a wrapper and make it another CLR assembly :D (Reusability FTW).

Let even alone the advantage which let you work together with people who only program in Visual Basic for example.

Regards,

Xeile

Share this post


Link to post
Share on other sites
Quote:
Original post by TheAdmiral
I second the C#-praising, but for completeness, .NET comes with a few considerations.

If your target audience is today's Windows user, then there's no contest. However, if you need to accommodate older versions of Windows (pre .NET framework) or other operating systems, then these managed languages will be of no use to you. In particular, for true cross-platformity, the most popular choice is C++ with OpenGL.

Admiral


Someone's never heard of mono :)

I've had great success using SDL and OpenGL in c# on linux and mac os x.

At the moment, if you really plan things carefully, you can write games that work in windows xp (and whatever versions support .net 2.0), linux, mac os x, and the xbox 360.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!