Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

How To: Display a Game in Full-Screen Mode

Demonstrates how to start a game in full-screen mode.

The 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

  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()
    {
        this.graphics.PreferredBackBufferWidth = 1280;
        this.graphics.PreferredBackBufferHeight = 720;
    
        this.graphics.IsFullScreen = true;
    }
    

Community Additions

ADD
Show:
© 2015 Microsoft