static void Main(string[] args) { PrintCredits(); System.Environment.CurrentDirectory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); if (args.Length > 0 && !File.Exists(args[0])) { Console.WriteLine("Error: File doesn't seem to exist: " + args[0]); return; } var thread = new Thread(() => { var inst = new NMSViewGame(); var form = new RenderWin(inst); form.Show(); form.Focus(); NMSViewGame.ReqFname = args.Length > 0 ? args[0] : null; inst.OnModelLoaded += new NMSViewGame.ModelLoadedEventHandler((model, entity, name) => { form.SetModelInst(name, model); }); var ctx = new GameContext(form.RenderPanel, false); inst.Run(ctx); }); thread.TrySetApartmentState(ApartmentState.STA); thread.Start(); }
public RenderWin(NMSViewGame Inst) { this.Inst = Inst; InitializeComponent(); }