Search Tips Advanced Search |
| Delphi Graphics and Game Programming Exposed with DirectX 7.0 by John Ayres Wordware Publishing, Inc. ISBN: 1556226373 Pub Date: 12/01/99
Search this book:
Previous | Table of Contents | Next
## Index A A*, 457 absolute measurement, 208 accessing memory, 184-185 Acquire, 219 action games, 13 adventure games, 13 AI, see artificial intelligence algorithms fire, 418 painter’s, 197 path finding, 456-457 rotation, 387-388 scaling, 383 star fields, 412 texture mapping, 405 aligned record fields, 363-364 alpha channel, 116 animation, 172-174, see also frame animation cycle, 175-177 issues, 194-195, 197 palette, 164-167 architecture, 17, 24 DirectX, 107-108 artificial intelligence, 32 artificial intelligence techniques aggression/evasion, 429-430 finite state machines, 437-438 movement, 426 path finding, 455-456 patterned movement, 433-434 probability machines, 446 random movement, 426 audible focus, 311-312 audio buffers, 309, 322-323 audible focus, 311-312 controls, 336-337 creating, 322-326 duplicating, 334-335 format, 309 frequency, 336 locking, 324-325 memory format, 311 memory locations, 310 optimum configuration, 310-311 pan, 336 playing, 325-326 static, 323-326 streaming, 330-331 types, 310 unlocking, 325 volume, 336 audio format, 309-310 automatic compiler optimizations, 362-363 axes, 207-208, 238, 262 B back stepping, 460-461 background graphics, 19 baseline application, 142-150 BGR, 78 binary bit shifting, 372 BitBlt, 87 bitmap manipulation, 378 bitmap transformations, 378 dynamic images, 412 lighting tricks, 392 rotation, 387 scaling, 383 texture mapping, 405 transition effects, 396-397 bitmaps, 74, 86-87 device-dependent, 86 device-independent, 87 direct pixel access, 89 displaying images, 87 displaying under DirectDraw, 133-135 loading, 87, 135 masking, 92 raster operations, 91 blitting surfaces, 135 Blt, 176 BltFast, 135 board games, 14 bounding boxes, 188-189 breadth first search, 456 brushes, 82 buffered data, 208-209 buffers, see audio buffers buttons, 207-208, 238 C C/C++, 5-7, 8-9 calibration, 236 call stack elimination, 362-363 canvas, 81 drawing on, 82-85 card games, 14 casual gamers, 12 CD audio, 346 implementing, 347-350 Red Book Audio, 347 children, 11 coefficient, 260 collision detection, 33, 188 bounding boxes, 188-189 pixel overlap comparison, 191-192 color components, 78 depth, 77 keying, 179-181 palette, see palettes common subexpression removal, 363 compiler optimizations, 363-364 automatic, 362-263 Component Object Model (COM), 114-115 GUID, 115 reference counting, 115 components, color, 78 DirectX, 108-109 conditions, 260, 271-272 damper, 273 friction, 272 inertia, 273 spring, 272 constant arrays, 374 constant forces, 273 cooperative levels, 209-210, 217 DirectDraw, 124 DirectInput, 209-211, 217 DirectSound, 314-315 coordinate systems, 3-D, 413 Cartesian, 412 coordinates, 81 CopyMode property, 91 crawl, 397 CreateDevice, 215 CreateEffect, 282 CreateEvent, 228 CreatePalette, 157 CreateSoundBuffer, 324 CreateSurface, 128 creating DirectDraw objects, 120-121 DirectInput objects, 212 DirectSound objects, 314 effect objects, 282-283 force feedback effects, 279-285 input devices, 215 surfaces, 127-129 custom forces, 278-279 D damper, 273 data types, 368-369 DC, see device context DDB, see device-dependent bitmaps dead code elimination, 363 deadzone, 237 Delphi and DirectX, 109-112 Delphi Blocks, 473-474 code, 481-514 enhancements, 480-481 game states, 474-475 general game architecture, 474 graphics, 477-480 music, 476 player advancement, 474 sound, 476 user input, 475-476 Delphi Games Creator (DGC), 112 Delphi games development, 7 Delphi games programming, 5-10 DelphiX, 111-112 demo state, 39-40 depth, 194, see also z-order depth first search, 457 device context, 80-81 device-dependent bitmaps, 86 device-independent bitmaps, 87 device-specific effects, 276 devices, see also game controller input, keyboard input, mouse input acquiring, 211, 219 audio, 312-313 CD audio, 346-347 enumerating, 212-214 game controllers, 205, 236 keyboard, 204, 220 MIDI, 341 mouse, 205, 224 peripheral input, 22 polling, 31, 209 standard input, 22 DIB, see device-independent bitmaps direct pixel access, 89 Direct3D, 109 DirectDraw, 108 displaying bitmaps, 133 features, 113 functional overview, 113-114 initializing, 118-129 rendering with GDI, 129-130 retrieving capabilities, 139 surfaces, 116 DirectDrawCreate, 120 DirectDrawEnumerateEx, 118 DirectInput, 109, 206 buffered data, 208-209 buttons and axes, 207-208 cooperative levels, 209-211 device acquisition, 211 features, 206-207 functional overview, 207 game controller input, 236-237 immediate data, 208-209 initializing, 211-219, 221, 226 keyboard input, 220-223 mouse input, 224-225 polling and event notification, 209 DirectInputCreate, 212 direction, 262-263 DirectMusic, 109 DirectPlay, 109 DirectSetup, 109, 519 callback function, 521-523 features, 519 functional overview, 519-520 overriding default behavior, 523-525 using, 520-523 verification of driver upgrade, 526-527 DirectSound, 108-109, 307 audible focus, 311-312 audio format, 309-310 buffer memory format, 311 buffer memory locations, 310 buffer types, 310 creating buffers, 322-326 features, 307 functional overview, 308 initialization, 312-316, 320 optimum buffer configuration, 310-311 sound buffers, 309 DirectSoundCreate, 314 DirectSoundEnumerate, 312 DirectX, 104-106 and Delphi, 109-112 architecture, 107-108 baseline application, 142-150 benefits, 106 components, 108-109 components and headers, 111-112 drawbacks, 107 HAL, 107 HEL, 107 redistributables, 517-518, 520 result codes, 150 SDK, 110 DirectXSetup, 522 DirectXSetupGetVersion, 521 DirectXSetupSetCallback, 522 display mode, setting, 124-125 dissolve, 397 Download, 283 drawing lines, 83 pixels, 82 polygons, 83-84 sprites, 185 text, 85 DuplicateSoundBuffer, 334 duration, 261 DXErrorString, 150 dynamic images, 412 fire, 418 star fields, 412 E effects, see bitmap manipulation, force feedback, sound effects EnumDevices, 213 EnumDisplayModes, 121 EnumEffects, 276 enumerating audio devices, 312-313 display devices, 118-119 input devices, 212-214 supported display modes, 121-123 EnumObjects, 247 envelope, 263, 296-297 EULA, 518 event notification, 209, 227-228 exceptions, 365 F fade, 166 females, 11-12 finite state machines, 437-438 fire, 418 first-person shooters, 13 Flip, 130 flipping, see page flipping force feedback, 205, 257 axes, 262 coefficient, 260 condition, 260 creating effects, 279-285 direction, 262-263 duration, 261 envelope, 263, 296 features, 258 functional overview, 258-259 gain, 261 kinetic force, 259 magnitude, 260 modifying at run time, 293-294 sample period, 261 force feedback effects, 263-266 conditions, 271-273 constant forces, 273 custom, 278-279 device-specific effects, 276 periodic forces, 274-275 ramp forces, 273-274 forces, constant, 273 custom, 278-279 kinetic, 259 periodic, 274-275 ramp, 273-274 frame, 172 frame animation, 172-173 frames, rendering, 34 frequency, 336 friction, 272 full-screen mode, 117-118 G gain, 261 game architecture, 24-27 logic, 32 markets, 11-12 modules, 24-27 states, 35-41 types, 12-14 game controller input, 236-237 game controller objects, 238 game controllers, 205 axes, 238 buttons, 238 calibration, 236 deadzone, 237 DirectInput initialization, 241-242 POV hats, 238 range, 237 reading input data, 251 saturation, 237 setting axis properties, 249 setting the data format, 246-247 Windows functions, 238-239 game development opportunities, 10 game development platform attributes, 6-7 game ending, 26, 34 game loop, 26-28 segments, 30-35 game over state, 41 game programming industry, 1-5, 10 GDI, see Graphical Device Interface GetAsyncKeyState, 220 GetAttachedSurface, 128 GetCapabilities, 241-242, 280 GetCaps, 139, 316 GetCurrentPosition, 330 GetCursorPos, 225 GetDC, 129 GetDeviceData, 230-231 GetDeviceState, 222 GetEffectInfo, 265 GetEffectStatus, 291 GetEntries, 164 GetForceFeedbackState, 291 GetObjectInfo, 242 GetPaletteEntries, 158 global variables, 374 Graphical Device Interface, 70 rendering with, 129-130 graphical elements, 72-76 bitmaps, 74 classification of, 75 lines, 73 pixels, 72 polygons, 73-74 graphics, 18-19 GUID, 115 H HAL, 107 hardware palette, 160 hat, see POV hat HEL, 107 hertz (Hz), 310 HPALETTE, 97 human/computer interaction, 204 I IDirectDraw, 120 IDirectDrawPalette, 157 IDirectDrawSurface, 128 IDirectInput, 212 IDirectSound, 314 images, displaying, 87-88 loading, 87 immediate data, 208-209 inertia, 273 initialization, 25 input considerations, 205-206 input data, reading, 251 retrieving, 219-220 input devices, 204-205, see also devices enumerating, 212-214 peripheral, 22 standard, 22 interactive images, 19 intermission state, 40 internal loop, 38 IntersectRect, 189 introduction, 25 J joyGetDevCaps, 239 joyGetPosEx, 239 K keyboard, 204 input, 220-223 kinetic force, 259 L lighting tricks, 392 lines, 73 Lock, 184, 324-325 locking surfaces, 183-184 lookup tables, 370-371 loop induction variables, 363 loop unrolling, 369 loops, see also game loop internal, 38 lost surfaces, 138-139 M magnitude, 260 masking, 92 MCISendCommand, 340-341 measurements, 208 melt, 396 memory, accessing, 184-185 allocation, 373 buffer format, 311 video board, 78 Microsoft Foundation Classes (MFC), 2 MIDI, 341 implementing, 341-345 mixing, 304 modes, non-palettized, 80 palettized, 79-80 motion, 175-177 mouse, 205 mouse input, 224 device acquisition, 229 DirectInput initialization, 226-227 event notification, 227-228 mouse cursor responsiveness, 224 reading input data, 229-232 secondary thread creation, 229 Windows functions, 225 movement, 426 aggression/evasion, 429-430 patterned, 433-434 random, 426 music, 21, 339-340 CD audio, 346-350 MIDI, 341-345 Red Book Audio, 347 N non-palettized modes, 80 O object method types, 366-367 Object Pascal, 8 objects IDirectDraw, 120 IDirectDrawPalette, 157 IDirectDrawSurface, 128 IDirectInput, 212 IDirectSound, 314 TBitmap, see TBitmap TCanvas, see TCanvas TDIEffect, 264 TDIEnvelope, 297 optimization, 357, see also profilers automatic compiler optimizations, 362-363 compiler optimizations, 363-364 considerations, 373-374 Delphi-specific, 361-369 general, 369-372 theory, 358 optimum buffer configuration, 310 overflow checking, 364 overscan, 159 P page flipping, 116-117, 126-127 painter’s algorithm, 197 palettes, 79, 95, 156-157 and GDI functions, 163 animation, 164-167 DirectDraw, 157-160 disconnecting, 163 hardware, 160 HPALETTE, 97 logical vs. system, 96 primary surface, 160 TPaletteEntry, 97 using, 97 palettized modes, 79-80 pan, 336 Pascal, see Object Pascal path finding, 455-456 algorithms, 456-457 back stepping, 460-461 basic implementation, 457-460 enhancements, 470-471 example, 462-470 paused state, 40 pens, 82 periodic forces, 274-275 peripheral input devices, 22 pixel checking, 183 pixel overlap comparison, 191-192 pixels, 72 Play, 325 playing state, 40 PlaySound, 305 polling, 30-31, 209 polygons, 73-74 POV hat, 216, 238 primary buffer format, 320-321 primary sound driver, 313 probability machines, 446 profilers, 358 effective optimization, 360 examining the algorithm, 359 timing code, 358 Project JEDI, 110-111 pulse code modulation (PCM), 309 puzzle games, 14 R ramp forces, 273-274 range checking, 364 range, 237 raster graphics, 75 raster operations, 91 real-time event-driven programming, 23 real-time strategy games, 12-13 rectangles, manipulating, 189 Red Book Audio, 347 reference counting, 115 register optimization, 362 relative measurement, 208 ReleaseDC, 129 rendering with GDI, 129-130 resolution, 76-77 Resource Interchange File Format (RIFF), 309 Restore, 138 restoring lost surfaces, 138-139 result codes, 150 retrieving audio device capabilities, 316-317 available drive space, 521 DirectDraw capabilities, 139 effect status, 291 force feedback system state, 291-292 input data, 219-220 the DirectX version, 150-151 user input, 30-31 RGB, 78 RingZero GDK, 112 rotation, 387 S sample period, 261 saturation, 237 scaling, 383 ScanLine property, 89-90 screen transitions, 166-167 SendForceFeedbackCommand, 292 SetColorKey, 180 SetCooperativeLevel, 124, 217, 315 SetCurrentPosition, 325 SetDataFormat, 216 SetDisplayMode, 125 SetEntries, 164-165 SetEventNotification, 228 SetFormat, 320 SetPalette, 160 SetParameters, 293 SetProperty, 217 setting the cooperative level, 124, 314-315 the display mode, 124-125 the primary buffer format, 320-321 Shoot ’em case study, 41-66 shutdown and exit, 27 simulations, 14 sound, 20, see also DirectSound sound buffers, 309, see also audio buffers sound effects, 20-21, 33, 304 mixing, 304 simplistic, 304-305 special effects, see bitmap manipulation speed delay, 35 sports games, 14 spring, 272 SpriteLib, 20 sprites, 19, 171, see also collision detection attributes, 175 drawing, 185 transparency issues, 178-181, 183 updating positions, 32-33 stack frames, 364 standard input devices, 22 star fields, 412 Start, 284 startup, 26 states, see game states static buffers, 323-326 Stop, 284 streaming buffers, 330-331 string parameters, 368 surfaces, see also palettes backbuffer, 116 blitting, 135 creating, 127-129 flipping, 130-131 locking, 183-184 lost, 138-139 memory location, 134 off-screen, 116 primary, 116 rendering with GDI, 129 unlocking, 187-188 T TBitmap, 87 TCanvas, 81 TDDColorKey, 180 TDDEnumCallbackEx, 119 TDDEnumModesCallback2, 122 TDDSCaps2, 129 TDDSurfaceDesc2, 122 TDICondition, 271 TDIConstantForce, 273 TDICustomForce, 278 TDIDataFormat, 246 TDIDevCaps, 242, 280 TDIDeviceInstance, 213-214 TDIDeviceObjectData, 231 TDIDeviceObjectInstance, 242-243 TDIEffect, 264 TDIEffectInfoA, 265 TDIEnumDeviceObjectsCallbackA, 247 TDIEnumDevicesCallbackA, 213 TDIEnumEffectsCallbackA, 276 TDIEnvelope, 297 TDIJoyState2, 251 TDIKeyboardState, 222 TDIObjectDataFormat, 246 TDIPeriodic, 274-275 TDIPropDWord, 218 TDIPropHeader, 218 TDIPropRange, 219 TDIRampForce, 274 TDSBufferDesc, 323 TDSCaps, 316-317 TDSEnumCallback, 312-313 TDSetup_Callback, 522, 524 TDSetup_CB_UpgradeInfo, 526 texture mapping, 405 timing, 194-195, 358-359 TMCI_Open_Parms, 342 TMCI_Play_Parms, 343 TMCI_Set_Parms, 343 TMCI_Status_Parms, 344 TPaletteEntry, 97, 158 transition effects, 396-397 transparency issues, 178-181, 183 simulating, 92-95 TransparentMode, 92 TTrueColor, 158 turn-based strategy games, 13 TWaveFormatEx, 309 U Unload, 283 Unlock, 188, 325 unlocking a surface, 187-188 user input, 21-22 retrieving, 30-31 V variants, 367 vector graphics, 75 video board memory, 78 video mode, 76 color depth, 77-78 resolution, 76-77 video palette, see palettes volume, 336 W WaitForMultipleObjects, 229-230 windowed mode, 117-118 Windows palette manager, see palettes Z z-order, 194, 197
Previous | Table of Contents | Next

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 whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.