internal WindowsGameHost(GraphicsContextFlags flags, string gameName, bool bindIPC = false) : base(gameName, bindIPC) { // OnActivate / OnDeactivate may not fire, so the initial activity state may be unknown here. // In order to be certain we have the correct activity state we are querying the Windows API here. timePeriod = new TimePeriod(1) { Active = true }; Architecture.SetIncludePath(); Window = new WindowsGameWindow(); Window.WindowStateChanged += (sender, e) => { if (Window.WindowState != OpenTK.WindowState.Minimized) { OnActivated(); } else { OnDeactivated(); } }; Dependencies.Cache(Storage = new WindowsStorage(gameName)); }
internal WindowsGameHost(GraphicsContextFlags flags, string gameName, bool bindIPC = false) : base(gameName, bindIPC) { // OnActivate / OnDeactivate may not fire, so the initial activity state may be unknown here. // In order to be certain we have the correct activity state we are querying the Windows API here. timePeriod = new TimePeriod(1) { Active = true }; Architecture.SetIncludePath(); Window = new WindowsGameWindow(); Window.WindowStateChanged += (sender, e) => { if (Window.WindowState != OpenTK.WindowState.Minimized) { OnActivated(); } else { OnDeactivated(); } }; Storage = new WindowsStorage(gameName); //TODO: check if we want this done so early. may be better in Run() Application.EnableVisualStyles(); }