How To: Display a Game in Full-Screen Mode

This example demonstrates how to start a game in full-screen mode.

The Complete Sample

The code in this tutorial illustrates the technique described in the text. A complete code sample for this tutorial is available for you to download, including full source code and any additional supporting files required by the sample.

To Start a Game in Full-Screen Mode

  1. Derive a class from Game.
  2. After creating the GraphicsDeviceManager, set its PreferredBackBufferWidth and PreferredBackBufferHeight to the desired screen width and height.
  3. Set IsFullScreen to true.

    public Game1()
    { = 1280; = 720;
    = true;

Community Additions