Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

Game Constructor

Initializes a new instance of this class, which provides basic graphics device initialization, game logic, rendering code, and a game loop.

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

public Game ()

Although the GraphicsDeviceManager constructor requires an instance of Game, if the application does not otherwise require an instance of Game it is often more desirable to implement the IGraphicsDeviceService interface to provide the same services that would be provided by the GraphicsDeviceManager.

Similarly, when creating a new ContentManager, if no instance of Game is otherwise required by the application, it is often more desirable to create a new class that implements the IServiceProvider interface rather than creating an instance of Game just to create a new instance of GraphicsDeviceManager.

/// <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
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.