Beispiel #1
0
        protected override void Initialize()
        {
            Logger.Instance.Log("MainGame Initializing...");

            Window.Position = new Point(0, 0);
            VariableTimeStep();

            var context = CallContext <GlobalContextPresentation> .GetData("GlobalContextPresentation");

            context.GraphicsDevice        = GraphicsDevice;
            context.GraphicsDeviceManager = _graphicsDeviceManager;
            context.GameWindow            = Window;

            if (context.DesiredResolution == PointI.Empty)
            {
                SetScreenResolution(_graphicsDeviceManager, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height);
            }
            else
            {
                SetScreenResolution(_graphicsDeviceManager, context.DesiredResolution.X, context.DesiredResolution.Y);
            }

            PhoenixGame.MakeWorld();
            _phoenixGameView = new PhoenixGameView();
            _metricsPanel    = new MetricsPanel();

            Logger.Instance.LogComplete();

            base.Initialize();
        }
Beispiel #2
0
        public void Setup()
        {
            // Arrange
            var gameMetadata        = new GameConfigCache();
            var presentationContext = new GlobalContextPresentation();

            CallContext <GameConfigCache> .SetData("GameMetadata", gameMetadata);

            CallContext <GlobalContextPresentation> .SetData("GlobalContextPresentation", presentationContext);

            _phoenixGameView = new PhoenixGameView();

            ContentManager content = new ContentManager(null);

            _phoenixGameView.LoadContent(content);
        }