Esempio n. 1
0
File: Menu.cs Progetto: 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();
        }
Esempio n. 2
0
File: Main.cs Progetto: Keilerr/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
        }
Esempio n. 3
0
File: Main.cs Progetto: 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
        }
Esempio n. 4
0
        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 Game();
                    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
        }
Esempio n. 5
0
        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
        }
Esempio n. 6
0
File: Menu.cs Progetto: 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();
        }