Exemplo n.º 1
0
        public GameBase(Form form, int window_size_w, int window_size_h, DlgMainLoopOneFrame dlg_main_loop_one_frame = null, bool is_fps_show = false)
        {
            game_base                    = this;
            this.form                    = form;
            this.window_size_w           = window_size_w;
            this.window_size_h           = window_size_h;
            this.is_fps_show             = is_fps_show;
            this.dlg_main_loop_one_frame = dlg_main_loop_one_frame;
            form.ClientSize              = new Size(window_size_w, window_size_h);

            int sh = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;
            int sw = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;

            form.Location = new Point((sw - form.Size.Width) / 2, (sh - form.Size.Height) / 2);

            WaitTimer.InitClass();
            input = new Input(form);
            DX.SetUserWindow(form.Handle); //DxLibの親ウインドウをこのフォームウインドウにセット
            DX.DxLib_Init();
            DX.SetDrawMode(DX.DX_DRAWMODE_BILINEAR);
        }