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