public Game1() { Game1.OriginalCultureInfo = CultureInfo.CurrentCulture; Game1.culture = new CultureInfo("en-US"); Thread.CurrentThread.CurrentCulture = Game1.culture; Thread.CurrentThread.CurrentUICulture = Game1.culture; Game1.threadsExiting = false; this.graphics = new GraphicsDeviceManager((Game)this); this.Content.RootDirectory = "Content"; this.graphics.DeviceDisposing += new EventHandler <EventArgs>(this.graphics_DeviceDisposing); this.graphics.DeviceResetting += new EventHandler <EventArgs>(this.graphics_DeviceResetting); this.graphics.DeviceReset += new EventHandler <EventArgs>(this.graphics_DeviceReset); PlatformAPISettings.InitPlatformAPI(); SettingsLoader.checkStatus(); if (SettingsLoader.didLoad) { this.CanLoadContent = true; this.graphics.PreferredBackBufferWidth = Math.Min(SettingsLoader.resWidth, 4096); this.graphics.PreferredBackBufferHeight = Math.Min(SettingsLoader.resHeight, 4096); this.graphics.IsFullScreen = SettingsLoader.isFullscreen; this.graphics.PreferMultiSampling = SettingsLoader.ShouldMultisample; if (Settings.StartOnAltMonitor & !SettingsLoader.isFullscreen) { this.graphics.PreparingDeviceSettings += new EventHandler <PreparingDeviceSettingsEventArgs>(this.graphics_PreparingDeviceSettingsForAltMonitor); } Console.WriteLine("Loaded Settings - Language Code: " + Settings.ActiveLocale); } else { this.graphics.PreferMultiSampling = true; if (Settings.windowed) { this.graphics.PreferredBackBufferWidth = 1280; this.graphics.PreferredBackBufferHeight = 800; this.CanLoadContent = true; } else { this.graphicsPreparedHandler = new EventHandler <PreparingDeviceSettingsEventArgs>(this.graphics_PreparingDeviceSettings); this.graphics.PreparingDeviceSettings += this.graphicsPreparedHandler; this.graphics.PreferredBackBufferWidth = 1280; this.graphics.PreferredBackBufferHeight = 800; this.graphics.IsFullScreen = true; } this.NeedsSettingsLocaleActivation = true; Console.WriteLine("Settings file not found, setting defaults."); } this.CheckAndFixWindowPosition(); this.IsMouseVisible = true; this.IsFixedTimeStep = false; Game1.singleton = this; this.Exiting += new EventHandler <EventArgs>(this.handleExit); StatsManager.InitStats(); }
public Game1() { culture = new CultureInfo("en-US"); Thread.CurrentThread.CurrentCulture = culture; Thread.CurrentThread.CurrentUICulture = culture; threadsExiting = false; graphics = new GraphicsDeviceManager(this) { GraphicsProfile = GraphicsProfile.HiDef, PreferMultiSampling = true }; graphics.DeviceDisposing += Graphics_DeviceDisposing; graphics.DeviceResetting += Graphics_DeviceResetting; graphics.DeviceReset += Graphics_DeviceReset; SettingsLoader.checkStatus(); if (SettingsLoader.didLoad) { CanLoadContent = true; graphics.PreferredBackBufferWidth = Math.Min(SettingsLoader.resWidth, 4096); graphics.PreferredBackBufferHeight = Math.Min(SettingsLoader.resHeight, 4096); graphics.IsFullScreen = SettingsLoader.isFullscreen; } else if (Settings.windowed) { graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 800; CanLoadContent = true; } else { graphicsPreparedHandler = Graphics_PreparingDeviceSettings; graphics.PreparingDeviceSettings += graphicsPreparedHandler; graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 800; graphics.IsFullScreen = true; } IsMouseVisible = true; IsFixedTimeStep = false; Content.RootDirectory = "Content"; singleton = this; Exiting += HandleExit; PlatformAPISettings.InitPlatformAPI(); StatsManager.InitStats(); }