Game Development Reference
In-Depth Information
n The resource cache, which is responsible for loading textures, meshes, and
sounds from a resource file.
n The main Event Manager, which allows all the different game subsystems to
communicate with each other.
n The network communications manager.
All of these members are initialized in GameCodeApp::InitInstance() .
InitInstance() : Checking System Resources
Checking system resources is especially important for Windows games, but console
developers don
'
t get off scot-free. Permanent storage, whether it is a hard disk or a
memory card, should be checked for enough space to store game data before the
player begins. Windows and console games that support special hardware, like steer-
ing wheels or other input devices, must check for their existence and fall back to
another option, like the gamepad, if nothing is found. Checking system RAM and
calculating the CPU speed can be important, too, even if the platform isn
t Windows.
The code inside InitInstance() is particularly sensitive to order, so be careful if
you decide to change this method. You should also keep your shutdown code in sync,
or rather reverse sync, with the order of initialization. Always release systems and
resources in the reverse order in which you requested or created them.
Here
'
'
s what this method does:
n Detects multiple instances of the application.
n Checks secondary storage space and memory.
n Calculates the CPU speed.
n Loads the game
s resource cache.
n Loads strings that will be presented to the player.
n Creates the LUA script manager.
n Creates the game
'
s Event Manager.
n Uses the script manager to load initial game options.
n Initializes DirectX, the application ' s window, and the D3D device.
n Creates the game logic and game views.
n Sets the directory for save games and other temporary files.
n Preloads selected resources from the resource cache.
'
 
 
Search WWH ::




Custom Search