search for books and compare prices
Tables of Contents for Beginning Directx 9
Chapter/Section Title
Page #
Page Count
Introduction
xv
 
PART I GETTING DOWN THE BASICS
1
62
Chapter 1 The What, Why, and How of DirectX
3
6
What Is DirectX?
3
1
The Components
4
1
Why Is DirectX Needed?
4
1
How Is DirectX Put Together?
5
2
The Component Object Model
6
1
The Architecture
6
1
Chapter Summary
7
2
Chapter 2 Your First DirectX Program
9
26
Creating the Project
9
2
Adding the Windows Code
11
5
Win Main
12
1
InitWindow
13
1
WndProc
14
2
Time for DirectX
16
6
The Direct3D Object
16
1
Creating the Rendering Device
17
2
Clearing the Screen
19
1
Displaying the Scene
20
1
Cleaning Up
21
1
Updating the Code
22
3
Changing the Message Loop
22
1
The Init Function
23
1
The Render Function
24
1
The cleanup Function
25
1
Adding the DirectX Libraries
25
2
Taking the Game Full Screen
27
7
Video Modes and Formats
29
1
Gathering Video Adapter and Driver Information
29
1
Getting the Display Modes for an Adapter
30
2
A Code Example for Querying the Video Adapter
32
2
Chapter Summary
34
1
Chapter 3 Surfaces, Sprites, and Salmon
35
28
You've Just Touched the Surface
35
11
The Display Buffers
36
1
Offscreen Surfaces
36
1
Loading a Bitmap to a Surface
37
2
Using DirectX to Render a Bitmap
39
3
StretchRect Revisited
42
4
Sprites
46
11
What Do Sprites Need?
46
1
Representing a Sprite in Code
46
1
Creating Your First Sprite
47
4
Moving Your Sprite
51
2
Animating Your Sprite
53
2
Displaying the Animated Sprites
55
2
Why Is It So Fast?
57
1
Timers: How to Animate on Time
57
4
Timing Under Windows
57
1
Using QueryPerformanceCounter
58
1
Getting the Time for Each Frame
58
1
Changing the Animation to Be Time Based
59
2
Chapter Summary
61
2
PART II IT'S A 3D WORLD AFTER ALL
63
136
Chapter 4 3D Primer
65
22
3D Space
65
1
Coordinate Systems
66
2
Defining a Point in 2D Space
66
1
Defining a Point in 3D Space
67
1
Left-Handed Systems
68
1
Right-Handed Systems
68
1
Vertices Explained
68
3
Creating a Shape
69
1
Adding Color
70
1
Vertex Buffers
71
11
Creating a Vertex Buffer
71
1
Flexible Vertex Format
72
2
Loading Data into a Buffer
74
4
Drawing the Contents of the Buffer
78
4
Primitive Types
82
3
Point List
83
1
Line List
83
1
Line Strip
83
1
Triangle List
83
1
Triangle Strip
84
1
Triangle Fan
85
1
Chapter Summary
85
2
Chapter 5 Matrices, Transforms, and Rotations
87
30
Creating a 3D Model
87
5
Defining the Vertex Buffer
88
3
Rendering the Cube
91
1
Index Buffers
92
5
Generating a Cube by Using Index Buffers
93
1
Creating and Filling the Index Buffer
94
3
The Geometry Pipeline
97
2
World Transformation
98
1
View Transformation
98
1
Projection Transformation
98
1
What Is a Matrix?
99
5
The Identity Matrix
100
1
Initializing a Matrix
100
1
Multiply Matrices
101
1
How Direct3D Defines a Matrix
102
1
D3DX Makes Matrices Easier
102
2
Manipulating 3D Objects by Using Matrices
104
8
Moving an Object Around
104
1
Rotating an Object
105
3
Center of Rotation
108
2
Scaling
110
1
Order of Matrix Operations
111
1
Creating a,Camera by Using Projections
112
3
Positioning and Pointing the Camera
113
2
Chapter Summary
115
2
Chapter 6 Vertex Colors, Texture Mapping, and 3D Lighting
117
30
Changing the Color of an Object
117
2
Vertex Colors Revisited
118
1
Color Macros
119
1
Shading
119
3
Flat Shading
120
1
Gouraud Shading
121
1
Choosing the Shading Mode
121
1
Fill Mode
122
2
Lighting Explained
124
1
Lighting Types
124
3
Ambient Light
124
1
Directional Lights
125
1
Point Lights
125
1
Spotlights
126
1
Light Properties
127
1
Creating Lights in a Scene
128
6
Creating an Ambient Light
129
1
Creating a Directional Light
130
1
Creating a Point Light
131
1
Creating a Spotlight
132
2
Materials Explained
134
2
Diffuse Reflection
134
1
Ambient Reflection
134
1
Specular Reflection
134
1
Emission
135
1
How Materials Are Used
135
1
Specular Highlights
136
1
Texture Mapping
136
3
How Direct3D Uses Textures
137
1
How Textures Are Applied
137
1
Texture Coordinates
138
1
Texture Stages
139
1
Texture Stage States
139
1
Loading a Texture
139
6
Applying a Texture
142
3
Chapter summary
145
2
Chapter 7 Meshes
147
30
Creating a 3D World
147
1
What Is a Mesh?
148
1
How Direct3D Defines a Mesh
148
1
Creating a Mesh
148
14
Filling the Mesh
151
3
Displaying a Mesh
154
1
Optimizing a Mesh
155
7
Predefined Meshes
162
7
D3DX Object Creation
163
5
The Direct3D Mesh Format: The X File
168
1
Saving a Mesh to an X File
169
3
D3DXSaveMeshToX
169
3
Loading a Mesh from an X File
172
3
Using the D3DXLoadMeshFromX Function
172
3
Chapter Summary
175
2
Chapter 8 Point Sprites, Particles, and Pyrotechnics
177
22
Particles
177
5
Particle Properties
178
1
The Particle Structure
178
1
How Are the Particles Created?
179
1
How Do the Particles Move?
180
2
Particle Systems
182
11
Designing a Particle System
182
2
Coding a Particle System Manager
184
9
Point Sprites: Making Particles Easy
193
4
Using Point Sprites in Direct3D
193
1
How to Use Point Sprites
194
3
Chapter Summary
197
2
PART III ADDITIONAL NEEDS
199
94
Chapter 9 Using DirectInput
201
36
I Need Input
201
2
Using DirectInput
203
27
Creating the DirectInput Object
204
1
Creating the DirectInput Device
205
1
Setting the Data Format
206
1
Setting the Cooperative Level
207
2
Acquiring Access
209
1
Getting Input
209
1
Enumerating Input Devices
210
4
Getting the Device Capabilities
214
2
Getting Input from a Keyboard
216
1
Getting Input from a Mouse
217
4
Using a Gamepad or Joystick
221
5
Supporting Multiple Input Devices
226
2
Reacquiring an Input Device
228
1
Cleaning Up DirectInput
229
1
Force Feedback
230
6
Force Feedback Effects
230
1
Enumerating the Input Devices for Force Feedback
231
1
Creating a Force Feedback Effect
232
3
Starting an Effect
235
1
Stopping an Effect
235
1
Chapter Summary
236
1
Chapter 10 DirectSound
237
20
Sound
237
1
DirectSound
238
6
How Does DirectSound Work?
238
1
Using DirectSound
239
5
Sound Files
244
11
The Secondary Buffer
244
3
Creating a Secondary Buffer
247
1
Loading a Sound File into a Buffer
248
7
Chapter Summary
255
2
Chapter 11 The Final Project
257
36
Welcome to the Final Project
257
1
Creating the Application Window
258
4
Win Main
258
1
init Window
259
2
WndProc
261
1
Initializing DirectX
262
4
The DirectX Manager
262
2
Hooking in the DirectX Manager
264
2
Coding the Demo
266
4
The Game Application Class
266
1
Creating the Game Timer
267
1
Hooking the Game Application into WinMain
268
2
Adding Objects to the World
270
7
The CGameObject Class
271
1
The CModel Class
272
4
The Game Object List
276
1
Creating the Planet
277
4
The CPlanet Class
277
3
Adding the Planet to the Scene
280
1
Adding a Spaceship
281
2
Moving in the Universe
283
5
The Spaceship Move Function
283
2
Bringing in DirectInput
285
3
Releasing Your Creation to the World
288
1
Packaging Your Game for Release
288
1
What Tools Are Available to Bundle My Game?
289
1
The DirectX Runtime
289
3
Shipping the DirectX Runtime with Your Game
289
1
Installing the DirectX Runtime
290
2
Chapter Summary
292
1
PART IV APPENDIXES
293
22
Appendix A Answers to End-of-Chapter Exercises
295
16
Appendix B Using the CD-ROM
311
4
What's on the CD-ROM
311
1
Installing the DirectX SDK
311
4
Glossary
315
3
Index
318