Пример #1
0
        /// <summary>
        ///
        /// </summary>
        public FrmMain()
        {
            InitializeComponent();

            this.Location = new Point();


            // Initialize API-Dependent stuff
            mRenderer = new RendererGDI();
            mInput    = new InputGDI();
            mSound    = new SoundBase();

            Game.LoadContents();
            Game.GameOver += Game_GameOver;
            mRenderer.SetGameWindow(Game.DefaultGameWidth, Game.DefaultGameHeight, this.doubleBufferPanel1.ClientRectangle.Width, this.doubleBufferPanel1.ClientRectangle.Height);
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void doubleBufferPanel1_Resize(object sender, EventArgs e)
        {
            // If screen size changes, refresh parameters for coords calculation

            mRenderer.SetGameWindow(Game.DefaultGameWidth, Game.DefaultGameHeight, this.doubleBufferPanel1.ClientRectangle.Width, this.doubleBufferPanel1.ClientRectangle.Height);
        }