   Game Loop Problem
  I am in the process of trying to write my own XNA like framework along with a small 2D arcade game.One of the bugs with the framework lies in the Game loop and frame timing system.  The problem is that the game only updates when the mouse is moving over it's window.  Knowing that mouse-handling is not in anyway connected to timing my update-render loop, I am thinking that this has something to do with time lost because the mouse is moving over the window.I have been grinding my teeth over this bug for hours.  Help is greatly appreciated: private void Tick()   {  //If the window is not active, then don't do anything  if (!this.IsActive || this.IsPaused)  { Thread.Sleep(inactiveSleepTime); return;  }  if (timeLastUpdate == TimeSpan.Zero) timeLastUpdate = TimeSpan.FromTicks(Stopwatch.GetTimestamp());  gameClock.Step();  accumulatedElapsedGameTime += gameClock.ElapsedAdjustedTime;  long ratio = accumulatedElapsedGameTime.Ticks / TargetElapsed.Ticks;  accumulatedElapsedGameTime = TimeSpan.FromTicks(accumulatedElapsedGameTime.Ticks % TargetElapsed.Ticks);  //if the ratio is greater than 1, it means that the game took longer to draw than we thought  if (ratio > 1)  { //we are lagging.  Set the right values IsRunningSlowly = true; updatesSinceRunningSlowly = 0;  }  else // we aren't lagging so we can reset the values back if we were lagging before  { updatesSinceRunningSlowly++; if (updatesSinceRunningSlowly > 20) {time.IsRunningSlowly = false;} IsRunningSlowly = false;  }  while (ratio > 0)  {    ratio -= 1; time.ElapsedGameTime = gameClock.ElapsedAdjustedTime; time.ElapsedRealTime = gameClock.ElapsedAdjustedTime; time.TotalGameTime = this.totalGameTime; time.TotalRealTime = this.totalRealTime; Update(time); timeLastUpdate += TargetElapsed; totalGameTime += TargetElapsed;  }  //now we can draw a frame  DrawFrame();   }
  Can you show the code that actually calls Tick()?   