/// <summary> /// run Initialize logic, start gametime, and start the main loop /// </summary> public void Run() { gameStopwatch.Start(); DrawEngine.InitializeScreen(); Initialize(); GameLoop(); }
//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(); } }