コード例 #1
0
        /// <summary>
        /// Создает файл со стандартными настройками отображения
        /// </summary>
        public override void CreateDefaultGraphicalSettings()
        {
            GraphicsSettingsDataOpenTk graphicsSettingsDataOpenTk = new GraphicsSettingsDataOpenTk();

            Console.WriteLine(graphicsSettingsDataOpenTk.SettingScreenResolution.Width);
            CurrentGraphicsSettings = graphicsSettingsDataOpenTk;
            //сразу же сериализуем их
            AppSerializationManager.SaveDataToFile <GraphicsSettingsDataOpenTk>(graphicsSettingsDataOpenTk,
                                                                                GraphicalSettingsPath);
        }
コード例 #2
0
        /// <summary>
        /// Обновляет дисплей и окно приложения, в случае необходимости создает новое окно
        /// </summary>
        private void UpdateViewport()
        {
            while (App.CurrentAppState.CurrentBaseAppState == EBaseAppStates.Running)
            {
                ViewAvailable = false;
                _currentGameWindow?.Dispose();

                GraphicsSettingsDataOpenTk graphicsCastRef = (GraphicsSettingsDataOpenTk)CurrentGraphicsSettings;
                GameWindowFlags            gwFlags         =
                    graphicsCastRef.IsFullscreen ? GameWindowFlags.Fullscreen : GameWindowFlags.FixedWindow;


                _currentGameWindow = new GlAppWindow(graphicsCastRef.SettingScreenResolution.Width,
                                                     graphicsCastRef.SettingScreenResolution.Height,
                                                     WindowName, gwFlags, this);
                _currentGameWindow.VSync = VSyncMode.Off;

                _currentGameWindow.Run();
            }
        }