Jump to content
  • Advertisement
Sign in to follow this  

C++ Model with C# View

This topic is 3092 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 was thinking about how you'd go about doing this sort of thing in regards to some kind of game editor. Such as having a WPF application with some rich UI, and a center window that would house the rendering, which would be done in unmanaged C++ and directx. Now the way I see it, is that data is going to have to go both ways. Such as - User clicks WPF UI to change some setting (which affects the rendering), which will then need to notify the c++ of that setting - User clicks the rendering window, to select say some object in 3d, the C++ code would then need to notify the WPF code, to display a window that shows that objects properties Do you think this could be done by a message system? So rather than a whole host of functions needing to be created to sync the two. Each has a single message loop like a win32 WndProc. But Im then wondering about what happens when you want to pass across a large class. Say for example, again, you wanted to view the objects properties in a WPF dialog when the object is selected in the view port, and makes a change. For this to happen, its going to need to; - C++ detect viewport has been clicked - C++ traces and selects the object from the scene - C++ Marshalls all object data and sends message to WPF - WPF recieves message, and creates window with data - User makes a change in that dialog - WPF sends message back to C++ of change - C++ recieves message and makes change Now, how should the data be passed? If I pass a pointer, thats going to cause all sorts of issues. Could a WPF application even make use of a pointer from c++ code that was of a polymorphic type? I gather that Multiple inheritance would be out of the question. So Im thinking I would just pass the data by value as a struct. Any advice on this kind of thing?

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!