|
|  |
|
Tricks of the Windows Game Programming Gurus
by Andre LaMothe
Sams, Macmillan Computer Publishing
ISBN: 0672313618 Pub Date: 09/27/99
|
Index
Symbols
- & (ampersand), 118
- /* */ comment operator, 929
- // comment operator, 929
- :: operator, 943944
- << operator, 933
- >> operator, 934
- 5.6.5 bit encoding format, 290
- 8-bit bitmaps, loading, 353354
- 8-bit windows modes, 398399
- 16-bit bitmaps, loading, 354355
- 16-bit high-color mode
- bit encoding formats, 289290
- pixel formats
- DDPIXELFORMAT structure, 290293
- finding, 290
- sample program, 293
- writing to screen, 293298
- 24-bit bitmaps, loading, 355356
- 24-bit high-color mode, 299
- 32-bit high-color mode, 300301
- 32-bit variables, 22
A
- A* search, 759
- absolute mode (mouse), 556
- acceleration, 804807
- Acquire() function, 543
- acquiring devices, 543
- joysticks, 573
- keyboard devices, 551
- mouse devices, 559
- reacquisition, 554556
- actions (AI), 741
- addition. See also mathematics
- fixed-point mathematics, 676
- matrices, 449
- vectors, 918919
- AddPort() function, 626
- AddRef() function, 221222
- AdjustWindowRectEx() function, 396
- AI (artificial intelligence), 713715
- design guidelines, 794795
- deterministic algorithms, 715
- evasion algorithms, 722
- random motion, 716717
- tracking algorithms, 717721
- FSMs (finite state machines), 729730
- example, 730734
- personality traits, 734736
- fuzzy logic, 772773
- FAMs (fuzzy associative matrices), 783793
- FLVs (fuzzy linguistic variables), 776779
- fuzzy set theory, 774776
- manifolds, 779783
- normal set theory, 773774
- genetic algorithms, 770772
- memory/learning, 736740
- neural networks, 767770
- McCulloch-Pitts neurode summation() function, 768
- truth table, 769
- pathfinding, 747, 754756
- A* search, 759
- bidirectional breadth-first searches, 757
- breadth-first searches, 756757
- collision avoidance tracks, 749750
- contour tracing, 749
- depth-first searches, 757758
- Dijkstras search, 759
- racing game example, 753754
- trial-and-error algorithms, 748749
- waypoints, 750753
- patterns (control scripting), 722723
- conditional logic, 727729
- creating, 723724
- processing, 725726
- reasonable motion, 726727
- planning
- actions, 741
- decision trees, 742745
- goals, 740741
- hard-coded plans, 742
- implementing, 745747
- production rules, 742
- scripting, 759
- C/C++ compiler, 762767
- Functions section, 763
- Globals section, 763
- Main section, 763
- scripting language design, 759762
- AI-controlled demo mode, 682
- algorithms, 24. See also mathematics
- asymptotic analysis, 657659
- Bresenhams algorithm, 403406
- accuracy, 406
- code listing, 407409
- optimization, 409
- Cohen-Sutherland algorithm, 420427
- collision algorithm, 849852
- deterministic AI (artificial intelligence) algorithms, 715
- evasion algorithms, 722
- random motion, 716717
- tracking algorithms, 717721
- Fibonacci algorithm, 662
- genetic, 770772
- pathfinding, 747, 754756
- A* search, 759
- bidirectional breadth-first searches, 757
- breadth-first searches, 756757
- collision avoidance tracks, 749750
- contour tracing, 749
- depth-first searches, 757758
- Dijkstras search, 759
- racing game example, 753754
- trial-and-error algorithms, 748749
- waypoints, 750753
- recursion, 659662
- Run-Slicing algorithm, 409
- Symmetric Double Step algorithm, 411
- allocating memory, 931
- Alpha(8).8.8.8 bit encoding format, 300
- Alpha.5.5.5 bit encoding format, 289
- ampersand (&), 118
- amplitude, 592, 596
- analyzing algorithms (asymptotic analysis), 657659
- AND operations, 769
- angles
- critical, 826
- of incidence, 830
- of reflection, 830
- Animate_BOB() function, 534
- animation
- color animation, 373379
- double-buffering, 301302
- implementing, 303305
- optimizing, 304
- sample program, 305307
- page flipping, 302303
- Flip() function, 311313
- sample program, 313317
- triple-buffering, 312
- antecedents (production rules), 742
- arcade games, 14
- architecture (Windows)
- event model, 5354
- multitasking, 5152
- multithreading, 5153
- arithmetic. See mathematics
- arrays, 648649
- artificial intelligence. See AI
- ASCII characters, 151, 955960
- assembly language, 679
- asteroid field (Outpost game), 882884
- asymptotic analysis, 657659
- attaching color palettes to surfaces, 272
- audio. See sound
- axons, 767
B
- B-trees. See BSTs (binary search trees)
- back buffers, 243, 307309
- background color, 139140
- backups, 25
- BeginPaint() function, 129130
- behavioral state systems. See FSMs (finite state machines)
- Belm Design Group, 953
- bi-linear filtering, 371
- bidirectional breadth-first searches, 757
- Big O notation, 657
- big-endian format, 290
- binary search trees. See BSTs
- binary shifts, 24
- bit encoding formats, 289290, 300
- BITMAPFILEHEADER structure, 346
- BITMAPINFO structure, 346
- BITMAPINFOHEADER structure, 346347
- bitmaps (.BMP files), 97
- blitting, 317319
- Blit8x8() function, 319320
- Blt() function, 321324
- BltFast() function, 324325
- memory fills, 325328
- offscreen surfaces, 358360, 365366
- surface to surface, 328331
- clipping, 332339
- IDirectDrawClipper interface, 339344
- pixels, 332333
- file structure
- BITMAPFILEHEADER, 346
- BITMAPINFO, 346
- BITMAPINFOHEADER, 346347
- DATA AREA, 347
- functions, 519522
- loading
- 8-bit images, 353354
- 16-bit images, 354355
- 24-bit images, 355356
- LoadBitmap() function, 348
- LoadImage() function, 348349
- Load_Bitmap_File() function, 349351
- mapping
- forward mapping, 368
- inverse mapping, 369
- reading manually, 348
- rotating, 366368
- scaling, 366373
- templates, 352
- unloading, 351352
- bits per pixel (bpp), 133
- black holes, simulating, 815816
- BLACKOUT.H header file (FreakOut), 3133
- blinking lights animation, 374379
- Blink_Colors() function, 525
- Blit8x8() function, 319320
- blitter, 317319
- bitmaps, copying from surface to surface, 328331
- Blit8x8() function, 319320
- Blt() function
- dwFlags parameter, 321324
- lpDDBltFx parameter, 321322
- lpDDSrcSurface parameter, 321
- lpDestRect parameter, 321
- lpSrcRect parameter, 321
- BltFast() function, 324325
- memory fills, 325328
- offscreen surfaces, 358360, 365366
- Blitter Object engine. See BOB engine
- Blt() function
- dwFlags parameter, 321324
- lpDDBltFx parameter, 321322
- lpDDSrcSurface parameter, 321
- lpDestRect parameter, 321
- lpSrcRect parameter, 321
- BltFast() function, 324325
- Blues News Web site, 952
- BMP files. See bitmaps
- board games, 14
- BOB (Blitter Object) engine, 527528
- Animate_BOB() function, 534
- Collision_BOBS() function, 535
- Create_BOB() function, 528530
- Destroy_BOB() function, 530
- Draw_BOB() function, 530531
- Draw_Scaled_BOB() function, 531
- Hide_BOB() function, 535
- Load_Animation_BOB() function, 532
- Load_Frame_BOB() function, 531
- Move_BOB() function, 534
- Set_Animation_BOB() function, 534
- Set_Anim_Speed() function, 533
- Set_Pos_BOB() function, 533
- Set_Vel_BOB() function, 533
- Show_BOB() function, 535
- bouncing objects, modeling, 828830
- bounding boxes, 481484
- bounding circles, 478481
- bpp (bits per pixel), 133
- brainstorming, 1415
- breadth-first searches, 756757
- Bresenhams algorithm, 403406
- accuracy, 406
- code listing, 407409
- optimization, 409
- brushes (GDI), 172173
- BSTs (binary search trees), 662666
- building, 666668
- orders, 662
- searching, 668671
- BS_3STATE button style, 191
- BS_AUTO3STATE button style, 192
- BS_AUTOCHECKBOX button style, 192
- BS_AUTORADIOBUTTON button style, 192
- BS_CHECKBOX button style, 191
- BS_OWNERDRAW button style, 192
- BS_PUSHBUTTON button style, 191
- BS_RADIOBUTTON button style, 191
- buffered data mode (DirectInput), 544
- buffers (DirectSound)
- execute buffers, 218
- primary, 606
- secondary
- circular buffering, 607
- creating, 607610
- locking, 610611
- releasing, 611
- static, 606
- streaming, 606
- unlocking, 611
- writing to, 610611
- busy loops, 701
- buttons
- creating, 193
- notification codes, 193194
- styles, 191192
C
- C++, 925928
- classes, 926, 934
- constructors, 938941
- defining, 935936
- destructors, 939943
- member functions, 937938, 945946
- public/private, 936
- comments, 929
- constants, 929
- inheritance, 926927
- memory management, 931932
- operators
- delete, 931932
- new, 931932
- overloading, 945946
- scope resolution, 943944
- polymorphism, 927928
- stream I/O (input/output), 932934
- structures, 934935
- variable
- creating, 930931
- referential, 929930
- C/C++ compiler, 26, 762767
- configuring, 908
- application types, 909
- code generation, 910
- error-level settings, 909
- optimization settings, 909
- search directories, 909
- struct alignment, 910
- threading models, 910
- typecast errors, 909
- directives, 60
- calculations. See algorithms; mathematics
- Cartesian coordinate system, 174
- cascading menus, 117
- cbClsExtra field (WNDCLASSEX structure), 70
- cbSize field (WNDCLASSEX structure), 67
- cbWndExtra field (WNDCLASSEX structure), 70
- cell-based isometric engines, 496498
- centroids, calculating, 790793
- characters (ASCII), 955960
- child controls. See controls
- cilia, 592
- circles, drawing, 180181
- circular buffering, 607
- class keyword, 935
- classes, 934
- constructors, 938941
- defining, 935936
- destructors, 939943
- inheritance, 926927
- IOSTREAM, 932
- member functions, 937938, 945946
- naming, 57
- public/private, 936
- Windows classes, 66
- registering, 74
- style flags, 6768
- WNDCLASS structure, 67
- WNDCLASSEX structure, 6774
- client area (DirectDraw windows), 395397
- client coordinates, 132
- clip lists, 340342
- clipping, 332
- bitmaps, 334339
- DirectX windows, 397398
- IDirectDrawClipper interface
- clip lists, 340342
- creating, 339
- sample program, 342344
- lines, 411413, 419420
- Cohen-Sutherland algorithm, 420427
- pixels, 332333
- triangles, 464
- Clip_Line() function, 514
- CloseHandle() function, 691692
- Close_Error_File() function, 518
- CLUTs (color lookup tables), 136
- CoCreateInstance() function, 225, 625
- code optimization, 2125, 671672
- algorithms, 24
- assembly language, 679
- backups, 25
- binary shifts, 24
- comments, 23
- double-buffering, 304
- fixed-point math, 673674
- accuracy, 676
- addition, 676
- converting to/from, 674675
- division, 676677
- multiplication, 676677
- representing numbers, 674
- subtraction, 676
- functions
- inline, 22
- mathematical, 672673
- look-up tables, 678679
- loop unrolling, 677678
- simplicity, 2425
- variables, 22
- coefficient of restitution, 844845
- Cohen-Sutherland algorithm, 420427
- CoInitialize() function, 624
- collisions, 810
- 2D object-to-object collision response, 841842
- coefficient of restitution, 844845
- collision algorithm, 849852
- impact events, 843
- impulse force, 843
- n-t coordinate system, 846849
- avoidance tracks, 749750
- collision response, 813
- conservation of momentum, 811
- detecting
- bounding boxes, 481484
- bounding circles, 478481
- point containment, 484486
- elastic vs. non-elastic, 828
- kinetic energy, 812
- line segment intersections, 835840
- vector reflection
- calculating, 830834
- example, 834835
- x,y bounce physics, 828830
- Collision_BOBS() function, 535
- Collision_Test() function, 526
- color
- animation, 373379
- CLUTs (color lookup tables), 136
- color keys, 360361
- destination color keying, 364365
- source color keying, 361363
- depth, 133
- DirectDraw palettes
- attaching to surfaces, 272
- color depths, 257
- creating, 259263
- foreground/background, 139140
- high-color modes
- 16-bit, 289298
- 24-bit, 299
- 32-bit, 300301
- computational speed, 288
- memory bandwidth, 288
- interfaces
- IDirectDrawColor Control, 382383
- IDirectDrawGamma Control, 383
- Outpost game, 877
- palette functions, 522525
- palletized, 136137
- RBG (red, green, blue) model, 135137, 381
- rotation (color shifting), 379381
- transforms, 381382
- color keys, 360361
- destination color keying, 364365
- source color keying, 361363
- color lookup tables (CLUTs), 136
- COLORREF structures, 385
- Color_Scan() function, 527
- COM (Component Object Model), 218219
- COM++, 238
- DCOM (Distributed COM), 239
- function pointers, 232235
- GUIDs (Globally Unique Identifiers), 223
- interfaces, 219222
- object creation, 224226
- sample program, 226231
- ComCreate() function, 225
- comments, 23, 929
- compiler, 26, 762767
- configuring, 908
- application types, 909
- code generation, 910
- error-level settings, 909
- optimization settings, 909
- search directories, 909
- struct alignment, 910
- threading models, 910
- typecast errors, 909
- directives, 60
- compiling
- DirectX programs, 231232
- Outpost game
- compilation files, 897
- runtime files, 898
- resources, 98, 114116
- complex surfaces, 309310
- Component Object Model. See COM
- conditional logic
- AI (artificial intelligence) patterns, 727729
- production rules, 742
- configuring
- C/C++ compiler, 909
- DirectInput, 542
- force feedback, 580581
- consequences (production rules), 742
- conservation
- of kinetic energy, 812
- of momentum, 811
- console applications, 59
- const keyword, 57
- constants
- creating, 929
- naming, 57
- constructors, 938941
- contour tracing, 749
- controls
- buttons, 190191
- creating, 193
- notification codes, 193194
- styles, 191192
- sending messages to, 195197
- cooperation levels
- DirectDraw
- control flags, 251252
- setting, 251254
- DirectInput
- joysticks, 568
- keyboard devices, 548549
- mouse devices, 558
- setting, 543
- DirectSound
- exclusive, 604
- normal, 604
- priority, 604
- setting, 605
- Write_Primary, 605
- coordinates
- Cartesian system, 174
- homogenous, 453
- n-t coordinate system (collisions), 846849
- polygons, 431
- windows, 132
- copying bitmaps. See blitter
- cosines, 913
- Cramers Rule, 839
- CreateClipper() function, 339
- CreateDevice() function, 542
- CreateHatchBrush() function, 172173
- CreatePalette() function, 261262
- CreatePen() function, 169170
- CreateSolidBrush() function, 172
- CreateSoundBuffer() function, 607609
- CreateSurface() function, 264
- CreateThread() function, 690691
- CreateWindowEx() function, 7576
- Create_Bitmap() function, 520
- Create_BOB() function, 528530
- critical angle, 826
- critical sections, 710
- cross products, 921923
- CS_DBLCLKS flag, 68
- CS_HREDRAW flag, 67
- CS_NOCLOSE flag, 68
- CS_OWNDC flag, 68
- CS_PARENTDC flag, 68
- CS_SAVEBITS flag, 68
- CS_VREDRAW flag, 68
- CURSOR keyword, 102
- Cursor, The, 952
- cursors, 97
- defining, 102103
- loading, 103104
- sample program, 104106
- setting, 104
D
- data formats
- joysticks, 569
- keyboard devices, 549551
- mouse devices, 558559
- setting, 543
- data structures. See structures
- data types, 503505
- dB (decibal), 613
- DCOM (Distributed COM), 239
- DDBLTFAST_ DESTCOLORKEY flag, 325
- DDBLTFAST_NOCOLORKEY flag, 325
- DDBLTFAST_SRCCOLORKEY flag, 325
- DDBLTFAST_WAIT flag, 325
- DDBLT_ASYNC flag, 324
- DDBLT_COLKEYSRCO VERRIDEORFILL flag, 323
- DDBLT_COLORFILL flag, 323
- DDBLT_DDFX flag, 323
- DDBLT_DDROPS flag, 323
- DDBLT_DEPTHFILL flag, 323
- DDBLT_KEYDEST flag, 324
- DDBLT_KEYDESTOVERRIDE flag, 323
- DDBLT_KEYSRC flag, 324
- DDBLT_ROP flag, 323
- DDBLT_ROTATIONANGLE flag, 324
- DDBLT_WAIT flag, 324
- ddckCKDestBlt field (DDSURFACE2 structure), 268
- ddckCKSrcBlt field (DDSURFACE2 structure), 268
- DDCKEY_COLORSPACE flag, 363
- DDCKEY_DESTBLT flag, 363
- DDCKEY_DESTOVERLAY flag, 363
- DDCKEY_SRCBLT flag, 363
- DDCKEY_SRCOVERLAY flag, 363
- DDCOLORCONTROL structure, 383
- DDERR_DIRECTDRAW ALREADYCREATED return code, 247
- DDERR_GENERIC return code, 247
- DDERR_INVALIDDIRECTDRAWGUID return code, 247
- DDERR_INVALIDPARAMS return code, 247
- DDERR_NODIRECTDRAWHW return code, 247
- DDERR_OUTOFMEMORY return code, 247
- DDPCAPS_1BIT control flag, 261
- DDPCAPS_2BIT control flag, 261
- DDPCAPS_4BIT control flag, 261
- DDPCAPS_8BIT control flag, 261
- DDPCAPS_8BITENTRIES control flag, 262
- DDPCAPS_ALLOW256 control flag, 262
- DDPCAPS_ALPHA control flag, 262
- DDPCAPS_INITIALIZE control flag, 262
- DDPCAPS_PRIMARYSURFACE control flag, 262
- DDPCAPS_VSYNC control flag, 262
- ddpfPixelFormat field (DDSURFACE2 structure), 268269
- DDPF_ALPHA flag, 291
- DDPF_ALPHAPIXELS flag, 291
- DDPF_LUMINANCE flag, 291
- DDPF_PALETTEINDEXED1 flag, 291
- DDPF_PALETTEINDEXED2 flag, 291
- DDPF_PALETTEINDEXED4 flag, 291
- DDPF_PALETTEINDEXED8 flag, 291
- DDPF_PALETTEINDEXEDTO8 flag, 291
- DDPF_RGB flag, 291
- DDPF_ZBUFFER flag, 291
- DDPF_ZPIXELS flag, 291
- DDPIXELFORMAT structure, 290291
- DDRAW.DLL file, 31
- DDRAW.LIB file, 31
- DDraw_Attach_Clipper() function, 342344, 508
- DDraw_Create_Surface() function, 508
- DDraw_Fill_Surface() function, 509
- DDraw_Flip() function, 508
- DDraw_Init() function, 507
- DDraw_Lock_Back_Surface() function, 510
- DDraw_Lock_Primary_ Surface() function, 510
- DDraw_Lock_Surface() function, 509
- DDraw_Shutdown() function, 507
- DDraw_Unlock_Surface() function, 510
- DDraw_Wait_For_Vsync() function, 509
- ddsCaps field (DDSURFACE2 structure), 270271
- DDSCAPS_BACKBUFFER flag, 270
- DDSCAPS_COMPLEX flag, 270
- DDSCAPS_FLIP flag, 270
- DDSCAPS_LOCALVIDMEM flag, 270
- DDSCAPS_MODEX flag, 270
- DDSCAPS_NONLOCAL VIDMEM flag, 270
- DDSCAPS_OFFSCREENPLAIN flag, 271
- DDSCAPS_OWNDC flag, 271
- DDSCAPS_PRIMARYSURFACE flag, 271
- DDSCAPS_STANDARDVGAMODEflag, 271
- DDSCAPS_SYSTEMMEMORY flag, 271
- DDSCAPS_VIDEOMEMORY flag, 271
- DDSCL_ALLOWMODEX flag, 251
- DDSCL_ALLOWREBOOT flag, 251
- DDSCL_EXCLUSIVE flag, 252
- DDSCL_FPUSETUP flag, 252
- DDSCL_FULLSCREEN flag, 252
- DDSCL_MULTITHREADED flag, 252
- DDSCL_NORMAL flag, 252
- DDSCL_NOWINDOWCHANGES flag, 252
- DDSD_ALPHABITDEPTH flag, 266
- DDSD_BACKBUFFERCOUNT flag, 266
- DDSD_CAPS flag, 266
- DDSD_CKDESTBLT flag, 266
- DDSD_CKDESTOVERLAY flag, 266
- DDSD_CKSRCBLT flag, 266, 362
- DDSD_CKSRCOVERLAY flag, 266
- DDSD_HEIGHT flag, 266
- DDSD_LINEARSIZE flag, 266
- DDSD_LPSURFACE flag, 266
- DDSD_MIPMAPCOUNT flag, 266
- DDSD_PITCH flag, 266
- DDSD_PIXELFORMAT flag, 266
- DDSD_REFRESHRATE flag, 266
- DDSD_TEXTURESTAGE flag, 266
- DDSD_WIDTH flag, 266
- DDSURFACEDESC2 data structure
- ddckCKDestBlt field, 268
- ddckCKSrcBlt field, 268
- ddpfPixelFormat field, 268269
- ddsCaps field, 270271
- dwBackBufferCount field, 268
- dwFlags field, 266
- dwHeight field, 266
- dwSize field, 265
- dwWidth field, 266
- lPitch field, 266267
- lpSurface field, 268
- DD_OK return code (DirectDrawCreate() function), 247
- deallocating memory, 932
- decibels, 613
- decision trees (AI), 742745
- declarators, 61
- decomposition, 470471
- #define directives, 60, 501502
- defining
- classes, 935936
- constructors, 939941
- cursors, 102103
- destructors, 941943
- icons, 100101
- degrees, compared to radians, 435
- degrees of membership (DOM), 774775
- delete operator, 931932
- DeleteObject() function, 171
- deleting
- GDI (Graphics Device Interface) objects, 171
- timers, 186
- demo mode
- AI-controlled, 682
- prerecorded, 680682
- dendrites, 767
- depth-first searches, 757758
- design, 13
- AI (artificial intelligence) guidelines, 794795
- brainstorming, 1415
- design documents, 15
- particle systems, 860861
- storyboards, 1516
- testing, 16
- destination color keying, 364365
- Destroy_Bitmap() function, 520
- Destroy_BOB() function, 530
- destructors, 939943
- detecting collisions
- bounding boxes, 481484
- bounding circles, 478481
- point containment, 484486
- determinates, 417
- deterministic AI (artificial intelligence) algorithms, 715
- evasion algorithms, 722
- random motion, 716717
- tracking algorithms
- literal vectoring, 717718
- trajectory vectoring, 718721
- device contexts, 68, 130
- devices (DirectInput), 539541. See also force feedback
- cooperation levels, 543
- creating, 542543
- data acquisition modes, 544
- data formats, 543
- DirectInput objects, creating, 544546
- generalized input system, 582584
- DInput_Init() function, 584
- DInput_Init_Joystick() function, 585
- DInput_Init_Keyboard() function, 584
- DInput_Init_Mouse() function, 585
- DInput_Read_Joystick() function, 587
- DInput_Read_ Keyboard() function, 586
- DInput_Read_Mouse() function, 586
- DInput_Release_ Joystick() function, 585
- DInput_Release_ Keyboard() function, 585
- DInput_Release_Mouse() function, 585
- DInput_Shutdown() function, 584
- modules, 588
- GUIDs (globally unique identifiers), 541542
- interfaces, 541542
- joysticks, 561562
- acquiring, 573
- cooperation level, 568
- creating, 567568
- data formats, 569
- enumeration, 562567
- polling, 574
- properties, 570573
- reading data from, 574575
- releasing, 575
- keyboards
- acquiring, 551
- cooperation level, 548549
- creating, 546548
- data formats, 549551
- reading data from, 551553
- unacquiring, 553554
- merging input, 576579
- mouse
- absolute mode, 556
- acquiring, 559
- cooperation level, 558
- creating, 558
- data format, 558559
- reading data from, 559560
- relative mode, 556
- releasing, 560
- polling, 543
- properties, 543
- reacquiring, 554556
- state, 544
- dialog boxes, 97
- DIENUM_CONTINUE constant, 566
- DIENUM_STOP constant, 566
- DIERR_INPUTLOST error code, 555
- DIERR_INVALIDPARAM error code, 555
- DIERR_NOTACQUIRED error code, 555
- DIERR_NOTINITIALIZED error code, 555
- digital sound, 594596
- Dijkstras search, 759
- DIJOYSTATE structure, 550
- DIJOYSTATE2 structure, 550
- dimensions (matrices), 447
- DIMOUSESTATE structure, 550
- DInput_Init() function, 584
- DInput_Init_Joystick() function, 585
- DInput_Init_Keyboard() function, 584
- DInput_Init_Mouse() function, 585
- DInput_Read_Joystick() function, 587
- DInput_Read_Keyboard() function, 586
- DInput_Read_Mouse() function, 586
- DInput_Release_Joystick() function, 585
- DInput_Release_Keyboard() function, 585
- DInput_Release_Mouse() function, 585
- DInput_Shutdown() function, 584
- Direct3DIM, 218
- Direct3DRM, 218
- DirectDraw, 216, 241
- bitmaps, 345
- file structure, 346348
- loading, 348356
- mapping, 368369
- rotating, 366368
- scaling, 366373
- templates, 352
- unloading, 351352
- blitter, 317319
- bitmaps, copying from surface to surface, 328331
- Blit8x8() function, 319320
- Blt() function, 321324
- BltFast() function, 324325
- memory fills, 325328
- capability-testing functions
- IDIRECTDRAW4
- :: GetCaps(), 386388
- IDIRECTDRAWPALETTE::GetCaps(), 389
- IDIRECTDRAWSURFACE4::GetCaps(), 388
- clipping
- bitmaps, 334339
- IDirectDrawClipper interface, 339344
- pixels, 332333
- color
- animation, 373379
- depths, 257
- high-color modes, 288301
- keys, 360365
- palettes, 259263, 272
- rotation, 379381
- transforms, 381382
- cooperation levels
- control flags, 251252
- setting, 251254
- double-buffering, 301302
- implementing, 303305
- optimizing, 304
- sample program, 305307
- error handling, 246247
- full-screen mode, 250
- interfaces, 242245
- accessing, 247250
- IDirectDraw, 242
- IDirectDrawClipper, 243244
- IDirectDrawColor-Control, 382383
- IDirectDrawGamma-Control, 383
- IDirectDrawPalette, 243
- IDirectDrawSurface, 242
- IIDs (interface IDs), 249
- IUnknown, 242
- objects, creating, 245246
- page flipping, 302303
- Flip() function, 311313
- sample program, 313317
- pixels, plotting, 272280
- resource management, 284285
- sample program, 280283
- surfaces, 263
- back buffers, 307309
- complex, 309310
- creating, 264272
- filling, 325328
- locking, 275276
- offscreen, 356360, 365366
- primary, 264
- secondary, 264
- unlocking, 277
- triple-buffering, 312
- video modes
- changing, 256257
- resolutions, 255256
- sample program, 257258
- setting, 255
- windows, 390391
- 8-bit windowed modes, 250, 398399
- client area, 395397
- clipping, 397398
- creating, 391392
- drawing to, 392395
- DirectDraw interface
- DDraw_Attach_Clipper() function, 508
- DDraw_Create_Surface() function, 508
- DDraw_Fill_Surface() function, 509
- DDraw_Flip() function, 508
- DDraw_Init() function, 507
- DDraw_Lock_Back_ Surface() function, 510
- DDraw_Lock_Primary_ Surface() function, 510
- DDraw_Lock_Surface() function, 509
- DDraw_Shutdown() function, 507
- DDraw_Unlock_Surface() function, 510
- DDraw_Wait_For_Vsync() function, 509
- DirectDrawCreate() function, 236, 245247
- DirectInput devices, 217, 539541. See also force feedback
- cooperation levels, 543
- creating, 542543
- data formats, 543
- DirectInput objects, creating, 544546
- generalized input system, 582584
- DInput_Init() function, 584
- DInput_Init_Joystick() function, 585
- DInput_Init_Keyboard() function, 584
- DInput_Init_Mouse() function, 585
- DInput_Read_Joystick() function, 587
- DInput_Read_ Keyboard() function, 586
- DInput_Read_Mouse() function, 586
- DInput_Release_ Joystick() function, 585
- DInput_Release_ Keyboard() function, 585
- DInput_Release_Mouse() function, 585
- DInput_Shutdown() function, 584
- modules, 588
- GUIDs (globally unique identifiers), 541542
- interfaces, 541542
- joysticks, 561562
- acquiring, 573
- cooperation level, 568
- creating, 567568
- data formats, 569
- enumeration, 562567
- polling, 574
- properties, 570573
- reading data from, 574575
- releasing, 575
- keyboards
- acquiring, 551
- cooperation level, 548549
- creating, 546548
- data formats, 549551
- reading data from, 551553
- unacquiring, 553554
- merging input, 576579
- mouse
- absolute mode, 556
- acquiring, 559
- cooperation level, 558
- creating, 558
- data format, 558559
- reading data from, 559560
- relative mode, 556
- releasing, 560
- polling, 543
- properties, 543
- reacquiring, 554556
- state, 544
- DirectInputCreate() function, 544545
- directives
- #define, 60, 501502
- #include, 60
- DirectMedia, 908
- DirectMusic, 217
- COM initialization, 624
- interfaces, 622623
- MIDI files
- loading, 626630
- playing, 630
- releasing, 631
- shutting down, 631632
- status, checking, 631
- stopping, 631
- performances
- creating, 625
- initializing, 625626
- ports, 626
- sound/music library, 632633
- DirectMusic API wrapper, 640643
- DirectSound API wrapper, 635640
- globals, 634635
- header file, 633
- types, 633634
- DirectPlay, 217
- DirectSetup, 218
- DirectSound, 217, 601602
- cooperation levels
- exclusive, 604
- normal, 604
- priority, 604
- setting, 605
- Write_Primary, 605
- DirectSound objects, creating, 602604
- interfaces, 602
- panning, 614
- playback frequencies, 613
- playing sounds, 612
- primary buffers, 606
- querying
- GetCaps() function, 614616
- GetStatus() function, 616
- secondary buffers
- circular buffering, 607
- creating, 607610
- locking, 610611
- releasing, 611
- static, 606
- streaming, 606
- unlocking, 611
- writing to, 610611
- sound/music library, 632633
- DirectMusic API wrapper, 640643
- DirectSound API wrapper, 635640
- globals, 634635
- header file, 633
- types, 633634
- stopping sounds, 612
- volume control, 612613
- .WAV loader, 616622
- DirectSound3D, 217
- DirectSoundCreate() function, 603
- DirectX, 11, 213214
- compile time, 231232
- Direct3DIM, 218
- Direct3DRM, 218
- DirectDraw, see DirectDraw
- DirectInput, see DirectInput devices
- DirectMusic, 217
- COM initialization, 624
- interfaces, 622623
- MIDI files, 626632
- performances, 625626
- ports, 626
- sound/music library, 632643
- DirectPlay, 217
- DirectSetup, 218
- DirectSound, 217, 601602
- cooperation levels, 604605
- interfaces, 602
- objects, creating, 602604
- panning, 614
- playback frequencies, 613
- playing sounds, 612
- primary buffers, 606
- querying, 614616
- secondary buffers, 606611
- sound/music library, 632643
- stopping sounds, 612
- volume control, 612613
- .WAV loader, 616622
- DirectSound3D, 217
- GDI (Graphics Device Interface), combining, 385
- HAL (Hardware Abstraction Layer), 216
- HEL (Hardware Emulation Layer), 216
- installation, 907908
- interfaces
- creating, 236237
- querying for, 237238
- multithreading, 709710
- Web site, 908
- DISCARDABLE keyword, 116
- DISCL_BACKGROUND flag, 548
- DISCL_EXCLUSIVE flag, 548
- DISCL_FOREGROUND flag, 548
- DISCL_NONEXCLUSIVE flag, 548
- DispatchMessage() function, 85
- Distributed COM (DCOM), 239
- division, 676677
- DMusic_Delete_All_MIDI() function, 642
- DMusic_Delete_MIDI() function, 642
- DMusic_Init() function, 641
- DMusic_Load_MIDI() function, 641
- DMUSIC_MIDI structure, 627
- DMusic_Play() function, 642
- DMusic_Shutdown() function, 641
- DMusic_Status() function, 643
- DMusic_Stop() function, 642
- DOM (degrees of membership), 774775
- DOS, Hello World program, 58
- dot products, 450, 919921
- double-buffering, 268, 301302
- implementing, 303305
- optimizing, 304
- sample program, 305307
- doubly linked lists, 656
- downloading games, 950
- drawing, 26. See also DirectDraw
- circles, 180181
- ellipses (ovals), 180181
- lines, 175, 402403
- Bresenhams algorithm, 403409
- FillRect() function, 178179
- FrameRect() function, 178
- LineTo() function, 176177
- MoveToEx() function, 175
- Rectangle() function, 177179
- Run-Slicing algorithm, 409
- Symmetric Double Step algorithm, 411
- points, 173175
- polygons, 181182, 430432
- quadrilaterals, 461464
- triangles, 461464
- flat bottom triangles, 467470
- flat top triangles, 465467
- overdraw, 464
- drawing tools
- brushes
- creating, 172173
- defined, 167
- deleting, 172
- selecting, 172
- pens
- creating, 169
- defined, 167
- deleting, 171
- line styles, 169170
- selecting, 170171
- stock objects, 168169
- DrawText() function, 137
- Draw_Bitmap() function, 522
- Draw_BOB() function, 530531
- Draw_Clip_Line() function, 513
- Draw_Filled_Polygon2D() function, 512
- Draw_Line() function, 407409, 514
- Draw_Particles() function, 866
- Draw_Pixel() function, 515
- Draw_QuadFP_2D() function, 512
- Draw_Scaled_BOB() function, 531
- Draw_Text_GDI() function, 516
- Draw_Triangle_2D() function, 511
- DSBCAPS structure, 615
- DSBCAPS_CTRDEFAULT flag, 608
- DSBCAPS_CTRLALL flag, 608
- DSBCAPS_CTRLFREQUENCY flag, 608
- DSBCAPS_CTRLPAN flag, 608
- DSBCAPS_CTRLVOLUME flag, 608
- DSBCAPS_LOCHARDWARE flag, 608
- DSBCAPS_LOCSOFTWARE flag, 608
- DSBCAPS_PRIMARYBUFFER flag, 608
- DSBCAPS_STATIC flag, 608
- DSBUFFERDESC structure, 607608
- DSCAPS structure, 614615
- DSound_Delete_Sound() function, 638
- DSound_Init() function, 635
- DSound_Load_WAV() function, 617, 636
- DSound_Play_Sound() function, 637638
- DSound_Replicate_Sound() function, 637
- DSound_Set_Sound_Freq() function, 640
- DSound_Set_Sound_Pan() function, 640
- DSound_Set_Sound_Volume() function, 639
- DSound_Shutdown() function, 636
- DSound_Status_Sound() function, 638639
- DSound_Stop_Sound() function, 638
- DSSCL_EXCLUSIVE flag, 605
- DSSCL_NORMAL flag, 605
- DSSCL_PRIORITY flag, 605
- DSSCL_WRITEPRIMARY flag, 605
- dwBackBufferCount field, 268
- dwCreationFlags field (CreateThread() function), 691
- dwDevType field (EnumDevices() function), 563564
- dwExStyle field (CreateWindowEx() function), 75
- dwFlags field
- DDPIXELFORMAT structure, 291
- DDSURFACE2 structure, 266
- dwFlags parameter
- Blt() function, 321324
- EnumDevices() function, 564
- dwHeight field (DDSURFACE2 structure), 266
- dwSize field
- DDPIXELFORMAT structure, 291
- DDSURFACE2 structure, 265
- dwStyle parameter (CreateWindowEx() function), 75
- dwWidth field (DDSURFACE2 structure), 266
E
- ecosystem simulation games, 14
- elastic collisions, 828
- Element Of operator, 774
- Ellipse() function, 180
- ellipses, drawing, 180181
- enemies (Outpost game)
- gunships, 888891
- mines, 886887
- outposts, 885886
- energy, kinetic, 812
- EnumDevices() function, 563564
- error handling
- C/C++ compiler settings, 909
- DirectDraw, 246247
- error codes, 555
- evasion algorithms, 722
- event handling, 77, 143
- impact events, 843
- keyboard input, 150
- ASCII codes, 151
- GetAsyncKeyState() function, 151, 155158
- scan codes, 151
- WM_CHAR message, 151153
- WM_KEYDOWN message, 153155
- WM_KEYUP message, 154
- main event loops, 8489
- menus, 122
- sample program, 125128
- WinProc() function, 123125
- mouse input
- WM_LBUTTON DBLCLK message, 160
- WM_LBUTTONDOWN message, 160
- WM_LBUTTONUP message, 160
- WM_MBUTTON-DBLCLK message, 160
- WM_MBUTTONDOWN message, 160
- WM_MBUTTONUP message, 160
- WM_MOUSEMOVE message, 158160
- WM_RBUTTON-DBLCLK message, 160
- WM_RBUTTONDOWN message, 160
- WM_RBUTTONUP message, 160
- real-time event loops, 8990
- window manipulation messages, see messages
- Windows event model, 5354
- WinProc() function
- message IDs, 7980
- parameters, 79
- prototype, 78
- sample program, 8084
- exclusive cooperation level (DirectSound), 604
- execute buffers, 218
- E_PENDING error code, 555
F
- FAILED macro, 246
- falling objects, simulating, 816818
- FAMs (fuzzy associative matrices), 783
- examples, 784786
- processing, 787789
- centroids, 790793
- MAX() function, 790
- Fast_Distance() function, 517
- Fast_Distance_3D() function, 517
- Fibonacci algorithm, 662
- fighting games, 13
- filename extensions
- .RC, 97
- .RES, 97
- .WAV, 109
- files
- header files, 60
- metafiles, 97
- WAV
- playing, 110112
- resource files, 109
- sample program, 112114
- stopping, 112
- filling
- polygons, 458459
- surfaces, 325328
- FillRect() function, 178179
- filtering, 371
- finding paths. See pathfinding
- Find_Bounding_Box_Poly2D() function, 518
- finite state machines. See FSMs
- firing neurons, 767
- fixed camera view isometric engines, 500
- fixed-point mathematics, 673674
- accuracy, 676
- addition, 676
- converting to/from, 674675
- division, 676677
- multiplication, 676677
- representing numbers, 674
- subtraction, 676
- flat bottom triangles
- defined, 459
- drawing, 467470
- flat top triangles
- defined, 459
- drawing, 465467
- Flip() function, 311313
- Flip_Bitmap() function, 522
- FLVs (fuzzy linguistic variables), 776779
- FM synthesis, 596597
- fonts
- changing, 182
- creating, 183184
- monospaced, 183
- force, 807809
- force feedback, 579
- conditions, 580
- configuring, 580581
- motive forces, 580
- sample program, 581582
- foreground color, 139140
- forward kinematics, 853857
- forward mapping, 368
- Fourier Transform, 593
- frame-based modeling, 871
- FrameRect() function, 178
- FreakOut game, 2931
- BLACKOUT.H file, 3133
- DDRAW.DLL file, 31
- DDRAW.LIB file, 31
- FREAKOUT.CPP file, 3346
- frequencies (playback), 592, 613
- friction
- defined, 821822
- physics modeling, 822
- air hockey example, 823
- inclined planes, 823828
- FSMs (finite state machines), 729730
- example, 730734
- personality traits, 734736
- full fuzzy sets, 775
- full-screen isometric engines, 498500
- full-screen mode (DirectDraw), 250
- function pointers, 232235
- functions, 937938
- Acquire(), 543
- AddPort(), 626
- AddRef(), 221222
- AdjustWindowRectEx(), 396
- Animate_BOB(), 534
- BeginPaint(), 129130
- Blink_Colors(), 525
- Blit8x8(), 319320
- Blt(), 321324
- BltFast(), 324325
- Clip_Line(), 514
- CloseHandle(), 691692
- Close_Error_File(), 518
- CoCreateInstance(), 225, 625
- CoInitialize(), 624
- Collision_BOBS(), 535
- Collision_Test(), 526
- Color_Scan(), 527
- ComCreate(), 225
- constructors, 938941
- CreateClipper(), 339
- CreateDevice(), 542
- CreateHatchBrush(), 172173
- CreatePalette(), 261262
- CreatePen(), 169170
- CreateSolidBrush(), 172
- CreateSoundBuffer(), 607609
- CreateSurface(), 264
- CreateThread(), 690691
- CreateWindowEx(), 7576
- Create_Bitmap(), 520
- Create_BOB(), 528530
- DDDraw_Create_Surface(), 508
- DDDraw_Flip(), 508
- DDraw_Attach_Clipper(), 342344, 508
- DDraw_Fill_Surface(), 509
- DDraw_Init(), 507
- DDraw_Lock_Back_ Surface(), 510
- DDraw_Lock_Primary_ Surface(), 510
- DDraw_Lock_Surface(), 509
- DDraw_Shutdown(), 507
- DDraw_Unlock_Surface(), 510
- DDraw_Wait_For_Vsync(), 509
- DeleteObject(), 171
- Destroy_Bitmap(), 520
- Destroy_BOB(), 530
- destructors, 939943
- DInput_Init(), 584
- DInput_Init_Joystick(), 585
- DInput_Init_Keyboard(), 584
- DInput_Init_Mouse(), 585
- DInput_Read_Joystick(), 587
- DInput_Read_Keyboard(), 586
- DInput_Read_Mouse(), 586
- DInput_Release_Joystick(), 585
- DInput_Release_Keyboard(), 585
- DInput_Release_Mouse(), 585
- DInput_Shutdown(), 584
- DirectDrawCreate(), 236, 245247
- DirectInputCreate(), 544545
- DirectSoundCreate(), 603
- DispatchMessage(), 85
- DMusic_Delete_All_MIDI(), 642
- DMusic_Delete_MIDI(), 642
- DMusic_Init(), 641
- DMusic_Load_MIDI(), 641
- DMusic_Play(), 642
- DMusic_Shutdown(), 641
- DMusic_Status(), 643
- DMusic_Stop(), 642
- DrawText(), 137
- Draw_Bitmap(), 522
- Draw_BOB(), 530531
- Draw_Clip_Line(), 513
- Draw_Filled_Polygon2D(), 512
- Draw_Line(), 407409, 514
- Draw_Particles(), 866
- Draw_Pixel(), 515
- Draw_QuadFP_2D(), 512
- Draw_Scaled_BOB(), 531
- Draw_Text_GDI(), 516
- Draw_Triangle_2D(), 511
- DSound_Delete_Sound(), 638
- DSound_Init(), 635
- DSound_Load_WAV(), 617, 636
- DSound_Play_Sound(), 637638
- DSound_Replicate_Sound(), 637
- DSound_Set_Sound_Freq(), 640
- DSound_Set_Sound_Pan(), 640
- DSound_Set_Sound_ Volume(), 639
- DSound_Shutdown(), 636
- DSound_Status_Sound(), 638639
- DSound_Stop_Sound(), 638
- Ellipse(), 180
- EnumDevices(), 563564
- Fast_Distance(), 517
- Fast_Distance_3D(), 517
- FillRect(), 178179
- Find_Bounding_Box_ Poly2D(), 518
- Flip(), 311313
- Flip_Bitmap(), 522
- FrameRect(), 178
- Game_Init(), 206
- Game_Main(), 206, 297298
- Game_Shutdown(), 207
- GetAsyncKeyState(), 151, 155158
- GetCaps(), 614616
- IDIRECTDRAW4:: GetCaps(), 386388
- IDIRECTDRAWPALETTE::GetCaps(), 389
- IDIRECTDRAWSURFACE4::GetCaps(), 388
- GetClientRect(), 132
- GetDC(), 130(), 383384
- GetDeviceState(), 544, 551, 555
- GetMessage(), 85
- GetPixelFormat(), 290, 393
- GetStatus(), 616
- GetStockObject(), 7273, 168
- GetSystemInfo(), 198199
- GetSystemMetrics(), 199203
- GetTextMetrics(), 204205
- GetTickCount(), 187
- GetWindowRect(), 392393
- Get_Clock(), 525
- Get_Palette_Entry(), 523
- Hide_BOB(), 535
- HLine(), 515
- Init_Reset_Particles(), 861862
- inline, 22
- InvalidateRect(), 132133
- IsPlaying(), 631
- KillTimer(), 186
- LineTo(), 176177
- LoadBitmap(), 348
- LoadCursor(), 71, 104
- LoadIcon(), 7071
- LoadImage(), 348349
- LoadMenu(), 119120
- LoadString(), 108
- Load_Animation_BOB(), 532
- Load_Bitmap_File(), 349351, 519
- Load_Frame_BOB(), 531
- Load_Image_Bitmap(), 521
- Load_Palette_From_File(), 524
- Lock(), 275276, 610
- MAX(), 790
- memcpy(), 304
- MessageBeep(), 6566
- MessageBox(), 6364
- MIN(), 788
- MoveToEx(), 175
- Move_BOB(), 534
- naming, 56
- Open_Error_File(), 518
- overloading, 945946
- PeekMessage(), 89
- Play(), 612
- PlaySegment(), 630
- PlaySound(), 110111
- Plot16(), 277
- Plot8(), 277
- Plot_Pixel16(), 294295
- Plot_Pixel_Fast16(), 295
- Plot_Pixel_Faster16(), 296
- pointers, 69
- Poll(), 543
- Polygon(), 181
- PostMessage(), 161163
- printf(), 932
- Process_Particles(), 864866
- QueryInterface(), 221, 238, 247
- Rectangle(), 177179
- RegisterClass(), 74
- RegisterClassEx(), 74
- Release(), 222, 284285
- ReleaseDC(), 130, 384
- Rotate_Colors(), 525
- Rotate_Polygon2D(), 513
- Save_Palette(), 524
- Save_Palette_To_File(), 523
- Scale_Polygon2D(), 513
- scanf(), 932
- Screen_Transition(), 516
- SelectObject(), 170171
- SendMessage(), 161163, 195197
- SetBkMode(), 140
- SetClipper(), 342, 397
- SetColorKey(), 361364
- SetCooperativeLevel(), 543, 548, 605
- SetCooperativeLevel(), 251252
- SetCursor(), 104
- SetDataFormat(), 543, 549
- SetDisplayMode(), 293
- SetEntries(), 354
- SetFrequency(), 613
- SetHWnd(), 397
- SetMenu(), 120
- SetPalette(), 272
- SetPan(), 614
- SetPixel(), 173175, 234235
- SetProperty(), 543
- SetTimer(), 185
- SetVolume(), 613
- Set_Animation_BOB(), 534
- Set_Anim_Speed(), 533
- Set_Palette(), 524
- Set_Palette_Entry(), 522
- Set_Pos_BOB(), 533
- Set_Vel_BOB(), 533
- ShowCursor(), 446
- Show_BOB(), 535
- Sleep(), 190
|