DEALING WITH WHATS KNOWN AS A “GAME LOOP”…
NOTE: I’d like to point out something before we continue. I’m writing this tutorial in a platform-indepent
manor. This way, regardless of the programming language/graphics app you use, all of you can put this knowledge to use…
Righty-then. Lets talk about the “game-loop”…
Computers run in a “procedual” fashion - for example, it will perform a number of commands( or jobs) in a sequential order. This much you should already know…
The same applys for a computer game - even the big guns such as “Devil May Cry” or “Metal Gear”. The best way to describe this is to simply show you the contents of a game loop…
THE LOGIC
Step 1: Recieve and Store keyboard/mouse/Joystick input.
Step 2: Process the player.
Step 3: Process the bad-guys.
Step 4: Process world objects.
Step 5: Process the games overall status..
THE RENDERING
Step 6: Clear the screen for drawing...
Step 7: Draw the surroundings/landscape whatever...
Step 8: Draw the player.
Step 9: Draw the bad-guys.
Step 10: Draw the world-objects.
Step 11: Draw any health-bars or whatever...
Step 12: Display the final output to the screen( or "flip" to all you DirectDraw users out there!).
…and all this will be done for every frame. Most likely, you’ll be working at 30-frames-per-second so all of the above will be repeated 30 times every second…simple? I bloody hope so!
So there you have it. This is how just about every game is programmed. Oh, yeah - one other detail is that the “condition” the game loop looks for is a “True or False” flag in which to exit the loop and carry on with the statements after the loop.
This is what you’re dealing with when it comes down to games-programming. Doing each step, one-at-a-time. Each of these “steps” can be a basic call to a function or Method or Procedure - whatever you call a sub-routine in your language of choice.
Keep it simple!
. It’ll be interesting to see how Microsoft handles OpenGL 2.0 when it comes out. If they spit on it and ignore new specifications as they have done in the past, it’s dead in the water.

