public void Start(string host, bool userConfigure, bool debugSettings)
{
// HACK: Use an English culture so that Axiom.Overlays.Elements.BorderPanel works.
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
// HACK: Get assembly Axiom.Platforms.Win32.dll loaded before any dynamically created assembly.
// This is to avoid an exception getting thrown from the Root constructor.
System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(typeof(Axiom.Platforms.Win32.Win32InputReader).TypeHandle);
var service = Connect(host);
var configuration = ConfigurationManagerFactory.CreateDefault();
using (var root = new Root("MOOLGOSS.log"))
using (Globals.Input = new Input())
{
root.RenderSystem = root.RenderSystems[0];
root.RenderSystem.ConfigOptions["VSync"].Value = "Yes";
root.RenderSystem.ConfigOptions["Full Screen"].Value = "Yes";
var bestMode =
root.RenderSystem.ConfigOptions["Video Mode"].PossibleValues
.Where(x => x.Value.Contains("32-bit color"))
.LastOrDefault().Value;
if (bestMode != null) root.RenderSystem.ConfigOptions["Video Mode"].Value = bestMode;
if (debugSettings)
{
root.RenderSystem.ConfigOptions["Full Screen"].Value = "No";
root.RenderSystem.ConfigOptions["Video Mode"].Value = "800 x 600 @ 32-bit color";
}
if (userConfigure && !configuration.ShowConfigDialog(root)) return;
var window = CreateRenderWindow(root.RenderSystem.ConfigOptions["Video Mode"].Value == "Yes");
Globals.Input.Initialize(window, ownMouse: !debugSettings);
ResourceGroupManager.Instance.AddResourceLocation("Media", "Folder", true);
ResourceGroupManager.Instance.InitializeAllResourceGroups();
Globals.Scene = root.CreateSceneManager(SceneType.Generic);
Globals.UI = new UserInterface();
Globals.UI.AddMode(new TitleScreen());
Globals.UI.AddMode(new Gameplay(service));
Globals.UI.AddMode(new Docked());
Globals.UI.SetMode("Title Screen");
CreateCamera(window);
root.FrameStarted += FrameStartedHandler;
root.StartRendering();
}
}