Example #1
0
        /// <summary>
        /// Loop through all the tests and save the images.
        /// </summary>
        /// <param name="gameTime">the game time.</param>
        protected override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            if (!ScreenShotAutomationEnabled)
            {
                return;
            }

            string testName;

            if (FrameGameSystem.AllTestsCompleted)
            {
                Exit();
            }
            else if (FrameGameSystem.IsScreenshotNeeded(out testName))
            {
                SaveBackBuffer(testName);
            }
        }
Example #2
0
        protected GameTestBase()
        {
            // Override the default graphic device manager
            GraphicsDeviceManager.Dispose();
            GraphicsDeviceManager = new TestGraphicsDeviceManager(this)
            {
                PreferredBackBufferWidth    = 800,
                PreferredBackBufferHeight   = 480,
                PreferredDepthStencilFormat = PixelFormat.D24_UNorm_S8_UInt,
                DeviceCreationFlags         = DeviceCreationFlags.Debug,
                PreferredGraphicsProfile    = new[] { GraphicsProfile.Level_9_1 }
            };
            Services.AddService <IGraphicsDeviceManager>(GraphicsDeviceManager);
            Services.AddService <IGraphicsDeviceService>(GraphicsDeviceManager);

            StopOnFrameCount        = -1;
            AutoLoadDefaultSettings = false;

            FrameGameSystem = new FrameGameSystem(Services);
            GameSystems.Add(FrameGameSystem);

            // by default we want the same size for the back buffer on mobiles and windows.
            BackBufferSizeMode = BackBufferSizeMode.FitToDesiredValues;
        }