예제 #1
0
파일: Menu.cs 프로젝트: bosoni/csat
        // starttaa esimerkki
        private void button1_Click(Object sender, EventArgs e)
        {
            Hide();

            DisplayDevice dev = DisplayDevice.Default;
            int ind = comboBox1.SelectedIndex;

            string[] strs = ((string)(comboBox1.Items[ind])).Split('x');
            Settings.Width = int.Parse(strs[0]);
            Settings.Height = int.Parse(strs[1]);
            Settings.Bpp = int.Parse(strs[2]);

            // fullscreen?
            if (checkBox1.Checked)
                Settings.FullScreen = true;
            else
                Settings.FullScreen = false;

            int version;
            GraphicsContextFlags flags;
            if (Settings.UseGL3 == false)
            {
                flags = GraphicsContextFlags.Default;
                version = 2;
            }
            else
            {
                flags = GraphicsContextFlags.ForwardCompatible;
                version = 3;
            }
#if DEBUG
            flags |= GraphicsContextFlags.Debug;
#endif

            using (BaseGame bgame = new BaseGame("Project XYZ", version, 0, flags))
            {
#if !DEBUG
                try
#endif
                {
                    GameClass game = new Game();
                    BaseGame.SetGame(game);
                    bgame.Run(120.0);
                }
#if !DEBUG
                catch (Exception ex)
                {
                    Log.WriteLine(ex.ToString());
                }
#endif
            }

            GC.Collect();
            GC.WaitForPendingFinalizers();
            Show();
        }
예제 #2
0
파일: Main.cs 프로젝트: bosoni/csat
        static void Main()
        {
            Log.Create("log.txt");
            Settings.ReadXML("settings.xml");

            Settings.ModelDir = "../../data/model/";
            Settings.TextureDir = "../../data/texture/";
            Settings.ShaderDir = "../../data/shader/";
            Settings.ParticleDir = "../../data/particles/";

            int version;
            GraphicsContextFlags flags;
            if (Settings.UseGL3 == false)
            {
                flags = GraphicsContextFlags.Default;
                version = 2;
            }
            else
            {
                flags = GraphicsContextFlags.ForwardCompatible;
                version = 3;
            }
#if DEBUG
            flags |= GraphicsContextFlags.Debug;
#endif

            using (BaseGame bgame = new BaseGame("Project XYZ", version, 0, flags))
            {
#if !DEBUG
                try
#endif
                {
                    GameClass game = new Tests();
                    BaseGame.SetGame(game);
                    bgame.Run(120.0);
                }
#if !DEBUG
                catch (Exception e)
                {
                    Log.WriteLine("Main(): " + e.ToString());
                }
#endif
            }

            Log.WriteLine("Exiting..");
#if DEBUG
            //Console.ReadKey();
#endif
        }
예제 #3
0
파일: Main_Class.cs 프로젝트: bosoni/csat
        static void Main()
        {
            Log.Create("log.txt");
            Settings.ReadXML("settings.xml");

            int version;
            GraphicsContextFlags flags;
            if (Settings.UseGL3 == false)
            {
                flags = GraphicsContextFlags.Default;
                version = 2;
            }
            else
            {
                flags = GraphicsContextFlags.ForwardCompatible;
                version = 3;
            }
#if DEBUG
            flags |= GraphicsContextFlags.Debug;
#endif

            using (BaseGame bgame = new BaseGame("Project XYZ", version, 0, flags))
            {
                BaseGame.Instance.WindowBorder = OpenTK.WindowBorder.Fixed;

#if !DEBUG
                try
#endif
                {
                    GameClass game = new GameMenu();
                    BaseGame.SetGame(game);
                    bgame.Run(120.0);
                }
#if !DEBUG
                catch (Exception e)
                {
                    Log.WriteLine("Main(): " + e.ToString());
                }
#endif
            }

            Log.WriteLine("Exiting..");
#if DEBUG
            //Console.ReadKey();
#endif
        }
예제 #4
0
파일: Menu.cs 프로젝트: Keilerr/csat
        // starttaa esimerkki
        private void button1_Click(Object sender, EventArgs e)
        {
            Hide();

            DisplayDevice dev = DisplayDevice.Default;
            int           ind = comboBox1.SelectedIndex;

            string[] strs = ((string)(comboBox1.Items[ind])).Split('x');
            Settings.Width  = int.Parse(strs[0]);
            Settings.Height = int.Parse(strs[1]);
            Settings.Bpp    = int.Parse(strs[2]);

            // fullscreen?
            if (checkBox1.Checked)
            {
                Settings.FullScreen = true;
            }
            else
            {
                Settings.FullScreen = false;
            }

            int version;
            GraphicsContextFlags flags;

            if (Settings.UseGL3 == false)
            {
                flags   = GraphicsContextFlags.Default;
                version = 2;
            }
            else
            {
                flags   = GraphicsContextFlags.ForwardCompatible;
                version = 3;
            }
#if DEBUG
            flags |= GraphicsContextFlags.Debug;
#endif

            using (BaseGame bgame = new BaseGame("Project XYZ", version, 0, flags))
            {
#if !DEBUG
                try
#endif
                {
                    GameClass game = new Game();
                    BaseGame.SetGame(game);
                    bgame.Run(120.0);
                }
#if !DEBUG
                catch (Exception ex)
                {
                    Log.WriteLine(ex.ToString());
                }
#endif
            }

            GC.Collect();
            GC.WaitForPendingFinalizers();
            Show();
        }