2 using System.Collections.Generic;
4 using Microsoft.Xna.Framework;
5 using Microsoft.Xna.Framework.Audio;
6 using Microsoft.Xna.Framework.Content;
7 using Microsoft.Xna.Framework.GamerServices;
8 using Microsoft.Xna.Framework.Graphics;
9 using Microsoft.Xna.Framework.Input;
10 using Microsoft.Xna.Framework.Media;
11 using Microsoft.Xna.Framework.Net;
12 using Microsoft.Xna.Framework.Storage;
17 /// This is the main type for your game
19 public class Game1 : Microsoft.Xna.Framework.Game
21 GraphicsDeviceManager graphics;
22 SpriteBatch spriteBatch;
26 NetworkSession networkSession;
27 AvailableNetworkSessionCollection availableSessions;
28 int selectedSessionIndex;
32 graphics = new GraphicsDeviceManager(this);
33 Content.RootDirectory = "Content";
34 Components.Add(new GamerServicesComponent(this));
38 /// Allows the game to perform any initialization it needs to before starting to run.
39 /// This is where it can query for any required services and load any non-graphic
40 /// related content. Calling base.Initialize will enumerate through any components
41 /// and initialize them as well.
43 protected override void Initialize()
45 // TODO: Add your initialization logic here
46 graphics.PreferredBackBufferWidth = 800;
47 graphics.PreferredBackBufferWidth = 600;
48 lbGui = new lobbyGUI();
53 /// LoadContent will be called once per game and is the place to load
54 /// all of your content.
56 protected override void LoadContent()
58 // Create a new SpriteBatch, which can be used to draw textures.
59 spriteBatch = new SpriteBatch(GraphicsDevice);
60 lbGui.LoadContent(Content, graphics);
65 /// UnloadContent will be called once per game and is the place to unload
68 protected override void UnloadContent()
70 // TODO: Unload any non ContentManager content here
74 /// Allows the game to run logic such as updating the world,
75 /// checking for collisions, gathering input, and playing audio.
77 /// <param name="gameTime">Provides a snapshot of timing values.</param>
78 protected override void Update(GameTime gameTime)
80 // Allows the game to exit
81 if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
84 // TODO: Add your update logic here
85 lbGui.Update(gameTime);
87 base.Update(gameTime);
91 /// This is called when the game should draw itself.
93 /// <param name="gameTime">Provides a snapshot of timing values.</param>
94 protected override void Draw(GameTime gameTime)
96 GraphicsDevice.Clear(Color.CornflowerBlue);
97 spriteBatch.Begin(SpriteBlendMode.AlphaBlend);
99 lbGui.Draw(spriteBatch);