예제 #1
0
 /// <summary>
 /// run Initialize logic, start gametime, and start the main loop
 /// </summary>
 public void Run()
 {
     gameStopwatch.Start();
     DrawEngine.InitializeScreen();
     Initialize();
     GameLoop();
 }
예제 #2
0
 //Can't figure out a way to prevent the user from changing the window size.
 //If we don't allow resize, just reset the size back where we want it.
 private void CheckForResize()
 {
     if (Console.WindowWidth != CurrentSettings.WindowWidth || Console.WindowHeight != CurrentSettings.WindowHeight)
     {
         if (CurrentSettings.AllowResize)
         {
             CurrentSettings.WindowWidth  = Console.WindowWidth;
             CurrentSettings.WindowHeight = Console.WindowHeight;
             CurrentSettings.Apply();
             OnWindowResize?.Invoke(this, new WindowResizedEvent());
         }
         else
         {
             CurrentSettings.Apply();
         }
         DrawEngine.InitializeScreen();
     }
 }
예제 #3
0
 private void DrawInternal(GameTime gameTimeForDraw)
 {
     Draw(gameTimeForDraw);
     DrawEngine.DrawScreen();
 }