예제 #1
0
        public GameLoop(Game game,
                        IFullscreenService fullscreenService,
                        IMetricsService metricsHandler,
                        IUpdateService updateChecker)
        {
            MetricsHandler = metricsHandler;
            UpdateChecker  = updateChecker;

#if WINDOWS || MONOMAC
            if (METRICS_ENABLED)
            {
                Global.metrics_allowed = true;
            }
#endif
            if (Config.UPDATE_CHECK_ENABLED)
            {
                Global.update_check_allowed = true;
            }

            //@Yeti: make this work without Global later?
            GameSettings        = new Settings();
            Global.gameSettings = GameSettings;

            Game      = game;
            Renderer  = new GameRenderer(game, fullscreenService);
            IOHandler = new GameIOHandler(this, Renderer);

#if !MONOGAME
            // Setup our OpenALSoundController to handle our SoundBuffer pools
            OpenALInterface.create_sound_controller();
#endif
        }
예제 #2
0
        public GameRenderer(Game game, IFullscreenService fullscreen)
        {
            Fullscreen = fullscreen;
            graphics   = new GraphicsDeviceManager(game);
            SetInitialResolution();

            camera = new Camera(WindowWidth, WindowHeight, Vector2.Zero);
        }