如何使用XNA在WPF? [英] How to use XNA in WPF?

查看:261
本文介绍了如何使用XNA在WPF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以...我想打一场比赛,我希望把它写在C#。在过去,我一直使用C ++和OpenGL做了马里奥克隆。我很喜欢OpenGL的,但我不知道它是如何以及内部C#/ WPF支持。另外,它可能是有益的使用实际的游戏库?我猜是XNA的的游戏库,C#,所以也许我会投资一点时间学习了。

So... I want to make a game, and I want to write it in C#. In the past, I've made a mario clone using C++ and OpenGL. I quite like OpenGL, but I don't know how well it's supported inside C#/WPF. Also, it might be beneficial to use an actual game library? I guess XNA is the game library for C#, so maybe I'll invest a bit of time learning that.

不过,我想用WPF窗体控件我的关卡编辑器...有,我可以嵌入一个WPF应用程序内的XNA(的DirectX?)窗口中的任何方式?

However, I want to use WPF form controls for my level editor... is there any way that I can embed an XNA (DirectX?) window inside a WPF app?

具体来说,我不需要任何按钮或事物的 的XNA的/ DirectX的窗口小部件里面,只是 的身边,所以不需要混合...只需要得到一个图形在我的WPF窗体部件。

Specifically, I don't need any buttons or things inside the XNA/DirectX widget, just around it, so no mixing required...just need to get a graphics widget in my WPF form.

推荐答案

Nick Gravelyn解释如何做到这一点在他的博客

尽管如此,如果它只是一个编辑器,你会发现使用的WinForms 是更容易,更好的支持。

Although, if it's just for an editor, you may find using WinForms is easier and better supported.

这篇关于如何使用XNA在WPF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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