Esempio n. 1
0
        private void Run()
        {
            while (!m_bShutdown)
            {
                m_dispatcherQueue.Execute((int)EEngineUpdatePriority.BeginFrame);

                float deltaTime = Updater.UpdateDeltaTime();

                // Update Input first poll input is thread safe but we should normally only poll here
                Input.PollInput();

                if (EnableEngineUpdate > 0)
                {
                    CRenderer.Instance.BeginFrame(deltaTime);
                    Config.Update(deltaTime);
                    CurrentWorld?.Update(deltaTime);
                    CRenderer.Instance.RenderFrame(deltaTime);
                }

                m_dispatcherQueue.Execute((int)EEngineUpdatePriority.EndFrame);
            }

            CurrentWorld?.Shutdown();
            CRenderer.Instance.Dispose();
            Input.Shutdown();
            CAssetRegistry.Instance.Dispose();
        }
Esempio n. 2
0
 protected override void Update(GameTime gameTime)
 {
     CurrentWorld.Update(0); // TODO: delta
     InputManager.Update();
     TouchManager.Update();
     base.Update(gameTime);
 }
Esempio n. 3
0
        private void GameLoop()
        {
            try
            {
                TimeManager.UpdateFrameTime();

                InputManager.Update();
                if (CurrentWorld != null)
                {
                    CurrentWorld.Update(TimeManager.FrameTime);
                }
                else
                {
                    Logger.LogWarning("No Game World");
                }
            }
            catch (Exception e)
            {
                Logger.LogError(e.Message);
                Logger.LogError(e.StackTrace);
                Console.WriteLine("Press Enter to continue.");
                Console.ReadLine();
            }
        }
 public virtual void Update(Microsoft.Xna.Framework.GameTime time)
 {
     CurrentWorld.Update(time);
 }