Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 /// <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);
 }
Exemplo n.º 3
0
 public static void Resume()
 {
     GameUpdater.Start();
 }
Exemplo n.º 4
0
 public static void Pause()
 {
     GameUpdater?.Pause();
 }
Exemplo n.º 5
0
 private static void Initialized(object sender, EventArgs e)
 {
     Debugging.DrawBounds = true;
     Debugging.Log(LogEntryType.Info, "Starting GameUpdater...");
     GameUpdater.Start();
 }