Ejemplo n.º 1
0
 protected Runner(int width, int height, int scale, bool fullscreen)
 {
     Application = this;
     Size        = new Point(width, height).Abs();
     Game        = new GameAdapter(this);
     Display     = new DisplayAdapter(Game, Size, scale, fullscreen);
 }
Ejemplo n.º 2
0
        internal DisplayAdapter(GameAdapter game, Point size, int scale, bool fullscreen)
        {
            _game = game;
            _game.Graphics.DeviceCreated   += OnDeviceChanged;
            _game.Window.ClientSizeChanged += OnDeviceChanged;
            _size = size;

            if (fullscreen)
            {
                ToFullscreen();
            }
            else
            {
                ToFixedScale(scale);
            }

            _game.ApplyChanges();
            _batch = new RendererBatch(_game.GraphicsDevice);
        }