In this chapter you learned a lot about the creation of a full-blown graphics engine and you have gone through quite a lot of new graphics classes. Most of them were quite simple, but they are all still very important for the upcoming projects in this book.
Besides the many unit tests you explored and that helped you to stay focused on the problems you had to solve to get your graphics engine running, you also learned about the process of converting 3D data to the 2D screen space and in which way to use right-handed matrices in XNA. To use these matrices in shaders, which are required to render anything in XNA, you took a quick look at vertex and pixel shaders, but you will dive much deeper into shaders in the next chapters.
If you take a look at the new classes (Figure 5-15) and the project overview (Figure 5-13) you can see that there are a lot more namespaces than in the previous projects and you also moved some classes around and refactored them to your new needs. This was important because the switch from 2D to 3D is not an easy one and you can always improve the way the classes work and make the unit tests simpler. When your engine becomes more and more complex it is even more important to have solid framework with many unit tests you can fall back on in case something does not work the way you want it to. Otherwise it would just not be possible to write a unit test at the end of the book that renders a complex car with many shaders and over 20,000 polygons into a scene with shadow mapping, post screen effects, and cool glass shaders in just a few lines of code.
BaseGame is now your main entry point for the application and all internal classes are somehow connected to this class. BaseGame not only stores the device or content manager, but it also allows you to get the width and height of the render area, all the matrices you need to render shaders, and it stores many more useful capabilities in the properties that allow you, for example, to quickly enable or disable alpha blending.
Finally you learned a little bit more about using the Xbox 360 to test your graphics engine and all the pitfalls that can happen if you don’t test your game on the console early enough. In the next chapter you learn all about shaders and in Chapter 8 you will do some cool normal mapping, and you finally fix all these problems with the XNA models, tangent data, and so on. Then in Chapter 9 you learn about the powerful post screen shaders, which quickly give your whole game another look, and as an example game you can play the Rocket Commander game on the Xbox 360 with help of XNA.