コード例 #1
0
 public Engine(string[] args)
 {
     running = true;
     if (instance != null)
     {
         throw new SingletonAlreadyExistsException("Engine");
     }
     instance = this;
     new Debug();
     Debug.Log("Engine initialized.");
     new Settings();
     window = new EngineWindow("PNCEngine");
     try
     {
         AssetManager.Initialize();
         SceneManager.TargetWindow = window;
         SceneManager.Initialize();
     }
     catch (Exception e)
     {
         Debug.LogError(e.Message);
         running = false;
     }
     clock                   = new Clock();
     fixedUpdateTime         = 0.2f;
     window.SettingsChanged += Window_SettingsChanged;
 }
コード例 #2
0
 private void Window_SettingsChanged(object sender, Events.WindowSettingsChangedArgs e)
 {
     if (e.Fullscreen == window.Fullscreen)
     {
         window = new EngineWindow(window.SystemHandle, e.Settings, e.VideoMode, e.Vsync);
     }
     else
     {
         string title = window.Title;
         window.Close();
         if (e.Fullscreen)
         {
             window = new EngineWindow(e.VideoMode, title, e.Vsync, e.Settings, Styles.Fullscreen);
         }
         else
         {
             window = new EngineWindow(e.VideoMode, title, e.Vsync, e.Settings, Styles.Titlebar | Styles.Close);
         }
     }
 }