public static void Run(GameWindow gameWindow, string appDataPath) { AppDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), appDataPath); GameWindow = gameWindow; Renderer = new Renderer(); GameUpdater = new GameUpdater(); IsProcessActive = true; Renderer.DrawDebugInfo = true; Renderer.Run(); GameUpdater.RunGameUpdater(); GameWindow.OnCreate(); Application.Run(GameWindow); }
/// <summary> /// Exits the game with specified exit code (0 = No error or exception, otherwise indicates game crashed) /// </summary> /// <param name="exitCode">Exit code</param> public static void Exit(int exitCode) { Debugging.Log(LogEntryType.Info, "Exiting game..."); Debugging.Log(LogEntryType.Info, "Stopping GameUpdater..."); GameUpdater.Stop(); if (exitCode != 0) { Debugging.Log(LogEntryType.Warning, "Game exited with exit code " + exitCode.ToHexademicalStringWithPrefix()); } else { Debugging.Log(LogEntryType.Info, "Game exited with exit code " + exitCode.ToHexademicalStringWithPrefix()); } Environment.Exit(exitCode); }
public static void Resume() { GameUpdater.Start(); }
public static void Pause() { GameUpdater?.Pause(); }
private static void Initialized(object sender, EventArgs e) { Debugging.DrawBounds = true; Debugging.Log(LogEntryType.Info, "Starting GameUpdater..."); GameUpdater.Start(); }