Embed XNA in WinForms

对着背影说爱祢 提交于 2019-11-27 05:54:46

问题


Is it possible to embed an XNA game in a C# WinForm or a C++ Window. If yes then How.

I want to use normal UI controls & have a windowed interface of the game for more interactive & dynamic simulations.


回答1:


The official samples:

  • XNA WinForms Series 1: Graphics Device
  • XNA WinForms Series 2: Content Loading



回答2:


I've had success doing this using the method described here:

XNA 3.0 and Winforms, the easy way

The blog post was written for XNA 3.0, but I had no problems using the same method with XNA 4.0.

It's very simple compared to the official Microsoft sample, but as this method is not officially supported, you should use it at your own risk. It worked perfectly in my case, and it required only minimal changes to the Game class.



来源:https://stackoverflow.com/questions/6558132/embed-xna-in-winforms

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