static void Main(string[] args) { Game game = new Game(); OpenTKWindow gw = new OpenTKWindow(game); gw.Run(Game.FPS); }
public static void Main() { Scene scene = new Exercise1(); OpenTKWindow window = new OpenTKWindow(scene); window.Run(); }
public Space() { var kernal = new StandardKernel(new TestModule()); using (var engine = kernal.Get<GameEngine>()) { //engine.Renderer = new OpenTKRenderer(); //engine.Renderer.Setup(); //ThreadPool.QueueUserWorkItem(Renderer.Start); engine.Timer.TimerMessages.Subscribe(m => { // Console.WriteLine("{0} - {1}".fmt(m.CurrentTickTime.GameTimeElapsed.ToString(), m.Message)); }); engine.Timer.Subscribe(t => { // Console.WriteLine("Doing stuff."); }); Setup(engine); engine.Bus.OfType<SystemMessage>().Subscribe(m => Console.WriteLine("{0} SYSTEM - {1}", m.TimeSent.ToString(), m.Message)); engine.Bus.Add(new SystemMessage(engine.Timer.LastTickTime, "OpenTK starting.")); ThreadPool.QueueUserWorkItem(new WaitCallback(delegate(object state) { using (OpenTKWindow p = new OpenTKWindow(engine)) { // p.AddView(typeof(TestUnit), new TestUnitView()); p.Run(); } }), null); bool finish = false; while (!finish) { engine.Start(); Console.ReadKey(true); engine.Stop(); if (Console.ReadKey(true).Key == ConsoleKey.Escape) finish = true; } Console.WriteLine("Timer should have stopped."); Console.WriteLine("Press any key to continue..."); Console.ReadKey(true); } }
static void Main(string[] args) { Queue <string> argq = new Queue <string>(args); while (argq.Count > 0) { string arg = argq.Dequeue(); if (arg == "--debug") { Debugger.Launch(); } } /*ImGuiOpenTKCSWindow*/ Instance = new YourGameWindow(); Instance.Run(); Instance.Dispose(); }
public override void Run( ) { OpenTKWindow.Run( ); }
/// <summary> /// Begins the main loop. /// </summary> /// <param name="updateRate">Number of frames/updates per second.</param> public void Run(float updateRate) { OpenTKWindow.Run(updateRate); }