Commit 2df7149

Nick committed on
Fix VSync, remove DirectX code, add hotkeys for enabling/disabling sound channels
commit 2df714918176ee953b367237e94fb285c6d27869 parent 1b1a63e
18 changed files +83−23547
DeletedDirectX/DXCommon.pas +0−77
@@ -1,77 +0,0 @@
1 unit DXCommon;
2
3 {$MODE Delphi}
4
5 interface
6
7 uses
8 Windows, SysUtils;
9
10 type
11 {$IFDEF UNICODE}
12 PCharAW = PWideChar;
13 {$ELSE}
14 PCharAW = PAnsiChar;
15 {$ENDIF}
16
17 function IsNTandDelphiRunning : boolean;
18 function RegGetStringValue(Hive: HKEY; const KeyName, ValueName: string): string;
19 function ExistFile(const FileName: string): Boolean;
20
21 implementation
22
23 function RegGetStringValue(Hive: HKEY; const KeyName, ValueName: string): string;
24 var EnvKey : HKEY;
25 Buf : array[0..255] of char;
26 BufSize : DWord;
27 RegType : DWord;
28 rc : DWord;
29 begin
30 Result := '';
31 BufSize := Sizeof(Buf);
32 ZeroMemory(@Buf, BufSize);
33 RegType := REG_SZ;
34 try
35 if (RegOpenKeyEx(Hive, PChar(KeyName), 0, KEY_READ, EnvKey) = ERROR_SUCCESS) then
36 begin
37 try
38 if (ValueName = '') then rc := RegQueryValueEx(EnvKey, nil, nil, @RegType, @Buf, @BufSize)
39 else rc := RegQueryValueEx(EnvKey, PChar(ValueName), nil, @RegType, @Buf, @BufSize);
40 if rc = ERROR_SUCCESS then Result := string(Buf);
41 finally
42 RegCloseKey(EnvKey);
43 end;
44 end;
45 finally
46 RegCloseKey(Hive);
47 end;
48 end;
49
50
51 function ExistFile(const FileName: string): Boolean;
52 var hFile: THandle;
53 begin
54 hFile := CreateFile(PChar(FileName), 0, 0, nil, OPEN_EXISTING, 0, 0);
55 Result := hFile <> INVALID_HANDLE_VALUE;
56 if Result = true then FileClose(hFile); { *Converted from CloseHandle* }
57 end;
58
59
60 function IsNTandDelphiRunning : boolean;
61 var
62 OSVersion : TOSVersionInfo;
63 ProgName : array[0..255] of char;
64 begin
65 OSVersion.dwOsVersionInfoSize := sizeof(OSVersion);
66 GetVersionEx(OSVersion);
67 ProgName[0] := #0;
68 lstrcat(ProgName, PChar(ParamStr(0)));
69 CharLowerBuff(ProgName, SizeOf(ProgName));
70 // Not running in NT or program is not Delphi itself ?
71 result := ( (OSVersion.dwPlatformID = VER_PLATFORM_WIN32_NT) and
72 (Pos('delphi32.exe', string(ProgName)) > 0) );
73 end;
74
75
76 end.
77
DeletedDirectX/Direct3D.pas +0−4060
@@ -1,4060 +0,0 @@
1 (*==========================================================================;
2 *
3 * Copyright (C) 1995-1998 Microsoft Corporation. All Rights Reserved.
4 *
5 * Files: d3dtypes.h d3dcaps.h d3d.h
6 *
7 * DirectX 7.0 Delphi adaptation by Erik Unger
8 *
9 * Modyfied: 19-Feb-2000
10 *
11 * Download: http://www.delphi-jedi.org/DelphiGraphics/
12 * E-Mail: [email protected]
13 *
14 ***************************************************************************)
15
16 unit Direct3D;
17
18 {$MODE Delphi}
19
20 {$MINENUMSIZE 4}
21 {$ALIGN ON}
22
23 interface
24
25 uses
26 Windows,
27 DirectDraw;
28
29 (* TD3DValue is the fundamental Direct3D fractional data type *)
30
31 type
32 TRefClsID = TGUID;
33
34 type
35 TD3DValue = Single;
36 TD3DFixed = LongInt;
37 float = TD3DValue;
38 PD3DColor = ^TD3DColor;
39 TD3DColor = DWORD;
40
41 function D3DVal(val: variant) : float;
42 function D3DDivide(a,b: double) : float;
43 function D3DMultiply(a,b: double) : float;
44
45 (*
46 * Format of CI colors is
47 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
48 * | alpha | color index | fraction |
49 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
50 *)
51
52 // #define CI_GETALPHA(ci) ((ci) >> 24)
53 function CI_GETALPHA(ci: DWORD) : DWORD;
54
55 // #define CI_GETINDEX(ci) (((ci) >> 8) & 0xffff)
56 function CI_GETINDEX(ci: DWORD) : DWORD;
57
58 // #define CI_GETFRACTION(ci) ((ci) & 0xff)
59 function CI_GETFRACTION(ci: DWORD) : DWORD;
60
61 // #define CI_ROUNDINDEX(ci) CI_GETINDEX((ci) + 0x80)
62 function CI_ROUNDINDEX(ci: DWORD) : DWORD;
63
64 // #define CI_MASKALPHA(ci) ((ci) & 0xffffff)
65 function CI_MASKALPHA(ci: DWORD) : DWORD;
66
67 // #define CI_MAKE(a, i, f) (((a) << 24) | ((i) << 8) | (f))
68 function CI_MAKE(a,i,f: DWORD) : DWORD;
69
70 (*
71 * Format of RGBA colors is
72 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
73 * | alpha | red | green | blue |
74 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
75 *)
76
77 // #define RGBA_GETALPHA(rgb) ((rgb) >> 24)
78 function RGBA_GETALPHA(rgb: TD3DColor) : DWORD;
79
80 // #define RGBA_GETRED(rgb) (((rgb) >> 16) & 0xff)
81 function RGBA_GETRED(rgb: TD3DColor) : DWORD;
82
83 // #define RGBA_GETGREEN(rgb) (((rgb) >> 8) & 0xff)
84 function RGBA_GETGREEN(rgb: TD3DColor) : DWORD;
85
86 // #define RGBA_GETBLUE(rgb) ((rgb) & 0xff)
87 function RGBA_GETBLUE(rgb: TD3DColor) : DWORD;
88
89 // #define RGBA_MAKE(r, g, b, a) ((TD3DColor) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)))
90 function RGBA_MAKE(r, g, b, a: DWORD) : TD3DColor;
91
92 (* D3DRGB and D3DRGBA may be used as initialisers for D3DCOLORs
93 * The float values must be in the range 0..1
94 *)
95
96 // #define D3DRGB(r, g, b) \
97 // (0xff000000L | (((long)((r) * 255)) << 16) | (((long)((g) * 255)) << 8) | (long)((b) * 255))
98 function D3DRGB(r, g, b: float) : TD3DColor;
99
100 // #define D3DRGBA(r, g, b, a) \
101 // ( (((long)((a) * 255)) << 24) | (((long)((r) * 255)) << 16) \
102 // | (((long)((g) * 255)) << 8) | (long)((b) * 255) \
103 // )
104 function D3DRGBA(r, g, b, a: float) : TD3DColor;
105
106 (*
107 * Format of RGB colors is
108 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
109 * | ignored | red | green | blue |
110 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
111 *)
112
113 // #define RGB_GETRED(rgb) (((rgb) >> 16) & 0xff)
114 function RGB_GETRED(rgb: TD3DColor) : DWORD;
115
116 // #define RGB_GETGREEN(rgb) (((rgb) >> 8) & 0xff)
117 function RGB_GETGREEN(rgb: TD3DColor) : DWORD;
118
119 // #define RGB_GETBLUE(rgb) ((rgb) & 0xff)
120 function RGB_GETBLUE(rgb: TD3DColor) : DWORD;
121
122 // #define RGBA_SETALPHA(rgba, x) (((x) << 24) | ((rgba) & 0x00ffffff))
123 function RGBA_SETALPHA(rgba: TD3DColor; x: DWORD) : TD3DColor;
124
125 // #define RGB_MAKE(r, g, b) ((TD3DColor) (((r) << 16) | ((g) << 8) | (b)))
126 function RGB_MAKE(r, g, b: DWORD) : TD3DColor;
127
128 // #define RGBA_TORGB(rgba) ((TD3DColor) ((rgba) & 0xffffff))
129 function RGBA_TORGB(rgba: TD3DColor) : TD3DColor;
130
131 // #define RGB_TORGBA(rgb) ((TD3DColor) ((rgb) | 0xff000000))
132 function RGB_TORGBA(rgb: TD3DColor) : TD3DColor;
133
134 (*
135 * Flags for Enumerate functions
136 *)
137 const
138
139 (*
140 * Stop the enumeration
141 *)
142
143 D3DENUMRET_CANCEL = DDENUMRET_CANCEL;
144
145 (*
146 * Continue the enumeration
147 *)
148
149 D3DENUMRET_OK = DDENUMRET_OK;
150
151 type
152 TD3DValidateCallback = function (lpUserArg: Pointer;
153 dwOffset: DWORD): HResult; stdcall;
154 TD3DEnumTextureFormatsCallback = function (var lpDdsd: TDDSurfaceDesc;
155 lpContext: Pointer): HResult; stdcall;
156 TD3DEnumPixelFormatsCallback = function (var lpDDPixFmt: TDDPixelFormat;
157 lpContext: Pointer): HResult; stdcall;
158
159
160 PD3DMaterialHandle = ^TD3DMaterialHandle;
161 TD3DMaterialHandle = DWORD;
162
163 PD3DTextureHandle = ^TD3DTextureHandle;
164 TD3DTextureHandle = DWORD;
165
166 PD3DMatrixHandle = ^TD3DMatrixHandle;
167 TD3DMatrixHandle = DWORD;
168
169 PD3DColorValue = ^TD3DColorValue;
170 TD3DColorValue = packed record
171 case Integer of
172 0: (
173 r: TD3DValue;
174 g: TD3DValue;
175 b: TD3DValue;
176 a: TD3DValue;
177 );
178 1: (
179 dvR: TD3DValue;
180 dvG: TD3DValue;
181 dvB: TD3DValue;
182 dvA: TD3DValue;
183 );
184 end;
185
186 PD3DRect = ^TD3DRect;
187 TD3DRect = packed record
188 case Integer of
189 0: (
190 x1: LongInt;
191 y1: LongInt;
192 x2: LongInt;
193 y2: LongInt;
194 );
195 1: (
196 lX1: LongInt;
197 lY1: LongInt;
198 lX2: LongInt;
199 lY2: LongInt;
200 );
201 2: (
202 a: array[0..3] of LongInt;
203 );
204 end;
205
206 PD3DVector = ^TD3DVector;
207 TD3DVector = packed record
208 case Integer of
209 0: (
210 x: TD3DValue;
211 y: TD3DValue;
212 z: TD3DValue;
213 );
214 1: (
215 dvX: TD3DValue;
216 dvY: TD3DValue;
217 dvZ: TD3DValue;
218 );
219 end;
220
221 (******************************************************************
222 * *
223 * D3DVec.inl *
224 * *
225 * Float-valued 3D vector class for Direct3D. *
226 * *
227 * Copyright (c) 1996-1998 Microsoft Corp. All rights reserved. *
228 * *
229 ******************************************************************)
230
231 // Addition and subtraction
232 function VectorAdd(const v1, v2: TD3DVector) : TD3DVector;
233 function VectorSub(const v1, v2: TD3DVector) : TD3DVector;
234 // Scalar multiplication and division
235 function VectorMulS(const v: TD3DVector; s: TD3DValue) : TD3DVector;
236 function VectorDivS(const v: TD3DVector; s: TD3DValue) : TD3DVector;
237 // Memberwise multiplication and division
238 function VectorMul(const v1, v2: TD3DVector) : TD3DVector;
239 function VectorDiv(const v1, v2: TD3DVector) : TD3DVector;
240 // Vector dominance
241 function VectorSmaller(v1, v2: TD3DVector) : boolean;
242 function VectorSmallerEquel(v1, v2: TD3DVector) : boolean;
243 // Bitwise equality
244 function VectorEquel(v1, v2: TD3DVector) : boolean;
245 // Length-related functions
246 function VectorSquareMagnitude(v: TD3DVector) : TD3DValue;
247 function VectorMagnitude(v: TD3DVector) : TD3DValue;
248 // Returns vector with same direction and unit length
249 function VectorNormalize(const v: TD3DVector) : TD3DVector;
250 // Return min/max component of the input vector
251 function VectorMin(v: TD3DVector) : TD3DValue;
252 function VectorMax(v: TD3DVector) : TD3DValue;
253 // Return memberwise min/max of input vectors
254 function VectorMinimize(const v1, v2: TD3DVector) : TD3DVector;
255 function VectorMaximize(const v1, v2: TD3DVector) : TD3DVector;
256 // Dot and cross product
257 function VectorDotProduct(v1, v2: TD3DVector) : TD3DValue;
258 function VectorCrossProduct(const v1, v2: TD3DVector) : TD3DVector;
259
260 type
261 (*
262 * Vertex data types supported in an ExecuteBuffer.
263 *)
264
265 (*
266 * Homogeneous vertices
267 *)
268
269 PD3DHVertex = ^TD3DHVertex;
270 TD3DHVertex = packed record
271 dwFlags: DWORD; (* Homogeneous clipping flags *)
272 case Integer of
273 0: (
274 hx: TD3DValue;
275 hy: TD3DValue;
276 hz: TD3DValue;
277 );
278 1: (
279 dvHX: TD3DValue;
280 dvHY: TD3DValue;
281 dvHZ: TD3DValue;
282 );
283 end;
284
285 (*
286 * Transformed/lit vertices
287 *)
288
289 PD3DTLVertex = ^TD3DTLVertex;
290 TD3DTLVertex = packed record
291 case Integer of
292 0: (
293 sx: TD3DValue; (* Screen coordinates *)
294 sy: TD3DValue;
295 sz: TD3DValue;
296 rhw: TD3DValue; (* Reciprocal of homogeneous w *)
297 color: TD3DColor; (* Vertex color *)
298 specular: TD3DColor; (* Specular component of vertex *)
299 tu: TD3DValue; (* Texture coordinates *)
300 tv: TD3DValue;
301 );
302 1: (
303 dvSX: TD3DValue;
304 dvSY: TD3DValue;
305 dvSZ: TD3DValue;
306 dvRHW: TD3DValue;
307 dcColor: TD3DColor;
308 dcSpecular: TD3DColor;
309 dvTU: TD3DValue;
310 dvTV: TD3DValue;
311 );
312 end;
313
314 (*
315 * Untransformed/lit vertices
316 *)
317
318 PD3DLVertex = ^TD3DLVertex;
319 TD3DLVertex = packed record
320 case Integer of
321 0: (
322 x: TD3DValue; (* Homogeneous coordinates *)
323 y: TD3DValue;
324 z: TD3DValue;
325 dwReserved: DWORD;
326 color: TD3DColor; (* Vertex color *)
327 specular: TD3DColor; (* Specular component of vertex *)
328 tu: TD3DValue; (* Texture coordinates *)
329 tv: TD3DValue;
330 );
331 1: (
332 dvX: TD3DValue;
333 dvY: TD3DValue;
334 dvZ: TD3DValue;
335 UNIONFILLER1d: DWORD;
336 dcColor: TD3DColor;
337 dcSpecular: TD3DColor;
338 dvTU: TD3DValue;
339 dvTV: TD3DValue;
340 );
341 end;
342
343 (*
344 * Untransformed/unlit vertices
345 *)
346
347 PD3DVertex = ^TD3DVertex;
348 TD3DVertex = packed record
349 case Integer of
350 0: (
351 x: TD3DValue; (* Homogeneous coordinates *)
352 y: TD3DValue;
353 z: TD3DValue;
354 nx: TD3DValue; (* Normal *)
355 ny: TD3DValue;
356 nz: TD3DValue;
357 tu: TD3DValue; (* Texture coordinates *)
358 tv: TD3DValue;
359 );
360 1: (
361 dvX: TD3DValue;
362 dvY: TD3DValue;
363 dvZ: TD3DValue;
364 dvNX: TD3DValue;
365 dvNY: TD3DValue;
366 dvNZ: TD3DValue;
367 dvTU: TD3DValue;
368 dvTV: TD3DValue;
369 );
370 end;
371
372 (*
373 * Matrix, viewport, and tranformation structures and definitions.
374 *)
375
376 PD3DMatrix = ^TD3DMatrix;
377 TD3DMatrix = packed record
378 case integer of
379 0 : (_11, _12, _13, _14: TD3DValue;
380 _21, _22, _23, _24: TD3DValue;
381 _31, _32, _33, _34: TD3DValue;
382 _41, _42, _43, _44: TD3DValue);
383 1 : (m : array [0..3, 0..3] of TD3DValue);
384 end;
385
386 PD3DViewport = ^TD3DViewport;
387 TD3DViewport = packed record
388 dwSize: DWORD;
389 dwX: DWORD;
390 dwY: DWORD; (* Top left *)
391 dwWidth: DWORD;
392 dwHeight: DWORD; (* Dimensions *)
393 dvScaleX: TD3DValue; (* Scale homogeneous to screen *)
394 dvScaleY: TD3DValue; (* Scale homogeneous to screen *)
395 dvMaxX: TD3DValue; (* Min/max homogeneous x coord *)
396 dvMaxY: TD3DValue; (* Min/max homogeneous y coord *)
397 dvMinZ: TD3DValue;
398 dvMaxZ: TD3DValue; (* Min/max homogeneous z coord *)
399 end;
400
401 PD3DViewport2 = ^TD3DViewport2;
402 TD3DViewport2 = packed record
403 dwSize: DWORD;
404 dwX: DWORD;
405 dwY: DWORD; (* Viewport Top left *)
406 dwWidth: DWORD;
407 dwHeight: DWORD; (* Viewport Dimensions *)
408 dvClipX: TD3DValue; (* Top left of clip volume *)
409 dvClipY: TD3DValue;
410 dvClipWidth: TD3DValue; (* Clip Volume Dimensions *)
411 dvClipHeight: TD3DValue;
412 dvMinZ: TD3DValue; (* Min/max of clip Volume *)
413 dvMaxZ: TD3DValue;
414 end;
415
416 PD3DViewport7 = ^TD3DViewport7;
417 TD3DViewport7 = packed record
418 dwX: DWORD;
419 dwY: DWORD; (* Viewport Top left *)
420 dwWidth: DWORD;
421 dwHeight: DWORD; (* Viewport Dimensions *)
422 dvMinZ: TD3DValue; (* Min/max of clip Volume *)
423 dvMaxZ: TD3DValue;
424 end;
425
426 (*
427 * Values for clip fields.
428 *)
429
430 const
431 // Max number of user clipping planes, supported in D3D.
432 D3DMAXUSERCLIPPLANES = 32;
433
434 // These bits could be ORed together to use with D3DRENDERSTATE_CLIPPLANEENABLE
435 //
436 D3DCLIPPLANE0 = (1 shl 0);
437 D3DCLIPPLANE1 = (1 shl 1);
438 D3DCLIPPLANE2 = (1 shl 2);
439 D3DCLIPPLANE3 = (1 shl 3);
440 D3DCLIPPLANE4 = (1 shl 4);
441 D3DCLIPPLANE5 = (1 shl 5);
442
443 const
444 D3DCLIP_LEFT = $00000001;
445 D3DCLIP_RIGHT = $00000002;
446 D3DCLIP_TOP = $00000004;
447 D3DCLIP_BOTTOM = $00000008;
448 D3DCLIP_FRONT = $00000010;
449 D3DCLIP_BACK = $00000020;
450 D3DCLIP_GEN0 = $00000040;
451 D3DCLIP_GEN1 = $00000080;
452 D3DCLIP_GEN2 = $00000100;
453 D3DCLIP_GEN3 = $00000200;
454 D3DCLIP_GEN4 = $00000400;
455 D3DCLIP_GEN5 = $00000800;
456
457 (*
458 * Values for d3d status.
459 *)
460
461 D3DSTATUS_CLIPUNIONLEFT = D3DCLIP_LEFT;
462 D3DSTATUS_CLIPUNIONRIGHT = D3DCLIP_RIGHT;
463 D3DSTATUS_CLIPUNIONTOP = D3DCLIP_TOP;
464 D3DSTATUS_CLIPUNIONBOTTOM = D3DCLIP_BOTTOM;
465 D3DSTATUS_CLIPUNIONFRONT = D3DCLIP_FRONT;
466 D3DSTATUS_CLIPUNIONBACK = D3DCLIP_BACK;
467 D3DSTATUS_CLIPUNIONGEN0 = D3DCLIP_GEN0;
468 D3DSTATUS_CLIPUNIONGEN1 = D3DCLIP_GEN1;
469 D3DSTATUS_CLIPUNIONGEN2 = D3DCLIP_GEN2;
470 D3DSTATUS_CLIPUNIONGEN3 = D3DCLIP_GEN3;
471 D3DSTATUS_CLIPUNIONGEN4 = D3DCLIP_GEN4;
472 D3DSTATUS_CLIPUNIONGEN5 = D3DCLIP_GEN5;
473
474 D3DSTATUS_CLIPINTERSECTIONLEFT = $00001000;
475 D3DSTATUS_CLIPINTERSECTIONRIGHT = $00002000;
476 D3DSTATUS_CLIPINTERSECTIONTOP = $00004000;
477 D3DSTATUS_CLIPINTERSECTIONBOTTOM = $00008000;
478 D3DSTATUS_CLIPINTERSECTIONFRONT = $00010000;
479 D3DSTATUS_CLIPINTERSECTIONBACK = $00020000;
480 D3DSTATUS_CLIPINTERSECTIONGEN0 = $00040000;
481 D3DSTATUS_CLIPINTERSECTIONGEN1 = $00080000;
482 D3DSTATUS_CLIPINTERSECTIONGEN2 = $00100000;
483 D3DSTATUS_CLIPINTERSECTIONGEN3 = $00200000;
484 D3DSTATUS_CLIPINTERSECTIONGEN4 = $00400000;
485 D3DSTATUS_CLIPINTERSECTIONGEN5 = $00800000;
486 D3DSTATUS_ZNOTVISIBLE = $01000000;
487 (* Do not use 0x80000000 for any status flags in future as it is reserved *)
488
489 D3DSTATUS_CLIPUNIONALL = (
490 D3DSTATUS_CLIPUNIONLEFT or
491 D3DSTATUS_CLIPUNIONRIGHT or
492 D3DSTATUS_CLIPUNIONTOP or
493 D3DSTATUS_CLIPUNIONBOTTOM or
494 D3DSTATUS_CLIPUNIONFRONT or
495 D3DSTATUS_CLIPUNIONBACK or
496 D3DSTATUS_CLIPUNIONGEN0 or
497 D3DSTATUS_CLIPUNIONGEN1 or
498 D3DSTATUS_CLIPUNIONGEN2 or
499 D3DSTATUS_CLIPUNIONGEN3 or
500 D3DSTATUS_CLIPUNIONGEN4 or
501 D3DSTATUS_CLIPUNIONGEN5);
502
503 D3DSTATUS_CLIPINTERSECTIONALL = (
504 D3DSTATUS_CLIPINTERSECTIONLEFT or
505 D3DSTATUS_CLIPINTERSECTIONRIGHT or
506 D3DSTATUS_CLIPINTERSECTIONTOP or
507 D3DSTATUS_CLIPINTERSECTIONBOTTOM or
508 D3DSTATUS_CLIPINTERSECTIONFRONT or
509 D3DSTATUS_CLIPINTERSECTIONBACK or
510 D3DSTATUS_CLIPINTERSECTIONGEN0 or
511 D3DSTATUS_CLIPINTERSECTIONGEN1 or
512 D3DSTATUS_CLIPINTERSECTIONGEN2 or
513 D3DSTATUS_CLIPINTERSECTIONGEN3 or
514 D3DSTATUS_CLIPINTERSECTIONGEN4 or
515 D3DSTATUS_CLIPINTERSECTIONGEN5);
516
517 D3DSTATUS_DEFAULT = (
518 D3DSTATUS_CLIPINTERSECTIONALL or
519 D3DSTATUS_ZNOTVISIBLE);
520
521 (*
522 * Options for direct transform calls
523 *)
524
525 D3DTRANSFORM_CLIPPED = $00000001;
526 D3DTRANSFORM_UNCLIPPED = $00000002;
527
528 type
529 PD3DTransformData = ^TD3DTransformData;
530 TD3DTransformData = packed record
531 dwSize: DWORD;
532 lpIn: Pointer; (* Input vertices *)
533 dwInSize: DWORD; (* Stride of input vertices *)
534 lpOut: Pointer; (* Output vertices *)
535 dwOutSize: DWORD; (* Stride of output vertices *)
536 lpHOut: ^TD3DHVertex; (* Output homogeneous vertices *)
537 dwClip: DWORD; (* Clipping hint *)
538 dwClipIntersection: DWORD;
539 dwClipUnion: DWORD; (* Union of all clip flags *)
540 drExtent: TD3DRect; (* Extent of transformed vertices *)
541 end;
542
543 (*
544 * Structure defining position and direction properties for lighting.
545 *)
546
547 PD3DLightingElement = ^TD3DLightingElement;
548 TD3DLightingElement = packed record
549 dvPosition: TD3DVector; (* Lightable point in model space *)
550 dvNormal: TD3DVector; (* Normalised unit vector *)
551 end;
552
553 (*
554 * Structure defining material properties for lighting.
555 *)
556
557 PD3DMaterial = ^TD3DMaterial;
558 TD3DMaterial = packed record
559 dwSize: DWORD;
560 case Integer of
561 0: (
562 diffuse: TD3DColorValue; (* Diffuse color RGBA *)
563 ambient: TD3DColorValue; (* Ambient color RGB *)
564 specular: TD3DColorValue; (* Specular 'shininess' *)
565 emissive: TD3DColorValue; (* Emissive color RGB *)
566 power: TD3DValue; (* Sharpness if specular highlight *)
567 hTexture: TD3DTextureHandle; (* Handle to texture map *)
568 dwRampSize: DWORD;
569 );
570 1: (
571 dcvDiffuse: TD3DColorValue;
572 dcvAmbient: TD3DColorValue;
573 dcvSpecular: TD3DColorValue;
574 dcvEmissive: TD3DColorValue;
575 dvPower: TD3DValue;
576 );
577 end;
578
579 PD3DMaterial7 = ^TD3DMaterial7;
580 TD3DMaterial7 = packed record
581 case Integer of
582 0: (
583 diffuse: TD3DColorValue; (* Diffuse color RGBA *)
584 ambient: TD3DColorValue; (* Ambient color RGB *)
585 specular: TD3DColorValue; (* Specular 'shininess' *)
586 emissive: TD3DColorValue; (* Emissive color RGB *)
587 power: TD3DValue; (* Sharpness if specular highlight *)
588 );
589 1: (
590 dcvDiffuse: TD3DColorValue;
591 dcvAmbient: TD3DColorValue;
592 dcvSpecular: TD3DColorValue;
593 dcvEmissive: TD3DColorValue;
594 dvPower: TD3DValue;
595 );
596 end;
597
598 PD3DLightType = ^TD3DLightType;
599 TD3DLightType = (
600 D3DLIGHT_INVALID_0,
601 D3DLIGHT_POINT,
602 D3DLIGHT_SPOT,
603 D3DLIGHT_DIRECTIONAL,
604 // Note: The following light type (D3DLIGHT_PARALLELPOINT)
605 // is no longer supported from D3D for DX7 onwards.
606 D3DLIGHT_PARALLELPOINT,
607 D3DLIGHT_GLSPOT);
608
609 (*
610 * Structure defining a light source and its properties.
611 *)
612
613 PD3DLight = ^TD3DLight;
614 TD3DLight = packed record
615 dwSize: DWORD;
616 dltType: TD3DLightType; (* Type of light source *)
617 dcvColor: TD3DColorValue; (* Color of light *)
618 dvPosition: TD3DVector; (* Position in world space *)
619 dvDirection: TD3DVector; (* Direction in world space *)
620 dvRange: TD3DValue; (* Cutoff range *)
621 dvFalloff: TD3DValue; (* Falloff *)
622 dvAttenuation0: TD3DValue; (* Constant attenuation *)
623 dvAttenuation1: TD3DValue; (* Linear attenuation *)
624 dvAttenuation2: TD3DValue; (* Quadratic attenuation *)
625 dvTheta: TD3DValue; (* Inner angle of spotlight cone *)
626 dvPhi: TD3DValue; (* Outer angle of spotlight cone *)
627 end;
628
629 PD3DLight7 = ^TD3DLight7;
630 TD3DLight7 = packed record
631 dltType: TD3DLightType; (* Type of light source *)
632 dcvDiffuse: TD3DColorValue; (* Diffuse color of light *)
633 dcvSpecular: TD3DColorValue;(* Specular color of light *)
634 dcvAmbient: TD3DColorValue; (* Ambient color of light *)
635 dvPosition: TD3DVector; (* Position in world space *)
636 dvDirection: TD3DVector; (* Direction in world space *)
637 dvRange: TD3DValue; (* Cutoff range *)
638 dvFalloff: TD3DValue; (* Falloff *)
639 dvAttenuation0: TD3DValue; (* Constant attenuation *)
640 dvAttenuation1: TD3DValue; (* Linear attenuation *)
641 dvAttenuation2: TD3DValue; (* Quadratic attenuation *)
642 dvTheta: TD3DValue; (* Inner angle of spotlight cone *)
643 dvPhi: TD3DValue; (* Outer angle of spotlight cone *)
644 end;
645
646 (*
647 * Structure defining a light source and its properties.
648 *)
649
650 (* flags bits *)
651 const
652 D3DLIGHT_ACTIVE = $00000001;
653 D3DLIGHT_NO_SPECULAR = $00000002;
654 D3DLIGHT_ALL = D3DLIGHT_ACTIVE or D3DLIGHT_ACTIVE;
655
656 (* maximum valid light range *)
657 D3DLIGHT_RANGE_MAX = 1.8439088915e+18; //sqrt(FLT_MAX);
658
659 type
660 PD3DLight2 = ^TD3DLight2;
661 TD3DLight2 = packed record
662 dwSize: DWORD;
663 dltType: TD3DLightType; (* Type of light source *)
664 dcvColor: TD3DColorValue; (* Color of light *)
665 dvPosition: TD3DVector; (* Position in world space *)
666 dvDirection: TD3DVector; (* Direction in world space *)
667 dvRange: TD3DValue; (* Cutoff range *)
668 dvFalloff: TD3DValue; (* Falloff *)
669 dvAttenuation0: TD3DValue; (* Constant attenuation *)
670 dvAttenuation1: TD3DValue; (* Linear attenuation *)
671 dvAttenuation2: TD3DValue; (* Quadratic attenuation *)
672 dvTheta: TD3DValue; (* Inner angle of spotlight cone *)
673 dvPhi: TD3DValue; (* Outer angle of spotlight cone *)
674 dwFlags: DWORD;
675 end;
676
677 PD3DLightData = ^TD3DLightData;
678 TD3DLightData = packed record
679 dwSize: DWORD;
680 lpIn: ^TD3DLightingElement; (* Input positions and normals *)
681 dwInSize: DWORD; (* Stride of input elements *)
682 lpOut: ^TD3DTLVertex; (* Output colors *)
683 dwOutSize: DWORD; (* Stride of output colors *)
684 end;
685
686 (*
687 * Before DX5, these values were in an enum called
688 * TD3DColorModel. This was not correct, since they are
689 * bit flags. A driver can surface either or both flags
690 * in the dcmColorModel member of D3DDEVICEDESC.
691 *)
692
693 type
694 TD3DColorModel = DWORD;
695
696 const
697 D3DCOLOR_MONO = 1;
698 D3DCOLOR_RGB = 2;
699
700 (*
701 * Options for clearing
702 *)
703
704 const
705 D3DCLEAR_TARGET = $00000001; (* Clear target surface *)
706 D3DCLEAR_ZBUFFER = $00000002; (* Clear target z buffer *)
707 D3DCLEAR_STENCIL = $00000004; (* Clear stencil planes *)
708
709 (*
710 * Execute buffers are allocated via Direct3D. These buffers may then
711 * be filled by the application with instructions to execute along with
712 * vertex data.
713 *)
714
715 (*
716 * Supported op codes for execute instructions.
717 *)
718
719 type
720 PD3DOpcode = ^TD3DOpcode;
721 TD3DOpcode = (
722 D3DOP_INVALID_0,
723 D3DOP_POINT,
724 D3DOP_LINE,
725 D3DOP_TRIANGLE,
726 D3DOP_MATRIXLOAD,
727 D3DOP_MATRIXMULTIPLY,
728 D3DOP_STATETRANSFORM,
729 D3DOP_STATELIGHT,
730 D3DOP_STATERENDER,
731 D3DOP_PROCESSVERTICES,
732 D3DOP_TEXTURELOAD,
733 D3DOP_EXIT,
734 D3DOP_BRANCHFORWARD,
735 D3DOP_SPAN,
736 D3DOP_SETSTATUS);
737
738 PD3DInstruction = ^TD3DInstruction;
739 TD3DInstruction = packed record
740 bOpcode: BYTE; (* Instruction opcode *)
741 bSize: BYTE; (* Size of each instruction data unit *)
742 wCount: WORD; (* Count of instruction data units to follow *)
743 end;
744
745 (*
746 * Structure for texture loads
747 *)
748
749 PD3DTextureLoad = ^TD3DTextureLoad;
750 TD3DTextureLoad = packed record
751 hDestTexture: TD3DTextureHandle;
752 hSrcTexture: TD3DTextureHandle;
753 end;
754
755 (*
756 * Structure for picking
757 *)
758
759 PD3DPickRecord = ^TD3DPickRecord;
760 TD3DPickRecord = packed record
761 bOpcode: BYTE;
762 bPad: BYTE;
763 dwOffset: DWORD;
764 dvZ: TD3DValue;
765 end;
766
767 (*
768 * The following defines the rendering states which can be set in the
769 * execute buffer.
770 *)
771
772 PD3DShadeMode = ^TD3DShadeMode;
773 TD3DShadeMode = (
774 D3DSHADE_INVALID_0,
775 D3DSHADE_FLAT,
776 D3DSHADE_GOURAUD,
777 D3DSHADE_PHONG);
778
779 PD3DFillMode = ^TD3DFillMode;
780 TD3DFillMode = (
781 D3DFILL_INVALID_0,
782 D3DFILL_POINT,
783 D3DFILL_WIREFRAME,
784 D3DFILL_SOLID);
785
786 PD3DLinePattern = ^TD3DLinePattern;
787 TD3DLinePattern = packed record
788 wRepeatFactor: WORD;
789 wLinePattern: WORD;
790 end;
791
792 PD3DTextureFilter = ^TD3DTextureFilter;
793 TD3DTextureFilter = (
794 D3DFILTER_INVALID_0,
795 D3DFILTER_NEAREST,
796 D3DFILTER_LINEAR,
797 D3DFILTER_MIPNEAREST,
798 D3DFILTER_MIPLINEAR,
799 D3DFILTER_LINEARMIPNEAREST,
800 D3DFILTER_LINEARMIPLINEAR);
801
802 PD3DBlend = ^TD3DBlend;
803 TD3DBlend = (
804 D3DBLEND_INVALID_0,
805 D3DBLEND_ZERO,
806 D3DBLEND_ONE,
807 D3DBLEND_SRCCOLOR,
808 D3DBLEND_INVSRCCOLOR,
809 D3DBLEND_SRCALPHA,
810 D3DBLEND_INVSRCALPHA,
811 D3DBLEND_DESTALPHA,
812 D3DBLEND_INVDESTALPHA,
813 D3DBLEND_DESTCOLOR,
814 D3DBLEND_INVDESTCOLOR,
815 D3DBLEND_SRCALPHASAT,
816 D3DBLEND_BOTHSRCALPHA,
817 D3DBLEND_BOTHINVSRCALPHA);
818
819 PD3DTextureBlend = ^TD3DTextureBlend;
820 TD3DTextureBlend = (
821 D3DTBLEND_INVALID_0,
822 D3DTBLEND_DECAL,
823 D3DTBLEND_MODULATE,
824 D3DTBLEND_DECALALPHA,
825 D3DTBLEND_MODULATEALPHA,
826 D3DTBLEND_DECALMASK,
827 D3DTBLEND_MODULATEMASK,
828 D3DTBLEND_COPY,
829 D3DTBLEND_ADD);
830
831 PD3DTextureAddress = ^TD3DTextureAddress;
832 TD3DTextureAddress = (
833 D3DTADDRESS_INVALID_0,
834 D3DTADDRESS_WRAP,
835 D3DTADDRESS_MIRROR,
836 D3DTADDRESS_CLAMP,
837 D3DTADDRESS_BORDER);
838
839 PD3DCull = ^TD3DCull;
840 TD3DCull = (
841 D3DCULL_INVALID_0,
842 D3DCULL_NONE,
843 D3DCULL_CW,
844 D3DCULL_CCW);
845
846 PD3DCmpFunc = ^TD3DCmpFunc;
847 TD3DCmpFunc = (
848 D3DCMP_INVALID_0,
849 D3DCMP_NEVER,
850 D3DCMP_LESS,
851 D3DCMP_EQUAL,
852 D3DCMP_LESSEQUAL,
853 D3DCMP_GREATER,
854 D3DCMP_NOTEQUAL,
855 D3DCMP_GREATEREQUAL,
856 D3DCMP_ALWAYS);
857
858 PD3DStencilOp = ^TD3DStencilOp;
859 TD3DStencilOp = (
860 D3DSTENCILOP_INVALID_0,
861 D3DSTENCILOP_KEEP,
862 D3DSTENCILOP_ZERO,
863 D3DSTENCILOP_REPLACE,
864 D3DSTENCILOP_INCRSAT,
865 D3DSTENCILOP_DECRSAT,
866 D3DSTENCILOP_INVERT,
867 D3DSTENCILOP_INCR,
868 D3DSTENCILOP_DECR);
869
870 PD3DFogMode = ^TD3DFogMode;
871 TD3DFogMode = (
872 D3DFOG_NONE,
873 D3DFOG_EXP,
874 D3DFOG_EXP2,
875 D3DFOG_LINEAR);
876
877 PD3DZBufferType = ^TD3DZBufferType;
878 TD3DZBufferType = (
879 D3DZB_FALSE,
880 D3DZB_TRUE, // Z buffering
881 D3DZB_USEW); // W buffering
882
883 PD3DAntialiasMode = ^TD3DAntialiasMode;
884 TD3DAntialiasMode = (
885 D3DANTIALIAS_NONE,
886 D3DANTIALIAS_SORTDEPENDENT,
887 D3DANTIALIAS_SORTINDEPENDENT);
888
889 // Vertex types supported by Direct3D
890 PD3DVertexType = ^TD3DVertexType;
891 TD3DVertexType = (
892 D3DVT_INVALID_0,
893 D3DVT_VERTEX,
894 D3DVT_LVERTEX,
895 D3DVT_TLVERTEX);
896
897 // Primitives supported by draw-primitive API
898 PD3DPrimitiveType = ^TD3DPrimitiveType;
899 TD3DPrimitiveType = (
900 D3DPT_INVALID_0,
901 D3DPT_POINTLIST,
902 D3DPT_LINELIST,
903 D3DPT_LINESTRIP,
904 D3DPT_TRIANGLELIST,
905 D3DPT_TRIANGLESTRIP,
906 D3DPT_TRIANGLEFAN);
907
908 (*
909 * Amount to add to a state to generate the override for that state.
910 *)
911
912 const
913 D3DSTATE_OVERRIDE_BIAS = 256;
914
915 (*
916 * A state which sets the override flag for the specified state type.
917 *)
918
919 function D3DSTATE_OVERRIDE(StateType: DWORD) : DWORD;
920
921 type
922 PD3DTransformStateType = ^TD3DTransformStateType;
923 TD3DTransformStateType = DWORD;
924 const
925 D3DTRANSFORMSTATE_WORLD = 1;
926 D3DTRANSFORMSTATE_VIEW = 2;
927 D3DTRANSFORMSTATE_PROJECTION = 3;
928 D3DTRANSFORMSTATE_WORLD1 = 4; // 2nd matrix to blend
929 D3DTRANSFORMSTATE_WORLD2 = 5; // 3rd matrix to blend
930 D3DTRANSFORMSTATE_WORLD3 = 6; // 4th matrix to blend
931 D3DTRANSFORMSTATE_TEXTURE0 = 16;
932 D3DTRANSFORMSTATE_TEXTURE1 = 17;
933 D3DTRANSFORMSTATE_TEXTURE2 = 18;
934 D3DTRANSFORMSTATE_TEXTURE3 = 19;
935 D3DTRANSFORMSTATE_TEXTURE4 = 20;
936 D3DTRANSFORMSTATE_TEXTURE5 = 21;
937 D3DTRANSFORMSTATE_TEXTURE6 = 22;
938 D3DTRANSFORMSTATE_TEXTURE7 = 23;
939
940 type
941 PD3DLightStateType = ^TD3DLightStateType;
942 TD3DLightStateType = (
943 D3DLIGHTSTATE_INVALID_0,
944 D3DLIGHTSTATE_MATERIAL,
945 D3DLIGHTSTATE_AMBIENT,
946 D3DLIGHTSTATE_COLORMODEL,
947 D3DLIGHTSTATE_FOGMODE,
948 D3DLIGHTSTATE_FOGSTART,
949 D3DLIGHTSTATE_FOGEND,
950 D3DLIGHTSTATE_FOGDENSITY,
951 D3DLIGHTSTATE_COLORVERTEX);
952
953 PD3DRenderStateType = ^TD3DRenderStateType;
954 TD3DRenderStateType = DWORD;
955 const
956 D3DRENDERSTATE_ANTIALIAS = 2; (* D3DANTIALIASMODE *)
957 D3DRENDERSTATE_TEXTUREPERSPECTIVE = 4; (* TRUE for perspective correction *)
958 D3DRENDERSTATE_ZENABLE = 7; (* D3DZBUFFERTYPE (or TRUE/FALSE for legacy) *)
959 D3DRENDERSTATE_FILLMODE = 8; (* D3DFILL_MODE *)
960 D3DRENDERSTATE_SHADEMODE = 9; (* D3DSHADEMODE *)
961 D3DRENDERSTATE_LINEPATTERN = 10; (* D3DLINEPATTERN *)
962 D3DRENDERSTATE_ZWRITEENABLE = 14; (* TRUE to enable z writes *)
963 D3DRENDERSTATE_ALPHATESTENABLE = 15; (* TRUE to enable alpha tests *)
964 D3DRENDERSTATE_LASTPIXEL = 16; (* TRUE for last-pixel on lines *)
965 D3DRENDERSTATE_SRCBLEND = 19; (* D3DBLEND *)
966 D3DRENDERSTATE_DESTBLEND = 20; (* D3DBLEND *)
967 D3DRENDERSTATE_CULLMODE = 22; (* D3DCULL *)
968 D3DRENDERSTATE_ZFUNC = 23; (* D3DCMPFUNC *)
969 D3DRENDERSTATE_ALPHAREF = 24; (* D3DFIXED *)
970 D3DRENDERSTATE_ALPHAFUNC = 25; (* D3DCMPFUNC *)
971 D3DRENDERSTATE_DITHERENABLE = 26; (* TRUE to enable dithering *)
972 D3DRENDERSTATE_ALPHABLENDENABLE = 27; (* TRUE to enable alpha blending *)
973 D3DRENDERSTATE_FOGENABLE = 28; (* TRUE to enable fog blending *)
974 D3DRENDERSTATE_SPECULARENABLE = 29; (* TRUE to enable specular *)
975 D3DRENDERSTATE_ZVISIBLE = 30; (* TRUE to enable z checking *)
976 D3DRENDERSTATE_STIPPLEDALPHA = 33; (* TRUE to enable stippled alpha (RGB device only) *)
977 D3DRENDERSTATE_FOGCOLOR = 34; (* D3DCOLOR *)
978 D3DRENDERSTATE_FOGTABLEMODE = 35; (* D3DFOGMODE *)
979 D3DRENDERSTATE_FOGSTART = 36; (* Fog start (for both vertex and pixel fog) *)
980 D3DRENDERSTATE_FOGEND = 37; (* Fog end *)
981 D3DRENDERSTATE_FOGDENSITY = 38; (* Fog density *)
982 D3DRENDERSTATE_EDGEANTIALIAS = 40; (* TRUE to enable edge antialiasing *)
983 D3DRENDERSTATE_COLORKEYENABLE = 41; (* TRUE to enable source colorkeyed textures *)
984 D3DRENDERSTATE_ZBIAS = 47; (* LONG Z bias *)
985 D3DRENDERSTATE_RANGEFOGENABLE = 48; (* Enables range-based fog *)
986
987 D3DRENDERSTATE_STENCILENABLE = 52; (* BOOL enable/disable stenciling *)
988 D3DRENDERSTATE_STENCILFAIL = 53; (* D3DSTENCILOP to do if stencil test fails *)
989 D3DRENDERSTATE_STENCILZFAIL = 54; (* D3DSTENCILOP to do if stencil test passes and Z test fails *)
990 D3DRENDERSTATE_STENCILPASS = 55; (* D3DSTENCILOP to do if both stencil and Z tests pass *)
991 D3DRENDERSTATE_STENCILFUNC = 56; (* D3DCMPFUNC fn. Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true *)
992 D3DRENDERSTATE_STENCILREF = 57; (* Reference value used in stencil test *)
993 D3DRENDERSTATE_STENCILMASK = 58; (* Mask value used in stencil test *)
994 D3DRENDERSTATE_STENCILWRITEMASK = 59; (* Write mask applied to values written to stencil buffer *)
995 D3DRENDERSTATE_TEXTUREFACTOR = 60; (* D3DCOLOR used for multi-texture blend *)
996
997 (*
998 * 128 values [128; 255] are reserved for texture coordinate wrap flags.
999 * These are constructed with the D3DWRAP_U and D3DWRAP_V macros. Using
1000 * a flags word preserves forward compatibility with texture coordinates
1001 * that are >2D.
1002 *)
1003 D3DRENDERSTATE_WRAP0 = 128; (* wrap for 1st texture coord. set *)
1004 D3DRENDERSTATE_WRAP1 = 129; (* wrap for 2nd texture coord. set *)
1005 D3DRENDERSTATE_WRAP2 = 130; (* wrap for 3rd texture coord. set *)
1006 D3DRENDERSTATE_WRAP3 = 131; (* wrap for 4th texture coord. set *)
1007 D3DRENDERSTATE_WRAP4 = 132; (* wrap for 5th texture coord. set *)
1008 D3DRENDERSTATE_WRAP5 = 133; (* wrap for 6th texture coord. set *)
1009 D3DRENDERSTATE_WRAP6 = 134; (* wrap for 7th texture coord. set *)
1010 D3DRENDERSTATE_WRAP7 = 135; (* wrap for 8th texture coord. set *)
1011 D3DRENDERSTATE_CLIPPING = 136;
1012 D3DRENDERSTATE_LIGHTING = 137;
1013 D3DRENDERSTATE_EXTENTS = 138;
1014 D3DRENDERSTATE_AMBIENT = 139;
1015 D3DRENDERSTATE_FOGVERTEXMODE = 140;
1016 D3DRENDERSTATE_COLORVERTEX = 141;
1017 D3DRENDERSTATE_LOCALVIEWER = 142;
1018 D3DRENDERSTATE_NORMALIZENORMALS = 143;
1019 D3DRENDERSTATE_COLORKEYBLENDENABLE = 144;
1020 D3DRENDERSTATE_DIFFUSEMATERIALSOURCE = 145;
1021 D3DRENDERSTATE_SPECULARMATERIALSOURCE = 146;
1022 D3DRENDERSTATE_AMBIENTMATERIALSOURCE = 147;
1023 D3DRENDERSTATE_EMISSIVEMATERIALSOURCE = 148;
1024 D3DRENDERSTATE_VERTEXBLEND = 151;
1025 D3DRENDERSTATE_CLIPPLANEENABLE = 152;
1026
1027 //
1028 // retired renderstates - not supported for DX7 interfaces
1029 //
1030 D3DRENDERSTATE_TEXTUREHANDLE = 1; (* Texture handle for legacy interfaces (Texture;Texture2) *)
1031 D3DRENDERSTATE_TEXTUREADDRESS = 3; (* D3DTEXTUREADDRESS *)
1032 D3DRENDERSTATE_WRAPU = 5; (* TRUE for wrapping in u *)
1033 D3DRENDERSTATE_WRAPV = 6; (* TRUE for wrapping in v *)
1034 D3DRENDERSTATE_MONOENABLE = 11; (* TRUE to enable mono rasterization *)
1035 D3DRENDERSTATE_ROP2 = 12; (* ROP2 *)
1036 D3DRENDERSTATE_PLANEMASK = 13; (* DWORD physical plane mask *)
1037 D3DRENDERSTATE_TEXTUREMAG = 17; (* D3DTEXTUREFILTER *)
1038 D3DRENDERSTATE_TEXTUREMIN = 18; (* D3DTEXTUREFILTER *)
1039 D3DRENDERSTATE_TEXTUREMAPBLEND = 21; (* D3DTEXTUREBLEND *)
1040 D3DRENDERSTATE_SUBPIXEL = 31; (* TRUE to enable subpixel correction *)
1041 D3DRENDERSTATE_SUBPIXELX = 32; (* TRUE to enable correction in X only *)
1042 D3DRENDERSTATE_STIPPLEENABLE = 39; (* TRUE to enable stippling *)
1043 D3DRENDERSTATE_BORDERCOLOR = 43; (* Border color for texturing w/border *)
1044 D3DRENDERSTATE_TEXTUREADDRESSU = 44; (* Texture addressing mode for U coordinate *)
1045 D3DRENDERSTATE_TEXTUREADDRESSV = 45; (* Texture addressing mode for V coordinate *)
1046 D3DRENDERSTATE_MIPMAPLODBIAS = 46; (* D3DVALUE Mipmap LOD bias *)
1047 D3DRENDERSTATE_ANISOTROPY = 49; (* Max. anisotropy. 1 = no anisotropy *)
1048 D3DRENDERSTATE_FLUSHBATCH = 50; (* Explicit flush for DP batching (DX5 Only) *)
1049 D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT=51; (* BOOL enable sort-independent transparency *)
1050 D3DRENDERSTATE_STIPPLEPATTERN00 = 64; (* Stipple pattern 01... *)
1051 D3DRENDERSTATE_STIPPLEPATTERN01 = 65;
1052 D3DRENDERSTATE_STIPPLEPATTERN02 = 66;
1053 D3DRENDERSTATE_STIPPLEPATTERN03 = 67;
1054 D3DRENDERSTATE_STIPPLEPATTERN04 = 68;
1055 D3DRENDERSTATE_STIPPLEPATTERN05 = 69;
1056 D3DRENDERSTATE_STIPPLEPATTERN06 = 70;
1057 D3DRENDERSTATE_STIPPLEPATTERN07 = 71;
1058 D3DRENDERSTATE_STIPPLEPATTERN08 = 72;
1059 D3DRENDERSTATE_STIPPLEPATTERN09 = 73;
1060 D3DRENDERSTATE_STIPPLEPATTERN10 = 74;
1061 D3DRENDERSTATE_STIPPLEPATTERN11 = 75;
1062 D3DRENDERSTATE_STIPPLEPATTERN12 = 76;
1063 D3DRENDERSTATE_STIPPLEPATTERN13 = 77;
1064 D3DRENDERSTATE_STIPPLEPATTERN14 = 78;
1065 D3DRENDERSTATE_STIPPLEPATTERN15 = 79;
1066 D3DRENDERSTATE_STIPPLEPATTERN16 = 80;
1067 D3DRENDERSTATE_STIPPLEPATTERN17 = 81;
1068 D3DRENDERSTATE_STIPPLEPATTERN18 = 82;
1069 D3DRENDERSTATE_STIPPLEPATTERN19 = 83;
1070 D3DRENDERSTATE_STIPPLEPATTERN20 = 84;
1071 D3DRENDERSTATE_STIPPLEPATTERN21 = 85;
1072 D3DRENDERSTATE_STIPPLEPATTERN22 = 86;
1073 D3DRENDERSTATE_STIPPLEPATTERN23 = 87;
1074 D3DRENDERSTATE_STIPPLEPATTERN24 = 88;
1075 D3DRENDERSTATE_STIPPLEPATTERN25 = 89;
1076 D3DRENDERSTATE_STIPPLEPATTERN26 = 90;
1077 D3DRENDERSTATE_STIPPLEPATTERN27 = 91;
1078 D3DRENDERSTATE_STIPPLEPATTERN28 = 92;
1079 D3DRENDERSTATE_STIPPLEPATTERN29 = 93;
1080 D3DRENDERSTATE_STIPPLEPATTERN30 = 94;
1081 D3DRENDERSTATE_STIPPLEPATTERN31 = 95;
1082
1083 //
1084 // retired renderstate names - the values are still used under new naming conventions
1085 //
1086 D3DRENDERSTATE_FOGTABLESTART = 36; (* Fog table start *)
1087 D3DRENDERSTATE_FOGTABLEEND = 37; (* Fog table end *)
1088 D3DRENDERSTATE_FOGTABLEDENSITY = 38; (* Fog table density *)
1089
1090 type
1091 // Values for material source
1092 PD3DMateralColorSource = ^TD3DMateralColorSource;
1093 TD3DMateralColorSource = (
1094 D3DMCS_MATERIAL, // Color from material is used
1095 D3DMCS_COLOR1, // Diffuse vertex color is used
1096 D3DMCS_COLOR2 // Specular vertex color is used
1097 );
1098
1099 const
1100 // For back-compatibility with legacy compilations
1101 D3DRENDERSTATE_BLENDENABLE = D3DRENDERSTATE_ALPHABLENDENABLE;
1102
1103
1104 // Bias to apply to the texture coordinate set to apply a wrap to.
1105 D3DRENDERSTATE_WRAPBIAS = 128;
1106
1107 (* Flags to construct the WRAP render states *)
1108 D3DWRAP_U = $00000001;
1109 D3DWRAP_V = $00000002;
1110
1111 (* Flags to construct the WRAP render states for 1D thru 4D texture coordinates *)
1112 D3DWRAPCOORD_0 = $00000001; // same as D3DWRAP_U
1113 D3DWRAPCOORD_1 = $00000002; // same as D3DWRAP_V
1114 D3DWRAPCOORD_2 = $00000004;
1115 D3DWRAPCOORD_3 = $00000008;
1116
1117 function D3DRENDERSTATE_STIPPLEPATTERN(y: integer) : TD3DRenderStateType;
1118
1119 type
1120 PD3DState = ^TD3DState;
1121 TD3DState = packed record
1122 case Integer of
1123 0: (
1124 dtstTransformStateType: TD3DTransformStateType;
1125 dwArg: Array [ 0..0 ] of DWORD;
1126 );
1127 1: (
1128 dlstLightStateType: TD3DLightStateType;
1129 dvArg: Array [ 0..0 ] of TD3DValue;
1130 );
1131 2: (
1132 drstRenderStateType: TD3DRenderStateType;
1133 );
1134 end;
1135
1136 (*
1137 * Operation used to load matrices
1138 * hDstMat = hSrcMat
1139 *)
1140 PD3DMatrixLoad = ^TD3DMatrixLoad;
1141 TD3DMatrixLoad = packed record
1142 hDestMatrix: TD3DMatrixHandle; (* Destination matrix *)
1143 hSrcMatrix: TD3DMatrixHandle; (* Source matrix *)
1144 end;
1145
1146 (*
1147 * Operation used to multiply matrices
1148 * hDstMat = hSrcMat1 * hSrcMat2
1149 *)
1150 PD3DMatrixMultiply = ^TD3DMatrixMultiply;
1151 TD3DMatrixMultiply = packed record
1152 hDestMatrix: TD3DMatrixHandle; (* Destination matrix *)
1153 hSrcMatrix1: TD3DMatrixHandle; (* First source matrix *)
1154 hSrcMatrix2: TD3DMatrixHandle; (* Second source matrix *)
1155 end;
1156
1157 (*
1158 * Operation used to transform and light vertices.
1159 *)
1160 PD3DProcessVertices = ^TD3DProcessVertices;
1161 TD3DProcessVertices = packed record
1162 dwFlags: DWORD; (* Do we transform or light or just copy? *)
1163 wStart: WORD; (* Index to first vertex in source *)
1164 wDest: WORD; (* Index to first vertex in local buffer *)
1165 dwCount: DWORD; (* Number of vertices to be processed *)
1166 dwReserved: DWORD; (* Must be zero *)
1167 end;
1168
1169 const
1170 D3DPROCESSVERTICES_TRANSFORMLIGHT = $00000000;
1171 D3DPROCESSVERTICES_TRANSFORM = $00000001;
1172 D3DPROCESSVERTICES_COPY = $00000002;
1173 D3DPROCESSVERTICES_OPMASK = $00000007;
1174
1175 D3DPROCESSVERTICES_UPDATEEXTENTS = $00000008;
1176 D3DPROCESSVERTICES_NOCOLOR = $00000010;
1177
1178
1179 (*
1180 * State enumerants for per-stage texture processing.
1181 *)
1182 type
1183 PD3DTextureStageStateType = ^TD3DTextureStageStateType;
1184 TD3DTextureStageStateType = DWORD;
1185 const
1186 D3DTSS_COLOROP = 1; (* D3DTEXTUREOP - per-stage blending controls for color channels *)
1187 D3DTSS_COLORARG1 = 2; (* D3DTA_* (texture arg) *)
1188 D3DTSS_COLORARG2 = 3; (* D3DTA_* (texture arg) *)
1189 D3DTSS_ALPHAOP = 4; (* D3DTEXTUREOP - per-stage blending controls for alpha channel *)
1190 D3DTSS_ALPHAARG1 = 5; (* D3DTA_* (texture arg) *)
1191 D3DTSS_ALPHAARG2 = 6; (* D3DTA_* (texture arg) *)
1192 D3DTSS_BUMPENVMAT00 = 7; (* D3DVALUE (bump mapping matrix) *)
1193 D3DTSS_BUMPENVMAT01 = 8; (* D3DVALUE (bump mapping matrix) *)
1194 D3DTSS_BUMPENVMAT10 = 9; (* D3DVALUE (bump mapping matrix) *)
1195 D3DTSS_BUMPENVMAT11 = 10; (* D3DVALUE (bump mapping matrix) *)
1196 D3DTSS_TEXCOORDINDEX = 11; (* identifies which set of texture coordinates index this texture *)
1197 D3DTSS_ADDRESS = 12; (* D3DTEXTUREADDRESS for both coordinates *)
1198 D3DTSS_ADDRESSU = 13; (* D3DTEXTUREADDRESS for U coordinate *)
1199 D3DTSS_ADDRESSV = 14; (* D3DTEXTUREADDRESS for V coordinate *)
1200 D3DTSS_BORDERCOLOR = 15; (* D3DCOLOR *)
1201 D3DTSS_MAGFILTER = 16; (* D3DTEXTUREMAGFILTER filter to use for magnification *)
1202 D3DTSS_MINFILTER = 17; (* D3DTEXTUREMINFILTER filter to use for minification *)
1203 D3DTSS_MIPFILTER = 18; (* D3DTEXTUREMIPFILTER filter to use between mipmaps during minification *)
1204 D3DTSS_MIPMAPLODBIAS = 19; (* D3DVALUE Mipmap LOD bias *)
1205 D3DTSS_MAXMIPLEVEL = 20; (* DWORD 0..(n-1) LOD index of largest map to use (0 == largest) *)
1206 D3DTSS_MAXANISOTROPY = 21; (* DWORD maximum anisotropy *)
1207 D3DTSS_BUMPENVLSCALE = 22; (* D3DVALUE scale for bump map luminance *)
1208 D3DTSS_BUMPENVLOFFSET = 23; (* D3DVALUE offset for bump map luminance *)
1209 D3DTSS_TEXTURETRANSFORMFLAGS = 24; (* D3DTEXTURETRANSFORMFLAGS controls texture transform *)
1210
1211 // Values, used with D3DTSS_TEXCOORDINDEX, to specify that the vertex data(position
1212 // and normal in the camera space) should be taken as texture coordinates
1213 // Low 16 bits are used to specify texture coordinate index, to take the WRAP mode from
1214 //
1215 D3DTSS_TCI_PASSTHRU = $00000000;
1216 D3DTSS_TCI_CAMERASPACENORMAL = $00010000;
1217 D3DTSS_TCI_CAMERASPACEPOSITION = $00020000;
1218 D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR = $00030000;
1219
1220 type
1221 (*
1222 * Enumerations for COLOROP and ALPHAOP texture blending operations set in
1223 * texture processing stage controls in D3DRENDERSTATE.
1224 *)
1225 PD3DTextureOp = ^TD3DTextureOp;
1226 TD3DTextureOp = (
1227 D3DTOP_INVALID_0,
1228 // Control
1229 D3DTOP_DISABLE , // disables stage
1230 D3DTOP_SELECTARG1, // the default
1231 D3DTOP_SELECTARG2,
1232
1233 // Modulate
1234 D3DTOP_MODULATE , // multiply args together
1235 D3DTOP_MODULATE2X, // multiply and 1 bit
1236 D3DTOP_MODULATE4X, // multiply and 2 bits
1237
1238 // Add
1239 D3DTOP_ADD , // add arguments together
1240 D3DTOP_ADDSIGNED , // add with -0.5 bias
1241 D3DTOP_ADDSIGNED2X, // as above but left 1 bit
1242 D3DTOP_SUBTRACT , // Arg1 - Arg2, with no saturation
1243 D3DTOP_ADDSMOOTH , // add 2 args, subtract product
1244 // Arg1 + Arg2 - Arg1*Arg2
1245 // = Arg1 + (1-Arg1)*Arg2
1246
1247 // Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha)
1248 D3DTOP_BLENDDIFFUSEALPHA , // iterated alpha
1249 D3DTOP_BLENDTEXTUREALPHA , // texture alpha
1250 D3DTOP_BLENDFACTORALPHA , // alpha from D3DRENDERSTATE_TEXTUREFACTOR
1251 // Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha)
1252 D3DTOP_BLENDTEXTUREALPHAPM, // texture alpha
1253 D3DTOP_BLENDCURRENTALPHA , // by alpha of current color
1254
1255 // Specular mapping
1256 D3DTOP_PREMODULATE , // modulate with next texture before use
1257 D3DTOP_MODULATEALPHA_ADDCOLOR, // Arg1.RGB + Arg1.A*Arg2.RGB
1258 // COLOROP only
1259 D3DTOP_MODULATECOLOR_ADDALPHA, // Arg1.RGB*Arg2.RGB + Arg1.A
1260 // COLOROP only
1261 D3DTOP_MODULATEINVALPHA_ADDCOLOR, // (1-Arg1.A)*Arg2.RGB + Arg1.RGB
1262 // COLOROP only
1263 D3DTOP_MODULATEINVCOLOR_ADDALPHA, // (1-Arg1.RGB)*Arg2.RGB + Arg1.A
1264 // COLOROP only
1265
1266 // Bump mapping
1267 D3DTOP_BUMPENVMAP , // per pixel env map perturbation
1268 D3DTOP_BUMPENVMAPLUMINANCE, // with luminance channel
1269 // This can do either diffuse or specular bump mapping with correct input.
1270 // Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B)
1271 // where each component has been scaled and offset to make it signed.
1272 // The result is replicated into all four (including alpha) channels.
1273 // This is a valid COLOROP only.
1274 D3DTOP_DOTPRODUCT3
1275 );
1276
1277 (*
1278 * Values for COLORARG1,2 and ALPHAARG1,2 texture blending operations
1279 * set in texture processing stage controls in D3DRENDERSTATE.
1280 *)
1281 const
1282 D3DTA_SELECTMASK = $0000000f; // mask for arg selector
1283 D3DTA_DIFFUSE = $00000000; // select diffuse color
1284 D3DTA_CURRENT = $00000001; // select result of previous stage
1285 D3DTA_TEXTURE = $00000002; // select texture color
1286 D3DTA_TFACTOR = $00000003; // select RENDERSTATE_TEXTUREFACTOR
1287 D3DTA_SPECULAR = $00000004; // select specular color
1288 D3DTA_COMPLEMENT = $00000010; // take 1.0 - x
1289 D3DTA_ALPHAREPLICATE = $00000020; // replicate alpha to color components
1290
1291 (*
1292 * IDirect3DTexture2 State Filter Types
1293 *)
1294 type
1295 PD3DTextureMagFilter = ^TD3DTextureMagFilter;
1296 TD3DTextureMagFilter = (
1297 D3DTFG_INVALID_0,
1298 D3DTFG_POINT , // nearest
1299 D3DTFG_LINEAR , // linear interpolation
1300 D3DTFG_FLATCUBIC , // cubic
1301 D3DTFG_GAUSSIANCUBIC, // different cubic kernel
1302 D3DTFG_ANISOTROPIC
1303 );
1304
1305 PD3DTextureMinFilter = ^TD3DTextureMinFilter;
1306 TD3DTextureMinFilter = (
1307 D3DTFN_INVALID_0,
1308 D3DTFN_POINT , // nearest
1309 D3DTFN_LINEAR , // linear interpolation
1310 D3DTFN_ANISOTROPIC
1311 );
1312
1313 PD3DTextureMipFilter = ^TD3DTextureMipFilter;
1314 TD3DTextureMipFilter = (
1315 D3DTFP_INVALID_0,
1316 D3DTFP_NONE , // mipmapping disabled (use MAG filter)
1317 D3DTFP_POINT , // nearest
1318 D3DTFP_LINEAR // linear interpolation
1319 );
1320
1321
1322 (*
1323 * Triangle flags
1324 *)
1325
1326 (*
1327 * Tri strip and fan flags.
1328 * START loads all three vertices
1329 * EVEN and ODD load just v3 with even or odd culling
1330 * START_FLAT contains a count from 0 to 29 that allows the
1331 * whole strip or fan to be culled in one hit.
1332 * e.g. for a quad len = 1
1333 *)
1334 const
1335 D3DTRIFLAG_START = $00000000;
1336 // #define D3DTRIFLAG_STARTFLAT(len) (len) (* 0 < len < 30 *)
1337 function D3DTRIFLAG_STARTFLAT(len: DWORD) : DWORD;
1338
1339 const
1340 D3DTRIFLAG_ODD = $0000001e;
1341 D3DTRIFLAG_EVEN = $0000001f;
1342
1343 (*
1344 * Triangle edge flags
1345 * enable edges for wireframe or antialiasing
1346 *)
1347 D3DTRIFLAG_EDGEENABLE1 = $00000100; (* v0-v1 edge *)
1348 D3DTRIFLAG_EDGEENABLE2 = $00000200; (* v1-v2 edge *)
1349 D3DTRIFLAG_EDGEENABLE3 = $00000400; (* v2-v0 edge *)
1350 D3DTRIFLAG_EDGEENABLETRIANGLE = (
1351 D3DTRIFLAG_EDGEENABLE1 or D3DTRIFLAG_EDGEENABLE2 or D3DTRIFLAG_EDGEENABLE3);
1352
1353 (*
1354 * Primitive structures and related defines. Vertex offsets are to types
1355 * TD3DVertex, TD3DLVertex, or TD3DTLVertex.
1356 *)
1357
1358 (*
1359 * Triangle list primitive structure
1360 *)
1361 type
1362 PD3DTriangle = ^TD3DTriangle;
1363 TD3DTriangle = packed record
1364 case Integer of
1365 0: (
1366 v1: WORD; (* Vertex indices *)
1367 v2: WORD;
1368 v3: WORD;
1369 wFlags: WORD; (* Edge (and other) flags *)
1370 );
1371 1: (
1372 wV1: WORD;
1373 wV2: WORD;
1374 wV3: WORD;
1375 );
1376 end;
1377
1378 (*
1379 * Line strip structure.
1380 * The instruction count - 1 defines the number of line segments.
1381 *)
1382 PD3DLine = ^TD3DLine;
1383 TD3DLine = packed record
1384 case Integer of
1385 0: (
1386 v1: WORD; (* Vertex indices *)
1387 v2: WORD;
1388 );
1389 1: (
1390 wV1: WORD;
1391 wV2: WORD;
1392 );
1393 end;
1394
1395 (*
1396 * Span structure
1397 * Spans join a list of points with the same y value.
1398 * If the y value changes, a new span is started.
1399 *)
1400 PD3DSpan = ^TD3DSpan;
1401 TD3DSpan = packed record
1402 wCount: WORD; (* Number of spans *)
1403 wFirst: WORD; (* Index to first vertex *)
1404 end;
1405
1406 (*
1407 * Point structure
1408 *)
1409 PD3DPoint = ^TD3DPoint;
1410 TD3DPoint = packed record
1411 wCount: WORD; (* number of points *)
1412 wFirst: WORD; (* index to first vertex *)
1413 end;
1414
1415 (*
1416 * Forward branch structure.
1417 * Mask is logically anded with the driver status mask
1418 * if the result equals 'value', the branch is taken.
1419 *)
1420 PD3DBranch = ^TD3DBranch;
1421 TD3DBranch = packed record
1422 dwMask: DWORD; (* Bitmask against D3D status *)
1423 dwValue: DWORD;
1424 bNegate: BOOL; (* TRUE to negate comparison *)
1425 dwOffset: DWORD; (* How far to branch forward (0 for exit)*)
1426 end;
1427
1428 (*
1429 * Status used for set status instruction.
1430 * The D3D status is initialised on device creation
1431 * and is modified by all execute calls.
1432 *)
1433 PD3DStatus = ^TD3DStatus;
1434 TD3DStatus = packed record
1435 dwFlags: DWORD; (* Do we set extents or status *)
1436 dwStatus: DWORD; (* D3D status *)
1437 drExtent: TD3DRect;
1438 end;
1439
1440 const
1441 D3DSETSTATUS_STATUS = $00000001;
1442 D3DSETSTATUS_EXTENTS = $00000002;
1443 D3DSETSTATUS_ALL = (D3DSETSTATUS_STATUS or D3DSETSTATUS_EXTENTS);
1444
1445 type
1446 PD3DClipStatus = ^TD3DClipStatus;
1447 TD3DClipStatus = packed record
1448 dwFlags : DWORD; (* Do we set 2d extents, 3D extents or status *)
1449 dwStatus : DWORD; (* Clip status *)
1450 minx, maxx : float; (* X extents *)
1451 miny, maxy : float; (* Y extents *)
1452 minz, maxz : float; (* Z extents *)
1453 end;
1454
1455 const
1456 D3DCLIPSTATUS_STATUS = $00000001;
1457 D3DCLIPSTATUS_EXTENTS2 = $00000002;
1458 D3DCLIPSTATUS_EXTENTS3 = $00000004;
1459
1460 (*
1461 * Statistics structure
1462 *)
1463 type
1464 PD3DStats = ^TD3DStats;
1465 TD3DStats = packed record
1466 dwSize: DWORD;
1467 dwTrianglesDrawn: DWORD;
1468 dwLinesDrawn: DWORD;
1469 dwPointsDrawn: DWORD;
1470 dwSpansDrawn: DWORD;
1471 dwVerticesProcessed: DWORD;
1472 end;
1473
1474 (*
1475 * Execute options.
1476 * When calling using D3DEXECUTE_UNCLIPPED all the primitives
1477 * inside the buffer must be contained within the viewport.
1478 *)
1479 const
1480 D3DEXECUTE_CLIPPED = $00000001;
1481 D3DEXECUTE_UNCLIPPED = $00000002;
1482
1483 type
1484 PD3DExecuteData = ^TD3DExecuteData;
1485 TD3DExecuteData = packed record
1486 dwSize: DWORD;
1487 dwVertexOffset: DWORD;
1488 dwVertexCount: DWORD;
1489 dwInstructionOffset: DWORD;
1490 dwInstructionLength: DWORD;
1491 dwHVertexOffset: DWORD;
1492 dsStatus: TD3DStatus; (* Status after execute *)
1493 end;
1494
1495 (*
1496 * Palette flags.
1497 * This are or'ed with the peFlags in the PALETTEENTRYs passed to DirectDraw.
1498 *)
1499
1500 const
1501 D3DPAL_FREE = $00; (* Renderer may use this entry freely *)
1502 D3DPAL_READONLY = $40; (* Renderer may not set this entry *)
1503 D3DPAL_RESERVED = $80; (* Renderer may not use this entry *)
1504
1505
1506 type
1507 PD3DVertexBufferDesc = ^TD3DVertexBufferDesc;
1508 TD3DVertexBufferDesc = packed record
1509 dwSize : DWORD;
1510 dwCaps : DWORD;
1511 dwFVF : DWORD;
1512 dwNumVertices : DWORD;
1513 end;
1514
1515 const
1516 (* These correspond to DDSCAPS_* flags *)
1517 D3DVBCAPS_SYSTEMMEMORY = $00000800;
1518 D3DVBCAPS_WRITEONLY = $00010000;
1519 D3DVBCAPS_OPTIMIZED = $80000000;
1520 D3DVBCAPS_DONOTCLIP = $00000001;
1521
1522 (* Vertex Operations for ProcessVertices *)
1523 D3DVOP_LIGHT = (1 shl 10);
1524 D3DVOP_TRANSFORM = (1 shl 0);
1525 D3DVOP_CLIP = (1 shl 2);
1526 D3DVOP_EXTENTS = (1 shl 3);
1527
1528 (* The maximum number of vertices user can pass to any d3d
1529 drawing function or to create vertex buffer with
1530 *)
1531 D3DMAXNUMVERTICES = ((1 shl 16) - 1);
1532 (* The maximum number of primitives user can pass to any d3d
1533 drawing function.
1534 *)
1535 D3DMAXNUMPRIMITIVES = ((1 shl 16) - 1);
1536
1537 (* Bits for dwFlags in ProcessVertices call *)
1538 D3DPV_DONOTCOPYDATA = (1 shl 0);
1539
1540 //-------------------------------------------------------------------
1541
1542 // Flexible vertex format bits
1543 //
1544 D3DFVF_RESERVED0 = $001;
1545 D3DFVF_POSITION_MASK = $00E;
1546 D3DFVF_XYZ = $002;
1547 D3DFVF_XYZRHW = $004;
1548 D3DFVF_XYZB1 = $006;
1549 D3DFVF_XYZB2 = $008;
1550 D3DFVF_XYZB3 = $00a;
1551 D3DFVF_XYZB4 = $00c;
1552 D3DFVF_XYZB5 = $00e;
1553
1554 D3DFVF_NORMAL = $010;
1555 D3DFVF_RESERVED1 = $020;
1556 D3DFVF_DIFFUSE = $040;
1557 D3DFVF_SPECULAR = $080;
1558
1559 D3DFVF_TEXCOUNT_MASK = $f00;
1560 D3DFVF_TEXCOUNT_SHIFT = 8;
1561 D3DFVF_TEX0 = $000;
1562 D3DFVF_TEX1 = $100;
1563 D3DFVF_TEX2 = $200;
1564 D3DFVF_TEX3 = $300;
1565 D3DFVF_TEX4 = $400;
1566 D3DFVF_TEX5 = $500;
1567 D3DFVF_TEX6 = $600;
1568 D3DFVF_TEX7 = $700;
1569 D3DFVF_TEX8 = $800;
1570
1571 D3DFVF_RESERVED2 = $f000; // 4 reserved bits
1572
1573 D3DFVF_VERTEX = ( D3DFVF_XYZ or D3DFVF_NORMAL or D3DFVF_TEX1 );
1574 D3DFVF_LVERTEX = ( D3DFVF_XYZ or D3DFVF_RESERVED1 or D3DFVF_DIFFUSE or
1575 D3DFVF_SPECULAR or D3DFVF_TEX1 );
1576 D3DFVF_TLVERTEX = ( D3DFVF_XYZRHW or D3DFVF_DIFFUSE or D3DFVF_SPECULAR or
1577 D3DFVF_TEX1 );
1578
1579 type
1580 PD3DDP_PtrStride = ^TD3DDP_PtrStride;
1581 TD3DDP_PtrStride = packed record
1582 lpvData : pointer;
1583 dwStride : DWORD;
1584 end;
1585
1586 const
1587 D3DDP_MAXTEXCOORD = 8;
1588
1589 type
1590 PD3DDrawPrimitiveStridedData = ^TD3DDrawPrimitiveStridedData;
1591 TD3DDrawPrimitiveStridedData = packed record
1592 position : TD3DDP_PtrStride;
1593 normal : TD3DDP_PtrStride;
1594 diffuse : TD3DDP_PtrStride;
1595 specular : TD3DDP_PtrStride;
1596 textureCoords : array [0..D3DDP_MAXTEXCOORD-1] of TD3DDP_PtrStride;
1597 end;
1598
1599 //---------------------------------------------------------------------
1600 // ComputeSphereVisibility return values
1601 //
1602 const
1603 D3DVIS_INSIDE_FRUSTUM = 0;
1604 D3DVIS_INTERSECT_FRUSTUM = 1;
1605 D3DVIS_OUTSIDE_FRUSTUM = 2;
1606 D3DVIS_INSIDE_LEFT = 0;
1607 D3DVIS_INTERSECT_LEFT = (1 shl 2);
1608 D3DVIS_OUTSIDE_LEFT = (2 shl 2);
1609 D3DVIS_INSIDE_RIGHT = 0;
1610 D3DVIS_INTERSECT_RIGHT = (1 shl 4);
1611 D3DVIS_OUTSIDE_RIGHT = (2 shl 4);
1612 D3DVIS_INSIDE_TOP = 0;
1613 D3DVIS_INTERSECT_TOP = (1 shl 6);
1614 D3DVIS_OUTSIDE_TOP = (2 shl 6);
1615 D3DVIS_INSIDE_BOTTOM = 0;
1616 D3DVIS_INTERSECT_BOTTOM = (1 shl 8);
1617 D3DVIS_OUTSIDE_BOTTOM = (2 shl 8);
1618 D3DVIS_INSIDE_NEAR = 0;
1619 D3DVIS_INTERSECT_NEAR = (1 shl 10);
1620 D3DVIS_OUTSIDE_NEAR = (2 shl 10);
1621 D3DVIS_INSIDE_FAR = 0;
1622 D3DVIS_INTERSECT_FAR = (1 shl 12);
1623 D3DVIS_OUTSIDE_FAR = (2 shl 12);
1624
1625 D3DVIS_MASK_FRUSTUM = (3 shl 0);
1626 D3DVIS_MASK_LEFT = (3 shl 2);
1627 D3DVIS_MASK_RIGHT = (3 shl 4);
1628 D3DVIS_MASK_TOP = (3 shl 6);
1629 D3DVIS_MASK_BOTTOM = (3 shl 8);
1630 D3DVIS_MASK_NEAR = (3 shl 10);
1631 D3DVIS_MASK_FAR = (3 shl 12);
1632
1633 // To be used with GetInfo()
1634 D3DDEVINFOID_TEXTUREMANAGER = 1;
1635 D3DDEVINFOID_D3DTEXTUREMANAGER = 2;
1636 D3DDEVINFOID_TEXTURING = 3;
1637
1638 type
1639 PD3DStateBlockType = ^TD3DStateBlockType;
1640 TD3DStateBlockType = (
1641 D3DSBT_INVALID_0 ,
1642 D3DSBT_ALL , // capture all state
1643 D3DSBT_PIXELSTATE , // capture pixel state
1644 D3DSBT_VERTEXSTATE // capture vertex state
1645 );
1646
1647 // The D3DVERTEXBLENDFLAGS type is used with D3DRENDERSTATE_VERTEXBLEND state.
1648 //
1649 PD3DVertexBlendFlags = ^TD3DVertexBlendFlags;
1650 TD3DVertexBlendFlags = (
1651 D3DVBLEND_DISABLE , // Disable vertex blending
1652 D3DVBLEND_1WEIGHT , // blend between 2 matrices
1653 D3DVBLEND_2WEIGHTS, // blend between 3 matrices
1654 D3DVBLEND_3WEIGHTS // blend between 4 matrices
1655 );
1656
1657 PD3DTextureTransformFlags = ^TD3DTextureTransformFlags;
1658 TD3DTextureTransformFlags = (
1659 D3DTTFF_DISABLE , // texture coordinates are passed directly
1660 D3DTTFF_COUNT1 , // rasterizer should expect 1-D texture coords
1661 D3DTTFF_COUNT2 , // rasterizer should expect 2-D texture coords
1662 D3DTTFF_COUNT3 , // rasterizer should expect 3-D texture coords
1663 D3DTTFF_COUNT4 // rasterizer should expect 4-D texture coords
1664 );
1665
1666 const
1667 D3DTTFF_PROJECTED = TD3DTextureTransformFlags(256); // texcoords to be divided by COUNTth element
1668
1669 // Macros to set texture coordinate format bits in the FVF id
1670
1671 D3DFVF_TEXTUREFORMAT2 = 0; // Two floating point values
1672 D3DFVF_TEXTUREFORMAT1 = 3; // One floating point value
1673 D3DFVF_TEXTUREFORMAT3 = 1; // Three floating point values
1674 D3DFVF_TEXTUREFORMAT4 = 2; // Four floating point values
1675
1676 function D3DFVF_TEXCOORDSIZE3(CoordIndex: DWORD) : DWORD;
1677 function D3DFVF_TEXCOORDSIZE2(CoordIndex: DWORD) : DWORD;
1678 function D3DFVF_TEXCOORDSIZE4(CoordIndex: DWORD) : DWORD;
1679 function D3DFVF_TEXCOORDSIZE1(CoordIndex: DWORD) : DWORD;
1680
1681 (*==========================================================================;
1682 *
1683 *
1684 * File: d3dcaps.h
1685 * Content: Direct3D capabilities include file
1686 *
1687 ***************************************************************************)
1688
1689 (* Description of capabilities of transform *)
1690
1691 type
1692 PD3DTransformCaps = ^TD3DTransformCaps;
1693 TD3DTransformCaps = packed record
1694 dwSize: DWORD;
1695 dwCaps: DWORD;
1696 end;
1697
1698 const
1699 D3DTRANSFORMCAPS_CLIP = $00000001; (* Will clip whilst transforming *)
1700
1701 (* Description of capabilities of lighting *)
1702
1703 type
1704 PD3DLightingCaps = ^TD3DLightingCaps;
1705 TD3DLightingCaps = packed record
1706 dwSize: DWORD;
1707 dwCaps: DWORD; (* Lighting caps *)
1708 dwLightingModel: DWORD; (* Lighting model - RGB or mono *)
1709 dwNumLights: DWORD; (* Number of lights that can be handled *)
1710 end;
1711
1712 const
1713 D3DLIGHTINGMODEL_RGB = $00000001;
1714 D3DLIGHTINGMODEL_MONO = $00000002;
1715
1716 D3DLIGHTCAPS_POINT = $00000001; (* Point lights supported *)
1717 D3DLIGHTCAPS_SPOT = $00000002; (* Spot lights supported *)
1718 D3DLIGHTCAPS_DIRECTIONAL = $00000004; (* Directional lights supported *)
1719 D3DLIGHTCAPS_PARALLELPOINT = $00000008; (* Parallel point lights supported *)
1720 D3DLIGHTCAPS_GLSPOT = $00000010; (* GL syle spot lights supported *)
1721
1722 (* Description of capabilities for each primitive type *)
1723
1724 type
1725 PD3DPrimCaps = ^TD3DPrimCaps;
1726 TD3DPrimCaps = packed record
1727 dwSize: DWORD;
1728 dwMiscCaps: DWORD; (* Capability flags *)
1729 dwRasterCaps: DWORD;
1730 dwZCmpCaps: DWORD;
1731 dwSrcBlendCaps: DWORD;
1732 dwDestBlendCaps: DWORD;
1733 dwAlphaCmpCaps: DWORD;
1734 dwShadeCaps: DWORD;
1735 dwTextureCaps: DWORD;
1736 dwTextureFilterCaps: DWORD;
1737 dwTextureBlendCaps: DWORD;
1738 dwTextureAddressCaps: DWORD;
1739 dwStippleWidth: DWORD; (* maximum width and height of *)
1740 dwStippleHeight: DWORD; (* of supported stipple (up to 32x32) *)
1741 end;
1742
1743 const
1744 (* TD3DPrimCaps dwMiscCaps *)
1745
1746 D3DPMISCCAPS_MASKPLANES = $00000001;
1747 D3DPMISCCAPS_MASKZ = $00000002;
1748 D3DPMISCCAPS_LINEPATTERNREP = $00000004;
1749 D3DPMISCCAPS_CONFORMANT = $00000008;
1750 D3DPMISCCAPS_CULLNONE = $00000010;
1751 D3DPMISCCAPS_CULLCW = $00000020;
1752 D3DPMISCCAPS_CULLCCW = $00000040;
1753
1754 (* TD3DPrimCaps dwRasterCaps *)
1755
1756 D3DPRASTERCAPS_DITHER = $00000001;
1757 D3DPRASTERCAPS_ROP2 = $00000002;
1758 D3DPRASTERCAPS_XOR = $00000004;
1759 D3DPRASTERCAPS_PAT = $00000008;
1760 D3DPRASTERCAPS_ZTEST = $00000010;
1761 D3DPRASTERCAPS_SUBPIXEL = $00000020;
1762 D3DPRASTERCAPS_SUBPIXELX = $00000040;
1763 D3DPRASTERCAPS_FOGVERTEX = $00000080;
1764 D3DPRASTERCAPS_FOGTABLE = $00000100;
1765 D3DPRASTERCAPS_STIPPLE = $00000200;
1766 D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT = $00000400;
1767 D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT = $00000800;
1768 D3DPRASTERCAPS_ANTIALIASEDGES = $00001000;
1769 D3DPRASTERCAPS_MIPMAPLODBIAS = $00002000;
1770 D3DPRASTERCAPS_ZBIAS = $00004000;
1771 D3DPRASTERCAPS_ZBUFFERLESSHSR = $00008000;
1772 D3DPRASTERCAPS_FOGRANGE = $00010000;
1773 D3DPRASTERCAPS_ANISOTROPY = $00020000;
1774 D3DPRASTERCAPS_WBUFFER = $00040000;
1775 D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT = $00080000;
1776 D3DPRASTERCAPS_WFOG = $00100000;
1777 D3DPRASTERCAPS_ZFOG = $00200000;
1778
1779 (* TD3DPrimCaps dwZCmpCaps, dwAlphaCmpCaps *)
1780
1781 const
1782 D3DPCMPCAPS_NEVER = $00000001;
1783 D3DPCMPCAPS_LESS = $00000002;
1784 D3DPCMPCAPS_EQUAL = $00000004;
1785 D3DPCMPCAPS_LESSEQUAL = $00000008;
1786 D3DPCMPCAPS_GREATER = $00000010;
1787 D3DPCMPCAPS_NOTEQUAL = $00000020;
1788 D3DPCMPCAPS_GREATEREQUAL = $00000040;
1789 D3DPCMPCAPS_ALWAYS = $00000080;
1790
1791 (* TD3DPrimCaps dwSourceBlendCaps, dwDestBlendCaps *)
1792
1793 D3DPBLENDCAPS_ZERO = $00000001;
1794 D3DPBLENDCAPS_ONE = $00000002;
1795 D3DPBLENDCAPS_SRCCOLOR = $00000004;
1796 D3DPBLENDCAPS_INVSRCCOLOR = $00000008;
1797 D3DPBLENDCAPS_SRCALPHA = $00000010;
1798 D3DPBLENDCAPS_INVSRCALPHA = $00000020;
1799 D3DPBLENDCAPS_DESTALPHA = $00000040;
1800 D3DPBLENDCAPS_INVDESTALPHA = $00000080;
1801 D3DPBLENDCAPS_DESTCOLOR = $00000100;
1802 D3DPBLENDCAPS_INVDESTCOLOR = $00000200;
1803 D3DPBLENDCAPS_SRCALPHASAT = $00000400;
1804 D3DPBLENDCAPS_BOTHSRCALPHA = $00000800;
1805 D3DPBLENDCAPS_BOTHINVSRCALPHA = $00001000;
1806
1807 (* TD3DPrimCaps dwShadeCaps *)
1808
1809 D3DPSHADECAPS_COLORFLATMONO = $00000001;
1810 D3DPSHADECAPS_COLORFLATRGB = $00000002;
1811 D3DPSHADECAPS_COLORGOURAUDMONO = $00000004;
1812 D3DPSHADECAPS_COLORGOURAUDRGB = $00000008;
1813 D3DPSHADECAPS_COLORPHONGMONO = $00000010;
1814 D3DPSHADECAPS_COLORPHONGRGB = $00000020;
1815
1816 D3DPSHADECAPS_SPECULARFLATMONO = $00000040;
1817 D3DPSHADECAPS_SPECULARFLATRGB = $00000080;
1818 D3DPSHADECAPS_SPECULARGOURAUDMONO = $00000100;
1819 D3DPSHADECAPS_SPECULARGOURAUDRGB = $00000200;
1820 D3DPSHADECAPS_SPECULARPHONGMONO = $00000400;
1821 D3DPSHADECAPS_SPECULARPHONGRGB = $00000800;
1822
1823 D3DPSHADECAPS_ALPHAFLATBLEND = $00001000;
1824 D3DPSHADECAPS_ALPHAFLATSTIPPLED = $00002000;
1825 D3DPSHADECAPS_ALPHAGOURAUDBLEND = $00004000;
1826 D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED = $00008000;
1827 D3DPSHADECAPS_ALPHAPHONGBLEND = $00010000;
1828 D3DPSHADECAPS_ALPHAPHONGSTIPPLED = $00020000;
1829
1830 D3DPSHADECAPS_FOGFLAT = $00040000;
1831 D3DPSHADECAPS_FOGGOURAUD = $00080000;
1832 D3DPSHADECAPS_FOGPHONG = $00100000;
1833
1834 (* TD3DPrimCaps dwTextureCaps *)
1835
1836 (*
1837 * Perspective-correct texturing is supported
1838 *)
1839 D3DPTEXTURECAPS_PERSPECTIVE = $00000001;
1840
1841 (*
1842 * Power-of-2 texture dimensions are required
1843 *)
1844 D3DPTEXTURECAPS_POW2 = $00000002;
1845
1846 (*
1847 * Alpha in texture pixels is supported
1848 *)
1849 D3DPTEXTURECAPS_ALPHA = $00000004;
1850
1851 (*
1852 * Color-keyed textures are supported
1853 *)
1854 D3DPTEXTURECAPS_TRANSPARENCY = $00000008;
1855
1856 (*
1857 * obsolete, see D3DPTADDRESSCAPS_BORDER
1858 *)
1859 D3DPTEXTURECAPS_BORDER = $00000010;
1860
1861 (*
1862 * Only square textures are supported
1863 *)
1864 D3DPTEXTURECAPS_SQUAREONLY = $00000020;
1865
1866 (*
1867 * Texture indices are not scaled by the texture size prior
1868 * to interpolation.
1869 *)
1870 D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE = $00000040;
1871
1872 (*
1873 * Device can draw alpha from texture palettes
1874 *)
1875 D3DPTEXTURECAPS_ALPHAPALETTE = $00000080;
1876
1877 (*
1878 * Device can use non-POW2 textures if:
1879 * 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage
1880 * 2) D3DRS_WRAP(N) is zero for this texture's coordinates
1881 * 3) mip mapping is not enabled (use magnification filter only)
1882 *)
1883 D3DPTEXTURECAPS_NONPOW2CONDITIONAL = $00000100;
1884
1885 // 0x00000200L unused
1886
1887 (*
1888 * Device can divide transformed texture coordinates by the
1889 * COUNTth texture coordinate (can do D3DTTFF_PROJECTED)
1890 *)
1891 D3DPTEXTURECAPS_PROJECTED = $00000400;
1892
1893 (*
1894 * Device can do cubemap textures
1895 *)
1896 D3DPTEXTURECAPS_CUBEMAP = $00000800;
1897
1898 D3DPTEXTURECAPS_COLORKEYBLEND = $00001000;
1899
1900
1901 (* TD3DPrimCaps dwTextureFilterCaps *)
1902
1903 D3DPTFILTERCAPS_NEAREST = $00000001;
1904 D3DPTFILTERCAPS_LINEAR = $00000002;
1905 D3DPTFILTERCAPS_MIPNEAREST = $00000004;
1906 D3DPTFILTERCAPS_MIPLINEAR = $00000008;
1907 D3DPTFILTERCAPS_LINEARMIPNEAREST = $00000010;
1908 D3DPTFILTERCAPS_LINEARMIPLINEAR = $00000020;
1909
1910 (* Device3 Min Filter *)
1911 D3DPTFILTERCAPS_MINFPOINT = $00000100;
1912 D3DPTFILTERCAPS_MINFLINEAR = $00000200;
1913 D3DPTFILTERCAPS_MINFANISOTROPIC = $00000400;
1914
1915 (* Device3 Mip Filter *)
1916 D3DPTFILTERCAPS_MIPFPOINT = $00010000;
1917 D3DPTFILTERCAPS_MIPFLINEAR = $00020000;
1918
1919 (* Device3 Mag Filter *)
1920 D3DPTFILTERCAPS_MAGFPOINT = $01000000;
1921 D3DPTFILTERCAPS_MAGFLINEAR = $02000000;
1922 D3DPTFILTERCAPS_MAGFANISOTROPIC = $04000000;
1923 D3DPTFILTERCAPS_MAGFAFLATCUBIC = $08000000;
1924 D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC = $10000000;
1925
1926 (* TD3DPrimCaps dwTextureBlendCaps *)
1927
1928 D3DPTBLENDCAPS_DECAL = $00000001;
1929 D3DPTBLENDCAPS_MODULATE = $00000002;
1930 D3DPTBLENDCAPS_DECALALPHA = $00000004;
1931 D3DPTBLENDCAPS_MODULATEALPHA = $00000008;
1932 D3DPTBLENDCAPS_DECALMASK = $00000010;
1933 D3DPTBLENDCAPS_MODULATEMASK = $00000020;
1934 D3DPTBLENDCAPS_COPY = $00000040;
1935 D3DPTBLENDCAPS_ADD = $00000080;
1936
1937 (* TD3DPrimCaps dwTextureAddressCaps *)
1938 D3DPTADDRESSCAPS_WRAP = $00000001;
1939 D3DPTADDRESSCAPS_MIRROR = $00000002;
1940 D3DPTADDRESSCAPS_CLAMP = $00000004;
1941 D3DPTADDRESSCAPS_BORDER = $00000008;
1942 D3DPTADDRESSCAPS_INDEPENDENTUV = $00000010;
1943
1944 (* D3DDEVICEDESC dwStencilCaps *)
1945
1946 D3DSTENCILCAPS_KEEP = $00000001;
1947 D3DSTENCILCAPS_ZERO = $00000002;
1948 D3DSTENCILCAPS_REPLACE = $00000004;
1949 D3DSTENCILCAPS_INCRSAT = $00000008;
1950 D3DSTENCILCAPS_DECRSAT = $00000010;
1951 D3DSTENCILCAPS_INVERT = $00000020;
1952 D3DSTENCILCAPS_INCR = $00000040;
1953 D3DSTENCILCAPS_DECR = $00000080;
1954
1955 (* D3DDEVICEDESC dwTextureOpCaps *)
1956
1957 D3DTEXOPCAPS_DISABLE = $00000001;
1958 D3DTEXOPCAPS_SELECTARG1 = $00000002;
1959 D3DTEXOPCAPS_SELECTARG2 = $00000004;
1960 D3DTEXOPCAPS_MODULATE = $00000008;
1961 D3DTEXOPCAPS_MODULATE2X = $00000010;
1962 D3DTEXOPCAPS_MODULATE4X = $00000020;
1963 D3DTEXOPCAPS_ADD = $00000040;
1964 D3DTEXOPCAPS_ADDSIGNED = $00000080;
1965 D3DTEXOPCAPS_ADDSIGNED2X = $00000100;
1966 D3DTEXOPCAPS_SUBTRACT = $00000200;
1967 D3DTEXOPCAPS_ADDSMOOTH = $00000400;
1968 D3DTEXOPCAPS_BLENDDIFFUSEALPHA = $00000800;
1969 D3DTEXOPCAPS_BLENDTEXTUREALPHA = $00001000;
1970 D3DTEXOPCAPS_BLENDFACTORALPHA = $00002000;
1971 D3DTEXOPCAPS_BLENDTEXTUREALPHAPM = $00004000;
1972 D3DTEXOPCAPS_BLENDCURRENTALPHA = $00008000;
1973 D3DTEXOPCAPS_PREMODULATE = $00010000;
1974 D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR = $00020000;
1975 D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA = $00040000;
1976 D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR = $00080000;
1977 D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA = $00100000;
1978 D3DTEXOPCAPS_BUMPENVMAP = $00200000;
1979 D3DTEXOPCAPS_BUMPENVMAPLUMINANCE = $00400000;
1980 D3DTEXOPCAPS_DOTPRODUCT3 = $00800000;
1981
1982 (* D3DDEVICEDESC dwFVFCaps flags *)
1983
1984 D3DFVFCAPS_TEXCOORDCOUNTMASK = $0000ffff; (* mask for texture coordinate count field *)
1985 D3DFVFCAPS_DONOTSTRIPELEMENTS = $00080000; (* Device prefers that vertex elements not be stripped *)
1986
1987 (*
1988 * Description for a device.
1989 * This is used to describe a device that is to be created or to query
1990 * the current device.
1991 *)
1992
1993 type
1994 PD3DDeviceDesc = ^TD3DDeviceDesc;
1995 TD3DDeviceDesc = packed record
1996 dwSize: DWORD; (* Size of TD3DDeviceDesc structure *)
1997 dwFlags: DWORD; (* Indicates which fields have valid data *)
1998 dcmColorModel: TD3DColorModel; (* Color model of device *)
1999 dwDevCaps: DWORD; (* Capabilities of device *)
Diff truncated after the static-page render limit. Clone the repository to inspect the complete change.
DeletedDirectX/Direct3DRM.pas +0−2974
@@ -1,2974 +0,0 @@
1 (*==========================================================================;
2 *
3 * Copyright (C) 1994-1997 Microsoft Corporation. All Rights Reserved.
4 *
5 * Files: D3DRMDef.h D3DRMObj.h D3DRM.h D3DRMWin.h RMXFGUID.h RMXFTmpl.h
6 * Content: Direct3D Retained Mode include files
7 *
8 * DirectX 7.0 Delphi adaptation by Erik Unger
9 *
10 * Modified: 30-Apr-2000
11 *
12 * Download: http://www.delphi-jedi.org/DelphiGraphics/
13 * E-Mail: [email protected]
14 *
15 *
16 ***************************************************************************)
17
18 unit Direct3DRM;
19
20 {$MODE Delphi}
21
22 interface
23
24 {$MINENUMSIZE 4}
25 {$ALIGN ON}
26
27 uses
28 Windows,
29 DirectDraw,
30 Direct3D;
31
32 var
33 D3DRMDLL : HMODULE = 0;
34
35 (*==========================================================================;
36 *
37 * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
38 *
39 * File: d3drmdef.h
40 * Content: Direct3DRM include file
41 *
42 ***************************************************************************)
43
44 type
45 PD3DRMVector4D = ^TD3DRMVector4D;
46 TD3DRMVector4D = packed record
47 x, y, z, w: TD3DValue;
48 end;
49
50 PD3DRMMatrix4D = ^TD3DRMMatrix4D;
51 TD3DRMMatrix4D = array [0..3, 0..3] of TD3DValue;
52
53 PD3DRMQuaternion = ^TD3DRMQuaternion;
54 TD3DRMQuaternion = packed record
55 s: TD3DValue;
56 v: TD3DVector;
57 end;
58
59 PD3DRMRay = ^TD3DRMRay;
60 TD3DRMRay = packed record
61 dvDir: TD3DVector;
62 dvPos: TD3DVector;
63 end;
64
65 PD3DRMBox = ^TD3DRMBox;
66 TD3DRMBox = packed record
67 min, max: TD3DVector;
68 end;
69
70 TD3DRMWrapCallback = procedure (var lpD3DVector: TD3DVector;
71 var lpU, lpV: Integer; var lpD3DRMVA, lpD3DRMVB: TD3DVector; lpArg:
72 Pointer); stdcall; // unused ?
73
74 PD3DRMLightType = ^TD3DRMLightType; // is it 16 or 32 bit ?
75 TD3DRMLightType = (
76 D3DRMLIGHT_AMBIENT,
77 D3DRMLIGHT_POINT,
78 D3DRMLIGHT_SPOT,
79 D3DRMLIGHT_DIRECTIONAL,
80 D3DRMLIGHT_PARALLELPOINT
81 );
82
83 PD3DRMShadeMode = ^TD3DRMShadeMode;
84 TD3DRMShadeMode = WORD;
85
86 const
87 D3DRMSHADE_FLAT = 0;
88 D3DRMSHADE_GOURAUD = 1;
89 D3DRMSHADE_PHONG = 2;
90 D3DRMSHADE_MASK = 7;
91 D3DRMSHADE_MAX = 8;
92
93 type
94 PD3DRMLightMode = ^TD3DRMLightMode;
95 TD3DRMLightMode = WORD;
96
97 const
98 D3DRMLIGHT_OFF = 0 * D3DRMSHADE_MAX;
99 D3DRMLIGHT_ON = 1 * D3DRMSHADE_MAX;
100 D3DRMLIGHT_MASK = 7 * D3DRMSHADE_MAX;
101 D3DRMLIGHT_MAX = 8 * D3DRMSHADE_MAX;
102
103 type
104 PD3DRMFillMode = ^TD3DRMFillMode;
105 TD3DRMFillMode = WORD;
106
107 const
108 D3DRMFILL_POINTS = 0 * D3DRMLIGHT_MAX;
109 D3DRMFILL_WIREFRAME = 1 * D3DRMLIGHT_MAX;
110 D3DRMFILL_SOLID = 2 * D3DRMLIGHT_MAX;
111 D3DRMFILL_MASK = 7 * D3DRMLIGHT_MAX;
112 D3DRMFILL_MAX = 8 * D3DRMLIGHT_MAX;
113
114 type
115 PD3DRMRenderQuality = ^TD3DRMRenderQuality;
116 TD3DRMRenderQuality = DWORD;
117
118 const
119 D3DRMRENDER_WIREFRAME =
120 (D3DRMSHADE_FLAT + D3DRMLIGHT_OFF + D3DRMFILL_WIREFRAME);
121 D3DRMRENDER_UNLITFLAT =
122 (D3DRMSHADE_FLAT + D3DRMLIGHT_OFF + D3DRMFILL_SOLID);
123 D3DRMRENDER_FLAT =
124 (D3DRMSHADE_FLAT + D3DRMLIGHT_ON + D3DRMFILL_SOLID);
125 D3DRMRENDER_GOURAUD =
126 (D3DRMSHADE_GOURAUD + D3DRMLIGHT_ON + D3DRMFILL_SOLID);
127 D3DRMRENDER_PHONG =
128 (D3DRMSHADE_PHONG + D3DRMLIGHT_ON + D3DRMFILL_SOLID);
129
130 D3DRMRENDERMODE_BLENDEDTRANSPARENCY = 1;
131 D3DRMRENDERMODE_SORTEDTRANSPARENCY = 2;
132 D3DRMRENDERMODE_LIGHTINMODELSPACE = 8;
133 D3DRMRENDERMODE_VIEWDEPENDENTSPECULAR = 16;
134
135 type
136 PD3DRMTextureQuality = ^TD3DRMTextureQuality;
137 TD3DRMTextureQuality = (
138 D3DRMTEXTURE_NEAREST, (* choose nearest texel *)
139 D3DRMTEXTURE_LINEAR, (* interpolate 4 texels *)
140 D3DRMTEXTURE_MIPNEAREST, (* nearest texel in nearest mipmap *)
141 D3DRMTEXTURE_MIPLINEAR, (* interpolate 2 texels from 2 mipmaps *)
142 D3DRMTEXTURE_LINEARMIPNEAREST, (* interpolate 4 texels in nearest mipmap *)
143 D3DRMTEXTURE_LINEARMIPLINEAR (* interpolate 8 texels from 2 mipmaps *)
144 );
145
146 const
147 (*
148 * Texture flags
149 *)
150 D3DRMTEXTURE_FORCERESIDENT = $00000001; (* texture should be kept in video memory *)
151 D3DRMTEXTURE_STATIC = $00000002; (* texture will not change *)
152 D3DRMTEXTURE_DOWNSAMPLEPOINT = $00000004; (* point filtering should be used when downsampling *)
153 D3DRMTEXTURE_DOWNSAMPLEBILINEAR = $00000008; (* bilinear filtering should be used when downsampling *)
154 D3DRMTEXTURE_DOWNSAMPLEREDUCEDEPTH = $00000010; (* reduce bit depth when downsampling *)
155 D3DRMTEXTURE_DOWNSAMPLENONE = $00000020; (* texture should never be downsampled *)
156 D3DRMTEXTURE_CHANGEDPIXELS = $00000040; (* pixels have changed *)
157 D3DRMTEXTURE_CHANGEDPALETTE = $00000080; (* palette has changed *)
158 D3DRMTEXTURE_INVALIDATEONLY = $00000100; (* dirty regions are invalid *)
159
160 (*
161 * Shadow flags
162 *)
163 D3DRMSHADOW_TRUEALPHA = $00000001; (* shadow should render without artifacts when true alpha is on *)
164
165 type
166 PD3DRMCombineType = ^TD3DRMCombineType;
167 TD3DRMCombineType = (
168 D3DRMCOMBINE_REPLACE,
169 D3DRMCOMBINE_BEFORE,
170 D3DRMCOMBINE_AFTER
171 );
172
173 PD3DRMColorModel = ^TD3DRMColorModel;
174 TD3DRMColorModel = TD3DColorModel;
175
176 PD3DRMPaletteFlags = ^TD3DRMPaletteFlags;
177 TD3DRMPaletteFlags = (
178 D3DRMPALETTE_FREE, (* renderer may use this entry freely *)
179 D3DRMPALETTE_READONLY, (* fixed but may be used by renderer *)
180 D3DRMPALETTE_RESERVED (* may not be used by renderer *)
181 );
182
183 PD3DRMPaletteEntry = ^TD3DRMPaletteEntry;
184 TD3DRMPaletteEntry = packed record
185 red: Byte; (* 0 .. 255 *)
186 green: Byte; (* 0 .. 255 *)
187 blue: Byte; (* 0 .. 255 *)
188 flags: Byte; (* one of D3DRMPALETTEFLAGS *)
189 end;
190
191 PD3DRMImage = ^TD3DRMImage;
192 TD3DRMImage = packed record
193 width, height: Integer; (* width and height in pixels *)
194 aspectx, aspecty: Integer; (* aspect ratio for non-square pixels *)
195 depth: Integer; (* bits per pixel *)
196 rgb: Integer; (* if false, pixels are indices into a
197 palette otherwise, pixels encode
198 RGB values. *)
199 bytes_per_line: Integer; (* number of bytes of memory for a
200 scanline. This must be a multiple
201 of 4. *)
202 buffer1: Pointer; (* memory to render into (first buffer). *)
203 buffer2: Pointer; (* second rendering buffer for double
204 buffering, set to NULL for single
205 buffering. *)
206 red_mask: DWORD;
207 green_mask: DWORD;
208 blue_mask: DWORD;
209 alpha_mask: DWORD; (* if rgb is true, these are masks for
210 the red, green and blue parts of a
211 pixel. Otherwise, these are masks
212 for the significant bits of the
213 red, green and blue elements in the
214 palette. For instance, most SVGA
215 displays use 64 intensities of red,
216 green and blue, so the masks should
217 all be set to = $fc. *)
218 palette_size: Integer; (* number of entries in palette *)
219 palette: PD3DRMPaletteEntry; (* description of the palette (only if
220 rgb is false). Must be (1<<depth)
221 elements. *)
222 end;
223
224 PD3DRMWrapType = ^TD3DRMWrapType;
225 TD3DRMWrapType = (
226 D3DRMWRAP_FLAT,
227 D3DRMWRAP_CYLINDER,
228 D3DRMWRAP_SPHERE,
229 D3DRMWRAP_CHROME,
230 D3DRMWRAP_SHEET,
231 D3DRMWRAP_BOX
232 );
233
234 const
235 D3DRMWIREFRAME_CULL = 1; (* cull backfaces *)
236 D3DRMWIREFRAME_HIDDENLINE = 2; (* lines are obscured by closer objects *)
237
238 type
239 (*
240 * Do not use righthanded perspective in Viewport2::SetProjection().
241 * Set up righthanded mode by using IDirect3DRM3::SetOptions().
242 *)
243 PD3DRMProjectionType = ^TD3DRMProjectionType;
244 TD3DRMProjectionType = (
245 D3DRMPROJECT_PERSPECTIVE,
246 D3DRMPROJECT_ORTHOGRAPHIC,
247 D3DRMPROJECT_RIGHTHANDPERSPECTIVE, (* Only valid pre-DX6 *)
248 D3DRMPROJECT_RIGHTHANDORTHOGRAPHIC (* Only valid pre-DX6 *)
249 );
250
251 const
252 D3DRMOPTIONS_LEFTHANDED = 00000001; (* Default *)
253 D3DRMOPTIONS_RIGHTHANDED = 00000002;
254
255 type
256 PD3DRMXOFFormat = ^TD3DRMXOFFormat;
257 TD3DRMXOFFormat = (
258 D3DRMXOF_BINARY,
259 D3DRMXOF_COMPRESSED,
260 D3DRMXOF_TEXT
261 );
262
263 TD3DRMSaveOptions = DWORD;
264 const
265 D3DRMXOFSAVE_NORMALS = 1;
266 D3DRMXOFSAVE_TEXTURECOORDINATES = 2;
267 D3DRMXOFSAVE_MATERIALS = 4;
268 D3DRMXOFSAVE_TEXTURENAMES = 8;
269 D3DRMXOFSAVE_ALL = 15;
270 D3DRMXOFSAVE_TEMPLATES = 16;
271 D3DRMXOFSAVE_TEXTURETOPOLOGY = 32;
272
273 type
274 PD3DRMColorSource = ^TD3DRMColorSource;
275 TD3DRMColorSource = (
276 D3DRMCOLOR_FROMFACE,
277 D3DRMCOLOR_FROMVERTEX
278 );
279
280 PD3DRMFrameConstraint = ^TD3DRMFrameConstraint;
281 TD3DRMFrameConstraint = (
282 D3DRMCONSTRAIN_Z, (* use only X and Y rotations *)
283 D3DRMCONSTRAIN_Y, (* use only X and Z rotations *)
284 D3DRMCONSTRAIN_X (* use only Y and Z rotations *)
285 );
286
287 PD3DRMMaterialMode = ^TD3DRMMaterialMode;
288 TD3DRMMaterialMode = (
289 D3DRMMATERIAL_FROMMESH,
290 D3DRMMATERIAL_FROMPARENT,
291 D3DRMMATERIAL_FROMFRAME
292 );
293
294 PD3DRMFogMode = ^TD3DRMFogMode;
295 TD3DRMFogMode = (
296 D3DRMFOG_LINEAR, (* linear between start and end *)
297 D3DRMFOG_EXPONENTIAL, (* density * exp(-distance) *)
298 D3DRMFOG_EXPONENTIALSQUARED (* density * exp(-distance*distance) *)
299 );
300
301 PD3DRMZBufferMode = ^TD3DRMZBufferMode;
302 TD3DRMZBufferMode = (
303 D3DRMZBUFFER_FROMPARENT, (* default *)
304 D3DRMZBUFFER_ENABLE, (* enable zbuffering *)
305 D3DRMZBUFFER_DISABLE (* disable zbuffering *)
306 );
307
308 PD3DRMSortMode = ^TD3DRMSortMode;
309 TD3DRMSortMode = (
310 D3DRMSORT_FROMPARENT, (* default *)
311 D3DRMSORT_NONE, (* don't sort child frames *)
312 D3DRMSORT_FRONTTOBACK, (* sort child frames front-to-back *)
313 D3DRMSORT_BACKTOFRONT (* sort child frames back-to-front *)
314 );
315
316 TD3DRMMaterialOverride = packed record
317 dwSize : DWORD; (* Size of this structure *)
318 dwFlags : DWORD; (* Indicate which fields are valid *)
319 dcDiffuse : TD3DColorValue; (* RGBA *)
320 dcAmbient : TD3DColorValue; (* RGB *)
321 dcEmissive : TD3DColorValue; (* RGB *)
322 dcSpecular : TD3DColorValue; (* RGB *)
323 dvPower : TD3DValue;
324 lpD3DRMTex : IUnknown;
325 end;
326
327 const
328 D3DRMMATERIALOVERRIDE_DIFFUSE_ALPHAONLY = $00000001;
329 D3DRMMATERIALOVERRIDE_DIFFUSE_RGBONLY = $00000002;
330 D3DRMMATERIALOVERRIDE_DIFFUSE = $00000003;
331 D3DRMMATERIALOVERRIDE_AMBIENT = $00000004;
332 D3DRMMATERIALOVERRIDE_EMISSIVE = $00000008;
333 D3DRMMATERIALOVERRIDE_SPECULAR = $00000010;
334 D3DRMMATERIALOVERRIDE_POWER = $00000020;
335 D3DRMMATERIALOVERRIDE_TEXTURE = $00000040;
336 D3DRMMATERIALOVERRIDE_DIFFUSE_ALPHAMULTIPLY = $00000080;
337 D3DRMMATERIALOVERRIDE_ALL = $000000FF;
338
339 D3DRMFPTF_ALPHA = $00000001;
340 D3DRMFPTF_NOALPHA = $00000002;
341 D3DRMFPTF_PALETTIZED = $00000004;
342 D3DRMFPTF_NOTPALETTIZED = $00000008;
343
344 D3DRMSTATECHANGE_UPDATEONLY = $000000001;
345 D3DRMSTATECHANGE_VOLATILE = $000000002;
346 D3DRMSTATECHANGE_NONVOLATILE = $000000004;
347 D3DRMSTATECHANGE_RENDER = $000000020;
348 D3DRMSTATECHANGE_LIGHT = $000000040;
349
350 (*
351 * Values for flags in RM3::CreateDeviceFromSurface
352 *)
353 D3DRMDEVICE_NOZBUFFER = $00000001;
354
355 (*
356 * Values for flags in Object2::SetClientData
357 *)
358 D3DRMCLIENTDATA_NONE = $00000001;
359 D3DRMCLIENTDATA_LOCALFREE = $00000002;
360 D3DRMCLIENTDATA_IUNKNOWN = $00000004;
361
362 (*
363 * Values for flags in Frame2::AddMoveCallback.
364 *)
365 D3DRMCALLBACK_PREORDER = 0;
366 D3DRMCALLBACK_POSTORDER = 1;
367
368 (*
369 * Values for flags in MeshBuilder2::RayPick.
370 *)
371 D3DRMRAYPICK_ONLYBOUNDINGBOXES = 1;
372 D3DRMRAYPICK_IGNOREFURTHERPRIMITIVES = 2;
373 D3DRMRAYPICK_INTERPOLATEUV = 4;
374 D3DRMRAYPICK_INTERPOLATECOLOR = 8;
375 D3DRMRAYPICK_INTERPOLATENORMAL = $10;
376
377 (*
378 * Values for flags in MeshBuilder3::AddFacesIndexed.
379 *)
380 D3DRMADDFACES_VERTICESONLY = 1;
381
382 (*
383 * Values for flags in MeshBuilder2::GenerateNormals.
384 *)
385 D3DRMGENERATENORMALS_PRECOMPACT = 1;
386 D3DRMGENERATENORMALS_USECREASEANGLE = 2;
387
388 (*
389 * Values for MeshBuilder3::GetParentMesh
390 *)
391 D3DRMMESHBUILDER_DIRECTPARENT = 1;
392 D3DRMMESHBUILDER_ROOTMESH = 2;
393
394 (*
395 * Flags for MeshBuilder3::Enable
396 *)
397 D3DRMMESHBUILDER_RENDERENABLE = $00000001;
398 D3DRMMESHBUILDER_PICKENABLE = $00000002;
399
400 (*
401 * Flags for Object2::GetAge when used with MeshBuilders
402 *)
403 D3DRMMESHBUILDERAGE_GEOMETRY = $00000001;
404 D3DRMMESHBUILDERAGE_MATERIALS = $00000002;
405 D3DRMMESHBUILDERAGE_TEXTURES = $00000004;
406
407 (*
408 * Format flags for MeshBuilder3::AddTriangles.
409 *)
410 D3DRMFVF_TYPE = $00000001;
411 D3DRMFVF_NORMAL = $00000002;
412 D3DRMFVF_COLOR = $00000004;
413 D3DRMFVF_TEXTURECOORDS = $00000008;
414
415 D3DRMVERTEX_STRIP = $00000001;
416 D3DRMVERTEX_FAN = $00000002;
417 D3DRMVERTEX_LIST = $00000004;
418
419 (*
420 * Values for flags in Viewport2::Clear2
421 *)
422 D3DRMCLEAR_TARGET = $00000001;
423 D3DRMCLEAR_ZBUFFER = $00000002;
424 D3DRMCLEAR_DIRTYRECTS = $00000004;
425 D3DRMCLEAR_ALL = (D3DRMCLEAR_TARGET or
426 D3DRMCLEAR_ZBUFFER or
427 D3DRMCLEAR_DIRTYRECTS);
428
429 (*
430 * Values for flags in Frame3::SetSceneFogMethod
431 *)
432 D3DRMFOGMETHOD_VERTEX = $00000001;
433 D3DRMFOGMETHOD_TABLE = $00000002;
434 D3DRMFOGMETHOD_ANY = $00000004;
435
436 (*
437 * Values for flags in Frame3::SetTraversalOptions
438 *)
439 D3DRMFRAME_RENDERENABLE = $00000001;
440 D3DRMFRAME_PICKENABLE = $00000002;
441
442 type
443 TD3DRMAnimationOptions = DWORD;
444
445 const
446 D3DRMANIMATION_OPEN = $01;
447 D3DRMANIMATION_CLOSED = $02;
448 D3DRMANIMATION_LINEARPOSITION = $04;
449 D3DRMANIMATION_SPLINEPOSITION = $08;
450 D3DRMANIMATION_SCALEANDROTATION = $00000010;
451 D3DRMANIMATION_POSITION = $00000020;
452
453 type
454 TD3DRMInterpolationOptions = DWORD;
455 const
456 D3DRMINTERPOLATION_OPEN = $01;
457 D3DRMINTERPOLATION_CLOSED = $02;
458 D3DRMINTERPOLATION_NEAREST = $0100;
459 D3DRMINTERPOLATION_LINEAR = $04;
460 D3DRMINTERPOLATION_SPLINE = $08;
461 D3DRMINTERPOLATION_VERTEXCOLOR = $40;
462 D3DRMINTERPOLATION_SLERPNORMALS = $80;
463
464 type
465 TD3DRMLoadOptions = DWORD;
466
467 const
468 D3DRMLOAD_FROMFILE = $00;
469 D3DRMLOAD_FROMRESOURCE = $01;
470 D3DRMLOAD_FROMMEMORY = $02;
471 D3DRMLOAD_FROMSTREAM = $04;
472 D3DRMLOAD_FROMURL = $08;
473
474 D3DRMLOAD_BYNAME = $10;
475 D3DRMLOAD_BYPOSITION = $20;
476 D3DRMLOAD_BYGUID = $40;
477 D3DRMLOAD_FIRST = $80;
478
479 D3DRMLOAD_INSTANCEBYREFERENCE = $100;
480 D3DRMLOAD_INSTANCEBYCOPYING = $200;
481
482 D3DRMLOAD_ASYNCHRONOUS = $400;
483
484 type
485 PD3DRMLoadResource = ^TD3DRMLoadResource;
486 TD3DRMLoadResource = packed record
487 hModule: HMODULE;
488 lpName: PAnsiChar;
489 lpType: PAnsiChar;
490 end;
491
492 PD3DRMLoadMemory = ^TD3DRMLoadMemory;
493 TD3DRMLoadMemory = packed record
494 lpMemory: Pointer;
495 dwSize: DWORD;
496 end;
497
498 const
499 D3DRMPMESHSTATUS_VALID = $01;
500 D3DRMPMESHSTATUS_INTERRUPTED = $02;
501 D3DRMPMESHSTATUS_BASEMESHCOMPLETE = $04;
502 D3DRMPMESHSTATUS_COMPLETE = $08;
503 D3DRMPMESHSTATUS_RENDERABLE = $10;
504
505 D3DRMPMESHEVENT_BASEMESH = $01;
506 D3DRMPMESHEVENT_COMPLETE = $02;
507
508 type
509 PD3DRMPMeshLoadStatus = ^TD3DRMPMeshLoadStatus;
510 TD3DRMPMeshLoadStatus = packed record
511 dwSize, // Size of this structure
512 dwPMeshSize, // Total Size (bytes)
513 dwBaseMeshSize, // Total Size of the Base Mesh
514 dwBytesLoaded, // Total bytes loaded
515 dwVerticesLoaded, // Number of vertices loaded
516 dwFacesLoaded : DWORD; // Number of faces loaded
517 dwLoadResult : HResult; // Result of the load operation
518 dwFlags : DWORD;
519 end;
520
521 PD3DRMUserVisualReason = ^TD3DRMUserVisualReason;
522 TD3DRMUserVisualReason = (
523 D3DRMUSERVISUAL_CANSEE,
524 D3DRMUSERVISUAL_RENDER
525 );
526
527 PD3DRMAnimationKey = ^TD3DRMAnimationKey;
528 TD3DRMAnimationKey = packed record
529 dwSize : DWORD;
530 dwKeyType : DWORD;
531 dvTime : TD3DValue;
532 dwID : DWORD;
533 case integer of
534 0 : (dqRotateKey : TD3DRMQuaternion);
535 1 : (dvScaleKey : TD3DVector);
536 2 : (dvPositionKey : TD3DVector);
537 3 : (dvK : array [0..3] of TD3DValue);
538 end;
539
540 procedure D3DRMAnimationGetRotateKey
541 (var rmKey: TD3DRMAnimationKey; var rmQuat: TD3DRMQuaternion);
542
543 procedure D3DRMAnimationGetScaleKey
544 (var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
545
546 procedure D3DRMAnimationGetPositionKey
547 (var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
548
549 procedure D3DRMAnimatioSetRotateKey
550 (var rmKey: TD3DRMAnimationKey; var rmQuat: TD3DRMQuaternion);
551
552 procedure D3DRMAnimationSetScaleKey
553 (var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
554
555 procedure D3DRMAnimationSetPositionKey
556 (var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
557
558 const
559 D3DRMANIMATION_ROTATEKEY = 01;
560 D3DRMANIMATION_SCALEKEY = 02;
561 D3DRMANIMATION_POSITIONKEY = 03;
562
563 type
564 TD3DRMMapping = DWORD;
565 PD3DRMMappingFlag = ^TD3DRMMappingFlag;
566 TD3DRMMappingFlag = DWORD;
567
568 const
569 D3DRMMAP_WRAPU = 1;
570 D3DRMMAP_WRAPV = 2;
571 D3DRMMAP_PERSPCORRECT = 4;
572
573 type
574 PD3DRMVertex = ^TD3DRMVertex;
575 TD3DRMVertex = packed record
576 position: TD3DVector;
577 normal: TD3DVector;
578 tu, tv: TD3DValue;
579 color: TD3DColor;
580 end;
581
582 TD3DRMGroupIndex = LongInt; (* group indexes begin a 0 *)
583
584 const
585 D3DRMGROUP_ALLGROUPS = -1;
586
587 var
588 (*
589 * Create a color from three components in the range 0-1 inclusive.
590 *)
591 D3DRMCreateColorRGB : function (red, green, blue: TD3DValue) : TD3DColor;
592 stdcall;
593
594 (*
595 * Create a color from four components in the range 0-1 inclusive.
596 *)
597 D3DRMCreateColorRGBA : function (red, green, blue, alpha: TD3DValue)
598 : TD3DColor; stdcall;
599
600 (*
601 * Get the red component of a color.
602 *)
603 D3DRMColorGetRed : function (d3drmc: TD3DColor) : TD3DValue; stdcall;
604
605 (*
606 * Get the green component of a color.
607 *)
608 D3DRMColorGetGreen : function (d3drmc: TD3DColor) : TD3DValue; stdcall;
609
610 (*
611 * Get the blue component of a color.
612 *)
613 D3DRMColorGetBlue : function (d3drmc: TD3DColor) : TD3DValue; stdcall;
614
615 (*
616 * Get the alpha component of a color.
617 *)
618 D3DRMColorGetAlpha : function (d3drmc: TD3DColor) : TD3DValue; stdcall;
619
620 (*
621 * Add two vectors. Returns its first argument.
622 *)
623 D3DRMVectorAdd : function (var d, s1, s2: TD3DVector) : PD3DVector; stdcall;
624
625 (*
626 * Subtract two vectors. Returns its first argument.
627 *)
628 D3DRMVectorSubtract : function (var d, s1, s2: TD3DVector) : PD3DVector;
629 stdcall;
630
631 (*
632 * Reflect a ray about a given normal. Returns its first argument.
633 *)
634 D3DRMVectorReflect : function (var d, ray, norm: TD3DVector) : PD3DVector;
635 stdcall;
636
637 (*
638 * Calculate the vector cross product. Returns its first argument.
639 *)
640 D3DRMVectorCrossProduct : function (var d, s1, s2: TD3DVector) : PD3DVector;
641 stdcall;
642
643 (*
644 * Return the vector dot product.
645 *)
646 D3DRMVectorDotProduct : function (var s1, s2: TD3DVector) : TD3DValue;
647 stdcall;
648
649 (*
650 * Scale a vector so that its modulus is 1. Returns its argument or
651 * NULL if there was an error (e.g. a zero vector was passed).
652 *)
653 D3DRMVectorNormalize : function (var lpv: TD3DVector) : PD3DVector; stdcall;
654
655 (*
656 * Return the length of a vector (e.g. sqrt(x*x + y*y + z*z)).
657 *)
658 D3DRMVectorModulus : function (var v: TD3DVector) : TD3DValue; stdcall;
659
660 (*
661 * Set the rotation part of a matrix to be a rotation of theta radians
662 * around the given axis.
663 *)
664 D3DRMVectorRotate : function (var r, v, axis: TD3DVector; theta: TD3DValue) :
665 PD3DVector; stdcall;
666
667 (*
668 * Scale a vector uniformly in all three axes
669 *)
670 D3DRMVectorScale : function (var d, s: TD3DVector; factor: TD3DValue) :
671 PD3DVector; stdcall;
672
673 (*
674 * Return a random unit vector
675 *)
676 D3DRMVectorRandom : function (var d: TD3DVector) : PD3DVector; stdcall;
677
678 (*
679 * Returns a unit quaternion that represents a rotation of theta radians
680 * around the given axis.
681 *)
682
683 D3DRMQuaternionFromRotation : function (var quat: TD3DRMQuaternion;
684 var v: TD3DVector; theta: TD3DValue) : PD3DRMQuaternion; stdcall;
685
686 (*
687 * Calculate the product of two quaternions
688 *)
689 D3DRMQuaternionMultiply : function (var q, a, b: TD3DRMQuaternion) :
690 PD3DRMQuaternion; stdcall;
691
692 (*
693 * Interpolate between two quaternions
694 *)
695 D3DRMQuaternionSlerp : function (var q, a, b: TD3DRMQuaternion;
696 alpha: TD3DValue) : PD3DRMQuaternion; stdcall;
697
698 (*
699 * Calculate the matrix for the rotation that a unit quaternion represents
700 *)
701 D3DRMMatrixFromQuaternion : procedure (dmMat: TD3DRMMatrix4D; var lpDqQuat:
702 TD3DRMQuaternion); stdcall;
703
704 (*
705 * Calculate the quaternion that corresponds to a rotation matrix
706 *)
707 D3DRMQuaternionFromMatrix : function (var lpQuat: TD3DRMQuaternion;
708 Mat: TD3DRMMatrix4D) : PD3DRMQuaternion; stdcall;
709
710 (*==========================================================================;
711 *
712 * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
713 *
714 * File: d3drmobj.h
715 * Content: Direct3DRM include file
716 *
717 ***************************************************************************)
718
719 (*
720 * Direct3DRM Object classes
721 *)
722
723 const
724 CLSID_CDirect3DRMDevice: TGUID =
725 (D1:$4fa3568e;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
726 CLSID_CDirect3DRMViewport: TGUID =
727 (D1:$4fa3568f;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
728 CLSID_CDirect3DRMFrame: TGUID =
729 (D1:$4fa35690;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
730 CLSID_CDirect3DRMMesh: TGUID =
731 (D1:$4fa35691;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
732 CLSID_CDirect3DRMMeshBuilder: TGUID =
733 (D1:$4fa35692;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
734 CLSID_CDirect3DRMFace: TGUID =
735 (D1:$4fa35693;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
736 CLSID_CDirect3DRMLight: TGUID =
737 (D1:$4fa35694;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
738 CLSID_CDirect3DRMTexture: TGUID =
739 (D1:$4fa35695;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
740 CLSID_CDirect3DRMWrap: TGUID =
741 (D1:$4fa35696;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
742 CLSID_CDirect3DRMMaterial: TGUID =
743 (D1:$4fa35697;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
744 CLSID_CDirect3DRMAnimation: TGUID =
745 (D1:$4fa35698;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
746 CLSID_CDirect3DRMAnimationSet: TGUID =
747 (D1:$4fa35699;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
748 CLSID_CDirect3DRMUserVisual: TGUID =
749 (D1:$4fa3569a;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
750 CLSID_CDirect3DRMShadow: TGUID =
751 (D1:$4fa3569b;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
752 CLSID_CDirect3DRMViewportInterpolator: TGUID =
753 (D1:$0de9eaa1;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
754 CLSID_CDirect3DRMFrameInterpolator: TGUID =
755 (D1:$0de9eaa2;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
756 CLSID_CDirect3DRMMeshInterpolator: TGUID =
757 (D1:$0de9eaa3;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
758 CLSID_CDirect3DRMLightInterpolator: TGUID =
759 (D1:$0de9eaa6;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
760 CLSID_CDirect3DRMMaterialInterpolator: TGUID =
761 (D1:$0de9eaa7;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
762 CLSID_CDirect3DRMTextureInterpolator: TGUID =
763 (D1:$0de9eaa8;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
764 CLSID_CDirect3DRMProgressiveMesh: TGUID =
765 (D1:$4516ec40;D2:$8f20;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
766 CLSID_CDirect3DRMClippedVisual: TGUID =
767 (D1:$5434e72d;D2:$6d66;D3:$11d1;D4:($bb,$0b,$00,$00,$f8,$75,$86,$5a));
768
769
770
771 type
772 IDirect3DRMObject = interface;
773 IDirect3DRMDevice = interface;
774 IDirect3DRMDevice2 = interface;
775 IDirect3DRMDevice3 = interface;
776 IDirect3DRMViewport = interface;
777 IDirect3DRMViewport2 = interface;
778 IDirect3DRMFrame = interface;
779 IDirect3DRMFrame2 = interface;
780 IDirect3DRMFrame3 = interface;
781 IDirect3DRMVisual = interface;
782 IDirect3DRMMesh = interface;
783 IDirect3DRMMeshBuilder = interface;
784 IDirect3DRMMeshBuilder2 = interface;
785 IDirect3DRMMeshBuilder3 = interface;
786 IDirect3DRMFace = interface;
787 IDirect3DRMFace2 = interface;
788 IDirect3DRMLight = interface;
789 IDirect3DRMTexture = interface;
790 IDirect3DRMTexture2 = interface;
791 IDirect3DRMTexture3 = interface;
792 IDirect3DRMWrap = interface;
793 IDirect3DRMMaterial = interface;
794 IDirect3DRMMaterial2 = interface;
795 IDirect3DRMAnimation = interface;
796 IDirect3DRMAnimation2 = interface;
797 IDirect3DRMAnimationSet = interface;
798 IDirect3DRMAnimationSet2 = interface;
799 IDirect3DRMArray = interface;
800 IDirect3DRMObjectArray = interface;
801 IDirect3DRMDeviceArray = interface;
802 IDirect3DRMViewportArray = interface;
803 IDirect3DRMFrameArray = interface;
804 IDirect3DRMVisualArray = interface;
805 IDirect3DRMLightArray = interface;
806 IDirect3DRMPickedArray = interface;
807 IDirect3DRMFaceArray = interface;
808 IDirect3DRMAnimationArray = interface;
809 IDirect3DRMUserVisual = interface;
810 IDirect3DRMShadow = interface;
811 IDirect3DRMShadow2 = interface;
812 IDirect3DRMInterpolator = interface;
813 IDirect3DRMProgressiveMesh = interface;
814 IDirect3DRMPicked2Array = interface;
815 IDirect3DRMClippedVisual = interface;
816
817 (*
818 * Direct3DRM Object interfaces
819 *)
820 IID_IDirect3DRMObject = IDirect3DRMObject;
821 IID_IDirect3DRMDevice = IDirect3DRMDevice;
822 IID_IDirect3DRMDevice2 = IDirect3DRMDevice2;
823 IID_IDirect3DRMDevice3 = IDirect3DRMDevice3;
824 IID_IDirect3DRMViewport = IDirect3DRMViewport;
825 IID_IDirect3DRMViewport2 = IDirect3DRMViewport2;
826 IID_IDirect3DRMFrame = IDirect3DRMFrame;
827 IID_IDirect3DRMFrame2 = IDirect3DRMFrame2;
828 IID_IDirect3DRMFrame3 = IDirect3DRMFrame3;
829 IID_IDirect3DRMVisual = IDirect3DRMVisual;
830 IID_IDirect3DRMMesh = IDirect3DRMMesh;
831 IID_IDirect3DRMMeshBuilder = IDirect3DRMMeshBuilder;
832 IID_IDirect3DRMMeshBuilder2 = IDirect3DRMMeshBuilder2;
833 IID_IDirect3DRMMeshBuilder3 = IDirect3DRMMeshBuilder3;
834 IID_IDirect3DRMFace = IDirect3DRMFace;
835 IID_IDirect3DRMFace2 = IDirect3DRMFace2;
836 IID_IDirect3DRMLight = IDirect3DRMLight;
837 IID_IDirect3DRMTexture = IDirect3DRMTexture;
838 IID_IDirect3DRMTexture2 = IDirect3DRMTexture2;
839 IID_IDirect3DRMTexture3 = IDirect3DRMTexture3;
840 IID_IDirect3DRMWrap = IDirect3DRMWrap;
841 IID_IDirect3DRMMaterial = IDirect3DRMMaterial;
842 IID_IDirect3DRMMaterial2 = IDirect3DRMMaterial2;
843 IID_IDirect3DRMAnimation = IDirect3DRMAnimation;
844 IID_IDirect3DRMAnimation2 = IDirect3DRMAnimation2;
845 IID_IDirect3DRMAnimationSet = IDirect3DRMAnimationSet;
846 IID_IDirect3DRMAnimationSet2 = IDirect3DRMAnimationSet2;
847 IID_IDirect3DRMObjectArray = IDirect3DRMObjectArray;
848 IID_IDirect3DRMDeviceArray = IDirect3DRMDeviceArray;
849 IID_IDirect3DRMViewportArray = IDirect3DRMViewportArray;
850 IID_IDirect3DRMFrameArray = IDirect3DRMFrameArray;
851 IID_IDirect3DRMVisualArray = IDirect3DRMVisualArray;
852 IID_IDirect3DRMLightArray = IDirect3DRMLightArray;
853 IID_IDirect3DRMPickedArray = IDirect3DRMPickedArray;
854 IID_IDirect3DRMFaceArray = IDirect3DRMFaceArray;
855 IID_IDirect3DRMAnimationArray = IDirect3DRMAnimationArray;
856 IID_IDirect3DRMUserVisual = IDirect3DRMUserVisual;
857 IID_IDirect3DRMShadow = IDirect3DRMShadow;
858 IID_IDirect3DRMShadow2 = IDirect3DRMShadow2;
859 IID_IDirect3DRMInterpolator = IDirect3DRMInterpolator;
860 IID_IDirect3DRMProgressiveMesh = IDirect3DRMProgressiveMesh;
861 IID_IDirect3DRMPicked2Array = IDirect3DRMPicked2Array;
862 IID_IDirect3DRMClippedVisual = IDirect3DRMClippedVisual;
863
864
865
866
867
868 PIDirect3DRMFaceArray = ^IDirect3DRMFaceArray;
869
870 TD3DRMObjectCallback = procedure (lpD3DRMobj: IDirect3DRMObject;
871 lpArg: Pointer); cdecl;
872 TD3DRMFrameMoveCallback = procedure (lpD3DRMFrame: IDirect3DRMFrame;
873 lpArg: Pointer; delta: TD3DValue); cdecl;
874 TD3DRMFrame3MoveCallback = procedure (lpD3DRMFrame: IDirect3DRMFrame3;
875 lpArg: Pointer; delta: TD3DValue); cdecl;
876 TD3DRMUpdateCallback = procedure (lpobj: IDirect3DRMDevice; lpArg: Pointer;
877 iRectCount: Integer; const d3dRectUpdate: TD3DRect); cdecl;
878 TD3DRMDevice3UpdateCallback = procedure (lpobj: IDirect3DRMDevice3;
879 lpArg: Pointer; iRectCount: Integer; const d3dRectUpdate: TD3DRect);cdecl;
880 TD3DRMUserVisualCallback = function (lpD3DRMUV: IDirect3DRMUserVisual;
881 lpArg: Pointer; lpD3DRMUVreason: TD3DRMUserVisualReason;
882 lpD3DRMDev: IDirect3DRMDevice;
883 lpD3DRMview: IDirect3DRMViewport) : Integer; cdecl;
884 TD3DRMLoadTextureCallback = function (tex_name: PAnsiChar; lpArg: Pointer;
885 out lpD3DRMTex: IDirect3DRMTexture) : HResult; cdecl;
886 TD3DRMLoadTexture3Callback = function (tex_name: PAnsiChar; lpArg: Pointer;
887 out lpD3DRMTex: IDirect3DRMTexture3) : HResult; cdecl;
888 TD3DRMLoadCallback = procedure (lpObject: IDirect3DRMObject;
889 const ObjectGuid: TGUID; lpArg: Pointer); cdecl;
890 TD3DRMDownSampleCallback = function (lpDirect3DRMTexture: IDirect3DRMTexture3;
891 pArg: pointer; pDDSSrc, pDDSDst: IDirectDrawSurface) : HResult; cdecl;
892 TD3DRMValidationCallback = function (lpDirect3DRMTexture: IDirect3DRMTexture3;
893 pArg: pointer; dwFlags, DWcRects: DWORD; const pRects: TRect) : HResult; cdecl;
894
895 PD3DRMPickDesc = ^TD3DRMPickDesc;
896 TD3DRMPickDesc = packed record
897 ulFaceIdx: DWORD;
898 lGroupIdx: LongInt;
899 vPosition: TD3DVector;
900 end;
901
902 PD3DRMPickDesc2 = ^TD3DRMPickDesc2;
903 TD3DRMPickDesc2 = packed record
904 ulFaceIdx: DWORD;
905 lGroupIdx: LongInt;
906 dvPosition: TD3DVector;
907 tu, tv: TD3DValue;
908 dvNormal: TD3DVector;
909 dcColor: TD3DColor;
910 end;
911
912 (*
913 * Base class
914 *)
915 {$IFDEF D2COM}
916 IDirect3DRMObject = class (IUnknown)
917 {$ELSE}
918 IDirect3DRMObject = interface (IUnknown)
919 ['{eb16cb00-d271-11ce-ac48-0000c03825a1}']
920 {$ENDIF}
921 (*
922 * The methods for IDirect3DRMObject
923 *)
924 function Clone (pUnkOuter: IUnknown; riid: TGUID;
925 var ppvObj: Pointer) : HResult; stdcall;
926 function AddDestroyCallback (lpCallback: TD3DRMObjectCallback;
927 lpArg: Pointer) : HResult; stdcall;
928 function DeleteDestroyCallback (d3drmObjProc: TD3DRMObjectCallback;
929 lpArg: Pointer) : HResult; stdcall;
930 function SetAppData (ulData: DWORD) : HResult; stdcall;
931 function GetAppData: DWORD; stdcall;
932 function SetName (lpName: PAnsiChar) : HResult; stdcall;
933 function GetName (var lpdwSize: DWORD; lpName: PAnsiChar) : HResult; stdcall;
934 function GetClassName (var lpdwSize: DWORD; lpName: PAnsiChar) : HResult; stdcall;
935 end;
936
937 IDirect3DRMVisual = interface (IDirect3DRMObject)
938 end;
939
940 IDirect3DRMDevice = interface (IDirect3DRMObject)
941 ['{e9e19280-6e05-11cf-ac4a-0000c03825a1}']
942 (*
943 * IDirect3DRMDevice methods
944 *)
945 function Init (width: LongInt; height: LongInt) : HResult; stdcall;
946 function InitFromD3D (lpD3D: IDirect3D; lpD3DIMDev: IDirect3DDevice) : HResult; stdcall;
947 function InitFromClipper (lpDDClipper: IDirectDrawClipper; lpGUID: PGUID;
948 width: Integer; height: Integer) : HResult; stdcall;
949 function Update: HResult; stdcall;
950 function AddUpdateCallback (d3drmUpdateProc: TD3DRMUpdateCallback;
951 arg: Pointer) : HResult; stdcall;
952 function DeleteUpdateCallback (d3drmUpdateProc: TD3DRMUpdateCallback;
953 arg: Pointer) : HResult; stdcall;
954 function SetBufferCount (dwCount: DWORD) : HResult; stdcall;
955 function GetBufferCount: DWORD; stdcall;
956 function SetDither (bDither: BOOL) : HResult; stdcall;
957 function SetShades (ulShades: DWORD) : HResult; stdcall;
958 function SetQuality (rqQuality: TD3DRMRenderQuality) : HResult; stdcall;
959 function SetTextureQuality (tqTextureQuality: TD3DRMTextureQuality) : HResult; stdcall;
960 function GetViewports (out lplpViewports: IDirect3DRMViewportArray) : HResult; stdcall;
961 function GetDither: BOOL; stdcall;
962 function GetShades: DWORD; stdcall;
963 function GetHeight: DWORD; stdcall;
964 function GetWidth: DWORD; stdcall;
965 function GetTrianglesDrawn: DWORD; stdcall;
966 function GetWireframeOptions: DWORD; stdcall;
967 function GetQuality: TD3DRMRenderQuality; stdcall;
968 function GetColorModel: TD3DColorModel; stdcall;
969 function GetTextureQuality: TD3DRMTextureQuality; stdcall;
970 function GetDirect3DDevice (out lplpD3DDevice: IDirect3DDevice) : HResult; stdcall;
971 end;
972
973 IDirect3DRMDevice2 = interface (IDirect3DRMDevice)
974 ['{4516ec78-8f20-11d0-9b6d-0000c0781bc3}']
975 (*
976 * IDirect3DRMDevice2 methods
977 *)
978 function InitFromD3D2(lpD3D: IDirect3D2; lpD3DIMDev: IDirect3DDevice2) : HResult; stdcall;
979 function InitFromSurface(const lpGUID: TGUID; lpDD: IDirectDraw; lpDDSBack: IDirectDrawSurface) : HResult; stdcall;
980 function SetRenderMode(dwFlags: DWORD ) : HResult; stdcall;
981 function GetRenderMode : DWORD; stdcall;
982 function GetDirect3DDevice2(out lplpD3DDevice: IDirect3DDevice2) : HResult; stdcall;
983 end;
984
985 IDirect3DRMDevice3 = interface (IDirect3DRMObject)
986 ['{549f498b-bfeb-11d1-8ed8-00a0c967a482}']
987 (*
988 * IDirect3DRMDevice methods
989 *)
990 function Init (width: LongInt; height: LongInt) : HResult; stdcall;
991 function InitFromD3D (lpD3D: IDirect3D2; lpD3DIMDev: IDirect3DDevice2) : HResult; stdcall;
992 function InitFromClipper (lpDDClipper: IDirectDrawClipper; lpGUID: PGUID;
993 width: Integer; height: Integer) : HResult; stdcall;
994 function Update: HResult; stdcall;
995 function AddUpdateCallback (d3drmUpdateProc: TD3DRMDevice3UpdateCallback;
996 arg: Pointer) : HResult; stdcall;
997 function DeleteUpdateCallback (d3drmUpdateProc: TD3DRMDevice3UpdateCallback;
998 arg: Pointer) : HResult; stdcall;
999 function SetBufferCount (dwCount: DWORD) : HResult; stdcall;
1000 function GetBufferCount: DWORD; stdcall;
1001 function SetDither (bDither: BOOL) : HResult; stdcall;
1002 function SetShades (ulShades: DWORD) : HResult; stdcall;
1003 function SetQuality (rqQuality: TD3DRMRenderQuality) : HResult; stdcall;
1004 function SetTextureQuality (tqTextureQuality: TD3DRMTextureQuality) : HResult; stdcall;
1005 function GetViewports (out lplpViewports: IDirect3DRMViewportArray) : HResult; stdcall;
1006 function GetDither: BOOL; stdcall;
1007 function GetShades: DWORD; stdcall;
1008 function GetHeight: DWORD; stdcall;
1009 function GetWidth: DWORD; stdcall;
1010 function GetTrianglesDrawn: DWORD; stdcall;
1011 function GetWireframeOptions: DWORD; stdcall;
1012 function GetQuality: TD3DRMRenderQuality; stdcall;
1013 function GetColorModel: TD3DColorModel; stdcall;
1014 function GetTextureQuality: TD3DRMTextureQuality; stdcall;
1015 function GetDirect3DDevice (out lplpD3DDevice: IDirect3DDevice) : HResult; stdcall;
1016 (*
1017 * IDirect3DRMDevice2 methods
1018 *)
1019 function InitFromD3D2(lpD3D: IDirect3D2; lpD3DIMDev: IDirect3DDevice2) : HResult; stdcall;
1020 function InitFromSurface(const lpGUID: TGUID; lpDD: IDirectDraw;
1021 lpDDSBack: IDirectDrawSurface) : HResult; stdcall;
1022 function SetRenderMode(dwFlags: DWORD ) : HResult; stdcall;
1023 function GetRenderMode : DWORD; stdcall;
1024 function GetDirect3DDevice2(out lplpD3DDevice: IDirect3DDevice2) : HResult; stdcall;
1025 (*
1026 * IDirect3DRMDevice3 methods
1027 *)
1028 function FindPreferredTextureFormat (dwBitDepths, dwFlags: DWORD;
1029 out lpDDPF: TDDPixelFormat) : HResult; stdcall;
1030 function RenderStateChange (dwStateNum, dwVal, dwFlags: DWORD) : HResult; stdcall;
1031
1032 function LightStateChange (drsType: TD3DLightStateType; // defined different in header and help
1033 dwVal, dwFlags: DWORD) : HResult; stdcall;
1034 function GetStateChangeOptions (dwStateClass, dwStateNum: DWORD;
1035 var pdwFlags: DWORD) : HResult; stdcall;
1036 function SetStateChangeOptions ( dwStateClass, dwStateNum, dwFlags: DWORD) : HResult; stdcall;
1037 end;
1038
1039 IDirect3DRMViewport = interface (IDirect3DRMObject)
1040 ['{eb16cb02-d271-11ce-ac48-0000c03825a1}']
1041 (*
1042 * IDirect3DRMViewport methods
1043 *)
1044 function Init (lpD3DRMDevice: IDirect3DRMDevice;
1045 lpD3DRMFrameCamera: IDirect3DRMFrame; xpos, ypos,
1046 width, height: DWORD) : HResult; stdcall;
1047 function Clear: HResult; stdcall;
1048 function Render (lpD3DRMFrame: IDirect3DRMFrame) : HResult; stdcall;
1049 function SetFront (rvFront: TD3DValue) : HResult; stdcall;
1050 function SetBack (rvBack: TD3DValue) : HResult; stdcall;
1051 function SetField (rvField: TD3DValue) : HResult; stdcall;
1052 function SetUniformScaling (bScale: BOOL) : HResult; stdcall;
1053 function SetCamera (lpCamera: IDirect3DRMFrame) : HResult; stdcall;
1054 function SetProjection (rptType: TD3DRMProjectionType) : HResult; stdcall;
1055 function Transform (out lprvDst: TD3DRMVector4D; const lprvSrc: TD3DVector) : HResult; stdcall;
1056 function InverseTransform (out lprvDst: TD3DVector;
1057 const lprvSrc: TD3DRMVector4D) : HResult; stdcall;
1058 function Configure (lX, lY: LongInt; dwWidth, dwHeight: DWORD) : HResult; stdcall;
1059 function ForceUpdate (dwX1, dwY1, dwX2, dwY2: DWORD) : HResult; stdcall;
1060 function SetPlane (rvLeft, rvRight, rvBottom, rvTop: TD3DValue) : HResult; stdcall;
1061 function GetCamera (out lpCamera: IDirect3DRMFrame) : HResult; stdcall;
1062 function GetDevice (out lpD3DRMDevice: IDirect3DRMDevice) : HResult; stdcall;
1063 function GetPlane (out lpd3dvLeft, lpd3dvRight, lpd3dvBottom, lpd3dvTop:
1064 TD3DValue) : HResult; stdcall;
1065 function Pick (lX, lY: LongInt; var lplpVisuals: IDirect3DRMPickedArray) : HResult; stdcall;
1066 function GetUniformScaling: BOOL; stdcall;
1067 function GetX: LongInt; stdcall;
1068 function GetY: LongInt; stdcall;
1069 function GetWidth: DWORD; stdcall;
1070 function GetHeight: DWORD; stdcall;
1071 function GetField: TD3DValue; stdcall;
1072 function GetBack: TD3DValue; stdcall;
1073 function GetFront: TD3DValue; stdcall;
1074 function GetProjection: TD3DRMProjectionType; stdcall;
1075 function GetDirect3DViewport (out lplpD3DViewport: IDirect3DViewport) : HResult; stdcall;
1076 end;
1077
1078 IDirect3DRMViewport2 = interface (IDirect3DRMObject)
1079 ['{4a1b1be6-bfed-11d1-8ed8-00a0c967a482}']
1080 (*
1081 * IDirect3DRMViewport2 methods
1082 *)
1083 function Init (lpD3DRMDevice: IDirect3DRMDevice3;
1084 lpD3DRMFrameCamera: IDirect3DRMFrame3; xpos, ypos,
1085 width, height: DWORD) : HResult; stdcall;
1086 function Clear (dwFlags: DWORD): HResult; stdcall;
1087 function Render (lpD3DRMFrame: IDirect3DRMFrame3) : HResult; stdcall;
1088 function SetFront (rvFront: TD3DValue) : HResult; stdcall;
1089 function SetBack (rvBack: TD3DValue) : HResult; stdcall;
1090 function SetField (rvField: TD3DValue) : HResult; stdcall;
1091 function SetUniformScaling (bScale: BOOL) : HResult; stdcall;
1092 function SetCamera (lpCamera: IDirect3DRMFrame3) : HResult; stdcall;
1093 function SetProjection (rptType: TD3DRMProjectionType) : HResult; stdcall;
1094 function Transform (out lprvDst: TD3DRMVector4D; const lprvSrc: TD3DVector) : HResult; stdcall;
1095 function InverseTransform (out lprvDst: TD3DVector;
1096 const lprvSrc: TD3DRMVector4D) : HResult; stdcall;
1097 function Configure (lX, lY: LongInt; dwWidth, dwHeight: DWORD) : HResult; stdcall;
1098 function ForceUpdate (dwX1, dwY1, dwX2, dwY2: DWORD) : HResult; stdcall;
1099 function SetPlane (rvLeft, rvRight, rvBottom, rvTop: TD3DValue) : HResult; stdcall;
1100 function GetCamera (out lpCamera: IDirect3DRMFrame3) : HResult; stdcall;
1101 function GetDevice (out lpD3DRMDevice: IDirect3DRMDevice3) : HResult; stdcall;
1102 function GetPlane (out lpd3dvLeft, lpd3dvRight, lpd3dvBottom, lpd3dvTop:
1103 TD3DValue) : HResult; stdcall;
1104 function Pick (lX, lY: LongInt; var lplpVisuals: IDirect3DRMPickedArray) : HResult; stdcall;
1105 function GetUniformScaling: BOOL; stdcall;
1106 function GetX: LongInt; stdcall;
1107 function GetY: LongInt; stdcall;
1108 function GetWidth: DWORD; stdcall;
1109 function GetHeight: DWORD; stdcall;
1110 function GetField: TD3DValue; stdcall;
1111 function GetBack: TD3DValue; stdcall;
1112 function GetFront: TD3DValue; stdcall;
1113 function GetProjection: TD3DRMProjectionType; stdcall;
1114 function GetDirect3DViewport (var lplpD3DViewport: IDirect3DViewport) : HResult; stdcall;
1115 function TransformVectors (dwNumVectors: DWORD; out lpDstVectors:
1116 TD3DRMVector4D; const lpSrcVectors: TD3DVector) : HResult; stdcall;
1117 function InverseTransformVectors (dwNumVectors: DWORD; out lpDstVectors:
1118 TD3DRMVector4D; const lpSrcVectors: TD3DVector) : HResult; stdcall;
1119 end;
1120
1121 IDirect3DRMFrame = interface (IDirect3DRMVisual)
1122 ['{eb16cb03-d271-11ce-ac48-0000c03825a1}']
1123 (*
1124 * IDirect3DRMFrame methods
1125 *)
1126 function AddChild (lpD3DRMFrameChild: IDirect3DRMFrame) : HResult; stdcall;
1127 function AddLight (lpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
1128 function AddMoveCallback (d3drmFMC: TD3DRMFrameMoveCallback;
1129 lpArg: Pointer) : HResult; stdcall;
1130 function AddTransform (rctCombine: TD3DRMCombineType;
1131 rmMatrix: TD3DRMMatrix4D) : HResult; stdcall;
1132 function AddTranslation (rctCombine: TD3DRMCombineType; rvX, rvY, rvZ:
1133 TD3DValue) : HResult; stdcall;
1134 function AddScale (rctCombine: TD3DRMCombineType; rvX, rvY, rvZ: TD3DValue) : HResult; stdcall;
1135 function AddRotation (rctCombine: TD3DRMCombineType; rvX, rvY, rvZ,
1136 rvTheta: TD3DValue) : HResult; stdcall;
1137 function AddVisual (lpD3DRMVisual: IDirect3DRMVisual) : HResult; stdcall;
1138 function GetChildren (out lplpChildren: IDirect3DRMFrameArray) : HResult; stdcall;
1139 function GetColor: TD3DColor; stdcall;
1140 function GetLights (out lplpLights: IDirect3DRMLightArray) : HResult; stdcall;
1141 function GetMaterialMode: TD3DRMMaterialMode; stdcall;
1142 function GetParent (out lplpParent: IDirect3DRMFrame) : HResult; stdcall;
1143 function GetPosition (lpRef: IDirect3DRMFrame; out lprvPos: TD3DVector) : HResult; stdcall;
1144 function GetRotation (lpRef: IDirect3DRMFrame; out lprvAxis: TD3DVector;
1145 out lprvTheta: TD3DValue) : HResult; stdcall;
1146 function GetScene (out lplpRoot: IDirect3DRMFrame) : HResult; stdcall;
1147 function GetSortMode: TD3DRMSortMode; stdcall;
1148 function GetTexture (out lplpTexture: IDirect3DRMTexture) : HResult; stdcall;
1149 function GetTransform (out rmMatrix: TD3DRMMatrix4D) : HResult; stdcall;
1150 function GetVelocity (lpRef: IDirect3DRMFrame; var lprvVel: TD3DVector;
1151 fRotVel: BOOL) : HResult; stdcall;
1152 function GetOrientation (lpRef: IDirect3DRMFrame; var lprvDir: TD3DVector;
1153 var lprvUp: TD3DVector) : HResult; stdcall;
1154 function GetVisuals (out lplpVisuals: IDirect3DRMVisualArray) : HResult; stdcall;
1155 function GetTextureTopology (out lpU, lpV: BOOL) : HResult; stdcall;
1156 function InverseTransform (out lprvDst: TD3DVector; const lprvSrc: TD3DVector) : HResult; stdcall;
1157 function Load (lpvObjSource: Pointer; lpvObjID: Pointer;
1158 d3drmLOFlags: TD3DRMLoadOptions; d3drmLoadTextureProc:
1159 TD3DRMLoadTextureCallback; lpArgLTP: Pointer) : HResult; stdcall;
1160 function LookAt (lpTarget, lpRef: IDirect3DRMFrame;
1161 rfcConstraint: TD3DRMFrameConstraint ) : HResult; stdcall;
1162 function Move (delta: TD3DValue) : HResult; stdcall;
1163 function DeleteChild (lpChild: IDirect3DRMFrame) : HResult; stdcall;
1164 function DeleteLight (lpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
1165 function DeleteMoveCallback (d3drmFMC: TD3DRMFrameMoveCallback;
1166 lpArg: Pointer) : HResult; stdcall;
1167 function DeleteVisual (lpD3DRMVisual: IDirect3DRMVisual) : HResult; stdcall;
1168 function GetSceneBackground: TD3DColor; stdcall;
1169 function GetSceneBackgroundDepth (out lplpDDSurface: IDirectDrawSurface) : HResult; stdcall;
1170 function GetSceneFogColor: TD3DColor; stdcall;
1171 function GetSceneFogEnable: BOOL; stdcall;
1172 function GetSceneFogMode: TD3DRMFogMode; stdcall;
1173 function GetSceneFogParams (out lprvStart, lprvEnd, lprvDensity: TD3DValue) : HResult; stdcall;
1174 function SetSceneBackground (rcColor: TD3DColor) : HResult; stdcall;
1175 function SetSceneBackgroundRGB (rvRed, rvGreen, rvBlue: TD3DValue) : HResult; stdcall;
1176 function SetSceneBackgroundDepth (lpImage: IDirectDrawSurface) : HResult; stdcall;
1177 function SetSceneBackgroundImage (lpTexture: IDirect3DRMTexture) : HResult; stdcall;
1178 function SetSceneFogEnable (bEnable: BOOL) : HResult; stdcall;
1179 function SetSceneFogColor (rcColor: TD3DColor) : HResult; stdcall;
1180 function SetSceneFogMode (rfMode: TD3DRMFogMode) : HResult; stdcall;
1181 function SetSceneFogParams (rvStart, rvEnd, rvDensity: TD3DValue) : HResult; stdcall;
1182 function SetColor (rcColor: TD3DColor) : HResult; stdcall;
1183 function SetColorRGB (rvRed, rvGreen, rvBlue: TD3DValue) : HResult; stdcall;
1184 function GetZbufferMode: TD3DRMZBufferMode; stdcall;
1185 function SetMaterialMode (rmmMode: TD3DRMMaterialMode) : HResult; stdcall;
1186 function SetOrientation (lpRef: IDirect3DRMFrame; rvDx, rvDy, rvDz, rvUx,
1187 rvUy, rvUz: TD3DValue) : HResult; stdcall;
1188 function SetPosition (lpRef: IDirect3DRMFrame; rvX, rvY, rvZ: TD3DValue) : HResult; stdcall;
1189 function SetRotation (lpRef: IDirect3DRMFrame; rvX, rvY, rvZ,
1190 rvTheta: TD3DValue) : HResult; stdcall;
1191 function SetSortMode (d3drmSM: TD3DRMSortMode) : HResult; stdcall;
1192 function SetTexture (lpD3DRMTexture: IDirect3DRMTexture) : HResult; stdcall;
1193 function SetTextureTopology (cylU, cylV: BOOL) : HResult; stdcall;
1194 function SetVelocity (lpRef: IDirect3DRMFrame; rvX, rvY, rvZ: TD3DValue;
1195 fRotVel: BOOL) : HResult; stdcall;
1196 function SetZbufferMode (d3drmZBM: TD3DRMZBufferMode) : HResult; stdcall;
1197 function Transform (out lpd3dVDst: TD3DVector; const lpd3dVSrc: TD3DVector) : HResult; stdcall;
1198 end;
1199
1200 IDirect3DRMFrame2 = interface (IDirect3DRMFrame)
1201 ['{c3dfbd60-3988-11d0-9ec2-0000c0291ac3}']
1202 (*
1203 * IDirect3DRMFrame2 methods
1204 *)
1205 function AddMoveCallback2 (d3drmFMC: TD3DRMFrameMoveCallback; lpArg:
1206 Pointer; dwFlags: DWORD) : HResult; stdcall;
1207 function GetBox (out lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
1208 function GetBoxEnable : boolean; stdcall;
1209 function GetAxes (out dir, up: TD3DVector) : HResult; stdcall;
1210 function GetMaterial (out lplpMaterial: IDirect3DRMMaterial) : HResult; stdcall;
1211 function GetInheritAxes : boolean; stdcall;
1212 function GetHierarchyBox (out lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
1213 function SetBox (const lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
1214 function SetBoxEnable (bEnableFlag: BOOL) : HResult; stdcall;
1215 function SetAxes (dx, dy, dz, ux, uy, uz: TD3DValue) : HResult; stdcall;
1216 function SetInheritAxes (inherit_from_parent: BOOL) : HResult; stdcall;
1217 function SetMaterial (var lplpMaterial: IDirect3DRMMaterial) : HResult; stdcall;
1218 function SetQuaternion (lpRef: IDirect3DRMFrame;
1219 const quat: TD3DRMQuaternion) : HResult; stdcall;
1220 function RayPick (lpRefFrame: IDirect3DRMFrame; var ray: TD3DRMRay;
1221 dwFlags: DWORD; out lplpPicked2Array: IDirect3DRMPicked2Array) :
1222 HResult; stdcall;
1223 function Save (lpFilename: PAnsiChar; d3dFormat: TD3DRMXOFFormat;
1224 d3dSaveFlags: TD3DRMSaveOptions) : HResult; stdcall;
1225 end;
1226
1227 IDirect3DRMFrame3 = interface (IDirect3DRMVisual)
1228 ['{ff6b7f70-a40e-11d1-91f9-0000f8758e66}']
1229 (*
1230 * IDirect3DRMFrame3 methods
1231 *)
1232 function AddChild (lpD3DRMFrameChild: IDirect3DRMFrame3) : HResult; stdcall;
1233 function AddLight (lpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
1234 function AddMoveCallback (d3drmFMC: TD3DRMFrame3MoveCallback;
1235 lpArg: Pointer; dwFlags: DWORD) : HResult; stdcall;
1236 function AddTransform (rctCombine: TD3DRMCombineType;
1237 rmMatrix: TD3DRMMatrix4D) : HResult; stdcall;
1238 function AddTranslation (rctCombine: TD3DRMCombineType; rvX, rvY, rvZ:
1239 TD3DValue) : HResult; stdcall;
1240 function AddScale (rctCombine: TD3DRMCombineType; rvX, rvY, rvZ: TD3DValue) : HResult; stdcall;
1241 function AddRotation (rctCombine: TD3DRMCombineType; rvX, rvY, rvZ,
1242 rvTheta: TD3DValue) : HResult; stdcall;
1243 function AddVisual (lpD3DRMVisual: IDirect3DRMVisual) : HResult; stdcall;
1244 function GetChildren (out lplpChildren: IDirect3DRMFrameArray) : HResult; stdcall;
1245 function GetColor: TD3DColor; stdcall;
1246 function GetLights (out lplpLights: IDirect3DRMLightArray) : HResult; stdcall;
1247 function GetMaterialMode: TD3DRMMaterialMode; stdcall;
1248 function GetParent (out lplpParent: IDirect3DRMFrame3) : HResult; stdcall;
1249 function GetPosition (lpRef: IDirect3DRMFrame3; out lprvPos: TD3DVector) : HResult; stdcall;
1250 function GetRotation (lpRef: IDirect3DRMFrame3; out lprvAxis: TD3DVector;
1251 out lprvTheta: TD3DValue) : HResult; stdcall;
1252 function GetScene (out lplpRoot: IDirect3DRMFrame3) : HResult; stdcall;
1253 function GetSortMode: TD3DRMSortMode; stdcall;
1254 function GetTexture (out lplpTexture: IDirect3DRMTexture3) : HResult; stdcall;
1255 function GetTransform (lpRefFrame: IDirect3DRMFrame3;
1256 var rmMatrix: TD3DRMMatrix4D) : HResult; stdcall;
1257 function GetVelocity (lpRef: IDirect3DRMFrame3; out lprvVel: TD3DVector;
1258 fRotVel: BOOL) : HResult; stdcall;
1259 function GetOrientation (lpRef: IDirect3DRMFrame3; out lprvDir: TD3DVector;
1260 out lprvUp: TD3DVector) : HResult; stdcall;
1261 function GetVisuals (out lplpVisuals: IDirect3DRMVisualArray) : HResult; stdcall;
1262 function InverseTransform (out lprvDst: TD3DVector; const lprvSrc: TD3DVector) : HResult; stdcall;
1263 function Load (lpvObjSource: Pointer; lpvObjID: Pointer;
1264 d3drmLOFlags: TD3DRMLoadOptions; d3drmLoadTextureProc:
1265 TD3DRMLoadTexture3Callback; lpArgLTP: Pointer) : HResult; stdcall;
1266 function LookAt (lpTarget, lpRef: IDirect3DRMFrame3;
1267 rfcConstraint: TD3DRMFrameConstraint ) : HResult; stdcall;
1268 function Move (delta: TD3DValue) : HResult; stdcall;
1269 function DeleteChild (lpChild: IDirect3DRMFrame3) : HResult; stdcall;
1270 function DeleteLight (lpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
1271 function DeleteMoveCallback (d3drmFMC: TD3DRMFrame3MoveCallback; lpArg: Pointer) : HResult; stdcall;
1272 function DeleteVisual (lpD3DRMVisual: IDirect3DRMVisual) : HResult; stdcall;
1273 function GetSceneBackground: TD3DColor; stdcall;
1274 function GetSceneBackgroundDepth (out lplpDDSurface: IDirectDrawSurface) : HResult; stdcall;
1275 function GetSceneFogColor: TD3DColor; stdcall;
1276 function GetSceneFogEnable: BOOL; stdcall;
1277 function GetSceneFogMode: TD3DRMFogMode; stdcall;
1278 function GetSceneFogParams (out lprvStart, lprvEnd, lprvDensity: TD3DValue) : HResult; stdcall;
1279 function SetSceneBackground (rcColor: TD3DColor) : HResult; stdcall;
1280 function SetSceneBackgroundRGB (rvRed, rvGreen, rvBlue: TD3DValue) : HResult; stdcall;
1281 function SetSceneBackgroundDepth (lpImage: IDirectDrawSurface) : HResult; stdcall;
1282 function SetSceneBackgroundImage (lpTexture: IDirect3DRMTexture3) : HResult; stdcall;
1283 function SetSceneFogEnable (bEnable: BOOL) : HResult; stdcall;
1284 function SetSceneFogColor (rcColor: TD3DColor) : HResult; stdcall;
1285 function SetSceneFogMode (rfMode: TD3DRMFogMode) : HResult; stdcall;
1286 function SetSceneFogParams (rvStart, rvEnd, rvDensity: TD3DValue) : HResult; stdcall;
1287 function SetColor (rcColor: TD3DColor) : HResult; stdcall;
1288 function SetColorRGB (rvRed, rvGreen, rvBlue: TD3DValue) : HResult; stdcall;
1289 function GetZbufferMode: TD3DRMZBufferMode; stdcall;
1290 function SetMaterialMode (rmmMode: TD3DRMMaterialMode) : HResult; stdcall;
1291 function SetOrientation (lpRef: IDirect3DRMFrame3; rvDx, rvDy, rvDz, rvUx,
1292 rvUy, rvUz: TD3DValue) : HResult; stdcall;
1293 function SetPosition (lpRef: IDirect3DRMFrame3; rvX, rvY, rvZ: TD3DValue) :
1294 HResult; stdcall;
1295 function SetRotation (lpRef: IDirect3DRMFrame3; rvX, rvY, rvZ,
1296 rvTheta: TD3DValue) : HResult; stdcall;
1297 function SetSortMode (d3drmSM: TD3DRMSortMode) : HResult; stdcall;
1298 function SetTexture (lpD3DRMTexture: IDirect3DRMTexture3) : HResult; stdcall;
1299 function SetVelocity (lpRef: IDirect3DRMFrame3; rvX, rvY, rvZ: TD3DValue;
1300 fRotVel: BOOL) : HResult; stdcall;
1301 function SetZbufferMode (d3drmZBM: TD3DRMZBufferMode) : HResult; stdcall;
1302 function Transform (out lpd3dVDst: TD3DVector; const lpd3dVSrc: TD3DVector) : HResult; stdcall;
1303
1304 function GetBox (out lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
1305 function GetBoxEnable : boolean; stdcall;
1306 function GetAxes (out dir, up: TD3DVector) : HResult; stdcall;
1307 function GetMaterial (out lplpMaterial: IDirect3DRMMaterial2) : HResult; stdcall;
1308 function GetInheritAxes : boolean; stdcall;
1309 function GetHierarchyBox (out lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
1310 function SetBox (const lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
1311 function SetBoxEnable (bEnableFlag: BOOL) : HResult; stdcall;
1312 function SetAxes (dx, dy, dz, ux, uy, uz: TD3DValue) : HResult; stdcall;
1313 function SetInheritAxes (inherit_from_parent: BOOL) : HResult; stdcall;
1314 function SetMaterial (var lplpMaterial: IDirect3DRMMaterial2) : HResult; stdcall;
1315 function SetQuaternion (lpRef: IDirect3DRMFrame3;
1316 const quat: TD3DRMQuaternion) : HResult; stdcall;
1317 function RayPick (lpRefFrame: IDirect3DRMFrame3; var ray: TD3DRMRay;
1318 dwFlags: DWORD; out lplpPicked2Array: IDirect3DRMPicked2Array) : HResult; stdcall;
1319 function Save (lpFilename: PAnsiChar; d3dFormat: TD3DRMXOFFormat;
1320 d3dSaveFlags: TD3DRMSaveOptions) : HResult; stdcall;
1321 function TransformVectors (lpRefFrame: IDirect3DRMFrame3;
1322 dwNumVectors: DWORD; out lpDstVectors: TD3DVector;
1323 const lpSrcVectors: TD3DVector) : HResult; stdcall;
1324 function InverseTransformVectors (lpRefFrame: IDirect3DRMFrame3;
1325 dwNumVectors: DWORD; out lpDstVectors: TD3DVector;
1326 const lpSrcVectors: TD3DVector) : HResult; stdcall;
1327 function SetTraversalOptions (dwFlags: DWORD) : HResult; stdcall;
1328 function GetTraversalOptions (out lpdwFlags: DWORD) : HResult; stdcall;
1329 function SetSceneFogMethod (dwFlags: DWORD) : HResult; stdcall;
1330 function GetSceneFogMethod (out lpdwFlags: DWORD) : HResult; stdcall;
1331 function SetMaterialOverride (
1332 const lpdmOverride: TD3DRMMaterialOverride) : HResult; stdcall;
1333 function GetMaterialOverride (
1334 const lpdmOverride: TD3DRMMaterialOverride) : HResult; stdcall;
1335 end;
1336
1337
1338 IDirect3DRMMesh = interface (IDirect3DRMVisual)
1339 ['{a3a80d01-6e12-11cf-ac4a-0000c03825a1}']
1340 (*
1341 * IDirect3DRMMesh methods
1342 *)
1343 function Scale (sx, sy, sz: TD3DValue) : HResult; stdcall;
1344 function Translate (tx, ty, tz: TD3DValue) : HResult; stdcall;
1345 function GetBox (out lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
1346 function AddGroup (vCount, fCount, vPerFace: DWORD; var fData: DWORD;
1347 var returnId: TD3DRMGroupIndex) : HResult; stdcall;
1348 function SetVertices (id: TD3DRMGroupIndex; index, count: DWORD;
1349 var values: TD3DRMVertex) : HResult; stdcall;
1350 function SetGroupColor (id: TD3DRMGroupIndex; value: TD3DColor) : HResult; stdcall;
1351 function SetGroupColorRGB (id: TD3DRMGroupIndex; red, green,
1352 blue: TD3DValue) : HResult; stdcall;
1353 function SetGroupMapping (id: TD3DRMGroupIndex;
1354 value: TD3DRMMapping) : HResult; stdcall;
1355 function SetGroupQuality (id: TD3DRMGroupIndex;
1356 value: TD3DRMRenderQuality) : HResult; stdcall;
1357 function SetGroupMaterial (id: TD3DRMGroupIndex; value:
1358 IDirect3DRMMaterial) : HResult; stdcall;
1359 function SetGroupTexture (id: TD3DRMGroupIndex; value: IDirect3DRMTexture) : HResult; stdcall;
1360 function GetGroupCount: DWORD; stdcall;
1361 function GetGroup (id: TD3DRMGroupIndex; vCount, fCount, vPerFace : PDWORD;
1362 var fDataSize: DWORD; fData: PDWORD) : HResult; stdcall;
1363 function GetVertices (id: TD3DRMGroupIndex; index, count : DWORD;
1364 out returnPtr : TD3DRMVertex) : HResult; stdcall;
1365 function GetGroupColor (id: TD3DRMGroupIndex) : TD3DColor; stdcall;
1366 function GetGroupMapping (id: TD3DRMGroupIndex) : TD3DRMMapping; stdcall;
1367 function GetGroupQuality (id: TD3DRMGroupIndex) : TD3DRMRenderQuality; stdcall;
1368 function GetGroupMaterial (id: TD3DRMGroupIndex;
1369 out returnPtr: IDirect3DRMMaterial) : HResult; stdcall;
1370 function GetGroupTexture (id: TD3DRMGroupIndex;
1371 out returnPtr: IDirect3DRMTexture) : HResult; stdcall;
1372 end;
1373
1374 IDirect3DRMProgressiveMesh = interface (IDirect3DRMVisual)
1375 ['{4516ec79-8f20-11d0-9b6d-0000c0781bc3}']
1376 (*
1377 * IDirect3DRMProgressiveMesh methods
1378 *)
1379 function Load (lpSource, lpObjID: pointer; dloLoadflags : TD3DRMLoadOptions;
1380 lpCallback: TD3DRMLoadTextureCallback; lpArg: pointer) : HResult; stdcall;
1381 function GetLoadStatus (out lpStatus: TD3DRMPMeshLoadStatus) : HResult; stdcall;
1382 function SetMinRenderDetail (d3dVal: TD3DValue) : HResult; stdcall;
1383 function Abort (dwFlags: DWORD) : HResult; stdcall;
1384 function GetFaceDetail (out lpdwCount: DWORD) : HResult; stdcall;
1385 function GetVertexDetail (out lpdwCount: DWORD) : HResult; stdcall;
1386 function SetFaceDetail (dwCount: DWORD) : HResult; stdcall;
1387 function SetVertexDetail (dwCount: DWORD) : HResult; stdcall;
1388 function GetFaceDetailRange (out lpdwMin, lpdwMax: DWORD) : HResult; stdcall;
1389 function GetVertexDetailRange (out lpdwMin, lpdwMax: DWORD) : HResult; stdcall;
1390 function GetDetail (out lpdvVal: TD3DValue) : HResult; stdcall;
1391 function SetDetail (lpdvVal: TD3DValue) : HResult; stdcall;
1392 function RegisterEvents (hEvent: THANDLE; dwFlags, dwReserved: DWORD) : HResult; stdcall;
1393 function CreateMesh (out lplpD3DRMMesh: IDirect3DRMMesh) : HResult; stdcall;
1394 function Duplicate (out lplpD3DRMPMesh: IDirect3DRMProgressiveMesh) : HResult; stdcall;
1395 function GetBox (out lpBBox: TD3DRMBox) : HResult; stdcall;
1396 function SetQuality (quality: TD3DRMRenderQuality) : HResult; stdcall;
1397 function GetQuality (out lpdwquality: TD3DRMRenderQuality) : HResult; stdcall;
1398 end;
1399
1400 IDirect3DRMShadow = interface (IDirect3DRMVisual)
1401 ['{af359780-6ba3-11cf-ac4a-0000c03825a1}']
1402 (*
1403 * IDirect3DRMShadow methods
1404 *)
1405 function Init (lpD3DRMVisual: IDirect3DRMVisual;
1406 lpD3DRMLight: IDirect3DRMLight;
1407 px, py, pz, nx, ny, nz: TD3DValue) : HResult; stdcall;
1408 end;
1409
1410 IDirect3DRMShadow2 = interface (IDirect3DRMShadow)
1411 ['{86b44e25-9c82-11d1-bb0b-00a0c981a0a6}']
1412 (*
1413 * IDirect3DRMShadow2 methods
1414 *)
1415 function GetVisual (out lplpDirect3DRMVisual: IDirect3DRMVisual) : HResult; stdcall;
1416 function SetVisual (lpDirect3DRMVisual: IDirect3DRMVisual;
1417 dwFlags: DWORD) : HResult; stdcall;
1418 function GetLight (out lplpDirect3DRMLight: IDirect3DRMLight) : HResult; stdcall;
1419 function SetLight (lplpDirect3DRMLight: IDirect3DRMLight;
1420 dwFlags: DWORD) : HResult; stdcall;
1421 function GetPlane (
1422 var pdvPX, pdvPY, pdvPZ, pdvNX, pdvNY, pdvNZ: TD3DValue) : HResult; stdcall;
1423 function SetPlane (px, py, pz, nx, ny, nz: TD3DValue;
1424 dwFlags: DWORD) : HResult; stdcall;
1425 function GetOptions (out pdwOptions: DWORD) : HResult; stdcall;
1426 function SetOptions (dwOptions: DWORD) : HResult; stdcall;
1427
1428 end;
1429
1430 IDirect3DRMFace = interface (IDirect3DRMObject)
1431 ['{eb16cb07-d271-11ce-ac48-0000c03825a1}']
1432 (*
1433 * IDirect3DRMFace methods
1434 *)
1435 function AddVertex (x, y, z: TD3DValue) : HResult; stdcall;
1436 function AddVertexAndNormalIndexed (vertex: DWORD; normal: DWORD) : HResult; stdcall;
1437 function SetColorRGB (red, green, blue: TD3DValue) : HResult; stdcall;
1438 function SetColor (color: TD3DColor) : HResult; stdcall;
1439 function SetTexture (lpD3DRMTexture: IDirect3DRMTexture) : HResult; stdcall;
1440 function SetTextureCoordinates (vertex: DWORD; u, v: TD3DValue) : HResult; stdcall;
1441 function SetMaterial (lpMat: IDirect3DRMMaterial) : HResult; stdcall;
1442 function SetTextureTopology (cylU, cylV: BOOL) : HResult; stdcall;
1443 function GetVertex (index: DWORD; out lpPosition: TD3DVector;
1444 out lpNormal: TD3DVector) : HResult; stdcall;
1445 function GetVertices (var lpdwVertexCount: DWORD;
1446 out lpPosition, lpNormal: TD3DVector) : HResult; stdcall;
1447 function GetTextureCoordinates (index: DWORD; out lpU, lpV: TD3DValue) : HResult; stdcall;
1448 function GetTextureTopology (out lpU, lpV: BOOL) : HResult; stdcall;
1449 function GetNormal (out lpNormal: TD3DVector) : HResult; stdcall;
1450 function GetTexture (out lplpTexture: IDirect3DRMTexture) : HResult; stdcall;
1451 function GetMaterial (out lpMat: IDirect3DRMMaterial) : HResult; stdcall;
1452 function GetVertexCount: Integer; stdcall;
1453 function GetVertexIndex (dwIndex: DWORD) : Integer; stdcall;
1454 function GetTextureCoordinateIndex (dwIndex: DWORD) : Integer; stdcall;
1455 function GetColor: TD3DColor; stdcall;
1456 end;
1457
1458 IDirect3DRMFace2 = interface (IDirect3DRMObject)
1459 ['{4516ec81-8f20-11d0-9b6d-0000c0781bc3}']
1460 (*
1461 * IDirect3DRMFace2 methods
1462 *)
1463 function AddVertex (x, y, z: TD3DValue) : HResult; stdcall;
1464 function AddVertexAndNormalIndexed (vertex: DWORD; normal: DWORD) : HResult; stdcall;
1465 function SetColorRGB (red, green, blue: TD3DValue) : HResult; stdcall;
1466 function SetColor (color: TD3DColor) : HResult; stdcall;
1467 function SetTexture (lpD3DRMTexture: IDirect3DRMTexture3) : HResult; stdcall;
1468 function SetTextureCoordinates (vertex: DWORD; u, v: TD3DValue) : HResult; stdcall;
1469 function SetMaterial (lpMat: IDirect3DRMMaterial2) : HResult; stdcall;
1470 function SetTextureTopology (cylU, cylV: BOOL) : HResult; stdcall;
1471 function GetVertex (index: DWORD; out lpPosition: TD3DVector;
1472 out lpNormal: TD3DVector) : HResult; stdcall;
1473 function GetVertices (var lpdwVertexCount: DWORD;
1474 out lpPosition, lpNormal: TD3DVector) : HResult; stdcall;
1475 function GetTextureCoordinates (index: DWORD; out lpU, lpV: TD3DValue) : HResult; stdcall;
1476 function GetTextureTopology (out lpU, lpV: BOOL) : HResult; stdcall;
1477 function GetNormal (out lpNormal: TD3DVector) : HResult; stdcall;
1478 function GetTexture (out lplpTexture: IDirect3DRMTexture3) : HResult; stdcall;
1479 function GetMaterial (out lpMat: IDirect3DRMMaterial2) : HResult; stdcall;
1480 function GetVertexCount: Integer; stdcall;
1481 function GetVertexIndex (dwIndex: DWORD) : Integer; stdcall;
1482 function GetTextureCoordinateIndex (dwIndex: DWORD) : Integer; stdcall;
1483 function GetColor: TD3DColor; stdcall;
1484 end;
1485
1486 IDirect3DRMMeshBuilder = interface (IDirect3DRMVisual)
1487 ['{a3a80d02-6e12-11cf-ac4a-0000c03825a1}']
1488 (*
1489 * IDirect3DRMMeshBuilder methods
1490 *)
1491 function Load (lpvObjSource, lpvObjID: Pointer; d3drmLOFlags:
1492 TD3DRMLoadOptions; d3drmLoadTextureProc: TD3DRMLoadTextureCallback;
1493 lpvArg: Pointer) : HResult; stdcall;
1494 function Save (lpFilename: PChar; TD3DRMXOFFormat: TD3DRMXOFFormat;
1495 d3drmSOContents: TD3DRMSaveOptions) : HResult; stdcall;
1496 function Scale (sx, sy, sz: TD3DValue) : HResult; stdcall;
1497 function Translate (tx, ty, tz: TD3DValue) : HResult; stdcall;
1498 function SetColorSource (source: TD3DRMColorSource) : HResult; stdcall;
1499 function GetBox (out lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
1500 function GenerateNormals : HResult; stdcall;
1501 function GetColorSource: TD3DRMColorSource; stdcall;
1502 function AddMesh (lpD3DRMMesh: IDirect3DRMMesh) : HResult; stdcall;
1503 function AddMeshBuilder (lpD3DRMMeshBuild: IDirect3DRMMeshBuilder) : HResult; stdcall;
1504 function AddFrame (lpD3DRMFrame: IDirect3DRMFrame) : HResult; stdcall;
1505 function AddFace (lpD3DRMFace: IDirect3DRMFace) : HResult; stdcall;
1506 function AddFaces (dwVertexCount: DWORD; const lpD3DVertices: TD3DVector;
1507 normalCount: DWORD; lpNormals: PD3DVector; var lpFaceData: DWORD;
1508 lplpD3DRMFaceArray: PIDirect3DRMFaceArray) : HResult; stdcall;
1509 function ReserveSpace (vertexCount, normalCount, faceCount: DWORD) : HResult; stdcall;
1510 function SetColorRGB (red, green, blue: TD3DValue) : HResult; stdcall;
1511 function SetColor (color: TD3DColor) : HResult; stdcall;
1512 function SetTexture (lpD3DRMTexture: IDirect3DRMTexture) : HResult; stdcall;
1513 function SetMaterial (lpIDirect3DRMmaterial: IDirect3DRMMaterial) : HResult; stdcall;
1514 function SetTextureTopology (cylU, cylV: BOOL) : HResult; stdcall;
1515 function SetQuality (quality: TD3DRMRenderQuality) : HResult; stdcall;
1516 function SetPerspective (perspective: BOOL) : HResult; stdcall;
1517 function SetVertex (index: DWORD; x, y, z: TD3DValue) : HResult; stdcall;
1518 function SetNormal (index: DWORD; x, y, z: TD3DValue) : HResult; stdcall;
1519 function SetTextureCoordinates (index: DWORD; u, v: TD3DValue) : HResult; stdcall;
1520 function SetVertexColor (index: DWORD; color: TD3DColor) : HResult; stdcall;
1521 function SetVertexColorRGB (index: DWORD; red, green, blue: TD3DValue) : HResult; stdcall;
1522 function GetFaces (out lplpD3DRMFaceArray: IDirect3DRMFaceArray) : HResult; stdcall;
1523 function GetVertices (var vcount: DWORD; var vertices : TD3DVector;
1524 var ncount : DWORD;
1525 var normals : TD3DVector;
1526 var face_data_size, face_data : DWORD) : HResult; stdcall;
1527 function GetTextureCoordinates(index : DWORD; out u, v : TD3DValue) : HResult; stdcall;
1528 function AddVertex (x, y, z: TD3DValue) : Integer; stdcall;
1529 function AddNormal (x, y, z: TD3DValue) : Integer; stdcall;
1530 function CreateFace (out lplpd3drmFace: IDirect3DRMFace) : HResult; stdcall;
1531 function GetQuality: TD3DRMRenderQuality; stdcall;
1532 function GetPerspective: BOOL; stdcall;
1533 function GetFaceCount: Integer; stdcall;
1534 function GetVertexCount: Integer; stdcall;
1535 function GetVertexColor (index: DWORD) : TD3DColor; stdcall;
1536 function CreateMesh (out lplpD3DRMMesh: IDirect3DRMMesh) : HResult; stdcall;
1537 end;
1538
1539 IDirect3DRMMeshBuilder2 = interface (IDirect3DRMMeshBuilder)
1540 ['{4516ec77-8f20-11d0-9b6d-0000c0781bc3}']
1541 (*
1542 * IDirect3DRMMeshBuilder2 methods
1543 *)
1544 function GenerateNormals2 (
1545 dvCreaseAngle: TD3DValue; dwFlags: DWORD) : HResult; stdcall;
1546 function GetFace (dwIndex: DWORD; lplpD3DRMFace: IDirect3DRMFace) : HResult; stdcall;
1547 end;
1548
1549 IDirect3DRMMeshBuilder3 = interface (IDirect3DRMVisual)
1550 ['{ff6b7f71-a40e-11d1-91f9-0000f8758e66}']
1551 (*
1552 * IDirect3DRMMeshBuilder3 methods
1553 *)
1554 function Load (lpvObjSource, lpvObjID: Pointer;
1555 d3drmLOFlags: TD3DRMLoadOptions;
1556 d3drmLoadTextureProc: TD3DRMLoadTexture3Callback;
1557 lpvArg: Pointer) : HResult; stdcall;
1558 function Save (lpFilename: PAnsiChar; TD3DRMXOFFormat: TD3DRMXOFFormat;
1559 d3drmSOContents: TD3DRMSaveOptions) : HResult; stdcall;
1560 function Scale (sx, sy, sz: TD3DValue) : HResult; stdcall;
1561 function Translate (tx, ty, tz: TD3DValue) : HResult; stdcall;
1562 function SetColorSource (source: TD3DRMColorSource) : HResult; stdcall;
1563 function GetBox (out lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
1564 function GenerateNormals (
1565 dvCreaseAngle: TD3DValue; dwFlags: DWORD): HResult; stdcall;
1566 function GetColorSource: TD3DRMColorSource; stdcall;
1567 function AddMesh (lpD3DRMMesh: IDirect3DRMMesh) : HResult; stdcall;
1568 function AddMeshBuilder (
1569 lpD3DRMMeshBuild: IDirect3DRMMeshBuilder3) : HResult; stdcall;
1570 function AddFrame (lpD3DRMFrame: IDirect3DRMFrame3) : HResult; stdcall;
1571 function AddFace (lpD3DRMFace: IDirect3DRMFace2) : HResult; stdcall;
1572 function AddFaces (dwVertexCount: DWORD; const lpD3DVertices: TD3DVector;
1573 normalCount: DWORD; lpNormals: PD3DVector; var lpFaceData: DWORD;
1574 lplpD3DRMFaceArray: PIDirect3DRMFaceArray) : HResult; stdcall;
1575 function ReserveSpace (vertexCount, normalCount, faceCount: DWORD) : HResult; stdcall;
1576 function SetColorRGB (red, green, blue: TD3DValue) : HResult; stdcall;
1577 function SetColor (color: TD3DColor) : HResult; stdcall;
1578 function SetTexture (lpD3DRMTexture: IDirect3DRMTexture3) : HResult; stdcall;
1579 function SetMaterial (lpIDirect3DRMmaterial: IDirect3DRMMaterial2) : HResult; stdcall;
1580 function SetTextureTopology (cylU, cylV: BOOL) : HResult; stdcall;
1581 function SetQuality (quality: TD3DRMRenderQuality) : HResult; stdcall;
1582 function SetPerspective (perspective: BOOL) : HResult; stdcall;
1583 function SetVertex (index: DWORD; x, y, z: TD3DValue) : HResult; stdcall;
1584 function SetNormal (index: DWORD; x, y, z: TD3DValue) : HResult; stdcall;
1585 function SetTextureCoordinates (index: DWORD; u, v: TD3DValue) : HResult; stdcall;
1586 function SetVertexColor (index: DWORD; color: TD3DColor) : HResult; stdcall;
1587 function SetVertexColorRGB (index: DWORD; red, green, blue: TD3DValue) : HResult; stdcall;
1588 function GetFaces (out lplpD3DRMFaceArray: IDirect3DRMFaceArray) : HResult; stdcall;
1589 function GetGeometry (var vcount: DWORD; var vertices : TD3DVector;
1590 var ncount : DWORD; var normals : TD3DVector;
1591 var face_data_size, face_data : DWORD) : HResult; stdcall;
1592 function GetTextureCoordinates(index : DWORD; out u, v : TD3DValue) : HResult; stdcall;
1593 function AddVertex (x, y, z: TD3DValue) : Integer; stdcall;
1594 function AddNormal (x, y, z: TD3DValue) : Integer; stdcall;
1595 function CreateFace (out lplpd3drmFace: IDirect3DRMFace2) : HResult; stdcall;
1596 function GetQuality: TD3DRMRenderQuality; stdcall;
1597 function GetPerspective: BOOL; stdcall;
1598 function GetFaceCount: Integer; stdcall;
1599 function GetVertexCount: Integer; stdcall;
1600 function GetVertexColor (index: DWORD) : TD3DColor; stdcall;
1601 function CreateMesh (out lplpD3DRMMesh: IDirect3DRMMesh) : HResult; stdcall;
1602 function GetFace
1603 (dwIndex: DWORD; lplpD3DRMFace: IDirect3DRMFace) : HResult; stdcall;
1604 function GetVertex (dwIndex: DWORD; out lpVector: TD3DVector) : HResult; stdcall;
1605 function GetNormal (dwIndex: DWORD; out lpVector: TD3DVector) : HResult; stdcall;
1606 function DeleteVertices (dwFirstIndex, dwCount: DWORD) : HResult; stdcall;
1607 function DeleteNormals (dwFirstIndex, dwCount: DWORD) : HResult; stdcall;
1608 function DeleteFace (lpFace: IDirect3DRMFace2) : HResult; stdcall;
1609 function Empty (dwFlags: DWORD) : HResult; stdcall;
1610 function Optimize (dwFlags: DWORD) : HResult; stdcall;
1611 function AddFacesIndexed (dwFlags: DWORD; var lpdwvIndices: DWORD;
1612 lpdwIndexFirst, lpdwCount: PDWORD) : HResult; stdcall;
1613 function CreateSubMesh (out lplpUnk: IUnknown) : HResult; stdcall;
1614 function GetParentMesh (dwFlags: DWORD; out lplpUnk: IUnknown) : HResult; stdcall;
1615 function GetSubMeshes (lpdwCount: PDWORD; lpUnk: IUnknown) : HResult; stdcall;
1616 function DeleteSubMesh (lplpUnk: IUnknown) : HResult; stdcall;
1617 function Enable (dwFlags: DWORD) : HResult; stdcall;
1618 function GetEnable (out lpdwFlags: DWORD) : HResult; stdcall;
1619 function AddTriangles (dwFlags, dwFormat, dwVertexCount: DWORD;
1620 lpData: pointer) : HResult; stdcall;
1621 function SetVertices
1622 (dwFirst, dwCount: DWORD; const lpdvVector: TD3DVector) : HResult; stdcall;
1623 function GetVertices(dwFirst: DWORD; var lpdwCount: DWORD;
1624 lpdvVector: PD3DVector) : HResult; stdcall;
1625 function SetNormals(dwFirst, dwCount: DWORD; const lpdvVector: TD3DVector) : HResult; stdcall;
1626 function GetNormals (dwFirst: DWORD; lpdwCount: PDWORD;
1627 var lpdvVector: TD3DVector) : HResult; stdcall;
1628 function GetNormalCount : integer; stdcall;
1629 end;
1630
1631 IDirect3DRMLight = interface (IDirect3DRMObject)
1632 ['{eb16cb08-d271-11ce-ac48-0000c03825a1}']
1633 (*
1634 * IDirect3DRMLight methods
1635 *)
1636 function SetType (d3drmtType: TD3DRMLightType) : HResult; stdcall;
1637 function SetColor (rcColor: TD3DColor) : HResult; stdcall;
1638 function SetColorRGB (rvRed, rvGreen, rvBlue: TD3DValue) : HResult; stdcall;
1639 function SetRange (rvRange: TD3DValue) : HResult; stdcall;
1640 function SetUmbra (rvAngle: TD3DValue) : HResult; stdcall;
1641 function SetPenumbra (rvAngle: TD3DValue) : HResult; stdcall;
1642 function SetConstantAttenuation (rvAtt: TD3DValue) : HResult; stdcall;
1643 function SetLinearAttenuation (rvAtt: TD3DValue) : HResult; stdcall;
1644 function SetQuadraticAttenuation (rvAtt: TD3DValue) : HResult; stdcall;
1645 function GetRange: TD3DValue; stdcall;
1646 function GetUmbra: TD3DValue; stdcall;
1647 function GetPenumbra: TD3DValue; stdcall;
1648 function GetConstantAttenuation: TD3DValue; stdcall;
1649 function GetLinearAttenuation: TD3DValue; stdcall;
1650 function GetQuadraticAttenuation: TD3DValue; stdcall;
1651 function GetColor: TD3DColor; stdcall;
1652 function GetType: TD3DRMLightType; stdcall;
1653 function SetEnableFrame (lpEnableFrame: IDirect3DRMFrame) : HResult; stdcall;
1654 function GetEnableFrame (out lplpEnableFrame: IDirect3DRMFrame) : HResult; stdcall;
1655 end;
1656
1657 IDirect3DRMTexture = interface (IDirect3DRMVisual)
1658 ['{eb16cb09-d271-11ce-ac48-0000c03825a1}']
1659 (*
1660 * IDirect3DRMTexture methods
1661 *)
1662 function InitFromFile (filename: PAnsiChar) : HResult; stdcall;
1663 function InitFromSurface (lpDDS: IDirectDrawSurface) : HResult; stdcall;
1664 function InitFromResource (rs: HRSRC) : HResult; stdcall;
1665 function Changed (bPixels, bPalette: BOOL) : HResult; stdcall;
1666 function SetColors (ulColors: DWORD) : HResult; stdcall;
1667 function SetShades (ulShades: DWORD) : HResult; stdcall;
1668 function SetDecalSize (rvWidth, rvHeight: TD3DValue) : HResult; stdcall;
1669 function SetDecalOrigin (lX, lY: LongInt) : HResult; stdcall;
1670 function SetDecalScale (dwScale: DWORD) : HResult; stdcall;
1671 function SetDecalTransparency (bTransp: BOOL) : HResult; stdcall;
1672 function SetDecalTransparentColor (rcTransp: TD3DColor) : HResult; stdcall;
1673 function GetDecalSize (out lprvWidth, lprvHeight: TD3DValue) : HResult; stdcall;
1674 function GetDecalOrigin (out lplX, lplY: LongInt) : HResult; stdcall;
1675 function GetImage: PD3DRMImage; stdcall;
1676 function GetShades: DWORD; stdcall;
1677 function GetColors: DWORD; stdcall;
1678 function GetDecalScale: DWORD; stdcall;
1679 function GetDecalTransparency: BOOL; stdcall;
1680 function GetDecalTransparentColor: TD3DColor; stdcall;
1681 end;
1682
1683 IDirect3DRMTexture2 = interface (IDirect3DRMTexture)
1684 ['{120f30c0-1629-11d0-941c-0080c80cfa7b}']
1685 (*
1686 * IDirect3DRMTexture2 methods
1687 *)
1688 function InitFromImage (const lpImage: TD3DRMImage) : HResult; stdcall;
1689 function InitFromResource2 (hModule: HModule;
1690 strName, strType: PAnsiChar) : HResult; stdcall;
1691 function GenerateMIPMap (dwFlags: DWORD) : HResult; stdcall;
1692 end;
1693
1694 IDirect3DRMTexture3 = interface (IDirect3DRMTexture2)
1695 ['{ff6b7f73-a40e-11d1-91f9-0000f8758e66}']
1696 (*
1697 * IDirect3DRMTexture3 methods
1698 *)
1699 function GetSurface
1700 (dwFlags: DWORD; out lplpDDS: IDirectDrawSurface) : HResult; stdcall;
1701 function SetCacheOptions (lImportance: integer; dwFlags: DWORD) : HResult; stdcall;
1702 function GetCacheOptions (var lplImportance: integer; var lpdwFlags: DWORD) : HResult; stdcall;
1703 function SetDownsampleCallback (
1704 pCallback: TD3DRMDownSampleCallback; pArg: pointer) : HResult; stdcall;
1705 function SetValidationCallback (
1706 pCallback: TD3DRMValidationCallback; pArg: pointer) : HResult; stdcall;
1707 end;
1708
1709 IDirect3DRMWrap = interface (IDirect3DRMObject)
1710 ['{eb16cb0a-d271-11ce-ac48-0000c03825a1}']
1711 (*
1712 * IDirect3DRMWrap methods
1713 *)
1714 function Init (d3drmwt: TD3DRMWrapType; lpd3drmfRef: IDirect3DRMFrame;
1715 ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv: TD3DValue)
1716 : HResult; stdcall;
1717 function Apply (lpObject: IDirect3DRMObject) : HResult; stdcall;
1718 function ApplyRelative(frame: IDirect3DRMFrame; mesh: IDirect3DRMObject) : HResult; stdcall;
1719 end;
1720
1721 IDirect3DRMMaterial = interface (IDirect3DRMObject)
1722 ['{eb16cb0b-d271-11ce-ac48-0000c03825a1}']
1723 (*
1724 * IDirect3DRMMaterial methods
1725 *)
1726 function SetPower (rvPower: TD3DValue) : HResult; stdcall;
1727 function SetSpecular (r, g, b: TD3DValue) : HResult; stdcall;
1728 function SetEmissive (r, g, b: TD3DValue) : HResult; stdcall;
1729 function GetPower: TD3DValue; stdcall;
1730 function GetSpecular (out lpr, lpg, lpb: TD3DValue) : HResult; stdcall;
1731 function GetEmissive (out lpr, lpg, lpb: TD3DValue) : HResult; stdcall;
1732 end;
1733
1734 IDirect3DRMMaterial2 = interface (IDirect3DRMMaterial)
1735 ['{ff6b7f75-a40e-11d1-91f9-0000f8758e66}']
1736 (*
1737 * IDirect3DRMMaterial2 methods
1738 *)
1739 function GetAmbient(out r,g,b: TD3DValue) : HResult; stdcall;
1740 function SetAmbient(r,g,b: TD3DValue) : HResult; stdcall;
1741 end;
1742
1743 IDirect3DRMAnimation = interface (IDirect3DRMObject)
1744 ['{eb16cb0d-d271-11ce-ac48-0000c03825a1}']
1745 (*
1746 * IDirect3DRMAnimation methods
1747 *)
1748 function SetOptions (d3drmanimFlags: TD3DRMAnimationOptions) : HResult; stdcall;
1749 function AddRotateKey (rvTime: TD3DValue; const rqQuat: TD3DRMQuaternion) : HResult; stdcall;
1750 function AddPositionKey (rvTime, rvX, rvY, rvZ: TD3DValue) : HResult; stdcall;
1751 function AddScaleKey (time, x, y, z: TD3DValue) : HResult; stdcall;
1752 function DeleteKey (time: TD3DValue) : HResult; stdcall;
1753 function SetFrame (lpD3DRMFrame: IDirect3DRMFrame) : HResult; stdcall;
1754 function SetTime (rvTime: TD3DValue) : HResult; stdcall;
1755 function GetOptions: TD3DRMAnimationOptions; stdcall;
1756 end;
1757
1758 IDirect3DRMAnimation2 = interface (IDirect3DRMAnimation)
1759 ['{ff6b7f77-a40e-11d1-91f9-0000f8758e66}']
1760 (*
1761 * IDirect3DRMAnimation methods
1762 *)
1763 function GetFrame (out lpD3DFrame: IDirect3DRMFrame3) : HResult; stdcall;
1764 function DeleteKeyByID (dwID: DWORD) : HResult; stdcall;
1765 function AddKey (const lpKey: TD3DRMAnimationKey) : HResult; stdcall;
1766 function ModifyKey (const lpKey: TD3DRMAnimationKey) : HResult; stdcall;
1767 function GetKeys (dvTimeMin, dvTimeMax: TD3DValue; var lpdwNumKeys: DWORD;
1768 lpKey: PD3DRMAnimationKey) : HResult; stdcall;
1769 end;
1770
1771 IDirect3DRMAnimationSet = interface (IDirect3DRMObject)
1772 ['{eb16cb0e-d271-11ce-ac48-0000c03825a1}']
1773 (*
1774 * IDirect3DRMAnimationSet methods
1775 *)
1776 function AddAnimation (lpD3DRMAnimation: IDirect3DRMAnimation) : HResult; stdcall;
1777 function Load (lpvObjSource, lpvObjID: Pointer;
1778 d3drmLOFlags: TD3DRMLoadOptions;
1779 d3drmLoadTextureProc: TD3DRMLoadTextureCallback; lpArgLTP: Pointer;
1780 lpParentFrame: IDirect3DRMFrame) : HResult; stdcall;
1781 function DeleteAnimation (lpD3DRMAnimation: IDirect3DRMAnimation) : HResult; stdcall;
1782 function SetTime (rvTime: TD3DValue) : HResult; stdcall;
1783 end;
1784
1785 IDirect3DRMAnimationSet2 = interface (IDirect3DRMObject)
1786 ['{ff6b7f79-a40e-11d1-91f9-0000f8758e66}']
1787 (*
1788 * IDirect3DRMAnimationSet methods
1789 *)
1790 function AddAnimation (lpD3DRMAnimation: IDirect3DRMAnimation2) : HResult; stdcall;
1791 function Load (lpvObjSource, lpvObjID: Pointer;
1792 d3drmLOFlags: TD3DRMLoadOptions;
1793 d3drmLoadTextureProc: TD3DRMLoadTexture3Callback; lpArgLTP: Pointer;
1794 lpParentFrame: IDirect3DRMFrame3) : HResult; stdcall;
1795 function DeleteAnimation (lpD3DRMAnimation: IDirect3DRMAnimation2) : HResult; stdcall;
1796 function SetTime (rvTime: TD3DValue) : HResult; stdcall;
1797 function GetAnimations(out lplpArray: IDirect3DRMAnimationArray) : HResult; stdcall;
1798 end;
1799
1800 IDirect3DRMUserVisual = interface (IDirect3DRMVisual)
1801 ['{59163de0-6d43-11cf-ac4a-0000c03825a1}']
1802 (*
1803 * IDirect3DRMUserVisual methods
1804 *)
1805 function Init (d3drmUVProc: TD3DRMUserVisualCallback;
1806 lpArg: Pointer) : HResult; stdcall;
1807 end;
1808
1809 IDirect3DRMArray = interface (IUnknown)
1810 function GetSize: DWORD; stdcall;
1811 (* No GetElement method as it would get overloaded
1812 * in derived classes, and overloading is
1813 * a no-no in COM
1814 *)
1815 end;
1816
1817 IDirect3DRMObjectArray = interface (IDirect3DRMArray)
1818 ['{242f6bc2-3849-11d0-9b6d-0000c0781bc3}']
1819 function GetElement (index: DWORD; out lplpD3DRMObject:
1820 IDirect3DRMObject) : HResult; stdcall;
1821 end;
1822
1823 IDirect3DRMDeviceArray = interface (IDirect3DRMArray)
1824 ['{eb16cb0e-d271-11ce-ac48-0000c03825a1}']
1825 function GetElement (index: DWORD; out lplpD3DRMDevice:
1826 IDirect3DRMDevice) : HResult; stdcall;
1827 end;
1828
1829 IDirect3DRMFrameArray = interface (IDirect3DRMArray)
1830 ['{eb16cb12-d271-11ce-ac48-0000c03825a1}']
1831 function GetElement (index: DWORD; out lplpD3DRMFrame: IDirect3DRMFrame) : HResult; stdcall;
1832 end;
1833
1834 IDirect3DRMViewportArray = interface (IDirect3DRMArray)
1835 ['{eb16cb11-d271-11ce-ac48-0000c03825a1}']
1836 function GetElement (index: DWORD; out lplpD3DRMViewport:
1837 IDirect3DRMViewport) : HResult; stdcall;
1838 end;
1839
1840 IDirect3DRMVisualArray = interface (IDirect3DRMArray)
1841 ['{eb16cb13-d271-11ce-ac48-0000c03825a1}']
1842 function GetElement (index: DWORD; out lplpD3DRMVisual:
1843 IDirect3DRMVisual) : HResult; stdcall;
1844 end;
1845
1846 IDirect3DRMAnimationArray = interface (IDirect3DRMArray)
1847 ['{d5f1cae0-4bd7-11d1-b974-0060083e45f3}']
1848 function GetElement (index: DWORD; out lplpD3DRMAnimation2:
1849 IDirect3DRMAnimation2) : HResult; stdcall;
1850 end;
1851
1852 IDirect3DRMPickedArray = interface (IDirect3DRMArray)
1853 ['{eb16cb16-d271-11ce-ac48-0000c03825a1}']
1854 function GetPick (index: DWORD; out lplpVisual: IDirect3DRMVisual;
1855 out lplpFrameArray: IDirect3DRMFrameArray;
1856 const lpD3DRMPickDesc: TD3DRMPickDesc) : HResult; stdcall;
1857
1858 end;
1859
1860 IDirect3DRMLightArray = interface (IDirect3DRMArray)
1861 ['{eb16cb14-d271-11ce-ac48-0000c03825a1}']
1862 function GetElement (index: DWORD; out lplpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
1863 end;
1864
1865
1866 IDirect3DRMFaceArray = interface (IDirect3DRMArray)
1867 ['{eb16cb17-d271-11ce-ac48-0000c03825a1}']
1868 function GetElement (index: DWORD; out lplpD3DRMFace: IDirect3DRMFace) : HResult; stdcall;
1869 end;
1870
1871 IDirect3DRMPicked2Array = interface (IDirect3DRMArray)
1872 ['{4516ec7b-8f20-11d0-9b6d-0000c0781bc3}']
1873 function GetPick (index: DWORD; out lplpVisual: IDirect3DRMVisual;
1874 out lplpFrameArray: IDirect3DRMFrameArray; const lpD3DRMPickDesc2:
1875 TD3DRMPickDesc2) : HResult; stdcall;
1876 end;
1877
1878 IDirect3DRMInterpolator = interface (IDirect3DRMObject)
1879 ['{242f6bc1-3849-11d0-9b6d-0000c0781bc3}']
1880 (*
1881 * IDirect3DRMInterpolator methods
1882 *)
1883 function AttachObject (lpD3DRMObject: IDirect3DRMObject) : HResult; stdcall;
1884 function GetAttachedObjects
1885 (lpD3DRMObjectArray: IDirect3DRMObjectArray) : HResult; stdcall;
1886 function DetachObject (lpD3DRMObject: IDirect3DRMObject) : HResult; stdcall;
1887 function SetIndex (d3dVal: TD3DValue) : HResult; stdcall;
1888 function GetIndex : TD3DValue; stdcall;
1889 function Interpolate (d3dVal: TD3DValue; lpD3DRMObject: IDirect3DRMObject;
1890 d3drmInterpFlags: TD3DRMInterpolationOptions) : HResult; stdcall;
1891 end;
1892
1893 IDirect3DRMClippedVisual = interface (IDirect3DRMObject)
1894 ['{5434e733-6d66-11d1-bb0b-0000f875865a}']
1895 (*
1896 * IDirect3DRMClippedVisual methods
1897 *)
1898 function Init (lpD3DRMVisual: IDirect3DRMVisual) : HResult; stdcall;
1899 function AddPlane (lpRef: IDirect3DRMFrame3;
1900 const lpdvPoint, lpdvNormal: TD3DVector;
1901 dwFlags: DWORD; out lpdwReturnID: DWORD) : HResult; stdcall;
1902 function DeletePlane (dwID, dwFlags: DWORD) : HResult; stdcall;
1903 function GetPlaneIDs (var lpdwCount: DWORD; out lpdwID: DWORD; dwFlags: DWORD) : HResult; stdcall;
1904 function GetPlane (dwID: DWORD; lpRef: IDirect3DRMFrame3;
1905 out lpdvPoint, lpdvNormal: TD3DVector; dwFlags: DWORD) : HResult; stdcall;
1906 function SetPlane (dwID: DWORD; lpRef: IDirect3DRMFrame3;
1907 const lpdvPoint, lpdvNormal: TD3DVector; dwFlags: DWORD) : HResult; stdcall;
1908 end;
1909
1910 (*==========================================================================;
1911 *
1912 * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
1913 *
1914 * File: d3drm.h
1915 * Content: Direct3DRM include file
1916 *
1917 ***************************************************************************)
1918
1919 function D3DRMErrorString(Value: HResult) : string;
1920
1921 type
Diff truncated after the static-page render limit. Clone the repository to inspect the complete change.
DeletedDirectX/DirectDraw.pas +0−5835
Diff omitted because this commit exceeds the static-page render limit.
DeletedDirectX/DirectInput.pas +0−2746
Diff omitted because this commit exceeds the static-page render limit.
DeletedDirectX/DirectMusic.pas +0−4085
Diff omitted because this commit exceeds the static-page render limit.
DeletedDirectX/DirectPlay.pas +0−2511
Diff omitted because this commit exceeds the static-page render limit.
DeletedDirectX/DirectSetup.pas +0−347
Diff omitted because this commit exceeds the static-page render limit.
DeletedDirectX/DirectSound.pas +0−765
Diff omitted because this commit exceeds the static-page render limit.
DeletedDirectX/Readme.txt +0−13
Diff omitted because this commit exceeds the static-page render limit.
DeletedDirectX/comswitch.inc +0−7
Diff omitted because this commit exceeds the static-page render limit.
DeletedDirectX/stringswitch.inc +0−7
Diff omitted because this commit exceeds the static-page render limit.
ModifiedGBEmu.lps +57−110
Diff omitted because this commit exceeds the static-page render limit.
ModifiedSound/sound.pas +2−2
Diff omitted because this commit exceeds the static-page render limit.
ModifiedUnitMain.lfm +2−2
Diff omitted because this commit exceeds the static-page render limit.
ModifiedUnitMain.pas +21−1
Diff omitted because this commit exceeds the static-page render limit.
Modifiedmainloop.pas +1−5
Diff omitted because this commit exceeds the static-page render limit.
Addedoutf2.pcm +0−0
File metadata changed without textual changes.