示例#1
0
        /// <summary>
        /// Update all managers and informations.
        /// </summary>
        protected override void Update(GameTime gameTime)
        {
            elapsedDeltaTime = gameTime.ElapsedGameTime;

            //  Update processing before input
            OnPreUpdate();

            //  Update input device
            InputManager.Update(gameTime);

            //  Update input handle
            OnHandleInput(gameTime);

            //  Update Xna.Framework.Game component
            base.Update(gameTime);

            //  Update game events
            GameEventManager.Update(gameTime);

            //  Update scene
            Viewer.Update(gameTime);

            //  Update 3D sound emitter
            SoundManager.ApplyEmitter(CurrentCamera.FirstCamera.Position,
                                      CurrentCamera.FirstCamera.Direction,
                                      CurrentCamera.FirstCamera.Up,
                                      CurrentCamera.FirstCamera.Velocity);

            //  Update sound engine
            SoundManager.Update();

            //  Update processing after input
            OnPostUpdate();

            //  Update FPS counter
            FpsCounter.Update(gameTime);

            //  Update FPS infomation
            if (textFPS.Visible)
            {
                textFPS.Text = string.Format("FPS : {0} ({1} x {2})",
                                             FrameworkCore.FpsCounter.Fps,
                                             CurrentViewport.Width, CurrentViewport.Height);
            }
        }