-
Notifications
You must be signed in to change notification settings - Fork 7
/
PixelPlanets.cs
63 lines (53 loc) · 1.76 KB
/
PixelPlanets.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace ShadersTest
{
public class PixelPlanets : Game
{
private GraphicsDeviceManager _graphics;
private SpriteBatch _spriteBatch;
public PixelPlanets()
{
Renderer.RegisterGraphicsDeviceManager(new GraphicsDeviceManager(this) { GraphicsProfile = GraphicsProfile.HiDef });
GameContent.RegisterContent(Content);
}
protected override void Initialize()
{
base.Initialize();
Renderer.RegisterGraphics();
IsMouseVisible = true;
Window.Title = string.Format("{0} - {1}", Config.APP_NAME, Config.APP_VERSION);
Shaders.UpdateShader();
}
protected override void LoadContent()
{
Renderer.Initialize();
Fonts.LoadFonts();
}
protected override void UnloadContent()
{
}
protected override void Update(GameTime gameTime)
{
UserInput.Update();
State.Update();
Shaders.Update();
Export.Exporter.Update();
UserInterface.UI.Update();
GameUpdate();
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
UserInterface.UI.Draw();
base.Draw(gameTime);
}
private void GameUpdate()
{
// Exit() method is a member of Game, which this what this PixelPlanets class inherits on,
// therefore, the action is done here based on the state.ExitRequested flag
if (State.ExitRequested)
Exit();
}
}
}