Now that you've had a quick overview of DirectDraw, let's get to the meat of the chapter: setting up DirectDraw for our Direct3D Immediate Mode program. (Although this chapter focuses mainly on DirectDraw, you'll see some Direct3D enumeration code here because a 3D program needs to get some Direct3D information before completely initializing DirectDraw.) This process involves the following steps:
In the following sections, I'll describe each step and explain how to implement it. We'll be looking at some code from the Direct3D framework, which does all these steps. d3denum.cpp contains the code to do steps 1-6, and d3dframe.cpp contains the code to do step 7. Code in d3dapp.cpp directs the whole process by calling into code in these other two files. By the end of the chapter, you'll see how to create the foundation of a Direct3D application. You can reuse this code for all your future Direct3D applications, so make sure you remember this sequence of steps and the basic tasks involved.