Ejemplo n.º 1
0
        public override void Update(Microsoft.Xna.Framework.GameTime gameTime)
        {
#if DEBUG
            if (_controls.ConsoleButton())
            {
                ConsoleWindow.ToggleConsole();
            }
            if (_controls.ConsoleSwitchButton())
            {
                ConsoleWindow.ChangeMode();
            }
#endif
            _controls.Update();
            base.Update(gameTime);
        }
        public EquestriEngine(string title)
        {
            EngineGlobals.GameReference = this;
            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8;

            graphics.PreparingDeviceSettings += OnPreparingDeviceSettings;

            #if RUN_FAST
            graphics.SynchronizeWithVerticalRetrace = false;
            this.IsFixedTimeStep = false;
            #endif
            _settings = GameSettings.LoadData();
            _settings.InitGraphicsDevice(graphics, GraphicsDevice);

            _assetManager = new AssetManager(this);
            _dataManager = new DataManager(this);
            _inputManager = new InputManager(this);
            _stateManager = new StateManager(this);
            _widgetDisplay = new WidgetDrawer(this);

            this.Components.Add(_assetManager);
            this.Components.Add(_dataManager);
            this.Components.Add(_inputManager);
            this.Components.Add(_stateManager);
            this.Components.Add(_widgetDisplay);
            #if PROFILER
            profiler = new Indiefreaks.Xna.Profiler.ProfilerGameComponent(this, @"Fonts\celestia_redux");
            Indiefreaks.AOP.Profiler.ProfilingManager.Run = true;
            this.Components.Add(profiler);
            #endif
            #if DEBUG
            _debugConsole = new ConsoleWindow(this);
            this.Components.Add(_debugConsole);
            #endif
            Content.RootDirectory = "Content";

            //this.Window.Title = string.Format("{0} - ver {1}",title,VERSION_NUMBER);
        }