Tricks of the Windows Game Programming Gurus:Journey into the Abbys

All ITKnowledge Source Code Search Tips Advanced Search |

| Tricks of the Windows Game Programming Gurus by Andre LaMothe Sams, Macmillan Computer Publishing ISBN: 0672313618 Pub Date: 09/27/99

Search this book:

Previous | Table of Contents | Next

### Using Tools

Writing video games used to require nothing more than a text editor and maybe a homemade paint program. However, today things are a little more complicated. At a minimum, you need a C/C++ compiler, a 2D paint program, and a sound processing program. In addition, you might need a 3D modeler if you’re going to do a 3D game, along with a music sequencing program if you’re going to use any MIDI.

Let’s take a look at some of the more popular products and what they do.

#### C/C++ Compilers

For Windows 9X/NT development, there’s simply no better compiler than MS VC++ 5.0+. It does everything you need it to, and more. The `.EXE`s generated are the fastest code available. The Borland compiler will also work fine (and is a lot cheaper), but it has a much smaller feature set. In either case, you don’t need the full-blown version of either one. A student version that makes Win32 `.EXE`s is more than enough.

#### 2D Art Software

Here you have paint programs, drawing programs, and image processing. Paint programs primarily allow you to draw images pixel by pixel with primitives and manipulate them. As far as I’m concerned, Paint Shop Pro 5.0+ by JASC is the leader of the pack for price vs. performance. Fractal Design Painter is also great, but it’s more for traditional artists, not to mention that it’s very expensive. My favorite is Corel Photo-Paint, but that’s definitely more firepower than most newbies need.

On the other hand, drawing programs allow you to create images that are mostly constructed from curves, lines, and 2D geometrical primitives. These types of programs aren’t as useful, but if you need one, Adobe Illustrator is the way to go.

The final class of 2D art programs is the image processing type. These programs are more for post-production work than for art creation. Adobe Photoshop is the favorite in most circles, but I think Corel Photo-Paint is better. Decide for yourself.

#### Sound Processing Software

Ninety percent of all sound effects (SFX) used in games today are digitized samples. To work with sound data of this type, you’re going to need a digital sound processing program. The best program in this genre is Sound Forge Xp. It has by far the most complex sound processing capabilities I have ever seen, and yet it’s the simplest to use.

#### 3D Modelers

This is where things get financially challenging. 3D modelers can cost tens of thousands of dollars, but recently a number of low-cost modelers have shown up that have enough power to literally make a movie. The modeler that I primarily use for simple-to-medium-scale 3D models and animation is Caligari trueSpace III+. This is the best 3D modeler for the price. It’s a few hundred dollars and has the best interface there is.

If you want a little more firepower and absolute photorealism, 3D Studio Max II+ is the way to go. It’s around $2,500, though, so that might be something to think about. However, for the most part we’re going to use these modelers just to create 3D meshes, not for rendering, so all the bells and whistles aren’t really needed. trueSpace is the way to go.

#### Music and MIDI Sequencing Programs

There are two kinds of music in today’s games: pure digital (like a CD) and MIDI (Musical Instruments Digital Interface), which is a synthesized performance based on note data. If you want to manipulate MIDI information and songs, you’ll need a sequencing package. One of the best and most reasonably priced is called Cakewalk, so I suggest that you look into this program if you plan on recording and manipulating MIDI music. I’ll talk about MIDI data when covering DirectMusic in Chapter 10, “Sounding Off With DirectSound and DirectMusic.”

And now for the cool part… A number of the software manufacturers listed here have allowed me to put shareware or evaluation versions on the CD, so make sure to check them out!

### Setting Up to Get Down—Using the Compiler

One of the most frustrating parts of learning Windows game programming is learning how to use the compiler. In most cases, you’re so excited to get started that you dive into the IDE and try to compile, and a million compiler and linker errors pop up! To help with this problem, let’s cover a few basic compiler concepts here.

  0. Read the entire compiler instructions—please, please, I beg you!
  1. You must install the DirectX SDK on your system. All you need to do is navigate to the `<DirectX SDK>` directory on the CD, read `README.TXT`, and do what it says (which should be nothing more than “Click on the DirectX SDK `INSTALL.EXE` program”).
  2. We are going to make Win32 `.EXE` programs, not `.DLL`s, ActiveX components, etc. So if you want to compile, the first thing you need to do with your compiler is create a new project or workspace and set the target output file to Win32 `.EXE`. This step is shown for the VC++ 5.0 compiler in Figure 1.6.

  Figure 1.6 Creating a Win32 .EXE with Visual C++ 5.0.

  3. Add the source files to the project using the ADD Files command from the main menu or from the project node itself. This is shown for the VC++ 5.0 compiler in Figure 1.7.

  Figure 1.7 Adding files to a project with VC++ 5.0.

  4. When you get to the DirectX chapters, and from there on, you’re going to have to include the DirectX COM interface libraries listed here and shown in Figure 1.8.
    • DDRAW.LIB
    • DSOUND.LIB
    • DSOUND3D.LIB
    • DINPUT.LIB
    • DMUSIC.LIB
    • DSETUP.LIB

  Figure 1.8 The resources needed to create a Win32 DirectX application.

  These DirectX `.LIB` files are located in the `<LIB>` directory wherever you installed the DirectX SDK. You must add these `.LIB` files to your project or workspace. You can’t just add the search path, because the search engine will probably find old DirectX 3.0 `.LIB` files along with installation libraries of the compiler itself. While you’re at it, you may have to add the Windows Multimedia Extensions library, `WINMM.LIB`, to your project. This file is located in the `<LIB>` directory of your compiler installation.

  5. You’re ready to compile your program.

> Warning: If you’re a Borland user, there is a separate Borland library directory within the DirectX SDK. So make sure to add those `.LIB` files—not the MS-compatible files higher up in the directory tree.

If you still have questions about this, don’t worry. I will revisit these steps a number of times throughout the book when discussing Windows programming and your first contact with DirectX.

Previous | Table of Contents | Next

Copyright © Macmillan Computer Publishing, Inc.

Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction in whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.