managed directx

abishekgopal

New member
Joined
Mar 30, 2008
Messages
10
Reaction score
0
Points
0
hi guys this is my first post in this forum, sad to hear about the m6 forums:(,anyway , i've just started learning directx using c++ and i was wondering if the performance(read fps) of orbiter or any game will be affected if it was implemented in managed C# .Net instead of c++. i'm quite interested to learn c# and if i could combine that with directx programming ,it would be great. Wat's ur say?
 
It shouldn't matter that much, because in 3D games the upper limit is usually set by the video card, not CPU (unless you have really complex physics and collision detection). And video card is handled by DX itself, which doesn't care even if you write your app in Ruby or something. As usual, fast algorithms and efficient use of hardware capabilities (like VBO and such) will give you probably 90% of the maximum possible speed.

Orbiter itself is not written in .NET, however; so if you are planning to make addons, I'm not sure you can do that in C#.
 
A friend of mine tried to make a 3D game in C# and DirectX. He became increasingly frustrated over the course of the time, and eventually dumped the whole thing three weeks later, and gone back to C++.

Apparently, the managed code systems works with piteous performance unless you do things exactly by the paths and ways that is written in the books, in which case it performs quite well. C# is not too clear also, for example passing arrays by reference, and if the perceived code action and actual action is different, it could lead to dramatic fall of performance, or even headwallbusting bugs.

So, in my opinion, C# and managed code could be good to start learning how to do object-oriented code, but once you begin to code creatively, normal languages are much more preferable.

If you want to try Orbiter add-on development with .NET, here is a good starting point:
http://sourceforge.net/projects/orbiterdotnet/
I'm not sure if it's usable yet, but there seems to be no other.

And the game is not only 3D graphics done by GPU, any good game will also have a lot of CPU-driven code.
 
thanks for the reply guys.I'm currently doing my Bachelor's degree in Computer science. How important do you think learning c# and the .Net really is,for developing small or medium sized applications(hobby) and also for gettting a high paying job??:)


Btw, are there any directx programmers out there? I would like to have somebody who can answer my doubts in it. I'm quite OK with 3d vector math but dont have much knowledge about the fundamentals of rendering and stuff, Is it absolutely essential??
 
Apparently, the managed code systems works with piteous performance unless you do things exactly by the paths and ways that is written in the books, in which case it performs quite well.

What do you mean by "exactly by the paths and ways it's written in books"? With any language, you have to understand how it works to get any performance at all. Coding by the seat of your pants in C++ usually results not just in bad perfomance, but in access violations.

Of course, C# isn't just C++ with some new features. You can't really just jump in and start coding in C# just because you know C++. It is much more different from C++ than C++ is different from C. You have to learn it. So if you already have a good understanding of C++, but no intention to learn C# in depth, then you are better off staying with C++ (which is what I decided for myself).

And the game is not only 3D graphics done by GPU, any good game will also have a lot of CPU-driven code.

I'm not saying a game is only graphics. I'm saying that GPU, not CPU, often sets the upper bound on fps, unless you really have a lot of complex code.

The bottom line of what I'm saying is, people often worry about performance penalties of few percent, that are inherent to a higher-level language, and choose a lower-level language because of that - only to get much more serious penalties because lower-level language "distracts" you, with all the low-level stuff, from the big picture of writing efficient algorithms - which is really most important because O(log n) algorithm written in Ruby is more efficient than O(n^2) written in highly optimized assembly.

thanks for the reply guys.I'm currently doing my Bachelor's degree in Computer science. How important do you think learning c# and the .Net really is,for developing small or medium sized applications(hobby) and also for gettting a high paying job??:)

For hobby, you learn whatever makes you happy. But for a high-paying job, I think you're better off with learning web-development-oriented languages such as Ruby, Python, Perl, etc., maybe Java (assuming you even want to seek a high-paying job in software development). C/C++ is mostly domain of embedded systems and game development. There are tons of very proficient developers with decades of experience in embedded systems industry, so it isn't going to be easy to get in. Games industry might be easier, but for one company that really takes off there are hundreds mediocre ones and thousands that flunk, it's an industry where you work very hard not necessarily to make big money but just to stay afloat. Think for yourself if you want to be in there. C# is a peculiar animal, I don't see it as either web development language or embedded systems programming platform, besides it is rather different from both C++ and Java... as such, am not sure it has a niche for itself at all. If you want to go for .NET, you're probably better off learning ASP or VB. It is of course up to you to view my opinions as overly conservative or merely realistic.

Btw, are there any directx programmers out there? I would like to have somebody who can answer my doubts in it. I'm quite OK with 3d vector math but dont have much knowledge about the fundamentals of rendering and stuff, Is it absolutely essential??

Yes, it is of course essential because you need to work with it to get anything rendered. There's nothing terribly complicated in rendering fundamentals, however, and there are many articles on it online.
 
Last edited:
For hobby, you learn whatever makes you happy. But for a high-paying job, I think you're better off with learning web-development-oriented languages such as Ruby, Python, Perl, etc., maybe Java (assuming you even want to seek a high-paying job in software development). C/C++ is mostly domain of embedded systems and game development. There are tons of very proficient developers with decades of experience in embedded systems industry, so it isn't going to be easy to get in. Games industry might be easier, but for one company that really takes off there are hundreds mediocre ones and thousands that flunk, it's an industry where you work very hard not necessarily to make big money but just to stay afloat. Think for yourself if you want to be in there.
I'm learning DirectX only as a hobby . I don't intend to become a game programmer . For normal (non-web oriented ) applications ,which language do I investing in??


Yes, it is of course essential because you need to work with it to get anything rendered. There's nothing terribly complicated in rendering fundamentals, however, and there are many articles on it online.
Actually I meant learning theoritical concepts from books like "Computer Graphics " ,"Realtime Rendering" ,etc. Can those knowledge wait until i've got some grasp of DirectX?
 
I'm learning DirectX only as a hobby . I don't intend to become a game programmer . For normal (non-web oriented ) applications ,which language do I investing in??

I think C/C++ would still be better to learn for that, than C#. Still I think it's even better to learn web-oriented languages, because you're likely to find more companies willing to hire you for developing website than for developing a traditional application. But the choice is up to you of course. Look at the job websites like monster.com or similar to see what kind of positions are companies trying to fill in, and what kind of background are they requiring for those positions, and then think what you want to do based on that.

Actually I meant learning theoritical concepts from books like "Computer Graphics " ,"Realtime Rendering" ,etc. Can those knowledge wait until i've got some grasp of DirectX?

I think it's opposite - understanding of DirectX API can wait until you get an idea of general concepts. You'll get a bigger overall picture, and then you'll start understanding smaller details when learning DX. Otherwise you can get lost in small details which don't seem to mean anything by themselves, and just get all confused.
 
thanks for your enlightening reply Tomek . So should i go for ASP .Net and SQL server instead of c#? Or would it be even better if I learn for MCAD certification exam no 70-316 which includes developing windows appz with c#. net and also web based appz with ASP .net?
 
I don't know your situation, you should think and do research for yourself, it's your future after all. Here in US many employment opportunities are in relatively small companies that survive on online business, and they typically use as much free software as possible, to minimize costs. So you very often see a "LAMP business" (stands for "Linux Apache MySQL Perl", though it's not always Perl, might be PHP, Python, Ruby, or some other free scripting language, but I'm yet to see a company using ASP or C#. Maybe I'm looking in wrong places...). Both C# and ASP are MS technology; to use it, a company would have to buy Windows station with MSVS for every developer, run Windows on its servers, and so forth - it's rather a huge cost for a small company. The only company here I've seen doing that is MS itself - there you have everything Microsoft and only Microsoft, from software to keyboards to stupid posters on the walls...

So I don't know, look around, if things are different in your area, or if you plan to work in Microsoft, then definitely go ahead and learn C# or ASP, or both and some more. I'd stick with more traditional ones, but I'm not an oracle and can't say what's best for everyone.

ASP is kind of Microsoft's PHP, it's used for web development. Right now, if I was going into web development I wouldn't learn neither ASP nor PHP (I don't consider PHP to be worth called a language, the way it's designed; ASP is better, but I wrote about MS technologies earlier). Instead I'd learn Ruby, it's quite hot currently, and quite cool at the same time. But that's only me.
 
Back
Top