Exemplo n.º 1
0
        public virtual void Init()
        {
            Globals.dedicated = Cvar.Get("dedicated", "0", Qcommon.CVAR_NOSET);
            Program.Q2Dialog  = new Q2DataDialog();
            Locale.SetDefault(Locale.US);
            Program.Q2Dialog.SetVisible(true);
            string DRIVER = "lwjgl";

            Qcommon.Init(new string { "DancingQueens", "+set", "gl_mode", "4", "+set", "vid_fullscreen", "0", "+set", "vid_ref", DRIVER });
            VID.Shutdown();
            String[] names = Renderer.GetDriverNames();
            System.Diagnostics.Debug.WriteLine("Registered Drivers: " + Arrays.AsList(names));
            this.re    = Renderer.GetDriver(DRIVER);
            Globals.re = this.re;
            System.Diagnostics.Debug.WriteLine("Use driver: " + re);
            System.out_renamed.Flush();
            re.Init(0, 0);
            kbd = re.GetKeyboardHandler();
            kbd.Init();
            Cbuf.AddText("unbind t");
            Cbuf.Execute();
            Cmd.AddCommand("togglemouse", togglemouse);
            Cbuf.AddText("bind t togglemouse");
            Cbuf.Execute();
            Globals.cls.key_dest = Defines.key_game;
            Globals.cls.state    = Defines.ca_active;
            viddef = Globals.viddef;
            fov_y  = Math3D.CalcFov(fov_x, viddef.GetWidth(), viddef.GetHeight());
        }
Exemplo n.º 2
0
 public static void Main(string[] args)
 {
     Qcommon.Init(args);
     System.Diagnostics.Debug.WriteLine("hello!");
     GameSave.InitGame();
     GameSave.ReadGame("test/data/savegames/game.ssv");
 }
Exemplo n.º 3
0
        public virtual void Init()
        {
            Globals.dedicated = Cvar.Get("dedicated", "0", Qcommon.CVAR_NOSET);
            Program.Q2Dialog  = new Q2DataDialog();
            Locale.SetDefault(Locale.US);
            Program.Q2Dialog.SetVisible(true);
            string DRIVER = "jsr231";

            Qcommon.Init(new string [] { "TestRenderer", "+set", "gl_mode", "6", "+set", "vid_fullscreen", "0", "+set", "vid_ref", DRIVER });
            VID.Shutdown();
            String[] names = Renderer.GetDriverNames();
            System.Diagnostics.Debug.WriteLine("Registered Drivers: " + Arrays.AsList(names));
            this.re    = Renderer.GetDriver(DRIVER);
            Globals.re = this.re;
            System.Diagnostics.Debug.WriteLine("Use driver: " + re);
            System.out_renamed.Flush();
            re.Init(0, 0);
            kbd = re.GetKeyboardHandler();
            kbd.Init();
            Cmd.AddCommand("nexttest", nexttest);
            Cbuf.AddText("bind n nexttest");
            Cbuf.Execute();
            Globals.cls.key_dest = Defines.key_game;
            Globals.cls.state    = Defines.ca_active;
        }
Exemplo n.º 4
0
 public virtual void Init()
 {
     Qcommon.Init(new string { "$Id: DebugCulling.java,v 1.6 2008-03-02 14:56:21 cawe Exp $" });
     VID.Shutdown();
     this.re = Renderer.GetDriver("jogl");
     re.Init(0, 0);
     viddef = Globals.viddef;
 }
Exemplo n.º 5
0
        public virtual void Init()
        {
            Globals.dedicated = Cvar.Get("dedicated", "0", Qcommon.CVAR_NOSET);
            if (Globals.dedicated.value != 1F)
            {
                Program.Q2Dialog = new Q2DataDialog();
                Locale.SetDefault(Locale.US);
                Program.Q2Dialog.SetVisible(true);
            }

            Qcommon.Init(new string[] { "TestMap" });
            VID.Shutdown();
            Globals.re = this.re = Renderer.GetDriver("jsr231", true);
            re.Init(0, 0);
            Cmd.AddCommand("+tforward", forward_down);
            Cmd.AddCommand("-tforward", forward_up);
            Cbuf.AddText("bind UPARROW +tforward");
            Cbuf.Execute();
            Cmd.AddCommand("+tbackward", backward_down);
            Cmd.AddCommand("-tbackward", backward_up);
            Cbuf.AddText("bind DOWNARROW +tbackward");
            Cbuf.Execute();
            Cmd.AddCommand("+tleft", left_down);
            Cmd.AddCommand("-tleft", left_up);
            Cbuf.AddText("bind LEFTARROW +tleft");
            Cbuf.Execute();
            Cmd.AddCommand("+tright", right_down);
            Cmd.AddCommand("-tright", right_up);
            Cbuf.AddText("bind RIGHTARROW +tright");
            Cbuf.Execute();
            Cmd.AddCommand("togglemouse", togglemouse);
            Cbuf.AddText("bind t togglemouse");
            Cbuf.Execute();
            Globals.cls.key_dest = Defines.key_game;
            Globals.cls.state    = Defines.ca_active;
            viddef = Globals.viddef;
        }
Exemplo n.º 6
0
        public static void Main(string[] args)
        {
            var dedicated = false;

            // check if we are in dedicated mode to hide the dialog.
            for (var n = 0; n < args.Length; n++)
            {
                if (!args[n].Equals("+set"))
                {
                    continue;
                }

                if (++n >= args.Length)
                {
                    break;
                }

                if (!args[n].Equals("dedicated"))
                {
                    continue;
                }

                if (++n >= args.Length)
                {
                    break;
                }

                if (!args[n].Equals("1") && !args[n].Equals("\"1\""))
                {
                    continue;
                }

                Com.Printf("Starting in dedicated mode.\n");
                dedicated = true;
            }

            Globals.dedicated = Cvar.Get("dedicated", "0", Defines.CVAR_NOSET);

            if (dedicated)
            {
                Globals.dedicated.value = 1.0f;
            }

            Qcommon.Init(args);

            Globals.nostdout = Cvar.Get("nostdout", "0", 0);

            while (true)
            {
                // find time spending rendering last frame
                var now   = Timer.Milliseconds();
                var delta = now - Program.last;

                if (Program.UpdateLoop != null)
                {
                    Program.UpdateLoop(delta);
                }
                else if (delta > 0)
                {
                    Qcommon.FrameUpdate(delta);
                    Qcommon.FrameRender(delta);
                }

                Program.last = now;
            }
        }