Export (0) Print
Expand All

Game.Run Method

Call this method to initialize the game, begin running the game loop, and start processing events for the game.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

public void Run ()

Exception typeCondition
InvalidOperationException Run has been called multiple times in the same application.
ArgumentException

Invalid arguments have been requested for the creation of the graphics device.

Invalid back buffer options have been requested:

Invalid PresentationParameters.PresentationInterval or SwapEffect options have been requested:

Invalid multisampling options have been requested:

Invalid depth stencil options have been requested:

IsFullScreen is true, but:

IsFullScreen is false, but:

This method calls the game Initialize and BeginRun methods before it begins the game loop and starts processing events for the game.

static class Program
{
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    static void Main(string[] args)
    {
        using (Game1 game = new Game1())
        {
            game.Run();
        }
    }
}

Xbox 360, Windows XP SP2, Windows Vista, Zune

Community Additions

ADD
Show:
© 2014 Microsoft