Datasheet
also download the drivers yourself and follow the instructions from the official hardware site of Microsoft
products at
www.microsoft.com/hardware/gaming/download.mspx.
Last but not least, you will do a lot of unit testing in this book, and for that I usually recommend NUnit
and TestDriven.NET (and later even xUnit, a newer unit testing framework released in late 2007). NUnit
is an external dll and TestDriven.NET is not supported in the Visual Studio Express Editions anymore. It
does not matter for this book because all source code will use its own kind of unit testing with a special
class later on.
If you use Visual Studio 2005, I suggest using TestDriven.NET, and if you are using Visual Studio 2005
Team System, you can also use the Unit Testing features implemented directly in VS there. Alternatively
there are also other Unit Testing Frameworks around (for example, MbUnit, csUnit, and so on). Most of
the samples in this book keep things simple and use only very basic features of unit testing and make it
look like many little test programs.
You can certainly do all your work inside the XNA Game Studio Express IDE, and Microsoft encourages
you to do so. All samples in this book work fine with the Express editions and I did not use any external
dlls (which was also one of the requirements for the XNA Starter Kits). However, some people already have
Visual Studio 2005 and may feel more comfortable doing their coding over there. Read on for a couple of
tricks on how to get XNA working with Visual Studio 2005 Professional.
What About Visual Studio 2005 Professional?
XNA Game Studio Express 1.0 is fine and a nice environment to work in. However, if you are used to
tools like SourceSafe or any other CMS (Content Management System) or plug-ins like CodeRush,
TestDriven.NET, and other productivity tools, you will run into a bunch of problems. As I said earlier, it
is not even possible to open your XNA 1.0 projects from Visual Studio 2005. If you are using XNA 2.0
where Visual Studio 2005 is supported out-of-the-box or do not care about Visual Studio 2005 or Visual
Studio 2008, you can skip this section.
The XNA Framework uses the .NET 2.0 Framework and DirectX 9.0c. To run games on any Windows
PC, it needs the .NET 2.0 Framework, DirectX 9.0c, and the XNA dlls. If you are a game developer you
will have the latest DirectX SDK anyway and if you have Visual Studio 2005, you will have the .NET 2.0
Framework, too, so the only thing you need for running and even compiling XNA applications are the
two XNA dlls:
❑ Microsoft.Xna.Framework.dll
❑ Microsoft.Xna.Framework.Game.dll
These dlls are referenced in all XNA projects, so if you just add them to a project in Visual Studio 2005,
you can directly start coding. To get started, just copy over the
Game1.cs and Program.cs files from an
empty XNA project you created with XNA Game Studio Express.
Another problem could arise if you work on a 64-bit operating system such as Windows XP x64 or Windows
Vista x64. Although DirectX 9.0c has had 64-bit dlls for some time now and the .NET Framework runs
fine on 64 bit, too, the problem lies in the XNA Framework, which is available only in a 32-bit version
12
Part I: XNA Framework Basics
61286c01.qxd:WroxPro 1/21/08 3:44 PM Page 12