using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Drawing; using System.Windows.Forms; using Azimuth; using Blacklight.Core; using Blacklight.Core.Drawables; namespace Blacklight.Testbed { class Program { static string GetPrefferedAdapter() { 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 = GetPrefferedAdapter(); Blacklight.Core.GraphicsAdapterManager.Singleton.ForceStartup(); if (Blacklight.Core.GraphicsAdapterManager.Singleton.Modules.Count == 0) { System.Windows.Forms.MessageBox.Show( "Could not locate any Blacklight graphics addapters (eg: XNA, Tao, or GDI). " + "Will now exit.", "Critical Error"); return; } Blacklight.Core.GraphicsAdapterManager.Singleton.SetCurrentModule( preferredAdapterName ?? Blacklight.Core.GraphicsAdapterManager.Singleton.Modules.First()); World world = new World(); var testbed = new Testbed(); world.BindToViewport(testbed.viewport.DrawableSurface); world.DrawScene(); Application.Run(testbed); } } }