Initialization 101

Initializing games involves performing setup tasks in a particular order, especially on Windows platforms. Initialization tasks for Windows games are a superset of console games. Consoles, due to their predictable architecture, have no need of determining how much VRAM is installed and many other things that are user configurable on a Wintel platform. There are some tasks you must perform before creating your window, and others that must have a valid window handle or HWND, and therefore happen after you create your window. Initialization tasks for a Windows game should happen in this order:

  • Check system resources: hard drive space, memory, input and output devices

  • Check the CPU speed

  • Estimate available VRAM

  • Initialize your random number generator (this was covered in Chapter 3)

  • Load programmer's options for debugging purposes

  • Initialize your memory cache

  • Create your window

  • Initialize the audio system

  • Load the player's game options and saved game files

  • Create your drawing surface

  • Perform initialization for game systems: physics, AI, and so on

Game Coding Complete
Game Coding Complete
ISBN: 1932111751
EAN: 2147483647
Year: 2003
Pages: 139 © 2008-2017.
If you may any questions please contact us: