Sign in to follow this  
Mulligan

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

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this