SlimDX视口在WPF控件 [英] SlimDX viewports in WPF controls

查看:642
本文介绍了SlimDX视口在WPF控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是从的WinForms转换/ XNA到WPF / SlimDX因为:

I am transitioning from WinForms/XNA to WPF/SlimDX because:


  • a)所有的WPF超过$ B $的好处b的WinForms(但学习曲线=哎哟!)

  • 二)我想有连接到多个面板
    SlimDX视口。
    XNA有1个游戏画面。

  • C,最后和最不)支持DirectX 10

所有我以前的XNA代码在C#。我有麻烦搞清楚如何在高水平上这个端口到SlimDX和WPF。我已搜查像疯了似的。我发现最接近的是:

All of my previous XNA code is in C#. I am having trouble figuring out how to port this over to SlimDX and WPF on a high level. I have searched like crazy. The closest I have found are:

1)的 http://www.gamedev.net/community/forums/topic.asp?topic_id=507941
许多文章指出这次讨论中,但它是不完整的,我想不通的,XAML,我附上所有的留在外面的_slimDXDevice和窗口1事件后获得设备错误

1) http://www.gamedev.net/community/forums/topic.asp?topic_id=507941 Many articles point to this discussion, however it is incomplete and I can't figure out the XAML, and I get device errors after attaching all of the _slimDXDevice and Window1 events that were left out.

2)的 http://www.codeproject.com/KB/WPF/D3DImage.aspx
本文假定用户是移植的C ++。我移植XNA代码,这是非常接近的MDX代码。

2) http://www.codeproject.com/KB/WPF/D3DImage.aspx This article assumes the user is porting C++. I am porting XNA code which is very close to MDX code.

如果我能得到的地方,我有一个自定义的SlimDX驱动视这仅仅是一个WPF的形​​式点一个蓝色的箱子,我可以去从那里。在XNA我使许多独立RenderTargets,放在他们都在屏幕上,现在我想将其连接到控制。但首先,仅有1蓝盒子! :D

If I could get to the point where I have a WPF form with a custom SlimDX driven viewport that was just a blue box, I could go from there. In XNA I rendered many separate RenderTargets and placed them all over the screen, now I want to attach them to controls. But first, just 1 blue box! :D

任何想法?我觉得这是简单的或者说有我就是缺少一些俗套的代码。不胜感激!

Any ideas? I feel that this is either simple or that there's some "cookie cutter" code that I'm missing. Greatly appreciated!

推荐答案

您可以在样本看现在。它刚刚在我们的库中检出,所以你需要使用SVN得到它(或者等待我们的船在2010年2月发布):

You can look at the sample now. It's just been checked in to our repository, so you'll need to use SVN to get it (or wait until we ship the Feb 2010 release):

http://code.google.com/p/slimdx/source/detail?r=1356

这篇关于SlimDX视口在WPF控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆