Jump to content
  • Advertisement
Sign in to follow this  
Kija

OpenGL Managed DirectX

This topic is 4730 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

I'm pretty new to DX but I've been using C++ / OpenGL a bit. I've browsed this forum and other sites for some time now and I stumble upon it all the time, Managed DirectX, Managed C++, C#, .NET. And to me, it's all a mystery. I can see the difference between C++ and C#, but is C# always "managed" and C++ can be "managed"? And primarily, what is meant by "managed"? I can't really find any good explanation of all these terms so if someone could point me to one it would be great. To my understanding managed directx / c# has the advantage of easier developing but a small performance hit. I've read that it should be ~95% of native code. That doesn't seem bad at all. I want to create fast and nice games, mainstream like world of warcraft, doom3 and so on, is Managed DirectX + C# something for me? Will Vista / DX10 be more focused on Managed DirectX + C#? Many questions :) Hopefully some of them can be answered. Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Kija
And primarily, what is meant by "managed"?

"Managed code" is code written in a language [variant] that targets the .NET Common Language Runtime (CLR). It is called managed because a number of low-level operations are mediated, such as memory management and system access/interaction, in such a way as to mitigate the risks of unexpected behavior within the code - to "manage" the behavior of the code.

C# is not always managed. Using __unsafe blocks you can gain direct access to pointers and other low-level facilities; such code is not managed by the CLR. C++/CLI is a variant on C++ that is essentially a suite of extensions to the language that allow it to target a managed code environment (it replaces earlier extensions such as "Managed C++" and "C++ .NET").

Quote:
I want to create fast and nice games, mainstream like world of warcraft, doom3 and so on, is Managed DirectX + C# something for me?

To rival those games in sheer performance, you'll probably need C++ at some point. The Managed DirectX environment is rapidly gaining maturity, but still lags behind the C++ interfaces in features and documentation. Keep in mind, however, that managed code is language agnostic, so you can write the majority of your game in C# - or even all of it at first - and then write or rewrite performance-critical portions in C++/CLI.

Quote:
Will Vista / DX10 be more focused on Managed DirectX + C#?

Yes, but not to the exclusion of "unmanaged" DirectX. Also, don't think that using Managed DirectX requires C#; you can use it from any managed code-capable language, such as VB.NET, Iron Python, FORTRAN.NET (!)...

(Okay, just because you can doesn't necessarily make it a good idea.)

Share this post


Link to post
Share on other sites
Thanks for that explanation, I understand it much better now.

I will certainly try it out, at least to get to know it better. There are some parts that I still don't really understand.

Do I need a special DirectX SDK for managed directx?
Is the syntax different? I guess it have to be...

Quote:
Original post by Oluseyi
Keep in mind, however, that managed code is language agnostic, so you can write the majority of your game in C# - or even all of it at first - and then write or rewrite performance-critical portions in C++/CLI.


How does this work? Is it a __unsafe block and then it's pure old C++ in the block or exactly how does this "merge" work?

Share this post


Link to post
Share on other sites
Quote:

Do I need a special DirectX SDK for managed directx?

The DirectX SDK that you download from the Microsoft site is all you need for native DirectX and Managed DirectX development.

Quote:

Is the syntax different?

The syntax is different as it follows the .NET naming scheme and you will use C# or another .NET language.

Quote:

How does this work? Is it a __unsafe block and then it's pure old C++ in the block or exactly how does this "merge" work?

c++/CLI, being a common language infrastructure allows you to write code in different languages in one project. I am assuming this is what Oluseyi meant. This means that you can write certain parts of your project in c++ and other parts in C#.

I hope this helps.
Take care.

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!