static void Main(string[] args) { if (Cli.Parse <ApplicationSettings>(args).CliExitEarly) { return; } Directory.SetCurrentDirectory(Path.GetDirectoryName(Application.ExecutablePath)); EnableLogging(); Logger.Debug("Launched from {launchDirectory} with args {launchOptions}.", Directory.GetCurrentDirectory(), string.Join(" ", args)); // Single instance handling _singleInstanceMutex = new Mutex(true, ApplicationSettings.Instance.MumbleMapName != null ? $"{APP_GUID}:{ApplicationSettings.Instance.MumbleMapName}" : $"{APP_GUID}"); if (!_singleInstanceMutex.WaitOne(TimeSpan.Zero, true)) { Logger.Warn("Blish HUD is already running!"); return; } using (var game = new BlishHud()) { game.Run(); } _singleInstanceMutex.ReleaseMutex(); }
static void Main() { if (IsMoreThanOneInstance()) { Logger.Warn("Blish HUD is already running!"); return; } // Needed by textboxes to enable CTRL + A selection Application.EnableVisualStyles(); using (var game = new BlishHud()) game.Run(); SingleInstanceMutex.ReleaseMutex(); }
public BlishHud() { BlishHud.Instance = this; this.ActiveGraphicsDeviceManager = new GraphicsDeviceManager(this); this.ActiveGraphicsDeviceManager.PreparingDeviceSettings += delegate(object sender, PreparingDeviceSettingsEventArgs args) { args.GraphicsDeviceInformation.PresentationParameters.MultiSampleCount = 4; }; this.ActiveGraphicsDeviceManager.GraphicsProfile = GraphicsProfile.HiDef; this.ActiveGraphicsDeviceManager.PreferMultiSampling = true; this.ActiveContentManager = this.Content; this.Content.RootDirectory = "Content"; this.IsMouseVisible = true; }
public void DoInitialize(BlishHud game) { ActiveBlishHud = game; Initialize(); }