|
||||||
![]() |
||||||
![]() ![]() ![]() ![]() ![]() |
![]() |
|
|
Introduction
A long time ago, in a galaxy far, far, away, I wrote a book about game programming called Tricks of the Game Programming Gurus. For me, it was an opportunity to create something that I had always wanteda book that taught the reader how to make games. Anyway, its been a few years and Im a little older and wiser, and I have definitely learned a lot of tricks <BG>. This book is going to continue where the old book left off. Im going to cover every major topic in game programming that I can fit within the binding of this bad boy! However, as usual, Im not going to assume that you are already a master programmer or that you even know how to make games. This book is for beginners as well as advanced game programmers. Nonetheless, the tempo is going to be fierce, so dont blink! Today is probably the coolest time in history to be in the game business. I mean, we now have the technology to create games that do look real! Imagine what will come next? But all this technology isnt easy to understand or trivialit takes hard work. These days the bar has definitely been raised on the skill set needed to make games. But if youre reading this, you are probably one of those people who like a challenge, right? Well, you came to right place, because when youre done with this book you will be able to create a full 3D, texture-mapped, professionally lit video game for the PC. Moreover, you will understand the underlying principles of artificial intelligence, physics modeling, game algorithms, 2D/3D graphics, and be able to use 3D hardware today and in the future. What Youre Going to Learn In this book youre going to learn about 100 teraquads of information! Im going to fill your neural net so full of information that you might have synaptic leakage! Seriously, though, this volume covers all the elements necessary to create a Windows 9X/NT-based game for the PC:
And more This book is primarily about game programming. There are two cyber-books on the CD that cover Direct3D Immediate mode and General 3D. What You Need to Know This book assumes that you can program. You are going to be fairly lost if you cant write C code. However, the book uses some C++enough to make a C coder just a little uneasy. But I will warn you if Im doing anything weird. Also, theres a decent C++ primer in Appendix D, so check it out if you need a crash course. Basically, C++ is only needed here and there for examples when using DirectX. Nevertheless, Ive decided that Im going to use C++ a little more on this book because there are so many things in game programming that are object-oriented, and its sacrilege to force them to be C-like structures. Bottom lineif you can program in C, you should be fine. If you program in C/C++, you shouldnt trip out at all. Everyone knows that a computer program is nothing more than logic and math. Well, 3D video games put the emphasis on the math part! 3D graphics is all math. Luckily for us, its cool math! (Yes, math can be cool.) About the only thing you need to know is basic algebra and geometry. The vector and matrix stuff I will teach you along the way. Heck, if you can add, subtract, multiply, and divide, you will be able to understand 90 percent of whats going even though you may not be able to rederive it. As long as you can use the code, thats all the matters. (Well, that and if 7 of 9 is on Voyager tonight.) Thats really all you need to know. Of course, youd better call all your friends and tell them that they wont see you for about two years, because youre going to be a little busy. But just think of all the movies youll get to rent when youre done with your training! How This Book Is Organized Tricks of the Windows Game Programming Gurus is divided into four parts, covering 14 chapters and six appendixes. Part I: Windows Programming Foundations
Part II: DirectX and 2D Fundamentals
Part III: Hardcore Game Programming
Part IV: Appendixes
Installing the CD-ROM The CD-ROM contains all the source, executables, sample programs, stock art, 3D modelers, sound effects, and bonus technical articles that make up the book. Heres the directory structure:
CD-DRIVE:\
T3DGAME\
SOURCE\
T3DCHAP01\
T3DCHAP02\
.
.
T3DCHAP14\
APPLICATIONS\
ARTWORK\
BITMAPS\
MODELS\
SOUND\
WAVES\
MIDI\
DIRECTX\
GAMES\
GOODIES\
ARTICLES\
ONLINEBOOKS\
ENGINES\
Each main directory contains specific data that youll need. Heres a more detailed breakdown:
There isnt any general installation program for the CD because there are so many different types of programs and data. Ill leave the installation to you. However, in most cases, youll simply copy the SOURCE\ directory to your hard drive and work within it. As for the other programs and data, youll probably install them as you need them. Installing DirectX About the only important part of the CD that you must install is the DirectX SDK and Run-Time files. The installation program is located within the DIRECTX\ directory, along with a README.TXT file explaining any last-minute changes.
Compiling the Programs I wrote the code for this book with Microsoft Visual C++ 5.0/6.0. However, in most cases the programs will work with any Win32-compliant compiler. Nevertheless, I suggest Microsoft VC++ because it works the best for this type of work. If you are unfamiliar with your compilers IDE, you are going to be wildly lost compiling Windows programs. Please take the time to learn your way around the compiler, and at least know how to compile a Hello World console program or something similar before you dive into compiling the programs. To compile Windows Win32 .EXE programs, all you need to do is set the target of your program project to Win32 .EXE and compile. However, to create DirectX programs, you must include the DirectX import libraries in your project. You may think that you can simply add the DirectX libraries to your include path, but that wont work! Save yourself a headache and include the DirectX .LIB files in your project or workspace manually. You can find the .LIB files in the LIB\ directory, right under the main DirectX SDK directory that you installed under. That way there wont be any linker confusion. In most cases, youll need the following:
Ill go into more detail on these files when you actually start working with them, but at least keep them in mind when you start getting unresolved symbol errors from your linker. I dont want any emails on this subject from rookies! In addition to the DirectX .LIB files, you must include the DirectX .H header files in your header search path, so keep that in mind. Also, be sure to make the DirectX SDK directories first in the search path list, because many C++ compilers contain old versions of DirectX and the old headers might be found in the compilers own INCLUDE\, which is wrong. The proper place is the DirectX SDK include directory, which is located in the main installation directory of the DirectX SDK in INCLUDE\. Finally, if you use Borland products, make sure that you use the Borland versions of the DirectX .LIB files. They can be found in the BORLAND\ directory of the DirectX SDK installation.
Copyright © Macmillan Computer Publishing, Inc.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
|