Jump to content
  • Advertisement
Sign in to follow this  
CrazyS

[.net] .NET and DirectX

This topic is 4581 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 am designing a "physics playground" in Visual Studio 2005 using DirectX and the Tokamak Physics Library. I need a little clearing up on how exactly the .NET framework can be used to make developing large-scale applications easier and what language I should be programming in. As of now I have a great deal of experience in C and C++. All windows applications I have made have been programmed in C++ using MFC. Although that is supposed to make the project simpler than just using the Win32 API some things are still rather difficult. It is a very complicated process to create menus with icons and to use XP styles for all controls and to make XP style toolbars etc. As I understand .NET can make it easier to create a nice looking UI very easily. That's all well and good but I also need this application to run fast 3D logic and graphics code which I would like to program in unmanaged C++ and still be compatible with unmanaged DirectX. Is this possible? Does this seem like a reasonable solution. How do I go about integrating the two. I'm not really looking for a step-by-step guide. I'm just looking for an explination of .NET and how it can be used to improve my project. A final note, for those of you who have used Maya or 3D Studio Max, I would like my program to be similar to them. The toolbar wil have large true-color icons and will have multiple tabs for drawing different types of primitives, etc. There will also be a tabbed dialog on the right side for editing the properties of specific objects, the scene, and simulations. The main canvas will have four viewports for modeling the simulation. Designing something like this with MFC in C++ will be a huge annoyance so that is why I am looking to .NET. Thank you in advance for any help, suggestions, etc.

Share this post


Link to post
Share on other sites
Advertisement
Well, you have three options here afaik. You could expose your unmanaged code through COM, which will allows you to just use it right away in C#, but this seems to be the least common approach. I can only guess that using COM for this is too complex, since what people mostly seem to be using is:

c++/cli, bascially c++, but with extension to easiliy interoperate with managed objects (similar to the old managed c++, but reportedly with a much cleaner syntax).

pinvoke, a facility from the .NET platform to call native code directly from managed code.

Share this post


Link to post
Share on other sites
I'd suggest you simply jump right in to C#, using managed directX (the .net directx api). You will find and performance differences to be pretty much zero (unless you make a mistake with garbage collection). The time savings however are quite significant. .NET does take a bit of getting used to, and you may miss some of the lower level managment you do in C++ (initally at least).

managed directx, in some cases, can actually be faster than unmanaged directX. Although it depends somewhat on the situation.

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!