With the introduction of Microsoft Windows 95, game developers had the opportunity to develop Windows-based games that were far more powerful than was possible with earlier versions of Windows. Even with this capability, however, accessing the multimedia hardware consistently and efficiently was no easy task—that is, until Microsoft introduced DirectX. DirectX not only provides fast access to the hardware and therefore incredibly speedy performance, but it also makes it much easier for hardware developers to produce new devices that work well in the Windows environment. The DirectX APIs take away the necessity of writing your own low-level, device-specific code to access hardware such as the display adapter and network card, making it much easier for you to write programs that take full advantage of the computer's multimedia capabilities.
In this book, I focus on the Direct3D Immediate Mode API of DirectX. Immediate Mode provides a very fast 3D development library that works hand in hand with the other DirectX APIs, which implement sound, device input, network play, and display device handling. To teach you how to develop a real application supporting all these capabilities, I also show how you to develop code that uses and integrates the other DirectX APIs. By the end of the book, you'll see how to implement a complex 3D game with detailed 3D graphics, animated characters, multiple input device support (including easy enhancement to force feedback support), sound, and multiplayer support via modem, network, or direct serial connection.
I wrote this book because even though several books have been written on the DirectX APIs, including Direct3D Retained Mode, to date very little has been written on Direct3D Immediate Mode. The main reason for this lack of books about Immediate Mode is that unlike Retained Mode, which provides a library of high-level, easy-to-use commands, Immediate Mode provides a much more challenging—but much more efficient—API that most game developers have adopted for their professional games and engines. Because of this, most individuals have chosen to take the code they have developed using DirectX Immediate Mode—and the lessons learned from it—and keep it proprietary. William Chin (who originally developed the RoadRage game) and I chose to provide our game engine free with this book as a way of helping people move into a software market that has typically been difficult to penetrate because of the complexities of developing a commerically viable engine. I've seen many people struggle with trying to determine how to use the commands of the DirectX APIs together to create a functional 3D application. Although the Direct3D API might seem daunting at first, I believe that by the end of this book, you'll thoroughly understand the power of the DirectX APIs and know how to make them work together in a very powerful and sensible manner.
Armed with this understanding, you'll be able to move forward, comfortably using Direct3D for your game development efforts. In demonstrating in detail how to build a real-world application in Direct3D, I hope to give you the background and confidence you need to create your own Direct3D applications. With this background, any initial trepidation toward developing an Immediate Mode application should, I hope, be erased. Using Immediate Mode and the code framework presented in this book, you should be able to build powerful and fast commercial-quality applications. There's a reason that all commercial game developers use Immediate Mode rather than other APIs, and when you've completed this book, I'm sure you'll choose this path as well.
With that, let's get on to learning about Direct3D!