Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 5 Game Initialization and Shutdo... > Stick the Landing: A Nice Clean Exit

STICK THE LANDING: A NICE CLEAN EXIT

Your game won't run forever. Even the best games will take a back seat to food and water. There may be a temptation to simply call exit (0) and be done with it. This isn't a wise choice because your DirectX drivers might be left in a bad state, and it could be difficult to tell if your game is leaking resources.

If you don't have a decent exit mechanism, you'll also find it impossible to determine where your game is leaking memory or other resources. After all, a hard exit is basically a huge memory leak, even though the operating system cleans it up. A tight exit mechanism will show you a single byte of leaked memory before returning control to the operating system. This is important for all games, Windows or console.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint