]> Dogcows Code - chaz/carfire/blob - Project06/lobbyTest/lobbyTest/Game1.cs
login info added
[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 public Game1()
27 {
28 graphics = new GraphicsDeviceManager(this);
29 Content.RootDirectory = "Content";
30 Components.Add(new GamerServicesComponent(this));
31 }
32
33 /// <summary>
34 /// Allows the game to perform any initialization it needs to before starting to run.
35 /// This is where it can query for any required services and load any non-graphic
36 /// related content. Calling base.Initialize will enumerate through any components
37 /// and initialize them as well.
38 /// </summary>
39 protected override void Initialize()
40 {
41 // TODO: Add your initialization logic here
42 graphics.PreferredBackBufferWidth = 800;
43 graphics.PreferredBackBufferWidth = 600;
44 lbGui = new lobbyGUI();
45 base.Initialize();
46 }
47
48 /// <summary>
49 /// LoadContent will be called once per game and is the place to load
50 /// all of your content.
51 /// </summary>
52 protected override void LoadContent()
53 {
54 // Create a new SpriteBatch, which can be used to draw textures.
55 spriteBatch = new SpriteBatch(GraphicsDevice);
56 lbGui.LoadContent(Content, graphics);
57
58 }
59
60 /// <summary>
61 /// UnloadContent will be called once per game and is the place to unload
62 /// all content.
63 /// </summary>
64 protected override void UnloadContent()
65 {
66 // TODO: Unload any non ContentManager content here
67 }
68
69 /// <summary>
70 /// Allows the game to run logic such as updating the world,
71 /// checking for collisions, gathering input, and playing audio.
72 /// </summary>
73 /// <param name="gameTime">Provides a snapshot of timing values.</param>
74 protected override void Update(GameTime gameTime)
75 {
76 // Allows the game to exit
77 if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
78 this.Exit();
79
80 // TODO: Add your update logic here
81 lbGui.Update(gameTime);
82
83 base.Update(gameTime);
84 }
85
86 /// <summary>
87 /// This is called when the game should draw itself.
88 /// </summary>
89 /// <param name="gameTime">Provides a snapshot of timing values.</param>
90 protected override void Draw(GameTime gameTime)
91 {
92 GraphicsDevice.Clear(Color.CornflowerBlue);
93 spriteBatch.Begin(SpriteBlendMode.AlphaBlend);
94
95 lbGui.Draw(spriteBatch);
96
97 spriteBatch.End();
98 base.Draw(gameTime);
99 }
100
101 }
102 }
This page took 0.033237 seconds and 4 git commands to generate.