XNA – Display a Game in Full-Screen Mode
June 22, 2009 5:03 AMThe Complete Sample
The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.
Starting a Game in Full-Screen Mode
To start a game in full-screen mode
-
Derive a class from Game.
-
After creating the GraphicsDeviceManager, set its PreferredBackBufferWidth and PreferredBackBufferHeight to the desired screen width and height.
-
Set IsFullScreen to true.
C#
public Game1()
{
this.graphics.PreferredBackBufferWidth = 800;
this.graphics.PreferredBackBufferHeight = 600;
this.graphics.IsFullScreen = true;
}
http://msdn.microsoft.com/en-us/library/bb195024.aspx
Categorised in: XNA