]> git.r.bdr.sh - rbdr/super-polarity/blob - SuperPolarityLinux/Game1.cs
Consolidate with mac project.
[rbdr/super-polarity] / SuperPolarityLinux / Game1.cs
1 #region Using Statements
2 using System;
3
4 using Microsoft.Xna.Framework;
5 using Microsoft.Xna.Framework.Graphics;
6 using Microsoft.Xna.Framework.Storage;
7 using Microsoft.Xna.Framework.Input;
8
9 #endregion
10
11 namespace SuperPolarityLinux
12 {
13 /// <summary>
14 /// This is the main type for your game
15 /// </summary>
16 public class Game1 : Game
17 {
18 GraphicsDeviceManager graphics;
19 SpriteBatch spriteBatch;
20
21 public Game1 ()
22 {
23 graphics = new GraphicsDeviceManager (this);
24 Content.RootDirectory = "Content";
25 graphics.IsFullScreen = true;
26 }
27
28 /// <summary>
29 /// Allows the game to perform any initialization it needs to before starting to run.
30 /// This is where it can query for any required services and load any non-graphic
31 /// related content. Calling base.Initialize will enumerate through any components
32 /// and initialize them as well.
33 /// </summary>
34 protected override void Initialize ()
35 {
36 // TODO: Add your initialization logic here
37 base.Initialize ();
38
39 }
40
41 /// <summary>
42 /// LoadContent will be called once per game and is the place to load
43 /// all of your content.
44 /// </summary>
45 protected override void LoadContent ()
46 {
47 // Create a new SpriteBatch, which can be used to draw textures.
48 spriteBatch = new SpriteBatch (GraphicsDevice);
49
50 //TODO: use this.Content to load your game content here
51 }
52
53 /// <summary>
54 /// Allows the game to run logic such as updating the world,
55 /// checking for collisions, gathering input, and playing audio.
56 /// </summary>
57 /// <param name="gameTime">Provides a snapshot of timing values.</param>
58 protected override void Update (GameTime gameTime)
59 {
60 // For Mobile devices, this logic will close the Game when the Back button is pressed
61 if (GamePad.GetState (PlayerIndex.One).Buttons.Back == ButtonState.Pressed) {
62 Exit ();
63 }
64 // TODO: Add your update logic here
65 base.Update (gameTime);
66 }
67
68 /// <summary>
69 /// This is called when the game should draw itself.
70 /// </summary>
71 /// <param name="gameTime">Provides a snapshot of timing values.</param>
72 protected override void Draw (GameTime gameTime)
73 {
74 graphics.GraphicsDevice.Clear (Color.CornflowerBlue);
75
76 //TODO: Add your drawing code here
77
78 base.Draw (gameTime);
79 }
80 }
81 }
82