XNA: get screen’s width and height

Empirically I’ve found that in XNA 4.0 I need to use

GraphicsDevice.Viewport.Width
GraphicsDevice.Viewport.Height

when running windowed mode, as I find

GraphicsDevice.DisplayMode.Width
GraphicsDevice.DisplayMode.Height 

gives me the resolution of the entire screen.

Hopefully this helps someone else out.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)