How well does WPF blend with XNA in real life?

对着背影说爱祢 提交于 2019-11-28 04:46:02
Kris Erickson

There is an addition in 3.5 SP1 that allows better interaction between DirectX and WPF (D3DImage), and one way to get to that is through XNA.

Here are some details:

http://jmorrill.hjtcentral.com/Default.aspx?tabid=428&EntryID=259

XNA integration is high on our list of things to add to WPF so we're looking in to this for future versions. Stay tuned (to GregSc's blog) for the details as they become available.

Ian Ellison-Taylor

Read more about this here

Thamir Khason presented a excellent session about WPF/XNA/Silverlight at Tech-ed... Here is his slides: http://blogs.microsoft.co.il/blogs/tamir/archive/2008/04/14/my-teched-08-presentation-slides-download.aspx

PS. This was quite impressive to see... he had a game that ran on the xbox. On his desktop using WPF to host XNA and ons his mobile phone using silverlight all playing against each other!!!

You want to use a D3DImage, but D3DImage works different on windows XP vs windows Vista or 7.

On Vista or 7, you create a NON-lockable renderTarget to use with the D3DImage & you use a Direct3D9EX Device. On XP, you create a lockable renderTarget to use with the D3DImage & use a normal Direct3D9 Device.

Also insted of using XNA it might be better to use SlimDX if your just making this for the PC. SlimDX is not lacking any Direct3D features & supports Direct3D 9, 10 & 11.

http://slimdx.org/

I personally would advise against trying to do this integration. I know what you're going for ... the ease of defining GUI/HUD elements in WPF greatly outweighs trying to do the same in just plain old XNA. However, think realistically of the time you'll spend trying to enable this scenario vs. how much you'd save if you just did everything "natively" in XNA. Also (and this may not be an issue for you), WPF isn't supported on the xbox or zune ... so you'd be limiting yourself :-)

Hey I know this is a while after you posted but if you are still looking for a WPF solution for XNA you may want to keep an eye on http://red-badger.com/product. The XPF soloution puts wpf into XNA. SO have a look, at the moment it is free as it is in beta but that will be changing as they add more components

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!