Example #1
0
 internal void Update(XGameTime gameTime)
 {
     foreach (XGameWindow window in this.allGameWindows)
     {
         if (window.Cursor != null)
         {
             window.Cursor.Update(gameTime);
         }
     }
 }
Example #2
0
        public XGame()
        {
            #region GameLoop stuff

            this.lastUpdateCount = new int[4];
            this.timer           = new XTimerTick();
            this.gameTime        = new XGameTime();

            const int BadUpdateCountTime = 2;
            var       maxLastCount       = 2 * Math.Min(BadUpdateCountTime, this.lastUpdateCount.Length);
            this.updateCountAverageSlowLimit = (float)(maxLastCount + (this.lastUpdateCount.Length - maxLastCount)) / this.lastUpdateCount.Length;

            this.totalGameTime = new TimeSpan();
            this.accumulatedElapsedGameTime = new TimeSpan();
            this.lastFrameElapsedGameTime   = new TimeSpan();
            this.IsFixedTimeStep            = true; // false;
            this.maximumElapsedTime         = TimeSpan.FromMilliseconds(500.0);
            this.inactiveSleepTime          = TimeSpan.FromSeconds(1.0);
            this.TargetElapsedTime          = TimeSpan.FromTicks(10000000 / 60);
            this.nextLastUpdateCountIndex   = 0;
            this.IsActive = true;

            #endregion
        }
Example #3
0
 /// <summary>
 /// Draws the Game
 /// </summary>
 /// <param name="gameTime">Time passed since the last call to Draw</param>
 protected virtual void Draw(XGameTime gameTime)
 {
 }
Example #4
0
 /// <summary>
 /// Updates the Game
 /// </summary>
 /// <param name="gameTime">Time passed since the last call to Update</param>
 protected virtual void Update(XGameTime gameTime)
 {
 }
Example #5
0
 // todo
 private void DrawGameSystems(XGameTime gameTime)
 {
 }
Example #6
0
 // todo
 private void UpdateGameSystems(XGameTime gameTime)
 {
 }
Example #7
0
 public abstract void Update(XGameTime gameTime);