using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; using Blacklight.Core; using Glass.Blacklight; namespace Glass.Testbed { internal static class Program { static string GetPreferredAdapter() { try { using (var reader = System.IO.File.OpenText("Blacklight.Testbed.PreferredAdapter.txt")) { return reader.ReadLine(); } } catch(Exception) { return null; } } static void Main(string[] args) { string preferredAdapterName = GetPreferredAdapter(); global::Blacklight.Core.GraphicsAdapterManager.Singleton.ForceStartup(); if (global::Blacklight.Core.GraphicsAdapterManager.Singleton.Modules.Count == 0) { System.Windows.Forms.MessageBox.Show( "Could not locate any Blacklight graphics addapters (eg: DirectX). Will now exit.", "Critical Error"); return; } global::Blacklight.Core.GraphicsAdapterManager.Singleton.SetCurrentModule( preferredAdapterName ?? global::Blacklight.Core.GraphicsAdapterManager.Singleton.Modules.First()); Application.Run(new Testbed()); } } }