Jump to content
  • Advertisement
Sign in to follow this  
schupf

DX10 in WPF?

This topic is 3821 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

Hi, I want to write a 3D-Editor (similar to Sandbox, just much much smaller and easier) for Windows Vista. I just looked into WPF and I am really fascinated by this approach. Unfortunately I have not found any demo or tutorial that tells me if it is possible to write a WPF application and use DirectX 10 to render into a WPF "Panel". Is this possible? And if yes, does anyone knows a sample which shows how this is done? And has anyone made some experience with WPF? Is it worth to delve deeper into WPF and a good idea to use WPF for a 3D Editor?

Share this post


Link to post
Share on other sites
Advertisement

Here's a recent journal post about the subject with a link to more info. It looks like we'll be able to use D3D surfaces as textures in WPF pretty soon, so it looks like a viable route. On the other hand, I don't know how well this would work with D3D10 (anyone?).

I looked around a bit and until that fancy interop becomes available, it seems that currently the best way would still be to add a WinForms host control to your WPF gui and have DX render to that. I don't have enough WPF experience to actually be sure about that though, so please correct me if I'm wrong [smile]

Share this post


Link to post
Share on other sites
I'm not as fluent in WPF as I'd like to be (still on my "todo" list [headshake]) but from my take on things you can't access D3D10 through it and I wouldn't expect that to change in the near future.

If you can get the WPF3.5sp1 release to talk via DXGI handles there may be a glimmer of hope, but otherwise you're better off assuming it's a D3D9 platform.

Remember that the core WPF technology is backwards compatable to WinXP and D3D10 won't ever exist there, so it'd be a fair design decision on the part of the WPF team to not include D3D10 support.


hth
Jack

Share this post


Link to post
Share on other sites
Well, I dont want to access D3D10 THROUGH WPF. I just want to use D3D10 IN a WPF application (actually I just want to render in a little panel of my editor via d3d10).
So it looks like there WILL be possibilites to use D3D10 in a WPF in the SP1 release, but currently its not possible? :(

So currently the best way to write a sandbox-like editor is to use WinForms I guess. But WinForms is Managed.. so is it possible to write the UI in .NET C# and the rendering to one WinForms Panel in C++ and DX10? Anyone ones sample applications?

Share this post


Link to post
Share on other sites
This is doable, but currently rather ugly. It may be better to stick with Windows Forms for now -- the problems are grounded in, among other things, the fact that WPF tries to make use of the graphics card as well, and issues concerning pixel ownership arise, &c.

(this is not D3D10-specific, either, it's equally annoying hosting a D3D9 interface inside a WPF application)

Share this post


Link to post
Share on other sites
Quote:
Original post by schupf
So currently the best way to write a sandbox-like editor is to use WinForms I guess. But WinForms is Managed.. so is it possible to write the UI in .NET C# and the rendering to one WinForms Panel in C++ and DX10? Anyone ones sample applications?


Sure, just pass the panel's window handle off to your C++ renderer and let it do its thing. You can pass it by either having your renderer in a DLL and exporting a standard C function that your managed code can pinvoke. If you need your managed control to have more interaction with your native renderer, you can make managed wrappers using C++/CLI (this is naturally a bit more involved).

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!