Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
There are a million little details about writing games that no one talks about. Lots of books and websites can teach you how to draw textured polygons in Direct3D. But when it comes to figuring out your initialization sequence, you'll find little discussion. Most programmers hack something together over time that eventually turns into a horrible mess.
I've written this chapter to show you the ins and outs of the entire initialization and shutdown sequence. As you check out the code in this chapter, keep in mind that every game is different and may require a different initialization sequence. Hopefully, you'll gain an understanding of the approach presented here and be able to adapt it to your particular situation. Truly elegant solutions and algorithms rarely just fall out of the sky. They usually come to you after seeing some code that is close to what you need, and you push it the rest of the way yourself.