Game Development Reference
In-Depth Information
The demo framework
The demo framework follows a very simple update, initialization, and cleanup design
shared throughout many of the classes within the sandbox.
The following is a class overview of the
BaseApplication.h
header:
The BaseApplication abstract class overview
The
BaseApplication
class has the main responsibility to configure the application
window, process input commands, as well as configure and interface with Ogre3D. The
Cleanup
,
Draw
,
Initialize
, and
Update
functions are stub functions with no im-
plementation within the
BaseApplication
class itself. Classes that inherit from
BaseApplication
can overload any of these functions in order to plug in their own lo-
gic:
• In a derived class, the
Initialize
function is called once at the start of the ap-
plication after Ogre has been initialized.
• The
Cleanup
function is called when the application requests to be shut down
right before Ogre itself gets cleaned up.
• The
Draw
call is executed right before the
graphics processing unit
(
GPU
)
renders the current application frame.
• The
Update
function is called immediately after the GPU has queued up all the
rendering calls in order to process the current frame. This allows the GPU to work
simultaneously as the CPU begins to prepare the next draw frame.