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

Initializing and Updating Gamer Services

Automatically Updating the Gamer Services Dispatcher

The XNA Framework provides a GamerServicesComponent. This is a game component that automatically takes care of initializing and updating the gamer services dispatcher. To make use of this component, XNA Framework games need to add only one line of code to the Game constructor.

To automatically update the gamer services dispatcher

  • Add this line of code to the Game constructor:

    Components.Add(new GamerServicesComponent(this));

Manually Updating the Gamer Services System

In some cases, a program may not use the XNA Framework application model or component infrastructure. For this application, it is possible to call the GamerServicesDispatcher directly.

To manually initialize and update the gamer services system

  1. In the startup code for the application, call GamerServicesDispatcher.Initialize once to initialize the gamer services subsystem.

    protected override void Initialize()
        GamerServicesDispatcher.WindowHandle = Window.Handle;
  2. Call GamerServicesDispatcher.Update once every frame to update the gamer services system.

    protected override void Update(GameTime gameTime)

Community Additions

© 2015 Microsoft