XNA:获取屏幕&x27;s的宽度和高度

XNA:获取屏幕&x27;s的宽度和高度,xna,fullscreen,Xna,Fullscreen,如何在XNA中获得整个屏幕的宽度和高度?似乎就是这样(我自己在谷歌上搜索“XNA屏幕宽度-高度”): 根据经验,我发现在XNA4.0中我需要使用 GraphicsDevice.Viewport.Width GraphicsDevice.Viewport.Height 当运行窗口模式时,我发现 GraphicsDevice.DisplayMode.Width GraphicsDevice.DisplayMode.Height 给我整个屏幕的分辨率 希望这能帮助其他人。GraphicsDevi

如何在XNA中获得整个屏幕的宽度和高度?

似乎就是这样(我自己在谷歌上搜索“XNA屏幕宽度-高度”):


根据经验,我发现在XNA4.0中我需要使用

GraphicsDevice.Viewport.Width
GraphicsDevice.Viewport.Height
当运行窗口模式时,我发现

GraphicsDevice.DisplayMode.Width
GraphicsDevice.DisplayMode.Height 
给我整个屏幕的分辨率


希望这能帮助其他人。

GraphicsDevice.Viewport.Bounds-返回矩形2D,它有宽度和高度参数。

这正是我想要的;窗户的宽度/高度是另一回事。
GraphicsDevice.DisplayMode.Width
GraphicsDevice.DisplayMode.Height