]> Dogcows Code - chaz/carfire/blob - Project06/lobbyTest/lobbyTest/Game1.cs
Some basic text added to create game screen
[chaz/carfire] / Project06 / lobbyTest / lobbyTest / Game1.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
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;
13
14 namespace lobbyTest
15 {
16 /// <summary>
17 /// This is the main type for your game
18 /// </summary>
19 public class Game1 : Microsoft.Xna.Framework.Game
20 {
21 GraphicsDeviceManager graphics;
22 SpriteBatch spriteBatch;
23
24 lobbyGUI lbGui;
25
26 NetworkSession networkSession;
27 AvailableNetworkSessionCollection availableSessions;
28 int selectedSessionIndex;
29
30 public Game1()
31 {
32 graphics = new GraphicsDeviceManager(this);
33 Content.RootDirectory = "Content";
34 Components.Add(new GamerServicesComponent(this));
35 }
36
37 /// <summary>
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.
42 /// </summary>
43 protected override void Initialize()
44 {
45 // TODO: Add your initialization logic here
46 graphics.PreferredBackBufferWidth = 800;
47 graphics.PreferredBackBufferWidth = 600;
48 lbGui = new lobbyGUI();
49 base.Initialize();
50 }
51
52 /// <summary>
53 /// LoadContent will be called once per game and is the place to load
54 /// all of your content.
55 /// </summary>
56 protected override void LoadContent()
57 {
58 // Create a new SpriteBatch, which can be used to draw textures.
59 spriteBatch = new SpriteBatch(GraphicsDevice);
60 lbGui.LoadContent(Content, graphics);
61
62 }
63
64 /// <summary>
65 /// UnloadContent will be called once per game and is the place to unload
66 /// all content.
67 /// </summary>
68 protected override void UnloadContent()
69 {
70 // TODO: Unload any non ContentManager content here
71 }
72
73 /// <summary>
74 /// Allows the game to run logic such as updating the world,
75 /// checking for collisions, gathering input, and playing audio.
76 /// </summary>
77 /// <param name="gameTime">Provides a snapshot of timing values.</param>
78 protected override void Update(GameTime gameTime)
79 {
80 // Allows the game to exit
81 if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
82 this.Exit();
83
84 // TODO: Add your update logic here
85 lbGui.Update(gameTime);
86
87 base.Update(gameTime);
88 }
89
90 /// <summary>
91 /// This is called when the game should draw itself.
92 /// </summary>
93 /// <param name="gameTime">Provides a snapshot of timing values.</param>
94 protected override void Draw(GameTime gameTime)
95 {
96 GraphicsDevice.Clear(Color.CornflowerBlue);
97 spriteBatch.Begin(SpriteBlendMode.AlphaBlend);
98
99 lbGui.Draw(spriteBatch);
100
101 spriteBatch.End();
102 base.Draw(gameTime);
103 }
104
105 }
106 }
This page took 0.033113 seconds and 4 git commands to generate.