Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
TestGameBase.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 
4 using SiliconStudio.Core.Diagnostics;
5 using SiliconStudio.Paradox.Games;
6 
7 namespace SiliconStudio.Paradox.Graphics.Regression
8 {
9  public class TestGameBase : Game
10  {
11  public static readonly Logger TestGameLogger = GlobalLogger.GetLogger("TestGameLogger");
12 
13  public int StopOnFrameCount { get; set; }
14 
15  public TestGameBase()
16  {
17  // Enable profiling
18  //Profiler.EnableAll();
19  GraphicsDeviceManager.PreferredBackBufferWidth = 800;
20  GraphicsDeviceManager.PreferredBackBufferHeight = 480;
21  GraphicsDeviceManager.PreferredDepthStencilFormat = PixelFormat.D24_UNorm_S8_UInt;
22  GraphicsDeviceManager.DeviceCreationFlags = DeviceCreationFlags.Debug;
23  GraphicsDeviceManager.PreferredGraphicsProfile = new[] { GraphicsProfile.Level_9_1 };
24  StopOnFrameCount = -1;
25  }
26 
27  protected override void Update(GameTime gameTime)
28  {
29  base.Update(gameTime);
30 
31  if (gameTime.FrameCount == StopOnFrameCount)
32  {
33  Exit();
34  }
35  }
36  }
37 }
Main Game class system.
Definition: Game.cs:32
Base implementation for ILogger.
Definition: Logger.cs:10
Current timing used for variable-step (real time) or fixed-step (game time) games.
Definition: GameTime.cs:31
int FrameCount
Gets the current frame count since the start of the game.
Definition: GameTime.cs:97
override void Update(GameTime gameTime)
Reference page contains links to related conceptual articles.
Definition: TestGameBase.cs:27