-
Notifications
You must be signed in to change notification settings - Fork 1
/
Direct3D9.pas
4943 lines (4442 loc) · 208 KB
/
Direct3D9.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: d3d9types.h d3d9caps.h d3d9.h *}
{* Content: Direct3D9 include files *}
{* *}
{* DirectX 9.0 Delphi adaptation by Alexey Barkovoy *}
{* E-Mail: [email protected] *}
{* *}
{* Modified: 26-Jan-2003 *}
{* *}
{* Latest version can be downloaded from: *}
{* http://clootie.narod.ru/delphi *}
{* *}
{* This File contains only Direct3D 9.0 definitions. *}
{* If you want to use previous versions - use Direct3D.pas and Direct3D8.pas *}
{* *}
{******************************************************************************}
{ }
{ 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 }
{ }
{******************************************************************************}
{$I DirectX.inc}
unit Direct3D9;
interface
// Global level dynamic loading support
{$IFDEF DYNAMIC_LINK_ALL}
{$DEFINE DIRECT3D9_DYNAMIC_LINK}
{$ENDIF}
{$IFDEF DYNAMIC_LINK_EXPLICIT_ALL}
{$DEFINE DIRECT3D9_DYNAMIC_LINK_EXPLICIT}
{$ENDIF}
// Remove "dots" below to force some kind of dynamic linking
{.$DEFINE DIRECT3D9_DYNAMIC_LINK}
{.$DEFINE DIRECT3D9_DYNAMIC_LINK_EXPLICIT}
{$NOINCLUDE DXTypes}
(*$HPPEMIT '#include "d3d9.h"' *)
(*$HPPEMIT '#include "d3d9types.h"' *)
(*$HPPEMIT '#include "d3d9caps.h"' *)
uses Windows, DXTypes;
///// Helper constants (for use in SetRenderState) /////
const
iTrue = DWORD(True);
iFalse = DWORD(False);
(*==========================================================================;
*
* Copyright (C) Microsoft Corporation. All Rights Reserved.
*
* File: d3d9types.h
* Content: Direct3D capabilities include file
*
***************************************************************************)
type
// D3DCOLOR is equivalent to D3DFMT_A8R8G8B8
D3DCOLOR = DXTypes.D3DCOLOR;
{$EXTERNALSYM D3DCOLOR}
TD3DColor = DXTypes.TD3DColor;
{$NODEFINE TD3DColor}
{$HPPEMIT 'typedef D3DCOLOR TD3DColor;'}
// maps unsigned 8 bits/channel to D3DCOLOR
// #define D3DCOLOR_ARGB(a,r,g,b) \
// ((D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff)))
function D3DCOLOR_ARGB(a,r,g,b: DWord): TD3DColor;
{$EXTERNALSYM D3DCOLOR_ARGB}
// #define D3DCOLOR_RGBA(r,g,b,a) D3DCOLOR_ARGB(a,r,g,b)
function D3DCOLOR_RGBA(r,g,b,a: DWord): TD3DColor;
{$EXTERNALSYM D3DCOLOR_RGBA}
// #define D3DCOLOR_XRGB(r,g,b) D3DCOLOR_ARGB(0xff,r,g,b)
function D3DCOLOR_XRGB(r,g,b: DWord): TD3DColor;
{$EXTERNALSYM D3DCOLOR_XRGB}
// #define D3DCOLOR_XYUV(y,u,v) D3DCOLOR_ARGB(0xff,y,u,v)
function D3DCOLOR_XYUV(y,u,v: DWord): TD3DColor;
{$EXTERNALSYM D3DCOLOR_XYUV}
// #define D3DCOLOR_AYUV(a,y,u,v) D3DCOLOR_ARGB(a,y,u,v)
function D3DCOLOR_AYUV(a,y,u,v: DWord): TD3DColor;
{$EXTERNALSYM D3DCOLOR_AYUV}
// maps floating point channels (0.f to 1.f range) to D3DCOLOR
// #define D3DCOLOR_COLORVALUE(r,g,b,a) \
// D3DCOLOR_RGBA((DWORD)((r)*255.f),(DWORD)((g)*255.f),(DWORD)((b)*255.f),(DWORD)((a)*255.f))
function D3DCOLOR_COLORVALUE(r,g,b,a: Single): TD3DColor;
{$EXTERNALSYM D3DCOLOR_COLORVALUE}
type
_D3DVECTOR = DXTypes._D3DVECTOR;
{$EXTERNALSYM _D3DVECTOR}
D3DVECTOR = DXTypes.D3DVECTOR;
{$EXTERNALSYM D3DVECTOR}
TD3DVector = DXTypes.TD3DVector;
{$NODEFINE TD3DVector}
PD3DVector = DXTypes.PD3DVector;
{$NODEFINE PD3DVector}
{$HPPEMIT 'typedef _D3DVECTOR TD3DVector;'}
{$HPPEMIT 'typedef _D3DVECTOR *PD3DVector;'}
PD3DColorValue = ^TD3DColorValue;
_D3DCOLORVALUE = packed record
r: Single;
g: Single;
b: Single;
a: Single;
end {_D3DCOLORVALUE};
{$EXTERNALSYM _D3DCOLORVALUE}
D3DCOLORVALUE = _D3DCOLORVALUE;
{$EXTERNALSYM D3DCOLORVALUE}
TD3DColorValue = _D3DCOLORVALUE;
PD3DRect = ^TD3DRect;
_D3DRECT = packed record
x1: LongInt;
y1: LongInt;
x2: LongInt;
y2: LongInt;
end {_D3DRECT};
{$EXTERNALSYM _D3DRECT}
D3DRECT = _D3DRECT;
{$EXTERNALSYM D3DRECT}
TD3DRect = _D3DRECT;
PD3DMatrix = ^TD3DMatrix;
_D3DMATRIX = packed record
case integer of
0 : (_11, _12, _13, _14: Single;
_21, _22, _23, _24: Single;
_31, _32, _33, _34: Single;
_41, _42, _43, _44: Single);
1 : (m : array [0..3, 0..3] of Single);
end {_D3DMATRIX};
{$EXTERNALSYM _D3DMATRIX}
D3DMATRIX = _D3DMATRIX;
{$EXTERNALSYM D3DMATRIX}
TD3DMatrix = _D3DMATRIX;
PD3DViewport9 = ^TD3DViewport9;
_D3DVIEWPORT9 = packed record
X: DWord;
Y: DWord; { Viewport Top left }
Width: DWord;
Height: DWord; { Viewport Dimensions }
MinZ: Single; { Min/max of clip Volume }
MaxZ: Single;
end {_D3DVIEWPORT9};
{$EXTERNALSYM _D3DVIEWPORT9}
D3DVIEWPORT9 = _D3DVIEWPORT9;
{$EXTERNALSYM D3DVIEWPORT9}
TD3DViewport9 = _D3DVIEWPORT9;
(*
* Values for clip fields.
*)
const
// Max number of user clipping planes, supported in D3D.
D3DMAXUSERCLIPPLANES = 32;
{$EXTERNALSYM D3DMAXUSERCLIPPLANES}
// These bits could be ORed together to use with D3DRS_CLIPPLANEENABLE
//
D3DCLIPPLANE0 = (1 shl 0);
{$EXTERNALSYM D3DCLIPPLANE0}
D3DCLIPPLANE1 = (1 shl 1);
{$EXTERNALSYM D3DCLIPPLANE1}
D3DCLIPPLANE2 = (1 shl 2);
{$EXTERNALSYM D3DCLIPPLANE2}
D3DCLIPPLANE3 = (1 shl 3);
{$EXTERNALSYM D3DCLIPPLANE3}
D3DCLIPPLANE4 = (1 shl 4);
{$EXTERNALSYM D3DCLIPPLANE4}
D3DCLIPPLANE5 = (1 shl 5);
{$EXTERNALSYM D3DCLIPPLANE5}
// The following bits are used in the ClipUnion and ClipIntersection
// members of the D3DCLIPSTATUS9
//
D3DCS_LEFT = $00000001;
{$EXTERNALSYM D3DCS_LEFT}
D3DCS_RIGHT = $00000002;
{$EXTERNALSYM D3DCS_RIGHT}
D3DCS_TOP = $00000004;
{$EXTERNALSYM D3DCS_TOP}
D3DCS_BOTTOM = $00000008;
{$EXTERNALSYM D3DCS_BOTTOM}
D3DCS_FRONT = $00000010;
{$EXTERNALSYM D3DCS_FRONT}
D3DCS_BACK = $00000020;
{$EXTERNALSYM D3DCS_BACK}
D3DCS_PLANE0 = $00000040;
{$EXTERNALSYM D3DCS_PLANE0}
D3DCS_PLANE1 = $00000080;
{$EXTERNALSYM D3DCS_PLANE1}
D3DCS_PLANE2 = $00000100;
{$EXTERNALSYM D3DCS_PLANE2}
D3DCS_PLANE3 = $00000200;
{$EXTERNALSYM D3DCS_PLANE3}
D3DCS_PLANE4 = $00000400;
{$EXTERNALSYM D3DCS_PLANE4}
D3DCS_PLANE5 = $00000800;
{$EXTERNALSYM D3DCS_PLANE5}
D3DCS_ALL = D3DCS_LEFT or
D3DCS_RIGHT or
D3DCS_TOP or
D3DCS_BOTTOM or
D3DCS_FRONT or
D3DCS_BACK or
D3DCS_PLANE0 or
D3DCS_PLANE1 or
D3DCS_PLANE2 or
D3DCS_PLANE3 or
D3DCS_PLANE4 or
D3DCS_PLANE5;
{$EXTERNALSYM D3DCS_ALL}
type
PD3DClipStatus9 = ^TD3DClipStatus9;
_D3DCLIPSTATUS9 = packed record
ClipUnion: DWord;
ClipIntersection: DWord;
end {_D3DCLIPSTATUS9};
{$EXTERNALSYM _D3DCLIPSTATUS9}
D3DCLIPSTATUS9 = _D3DCLIPSTATUS9;
{$EXTERNALSYM D3DCLIPSTATUS9}
TD3DClipStatus9 = _D3DCLIPSTATUS9;
PD3DMaterial9 = ^TD3DMaterial9;
_D3DMATERIAL9 = packed record
Diffuse: TD3DColorValue; { Diffuse color RGBA }
Ambient: TD3DColorValue; { Ambient color RGB }
Specular: TD3DColorValue; { Specular 'shininess' }
Emissive: TD3DColorValue; { Emissive color RGB }
Power: Single; { Sharpness if specular highlight }
end {_D3DMATERIAL9};
{$EXTERNALSYM _D3DMATERIAL9}
D3DMATERIAL9 = _D3DMATERIAL9;
{$EXTERNALSYM D3DMATERIAL9}
TD3DMaterial9 = _D3DMATERIAL9;
_D3DLIGHTTYPE = (
{$IFNDEF COMPILER6_UP}
D3DLIGHT_INVALID_0, {= 0}
D3DLIGHT_POINT, {= 1}
D3DLIGHT_SPOT, {= 2}
D3DLIGHT_DIRECTIONAL{= 3}
{$ELSE}
D3DLIGHT_POINT = 1,
D3DLIGHT_SPOT = 2,
D3DLIGHT_DIRECTIONAL = 3
{$ENDIF}
);
{$EXTERNALSYM _D3DLIGHTTYPE}
D3DLIGHTTYPE = _D3DLIGHTTYPE;
{$EXTERNALSYM D3DLIGHTTYPE}
TD3DLightType = _D3DLIGHTTYPE;
PD3DLight9 = ^TD3DLight9;
_D3DLIGHT9 = packed record
_Type: TD3DLightType; { Type of light source }
Diffuse: TD3DColorValue; { Diffuse color of light }
Specular: TD3DColorValue; { Specular color of light }
Ambient: TD3DColorValue; { Ambient color of light }
Position: TD3DVector; { Position in world space }
Direction: TD3DVector; { Direction in world space }
Range: Single; { Cutoff range }
Falloff: Single; { Falloff }
Attenuation0: Single; { Constant attenuation }
Attenuation1: Single; { Linear attenuation }
Attenuation2: Single; { Quadratic attenuation }
Theta: Single; { Inner angle of spotlight cone }
Phi: Single; { Outer angle of spotlight cone }
end {_D3DLIGHT9};
{$EXTERNALSYM _D3DLIGHT9}
D3DLIGHT9 = _D3DLIGHT9;
{$EXTERNALSYM D3DLIGHT9}
TD3DLight9 = _D3DLIGHT9;
(*
* Options for clearing
*)
const
D3DCLEAR_TARGET = $00000001; { Clear target surface }
{$EXTERNALSYM D3DCLEAR_TARGET}
D3DCLEAR_ZBUFFER = $00000002; { Clear target z buffer }
{$EXTERNALSYM D3DCLEAR_ZBUFFER}
D3DCLEAR_STENCIL = $00000004; { Clear stencil planes }
{$EXTERNALSYM D3DCLEAR_STENCIL}
(*
* The following defines the rendering states
*)
type
_D3DSHADEMODE = {$IFDEF TYPE_IDENTITY}type {$ENDIF}DWord;
{$EXTERNALSYM _D3DSHADEMODE}
D3DSHADEMODE = _D3DSHADEMODE;
{$EXTERNALSYM D3DSHADEMODE}
TD3DShadeMode = _D3DSHADEMODE;
const
D3DSHADE_FLAT = 1;
{$EXTERNALSYM D3DSHADE_FLAT}
D3DSHADE_GOURAUD = 2;
{$EXTERNALSYM D3DSHADE_GOURAUD}
D3DSHADE_PHONG = 3;
{$EXTERNALSYM D3DSHADE_PHONG}
type
_D3DFILLMODE = {$IFDEF TYPE_IDENTITY}type {$ENDIF}DWord;
{$EXTERNALSYM _D3DFILLMODE}
D3DFILLMODE = _D3DFILLMODE;
{$EXTERNALSYM D3DFILLMODE}
TD3DFillMode = _D3DFILLMODE;
const
D3DFILL_POINT = 1;
{$EXTERNALSYM D3DFILL_POINT}
D3DFILL_WIREFRAME = 2;
{$EXTERNALSYM D3DFILL_WIREFRAME}
D3DFILL_SOLID = 3;
{$EXTERNALSYM D3DFILL_SOLID}
type
_D3DBLEND = {$IFDEF TYPE_IDENTITY}type {$ENDIF}DWord;
{$EXTERNALSYM _D3DBLEND}
D3DBLEND = _D3DBLEND;
{$EXTERNALSYM D3DBLEND}
TD3DBlend = _D3DBLEND;
const
D3DBLEND_ZERO = 1;
{$EXTERNALSYM D3DBLEND_ZERO}
D3DBLEND_ONE = 2;
{$EXTERNALSYM D3DBLEND_ONE}
D3DBLEND_SRCCOLOR = 3;
{$EXTERNALSYM D3DBLEND_SRCCOLOR}
D3DBLEND_INVSRCCOLOR = 4;
{$EXTERNALSYM D3DBLEND_INVSRCCOLOR}
D3DBLEND_SRCALPHA = 5;
{$EXTERNALSYM D3DBLEND_SRCALPHA}
D3DBLEND_INVSRCALPHA = 6;
{$EXTERNALSYM D3DBLEND_INVSRCALPHA}
D3DBLEND_DESTALPHA = 7;
{$EXTERNALSYM D3DBLEND_DESTALPHA}
D3DBLEND_INVDESTALPHA = 8;
{$EXTERNALSYM D3DBLEND_INVDESTALPHA}
D3DBLEND_DESTCOLOR = 9;
{$EXTERNALSYM D3DBLEND_DESTCOLOR}
D3DBLEND_INVDESTCOLOR = 10;
{$EXTERNALSYM D3DBLEND_INVDESTCOLOR}
D3DBLEND_SRCALPHASAT = 11;
{$EXTERNALSYM D3DBLEND_SRCALPHASAT}
D3DBLEND_BOTHSRCALPHA = 12;
{$EXTERNALSYM D3DBLEND_BOTHSRCALPHA}
D3DBLEND_BOTHINVSRCALPHA = 13;
{$EXTERNALSYM D3DBLEND_BOTHINVSRCALPHA}
D3DBLEND_BLENDFACTOR = 14; (* Only supported if D3DPBLENDCAPS_BLENDFACTOR is on *)
{$EXTERNALSYM D3DBLEND_BLENDFACTOR}
D3DBLEND_INVBLENDFACTOR = 15; (* Only supported if D3DPBLENDCAPS_BLENDFACTOR is on *)
{$EXTERNALSYM D3DBLEND_INVBLENDFACTOR}
type
_D3DBLENDOP = {$IFDEF TYPE_IDENTITY}type {$ENDIF}DWord;
{$EXTERNALSYM _D3DBLENDOP}
D3DBLENDOP = _D3DBLENDOP;
{$EXTERNALSYM D3DBLENDOP}
TD3DBlendOp = _D3DBLENDOP;
const
D3DBLENDOP_ADD = 1;
{$EXTERNALSYM D3DBLENDOP_ADD}
D3DBLENDOP_SUBTRACT = 2;
{$EXTERNALSYM D3DBLENDOP_SUBTRACT}
D3DBLENDOP_REVSUBTRACT = 3;
{$EXTERNALSYM D3DBLENDOP_REVSUBTRACT}
D3DBLENDOP_MIN = 4;
{$EXTERNALSYM D3DBLENDOP_MIN}
D3DBLENDOP_MAX = 5;
{$EXTERNALSYM D3DBLENDOP_MAX}
type
_D3DTEXTUREADDRESS = {$IFDEF TYPE_IDENTITY}type {$ENDIF}DWord;
{$EXTERNALSYM _D3DTEXTUREADDRESS}
D3DTEXTUREADDRESS = _D3DTEXTUREADDRESS;
{$EXTERNALSYM D3DTEXTUREADDRESS}
TD3DTextureAddress = _D3DTEXTUREADDRESS;
const
D3DTADDRESS_WRAP = 1;
{$EXTERNALSYM D3DTADDRESS_WRAP}
D3DTADDRESS_MIRROR = 2;
{$EXTERNALSYM D3DTADDRESS_MIRROR}
D3DTADDRESS_CLAMP = 3;
{$EXTERNALSYM D3DTADDRESS_CLAMP}
D3DTADDRESS_BORDER = 4;
{$EXTERNALSYM D3DTADDRESS_BORDER}
D3DTADDRESS_MIRRORONCE = 5;
{$EXTERNALSYM D3DTADDRESS_MIRRORONCE}
type
_D3DCULL = {$IFDEF TYPE_IDENTITY}type {$ENDIF}DWord;
{$EXTERNALSYM _D3DCULL}
D3DCULL = _D3DCULL;
{$EXTERNALSYM D3DCULL}
TD3DCull = _D3DCULL;
const
D3DCULL_NONE = 1;
{$EXTERNALSYM D3DCULL_NONE}
D3DCULL_CW = 2;
{$EXTERNALSYM D3DCULL_CW}
D3DCULL_CCW = 3;
{$EXTERNALSYM D3DCULL_CCW}
type
_D3DCMPFUNC = {$IFDEF TYPE_IDENTITY}type {$ENDIF}DWord;
{$EXTERNALSYM _D3DCMPFUNC}
D3DCMPFUNC = _D3DCMPFUNC;
{$EXTERNALSYM D3DCMPFUNC}
TD3DCmpFunc = _D3DCMPFUNC;
const
D3DCMP_NEVER = 1;
{$EXTERNALSYM D3DCMP_NEVER}
D3DCMP_LESS = 2;
{$EXTERNALSYM D3DCMP_LESS}
D3DCMP_EQUAL = 3;
{$EXTERNALSYM D3DCMP_EQUAL}
D3DCMP_LESSEQUAL = 4;
{$EXTERNALSYM D3DCMP_LESSEQUAL}
D3DCMP_GREATER = 5;
{$EXTERNALSYM D3DCMP_GREATER}
D3DCMP_NOTEQUAL = 6;
{$EXTERNALSYM D3DCMP_NOTEQUAL}
D3DCMP_GREATEREQUAL = 7;
{$EXTERNALSYM D3DCMP_GREATEREQUAL}
D3DCMP_ALWAYS = 8;
{$EXTERNALSYM D3DCMP_ALWAYS}
type
_D3DSTENCILOP = {$IFDEF TYPE_IDENTITY}type {$ENDIF}DWord;
{$EXTERNALSYM _D3DSTENCILOP}
D3DSTENCILOP = _D3DSTENCILOP;
{$EXTERNALSYM D3DSTENCILOP}
TD3DStencilOp = _D3DSTENCILOP;
const
D3DSTENCILOP_KEEP = 1;
{$EXTERNALSYM D3DSTENCILOP_KEEP}
D3DSTENCILOP_ZERO = 2;
{$EXTERNALSYM D3DSTENCILOP_ZERO}
D3DSTENCILOP_REPLACE = 3;
{$EXTERNALSYM D3DSTENCILOP_REPLACE}
D3DSTENCILOP_INCRSAT = 4;
{$EXTERNALSYM D3DSTENCILOP_INCRSAT}
D3DSTENCILOP_DECRSAT = 5;
{$EXTERNALSYM D3DSTENCILOP_DECRSAT}
D3DSTENCILOP_INVERT = 6;
{$EXTERNALSYM D3DSTENCILOP_INVERT}
D3DSTENCILOP_INCR = 7;
{$EXTERNALSYM D3DSTENCILOP_INCR}
D3DSTENCILOP_DECR = 8;
{$EXTERNALSYM D3DSTENCILOP_DECR}
type
_D3DFOGMODE = {$IFDEF TYPE_IDENTITY}type {$ENDIF}DWord;
{$EXTERNALSYM _D3DFOGMODE}
D3DFOGMODE = _D3DFOGMODE;
{$EXTERNALSYM D3DFOGMODE}
TD3DFogMode = _D3DFOGMODE;
const
D3DFOG_NONE = 0;
{$EXTERNALSYM D3DFOG_NONE}
D3DFOG_EXP = 1;
{$EXTERNALSYM D3DFOG_EXP}
D3DFOG_EXP2 = 2;
{$EXTERNALSYM D3DFOG_EXP2}
D3DFOG_LINEAR = 3;
{$EXTERNALSYM D3DFOG_LINEAR}
type
_D3DZBUFFERTYPE = {$IFDEF TYPE_IDENTITY}type {$ENDIF}DWord;
{$EXTERNALSYM _D3DZBUFFERTYPE}
D3DZBUFFERTYPE = _D3DZBUFFERTYPE;
{$EXTERNALSYM D3DZBUFFERTYPE}
TD3DZBufferType = _D3DZBUFFERTYPE;
const
D3DZB_FALSE = 0;
{$EXTERNALSYM D3DZB_FALSE}
D3DZB_TRUE = 1;
{$EXTERNALSYM D3DZB_TRUE}
D3DZB_USEW = 2;
{$EXTERNALSYM D3DZB_USEW}
type
// Primitives supported by draw-primitive API
_D3DPRIMITIVETYPE = (
{$IFNDEF COMPILER6_UP}
D3DPT_INVALID_0 {= 0},
D3DPT_POINTLIST {= 1},
D3DPT_LINELIST {= 2},
D3DPT_LINESTRIP {= 3},
D3DPT_TRIANGLELIST {= 4},
D3DPT_TRIANGLESTRIP{= 5},
D3DPT_TRIANGLEFAN {= 6}
{$ELSE}
D3DPT_POINTLIST = 1,
D3DPT_LINELIST = 2,
D3DPT_LINESTRIP = 3,
D3DPT_TRIANGLELIST = 4,
D3DPT_TRIANGLESTRIP = 5,
D3DPT_TRIANGLEFAN = 6
{$ENDIF}
);
{$EXTERNALSYM _D3DPRIMITIVETYPE}
D3DPRIMITIVETYPE = _D3DPRIMITIVETYPE;
{$EXTERNALSYM D3DPRIMITIVETYPE}
TD3DPrimitiveType = _D3DPRIMITIVETYPE;
{$IFNDEF COMPILER6_UP}
const
D3DTS_VIEW = 2;
{$EXTERNALSYM D3DTS_VIEW}
D3DTS_PROJECTION = 3;
{$EXTERNALSYM D3DTS_PROJECTION}
D3DTS_TEXTURE0 = 16;
{$EXTERNALSYM D3DTS_TEXTURE0}
D3DTS_TEXTURE1 = 17;
{$EXTERNALSYM D3DTS_TEXTURE1}
D3DTS_TEXTURE2 = 18;
{$EXTERNALSYM D3DTS_TEXTURE2}
D3DTS_TEXTURE3 = 19;
{$EXTERNALSYM D3DTS_TEXTURE3}
D3DTS_TEXTURE4 = 20;
{$EXTERNALSYM D3DTS_TEXTURE4}
D3DTS_TEXTURE5 = 21;
{$EXTERNALSYM D3DTS_TEXTURE5}
D3DTS_TEXTURE6 = 22;
{$EXTERNALSYM D3DTS_TEXTURE6}
D3DTS_TEXTURE7 = 23;
{$EXTERNALSYM D3DTS_TEXTURE7}
D3DTS_FORCE_DWORD = $7fffffff; (* force 32-bit size enum *)
{$EXTERNALSYM D3DTS_FORCE_DWORD}
type
_D3DTRANSFORMSTATETYPE = {$IFDEF TYPE_IDENTITY}type {$ENDIF}DWord;
{$ELSE}
type
_D3DTRANSFORMSTATETYPE = (
D3DTS_VIEW = 2,
D3DTS_PROJECTION = 3,
D3DTS_TEXTURE0 = 16,
D3DTS_TEXTURE1 = 17,
D3DTS_TEXTURE2 = 18,
D3DTS_TEXTURE3 = 19,
D3DTS_TEXTURE4 = 20,
D3DTS_TEXTURE5 = 21,
D3DTS_TEXTURE6 = 22,
D3DTS_TEXTURE7 = 23
);
{$ENDIF}
{$EXTERNALSYM _D3DTRANSFORMSTATETYPE}
D3DTRANSFORMSTATETYPE = _D3DTRANSFORMSTATETYPE;
{$EXTERNALSYM D3DTRANSFORMSTATETYPE}
TD3DTransformStateType = _D3DTRANSFORMSTATETYPE;
// #define D3DTS_WORLDMATRIX(index) (D3DTRANSFORMSTATETYPE)(index + 256)
function D3DTS_WORLDMATRIX(index: Byte): TD3DTransformStateType;
{$EXTERNALSYM D3DTS_WORLDMATRIX}
const
D3DTS_WORLD = TD3DTransformStateType(0 + 256); // #define D3DTS_WORLD D3DTS_WORLDMATRIX(0)
{$EXTERNALSYM D3DTS_WORLD}
D3DTS_WORLD1 = TD3DTransformStateType(1 + 256); // #define D3DTS_WORLD1 D3DTS_WORLDMATRIX(1)
{$EXTERNALSYM D3DTS_WORLD1}
D3DTS_WORLD2 = TD3DTransformStateType(2 + 256); // #define D3DTS_WORLD2 D3DTS_WORLDMATRIX(2)
{$EXTERNALSYM D3DTS_WORLD2}
D3DTS_WORLD3 = TD3DTransformStateType(3 + 256); // #define D3DTS_WORLD3 D3DTS_WORLDMATRIX(3)
{$EXTERNALSYM D3DTS_WORLD3}
{$IFNDEF COMPILER6_UP}
type
_D3DRENDERSTATETYPE = {$IFDEF TYPE_IDENTITY}type {$ENDIF}DWord;
{$EXTERNALSYM _D3DRENDERSTATETYPE}
D3DRENDERSTATETYPE = _D3DRENDERSTATETYPE;
{$EXTERNALSYM D3DRENDERSTATETYPE}
TD3DRenderStateType = _D3DRENDERSTATETYPE;
const
D3DRS_ZENABLE = TD3DRenderStateType(7); { D3DZBUFFERTYPE (or TRUE/FALSE for legacy) }
{$EXTERNALSYM D3DRS_ZENABLE}
D3DRS_FILLMODE = TD3DRenderStateType(8); { D3DFILLMODE }
{$EXTERNALSYM D3DRS_FILLMODE}
D3DRS_SHADEMODE = TD3DRenderStateType(9); { D3DSHADEMODE }
{$EXTERNALSYM D3DRS_SHADEMODE}
D3DRS_ZWRITEENABLE = TD3DRenderStateType(14); { TRUE to enable z writes }
{$EXTERNALSYM D3DRS_ZWRITEENABLE}
D3DRS_ALPHATESTENABLE = TD3DRenderStateType(15); { TRUE to enable alpha tests }
{$EXTERNALSYM D3DRS_ALPHATESTENABLE}
D3DRS_LASTPIXEL = TD3DRenderStateType(16); { TRUE for last-pixel on lines }
{$EXTERNALSYM D3DRS_LASTPIXEL}
D3DRS_SRCBLEND = TD3DRenderStateType(19); { D3DBLEND }
{$EXTERNALSYM D3DRS_SRCBLEND}
D3DRS_DESTBLEND = TD3DRenderStateType(20); { D3DBLEND }
{$EXTERNALSYM D3DRS_DESTBLEND}
D3DRS_CULLMODE = TD3DRenderStateType(22); { D3DCULL }
{$EXTERNALSYM D3DRS_CULLMODE}
D3DRS_ZFUNC = TD3DRenderStateType(23); { D3DCMPFUNC }
{$EXTERNALSYM D3DRS_ZFUNC}
D3DRS_ALPHAREF = TD3DRenderStateType(24); { D3DFIXED }
{$EXTERNALSYM D3DRS_ALPHAREF}
D3DRS_ALPHAFUNC = TD3DRenderStateType(25); { D3DCMPFUNC }
{$EXTERNALSYM D3DRS_ALPHAFUNC}
D3DRS_DITHERENABLE = TD3DRenderStateType(26); { TRUE to enable dithering }
{$EXTERNALSYM D3DRS_DITHERENABLE}
D3DRS_ALPHABLENDENABLE = TD3DRenderStateType(27); { TRUE to enable alpha blending }
{$EXTERNALSYM D3DRS_ALPHABLENDENABLE}
D3DRS_FOGENABLE = TD3DRenderStateType(28); { TRUE to enable fog blending }
{$EXTERNALSYM D3DRS_FOGENABLE}
D3DRS_SPECULARENABLE = TD3DRenderStateType(29); { TRUE to enable specular }
{$EXTERNALSYM D3DRS_SPECULARENABLE}
D3DRS_FOGCOLOR = TD3DRenderStateType(34); { D3DCOLOR }
{$EXTERNALSYM D3DRS_FOGCOLOR}
D3DRS_FOGTABLEMODE = TD3DRenderStateType(35); { D3DFOGMODE }
{$EXTERNALSYM D3DRS_FOGTABLEMODE}
D3DRS_FOGSTART = TD3DRenderStateType(36); { Fog start (for both vertex and pixel fog) }
{$EXTERNALSYM D3DRS_FOGSTART}
D3DRS_FOGEND = TD3DRenderStateType(37); { Fog end }
{$EXTERNALSYM D3DRS_FOGEND}
D3DRS_FOGDENSITY = TD3DRenderStateType(38); { Fog density }
{$EXTERNALSYM D3DRS_FOGDENSITY}
D3DRS_RANGEFOGENABLE = TD3DRenderStateType(48); { Enables range-based fog }
{$EXTERNALSYM D3DRS_RANGEFOGENABLE}
D3DRS_STENCILENABLE = TD3DRenderStateType(52); { BOOL enable/disable stenciling }
{$EXTERNALSYM D3DRS_STENCILENABLE}
D3DRS_STENCILFAIL = TD3DRenderStateType(53); { D3DSTENCILOP to do if stencil test fails }
{$EXTERNALSYM D3DRS_STENCILFAIL}
D3DRS_STENCILZFAIL = TD3DRenderStateType(54); { D3DSTENCILOP to do if stencil test passes and Z test fails }
{$EXTERNALSYM D3DRS_STENCILZFAIL}
D3DRS_STENCILPASS = TD3DRenderStateType(55); { D3DSTENCILOP to do if both stencil and Z tests pass }
{$EXTERNALSYM D3DRS_STENCILPASS}
D3DRS_STENCILFUNC = TD3DRenderStateType(56); { D3DCMPFUNC fn. Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true }
{$EXTERNALSYM D3DRS_STENCILFUNC}
D3DRS_STENCILREF = TD3DRenderStateType(57); { Reference value used in stencil test }
{$EXTERNALSYM D3DRS_STENCILREF}
D3DRS_STENCILMASK = TD3DRenderStateType(58); { Mask value used in stencil test }
{$EXTERNALSYM D3DRS_STENCILMASK}
D3DRS_STENCILWRITEMASK = TD3DRenderStateType(59); { Write mask applied to values written to stencil buffer }
{$EXTERNALSYM D3DRS_STENCILWRITEMASK}
D3DRS_TEXTUREFACTOR = TD3DRenderStateType(60); { D3DCOLOR used for multi-texture blend }
{$EXTERNALSYM D3DRS_TEXTUREFACTOR}
D3DRS_WRAP0 = TD3DRenderStateType(128); { wrap for 1st texture coord. set }
{$EXTERNALSYM D3DRS_WRAP0}
D3DRS_WRAP1 = TD3DRenderStateType(129); { wrap for 2nd texture coord. set }
{$EXTERNALSYM D3DRS_WRAP1}
D3DRS_WRAP2 = TD3DRenderStateType(130); { wrap for 3rd texture coord. set }
{$EXTERNALSYM D3DRS_WRAP2}
D3DRS_WRAP3 = TD3DRenderStateType(131); { wrap for 4th texture coord. set }
{$EXTERNALSYM D3DRS_WRAP3}
D3DRS_WRAP4 = TD3DRenderStateType(132); { wrap for 5th texture coord. set }
{$EXTERNALSYM D3DRS_WRAP4}
D3DRS_WRAP5 = TD3DRenderStateType(133); { wrap for 6th texture coord. set }
{$EXTERNALSYM D3DRS_WRAP5}
D3DRS_WRAP6 = TD3DRenderStateType(134); { wrap for 7th texture coord. set }
{$EXTERNALSYM D3DRS_WRAP6}
D3DRS_WRAP7 = TD3DRenderStateType(135); { wrap for 8th texture coord. set }
{$EXTERNALSYM D3DRS_WRAP7}
D3DRS_CLIPPING = TD3DRenderStateType(136);
{$EXTERNALSYM D3DRS_CLIPPING}
D3DRS_LIGHTING = TD3DRenderStateType(137);
{$EXTERNALSYM D3DRS_LIGHTING}
D3DRS_AMBIENT = TD3DRenderStateType(139);
{$EXTERNALSYM D3DRS_AMBIENT}
D3DRS_FOGVERTEXMODE = TD3DRenderStateType(140);
{$EXTERNALSYM D3DRS_FOGVERTEXMODE}
D3DRS_COLORVERTEX = TD3DRenderStateType(141);
{$EXTERNALSYM D3DRS_COLORVERTEX}
D3DRS_LOCALVIEWER = TD3DRenderStateType(142);
{$EXTERNALSYM D3DRS_LOCALVIEWER}
D3DRS_NORMALIZENORMALS = TD3DRenderStateType(143);
{$EXTERNALSYM D3DRS_NORMALIZENORMALS}
D3DRS_DIFFUSEMATERIALSOURCE = TD3DRenderStateType(145);
{$EXTERNALSYM D3DRS_DIFFUSEMATERIALSOURCE}
D3DRS_SPECULARMATERIALSOURCE = TD3DRenderStateType(146);
{$EXTERNALSYM D3DRS_SPECULARMATERIALSOURCE}
D3DRS_AMBIENTMATERIALSOURCE = TD3DRenderStateType(147);
{$EXTERNALSYM D3DRS_AMBIENTMATERIALSOURCE}
D3DRS_EMISSIVEMATERIALSOURCE = TD3DRenderStateType(148);
{$EXTERNALSYM D3DRS_EMISSIVEMATERIALSOURCE}
D3DRS_VERTEXBLEND = TD3DRenderStateType(151);
{$EXTERNALSYM D3DRS_VERTEXBLEND}
D3DRS_CLIPPLANEENABLE = TD3DRenderStateType(152);
{$EXTERNALSYM D3DRS_CLIPPLANEENABLE}
D3DRS_POINTSIZE = TD3DRenderStateType(154); { float point size }
{$EXTERNALSYM D3DRS_POINTSIZE}
D3DRS_POINTSIZE_MIN = TD3DRenderStateType(155); { float point size min threshold }
{$EXTERNALSYM D3DRS_POINTSIZE_MIN}
D3DRS_POINTSPRITEENABLE = TD3DRenderStateType(156); { BOOL point texture coord control }
{$EXTERNALSYM D3DRS_POINTSPRITEENABLE}
D3DRS_POINTSCALEENABLE = TD3DRenderStateType(157); { BOOL point size scale enable }
{$EXTERNALSYM D3DRS_POINTSCALEENABLE}
D3DRS_POINTSCALE_A = TD3DRenderStateType(158); { float point attenuation A value }
{$EXTERNALSYM D3DRS_POINTSCALE_A}
D3DRS_POINTSCALE_B = TD3DRenderStateType(159); { float point attenuation B value }
{$EXTERNALSYM D3DRS_POINTSCALE_B}
D3DRS_POINTSCALE_C = TD3DRenderStateType(160); { float point attenuation C value }
{$EXTERNALSYM D3DRS_POINTSCALE_C}
D3DRS_MULTISAMPLEANTIALIAS = TD3DRenderStateType(161); // BOOL - set to do FSAA with multisample buffer
{$EXTERNALSYM D3DRS_MULTISAMPLEANTIALIAS}
D3DRS_MULTISAMPLEMASK = TD3DRenderStateType(162); // DWORD - per-sample enable/disable
{$EXTERNALSYM D3DRS_MULTISAMPLEMASK}
D3DRS_PATCHEDGESTYLE = TD3DRenderStateType(163); // Sets whether patch edges will use float style tessellation
{$EXTERNALSYM D3DRS_PATCHEDGESTYLE}
D3DRS_DEBUGMONITORTOKEN = TD3DRenderStateType(165); // DEBUG ONLY - token to debug monitor
{$EXTERNALSYM D3DRS_DEBUGMONITORTOKEN}
D3DRS_POINTSIZE_MAX = TD3DRenderStateType(166); { float point size max threshold }
{$EXTERNALSYM D3DRS_POINTSIZE_MAX}
D3DRS_INDEXEDVERTEXBLENDENABLE = TD3DRenderStateType(167);
{$EXTERNALSYM D3DRS_INDEXEDVERTEXBLENDENABLE}
D3DRS_COLORWRITEENABLE = TD3DRenderStateType(168); // per-channel write enable
{$EXTERNALSYM D3DRS_COLORWRITEENABLE}
D3DRS_TWEENFACTOR = TD3DRenderStateType(170); // float tween factor
{$EXTERNALSYM D3DRS_TWEENFACTOR}
D3DRS_BLENDOP = TD3DRenderStateType(171); // D3DBLENDOP setting
{$EXTERNALSYM D3DRS_BLENDOP}
D3DRS_POSITIONDEGREE = TD3DRenderStateType(172); // NPatch position interpolation degree. D3DDEGREE_LINEAR or D3DDEGREE_CUBIC (default)
{$EXTERNALSYM D3DRS_POSITIONDEGREE}
D3DRS_NORMALDEGREE = TD3DRenderStateType(173); // NPatch normal interpolation degree. D3DDEGREE_LINEAR (default) or D3DDEGREE_QUADRATIC
{$EXTERNALSYM D3DRS_NORMALDEGREE}
D3DRS_SCISSORTESTENABLE = TD3DRenderStateType(174);
{$EXTERNALSYM D3DRS_SCISSORTESTENABLE}
D3DRS_SLOPESCALEDEPTHBIAS = TD3DRenderStateType(175);
{$EXTERNALSYM D3DRS_SLOPESCALEDEPTHBIAS}
D3DRS_ANTIALIASEDLINEENABLE = TD3DRenderStateType(176);
{$EXTERNALSYM D3DRS_ANTIALIASEDLINEENABLE}
D3DRS_MINTESSELLATIONLEVEL = TD3DRenderStateType(178);
{$EXTERNALSYM D3DRS_MINTESSELLATIONLEVEL}
D3DRS_MAXTESSELLATIONLEVEL = TD3DRenderStateType(179);
{$EXTERNALSYM D3DRS_MAXTESSELLATIONLEVEL}
D3DRS_ADAPTIVETESS_X = TD3DRenderStateType(180);
{$EXTERNALSYM D3DRS_ADAPTIVETESS_X}
D3DRS_ADAPTIVETESS_Y = TD3DRenderStateType(181);
{$EXTERNALSYM D3DRS_ADAPTIVETESS_Y}
D3DRS_ADAPTIVETESS_Z = TD3DRenderStateType(182);
{$EXTERNALSYM D3DRS_ADAPTIVETESS_Z}
D3DRS_ADAPTIVETESS_W = TD3DRenderStateType(183);
{$EXTERNALSYM D3DRS_ADAPTIVETESS_W}
D3DRS_ENABLEADAPTIVETESSELLATION = TD3DRenderStateType(184);
{$EXTERNALSYM D3DRS_ENABLEADAPTIVETESSELLATION}
D3DRS_TWOSIDEDSTENCILMODE = TD3DRenderStateType(185); (* BOOL enable/disable 2 sided stenciling *)
{$EXTERNALSYM D3DRS_TWOSIDEDSTENCILMODE}
D3DRS_CCW_STENCILFAIL = TD3DRenderStateType(186); (* D3DSTENCILOP to do if ccw stencil test fails *)
{$EXTERNALSYM D3DRS_CCW_STENCILFAIL}
D3DRS_CCW_STENCILZFAIL = TD3DRenderStateType(187); (* D3DSTENCILOP to do if ccw stencil test passes and Z test fails *)
{$EXTERNALSYM D3DRS_CCW_STENCILZFAIL}
D3DRS_CCW_STENCILPASS = TD3DRenderStateType(188); (* D3DSTENCILOP to do if both ccw stencil and Z tests pass *)
{$EXTERNALSYM D3DRS_CCW_STENCILPASS}
D3DRS_CCW_STENCILFUNC = TD3DRenderStateType(189); (* D3DCMPFUNC fn. ccw Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true *)
{$EXTERNALSYM D3DRS_CCW_STENCILFUNC}
D3DRS_COLORWRITEENABLE1 = TD3DRenderStateType(190); (* Additional ColorWriteEnables for the devices that support D3DPMISCCAPS_INDEPENDENTWRITEMASKS *)
{$EXTERNALSYM D3DRS_COLORWRITEENABLE1}
D3DRS_COLORWRITEENABLE2 = TD3DRenderStateType(191); (* Additional ColorWriteEnables for the devices that support D3DPMISCCAPS_INDEPENDENTWRITEMASKS *)
{$EXTERNALSYM D3DRS_COLORWRITEENABLE2}
D3DRS_COLORWRITEENABLE3 = TD3DRenderStateType(192); (* Additional ColorWriteEnables for the devices that support D3DPMISCCAPS_INDEPENDENTWRITEMASKS *)
{$EXTERNALSYM D3DRS_COLORWRITEENABLE3}
D3DRS_BLENDFACTOR = TD3DRenderStateType(193); (* D3DCOLOR used for a constant blend factor during alpha blending for devices that support D3DPBLENDCAPS_BLENDFACTOR *)
{$EXTERNALSYM D3DRS_BLENDFACTOR}
D3DRS_SRGBWRITEENABLE = TD3DRenderStateType(194); (* Enable rendertarget writes to be DE-linearized to SRGB (for formats that expose D3DUSAGE_QUERY_SRGBWRITE) *)
{$EXTERNALSYM D3DRS_SRGBWRITEENABLE}
D3DRS_DEPTHBIAS = TD3DRenderStateType(195);
{$EXTERNALSYM D3DRS_DEPTHBIAS}
D3DRS_WRAP8 = TD3DRenderStateType(198); (* Additional wrap states for vs_3_0+ attributes with D3DDECLUSAGE_TEXCOORD *)
{$EXTERNALSYM D3DRS_WRAP8}
D3DRS_WRAP9 = TD3DRenderStateType(199);
{$EXTERNALSYM D3DRS_WRAP9}
D3DRS_WRAP10 = TD3DRenderStateType(200);
{$EXTERNALSYM D3DRS_WRAP10}
D3DRS_WRAP11 = TD3DRenderStateType(201);
{$EXTERNALSYM D3DRS_WRAP11}
D3DRS_WRAP12 = TD3DRenderStateType(202);
{$EXTERNALSYM D3DRS_WRAP12}
D3DRS_WRAP13 = TD3DRenderStateType(203);
{$EXTERNALSYM D3DRS_WRAP13}
D3DRS_WRAP14 = TD3DRenderStateType(204);
{$EXTERNALSYM D3DRS_WRAP14}
D3DRS_WRAP15 = TD3DRenderStateType(205);
{$EXTERNALSYM D3DRS_WRAP15}
D3DRS_SEPARATEALPHABLENDENABLE = TD3DRenderStateType(206); (* TRUE to enable a separate blending function for the alpha channel *)
{$EXTERNALSYM D3DRS_SEPARATEALPHABLENDENABLE}
D3DRS_SRCBLENDALPHA = TD3DRenderStateType(207); (* SRC blend factor for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE *)
{$EXTERNALSYM D3DRS_SRCBLENDALPHA}
D3DRS_DESTBLENDALPHA = TD3DRenderStateType(208); (* DST blend factor for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE *)
{$EXTERNALSYM D3DRS_DESTBLENDALPHA}
D3DRS_BLENDOPALPHA = TD3DRenderStateType(209); (* Blending operation for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE *)
{$EXTERNALSYM D3DRS_BLENDOPALPHA}
D3DRS_FORCE_DWORD = TD3DRenderStateType($7fffffff); { force 32-bit size enum }
{$EXTERNALSYM D3DRS_FORCE_DWORD}
{$ELSE}
type
_D3DRENDERSTATETYPE = (
D3DRS_ZENABLE = 7, (* D3DZBUFFERTYPE (or TRUE/FALSE for legacy) *)
D3DRS_FILLMODE = 8, (* D3DFILLMODE *)
D3DRS_SHADEMODE = 9, (* D3DSHADEMODE *)
D3DRS_ZWRITEENABLE = 14, (* TRUE to enable z writes *)
D3DRS_ALPHATESTENABLE = 15, (* TRUE to enable alpha tests *)
D3DRS_LASTPIXEL = 16, (* TRUE for last-pixel on lines *)
D3DRS_SRCBLEND = 19, (* D3DBLEND *)
D3DRS_DESTBLEND = 20, (* D3DBLEND *)
D3DRS_CULLMODE = 22, (* D3DCULL *)
D3DRS_ZFUNC = 23, (* D3DCMPFUNC *)
D3DRS_ALPHAREF = 24, (* D3DFIXED *)
D3DRS_ALPHAFUNC = 25, (* D3DCMPFUNC *)
D3DRS_DITHERENABLE = 26, (* TRUE to enable dithering *)
D3DRS_ALPHABLENDENABLE = 27, (* TRUE to enable alpha blending *)
D3DRS_FOGENABLE = 28, (* TRUE to enable fog blending *)
D3DRS_SPECULARENABLE = 29, (* TRUE to enable specular *)
D3DRS_FOGCOLOR = 34, (* D3DCOLOR *)
D3DRS_FOGTABLEMODE = 35, (* D3DFOGMODE *)
D3DRS_FOGSTART = 36, (* Fog start (for both vertex and pixel fog) *)
D3DRS_FOGEND = 37, (* Fog end *)
D3DRS_FOGDENSITY = 38, (* Fog density *)
D3DRS_RANGEFOGENABLE = 48, (* Enables range-based fog *)
D3DRS_STENCILENABLE = 52, (* BOOL enable/disable stenciling *)
D3DRS_STENCILFAIL = 53, (* D3DSTENCILOP to do if stencil test fails *)
D3DRS_STENCILZFAIL = 54, (* D3DSTENCILOP to do if stencil test passes and Z test fails *)
D3DRS_STENCILPASS = 55, (* D3DSTENCILOP to do if both stencil and Z tests pass *)
D3DRS_STENCILFUNC = 56, (* D3DCMPFUNC fn. Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true *)
D3DRS_STENCILREF = 57, (* Reference value used in stencil test *)
D3DRS_STENCILMASK = 58, (* Mask value used in stencil test *)
D3DRS_STENCILWRITEMASK = 59, (* Write mask applied to values written to stencil buffer *)
D3DRS_TEXTUREFACTOR = 60, (* D3DCOLOR used for multi-texture blend *)
D3DRS_WRAP0 = 128, (* wrap for 1st texture coord. set *)
D3DRS_WRAP1 = 129, (* wrap for 2nd texture coord. set *)
D3DRS_WRAP2 = 130, (* wrap for 3rd texture coord. set *)
D3DRS_WRAP3 = 131, (* wrap for 4th texture coord. set *)
D3DRS_WRAP4 = 132, (* wrap for 5th texture coord. set *)
D3DRS_WRAP5 = 133, (* wrap for 6th texture coord. set *)
D3DRS_WRAP6 = 134, (* wrap for 7th texture coord. set *)
D3DRS_WRAP7 = 135, (* wrap for 8th texture coord. set *)
D3DRS_CLIPPING = 136,
D3DRS_LIGHTING = 137,
D3DRS_AMBIENT = 139,
D3DRS_FOGVERTEXMODE = 140,
D3DRS_COLORVERTEX = 141,
D3DRS_LOCALVIEWER = 142,
D3DRS_NORMALIZENORMALS = 143,
D3DRS_DIFFUSEMATERIALSOURCE = 145,
D3DRS_SPECULARMATERIALSOURCE = 146,
D3DRS_AMBIENTMATERIALSOURCE = 147,
D3DRS_EMISSIVEMATERIALSOURCE = 148,
D3DRS_VERTEXBLEND = 151,
D3DRS_CLIPPLANEENABLE = 152,
D3DRS_POINTSIZE = 154, (* float point size *)
D3DRS_POINTSIZE_MIN = 155, (* float point size min threshold *)
D3DRS_POINTSPRITEENABLE = 156, (* BOOL point texture coord control *)
D3DRS_POINTSCALEENABLE = 157, (* BOOL point size scale enable *)
D3DRS_POINTSCALE_A = 158, (* float point attenuation A value *)
D3DRS_POINTSCALE_B = 159, (* float point attenuation B value *)
D3DRS_POINTSCALE_C = 160, (* float point attenuation C value *)
D3DRS_MULTISAMPLEANTIALIAS = 161, // BOOL - set to do FSAA with multisample buffer
D3DRS_MULTISAMPLEMASK = 162, // DWORD - per-sample enable/disable
D3DRS_PATCHEDGESTYLE = 163, // Sets whether patch edges will use float style tessellation
D3DRS_DEBUGMONITORTOKEN = 165, // DEBUG ONLY - token to debug monitor
D3DRS_POINTSIZE_MAX = 166, (* float point size max threshold *)
D3DRS_INDEXEDVERTEXBLENDENABLE = 167,
D3DRS_COLORWRITEENABLE = 168, // per-channel write enable
D3DRS_TWEENFACTOR = 170, // float tween factor
D3DRS_BLENDOP = 171, // D3DBLENDOP setting
D3DRS_POSITIONDEGREE = 172, // NPatch position interpolation degree. D3DDEGREE_LINEAR or D3DDEGREE_CUBIC (default)
D3DRS_NORMALDEGREE = 173, // NPatch normal interpolation degree. D3DDEGREE_LINEAR (default) or D3DDEGREE_QUADRATIC
D3DRS_SCISSORTESTENABLE = 174,
D3DRS_SLOPESCALEDEPTHBIAS = 175,
D3DRS_ANTIALIASEDLINEENABLE = 176,
D3DRS_MINTESSELLATIONLEVEL = 178,
D3DRS_MAXTESSELLATIONLEVEL = 179,
D3DRS_ADAPTIVETESS_X = 180,
D3DRS_ADAPTIVETESS_Y = 181,
D3DRS_ADAPTIVETESS_Z = 182,
D3DRS_ADAPTIVETESS_W = 183,
D3DRS_ENABLEADAPTIVETESSELLATION = 184,
D3DRS_TWOSIDEDSTENCILMODE = 185, (* BOOL enable/disable 2 sided stenciling *)
D3DRS_CCW_STENCILFAIL = 186, (* D3DSTENCILOP to do if ccw stencil test fails *)
D3DRS_CCW_STENCILZFAIL = 187, (* D3DSTENCILOP to do if ccw stencil test passes and Z test fails *)
D3DRS_CCW_STENCILPASS = 188, (* D3DSTENCILOP to do if both ccw stencil and Z tests pass *)
D3DRS_CCW_STENCILFUNC = 189, (* D3DCMPFUNC fn. ccw Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true *)
D3DRS_COLORWRITEENABLE1 = 190, (* Additional ColorWriteEnables for the devices that support D3DPMISCCAPS_INDEPENDENTWRITEMASKS *)
D3DRS_COLORWRITEENABLE2 = 191, (* Additional ColorWriteEnables for the devices that support D3DPMISCCAPS_INDEPENDENTWRITEMASKS *)
D3DRS_COLORWRITEENABLE3 = 192, (* Additional ColorWriteEnables for the devices that support D3DPMISCCAPS_INDEPENDENTWRITEMASKS *)
D3DRS_BLENDFACTOR = 193, (* D3DCOLOR used for a constant blend factor during alpha blending for devices that support D3DPBLENDCAPS_BLENDFACTOR *)
D3DRS_SRGBWRITEENABLE = 194, (* Enable rendertarget writes to be DE-linearized to SRGB (for formats that expose D3DUSAGE_QUERY_SRGBWRITE) *)
D3DRS_DEPTHBIAS = 195,
D3DRS_WRAP8 = 198, (* Additional wrap states for vs_3_0+ attributes with D3DDECLUSAGE_TEXCOORD *)
D3DRS_WRAP9 = 199,
D3DRS_WRAP10 = 200,
D3DRS_WRAP11 = 201,
D3DRS_WRAP12 = 202,
D3DRS_WRAP13 = 203,
D3DRS_WRAP14 = 204,
D3DRS_WRAP15 = 205,
D3DRS_SEPARATEALPHABLENDENABLE = 206, (* TRUE to enable a separate blending function for the alpha channel *)
D3DRS_SRCBLENDALPHA = 207, (* SRC blend factor for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE *)
D3DRS_DESTBLENDALPHA = 208, (* DST blend factor for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE *)
D3DRS_BLENDOPALPHA = 209 (* Blending operation for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE *)
);
{$EXTERNALSYM _D3DRENDERSTATETYPE}
D3DRENDERSTATETYPE = _D3DRENDERSTATETYPE;
{$EXTERNALSYM D3DRENDERSTATETYPE}
TD3DRenderStateType = _D3DRENDERSTATETYPE;
{$ENDIF}
const
// Maximum number of simultaneous render targets D3D supports
D3D_MAX_SIMULTANEOUS_RENDERTARGETS = 4;
{$EXTERNALSYM D3D_MAX_SIMULTANEOUS_RENDERTARGETS}
type
// Values for material source
_D3DMATERIALCOLORSOURCE = {$IFDEF TYPE_IDENTITY}type {$ENDIF}DWord;
{$EXTERNALSYM _D3DMATERIALCOLORSOURCE}
D3DMATERIALCOLORSOURCE = _D3DMATERIALCOLORSOURCE;
{$EXTERNALSYM D3DMATERIALCOLORSOURCE}
TD3DMaterialSource = _D3DMATERIALCOLORSOURCE;
const
D3DMCS_MATERIAL = TD3DMaterialSource(0); // Color from material is used
{$EXTERNALSYM D3DMCS_MATERIAL}
D3DMCS_COLOR1 = TD3DMaterialSource(1); // Diffuse vertex color is used
{$EXTERNALSYM D3DMCS_COLOR1}
D3DMCS_COLOR2 = TD3DMaterialSource(2); // Specular vertex color is used
{$EXTERNALSYM D3DMCS_COLOR2}
D3DMCS_FORCE_DWORD = TD3DMaterialSource($7fffffff); // force 32-bit size enum
{$EXTERNALSYM D3DMCS_FORCE_DWORD}
// Bias to apply to the texture coordinate set to apply a wrap to.
D3DRENDERSTATE_WRAPBIAS = DWORD(128);
{$EXTERNALSYM D3DRENDERSTATE_WRAPBIAS}
{ Flags to construct the WRAP render states }
D3DWRAP_U = $00000001;
{$EXTERNALSYM D3DWRAP_U}
D3DWRAP_V = $00000002;
{$EXTERNALSYM D3DWRAP_V}
D3DWRAP_W = $00000004;
{$EXTERNALSYM D3DWRAP_W}
{ Flags to construct the WRAP render states for 1D thru 4D texture coordinates }
D3DWRAPCOORD_0 = $00000001; // same as D3DWRAP_U
{$EXTERNALSYM D3DWRAPCOORD_0}
D3DWRAPCOORD_1 = $00000002; // same as D3DWRAP_V
{$EXTERNALSYM D3DWRAPCOORD_1}
D3DWRAPCOORD_2 = $00000004; // same as D3DWRAP_W
{$EXTERNALSYM D3DWRAPCOORD_2}
D3DWRAPCOORD_3 = $00000008;
{$EXTERNALSYM D3DWRAPCOORD_3}
{ Flags to construct D3DRS_COLORWRITEENABLE }
D3DCOLORWRITEENABLE_RED = (1 shl 0);
{$EXTERNALSYM D3DCOLORWRITEENABLE_RED}
D3DCOLORWRITEENABLE_GREEN = (1 shl 1);
{$EXTERNALSYM D3DCOLORWRITEENABLE_GREEN}
D3DCOLORWRITEENABLE_BLUE = (1 shl 2);