Jump to content
  • Advertisement
Sign in to follow this  
duhroach

DX + Windows Forms..

This topic is 5119 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've reached the point that I need to start making tools for my current engine. I was reading about the new Windows Forms, and decided to use them over MFC. What I'm running into however, is that Windows Forms wants you to use Managed Directx, which doesn't at all fit in with my current rendering abstraction. Can anyone help me out in understanding how to pull up unmanaged directx in windows forms using c++? Any help would be appriciated. ~Main

Share this post


Link to post
Share on other sites
Advertisement
What Coder means is that you can pass a "Handle" property (just a member variable) which is a hWnd from the managed part to the unmanaged part to use when creating the Device. Just pass it as a *void and cast it back. Works fine for me. Doesn't have to be of the main window itself either, it can just be one of the panels in the form too.

About using WinForms with unmanaged code in general, you have a few options. You can write the managed part in a different project and access the unmanaged part via P/Invoke or you can write you unmanaged part a managed wrapper or you can wrap your unmanaged part as a COM object. I don't know which is best; I'm trying them out myself ;)

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!