Click to Rate and Give Feedback
MSDN
MSDN Library
XNA Game Studio
XNA Game Studio 3.1
Programming Guide
Gamer Services
 How To: Initialize and Update the G...
Collapse All/Expand All Collapse All
XNA Game Studio 3.1
How To: Initialize and Update the Gamer Services Dispatcher
Describes how an application would use the GamerServicesDispatcher instead of the GamerServicesComponent for cases in which a program may not be using the XNA Framework application model or component infrastructure.

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

  • To make use of this component, add this line of code to the Game constructor:

    C#
    Components.Add(new GamerServicesComponent(this));

Manually Updating the Gamer Services System

In some cases a program might 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. Once, in the startup code for the application, call GamerServicesDispatcher.Initialize to initialize the gamer services subsystem.

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

    C#
    protected override void Update(GameTime gameTime)
    {
        GamerServicesDispatcher.Update();
        base.Update(gameTime);
    }
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker