Esempio n. 1
0
        private void InitializeLater()
        {
            Window.AllowUserResizing  = true;
            Window.ClientSizeChanged += new System.EventHandler <System.EventArgs>(Window_ClientSizeChanged);

            renderTarget = new RenderTarget2D(GraphicsDevice, 1920, 1080);

            windowResX = renderTarget.Width / 2;
            windowResY = renderTarget.Height / 2;

            ContentLoader.Initialize(Content, GraphicsDevice, new Random());
            DrawM.Initialize(GraphicsDevice);
            spriteBatch = new SpriteBatch(GraphicsDevice);
            G.batch     = spriteBatch;
            Drawer.Initialize(spriteBatch);
            Input.Initialize();
            Rules.Initialize();
            Save.Initialize();
            RunningContent.LoadAll(GraphicsDevice);


            G.Initialize(new Int2(renderTarget.Width / samplingZoom, renderTarget.Height / samplingZoom), GraphicsDevice);


            //InitPatcher();

            inputRecorderManager = new InputRecorderManager();

            Restart(null);

            ToggleFullscreen();
        }
Esempio n. 2
0
        protected override void Initialize()
        {
            Window.AllowUserResizing  = true;
            Window.ClientSizeChanged += new System.EventHandler <System.EventArgs>(Window_ClientSizeChanged);

            CenterWindow();

            DrawM.Initialize(GraphicsDevice);
            Input.Initialize();

            base.Initialize();
        }
Esempio n. 3
0
        public void Window_ClientSizeChanged(object sender, EventArgs e)
        {
            if (!changeResolution)
            {
                changeResolution = true;

                graphics.PreferredBackBufferWidth  = Window.ClientBounds.Width;
                graphics.PreferredBackBufferHeight = Window.ClientBounds.Height;
                graphics.ApplyChanges();

                if (!isFullScreen)
                {
                    windowResX = resX;
                    windowResY = resY;
                }

                changeResolution = false;
            }

            DrawM.Initialize(graphics.GraphicsDevice);
        }
Esempio n. 4
0
        protected override void Initialize()
        {
            Window.IsBorderless = true;
            Window.Position     = new Point(0, 0);
            graphics.PreferredBackBufferWidth  = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
            graphics.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;

#if !WINDOWS
            graphics.IsFullScreen = true;
#endif
            graphics.ApplyChanges();

            Input.Initialize();
            DrawM.Initialize(GraphicsDevice);

            windowHelper = new WindowHelper(graphics, Window);

            G.Initialize(GraphicsDevice);

            this.IsFixedTimeStep   = true;
            this.TargetElapsedTime = TimeSpan.FromSeconds(1d / 60d);

            base.Initialize();
        }