使用XNA在多台显示器上全屏显示
我正在使用XNA构建一个特殊的应用程序,该应用程序是为具有多台显示器的计算机而设计的.问题是,如果我告诉我的XNA应用程序变为全屏,则它仅覆盖主屏幕.如何确保我的应用程序在所有屏幕上全屏运行?
I'm building a special application with XNA that is made for computers with multiple monitors. The problem is that if I tell my XNA application to become fullscreen, it only covers the main screen. How can I make sure that my application runs full screen across all of the screens?
这听起来并不简单.当屏幕的分辨率和纵横比不同时会发生什么?您必须分别为每个屏幕创建一个rendertarget.无法将它们全部可靠地划分为一个大矩形.看看 GraphicsAdapter 类,它应该管理所有可用的图形适配器.我从来没有在游戏中使用多显示器,但这就是我的起点.查看是否可以创建多个图形设备或至少在绘制调用之间切换适配器,以将不同的目标渲染到不同的屏幕.
This doesn't sound trivial at all. What happens when the screens are varying resolutions and aspect ratios? You'll have to create a rendertarget for each of the screens individually. There's no way to mesh them all into one giant rectangle reliably. Have a look at the GraphicsAdapter class, which should manage all of the graphics adapters available. I've never used multimonitor in a game but that's where I'd start. See if you can create multiple graphics devices or at least switch adapters between draw calls in order to render different targets to different screens.