如何使用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.
尽管如此,如果它只是一个编辑器,你会发现使用的WinForms 是更容易,更好的支持。
Although, if it's just for an editor, you may find using WinForms is easier and better supported.