-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDirectDraw.pas
7162 lines (6256 loc) · 255 KB
/
DirectDraw.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{******************************************************************************}
{* *}
{* Copyright (C) Microsoft Corporation. All Rights Reserved. *}
{* *}
{* Files: ddraw.h dvp.h *}
{* Content: DirectDraw and DirectDrawVideoPort include files *}
{* *}
{* DirectX 9.0 Delphi adaptation by Alexey Barkovoy *}
{* E-Mail: [email protected] *}
{* *}
{* Modified: 20-Dec-2002 *}
{* *}
{* Based upon : *}
{* DirectX 7.0 Object Pascal adaptation by *}
{* Erik Unger, e-Mail: [email protected] *}
{* *}
{* Latest version can be downloaded from: *}
{* http://clootie.narod.ru/delphi/ *}
{* *}
{******************************************************************************}
{ }
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
{ }
{ The contents of this file are used with permission, subject to the Mozilla }
{ Public License Version 1.1 (the "License"); you may not use this file except }
{ in compliance with the License. You may obtain a copy of the License at }
{ http://www.mozilla.org/MPL/MPL-1.1.html }
{ }
{ Software distributed under the License is distributed on an "AS IS" basis, }
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
{ the specific language governing rights and limitations under the License. }
{ }
{ Alternatively, the contents of this file may be used under the terms of the }
{ GNU Lesser General Public License (the "LGPL License"), in which case the }
{ provisions of the LGPL License are applicable instead of those above. }
{ If you wish to allow use of your version of this file only under the terms }
{ of the LGPL License and not to allow others to use your version of this file }
{ under the MPL, indicate your decision by deleting the provisions above and }
{ replace them with the notice and other provisions required by the LGPL }
{ License. If you do not delete the provisions above, a recipient may use }
{ your version of this file under either the MPL or the LGPL License. }
{ }
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
{ }
{******************************************************************************}
///////////////////////////////////////////////////////////////////////////////
// Notes:
//----------------------------------------------------------------------------
// Possible input defines for this file, mapped to original C values:
// DIRECTDRAW_VERSION_7 : DIRECTDRAW_VERSION = 0x0700,
// DIRECTDRAW_VERSION_6 : DIRECTDRAW_VERSION = 0x0600,
// DIRECTDRAW_VERSION_5 : DIRECTDRAW_VERSION = 0x0500,
// DIRECTDRAW_VERSION_3 : DIRECTDRAW_VERSION = 0x0300,
// DIRECTDRAW_VERSION_LESS_3 : DIRECTDRAW_VERSION < 0x0300,
//
// By default DIRECTDRAW_VERSION_7 (DIRECTDRAW_VERSION = 0x0700) is assumed
//
// Also you can use generic DIRECTXx defines, so:
// DIRECTX7 equal to DIRECTDRAW_VERSION_7;
// DIRECTX6 equal to DIRECTDRAW_VERSION_6;
// DIRECTX5 equal to DIRECTDRAW_VERSION_5;
// DIRECTX3 equal to DIRECTDRAW_VERSION_3
///////////////////////////////////////////////////////////////////////////////
unit DirectDraw;
interface
{$I DirectX.inc}
////////////////////////////////////////////////////////////////////////
// Global level dynamic loading support
{$IFDEF DYNAMIC_LINK_ALL}
{$DEFINE DIRECTDRAW_DYNAMIC_LINK}
{$ENDIF}
{$IFDEF DYNAMIC_LINK_EXPLICIT_ALL}
{$DEFINE DIRECTDRAW_DYNAMIC_LINK_EXPLICIT}
{$ENDIF}
// Remove "dots" below to force some kind of dynamic linking
{.$DEFINE DIRECTDRAW_DYNAMIC_LINK}
{.$DEFINE DIRECTDRAW_DYNAMIC_LINK_EXPLICIT}
////////////////////////////////////////////////////////////////////////
// Assume for what DirectDraw version we will compile headers
{$IFDEF DIRECTX7}
{$DEFINE DIRECTDRAW_VERSION_7}
{$ENDIF}
{$IFDEF DIRECTX6}
{$DEFINE DIRECTDRAW_VERSION_6}
{$ENDIF}
{$IFDEF DIRECTX5}
{$DEFINE DIRECTDRAW_VERSION_5}
{$ENDIF}
{$IFDEF DIRECTX3}
{$DEFINE DIRECTDRAW_VERSION_3}
{$ENDIF}
{$IFNDEF DIRECTDRAW_VERSION_7}
{$IFNDEF DIRECTDRAW_VERSION_6}
{$IFNDEF DIRECTDRAW_VERSION_5}
{$IFNDEF DIRECTDRAW_VERSION_3}
{$IFNDEF DIRECTDRAW_VERSION_LESS_3}
{$DEFINE DIRECTDRAW_VERSION_7} // Compiling for DirectDraw7 by default
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}
////////////////////////////////////////////////////////////////////////
// Emit conditionals to C++Builder compiler
{$IFDEF DIRECTDRAW_VERSION_LESS_3}
{$HPPEMIT '#define DIRECTDRAW_VERSION 0x0100'}
{$ENDIF}
{$IFDEF DIRECTDRAW_VERSION_3}
{$HPPEMIT '#define DIRECTDRAW_VERSION 0x0300'}
{$ENDIF}
{$IFDEF DIRECTDRAW_VERSION_5}
{$HPPEMIT '#define DIRECTDRAW_VERSION 0x0500'}
{$ENDIF}
{$IFDEF DIRECTDRAW_VERSION_6}
{$HPPEMIT '#define DIRECTDRAW_VERSION 0x0600'}
{$ENDIF}
{$IFDEF DIRECTDRAW_VERSION_7}
{$HPPEMIT '#define DIRECTDRAW_VERSION 0x0700'}
{$ENDIF}
////////////////////////////////////////////////////////////////////////
// Define symbols for '<=' comparision
{$IFDEF DIRECTDRAW_VERSION_7}
{$DEFINE DIRECTDRAW_VERSION_6}
{$ENDIF}
{$IFDEF DIRECTDRAW_VERSION_6}
{$DEFINE DIRECTDRAW_VERSION_5}
{$ENDIF}
{$IFDEF DIRECTDRAW_VERSION_5}
{$DEFINE DIRECTDRAW_VERSION_3}
{$ENDIF}
{$IFDEF DIRECTDRAW_VERSION_3}
{$DEFINE DIRECTDRAW_VERSION_LESS_3}
{$ENDIF}
(*$HPPEMIT '#include "ddraw.h"' *)
(*$HPPEMIT '#include "dvp.h"' *)
uses
Windows;
(*==========================================================================;
*
* Copyright (C) Microsoft Corporation. All Rights Reserved.
*
* File: ddraw.h
* Content: DirectDraw include file
*
***************************************************************************)
function MAKEFOURCC(ch0, ch1, ch2, ch3: Char): DWORD;
{$EXTERNALSYM MAKEFOURCC}
(*
* FOURCC codes for DX compressed-texture pixel formats
*)
const
//#define FOURCC_DXT1 (MAKEFOURCC('D','X','T','1'))
FOURCC_DXT1 = DWORD(Byte('D') or (Byte('X') shl 8) or (Byte('T') shl 16) or (Byte('1') shl 24));
{$EXTERNALSYM FOURCC_DXT1}
//#define FOURCC_DXT2 (MAKEFOURCC('D','X','T','2'))
FOURCC_DXT2 = DWORD(Byte('D') or (Byte('X') shl 8) or (Byte('T') shl 16) or (Byte('2') shl 24));
{$EXTERNALSYM FOURCC_DXT2}
//#define FOURCC_DXT3 (MAKEFOURCC('D','X','T','3'))
FOURCC_DXT3 = DWORD(Byte('D') or (Byte('X') shl 8) or (Byte('T') shl 16) or (Byte('3') shl 24));
{$EXTERNALSYM FOURCC_DXT3}
//#define FOURCC_DXT4 (MAKEFOURCC('D','X','T','4'))
FOURCC_DXT4 = DWORD(Byte('D') or (Byte('X') shl 8) or (Byte('T') shl 16) or (Byte('4') shl 24));
{$EXTERNALSYM FOURCC_DXT4}
//#define FOURCC_DXT5 (MAKEFOURCC('D','X','T','5'))
FOURCC_DXT5 = DWORD(Byte('D') or (Byte('X') shl 8) or (Byte('T') shl 16) or (Byte('5') shl 24));
{$EXTERNALSYM FOURCC_DXT5}
(*
* GUIDS used by DirectDraw objects
*)
const
CLSID_DirectDraw: TGUID = '{D7B70EE0-4340-11CF-B063-0020AFC2CD35}';
{$EXTERNALSYM CLSID_DirectDraw}
CLSID_DirectDraw7: TGUID = '{3c305196-50db-11d3-9cfe-00c04fd930c5}';
{$EXTERNALSYM CLSID_DirectDraw7}
CLSID_DirectDrawClipper: TGUID = '{593817A0-7DB3-11CF-A2DE-00AA00b93356}';
{$EXTERNALSYM CLSID_DirectDrawClipper}
(* These GUID's defined later by typedefing to Delphi interfaces
DEFINE_GUID( IID_IDirectDraw, 0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
DEFINE_GUID( IID_IDirectDraw2, 0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 );
DEFINE_GUID( IID_IDirectDraw4, 0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
DEFINE_GUID( IID_IDirectDraw7, 0x15e65ec0,0x3b9c,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b );
DEFINE_GUID( IID_IDirectDrawSurface, 0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
DEFINE_GUID( IID_IDirectDrawSurface2, 0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27 );
DEFINE_GUID( IID_IDirectDrawSurface3, 0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB );
DEFINE_GUID( IID_IDirectDrawSurface4, 0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B );
DEFINE_GUID( IID_IDirectDrawSurface7, 0x06675a80,0x3b9b,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b );
DEFINE_GUID( IID_IDirectDrawPalette, 0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
DEFINE_GUID( IID_IDirectDrawClipper, 0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
DEFINE_GUID( IID_IDirectDrawColorControl, 0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 );
DEFINE_GUID( IID_IDirectDrawGammaControl, 0x69C11C3E,0xB46B,0x11D1,0xAD,0x7A,0x00,0xC0,0x4F,0xC2,0x9B,0x4E );
*)
const
DD_ROP_SPACE = (256 div 32); // space required to store ROP array
{$EXTERNALSYM DD_ROP_SPACE}
MAX_DDDEVICEID_STRING = 512;
{$EXTERNALSYM MAX_DDDEVICEID_STRING}
(*============================================================================
*
* DirectDraw Structures
*
* Various structures used to invoke DirectDraw.
*
*==========================================================================*)
var
NilGUID : TGUID = '{00000000-0000-0000-0000-000000000000}';
type
//Clootie: This was originally in Erik Unger headers - don't know why, so leave it alone
TRefGUID = packed record
case Integer of
1: (guid : PGUID);
2: (dwFlags : DWORD);
end;
REFGUID = PGUID;
{$EXTERNALSYM REFGUID}
{$HPPEMIT 'typedef System::DelphiInterface<IDirectDraw> _di_IDirectDraw;'}
{$HPPEMIT 'typedef System::DelphiInterface<IDirectDraw2> _di_IDirectDraw2;'}
{$HPPEMIT 'typedef System::DelphiInterface<IDirectDraw4> _di_IDirectDraw4;'}
{$HPPEMIT 'typedef System::DelphiInterface<IDirectDraw7> _di_IDirectDraw7;'}
{$HPPEMIT 'typedef System::DelphiInterface<IDirectDrawSurface> _di_IDirectDrawSurface;'}
{$HPPEMIT 'typedef System::DelphiInterface<IDirectDrawSurface2> _di_IDirectDrawSurface2;'}
{$HPPEMIT 'typedef System::DelphiInterface<IDirectDrawSurface3> _di_IDirectDrawSurface3;'}
{$HPPEMIT 'typedef System::DelphiInterface<IDirectDrawSurface4> _di_IDirectDrawSurface4;'}
{$HPPEMIT 'typedef System::DelphiInterface<IDirectDrawSurface7> _di_IDirectDrawSurface7;'}
{$HPPEMIT 'typedef System::DelphiInterface<IDirectDrawPalette> _di_IDirectDrawPalette;'}
{$HPPEMIT 'typedef System::DelphiInterface<IDirectDrawClipper> _di_IDirectDrawClipper;'}
{$HPPEMIT 'typedef System::DelphiInterface<IDirectDrawColorControl> _di_IDirectDrawColorControl;'}
{$HPPEMIT 'typedef System::DelphiInterface<IDirectDrawGammaControl> _di_IDirectDrawGammaControl;'}
IDirectDraw = interface;
{$EXTERNALSYM IDirectDraw}
IDirectDraw2 = interface;
{$EXTERNALSYM IDirectDraw2}
IDirectDraw4 = interface;
{$EXTERNALSYM IDirectDraw4}
IDirectDraw7 = interface;
{$EXTERNALSYM IDirectDraw7}
IDirectDrawSurface = interface;
{$EXTERNALSYM IDirectDrawSurface}
IDirectDrawSurface2 = interface;
{$EXTERNALSYM IDirectDrawSurface2}
IDirectDrawSurface3 = interface;
{$EXTERNALSYM IDirectDrawSurface3}
IDirectDrawSurface4 = interface;
{$EXTERNALSYM IDirectDrawSurface4}
IDirectDrawSurface7 = interface;
{$EXTERNALSYM IDirectDrawSurface7}
IDirectDrawPalette = interface;
{$EXTERNALSYM IDirectDrawPalette}
IDirectDrawClipper = interface;
{$EXTERNALSYM IDirectDrawClipper}
IDirectDrawColorControl = interface;
{$EXTERNALSYM IDirectDrawColorControl}
IDirectDrawGammaControl = interface;
{$EXTERNALSYM IDirectDrawGammaControl}
(*
* Generic pixel format with 8-bit RGB and alpha components
*)
PDDARGB = ^TDDARGB;
_DDARGB = packed record
blue: Byte;
green: Byte;
red: Byte;
alpha: Byte;
end;
{$EXTERNALSYM _DDARGB}
DDARGB = _DDARGB;
{$EXTERNALSYM DDARGB}
TDDARGB = _DDARGB;
(*
* This version of the structure remains for backwards source compatibility.
* The DDARGB structure is the one that should be used for all DirectDraw APIs.
*)
PDDRGBA = ^TDDRGBA;
_DDRGBA = packed record
red : Byte;
green : Byte;
blue : Byte;
alpha : Byte;
end;
{$EXTERNALSYM _DDRGBA}
DDRGBA = _DDRGBA;
{$EXTERNALSYM DDRGBA}
TDDRGBA = _DDRGBA;
(*
* TDDColorKey
*)
PDDColorKey = ^TDDColorKey;
_DDCOLORKEY = packed record
dwColorSpaceLowValue: DWORD; // low boundary of color space that is to
// be treated as Color Key, inclusive
dwColorSpaceHighValue: DWORD; // high boundary of color space that is
// to be treated as Color Key, inclusive
end;
{$EXTERNALSYM _DDCOLORKEY}
DDCOLORKEY = _DDCOLORKEY;
{$EXTERNALSYM DDCOLORKEY}
TDDColorKey = _DDCOLORKEY;
// Delphi 5 and up don't allow interfaces in variant records
// so we have to use pointers instead (which can be type-casted into interfaces):
PDirectDrawSurface = Pointer;
(*{$IFDEF COMPILER5_UP}
PDirectDrawSurface = Pointer;
{$ELSE}
PDirectDrawSurface = IDirectDrawSurface;
{$ENDIF} *)
(*
* TDDBltFX
* Used to pass override information to the DIRECTDRAWSURFACE callback Blt.
*)
PDDBltFX = ^TDDBltFX;
_DDBLTFX = packed record
dwSize : DWORD; // size of structure
dwDDFX : DWORD; // FX operations
dwROP : DWORD; // Win32 raster operations
dwDDROP : DWORD; // Raster operations new for DirectDraw
dwRotationAngle : DWORD; // Rotation angle for blt
dwZBufferOpCode : DWORD; // ZBuffer compares
dwZBufferLow : DWORD; // Low limit of Z buffer
dwZBufferHigh : DWORD; // High limit of Z buffer
dwZBufferBaseDest : DWORD; // Destination base value
dwZDestConstBitDepth : DWORD; // Bit depth used to specify Z constant for destination
case Integer of
0: (
dwZDestConst : DWORD // Constant to use as Z buffer for dest
);
1: (
lpDDSZBufferDest : PDirectDrawSurface; // Surface to use as Z buffer for dest
dwZSrcConstBitDepth : DWORD; // Bit depth used to specify Z constant for source
case integer of
0: (
dwZSrcConst : DWORD; // Constant to use as Z buffer for src
);
1: (
lpDDSZBufferSrc : PDirectDrawSurface; // Surface to use as Z buffer for src
dwAlphaEdgeBlendBitDepth : DWORD; // Bit depth used to specify constant for alpha edge blend
dwAlphaEdgeBlend : DWORD; // Alpha for edge blending
dwReserved : DWORD;
dwAlphaDestConstBitDepth : DWORD; // Bit depth used to specify alpha constant for destination
case integer of
0: (
dwAlphaDestConst : DWORD; // Constant to use as Alpha Channel
);
1: (
lpDDSAlphaDest : PDirectDrawSurface; // Surface to use as Alpha Channel
dwAlphaSrcConstBitDepth : DWORD; // Bit depth used to specify alpha constant for source
case integer of
0: (
dwAlphaSrcConst : DWORD; // Constant to use as Alpha Channel
);
1: (
lpDDSAlphaSrc : PDirectDrawSurface; // Surface to use as Alpha Channel
case integer of
0: (
dwFillColor : DWORD; // color in RGB or Palettized
);
1: (
dwFillDepth : DWORD; // depth value for z-buffer
);
2: (
dwFillPixel : DWORD; // pixel value
);
3: (
lpDDSPattern : PDirectDrawSurface; // Surface to use as pattern
ddckDestColorkey : TDDColorKey; // DestColorkey override
ddckSrcColorkey : TDDColorKey; // SrcColorkey override
)
)
)
)
)
end;
{$EXTERNALSYM _DDBLTFX}
DDBLTFX = _DDBLTFX;
{$EXTERNALSYM DDBLTFX}
TDDBltFX = _DDBLTFX;
(*
* TDDSCaps
*)
PDDSCaps = ^TDDSCaps;
_DDSCAPS = packed record
dwCaps: DWORD; // capabilities of surface wanted
end;
{$EXTERNALSYM _DDSCAPS}
DDSCAPS = _DDSCAPS;
{$EXTERNALSYM DDSCAPS}
TDDSCaps = _DDSCAPS;
(*
* TDDOSCaps
*)
PDDOSCaps = ^TDDOSCaps;
_DDOSCAPS = packed record
dwCaps: DWORD; // capabilities of surface wanted
end;
{$EXTERNALSYM _DDOSCAPS}
DDOSCAPS = _DDOSCAPS;
{$EXTERNALSYM DDOSCAPS}
TDDOSCaps = _DDOSCAPS;
(*
* This structure is used internally by DirectDraw.
*)
PDDSCapsEx = ^TDDSCapsEx;
_DDSCAPSEX = packed record
dwCaps2 : DWORD;
dwCaps3 : DWORD;
dwCaps4 : DWORD;
end;
{$EXTERNALSYM _DDSCAPSEX}
DDSCAPSEX = _DDSCAPSEX;
{$EXTERNALSYM DDSCAPSEX}
TDDSCapsEx = _DDSCAPSEX;
(*
* TDDSCaps2
*)
PDDSCaps2 = ^TDDSCaps2;
_DDSCAPS2 = packed record
dwCaps: DWORD; // capabilities of surface wanted
dwCaps2 : DWORD;
dwCaps3 : DWORD;
dwCaps4 : DWORD;
end;
{$EXTERNALSYM _DDSCAPS2}
DDSCAPS2 = _DDSCAPS2;
{$EXTERNALSYM DDSCAPS2}
TDDSCaps2 = _DDSCAPS2;
(*
* NOTE: Our choosen structure number scheme is to append a single digit to
* the end of the structure giving the version that structure is associated
* with.
*)
(*
* This structure represents the DDCAPS structure released in DirectDraw 1.0. It is used internally
* by DirectDraw to interpret caps passed into ddraw by drivers written prior to the release of DirectDraw 2.0.
* New applications should use the DDCAPS structure defined below.
*)
PDDCaps_DX1 = ^TDDCaps_DX1;
_DDCAPS_DX1 = packed record
dwSize: DWORD; // size of the DDDRIVERCAPS structure
dwCaps: DWORD; // driver specific capabilities
dwCaps2: DWORD; // more driver specific capabilites
dwCKeyCaps: DWORD; // color key capabilities of the surface
dwFXCaps: DWORD; // driver specific stretching and effects capabilites
dwFXAlphaCaps: DWORD; // alpha driver specific capabilities
dwPalCaps: DWORD; // palette capabilities
dwSVCaps: DWORD; // stereo vision capabilities
dwAlphaBltConstBitDepths: DWORD; // DDBD_2,4,8
dwAlphaBltPixelBitDepths: DWORD; // DDBD_1,2,4,8
dwAlphaBltSurfaceBitDepths: DWORD; // DDBD_1,2,4,8
dwAlphaOverlayConstBitDepths: DWORD; // DDBD_2,4,8
dwAlphaOverlayPixelBitDepths: DWORD; // DDBD_1,2,4,8
dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
dwZBufferBitDepths: DWORD; // DDBD_8,16,24,32
dwVidMemTotal: DWORD; // total amount of video memory
dwVidMemFree: DWORD; // amount of free video memory
dwMaxVisibleOverlays: DWORD; // maximum number of visible overlays
dwCurrVisibleOverlays: DWORD; // current number of visible overlays
dwNumFourCCCodes: DWORD; // number of four cc codes
dwAlignBoundarySrc: DWORD; // source rectangle alignment
dwAlignSizeSrc: DWORD; // source rectangle byte size
dwAlignBoundaryDest: DWORD; // dest rectangle alignment
dwAlignSizeDest: DWORD; // dest rectangle byte size
dwAlignStrideAlign: DWORD; // stride alignment
dwRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported
ddsCaps: TDDSCaps; // TDDSCaps structure has all the general capabilities
dwMinOverlayStretch: DWORD; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMaxOverlayStretch: DWORD; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMinLiveVideoStretch: DWORD; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMaxLiveVideoStretch: DWORD; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMinHwCodecStretch: DWORD; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMaxHwCodecStretch: DWORD; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwReserved1: DWORD; // reserved
dwReserved2: DWORD; // reserved
dwReserved3: DWORD; // reserved
end;
{$EXTERNALSYM _DDCAPS_DX1}
DDCAPS_DX1 = _DDCAPS_DX1;
{$EXTERNALSYM DDCAPS_DX1}
TDDCaps_DX1 = _DDCAPS_DX1;
(*
* This structure is the TDDCaps structure as it was in version 2 and 3 of Direct X.
* It is present for back compatability.
*)
PDDCaps_DX3 = ^TDDCaps_DX3;
_DDCAPS_DX3 = packed record
dwSize: DWORD; // size of the DDDRIVERCAPS structure
dwCaps: DWORD; // driver specific capabilities
dwCaps2: DWORD; // more driver specific capabilites
dwCKeyCaps: DWORD; // color key capabilities of the surface
dwFXCaps: DWORD; // driver specific stretching and effects capabilites
dwFXAlphaCaps: DWORD; // alpha driver specific capabilities
dwPalCaps: DWORD; // palette capabilities
dwSVCaps: DWORD; // stereo vision capabilities
dwAlphaBltConstBitDepths: DWORD; // DDBD_2,4,8
dwAlphaBltPixelBitDepths: DWORD; // DDBD_1,2,4,8
dwAlphaBltSurfaceBitDepths: DWORD; // DDBD_1,2,4,8
dwAlphaOverlayConstBitDepths: DWORD; // DDBD_2,4,8
dwAlphaOverlayPixelBitDepths: DWORD; // DDBD_1,2,4,8
dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
dwZBufferBitDepths: DWORD; // DDBD_8,16,24,32
dwVidMemTotal: DWORD; // total amount of video memory
dwVidMemFree: DWORD; // amount of free video memory
dwMaxVisibleOverlays: DWORD; // maximum number of visible overlays
dwCurrVisibleOverlays: DWORD; // current number of visible overlays
dwNumFourCCCodes: DWORD; // number of four cc codes
dwAlignBoundarySrc: DWORD; // source rectangle alignment
dwAlignSizeSrc: DWORD; // source rectangle byte size
dwAlignBoundaryDest: DWORD; // dest rectangle alignment
dwAlignSizeDest: DWORD; // dest rectangle byte size
dwAlignStrideAlign: DWORD; // stride alignment
dwRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported
ddsCaps: TDDSCaps; // TDDSCaps structure has all the general capabilities
dwMinOverlayStretch: DWORD; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMaxOverlayStretch: DWORD; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMinLiveVideoStretch: DWORD; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMaxLiveVideoStretch: DWORD; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMinHwCodecStretch: DWORD; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMaxHwCodecStretch: DWORD; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwReserved1: DWORD; // reserved
dwReserved2: DWORD; // reserved
dwReserved3: DWORD; // reserved
dwSVBCaps: DWORD; // driver specific capabilities for System->Vmem blts
dwSVBCKeyCaps: DWORD; // driver color key capabilities for System->Vmem blts
dwSVBFXCaps: DWORD; // driver FX capabilities for System->Vmem blts
dwSVBRops: array[0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
dwVSBCaps: DWORD; // driver specific capabilities for Vmem->System blts
dwVSBCKeyCaps: DWORD; // driver color key capabilities for Vmem->System blts
dwVSBFXCaps: DWORD; // driver FX capabilities for Vmem->System blts
dwVSBRops: array[0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
dwSSBCaps: DWORD; // driver specific capabilities for System->System blts
dwSSBCKeyCaps: DWORD; // driver color key capabilities for System->System blts
dwSSBFXCaps: DWORD; // driver FX capabilities for System->System blts
dwSSBRops: array[0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
dwReserved4 : DWORD;
dwReserved5 : DWORD;
dwReserved6 : DWORD;
end;
{$EXTERNALSYM _DDCAPS_DX3}
DDCAPS_DX3 = _DDCAPS_DX3;
{$EXTERNALSYM DDCAPS_DX3}
TDDCaps_DX3 = _DDCAPS_DX3;
(*
* This structure is the TDDCaps structure as it was in version 5 of Direct X.
* It is present for back compatability.
*)
PDDCaps_DX5 = ^TDDCaps_DX5;
_DDCAPS_DX5 = packed record
dwSize: DWORD; // size of the DDDRIVERCAPS structure
dwCaps: DWORD; // driver specific capabilities
dwCaps2: DWORD; // more driver specific capabilites
dwCKeyCaps: DWORD; // color key capabilities of the surface
dwFXCaps: DWORD; // driver specific stretching and effects capabilites
dwFXAlphaCaps: DWORD; // alpha driver specific capabilities
dwPalCaps: DWORD; // palette capabilities
dwSVCaps: DWORD; // stereo vision capabilities
dwAlphaBltConstBitDepths: DWORD; // DDBD_2,4,8
dwAlphaBltPixelBitDepths: DWORD; // DDBD_1,2,4,8
dwAlphaBltSurfaceBitDepths: DWORD; // DDBD_1,2,4,8
dwAlphaOverlayConstBitDepths: DWORD; // DDBD_2,4,8
dwAlphaOverlayPixelBitDepths: DWORD; // DDBD_1,2,4,8
dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
dwZBufferBitDepths: DWORD; // DDBD_8,16,24,32
dwVidMemTotal: DWORD; // total amount of video memory
dwVidMemFree: DWORD; // amount of free video memory
dwMaxVisibleOverlays: DWORD; // maximum number of visible overlays
dwCurrVisibleOverlays: DWORD; // current number of visible overlays
dwNumFourCCCodes: DWORD; // number of four cc codes
dwAlignBoundarySrc: DWORD; // source rectangle alignment
dwAlignSizeSrc: DWORD; // source rectangle byte size
dwAlignBoundaryDest: DWORD; // dest rectangle alignment
dwAlignSizeDest: DWORD; // dest rectangle byte size
dwAlignStrideAlign: DWORD; // stride alignment
dwRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported
ddsCaps: TDDSCaps; // TDDSCaps structure has all the general capabilities
dwMinOverlayStretch: DWORD; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMaxOverlayStretch: DWORD; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMinLiveVideoStretch: DWORD; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMaxLiveVideoStretch: DWORD; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMinHwCodecStretch: DWORD; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMaxHwCodecStretch: DWORD; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwReserved1: DWORD; // reserved
dwReserved2: DWORD; // reserved
dwReserved3: DWORD; // reserved
dwSVBCaps: DWORD; // driver specific capabilities for System->Vmem blts
dwSVBCKeyCaps: DWORD; // driver color key capabilities for System->Vmem blts
dwSVBFXCaps: DWORD; // driver FX capabilities for System->Vmem blts
dwSVBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
dwVSBCaps: DWORD; // driver specific capabilities for Vmem->System blts
dwVSBCKeyCaps: DWORD; // driver color key capabilities for Vmem->System blts
dwVSBFXCaps: DWORD; // driver FX capabilities for Vmem->System blts
dwVSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
dwSSBCaps: DWORD; // driver specific capabilities for System->System blts
dwSSBCKeyCaps: DWORD; // driver color key capabilities for System->System blts
dwSSBFXCaps: DWORD; // driver FX capabilities for System->System blts
dwSSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
// Members added for DX5:
dwMaxVideoPorts: DWORD; // maximum number of usable video ports
dwCurrVideoPorts: DWORD; // current number of video ports used
dwSVBCaps2: DWORD; // more driver specific capabilities for System->Vmem blts
dwNLVBCaps: DWORD; // driver specific capabilities for non-local->local vidmem blts
dwNLVBCaps2: DWORD; // more driver specific capabilities non-local->local vidmem blts
dwNLVBCKeyCaps: DWORD; // driver color key capabilities for non-local->local vidmem blts
dwNLVBFXCaps: DWORD; // driver FX capabilities for non-local->local blts
dwNLVBRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for non-local->local blts
end;
{$EXTERNALSYM _DDCAPS_DX5}
DDCAPS_DX5 = _DDCAPS_DX5;
{$EXTERNALSYM DDCAPS_DX5}
TDDCaps_DX5 = _DDCAPS_DX5;
PDDCaps_DX6 = ^TDDCaps_DX6;
_DDCAPS_DX6 = packed record
dwSize: DWORD; // size of the DDDRIVERCAPS structure
dwCaps: DWORD; // driver specific capabilities
dwCaps2: DWORD; // more driver specific capabilites
dwCKeyCaps: DWORD; // color key capabilities of the surface
dwFXCaps: DWORD; // driver specific stretching and effects capabilites
dwFXAlphaCaps: DWORD; // alpha driver specific capabilities
dwPalCaps: DWORD; // palette capabilities
dwSVCaps: DWORD; // stereo vision capabilities
dwAlphaBltConstBitDepths: DWORD; // DDBD_2,4,8
dwAlphaBltPixelBitDepths: DWORD; // DDBD_1,2,4,8
dwAlphaBltSurfaceBitDepths: DWORD; // DDBD_1,2,4,8
dwAlphaOverlayConstBitDepths: DWORD; // DDBD_2,4,8
dwAlphaOverlayPixelBitDepths: DWORD; // DDBD_1,2,4,8
dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
dwZBufferBitDepths: DWORD; // DDBD_8,16,24,32
dwVidMemTotal: DWORD; // total amount of video memory
dwVidMemFree: DWORD; // amount of free video memory
dwMaxVisibleOverlays: DWORD; // maximum number of visible overlays
dwCurrVisibleOverlays: DWORD; // current number of visible overlays
dwNumFourCCCodes: DWORD; // number of four cc codes
dwAlignBoundarySrc: DWORD; // source rectangle alignment
dwAlignSizeSrc: DWORD; // source rectangle byte size
dwAlignBoundaryDest: DWORD; // dest rectangle alignment
dwAlignSizeDest: DWORD; // dest rectangle byte size
dwAlignStrideAlign: DWORD; // stride alignment
dwRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported
ddsOldCaps: TDDSCaps; // Was dssCaps: TDDSCaps. ddsCaps is of type TDDScaps2 for DX6
dwMinOverlayStretch: DWORD; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMaxOverlayStretch: DWORD; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMinLiveVideoStretch: DWORD; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMaxLiveVideoStretch: DWORD; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMinHwCodecStretch: DWORD; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMaxHwCodecStretch: DWORD; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwReserved1: DWORD; // reserved
dwReserved2: DWORD; // reserved
dwReserved3: DWORD; // reserved
dwSVBCaps: DWORD; // driver specific capabilities for System->Vmem blts
dwSVBCKeyCaps: DWORD; // driver color key capabilities for System->Vmem blts
dwSVBFXCaps: DWORD; // driver FX capabilities for System->Vmem blts
dwSVBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
dwVSBCaps: DWORD; // driver specific capabilities for Vmem->System blts
dwVSBCKeyCaps: DWORD; // driver color key capabilities for Vmem->System blts
dwVSBFXCaps: DWORD; // driver FX capabilities for Vmem->System blts
dwVSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
dwSSBCaps: DWORD; // driver specific capabilities for System->System blts
dwSSBCKeyCaps: DWORD; // driver color key capabilities for System->System blts
dwSSBFXCaps: DWORD; // driver FX capabilities for System->System blts
dwSSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
// Members added for DX5:
dwMaxVideoPorts: DWORD; // maximum number of usable video ports
dwCurrVideoPorts: DWORD; // current number of video ports used
dwSVBCaps2: DWORD; // more driver specific capabilities for System->Vmem blts
dwNLVBCaps: DWORD; // driver specific capabilities for non-local->local vidmem blts
dwNLVBCaps2: DWORD; // more driver specific capabilities non-local->local vidmem blts
dwNLVBCKeyCaps: DWORD; // driver color key capabilities for non-local->local vidmem blts
dwNLVBFXCaps: DWORD; // driver FX capabilities for non-local->local blts
dwNLVBRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for non-local->local blts
// Members added for DX6 release
ddsCaps : TDDSCaps2 ; // Surface Caps
end;
{$EXTERNALSYM _DDCAPS_DX6}
DDCAPS_DX6 = _DDCAPS_DX6;
{$EXTERNALSYM DDCAPS_DX6}
TDDCaps_DX6 = _DDCAPS_DX6;
_DDCAPS_DX7 = TDDCaps_DX6;
{$EXTERNALSYM _DDCAPS_DX7}
DDCAPS_DX7 = _DDCAPS_DX7;
{$EXTERNALSYM DDCAPS_DX7}
PDDCaps_DX7 = ^TDDCaps_DX7;
TDDCaps_DX7 = TDDCaps_DX6;
{$IFDEF DIRECTDRAW_VERSION_7}
PDDCaps = PDDCaps_DX7;
TDDCaps = TDDCaps_DX7;
{$ELSE}
{$IFDEF DIRECTDRAW_VERSION_6}
PDDCaps = PDDCaps_DX6;
TDDCaps = TDDCaps_DX6;
{$ELSE}
{$IFDEF DIRECTDRAW_VERSION_5}
PDDCaps = PDDCaps_DX5;
TDDCaps = TDDCaps_DX5;
{$ELSE}
{$IFDEF DIRECTDRAW_VERSION_3}
PDDCaps = PDDCaps_DX3;
TDDCaps = TDDCaps_DX3;
{$ELSE}
PDDCaps = PDDCaps_DX1;
TDDCaps = TDDCaps_DX1;
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}
(*
* TDDPixelFormat
*)
PDDPixelFormat = ^TDDPixelFormat;
_DDPIXELFORMAT = packed record
dwSize: DWORD; // size of structure
dwFlags: DWORD; // pixel format flags
dwFourCC: DWORD; // (FOURCC code)
case Integer of
1: (
dwRGBBitCount : DWORD; // how many bits per pixel
dwRBitMask : DWORD; // mask for red bit
dwGBitMask : DWORD; // mask for green bits
dwBBitMask : DWORD; // mask for blue bits
dwRGBAlphaBitMask : DWORD; // mask for alpha channel
);
2: (
dwYUVBitCount : DWORD; // how many bits per pixel
dwYBitMask : DWORD; // mask for Y bits
dwUBitMask : DWORD; // mask for U bits
dwVBitMask : DWORD; // mask for V bits
dwYUVAlphaBitMask : DWORD; // mask for alpha channel
);
3: (
dwZBufferBitDepth : DWORD; // how many total bits/pixel in z buffer (including any stencil bits)
dwStencilBitDepth : DWORD; // how many stencil bits (note: dwZBufferBitDepth-dwStencilBitDepth is total Z-only bits)
dwZBitMask : DWORD; // mask for Z bits
dwStencilBitMask : DWORD; // mask for stencil bits
dwLuminanceAlphaBitMask : DWORD; // mask for alpha channel
);
4: (
dwAlphaBitDepth : DWORD; // how many bits for alpha channels
dwLuminanceBitMask : DWORD; // mask for luminance bits
dwBumpDvBitMask : DWORD; // mask for bump map V delta bits
dwBumpLuminanceBitMask : DWORD; // mask for luminance in bump map
dwRGBZBitMask : DWORD; // mask for Z channel
);
5: (
dwLuminanceBitCount : DWORD; // how many bits per pixel
dwBumpDuBitMask : DWORD; // mask for bump map U delta bits
Fill1, Fill2 : DWORD;
dwYUVZBitMask : DWORD; // mask for Z channel
);
6: ( dwBumpBitCount : DWORD; // how many bits per "buxel", total
);
end;
{$EXTERNALSYM _DDPIXELFORMAT}
DDPIXELFORMAT = _DDPIXELFORMAT;
{$EXTERNALSYM DDPIXELFORMAT}
TDDPixelFormat = _DDPIXELFORMAT;
// These definitions are for compatibility with Erik Unger original conversion
PDDPixelFormat_DX3 = PDDPixelFormat;
TDDPixelFormat_DX3 = TDDPixelFormat;
PDDPixelFormat_DX5 = PDDPixelFormat;
TDDPixelFormat_DX5 = TDDPixelFormat;
PDDPixelFormat_DX6 = PDDPixelFormat;
TDDPixelFormat_DX6 = TDDPixelFormat;
PDDPixelFormat_DX7 = PDDPixelFormat;
TDDPixelFormat_DX7 = TDDPixelFormat;
(*
* TDDOverlayFX
*)
PDDOverlayFX = ^TDDOverlayFX;
_DDOVERLAYFX = packed record
dwSize: DWORD; // size of structure
dwAlphaEdgeBlendBitDepth: DWORD; // Bit depth used to specify constant for alpha edge blend
dwAlphaEdgeBlend: DWORD; // Constant to use as alpha for edge blend
dwReserved: DWORD;
dwAlphaDestConstBitDepth: DWORD; // Bit depth used to specify alpha constant for destination
case Integer of
0: (
dwAlphaDestConst: DWORD; // Constant to use as alpha channel for dest
dwAlphaSrcConstBitDepth: DWORD; // Bit depth used to specify alpha constant for source
dwAlphaSrcConst: DWORD; // Constant to use as alpha channel for src
dckDestColorkey: TDDColorKey; // DestColorkey override
dckSrcColorkey: TDDColorKey; // DestColorkey override
dwDDFX: DWORD; // Overlay FX
dwFlags: DWORD; // flags
);
1: (
lpDDSAlphaDest: PDirectDrawSurface; // Surface to use as alpha channel for dest
filler: DWORD;
lpDDSAlphaSrc: PDirectDrawSurface; // Surface to use as alpha channel for src
);
end;
{$EXTERNALSYM _DDOVERLAYFX}
DDOVERLAYFX = _DDOVERLAYFX;
{$EXTERNALSYM DDOVERLAYFX}
TDDOverlayFX = _DDOVERLAYFX;
(*
* TDDBltBatch: BltBatch entry structure
*)
PDDBltBatch = ^TDDBltBatch;
_DDBLTBATCH = packed record
lprDest: PRect;
lpDDSSrc: IDirectDrawSurface;
lprSrc: PRect;
dwFlags: DWORD;
lpDDBltFx: TDDBltFX;
end;
{$EXTERNALSYM _DDBLTBATCH}
DDBLTBATCH = _DDBLTBATCH;
{$EXTERNALSYM DDBLTBATCH}
TDDBltBatch = _DDBLTBATCH;
(*
* TDDGammaRamp
*)
PDDGammaRamp = ^TDDGammaRamp;
_DDGAMMARAMP = packed record
red : array[0..255] of WORD;
green : array[0..255] of WORD;
blue : array[0..255] of WORD;
end;
{$EXTERNALSYM _DDGAMMARAMP}
DDGAMMARAMP = _DDGAMMARAMP;
{$EXTERNALSYM DDGAMMARAMP}
TDDGammaRamp = _DDGAMMARAMP;
(*
* This is the structure within which DirectDraw returns data about the current graphics driver and chipset
*)
PDDDeviceIdentifier = ^TDDDeviceIdentifier;
tagDDDEVICEIDENTIFIER = packed record
//
// These elements are for presentation to the user only. They should not be used to identify particular
// drivers, since this is unreliable and many different strings may be associated with the same
// device, and the same driver from different vendors.
//
szDriver: array[0..MAX_DDDEVICEID_STRING-1] of Char;
szDescription: array[0..MAX_DDDEVICEID_STRING-1] of Char;
//
// This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons
// on the whole 64 bits. Caution should be exercised if you use this element to identify problematic
// drivers. It is recommended that guidDeviceIdentifier is used for this purpose.
//
// This version has the form:
// wProduct = HIWORD(liDriverVersion.HighPart)
// wVersion = LOWORD(liDriverVersion.HighPart)
// wSubVersion = HIWORD(liDriverVersion.LowPart)
// wBuild = LOWORD(liDriverVersion.LowPart)
//
liDriverVersion: TLargeInteger; // Defined for applications and other 32 bit components
//
// These elements can be used to identify particular chipsets. Use with extreme caution.
// dwVendorId Identifies the manufacturer. May be zero if unknown.
// dwDeviceId Identifies the type of chipset. May be zero if unknown.
// dwSubSysId Identifies the subsystem, typically this means the particular board. May be zero if unknown.
// dwRevision Identifies the revision level of the chipset. May be zero if unknown.
//
dwVendorId: DWORD;
dwDeviceId: DWORD;
dwSubSysId: DWORD;
dwRevision: DWORD;
//
// This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the
// driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to
// reprofile the graphics subsystem.
// This element can also be used to identify particular problematic drivers.
//
guidDeviceIdentifier: TGUID;
end;
{$EXTERNALSYM tagDDDEVICEIDENTIFIER}
DDDEVICEIDENTIFIER = tagDDDEVICEIDENTIFIER;
{$EXTERNALSYM DDDEVICEIDENTIFIER}
TDDDeviceIdentifier = tagDDDEVICEIDENTIFIER;
PDDDeviceIdentifier2 = ^TDDDeviceIdentifier2;
tagDDDEVICEIDENTIFIER2 = packed record
//
// These elements are for presentation to the user only. They should not be used to identify particular
// drivers, since this is unreliable and many different strings may be associated with the same
// device, and the same driver from different vendors.
//
szDriver: array[0..MAX_DDDEVICEID_STRING-1] of Char;
szDescription: array[0..MAX_DDDEVICEID_STRING-1] of Char;
//
// This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons
// on the whole 64 bits. Caution should be exercised if you use this element to identify problematic
// drivers. It is recommended that guidDeviceIdentifier is used for this purpose.
//
// This version has the form:
// wProduct = HIWORD(liDriverVersion.HighPart)
// wVersion = LOWORD(liDriverVersion.HighPart)
// wSubVersion = HIWORD(liDriverVersion.LowPart)
// wBuild = LOWORD(liDriverVersion.LowPart)
//
liDriverVersion: TLargeInteger; // Defined for applications and other 32 bit components
//
// These elements can be used to identify particular chipsets. Use with extreme caution.
// dwVendorId Identifies the manufacturer. May be zero if unknown.
// dwDeviceId Identifies the type of chipset. May be zero if unknown.
// dwSubSysId Identifies the subsystem, typically this means the particular board. May be zero if unknown.
// dwRevision Identifies the revision level of the chipset. May be zero if unknown.
//
dwVendorId: DWORD;
dwDeviceId: DWORD;
dwSubSysId: DWORD;
dwRevision: DWORD;
//
// This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the
// driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to
// reprofile the graphics subsystem.
// This element can also be used to identify particular problematic drivers.
//
guidDeviceIdentifier: TGUID;
(*
* This element is used to determine the Windows Hardware Quality Lab (WHQL)
* certification level for this driver/device pair.
*)
dwWHQLLevel: DWORD;
end;
{$EXTERNALSYM tagDDDEVICEIDENTIFIER2}
DDDEVICEIDENTIFIER2 = tagDDDEVICEIDENTIFIER2;
{$EXTERNALSYM DDDEVICEIDENTIFIER2}
TDDDeviceIdentifier2 = tagDDDEVICEIDENTIFIER2;
(*
* callbacks
*)
TClipperCallback = function(lpDDClipper: IDirectDrawClipper; hWnd: HWND;
Code: DWORD; lpContext: Pointer): HResult; stdcall;
{$NODEFINE TClipperCallback}
{$HPPEMIT 'typedef LPCLIPPERCALLBACK TClipperCallback;'}
TSurfacesStreamingCallback = function(arg: DWORD): HResult; stdcall;
{$NODEFINE TSurfacesStreamingCallback}
(*
* TDDSurfaceDesc
*)
PDDSurfaceDesc = ^TDDSurfaceDesc;
_DDSURFACEDESC = packed record
dwSize: DWORD; // size of the TDDSurfaceDesc structure
dwFlags: DWORD; // determines what fields are valid
dwHeight: DWORD; // height of surface to be created
dwWidth: DWORD; // width of input surface
case Integer of