Jump to content

  • Log In with Google      Sign In   
  • Create Account

DirectX 11 as DLL + WPF for UI


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 BlackJoker   Members   -  Reputation: 531

Like
0Likes
Like

Posted 06 March 2013 - 09:05 AM

Hello,

 

I want to start developing my own game editor and I want to use WPF for UI part. 

 

As far as I use DirectX 11, I have some troubles with connecting DX 11 to WPF.

 

I know that exists 2 methods:

1) using WinForms control inside WPF

2) using D3DImage.

But D3DImage using only DirectX 9 and I cannot find solution that clearly describes what I need to do to get DX 11 work via D3DImage.

 

What would you advice in my case? Which variant is better?

And if you use 2nd variant, please, provide me code for interop with DX11 via D3DImage.

 

Thanks in advance.



Sponsor:

#2 tweduk   Members   -  Reputation: 144

Like
1Likes
Like

Posted 06 March 2013 - 10:59 AM

There is a third method, which is to use a HwndHost control. I'm currently using this for an application that I'm working on and it appears to work and meet my needs so far. The main drawback is that most Win32 messages directed to the HWND in the HwndHost are not automatically forwarded to WPF, so I have to actually raise mouse events etc. myself.

 

Regarding WindowsFormsHost, I haven't tried it but I heard about it after implementing a HwndHost-based DX11Host class. It actually looks like it might be a better method than HwndHost. I may get around to trying this at some point, but I don't see why it won't work.

 

I have heard of people using a shared surface technique, where you create a D3D9 render target, which should be straightforward in WPF, and somehow getting a D3D11 handle to it. Apparently this works only in Windows 7 or later. I haven't tried this myself, but see

 

http://msdn.microsoft.com/en-gb/library/windows/desktop/ff476531(v=vs.85).aspx



#3 BlackJoker   Members   -  Reputation: 531

Like
0Likes
Like

Posted 07 March 2013 - 03:38 AM

Thanks for the answer. In that case I will try to implement variant with WinForms control inside WPF window.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS