The Game Loop

November 29th, 2014

There are three steps to the game loop.

Initialize

This step calls the method that has been bound to OPinitialize. This is helpful to setup your game and game states before the update loop begins taking place.

Update

This step is called every frame, and receives an OPtimer giving the elapsed time used by the OPengine. The OPupdate method needs to overridden.

Destroy

Once the engine has been told to end this method will be called and then exit the program. OPdestroy gets overridden for this call.

 

The engine begins this process as soon as OPstart is called. The OPstart method is a blocking call, it won't return until the OPupdate call returns 1.