Quote Originally Posted by pstudio
Is GameLoop() both for checking input, update sprites... and render graphics? I would personally go for two methods. One for updating whatever needs updating and one for all the drawing.
It depends on how the developer utilises it. He could jam all his update routines in there or he could code routines which will be called from within GameLoop()...

A good example:

A basic routine for updating the player...

Code:
procedure UpdatePlayer();
begin
 Case App1.KeyDown of
  KEY_UP: sprPlayer.Y := sprPlayer.Y - 1;
  KEY_DOWN: sprPlayer.Y := sprPlayer.Y + 1;
  KEY_LEFT: sprPlayer.X := sprPlayer.X - 1;
  KEY_RIGHT: sprPlayer.X := sprPlayer.X + 1;
 end;
end;
The UpdatePlayer() routine will be called from within GameLoop()...

Code:
procedure TApp1.GameLoop();
begin
 UpdatePlayer()
 UpdateEnemies()
 
 //And whatever needs to follow after that...
end;
I also plan on adding a "Best Practices" section to the documentation where recommended methods will be discussed. And the above method will definitely feature in it.

I recently started coding on the lib and the input routines shown is just a basic "sketch" of what I'm trying to achieve...