static void Main() { Log.Open("log.txt"); Log.WriteDebugLine("CSat " + Settings.Version + " examples (c) 2008-2009 mjt[[email protected]]"); // muutetaan data hakemistot // näin siksi että debug ja release versio löytää data-hakemiston bin/ hakemistosta. Settings.DataDir = "../data/model/"; Settings.TextureDir = "../data/texture/"; Settings.ShaderDir = "../data/shader/"; // jos true, käynnistä vain haluttu demo //if (true) if (false) { GameWindow game = new Game5(800, 600); // mikä demo halutaan //game.WindowBorder = WindowBorder.Fixed; game.WindowState = OpenTK.WindowState.Normal; // .FullScreen; Menu.PrintInfo(); game.Run(30.0, 0.0); return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Menu()); }
static void Main() { Log.Open("log.txt"); Settings.DataDir = "../data/model/"; Settings.TextureDir = "../data/texture/"; Settings.ShaderDir = "../data/shader/"; if (true) { GameWindow game = new Game5(800, 600); game.WindowState = OpenTK.WindowState.Normal; // .FullScreen; game.Run(30.0, 0.0); return; } }
private void button1_Click(Object sender, EventArgs e) { // starttaa esimerkki GameWindow game = null; DisplayDevice dev = DisplayDevice.Default; int ind = comboBox1.SelectedIndex; string[] strs = ((string)(comboBox1.Items[ind])).Split('x'); int width = int.Parse(strs[0]); int height = int.Parse(strs[1]); int bpp = int.Parse(strs[2]); switch (listBox1.SelectedIndex + 1) { case 1: game = new Game1(width, height); break; case 2: game = new Game2(width, height); break; case 3: game = new Game3(width, height); break; case 4: game = new Game4(width, height); break; case 5: game = new Game5(width, height); break; case 6: game = new Game6(width, height); break; case 7: game = new Game7(width, height); break; case 8: game = new Game8(width, height); break; case 9: game = new Game9(width, height); break; case 10: game = new Game10(width, height); break; case 11: game = new Game11(width, height); break; } // fullscreen? if (checkBox1.Checked) { dev.ChangeResolution(dev.SelectResolution(width, height, bpp, 60f)); //game.WindowBorder = WindowBorder.Fixed; //game.WindowState = OpenTK.WindowState.Maximized; game.WindowState = OpenTK.WindowState.Fullscreen; } else { //game.WindowBorder = WindowBorder.Fixed; game.WindowState = OpenTK.WindowState.Normal; } PrintInfo(); game.Run(30.0, 0.0); if (checkBox1.Checked) dev.RestoreResolution(); Log.WriteDebugLine("Test finished.."); game = null; GC.Collect(); GC.WaitForPendingFinalizers(); }