Chapter 11: Tools of the Trade


The first ten chapters of this book covered the development of a simple game engine. We ll wrap up with a look at the tools you will need for building the sample game engine as well as any games created with this engine. We will also look at some of the tools you can use to build the artistic content for your games . This includes three-dimensional models, collections of models to form a scene, textures and other two-dimensional content, and audio files. In each of these categories, we will look at not only the more professional tools that are available, but also the free or inexpensive tools that are available to the novice or hobbyist developer.

Setting Up Your Development Environment

You are never going to get anywhere in your game development if you can t build the software. The software development tools include not only the compiler for the software, but also tools to debug and profile the software. You will also need to have the .NET Framework and the DirectX 9 SDK installed on your development machine. Both of these packages are free to download from Microsoft. The .NET Framework can be found at http://msdn.microsoft.com/netframework. The latest version of DirectX can be downloaded from http://www.microsoft.com/directx. When downloading DirectX, be sure that you get the SDK. There is also a download at this site that contains only the runtime components. These components will allow you to execute the DirectX application but do not include all of the headers and tools required to build DirectX applications. When installing the SDK, be sure to install the debug libraries. Your software will execute a bit slower with these libraries, but they provide invaluable information when chasing a problem in your software.

In order to run the .NET Framework, you must have at least the Windows 98 version of Microsoft Windows. I would recommend either Windows 2000 or Windows XP. To get the most out of DirectX, you should also have a fairly recent graphics card and get the latest drivers for the card. As of this writing, only the latest cards from nVIDIA and ATI are fully DirectX 9 compatible.

Driving the Cadillac-Visual Studio

The quickest way to develop game software is with a good integrated design environment (IDE). An IDE brings all the software development tools together in one place. This includes the editor, the debugger, and other tools. The best IDE on the market for C# development is Visual Studio 7. This is a somewhat pricey package for the novice and hobbyist developer, but it does provide everything that a developer needs. In addition to the basic IDE components already mentioned, it has an integrated object browser. The object browser gives you the ability to browse through the classes and structures in any .NET assembly. Since the Microsoft documentation for Managed DirectX 9 is somewhat behind the C++ documentation, you may occasionally need to do a bit of digging to figure out exactly what the API is doing. The solution is to become familiar with the C++ documentation. You must then supplement that information with the limited C# documentation and looking directly at the classes in the object browser.

Visual Studio also provides a DirectX Wizard that will create the graphical equivalent to a Hello World application for you. It uses the same underlying framework that was the used in this book s sample game engine. It also adds references to the project for the DirectX components requested . If you don t use the wizard or if you decide that you need additional components later, you must add references to those assemblies. References are added to a project within the workspace by right-clicking the References folder for the project in the Solution Explorer pane. The Add Reference dialog box will appear, and the DirectX assemblies will be displayed on the .NET tab of the dialog box. Simply select the desired assembly, and click the Select button followed by the OK button. The assembly will then be displayed in the project s References folder.

Visual Studio also provides complete debugging capabilities. One of the important capabilities of the debugger is the ability to perform unmanaged debugging. The debug libraries of DirectX provide what is referred to as debug spew. This spew is a stream of status and fault information that is provided by the debug version of the libraries, which is one reason why the debug libraries run slower than the release versions. If unmanaged debugging is activated, this information is routed to Visual Studio s output pane. Unmanaged debugging is disabled by default. To enable it, you must open the property window for the project. Under Configuration Properties you will find a selection for debugging. On this page appears a property labeled Enable Unmanaged Debugging. Setting this property to true enables this capability. With unmanaged debugging enabled, any DirectX commands that fail will send useful information to the output pane.

Visual Studio is the Cadillac of development tools when it comes to developing Managed DirectX. This level of capability comes at a price, though. The C#-only version costs at least $100. The full version of Visual Studio costs over $800. While this is not out of line for professional developers, it could be a bit pricey for hobbyist developers.

Getting There in a Yugo-Free Tools

Luckily for hobbyist developers, there are other options open for developing C# and managed DirectX applications. The first option is supplied with the .NET Framework itself. The framework comes with a command line C# compiler. In fact, it is this compiler that is invoked by Visual Studio when building applications. You can edit your source code with your favorite text editor and then invoke the compiler to build the application. Some developer s editors include the capability to invoke compilers from within the editor environment. This provides the ability to build the applications but not to debug them. Luckily, Microsoft has provided some debugging tools with the DirectX SDK. The first of these tools is DBMon. DBMon is a DOS window that acts like the Output pane during unmanaged debugging. The DBMon window displays the same debug spew from the debug libraries.

Another option is available that is closer to the Visual Studio experience: an open source project, called SharpDevelop, available at http://www. sourceforge .net/projects/sharpdevelop or http: //www. icsharpcode.net. This is a C# IDE written entirely in C#. Since SharpDevelop is an open source project, the full source to the compiler is also available. This application provides the entire IDE experience. You can edit your code, compile, and debug. It uses the command line compiler provided by the .NET Framework to perform the actual compiling. The one thing that it does not support so far is the display of the DirectX debug spew. For that, you still need to use the DBMon application.




Introduction to 3D Game Engine Design Using DirectX 9 and C#
Introduction to 3D Game Engine Design Using DirectX 9 and C#
ISBN: 1590590813
EAN: 2147483647
Year: 2005
Pages: 98

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net