  FExiting := False;

  FLastUpdateTime := GetTimer;
  LastFPS := GetTimer;
  FFPS := 0;
  FPSCounter := 0;
  while not FExiting do begin
    IterationTime := GetTimer;
    while IterationTime - FLastUpdateTime > FUpdateInterval do begin
      Update;
      FLastUpdateTime := FLastUpdateTime + FUpdateInterval;
    end;
    Render;
    Inc(FPSCounter);
    if LastFPS + 1000 < GetTimer then begin
      FFPS := FPSCounter;
      FPSCounter := 0;
      LastFPS := GetTimer;
    end;
    FWinApi.ReadMessages;
  end;
