did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9781556227417

Learn Computer Game Programming With Directx 7.0

by
  • ISBN13:

    9781556227417

  • ISBN10:

    1556227418

  • Format: Paperback
  • Copyright: 2000-08-01
  • Publisher: Jones & Bartlett Pub
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $49.95

Summary

Another addition to the Wordware Game Developer's Library, Learn Computer Game Programming with DirectX 7.0 provides beginning programmers with the foundations of computer game programming using Microsoft's DirectX 7.0 software. Computer science professor Ian Parberry details the construction of a game demo in 14 easy stages using DirectDraw, DirectSound, the Windows API, and the Windows registry, including a detailed explanation of the program's C++ code.

Table of Contents

Foreword xv
Preface xvi
Acknowledgments xix
Read This First
2(14)
Are You Reading This in the Bookstore?
3(2)
What You Need to Know
5(1)
DirectX: Who, What, Where, When, How, and Why?
5(2)
The Who
5(1)
The What
5(1)
The Where
6(1)
The When
6(1)
The How
6(1)
The Why
6(1)
How to Use This Book
7(1)
Using the Companion CD
8(3)
Installing Ned's Turkey Farm
10(1)
Installing the DirectX 7.0a SDK
10(1)
Setting up Visual C + + 6.0
11(5)
Setting the Include and Library Directories
11(2)
Creating a Project
13(2)
The Linker Settings
15(1)
Displaying the Background
16(34)
Experiment with Demo 0
18(1)
Choosing the Screen Format
18(2)
Getting Started
20(2)
WinMain
22(2)
Creating a Full-screen Window
24(2)
Setting Up DirectDraw
26(3)
Declarations
26(1)
The DirectDraw Object
26(1)
The Primary Surface
27(1)
The Palette
28(1)
Loading Graphics
29(1)
The Window Procedure
30(2)
The Bmp File Reader
32(9)
Palettized Art
33(1)
The Bmp File Format
34(1)
Bmp File Reader Overview
35(1)
Loading Bmp Files
36(3)
Drawing to a Surface
39(2)
Setting the Palette
41(1)
Demo 0 Files
41(1)
Code Files
41(1)
Media Files
42(1)
Required Libraries
42(1)
Code Listings
42(8)
Bmp.h
42(1)
Bmp.cpp
43(2)
Ddsetup.cpp
45(2)
Defines.h
47(1)
Main.cpp
47(3)
Page Flipping
50(16)
Experiment with Demo 1
52(1)
Why Flip Pages?
53(4)
The Video Serializer
53(1)
Tearing
54(2)
How to Avoid Tearing
56(1)
The Secondary Surface
57(3)
Demo 1 Files
60(1)
Code Files
60(1)
Media Files
60(1)
Required Libraries
60(1)
Code Listings
61(5)
Ddsetup.cpp
61(2)
Main.cpp
63(3)
Full-screen Animation
66(12)
Experiment with Demo 2
67(1)
The Timer
68(1)
Using the Timer
69(3)
Demo 2 Files
72(1)
Code Files
72(1)
Media Files
72(1)
Required Libraries
72(1)
Code Listings
73(5)
Main.cpp
73(3)
Timer.h
76(1)
Timer.cpp
76(2)
Sprite Animation
78(30)
Experiment with Demo 3
80(1)
The Sprite File
80(3)
The Bmp Sprite File Reader
83(1)
The Base Sprite
83(5)
Base Sprite Overview
84(1)
Creation and Destruction
85(2)
Loading and Drawing
87(1)
Other Member Functions
88(1)
The Object Class
88(4)
Object Overview
88(1)
Object Code
89(1)
The Move Function
90(2)
Changes to Ddsetup.cpp and Main.cpp
92(3)
The LoadPlaneSprite and LoadImages Functions
92(1)
The CreateObjects Function
93(1)
The RestoreSurfaces Function
94(1)
The ComposeFrame Function
94(1)
The Window Procedure and WinMain
94(1)
Demo 3 Files
95(1)
Code Files
95(1)
Media Files
95(1)
Required Libraries
96(1)
Code Listings
96(12)
Bsprite.h
96(1)
Bsprite.cpp
97(2)
Ddsetup.cpp
99(2)
Defines.h
101(1)
Main.cpp
101(4)
Objects.h
105(1)
Objects.cpp
105(1)
Sbmp.h
106(1)
Sbmp.cpp
107(1)
Sprite Clipping
108(26)
Experiment with Demo 4
110(1)
Creating a DirectDraw Clipper
110(1)
The Clipped Sprite
111(3)
Clipped Sprite Overview
111(1)
Clipped Sprite Code
112(2)
Changes to the Object Class
114(5)
Declarations
114(1)
Some Code Changes
115(1)
The Draw Function
115(2)
The Create Function
117(1)
The Accelerate and Move Functions
118(1)
Changes to Main.cpp
119(3)
The LoadCrowSprite Function
119(1)
The LoadImages Function
119(1)
The CreateObjects Function
120(1)
The RestoreSurfaces Function
120(1)
The ComposeFrame Function
120(1)
The Keyboard Handler
121(1)
The Window Procedure
121(1)
Demo 4 Files
122(1)
Code Files
122(1)
Required Libraries
122(1)
Code Listings
123(11)
Csprite.h
123(1)
Csprite.cpp
123(1)
Ddsetup.cpp
124(2)
Main.cpp
126(5)
Objects.h
131(1)
Objects.cpp
131(3)
Parallax Scrolling
134(34)
Experiment with Demo 5
136(1)
The Viewpoint Manager
136(6)
Viewpoint Manager Overview
137(1)
Viewpoint Manager Code
138(2)
Drawing the Background
140(2)
The Object Manager
142(4)
Object Manager Overview
142(1)
The Constructor and Destructor
143(1)
The Create Function
144(1)
The Animate Function
145(1)
Other Member Functions
145(1)
Generating Pseudorandom Numbers
146(2)
Changes to the Object Class
148(2)
Changes to Main.cpp
150(3)
Loading Sprites
150(1)
The CreateObjects Function
151(1)
Other Functions
152(1)
Demo 5 Files
153(1)
Code Files
153(1)
Media Files
153(1)
Required Libraries
154(1)
Code Listings
154(14)
Main.cpp
154(5)
Objects.h
159(1)
Objects.cpp
160(2)
Objman.h
162(1)
Objman.cpp
163(1)
Random.h
164(1)
Random.cpp
164(1)
View.h
165(1)
View.cpp
166(2)
Artificial Intelligence
168(44)
Experiment with Demo 6
170(1)
Intelligent Objects
170(7)
Intelligent Object Overview
171(1)
Intelligent Object Code
172(1)
Moving and Thinking
173(1)
The Plane and Distance
174(1)
Changing State
175(1)
Cruising Al
176(1)
Avoidance Al
176(1)
Changes to the Object Class
177(5)
Declarations
177(2)
The Constructor
179(2)
Drawing and Moving
181(1)
Changes to the Object Manager Class
182(8)
Declarations
183(1)
The Constructor
184(1)
The Animate Function
184(1)
The Distance Functions
185(1)
Killing and Firing the Gun
186(1)
Culling Objects
186(1)
The Replace Function
187(1)
Collision Detection
188(2)
Changes to Main.cpp
190(2)
Loading Sprites
190(1)
The CreateObjects Function
191(1)
Other Functions
191(1)
Demo 6 Files
192(1)
Code Files
192(1)
Required Libraries
192(1)
Code Listings
193(19)
Ai.h
193(1)
Ai.cpp
193(3)
Main.cpp
196(6)
Objects.h
202(1)
Objects.cpp
203(3)
Objman.h
206(1)
Objman.cpp
207(5)
The Game Shell
212(22)
Experiment with Demo 7
215(1)
Changes to the Object Manager
215(2)
Phase Management
217(6)
The Display_screen Function
217(1)
The Change_phase Function
218(1)
The Redraw Function
219(1)
The ProcessFrame Function
219(2)
The Keyboard Handlers
221(2)
Demo 7 Files
223(1)
Code Files
223(1)
Media Files
224(1)
Required Libraries
224(1)
Code Listings
224(10)
Defines.h
224(1)
Main.cpp
224(10)
Sound
234(44)
Experiment with Demo 8
235(1)
The Sound List
236(1)
Sound Quality
236(2)
The Sound Manager
238(14)
Sound Manager Overview
238(4)
The Constructor and Destructor
242(1)
The Clear Function
243(1)
The Load Function
244(1)
The Play Function
245(2)
The Stop Functions
247(1)
The CopyBuffer Function
247(1)
The CreateBuffer Function
248(2)
The LoadBuffer Function
250(2)
The LoadSound Function
252(1)
Changes to the Object Classes
252(2)
Changes to the Base Object
252(2)
Changes to the Intelligent Object
254(1)
Changes to Main.cpp
254(2)
Demo 8 Files
256(2)
Code Files
256(1)
Media Files
257(1)
Required Libraries
258(1)
Code Listings
258(20)
Main.cpp
258(9)
Objects.cpp
267(4)
Sndlist.h
271(1)
Sound.h
271(1)
Sound.cpp
272(6)
The Mouse
278(60)
Experiment with Demo 9
280(1)
The Elusive DirectDraw Mouse Cursor
280(2)
The Button Manager
282(11)
Button Manager Overview
282(4)
The Constructors and the Destructor
286(1)
The Set_radio and Addbutton Functions
287(1)
The Hit Function
287(1)
The Release and PointInRect Functions
288(1)
The LoadImages and Loadsprite Functions
288(1)
The Restore and Release Functions
289(1)
The Buttondown Functions
290(1)
The Buttonup and Allbuttonsup Functions
291(1)
The Display_menu Function
292(1)
The Setsounds Function
293(1)
The Input Manager
293(14)
Input Manager Overview
293(2)
The Constructor and Destructor
295(1)
The Restore and Release Functions
296(1)
Setting Up Buttons
296(2)
Keyboard Handlers
298(3)
Mouse Handlers
301(4)
The Mouse as Digital Joystick
305(2)
Changes to the Object and Object Manager Classes
307(1)
Changes to Main.cpp
308(4)
The Change_phase Function
309(2)
Other Functions
311(1)
Demo 9 Files
312(1)
Code Files
312(1)
Media Files
313(1)
Required Libraries
313(1)
Code Listings
313(25)
Buttons.h
313(1)
Buttons.cpp
314(5)
Defines.h
319(1)
Input.h
319(2)
Input.cpp
321(6)
Main.cpp
327(10)
Sndlist.h
337(1)
The Joystick
338(28)
Experiment with Demo 10
339(1)
How the Joystick Works
340(3)
The Joystick Manager
343(7)
Joystick Manager Overview
343(2)
Initializing the Joystick Manager
345(2)
Getting Data From the Joystick
347(1)
Other Member Functions
348(2)
Changes to the Input Manager
350(2)
Declarations
350(1)
Changes to the Code
350(2)
Demo 10 Files
352(1)
Code Files
352(1)
Required Libraries
353(1)
Code Listings
353(13)
Defines.h
353(1)
Input.h
354(1)
Input.cpp
355(7)
Joystick.h
362(1)
Joystick.cpp
363(3)
Winning and Losing
366(70)
Experiment with Demo 11
368(1)
The Score Manager
368(4)
Score Manager Overview
368(1)
Score Manager Code
369(3)
The Text Manager
372(5)
Text Manager Overview
372(2)
Text Manager Code
374(3)
Changes to Defines.h and Sndlist.h
377(1)
Changes to the Input Manager
378(1)
Changes to the Object Class
379(3)
Declarations
379(1)
The Constructor and Destructor
379(3)
The Draw Function
382(1)
Changes to the Object Manager Class
382(5)
Declarations
382(1)
The Constructor and the Create Functions
383(1)
The Accelerate, Kill, and Fire_gun Functions
384(1)
The Replace Function
385(1)
Collision Detection
385(1)
Other Member Functions
386(1)
Changes to Main.cpp
387(9)
Declarations
387(1)
Loading Sprites
388(2)
The CreateObjects Function
390(1)
The RestoreSurfaces Function
390(1)
The LoadSounds Function
390(1)
Drawing Numbers
391(1)
Drawing the Text Header and Player Statistics
392(2)
The Change_phase Function
394(1)
The Redraw and ProcessFrame Functions
395(1)
The Window Procedure
395(1)
Demo 11 Files
396(1)
Code Files
396(1)
Media Files
397(1)
Required Libraries
397(1)
Code Listings
397(39)
Defines.h
397(1)
Input.cpp
398(7)
Main.cpp
405(12)
Objects.h
417(2)
Objects.cpp
419(4)
Objman.h
423(2)
Objman.cpp
425(5)
Score.h
430(1)
Score.cpp
431(1)
Sndlist.h
432(1)
Text.h
433(1)
Text.cpp
434(2)
The High Score List
436(66)
Experiment with Demo 12
438(1)
The Windows Registry
438(3)
Changes to Defines.h and Sndlist.h
441(1)
The High Score Manager
441(17)
High Score Manager Overview
441(3)
High Score Manager Code
444(1)
The Constructor and the Clear Function
445(1)
The Insert Function
445(2)
The Draw Function
447(1)
Loading an Entry from the Registry
448(2)
Loading the High Score List from the Registry
450(2)
Saving an Entry to the Registry
452(1)
Saving the High Score List to the Registry
453(1)
The Made_the_grade Function
454(1)
The Checksums
454(2)
Entering the Player's Name
456(2)
Changes to the Input Manager
458(4)
Declarations
458(1)
Storing the Device in the Registry
458(2)
The Keyboard Handler
460(2)
Changes to Main.cpp
462(5)
Two New Display Functions
463(1)
The Change_phase Function
464(1)
The Redraw and ProcessFrame Functions
465(2)
Demo 12 Files
467(2)
Code Files
467(1)
Media Files
468(1)
Required Libraries
468(1)
Code Listings
469(33)
Defines.h
469(1)
Input.h
469(2)
Input.cpp
471(9)
Main.cpp
480(14)
Sndlist.h
494(1)
Topscore.h
495(1)
Topscore.cpp
496(6)
Pausing the Game
502(55)
Experiment with Demo 13
505(1)
The Pausable Timer
506(2)
Pausable Timer Overview
506(1)
Pausable Timer Code
506(2)
The Pausable Sound Manager
508(5)
Changes to the Sound Manager
508(1)
Pausable Sound Manager Overview
508(1)
Pausable Sound Manager Code
509(1)
Pausing and Unpausing
510(2)
Declaring the Sound Manager
512(1)
Pause Management
513(2)
Changes to the Input Manager
513(1)
Changes to Main.cpp
514(1)
Phase Management
515(6)
The Credits Phase
516(1)
The Help Phase
517(3)
Breaking out of Gameplay
520(1)
Demo 13 Files
521(2)
Code Files
521(1)
Media Files
522(1)
Required Libraries
523(1)
Code Listings
523(34)
Defines.h
523(1)
Gtimer.h
523(1)
Gtimer.cpp
524(1)
Input.h
525(1)
Input.cpp
526(10)
Main.cpp
536(16)
Psound.h
552(1)
Psound.cpp
553(1)
Sndlist.h
554(1)
Sound.h
555(2)
Postscript 557(2)
Index 559

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program