Jump to content
  • Advertisement
Sign in to follow this  
Mulligan

[.net] Wraping lots of unmanaged code in a managed layer

This topic is 4827 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 have an engine written entirely in c++ with pure virtual classes exported from dlls to represent each of the major engine components i.e (video, audio, input, etc). The game itself if written in c++ as well, so thats no problem. The editor on the other hand, I will be writing in managed C#. I've had some experience in calling unmanaged code from managed code, but not on a large scale. Are there any general stratagies for attacking this problem?

Share this post


Link to post
Share on other sites
Advertisement
The best way imo is to have an engine with a single point of contact and write a managed C++ wrapper. From there you can just use the wrapper with C#.

I have done this in the past with my engine and it works great for the editor, and I know of at least one major engine that does this as well.

Share this post


Link to post
Share on other sites
After reading those articles posted above, thats what I'm going to do. I have several clearly defined interfaces to each engine component, but it seems the hard part is going to be duplicating the structures that my engine interfaces accept as parameters.

Share this post


Link to post
Share on other sites
Actually, ive got one more question.

I fully intend to keep the actual engine code to be unmanaged. Also, after reading all of those documents, it seems that if I structured my engine using COM interfaces, the .NET portability issues would be largely eliminated, and future enhancements to the engine would be very easy to use in .NET.

I've never created COM components before, but have read lots of material on the subject, so im fairly familiar with the process.

Do you think its worth it to convert my engine to COM?

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!