public void Init(HashTableSettings gSettings, Ribbon mainRibbon) { ribbon = mainRibbon; devSettings = (bool)gSettings["DeveloperMode"]; appDir = Application.StartupPath + "\\"; globalSettings = gSettings; // load recent files if (File.Exists(appDir + "recentFiles.xml")) { recentFiles = RecentFiles.LoadFromFile(appDir + "recentFiles.xml"); recentFiles.ClearDeadEntires(); } else recentFiles = new RecentFiles(); RebuildRecentFilesMenu(); baseDir = /*(string)gSettings["Base.Path"];*/Path.GetFullPath(ConfigurationManager.AppSettings[(devSettings ? "dev@" : "") + "Base.Path.Relative"].Replace("%STARTUP%", Application.StartupPath)); if (!Directory.Exists(baseDir)) throw new ApplicationException("Base directory does not exist! : " + baseDir); cdi = ICommonDeviceInterface.NewInterface((byte)globalSettings["CDI.Adapter"], baseDir); cdi.ResourceLoader.RegisterContentLoader(new LayerContentLoader()); cdi.ResourceLoader.RegisterContentLoader(new BooScriptContentLoader()); ShowHideGroups(false); }
public virtual void Init(HashTableSettings settings, ICommonDeviceInterface cdi) { this.settings = settings; // load settings BackColor = (Color)settings["View3D.BgClr"]; // filter profiles into supported // NOTE: Profiles should be done in CDI really List<GraphicsProfile> sProfiles = new List<GraphicsProfile>(); foreach (GraphicsProfile profile in profiles) { if (GraphicsDeviceManager.CheckAdapterMeetsRequirements(((CommonDeviceInterface)cdi).Adapter, profile.MinReqs)) { sProfiles.Add(profile); // decide which recommendation to use profile.RecommendedVarInUse = -1; for (int i = 0; i < profile.RecommendedVariations.Length; i++) { if (GraphicsDeviceManager.CheckAdapterMeetsRequirements(((CommonDeviceInterface)cdi).Adapter, profile.RecommendedVariations[i])) { profile.RecommendedVarInUse = i; break; } } } } // TODO: This needs to feed back to UI? supportedProfiles = sProfiles.ToArray(); if (supportedProfiles.Length == 0) throw new Exception("None of the available graphics profiles meet the graphics devices capabilities"); }
public override void Init(HashTableSettings settings, ICommonDeviceInterface cdi) { base.Init(settings, cdi); renderContext = rContext = new VisRenderingContext3D(settings, this, (CommonDeviceInterface)cdi, profiles[0]); renderContext.BackColor = BackColor; }