Subversion Repositories spacemission

Rev

Rev 16 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 16 Rev 21
1
(*==========================================================================;
1
(*==========================================================================;
2
 *
2
 *
3
 *  Copyright (C) 1994-1999 Microsoft Corporation.  All Rights Reserved.
3
 *  Copyright (C) 1994-1999 Microsoft Corporation.  All Rights Reserved.
4
 *
4
 *
5
 *  DirectX header version 98.11.20
5
 *  DirectX header version 98.11.20
6
 *
6
 *
7
 *  Present by Hiroyuki Hori.
7
 *  Present by Hiroyuki Hori.
8
 *
8
 *
9
 *  E-Mail: hori@ingjapan.ne.jp
9
 *  E-Mail: hori@ingjapan.ne.jp
10
 *  Homepage: http://www.ingjapan.ne.jp/hori/index.html
10
 *  Homepage: http://www.ingjapan.ne.jp/hori/index.html
11
 *  Homepage: http://www.ingjapan.ne.jp/hori/index-e.html
11
 *  Homepage: http://www.ingjapan.ne.jp/hori/index-e.html
12
 *
12
 *
13
 *  Present unit:
13
 *  Present unit:
14
 *    DirectX.pas    DirectX 7 (DirectX 7 SDK)
14
 *    DirectX.pas    DirectX 7 (DirectX 7 SDK)
15
 *    DShow.pas      DirectShow (DirectX Media SDK 5.1)
15
 *    DShow.pas      DirectShow (DirectX Media SDK 5.1)
16
 *    DAnim.pas      DirectAnimation (DirectX Media SDK 5.1)
16
 *    DAnim.pas      DirectAnimation (DirectX Media SDK 5.1)
17
 *
17
 *
18
 *--------------------------------------------------------------------------
18
 *--------------------------------------------------------------------------
19
 *
19
 *
20
 *    DirectMusic header version 1.0
20
 *    DirectMusic header version 1.0
21
 *
21
 *
22
 *    Present by Kazuya Yamane
22
 *    Present by Kazuya Yamane
23
 *
23
 *
24
 *    e-mail : kazuya-y@infosakyu.ne.jp
24
 *    e-mail : kazuya-y@infosakyu.ne.jp
25
 *    URL    : http://www.infosakyu.ne.jp/~kazuya-y/index.html
25
 *    URL    : http://www.infosakyu.ne.jp/~kazuya-y/index.html
26
 *
26
 *
27
 ***************************************************************************)
27
 ***************************************************************************)
28
{
28
{
29
(c)2004 Jaro Benes Recompilation with Erik Unger's headers
29
(c)2004 Jaro Benes Recompilation with Erik Unger's headers
30
 
30
 
31
Join in order:
31
Join in order:
32
  1) DirectDraw
32
  1) DirectDraw
33
  2) Direct3D
33
  2) Direct3D
34
  3) Direct3DRM
34
  3) Direct3DRM
35
  4) DirectInput
35
  4) DirectInput
36
  5) DirectPlay
36
  5) DirectPlay
37
  6) DirectSetup
37
  6) DirectSetup
38
  7) DirectSound
38
  7) DirectSound
39
  8) DirectMusic
39
  8) DirectMusic
40
}
40
}
41
Unit DirectX;
41
Unit DirectX;
42
 
42
 
43
Interface
43
Interface
44
 
44
 
45
{Delphi version marks}
45
{Delphi version marks}
46
 
46
 
47
{$I DelphiXcfg.inc}
47
{$I DelphiXcfg.inc}
48
 
48
 
49
{$MINENUMSIZE 4}
49
{$MINENUMSIZE 4}
50
{$ALIGN ON}
50
{$ALIGN ON}
51
 
51
 
52
uses
52
uses
53
  Windows, MMSystem;
53
  Windows, MMSystem;
-
 
54
 
-
 
55
type
-
 
56
{$IFDEF UNICODE}
-
 
57
  PCharAW = PWideChar;
-
 
58
{$ELSE}
-
 
59
  PCharAW = PAnsiChar;
-
 
60
{$ENDIF}
-
 
61
 
54
//DirectDraw file
62
//DirectDraw file
55
(*==========================================================================;
63
(*==========================================================================;
56
 *
64
 *
57
 *  Copyright (C) 1994-1997 Microsoft Corporation.  All Rights Reserved.
65
 *  Copyright (C) 1994-1997 Microsoft Corporation.  All Rights Reserved.
58
 *
66
 *
59
 *  Files:      ddraw.h dvp.h
67
 *  Files:      ddraw.h dvp.h
60
 *  Content:    DirectDraw and DirectDrawVideoPort include files
68
 *  Content:    DirectDraw and DirectDrawVideoPort include files
61
 *
69
 *
62
 *  DirectX 7.0 Delphi adaptation by Erik Unger
70
 *  DirectX 7.0 Delphi adaptation by Erik Unger
63
 *
71
 *
64
 *  Modified: 10-Sep-2000
72
 *  Modified: 10-Sep-2000
65
 *
73
 *
66
 *  Download: http://www.delphi-jedi.org/DelphiGraphics/
74
 *  Download: http://www.delphi-jedi.org/DelphiGraphics/
67
 *  E-Mail: DelphiDirectX@next-reality.com
75
 *  E-Mail: DelphiDirectX@next-reality.com
68
 *
76
 *
69
 *
77
 *
70
 ***************************************************************************)
78
 ***************************************************************************)
71
 
79
 
72
var
80
var
73
  DDrawDLL : HMODULE = 0;
81
  DDrawDLL : HMODULE = 0;
74
 
82
 
75
function DDErrorString(Value: HResult) : string;
83
function DDErrorString(Value: HResult) : string;
76
 
84
 
77
function MAKEFOURCC(ch0, ch1, ch2, ch3: Char) : DWORD;
85
function MAKEFOURCC(ch0, ch1, ch2, ch3: Char) : DWORD;
78
 
86
 
79
(*
87
(*
80
 * FOURCC codes for DX compressed-texture pixel formats
88
 * FOURCC codes for DX compressed-texture pixel formats
81
 *)
89
 *)
82
const
90
const
83
  FOURCC_DXT1 = 'DXT1';
91
  FOURCC_DXT1 = 'DXT1';
84
  FOURCC_DXT2 = 'DXT2';
92
  FOURCC_DXT2 = 'DXT2';
85
  FOURCC_DXT3 = 'DXT3';
93
  FOURCC_DXT3 = 'DXT3';
86
  FOURCC_DXT4 = 'DXT4';
94
  FOURCC_DXT4 = 'DXT4';
87
  FOURCC_DXT5 = 'DXT5';
95
  FOURCC_DXT5 = 'DXT5';
88
 
96
 
89
(*
97
(*
90
 * GUIDS used by DirectDraw objects
98
 * GUIDS used by DirectDraw objects
91
 *)
99
 *)
92
const
100
const
93
  CLSID_DirectDraw: TGUID = '{D7B70EE0-4340-11CF-B063-0020AFC2CD35}';
101
  CLSID_DirectDraw: TGUID = '{D7B70EE0-4340-11CF-B063-0020AFC2CD35}';
94
  CLSID_DirectDraw7: TGUID = '{3c305196-50db-11d3-9cfe-00c04fd930c5}';
102
  CLSID_DirectDraw7: TGUID = '{3c305196-50db-11d3-9cfe-00c04fd930c5}';
95
  CLSID_DirectDrawClipper: TGUID = '{593817A0-7DB3-11CF-A2DE-00AA00b93356}';
103
  CLSID_DirectDrawClipper: TGUID = '{593817A0-7DB3-11CF-A2DE-00AA00b93356}';
96
 
104
 
97
const
105
const
98
  DD_ROP_SPACE = (256 div 32);       // space required to store ROP array
106
  DD_ROP_SPACE = (256 div 32);       // space required to store ROP array
99
 
107
 
100
  MAX_DDDEVICEID_STRING = 512;
108
  MAX_DDDEVICEID_STRING = 512;
101
 
109
 
102
(*
110
(*
103
 * Flags for the IDirectDraw4::GetDeviceIdentifier method
111
 * Flags for the IDirectDraw4::GetDeviceIdentifier method
104
 *)
112
 *)
105
 
113
 
106
(*
114
(*
107
 * This flag causes GetDeviceIdentifier to return information about the host (typically 2D) adapter in a system equipped
115
 * This flag causes GetDeviceIdentifier to return information about the host (typically 2D) adapter in a system equipped
108
 * with a stacked secondary 3D adapter. Such an adapter appears to the application as if it were part of the
116
 * with a stacked secondary 3D adapter. Such an adapter appears to the application as if it were part of the
109
 * host adapter, but is typically physcially located on a separate card. The stacked secondary's information is
117
 * host adapter, but is typically physcially located on a separate card. The stacked secondary's information is
110
 * returned when GetDeviceIdentifier's dwFlags field is zero, since this most accurately reflects the qualities
118
 * returned when GetDeviceIdentifier's dwFlags field is zero, since this most accurately reflects the qualities
111
 * of the DirectDraw object involved.
119
 * of the DirectDraw object involved.
112
 *)
120
 *)
113
  DDGDI_GETHOSTIDENTIFIER         = $00000001;
121
  DDGDI_GETHOSTIDENTIFIER         = $00000001;
114
 
122
 
115
(*============================================================================
123
(*============================================================================
116
 *
124
 *
117
 * DirectDraw Structures
125
 * DirectDraw Structures
118
 *
126
 *
119
 * Various structures used to invoke DirectDraw.
127
 * Various structures used to invoke DirectDraw.
120
 *
128
 *
121
 *==========================================================================*)
129
 *==========================================================================*)
122
 
130
 
123
var
131
var
124
  NilGUID : TGUID{$IfNDef VER6UP} absolute 0{$EndIf};
132
  NilGUID : TGUID{$IfNDef VER6UP} absolute 0{$EndIf};
125
 
133
 
126
type
134
type
127
  TRefGUID = packed record
135
  TRefGUID = packed record
128
    case integer of
136
    case integer of
129
    1: (guid : PGUID);
137
    1: (guid : PGUID);
130
    2: (dwFlags : DWORD);
138
    2: (dwFlags : DWORD);
131
  end;
139
  end;
132
 
140
 
133
  IDirectDraw = interface;
141
  IDirectDraw = interface;
134
  IDirectDraw2 = interface;
142
  IDirectDraw2 = interface;
135
  IDirectDraw4 = interface;
143
  IDirectDraw4 = interface;
136
  IDirectDraw7 = interface;
144
  IDirectDraw7 = interface;
137
  IDirectDrawSurface = interface;
145
  IDirectDrawSurface = interface;
138
  IDirectDrawSurface2 = interface;
146
  IDirectDrawSurface2 = interface;
139
  IDirectDrawSurface3 = interface;
147
  IDirectDrawSurface3 = interface;
140
  IDirectDrawSurface4 = interface;
148
  IDirectDrawSurface4 = interface;
141
  IDirectDrawSurface7 = interface;
149
  IDirectDrawSurface7 = interface;
142
 
150
 
143
  IDirectDrawPalette = interface;
151
  IDirectDrawPalette = interface;
144
  IDirectDrawClipper = interface;
152
  IDirectDrawClipper = interface;
145
  IDirectDrawColorControl = interface;
153
  IDirectDrawColorControl = interface;
146
  IDirectDrawGammaControl = interface;
154
  IDirectDrawGammaControl = interface;
147
 
155
 
148
(*
156
(*
149
 * Generic pixel format with 8-bit RGB and alpha components
157
 * Generic pixel format with 8-bit RGB and alpha components
150
 *)
158
 *)
151
  PDDARGB = ^TDDARGB;
159
  PDDARGB = ^TDDARGB;
152
  TDDARGB = packed record
160
  TDDARGB = packed record
153
    blue:     BYTE;
161
    blue:     BYTE;
154
    green:    BYTE;
162
    green:    BYTE;
155
    red:      BYTE;
163
    red:      BYTE;
156
    alpha:    BYTE;
164
    alpha:    BYTE;
157
  end;
165
  end;
158
 
166
 
159
(*
167
(*
160
 * This version of the structure remains for backwards source compatibility.
168
 * This version of the structure remains for backwards source compatibility.
161
 * The DDARGB structure is the one that should be used for all DirectDraw APIs.
169
 * The DDARGB structure is the one that should be used for all DirectDraw APIs.
162
 *)
170
 *)
163
  PDDRGBA = ^TDDRGBA;
171
  PDDRGBA = ^TDDRGBA;
164
  TDDRGBA = packed record
172
  TDDRGBA = packed record
165
    red   : BYTE;
173
    red   : BYTE;
166
    green : BYTE;
174
    green : BYTE;
167
    blue  : BYTE;
175
    blue  : BYTE;
168
    alpha : BYTE;
176
    alpha : BYTE;
169
  end;
177
  end;
170
 
178
 
171
(*
179
(*
172
 * TDDColorKey
180
 * TDDColorKey
173
 *)
181
 *)
174
  PDDColorKey = ^TDDColorKey;
182
  PDDColorKey = ^TDDColorKey;
175
  TDDColorKey = packed record
183
  TDDColorKey = packed record
176
    dwColorSpaceLowValue: DWORD;   // low boundary of color space that is to
184
    dwColorSpaceLowValue: DWORD;   // low boundary of color space that is to
177
                                   // be treated as Color Key, inclusive
185
                                   // be treated as Color Key, inclusive
178
    dwColorSpaceHighValue: DWORD;  // high boundary of color space that is
186
    dwColorSpaceHighValue: DWORD;  // high boundary of color space that is
179
                                   // to be treated as Color Key, inclusive
187
                                   // to be treated as Color Key, inclusive
180
  end;
188
  end;
181
 
189
 
182
// Delphi 5 can't handle interface in variant records
190
// Delphi 5 can't handle interface in variant records
183
// so we have to use pointers instead (which can be type-casted into interfaces):
191
// so we have to use pointers instead (which can be type-casted into interfaces):
184
 
192
 
185
{$IFDEF VER5UP}
193
{$IFDEF VER5UP}
186
  PDirectDrawSurface = Pointer;              
194
  PDirectDrawSurface = Pointer;              
187
{$ELSE}
195
{$ELSE}
188
  PDirectDrawSurface = IDirectDrawSurface;
196
  PDirectDrawSurface = IDirectDrawSurface;
189
{$ENDIF}
197
{$ENDIF}
190
 
198
 
191
(*
199
(*
192
 * TDDBltFX
200
 * TDDBltFX
193
 * Used to pass override information to the DIRECTDRAWSURFACE callback Blt.
201
 * Used to pass override information to the DIRECTDRAWSURFACE callback Blt.
194
 *)
202
 *)
195
  PDDBltFX = ^TDDBltFX;
203
  PDDBltFX = ^TDDBltFX;
196
  TDDBltFX = packed record
204
  TDDBltFX = packed record
197
    dwSize                        : DWORD;     // size of structure
205
    dwSize                        : DWORD;     // size of structure
198
    dwDDFX                        : DWORD;     // FX operations
206
    dwDDFX                        : DWORD;     // FX operations
199
    dwROP                         : DWORD;     // Win32 raster operations
207
    dwROP                         : DWORD;     // Win32 raster operations
200
    dwDDROP                       : DWORD;     // Raster operations new for DirectDraw
208
    dwDDROP                       : DWORD;     // Raster operations new for DirectDraw
201
    dwRotationAngle               : DWORD;     // Rotation angle for blt
209
    dwRotationAngle               : DWORD;     // Rotation angle for blt
202
    dwZBufferOpCode               : DWORD;     // ZBuffer compares
210
    dwZBufferOpCode               : DWORD;     // ZBuffer compares
203
    dwZBufferLow                  : DWORD;     // Low limit of Z buffer
211
    dwZBufferLow                  : DWORD;     // Low limit of Z buffer
204
    dwZBufferHigh                 : DWORD;     // High limit of Z buffer
212
    dwZBufferHigh                 : DWORD;     // High limit of Z buffer
205
    dwZBufferBaseDest             : DWORD;     // Destination base value
213
    dwZBufferBaseDest             : DWORD;     // Destination base value
206
    dwZDestConstBitDepth          : DWORD;     // Bit depth used to specify Z constant for destination
214
    dwZDestConstBitDepth          : DWORD;     // Bit depth used to specify Z constant for destination
207
    case integer of
215
    case integer of
208
    0: (
216
    0: (
209
      dwZDestConst                : DWORD      // Constant to use as Z buffer for dest
217
      dwZDestConst                : DWORD      // Constant to use as Z buffer for dest
210
     );
218
     );
211
    1: (
219
    1: (
212
      lpDDSZBufferDest            : PDirectDrawSurface; // Surface to use as Z buffer for dest
220
      lpDDSZBufferDest            : PDirectDrawSurface; // Surface to use as Z buffer for dest
213
      dwZSrcConstBitDepth         : DWORD;     // Bit depth used to specify Z constant for source
221
      dwZSrcConstBitDepth         : DWORD;     // Bit depth used to specify Z constant for source
214
      case integer of
222
      case integer of
215
      0: (
223
      0: (
216
        dwZSrcConst               : DWORD;     // Constant to use as Z buffer for src
224
        dwZSrcConst               : DWORD;     // Constant to use as Z buffer for src
217
       );
225
       );
218
      1: (
226
      1: (
219
        lpDDSZBufferSrc           : PDirectDrawSurface; // Surface to use as Z buffer for src
227
        lpDDSZBufferSrc           : PDirectDrawSurface; // Surface to use as Z buffer for src
220
        dwAlphaEdgeBlendBitDepth  : DWORD;     // Bit depth used to specify constant for alpha edge blend
228
        dwAlphaEdgeBlendBitDepth  : DWORD;     // Bit depth used to specify constant for alpha edge blend
221
        dwAlphaEdgeBlend          : DWORD;     // Alpha for edge blending
229
        dwAlphaEdgeBlend          : DWORD;     // Alpha for edge blending
222
        dwReserved                : DWORD;
230
        dwReserved                : DWORD;
223
        dwAlphaDestConstBitDepth  : DWORD;     // Bit depth used to specify alpha constant for destination
231
        dwAlphaDestConstBitDepth  : DWORD;     // Bit depth used to specify alpha constant for destination
224
        case integer of
232
        case integer of
225
        0: (
233
        0: (
226
          dwAlphaDestConst        : DWORD;     // Constant to use as Alpha Channel
234
          dwAlphaDestConst        : DWORD;     // Constant to use as Alpha Channel
227
         );
235
         );
228
        1: (
236
        1: (
229
          lpDDSAlphaDest          : PDirectDrawSurface; // Surface to use as Alpha Channel
237
          lpDDSAlphaDest          : PDirectDrawSurface; // Surface to use as Alpha Channel
230
          dwAlphaSrcConstBitDepth : DWORD;     // Bit depth used to specify alpha constant for source
238
          dwAlphaSrcConstBitDepth : DWORD;     // Bit depth used to specify alpha constant for source
231
          case integer of
239
          case integer of
232
          0: (
240
          0: (
233
            dwAlphaSrcConst       : DWORD;     // Constant to use as Alpha Channel
241
            dwAlphaSrcConst       : DWORD;     // Constant to use as Alpha Channel
234
          );
242
          );
235
          1: (
243
          1: (
236
            lpDDSAlphaSrc         : PDirectDrawSurface; // Surface to use as Alpha Channel
244
            lpDDSAlphaSrc         : PDirectDrawSurface; // Surface to use as Alpha Channel
237
            case integer of
245
            case integer of
238
            0: (
246
            0: (
239
              dwFillColor         : DWORD;     // color in RGB or Palettized
247
              dwFillColor         : DWORD;     // color in RGB or Palettized
240
            );
248
            );
241
            1: (
249
            1: (
242
              dwFillDepth         : DWORD;     // depth value for z-buffer
250
              dwFillDepth         : DWORD;     // depth value for z-buffer
243
            );
251
            );
244
            2: (
252
            2: (
245
              dwFillPixel         : DWORD;     // pixel value
253
              dwFillPixel         : DWORD;     // pixel value
246
            );
254
            );
247
            3: (
255
            3: (
248
              lpDDSPattern        : PDirectDrawSurface; // Surface to use as pattern
256
              lpDDSPattern        : PDirectDrawSurface; // Surface to use as pattern
249
              ddckDestColorkey    : TDDColorKey; // DestColorkey override
257
              ddckDestColorkey    : TDDColorKey; // DestColorkey override
250
              ddckSrcColorkey     : TDDColorKey; // SrcColorkey override
258
              ddckSrcColorkey     : TDDColorKey; // SrcColorkey override
251
            )
259
            )
252
        )
260
        )
253
      )
261
      )
254
    )
262
    )
255
  )
263
  )
256
  end;
264
  end;
257
 
265
 
258
(*
266
(*
259
 * TDDSCaps
267
 * TDDSCaps
260
 *)
268
 *)
261
  PDDSCaps = ^TDDSCaps;
269
  PDDSCaps = ^TDDSCaps;
262
  TDDSCaps = packed record
270
  TDDSCaps = packed record
263
    dwCaps: DWORD;         // capabilities of surface wanted
271
    dwCaps: DWORD;         // capabilities of surface wanted
264
  end;
272
  end;
265
 
273
 
266
(*
274
(*
267
 * TDDOSCaps
275
 * TDDOSCaps
268
 *)
276
 *)
269
  PDDOSCaps = ^TDDOSCaps;
277
  PDDOSCaps = ^TDDOSCaps;
270
  TDDOSCaps = packed record
278
  TDDOSCaps = packed record
271
    dwCaps: DWORD;         // capabilities of surface wanted
279
    dwCaps: DWORD;         // capabilities of surface wanted
272
  end;
280
  end;
273
 
281
 
274
(*
282
(*
275
 * This structure is used internally by DirectDraw.
283
 * This structure is used internally by DirectDraw.
276
 *)
284
 *)
277
  PDDSCapsEx = ^TDDSCapsEx;
285
  PDDSCapsEx = ^TDDSCapsEx;
278
  TDDSCapsEx = packed record
286
  TDDSCapsEx = packed record
279
    dwCaps2 : DWORD;
287
    dwCaps2 : DWORD;
280
    dwCaps3 : DWORD;
288
    dwCaps3 : DWORD;
281
    dwCaps4 : DWORD;
289
    dwCaps4 : DWORD;
282
  end;
290
  end;
283
 
291
 
284
(*
292
(*
285
 * TDDSCaps2
293
 * TDDSCaps2
286
 *)
294
 *)
287
  PDDSCaps2 = ^TDDSCaps2;
295
  PDDSCaps2 = ^TDDSCaps2;
288
  TDDSCaps2 = packed record
296
  TDDSCaps2 = packed record
289
    dwCaps: DWORD;         // capabilities of surface wanted
297
    dwCaps: DWORD;         // capabilities of surface wanted
290
    dwCaps2 : DWORD;
298
    dwCaps2 : DWORD;
291
    dwCaps3 : DWORD;
299
    dwCaps3 : DWORD;
292
    dwCaps4 : DWORD;
300
    dwCaps4 : DWORD;
293
  end;
301
  end;
294
 
302
 
295
(*
303
(*
296
 * TDDCaps
304
 * TDDCaps
297
 *)
305
 *)
298
(*
306
(*
299
 * This structure is the TDDCaps structure as it was in version 2 and 3 of Direct X.
307
 * This structure is the TDDCaps structure as it was in version 2 and 3 of Direct X.
300
 * It is present for back compatability.
308
 * It is present for back compatability.
301
 *)
309
 *)
302
  PDDCaps_DX3 = ^TDDCaps_DX3;
310
  PDDCaps_DX3 = ^TDDCaps_DX3;
303
  TDDCaps_DX3 = packed record
311
  TDDCaps_DX3 = packed record
304
    dwSize: DWORD;                 // size of the DDDRIVERCAPS structure
312
    dwSize: DWORD;                 // size of the DDDRIVERCAPS structure
305
    dwCaps: DWORD;                 // driver specific capabilities
313
    dwCaps: DWORD;                 // driver specific capabilities
306
    dwCaps2: DWORD;                // more driver specific capabilites
314
    dwCaps2: DWORD;                // more driver specific capabilites
307
    dwCKeyCaps: DWORD;             // color key capabilities of the surface
315
    dwCKeyCaps: DWORD;             // color key capabilities of the surface
308
    dwFXCaps: DWORD;               // driver specific stretching and effects capabilites
316
    dwFXCaps: DWORD;               // driver specific stretching and effects capabilites
309
    dwFXAlphaCaps: DWORD;          // alpha driver specific capabilities
317
    dwFXAlphaCaps: DWORD;          // alpha driver specific capabilities
310
    dwPalCaps: DWORD;              // palette capabilities
318
    dwPalCaps: DWORD;              // palette capabilities
311
    dwSVCaps: DWORD;               // stereo vision capabilities
319
    dwSVCaps: DWORD;               // stereo vision capabilities
312
    dwAlphaBltConstBitDepths: DWORD;       // DDBD_2,4,8
320
    dwAlphaBltConstBitDepths: DWORD;       // DDBD_2,4,8
313
    dwAlphaBltPixelBitDepths: DWORD;       // DDBD_1,2,4,8
321
    dwAlphaBltPixelBitDepths: DWORD;       // DDBD_1,2,4,8
314
    dwAlphaBltSurfaceBitDepths: DWORD;     // DDBD_1,2,4,8
322
    dwAlphaBltSurfaceBitDepths: DWORD;     // DDBD_1,2,4,8
315
    dwAlphaOverlayConstBitDepths: DWORD;   // DDBD_2,4,8
323
    dwAlphaOverlayConstBitDepths: DWORD;   // DDBD_2,4,8
316
    dwAlphaOverlayPixelBitDepths: DWORD;   // DDBD_1,2,4,8
324
    dwAlphaOverlayPixelBitDepths: DWORD;   // DDBD_1,2,4,8
317
    dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
325
    dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
318
    dwZBufferBitDepths: DWORD;             // DDBD_8,16,24,32
326
    dwZBufferBitDepths: DWORD;             // DDBD_8,16,24,32
319
    dwVidMemTotal: DWORD;          // total amount of video memory
327
    dwVidMemTotal: DWORD;          // total amount of video memory
320
    dwVidMemFree: DWORD;           // amount of free video memory
328
    dwVidMemFree: DWORD;           // amount of free video memory
321
    dwMaxVisibleOverlays: DWORD;   // maximum number of visible overlays
329
    dwMaxVisibleOverlays: DWORD;   // maximum number of visible overlays
322
    dwCurrVisibleOverlays: DWORD;  // current number of visible overlays
330
    dwCurrVisibleOverlays: DWORD;  // current number of visible overlays
323
    dwNumFourCCCodes: DWORD;       // number of four cc codes
331
    dwNumFourCCCodes: DWORD;       // number of four cc codes
324
    dwAlignBoundarySrc: DWORD;     // source rectangle alignment
332
    dwAlignBoundarySrc: DWORD;     // source rectangle alignment
325
    dwAlignSizeSrc: DWORD;         // source rectangle byte size
333
    dwAlignSizeSrc: DWORD;         // source rectangle byte size
326
    dwAlignBoundaryDest: DWORD;    // dest rectangle alignment
334
    dwAlignBoundaryDest: DWORD;    // dest rectangle alignment
327
    dwAlignSizeDest: DWORD;        // dest rectangle byte size
335
    dwAlignSizeDest: DWORD;        // dest rectangle byte size
328
    dwAlignStrideAlign: DWORD;     // stride alignment
336
    dwAlignStrideAlign: DWORD;     // stride alignment
329
    dwRops: Array [0..DD_ROP_SPACE-1] of DWORD;   // ROPS supported
337
    dwRops: Array [0..DD_ROP_SPACE-1] of DWORD;   // ROPS supported
330
    ddsCaps: TDDSCaps;             // TDDSCaps structure has all the general capabilities
338
    ddsCaps: TDDSCaps;             // TDDSCaps structure has all the general capabilities
331
    dwMinOverlayStretch: DWORD;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
339
    dwMinOverlayStretch: DWORD;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
332
    dwMaxOverlayStretch: DWORD;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
340
    dwMaxOverlayStretch: DWORD;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
333
    dwMinLiveVideoStretch: DWORD;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
341
    dwMinLiveVideoStretch: DWORD;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
334
    dwMaxLiveVideoStretch: DWORD;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
342
    dwMaxLiveVideoStretch: DWORD;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
335
    dwMinHwCodecStretch: DWORD;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
343
    dwMinHwCodecStretch: DWORD;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
336
    dwMaxHwCodecStretch: DWORD;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
344
    dwMaxHwCodecStretch: DWORD;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
337
    dwReserved1: DWORD;            // reserved
345
    dwReserved1: DWORD;            // reserved
338
    dwReserved2: DWORD;            // reserved
346
    dwReserved2: DWORD;            // reserved
339
    dwReserved3: DWORD;            // reserved
347
    dwReserved3: DWORD;            // reserved
340
    dwSVBCaps: DWORD;              // driver specific capabilities for System->Vmem blts
348
    dwSVBCaps: DWORD;              // driver specific capabilities for System->Vmem blts
341
    dwSVBCKeyCaps: DWORD;          // driver color key capabilities for System->Vmem blts
349
    dwSVBCKeyCaps: DWORD;          // driver color key capabilities for System->Vmem blts
342
    dwSVBFXCaps: DWORD;            // driver FX capabilities for System->Vmem blts
350
    dwSVBFXCaps: DWORD;            // driver FX capabilities for System->Vmem blts
343
    dwSVBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
351
    dwSVBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
344
    dwVSBCaps: DWORD;              // driver specific capabilities for Vmem->System blts
352
    dwVSBCaps: DWORD;              // driver specific capabilities for Vmem->System blts
345
    dwVSBCKeyCaps: DWORD;          // driver color key capabilities for Vmem->System blts
353
    dwVSBCKeyCaps: DWORD;          // driver color key capabilities for Vmem->System blts
346
    dwVSBFXCaps: DWORD;            // driver FX capabilities for Vmem->System blts
354
    dwVSBFXCaps: DWORD;            // driver FX capabilities for Vmem->System blts
347
    dwVSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
355
    dwVSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
348
    dwSSBCaps: DWORD;              // driver specific capabilities for System->System blts
356
    dwSSBCaps: DWORD;              // driver specific capabilities for System->System blts
349
    dwSSBCKeyCaps: DWORD;          // driver color key capabilities for System->System blts
357
    dwSSBCKeyCaps: DWORD;          // driver color key capabilities for System->System blts
350
    dwSSBFXCaps: DWORD;            // driver FX capabilities for System->System blts
358
    dwSSBFXCaps: DWORD;            // driver FX capabilities for System->System blts
351
    dwSSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
359
    dwSSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
352
    dwReserved4 : DWORD;
360
    dwReserved4 : DWORD;
353
    dwReserved5 : DWORD;
361
    dwReserved5 : DWORD;
354
    dwReserved6 : DWORD;
362
    dwReserved6 : DWORD;
355
  end;
363
  end;
356
 
364
 
357
(*
365
(*
358
 * This structure is the TDDCaps structure as it was in version 5 of Direct X.
366
 * This structure is the TDDCaps structure as it was in version 5 of Direct X.
359
 * It is present for back compatability.
367
 * It is present for back compatability.
360
 *)
368
 *)
361
  PDDCaps_DX5 = ^TDDCaps_DX5;
369
  PDDCaps_DX5 = ^TDDCaps_DX5;
362
  TDDCaps_DX5 = packed record
370
  TDDCaps_DX5 = packed record
363
    dwSize: DWORD;                 // size of the DDDRIVERCAPS structure
371
    dwSize: DWORD;                 // size of the DDDRIVERCAPS structure
364
    dwCaps: DWORD;                 // driver specific capabilities
372
    dwCaps: DWORD;                 // driver specific capabilities
365
    dwCaps2: DWORD;                // more driver specific capabilites
373
    dwCaps2: DWORD;                // more driver specific capabilites
366
    dwCKeyCaps: DWORD;             // color key capabilities of the surface
374
    dwCKeyCaps: DWORD;             // color key capabilities of the surface
367
    dwFXCaps: DWORD;               // driver specific stretching and effects capabilites
375
    dwFXCaps: DWORD;               // driver specific stretching and effects capabilites
368
    dwFXAlphaCaps: DWORD;          // alpha driver specific capabilities
376
    dwFXAlphaCaps: DWORD;          // alpha driver specific capabilities
369
    dwPalCaps: DWORD;              // palette capabilities
377
    dwPalCaps: DWORD;              // palette capabilities
370
    dwSVCaps: DWORD;               // stereo vision capabilities
378
    dwSVCaps: DWORD;               // stereo vision capabilities
371
    dwAlphaBltConstBitDepths: DWORD;       // DDBD_2,4,8
379
    dwAlphaBltConstBitDepths: DWORD;       // DDBD_2,4,8
372
    dwAlphaBltPixelBitDepths: DWORD;       // DDBD_1,2,4,8
380
    dwAlphaBltPixelBitDepths: DWORD;       // DDBD_1,2,4,8
373
    dwAlphaBltSurfaceBitDepths: DWORD;     // DDBD_1,2,4,8
381
    dwAlphaBltSurfaceBitDepths: DWORD;     // DDBD_1,2,4,8
374
    dwAlphaOverlayConstBitDepths: DWORD;   // DDBD_2,4,8
382
    dwAlphaOverlayConstBitDepths: DWORD;   // DDBD_2,4,8
375
    dwAlphaOverlayPixelBitDepths: DWORD;   // DDBD_1,2,4,8
383
    dwAlphaOverlayPixelBitDepths: DWORD;   // DDBD_1,2,4,8
376
    dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
384
    dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
377
    dwZBufferBitDepths: DWORD;             // DDBD_8,16,24,32
385
    dwZBufferBitDepths: DWORD;             // DDBD_8,16,24,32
378
    dwVidMemTotal: DWORD;          // total amount of video memory
386
    dwVidMemTotal: DWORD;          // total amount of video memory
379
    dwVidMemFree: DWORD;           // amount of free video memory
387
    dwVidMemFree: DWORD;           // amount of free video memory
380
    dwMaxVisibleOverlays: DWORD;   // maximum number of visible overlays
388
    dwMaxVisibleOverlays: DWORD;   // maximum number of visible overlays
381
    dwCurrVisibleOverlays: DWORD;  // current number of visible overlays
389
    dwCurrVisibleOverlays: DWORD;  // current number of visible overlays
382
    dwNumFourCCCodes: DWORD;       // number of four cc codes
390
    dwNumFourCCCodes: DWORD;       // number of four cc codes
383
    dwAlignBoundarySrc: DWORD;     // source rectangle alignment
391
    dwAlignBoundarySrc: DWORD;     // source rectangle alignment
384
    dwAlignSizeSrc: DWORD;         // source rectangle byte size
392
    dwAlignSizeSrc: DWORD;         // source rectangle byte size
385
    dwAlignBoundaryDest: DWORD;    // dest rectangle alignment
393
    dwAlignBoundaryDest: DWORD;    // dest rectangle alignment
386
    dwAlignSizeDest: DWORD;        // dest rectangle byte size
394
    dwAlignSizeDest: DWORD;        // dest rectangle byte size
387
    dwAlignStrideAlign: DWORD;     // stride alignment
395
    dwAlignStrideAlign: DWORD;     // stride alignment
388
    dwRops: Array [0..DD_ROP_SPACE-1] of DWORD;   // ROPS supported
396
    dwRops: Array [0..DD_ROP_SPACE-1] of DWORD;   // ROPS supported
389
    ddsCaps: TDDSCaps;             // TDDSCaps structure has all the general capabilities
397
    ddsCaps: TDDSCaps;             // TDDSCaps structure has all the general capabilities
390
    dwMinOverlayStretch: DWORD;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
398
    dwMinOverlayStretch: DWORD;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
391
    dwMaxOverlayStretch: DWORD;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
399
    dwMaxOverlayStretch: DWORD;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
392
    dwMinLiveVideoStretch: DWORD;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
400
    dwMinLiveVideoStretch: DWORD;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
393
    dwMaxLiveVideoStretch: DWORD;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
401
    dwMaxLiveVideoStretch: DWORD;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
394
    dwMinHwCodecStretch: DWORD;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
402
    dwMinHwCodecStretch: DWORD;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
395
    dwMaxHwCodecStretch: DWORD;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
403
    dwMaxHwCodecStretch: DWORD;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
396
    dwReserved1: DWORD;            // reserved
404
    dwReserved1: DWORD;            // reserved
397
    dwReserved2: DWORD;            // reserved
405
    dwReserved2: DWORD;            // reserved
398
    dwReserved3: DWORD;            // reserved
406
    dwReserved3: DWORD;            // reserved
399
    dwSVBCaps: DWORD;              // driver specific capabilities for System->Vmem blts
407
    dwSVBCaps: DWORD;              // driver specific capabilities for System->Vmem blts
400
    dwSVBCKeyCaps: DWORD;          // driver color key capabilities for System->Vmem blts
408
    dwSVBCKeyCaps: DWORD;          // driver color key capabilities for System->Vmem blts
401
    dwSVBFXCaps: DWORD;            // driver FX capabilities for System->Vmem blts
409
    dwSVBFXCaps: DWORD;            // driver FX capabilities for System->Vmem blts
402
    dwSVBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
410
    dwSVBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
403
    dwVSBCaps: DWORD;              // driver specific capabilities for Vmem->System blts
411
    dwVSBCaps: DWORD;              // driver specific capabilities for Vmem->System blts
404
    dwVSBCKeyCaps: DWORD;          // driver color key capabilities for Vmem->System blts
412
    dwVSBCKeyCaps: DWORD;          // driver color key capabilities for Vmem->System blts
405
    dwVSBFXCaps: DWORD;            // driver FX capabilities for Vmem->System blts
413
    dwVSBFXCaps: DWORD;            // driver FX capabilities for Vmem->System blts
406
    dwVSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
414
    dwVSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
407
    dwSSBCaps: DWORD;              // driver specific capabilities for System->System blts
415
    dwSSBCaps: DWORD;              // driver specific capabilities for System->System blts
408
    dwSSBCKeyCaps: DWORD;          // driver color key capabilities for System->System blts
416
    dwSSBCKeyCaps: DWORD;          // driver color key capabilities for System->System blts
409
    dwSSBFXCaps: DWORD;            // driver FX capabilities for System->System blts
417
    dwSSBFXCaps: DWORD;            // driver FX capabilities for System->System blts
410
    dwSSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
418
    dwSSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
411
    // Members added for DX5:
419
    // Members added for DX5:
412
    dwMaxVideoPorts: DWORD;        // maximum number of usable video ports
420
    dwMaxVideoPorts: DWORD;        // maximum number of usable video ports
413
    dwCurrVideoPorts: DWORD;       // current number of video ports used
421
    dwCurrVideoPorts: DWORD;       // current number of video ports used
414
    dwSVBCaps2: DWORD;             // more driver specific capabilities for System->Vmem blts
422
    dwSVBCaps2: DWORD;             // more driver specific capabilities for System->Vmem blts
415
    dwNLVBCaps: DWORD;             // driver specific capabilities for non-local->local vidmem blts
423
    dwNLVBCaps: DWORD;             // driver specific capabilities for non-local->local vidmem blts
416
    dwNLVBCaps2: DWORD;            // more driver specific capabilities non-local->local vidmem blts
424
    dwNLVBCaps2: DWORD;            // more driver specific capabilities non-local->local vidmem blts
417
    dwNLVBCKeyCaps: DWORD;         // driver color key capabilities for non-local->local vidmem blts
425
    dwNLVBCKeyCaps: DWORD;         // driver color key capabilities for non-local->local vidmem blts
418
    dwNLVBFXCaps: DWORD;           // driver FX capabilities for non-local->local blts
426
    dwNLVBFXCaps: DWORD;           // driver FX capabilities for non-local->local blts
419
    dwNLVBRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for non-local->local blts
427
    dwNLVBRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for non-local->local blts
420
  end;
428
  end;
421
 
429
 
422
  PDDCaps_DX6 = ^TDDCaps_DX6;
430
  PDDCaps_DX6 = ^TDDCaps_DX6;
423
  TDDCaps_DX6 = packed record
431
  TDDCaps_DX6 = packed record
424
    dwSize: DWORD;                 // size of the DDDRIVERCAPS structure
432
    dwSize: DWORD;                 // size of the DDDRIVERCAPS structure
425
    dwCaps: DWORD;                 // driver specific capabilities
433
    dwCaps: DWORD;                 // driver specific capabilities
426
    dwCaps2: DWORD;                // more driver specific capabilites
434
    dwCaps2: DWORD;                // more driver specific capabilites
427
    dwCKeyCaps: DWORD;             // color key capabilities of the surface
435
    dwCKeyCaps: DWORD;             // color key capabilities of the surface
428
    dwFXCaps: DWORD;               // driver specific stretching and effects capabilites
436
    dwFXCaps: DWORD;               // driver specific stretching and effects capabilites
429
    dwFXAlphaCaps: DWORD;          // alpha driver specific capabilities
437
    dwFXAlphaCaps: DWORD;          // alpha driver specific capabilities
430
    dwPalCaps: DWORD;              // palette capabilities
438
    dwPalCaps: DWORD;              // palette capabilities
431
    dwSVCaps: DWORD;               // stereo vision capabilities
439
    dwSVCaps: DWORD;               // stereo vision capabilities
432
    dwAlphaBltConstBitDepths: DWORD;       // DDBD_2,4,8
440
    dwAlphaBltConstBitDepths: DWORD;       // DDBD_2,4,8
433
    dwAlphaBltPixelBitDepths: DWORD;       // DDBD_1,2,4,8
441
    dwAlphaBltPixelBitDepths: DWORD;       // DDBD_1,2,4,8
434
    dwAlphaBltSurfaceBitDepths: DWORD;     // DDBD_1,2,4,8
442
    dwAlphaBltSurfaceBitDepths: DWORD;     // DDBD_1,2,4,8
435
    dwAlphaOverlayConstBitDepths: DWORD;   // DDBD_2,4,8
443
    dwAlphaOverlayConstBitDepths: DWORD;   // DDBD_2,4,8
436
    dwAlphaOverlayPixelBitDepths: DWORD;   // DDBD_1,2,4,8
444
    dwAlphaOverlayPixelBitDepths: DWORD;   // DDBD_1,2,4,8
437
    dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
445
    dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
438
    dwZBufferBitDepths: DWORD;             // DDBD_8,16,24,32
446
    dwZBufferBitDepths: DWORD;             // DDBD_8,16,24,32
439
    dwVidMemTotal: DWORD;          // total amount of video memory
447
    dwVidMemTotal: DWORD;          // total amount of video memory
440
    dwVidMemFree: DWORD;           // amount of free video memory
448
    dwVidMemFree: DWORD;           // amount of free video memory
441
    dwMaxVisibleOverlays: DWORD;   // maximum number of visible overlays
449
    dwMaxVisibleOverlays: DWORD;   // maximum number of visible overlays
442
    dwCurrVisibleOverlays: DWORD;  // current number of visible overlays
450
    dwCurrVisibleOverlays: DWORD;  // current number of visible overlays
443
    dwNumFourCCCodes: DWORD;       // number of four cc codes
451
    dwNumFourCCCodes: DWORD;       // number of four cc codes
444
    dwAlignBoundarySrc: DWORD;     // source rectangle alignment
452
    dwAlignBoundarySrc: DWORD;     // source rectangle alignment
445
    dwAlignSizeSrc: DWORD;         // source rectangle byte size
453
    dwAlignSizeSrc: DWORD;         // source rectangle byte size
446
    dwAlignBoundaryDest: DWORD;    // dest rectangle alignment
454
    dwAlignBoundaryDest: DWORD;    // dest rectangle alignment
447
    dwAlignSizeDest: DWORD;        // dest rectangle byte size
455
    dwAlignSizeDest: DWORD;        // dest rectangle byte size
448
    dwAlignStrideAlign: DWORD;     // stride alignment
456
    dwAlignStrideAlign: DWORD;     // stride alignment
449
    dwRops: Array [0..DD_ROP_SPACE-1] of DWORD;   // ROPS supported
457
    dwRops: Array [0..DD_ROP_SPACE-1] of DWORD;   // ROPS supported
450
    ddsOldCaps: TDDSCaps;          // Was dssCaps: TDDSCaps. ddsCaps is of type TDDScaps2 for DX6
458
    ddsOldCaps: TDDSCaps;          // Was dssCaps: TDDSCaps. ddsCaps is of type TDDScaps2 for DX6
451
    dwMinOverlayStretch: DWORD;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
459
    dwMinOverlayStretch: DWORD;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
452
    dwMaxOverlayStretch: DWORD;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
460
    dwMaxOverlayStretch: DWORD;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
453
    dwMinLiveVideoStretch: DWORD;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
461
    dwMinLiveVideoStretch: DWORD;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
454
    dwMaxLiveVideoStretch: DWORD;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
462
    dwMaxLiveVideoStretch: DWORD;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
455
    dwMinHwCodecStretch: DWORD;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
463
    dwMinHwCodecStretch: DWORD;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
456
    dwMaxHwCodecStretch: DWORD;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
464
    dwMaxHwCodecStretch: DWORD;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
457
    dwReserved1: DWORD;            // reserved
465
    dwReserved1: DWORD;            // reserved
458
    dwReserved2: DWORD;            // reserved
466
    dwReserved2: DWORD;            // reserved
459
    dwReserved3: DWORD;            // reserved
467
    dwReserved3: DWORD;            // reserved
460
    dwSVBCaps: DWORD;              // driver specific capabilities for System->Vmem blts
468
    dwSVBCaps: DWORD;              // driver specific capabilities for System->Vmem blts
461
    dwSVBCKeyCaps: DWORD;          // driver color key capabilities for System->Vmem blts
469
    dwSVBCKeyCaps: DWORD;          // driver color key capabilities for System->Vmem blts
462
    dwSVBFXCaps: DWORD;            // driver FX capabilities for System->Vmem blts
470
    dwSVBFXCaps: DWORD;            // driver FX capabilities for System->Vmem blts
463
    dwSVBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
471
    dwSVBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
464
    dwVSBCaps: DWORD;              // driver specific capabilities for Vmem->System blts
472
    dwVSBCaps: DWORD;              // driver specific capabilities for Vmem->System blts
465
    dwVSBCKeyCaps: DWORD;          // driver color key capabilities for Vmem->System blts
473
    dwVSBCKeyCaps: DWORD;          // driver color key capabilities for Vmem->System blts
466
    dwVSBFXCaps: DWORD;            // driver FX capabilities for Vmem->System blts
474
    dwVSBFXCaps: DWORD;            // driver FX capabilities for Vmem->System blts
467
    dwVSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
475
    dwVSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
468
    dwSSBCaps: DWORD;              // driver specific capabilities for System->System blts
476
    dwSSBCaps: DWORD;              // driver specific capabilities for System->System blts
469
    dwSSBCKeyCaps: DWORD;          // driver color key capabilities for System->System blts
477
    dwSSBCKeyCaps: DWORD;          // driver color key capabilities for System->System blts
470
    dwSSBFXCaps: DWORD;            // driver FX capabilities for System->System blts
478
    dwSSBFXCaps: DWORD;            // driver FX capabilities for System->System blts
471
    dwSSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
479
    dwSSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
472
    // Members added for DX5:
480
    // Members added for DX5:
473
    dwMaxVideoPorts: DWORD;        // maximum number of usable video ports
481
    dwMaxVideoPorts: DWORD;        // maximum number of usable video ports
474
    dwCurrVideoPorts: DWORD;       // current number of video ports used
482
    dwCurrVideoPorts: DWORD;       // current number of video ports used
475
    dwSVBCaps2: DWORD;             // more driver specific capabilities for System->Vmem blts
483
    dwSVBCaps2: DWORD;             // more driver specific capabilities for System->Vmem blts
476
    dwNLVBCaps: DWORD;             // driver specific capabilities for non-local->local vidmem blts
484
    dwNLVBCaps: DWORD;             // driver specific capabilities for non-local->local vidmem blts
477
    dwNLVBCaps2: DWORD;            // more driver specific capabilities non-local->local vidmem blts
485
    dwNLVBCaps2: DWORD;            // more driver specific capabilities non-local->local vidmem blts
478
    dwNLVBCKeyCaps: DWORD;         // driver color key capabilities for non-local->local vidmem blts
486
    dwNLVBCKeyCaps: DWORD;         // driver color key capabilities for non-local->local vidmem blts
479
    dwNLVBFXCaps: DWORD;           // driver FX capabilities for non-local->local blts
487
    dwNLVBFXCaps: DWORD;           // driver FX capabilities for non-local->local blts
480
    dwNLVBRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for non-local->local blts
488
    dwNLVBRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for non-local->local blts
481
    // Members added for DX6 release
489
    // Members added for DX6 release
482
    ddsCaps : TDDSCaps2 ;          // Surface Caps
490
    ddsCaps : TDDSCaps2 ;          // Surface Caps
483
  end;
491
  end;
484
 
492
 
485
  TDDCaps_DX7 = TDDCaps_DX6;
493
  TDDCaps_DX7 = TDDCaps_DX6;
486
 
494
 
487
  PDDCaps = ^TDDCaps;
495
  PDDCaps = ^TDDCaps;
488
 
496
 
489
{$IFDEF DIRECTX3}
497
{$IFDEF DIRECTX3}
490
  TDDCaps = TDDCaps_DX3;
498
  TDDCaps = TDDCaps_DX3;
491
{$ELSE}
499
{$ELSE}
492
  {$IFDEF DIRECTX5}
500
  {$IFDEF DIRECTX5}
493
    TDDCaps = TDDCaps_DX5;
501
    TDDCaps = TDDCaps_DX5;
494
  {$ELSE}
502
  {$ELSE}
495
    {$IFDEF DIRECTX6}
503
    {$IFDEF DIRECTX6}
496
      TDDCaps = TDDCaps_DX6;
504
      TDDCaps = TDDCaps_DX6;
497
    {$ELSE}
505
    {$ELSE}
498
      TDDCaps = TDDCaps_DX7;
506
      TDDCaps = TDDCaps_DX7;
499
    {$ENDIF}
507
    {$ENDIF}
500
  {$ENDIF}
508
  {$ENDIF}
501
{$ENDIF}
509
{$ENDIF}
502
 
510
 
503
 
511
 
504
 
512
 
505
 
513
 
506
(*
514
(*
507
 * TDDPixelFormat
515
 * TDDPixelFormat
508
 *)
516
 *)
509
  PDDPixelFormat_DX5 = ^TDDPixelFormat_DX5;
517
  PDDPixelFormat_DX5 = ^TDDPixelFormat_DX5;
510
  TDDPixelFormat_DX5 = packed record
518
  TDDPixelFormat_DX5 = packed record
511
    dwSize: DWORD;                 // size of structure
519
    dwSize: DWORD;                 // size of structure
512
    dwFlags: DWORD;                // pixel format flags
520
    dwFlags: DWORD;                // pixel format flags
513
    dwFourCC: DWORD;               // (FOURCC code)
521
    dwFourCC: DWORD;               // (FOURCC code)
514
    case Integer of
522
    case Integer of
515
    0: (
523
    0: (
516
      dwZBufferBitDepth: DWORD;      // how many bits for z buffers
524
      dwZBufferBitDepth: DWORD;      // how many bits for z buffers
517
     );
525
     );
518
    1: (
526
    1: (
519
      dwAlphaBitDepth: DWORD;        // how many bits for alpha channels
527
      dwAlphaBitDepth: DWORD;        // how many bits for alpha channels
520
     );
528
     );
521
    2: (
529
    2: (
522
      dwRGBBitCount: DWORD;          // how many bits per pixel
530
      dwRGBBitCount: DWORD;          // how many bits per pixel
523
      dwRBitMask: DWORD;             // mask for red bit
531
      dwRBitMask: DWORD;             // mask for red bit
524
      dwGBitMask: DWORD;             // mask for green bits
532
      dwGBitMask: DWORD;             // mask for green bits
525
      dwBBitMask: DWORD;             // mask for blue bits
533
      dwBBitMask: DWORD;             // mask for blue bits
526
      dwRGBAlphaBitMask: DWORD;      // mask for alpha channel
534
      dwRGBAlphaBitMask: DWORD;      // mask for alpha channel
527
     );
535
     );
528
    3: (
536
    3: (
529
      dwYUVBitCount: DWORD;          // how many bits per pixel
537
      dwYUVBitCount: DWORD;          // how many bits per pixel
530
      dwYBitMask: DWORD;             // mask for Y bits
538
      dwYBitMask: DWORD;             // mask for Y bits
531
      dwUBitMask: DWORD;             // mask for U bits
539
      dwUBitMask: DWORD;             // mask for U bits
532
      dwVBitMask: DWORD;             // mask for V bits
540
      dwVBitMask: DWORD;             // mask for V bits
533
      case Integer of
541
      case Integer of
534
      0: (
542
      0: (
535
        dwYUVAlphaBitMask: DWORD;      // mask for alpha channel
543
        dwYUVAlphaBitMask: DWORD;      // mask for alpha channel
536
       );
544
       );
537
      1: (
545
      1: (
538
        dwRGBZBitMask: DWORD;
546
        dwRGBZBitMask: DWORD;
539
       );
547
       );
540
      2: (
548
      2: (
541
        dwYUVZBitMask: DWORD;
549
        dwYUVZBitMask: DWORD;
542
       );
550
       );
543
     );
551
     );
544
  end;
552
  end;
545
 
553
 
546
  PDDPixelFormat_DX6 = ^TDDPixelFormat_DX6;
554
  PDDPixelFormat_DX6 = ^TDDPixelFormat_DX6;
547
  TDDPixelFormat_DX6 = packed record
555
  TDDPixelFormat_DX6 = packed record
548
    dwSize: DWORD;                 // size of structure
556
    dwSize: DWORD;                 // size of structure
549
    dwFlags: DWORD;                // pixel format flags
557
    dwFlags: DWORD;                // pixel format flags
550
    dwFourCC: DWORD;               // (FOURCC code)
558
    dwFourCC: DWORD;               // (FOURCC code)
551
    case Integer of
559
    case Integer of
552
      1: (
560
      1: (
553
          dwRGBBitCount : DWORD;  // how many bits per pixel
561
          dwRGBBitCount : DWORD;  // how many bits per pixel
554
          dwRBitMask : DWORD;  // mask for red bit
562
          dwRBitMask : DWORD;  // mask for red bit
555
          dwGBitMask : DWORD;  // mask for green bits
563
          dwGBitMask : DWORD;  // mask for green bits
556
          dwBBitMask : DWORD;  // mask for blue bits
564
          dwBBitMask : DWORD;  // mask for blue bits
557
          dwRGBAlphaBitMask : DWORD; // mask for alpha channel
565
          dwRGBAlphaBitMask : DWORD; // mask for alpha channel
558
          );
566
          );
559
      2: (
567
      2: (
560
          dwYUVBitCount : DWORD;  // how many bits per pixel
568
          dwYUVBitCount : DWORD;  // how many bits per pixel
561
          dwYBitMask : DWORD;  // mask for Y bits
569
          dwYBitMask : DWORD;  // mask for Y bits
562
          dwUBitMask : DWORD;  // mask for U bits
570
          dwUBitMask : DWORD;  // mask for U bits
563
          dwVBitMask : DWORD;  // mask for V bits
571
          dwVBitMask : DWORD;  // mask for V bits
564
          dwYUVAlphaBitMask : DWORD; // mask for alpha channel
572
          dwYUVAlphaBitMask : DWORD; // mask for alpha channel
565
          );
573
          );
566
      3: (
574
      3: (
567
          dwZBufferBitDepth : DWORD; // how many total bits/pixel in z buffer (including any stencil bits)
575
          dwZBufferBitDepth : DWORD; // how many total bits/pixel in z buffer (including any stencil bits)
568
          dwStencilBitDepth : DWORD; // how many stencil bits (note: dwZBufferBitDepth-dwStencilBitDepth is total Z-only bits)
576
          dwStencilBitDepth : DWORD; // how many stencil bits (note: dwZBufferBitDepth-dwStencilBitDepth is total Z-only bits)
569
          dwZBitMask : DWORD;  // mask for Z bits
577
          dwZBitMask : DWORD;  // mask for Z bits
570
          dwStencilBitMask : DWORD; // mask for stencil bits
578
          dwStencilBitMask : DWORD; // mask for stencil bits
571
          dwLuminanceAlphaBitMask : DWORD;// mask for alpha channel
579
          dwLuminanceAlphaBitMask : DWORD;// mask for alpha channel
572
          );
580
          );
573
      4: (
581
      4: (
574
          dwAlphaBitDepth : DWORD; // how many bits for alpha channels
582
          dwAlphaBitDepth : DWORD; // how many bits for alpha channels
575
          dwLuminanceBitMask : DWORD; // mask for luminance bits
583
          dwLuminanceBitMask : DWORD; // mask for luminance bits
576
          dwBumpDvBitMask : DWORD;        // mask for bump map V delta bits
584
          dwBumpDvBitMask : DWORD;        // mask for bump map V delta bits
577
          dwBumpLuminanceBitMask : DWORD; // mask for luminance in bump map
585
          dwBumpLuminanceBitMask : DWORD; // mask for luminance in bump map
578
          dwRGBZBitMask : DWORD;  // mask for Z channel
586
          dwRGBZBitMask : DWORD;  // mask for Z channel
579
          );
587
          );
580
      5: (
588
      5: (
581
           dwLuminanceBitCount : DWORD; // how many bits per pixel
589
           dwLuminanceBitCount : DWORD; // how many bits per pixel
582
           dwBumpDuBitMask : DWORD;       // mask for bump map U delta bits
590
           dwBumpDuBitMask : DWORD;       // mask for bump map U delta bits
583
           Fill1, Fill2    : DWORD;
591
           Fill1, Fill2    : DWORD;
584
           dwYUVZBitMask   : DWORD;  // mask for Z channel
592
           dwYUVZBitMask   : DWORD;  // mask for Z channel
585
         );
593
         );
586
      6: ( dwBumpBitCount  : DWORD;         // how many bits per "buxel", total
594
      6: ( dwBumpBitCount  : DWORD;         // how many bits per "buxel", total
587
         );
595
         );
588
  end;
596
  end;
589
 
597
 
590
  TDDPixelFormat_DX3 = TDDPixelFormat_DX5;
598
  TDDPixelFormat_DX3 = TDDPixelFormat_DX5;
591
  TDDPixelFormat_DX7 = TDDPixelFormat_DX6;
599
  TDDPixelFormat_DX7 = TDDPixelFormat_DX6;
592
 
600
 
593
  PDDPixelFormat = ^TDDPixelFormat;
601
  PDDPixelFormat = ^TDDPixelFormat;
594
{$IFDEF DIRECTX3}
602
{$IFDEF DIRECTX3}
595
  TDDPixelFormat = TDDPixelFormat_DX3;
603
  TDDPixelFormat = TDDPixelFormat_DX3;
596
{$ELSE}
604
{$ELSE}
597
  {$IFDEF DIRECTX5}
605
  {$IFDEF DIRECTX5}
598
    TDDPixelFormat = TDDPixelFormat_DX5;
606
    TDDPixelFormat = TDDPixelFormat_DX5;
599
  {$ELSE}
607
  {$ELSE}
600
    {$IFDEF DIRECTX6}
608
    {$IFDEF DIRECTX6}
601
      TDDPixelFormat = TDDPixelFormat_DX6;
609
      TDDPixelFormat = TDDPixelFormat_DX6;
602
    {$ELSE}
610
    {$ELSE}
603
      TDDPixelFormat = TDDPixelFormat_DX7;
611
      TDDPixelFormat = TDDPixelFormat_DX7;
604
    {$ENDIF}
612
    {$ENDIF}
605
  {$ENDIF}
613
  {$ENDIF}
606
{$ENDIF}
614
{$ENDIF}
607
 
615
 
608
(*
616
(*
609
 * TDDOverlayFX
617
 * TDDOverlayFX
610
 *)
618
 *)
611
  PDDOverlayFX = ^TDDOverlayFX;
619
  PDDOverlayFX = ^TDDOverlayFX;
612
  TDDOverlayFX = packed record
620
  TDDOverlayFX = packed record
613
    dwSize: DWORD;                         // size of structure
621
    dwSize: DWORD;                         // size of structure
614
    dwAlphaEdgeBlendBitDepth: DWORD;       // Bit depth used to specify constant for alpha edge blend
622
    dwAlphaEdgeBlendBitDepth: DWORD;       // Bit depth used to specify constant for alpha edge blend
615
    dwAlphaEdgeBlend: DWORD;               // Constant to use as alpha for edge blend
623
    dwAlphaEdgeBlend: DWORD;               // Constant to use as alpha for edge blend
616
    dwReserved: DWORD;
624
    dwReserved: DWORD;
617
    dwAlphaDestConstBitDepth: DWORD;       // Bit depth used to specify alpha constant for destination
625
    dwAlphaDestConstBitDepth: DWORD;       // Bit depth used to specify alpha constant for destination
618
    case Integer of
626
    case Integer of
619
    0: (
627
    0: (
620
      dwAlphaDestConst: DWORD;               // Constant to use as alpha channel for dest
628
      dwAlphaDestConst: DWORD;               // Constant to use as alpha channel for dest
621
      dwAlphaSrcConstBitDepth: DWORD;        // Bit depth used to specify alpha constant for source
629
      dwAlphaSrcConstBitDepth: DWORD;        // Bit depth used to specify alpha constant for source
622
      dwAlphaSrcConst: DWORD;                // Constant to use as alpha channel for src
630
      dwAlphaSrcConst: DWORD;                // Constant to use as alpha channel for src
623
      dckDestColorkey: TDDColorKey;                // DestColorkey override
631
      dckDestColorkey: TDDColorKey;                // DestColorkey override
624
      dckSrcColorkey: TDDColorKey;                 // DestColorkey override
632
      dckSrcColorkey: TDDColorKey;                 // DestColorkey override
625
      dwDDFX: DWORD;                         // Overlay FX
633
      dwDDFX: DWORD;                         // Overlay FX
626
      dwFlags: DWORD;                        // flags
634
      dwFlags: DWORD;                        // flags
627
     );
635
     );
628
    1: (
636
    1: (
629
      lpDDSAlphaDest: PDirectDrawSurface;     // Surface to use as alpha channel for dest
637
      lpDDSAlphaDest: PDirectDrawSurface;     // Surface to use as alpha channel for dest
630
      filler: DWORD;
638
      filler: DWORD;
631
      lpDDSAlphaSrc: PDirectDrawSurface;      // Surface to use as alpha channel for src
639
      lpDDSAlphaSrc: PDirectDrawSurface;      // Surface to use as alpha channel for src
632
     );
640
     );
633
  end;
641
  end;
634
 
642
 
635
(*
643
(*
636
 * TDDBltBatch: BltBatch entry structure
644
 * TDDBltBatch: BltBatch entry structure
637
 *)
645
 *)
638
  PDDBltBatch = ^TDDBltBatch;
646
  PDDBltBatch = ^TDDBltBatch;
639
  TDDBltBatch = packed record
647
  TDDBltBatch = packed record
640
    lprDest: PRect;
648
    lprDest: PRect;
641
    lpDDSSrc: IDirectDrawSurface;
649
    lpDDSSrc: IDirectDrawSurface;
642
    lprSrc: PRect;
650
    lprSrc: PRect;
643
    dwFlags: DWORD;
651
    dwFlags: DWORD;
644
    lpDDBltFx: TDDBltFX;
652
    lpDDBltFx: TDDBltFX;
645
  end;
653
  end;
646
 
654
 
647
(*
655
(*
648
 * TDDGammaRamp
656
 * TDDGammaRamp
649
 *)
657
 *)
650
  PDDGammaRamp = ^TDDGammaRamp;
658
  PDDGammaRamp = ^TDDGammaRamp;
651
  TDDGammaRamp = packed record
659
  TDDGammaRamp = packed record
652
    red   : array[0..255] of WORD;
660
    red   : array[0..255] of WORD;
653
    green : array[0..255] of WORD;
661
    green : array[0..255] of WORD;
654
    blue  : array[0..255] of WORD;
662
    blue  : array[0..255] of WORD;
655
  end;
663
  end;
656
 
664
 
657
(*
665
(*
658
 *  This is the structure within which DirectDraw returns data about the current graphics driver and chipset
666
 *  This is the structure within which DirectDraw returns data about the current graphics driver and chipset
659
 *)
667
 *)
660
 
668
 
661
  PDDDeviceIdentifier = ^TDDDeviceIdentifier;
669
  PDDDeviceIdentifier = ^TDDDeviceIdentifier;
662
  TDDDeviceIdentifier = packed record
670
  TDDDeviceIdentifier = packed record
663
    //
671
    //
664
    // These elements are for presentation to the user only. They should not be used to identify particular
672
    // These elements are for presentation to the user only. They should not be used to identify particular
665
    // drivers, since this is unreliable and many different strings may be associated with the same
673
    // drivers, since this is unreliable and many different strings may be associated with the same
666
    // device, and the same driver from different vendors.
674
    // device, and the same driver from different vendors.
667
    //
675
    //
668
    szDriver: array[0..MAX_DDDEVICEID_STRING-1] of Char;
676
    szDriver: array[0..MAX_DDDEVICEID_STRING-1] of Char;
669
    szDescription: array[0..MAX_DDDEVICEID_STRING-1] of Char;
677
    szDescription: array[0..MAX_DDDEVICEID_STRING-1] of Char;
670
 
678
 
671
    //
679
    //
672
    // This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons
680
    // This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons
673
    // on the whole 64 bits. Caution should be exercised if you use this element to identify problematic
681
    // on the whole 64 bits. Caution should be exercised if you use this element to identify problematic
674
    // drivers. It is recommended that guidDeviceIdentifier is used for this purpose.
682
    // drivers. It is recommended that guidDeviceIdentifier is used for this purpose.
675
    //
683
    //
676
    // This version has the form:
684
    // This version has the form:
677
    //  wProduct = HIWORD(liDriverVersion.HighPart)
685
    //  wProduct = HIWORD(liDriverVersion.HighPart)
678
    //  wVersion = LOWORD(liDriverVersion.HighPart)
686
    //  wVersion = LOWORD(liDriverVersion.HighPart)
679
    //  wSubVersion = HIWORD(liDriverVersion.LowPart)
687
    //  wSubVersion = HIWORD(liDriverVersion.LowPart)
680
    //  wBuild = LOWORD(liDriverVersion.LowPart)
688
    //  wBuild = LOWORD(liDriverVersion.LowPart)
681
    //
689
    //
682
    liDriverVersion: TLargeInteger;     // Defined for applications and other 32 bit components
690
    liDriverVersion: TLargeInteger;     // Defined for applications and other 32 bit components
683
 
691
 
684
    //
692
    //
685
    // These elements can be used to identify particular chipsets. Use with extreme caution.
693
    // These elements can be used to identify particular chipsets. Use with extreme caution.
686
    //   dwVendorId     Identifies the manufacturer. May be zero if unknown.
694
    //   dwVendorId     Identifies the manufacturer. May be zero if unknown.
687
    //   dwDeviceId     Identifies the type of chipset. May be zero if unknown.
695
    //   dwDeviceId     Identifies the type of chipset. May be zero if unknown.
688
    //   dwSubSysId     Identifies the subsystem, typically this means the particular board. May be zero if unknown.
696
    //   dwSubSysId     Identifies the subsystem, typically this means the particular board. May be zero if unknown.
689
    //   dwRevision     Identifies the revision level of the chipset. May be zero if unknown.
697
    //   dwRevision     Identifies the revision level of the chipset. May be zero if unknown.
690
    //
698
    //
691
    dwVendorId: DWORD;
699
    dwVendorId: DWORD;
692
    dwDeviceId: DWORD;
700
    dwDeviceId: DWORD;
693
    dwSubSysId: DWORD;
701
    dwSubSysId: DWORD;
694
    dwRevision: DWORD;
702
    dwRevision: DWORD;
695
 
703
 
696
    //
704
    //
697
    // This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the
705
    // This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the
698
    // driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to
706
    // driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to
699
    // reprofile the graphics subsystem.
707
    // reprofile the graphics subsystem.
700
    // This element can also be used to identify particular problematic drivers.
708
    // This element can also be used to identify particular problematic drivers.
701
    //
709
    //
702
    guidDeviceIdentifier: TGUID;
710
    guidDeviceIdentifier: TGUID;
703
  end;
711
  end;
704
 
712
 
705
  PDDDeviceIdentifier2 = ^TDDDeviceIdentifier2;
713
  PDDDeviceIdentifier2 = ^TDDDeviceIdentifier2;
706
  TDDDeviceIdentifier2 = packed record
714
  TDDDeviceIdentifier2 = packed record
707
    //
715
    //
708
    // These elements are for presentation to the user only. They should not be used to identify particular
716
    // These elements are for presentation to the user only. They should not be used to identify particular
709
    // drivers, since this is unreliable and many different strings may be associated with the same
717
    // drivers, since this is unreliable and many different strings may be associated with the same
710
    // device, and the same driver from different vendors.
718
    // device, and the same driver from different vendors.
711
    //
719
    //
712
    szDriver: array[0..MAX_DDDEVICEID_STRING-1] of Char;
720
    szDriver: array[0..MAX_DDDEVICEID_STRING-1] of Char;
713
    szDescription: array[0..MAX_DDDEVICEID_STRING-1] of Char;
721
    szDescription: array[0..MAX_DDDEVICEID_STRING-1] of Char;
714
 
722
 
715
    //
723
    //
716
    // This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons
724
    // This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons
717
    // on the whole 64 bits. Caution should be exercised if you use this element to identify problematic
725
    // on the whole 64 bits. Caution should be exercised if you use this element to identify problematic
718
    // drivers. It is recommended that guidDeviceIdentifier is used for this purpose.
726
    // drivers. It is recommended that guidDeviceIdentifier is used for this purpose.
719
    //
727
    //
720
    // This version has the form:
728
    // This version has the form:
721
    //  wProduct = HIWORD(liDriverVersion.HighPart)
729
    //  wProduct = HIWORD(liDriverVersion.HighPart)
722
    //  wVersion = LOWORD(liDriverVersion.HighPart)
730
    //  wVersion = LOWORD(liDriverVersion.HighPart)
723
    //  wSubVersion = HIWORD(liDriverVersion.LowPart)
731
    //  wSubVersion = HIWORD(liDriverVersion.LowPart)
724
    //  wBuild = LOWORD(liDriverVersion.LowPart)
732
    //  wBuild = LOWORD(liDriverVersion.LowPart)
725
    //
733
    //
726
    liDriverVersion: TLargeInteger;     // Defined for applications and other 32 bit components
734
    liDriverVersion: TLargeInteger;     // Defined for applications and other 32 bit components
727
 
735
 
728
    //
736
    //
729
    // These elements can be used to identify particular chipsets. Use with extreme caution.
737
    // These elements can be used to identify particular chipsets. Use with extreme caution.
730
    //   dwVendorId     Identifies the manufacturer. May be zero if unknown.
738
    //   dwVendorId     Identifies the manufacturer. May be zero if unknown.
731
    //   dwDeviceId     Identifies the type of chipset. May be zero if unknown.
739
    //   dwDeviceId     Identifies the type of chipset. May be zero if unknown.
732
    //   dwSubSysId     Identifies the subsystem, typically this means the particular board. May be zero if unknown.
740
    //   dwSubSysId     Identifies the subsystem, typically this means the particular board. May be zero if unknown.
733
    //   dwRevision     Identifies the revision level of the chipset. May be zero if unknown.
741
    //   dwRevision     Identifies the revision level of the chipset. May be zero if unknown.
734
    //
742
    //
735
    dwVendorId: DWORD;
743
    dwVendorId: DWORD;
736
    dwDeviceId: DWORD;
744
    dwDeviceId: DWORD;
737
    dwSubSysId: DWORD;
745
    dwSubSysId: DWORD;
738
    dwRevision: DWORD;
746
    dwRevision: DWORD;
739
 
747
 
740
    //
748
    //
741
    // This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the
749
    // This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the
742
    // driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to
750
    // driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to
743
    // reprofile the graphics subsystem.
751
    // reprofile the graphics subsystem.
744
    // This element can also be used to identify particular problematic drivers.
752
    // This element can also be used to identify particular problematic drivers.
745
    //
753
    //
746
    guidDeviceIdentifier: TGUID;
754
    guidDeviceIdentifier: TGUID;
747
 
755
 
748
    (*
756
    (*
749
     * This element is used to determine the Windows Hardware Quality Lab (WHQL)
757
     * This element is used to determine the Windows Hardware Quality Lab (WHQL)
750
     * certification level for this driver/device pair.
758
     * certification level for this driver/device pair.
751
     *)
759
     *)
752
    dwWHQLLevel: DWORD;
760
    dwWHQLLevel: DWORD;
753
  end;
761
  end;
754
 
762
 
755
(*
763
(*
756
 * callbacks
764
 * callbacks
757
 *)
765
 *)
758
  TClipperCallback = function(lpDDClipper: IDirectDrawClipper; hWnd: HWND;
766
  TClipperCallback = function(lpDDClipper: IDirectDrawClipper; hWnd: HWND;
759
      Code: DWORD; lpContext: Pointer): HResult; stdcall;
767
      Code: DWORD; lpContext: Pointer): HResult; stdcall;
760
  TSurfacesStreamingCallback = function(Arg: DWORD): HResult; stdcall;
768
  TSurfacesStreamingCallback = function(Arg: DWORD): HResult; stdcall;
761
 
769
 
762
(*
770
(*
763
 * TDDSurfaceDesc
771
 * TDDSurfaceDesc
764
 *)
772
 *)
765
  PDDSurfaceDesc_DX5 = ^TDDSurfaceDesc_DX5;
773
  PDDSurfaceDesc_DX5 = ^TDDSurfaceDesc_DX5;
766
  TDDSurfaceDesc_DX5 = packed record
774
  TDDSurfaceDesc_DX5 = packed record
767
    dwSize: DWORD;                 // size of the TDDSurfaceDesc structure
775
    dwSize: DWORD;                 // size of the TDDSurfaceDesc structure
768
    dwFlags: DWORD;                // determines what fields are valid
776
    dwFlags: DWORD;                // determines what fields are valid
769
    dwHeight: DWORD;               // height of surface to be created
777
    dwHeight: DWORD;               // height of surface to be created
770
    dwWidth: DWORD;                // width of input surface
778
    dwWidth: DWORD;                // width of input surface
771
    case Integer of
779
    case Integer of
772
    0: (
780
    0: (
773
      dwLinearSize : DWORD;       // unused at the moment
781
      dwLinearSize : DWORD;       // unused at the moment
774
     );
782
     );
775
    1: (
783
    1: (
776
      lPitch: LongInt;                 // distance to start of next line (return value only)
784
      lPitch: LongInt;                 // distance to start of next line (return value only)
777
      dwBackBufferCount: DWORD;      // number of back buffers requested
785
      dwBackBufferCount: DWORD;      // number of back buffers requested
778
      case Integer of
786
      case Integer of
779
      0: (
787
      0: (
780
        dwMipMapCount: DWORD;          // number of mip-map levels requested
788
        dwMipMapCount: DWORD;          // number of mip-map levels requested
781
        dwAlphaBitDepth: DWORD;        // depth of alpha buffer requested
789
        dwAlphaBitDepth: DWORD;        // depth of alpha buffer requested
782
        dwReserved: DWORD;             // reserved
790
        dwReserved: DWORD;             // reserved
783
        lpSurface: Pointer;              // pointer to the associated surface memory
791
        lpSurface: Pointer;              // pointer to the associated surface memory
784
        ddckCKDestOverlay: TDDColorKey;      // color key for destination overlay use
792
        ddckCKDestOverlay: TDDColorKey;      // color key for destination overlay use
785
        ddckCKDestBlt: TDDColorKey;          // color key for destination blt use
793
        ddckCKDestBlt: TDDColorKey;          // color key for destination blt use
786
        ddckCKSrcOverlay: TDDColorKey;       // color key for source overlay use
794
        ddckCKSrcOverlay: TDDColorKey;       // color key for source overlay use
787
        ddckCKSrcBlt: TDDColorKey;           // color key for source blt use
795
        ddckCKSrcBlt: TDDColorKey;           // color key for source blt use
788
        ddpfPixelFormat: TDDPixelFormat_DX5; // pixel format description of the surface
796
        ddpfPixelFormat: TDDPixelFormat_DX5; // pixel format description of the surface
789
        ddsCaps: TDDSCaps;                // direct draw surface capabilities
797
        ddsCaps: TDDSCaps;                // direct draw surface capabilities
790
       );
798
       );
791
      1: (
799
      1: (
792
        dwZBufferBitDepth: DWORD;      // depth of Z buffer requested
800
        dwZBufferBitDepth: DWORD;      // depth of Z buffer requested
793
       );
801
       );
794
      2: (
802
      2: (
795
        dwRefreshRate: DWORD;          // refresh rate (used when display mode is described)
803
        dwRefreshRate: DWORD;          // refresh rate (used when display mode is described)
796
       );
804
       );
797
     );
805
     );
798
  end;
806
  end;
799
 
807
 
800
  PDDSurfaceDesc_DX6 = ^TDDSurfaceDesc_DX6;
808
  PDDSurfaceDesc_DX6 = ^TDDSurfaceDesc_DX6;
801
  TDDSurfaceDesc_DX6 = packed record
809
  TDDSurfaceDesc_DX6 = packed record
802
    dwSize: DWORD;                 // size of the TDDSurfaceDesc structure
810
    dwSize: DWORD;                 // size of the TDDSurfaceDesc structure
803
    dwFlags: DWORD;                // determines what fields are valid
811
    dwFlags: DWORD;                // determines what fields are valid
804
    dwHeight: DWORD;               // height of surface to be created
812
    dwHeight: DWORD;               // height of surface to be created
805
    dwWidth: DWORD;                // width of input surface
813
    dwWidth: DWORD;                // width of input surface
806
    case Integer of
814
    case Integer of
807
    0: (
815
    0: (
808
      dwLinearSize : DWORD;       // unused at the moment
816
      dwLinearSize : DWORD;       // unused at the moment
809
     );
817
     );
810
    1: (
818
    1: (
811
      lPitch: LongInt;                 // distance to start of next line (return value only)
819
      lPitch: LongInt;                 // distance to start of next line (return value only)
812
      dwBackBufferCount: DWORD;      // number of back buffers requested
820
      dwBackBufferCount: DWORD;      // number of back buffers requested
813
      case Integer of
821
      case Integer of
814
      0: (
822
      0: (
815
        dwMipMapCount: DWORD;          // number of mip-map levels requested
823
        dwMipMapCount: DWORD;          // number of mip-map levels requested
816
        dwAlphaBitDepth: DWORD;        // depth of alpha buffer requested
824
        dwAlphaBitDepth: DWORD;        // depth of alpha buffer requested
817
        dwReserved: DWORD;             // reserved
825
        dwReserved: DWORD;             // reserved
818
        lpSurface: Pointer;              // pointer to the associated surface memory
826
        lpSurface: Pointer;              // pointer to the associated surface memory
819
        ddckCKDestOverlay: TDDColorKey;      // color key for destination overlay use
827
        ddckCKDestOverlay: TDDColorKey;      // color key for destination overlay use
820
        ddckCKDestBlt: TDDColorKey;          // color key for destination blt use
828
        ddckCKDestBlt: TDDColorKey;          // color key for destination blt use
821
        ddckCKSrcOverlay: TDDColorKey;       // color key for source overlay use
829
        ddckCKSrcOverlay: TDDColorKey;       // color key for source overlay use
822
        ddckCKSrcBlt: TDDColorKey;           // color key for source blt use
830
        ddckCKSrcBlt: TDDColorKey;           // color key for source blt use
823
        ddpfPixelFormat: TDDPixelFormat_DX6; // pixel format description of the surface
831
        ddpfPixelFormat: TDDPixelFormat_DX6; // pixel format description of the surface
824
        ddsCaps: TDDSCaps;                // direct draw surface capabilities
832
        ddsCaps: TDDSCaps;                // direct draw surface capabilities
825
       );
833
       );
826
      1: (
834
      1: (
827
        dwZBufferBitDepth: DWORD;      // depth of Z buffer requested
835
        dwZBufferBitDepth: DWORD;      // depth of Z buffer requested
828
       );
836
       );
829
      2: (
837
      2: (
830
        dwRefreshRate: DWORD;          // refresh rate (used when display mode is described)
838
        dwRefreshRate: DWORD;          // refresh rate (used when display mode is described)
831
       );
839
       );
832
     );
840
     );
833
  end;
841
  end;
834
 
842
 
835
  PDDSurfaceDesc = ^TDDSurfaceDesc;
843
  PDDSurfaceDesc = ^TDDSurfaceDesc;
836
{$IFDEF DIRECTX5}
844
{$IFDEF DIRECTX5}
837
  TDDSurfaceDesc = TDDSurfaceDesc_DX5;
845
  TDDSurfaceDesc = TDDSurfaceDesc_DX5;
838
{$ELSE}
846
{$ELSE}
839
  TDDSurfaceDesc = TDDSurfaceDesc_DX6;
847
  TDDSurfaceDesc = TDDSurfaceDesc_DX6;
840
{$ENDIF}
848
{$ENDIF}
841
 
849
 
842
 
850
 
843
(*
851
(*
844
 * TDDSurfaceDesc2
852
 * TDDSurfaceDesc2
845
 *)
853
 *)
846
  PDDSurfaceDesc2 = ^TDDSurfaceDesc2;
854
  PDDSurfaceDesc2 = ^TDDSurfaceDesc2;
847
  TDDSurfaceDesc2 = packed record
855
  TDDSurfaceDesc2 = packed record
848
    dwSize: DWORD;                 // size of the TDDSurfaceDesc structure
856
    dwSize: DWORD;                 // size of the TDDSurfaceDesc structure
849
    dwFlags: DWORD;                // determines what fields are valid
857
    dwFlags: DWORD;                // determines what fields are valid
850
    dwHeight: DWORD;               // height of surface to be created
858
    dwHeight: DWORD;               // height of surface to be created
851
    dwWidth: DWORD;                // width of input surface
859
    dwWidth: DWORD;                // width of input surface
852
    case Integer of
860
    case Integer of
853
    0: (
861
    0: (
854
      lPitch : LongInt;                  // distance to start of next line (return value only)
862
      lPitch : LongInt;                  // distance to start of next line (return value only)
855
     );
863
     );
856
    1: (
864
    1: (
857
      dwLinearSize : DWORD;              // Formless late-allocated optimized surface size
865
      dwLinearSize : DWORD;              // Formless late-allocated optimized surface size
858
      dwBackBufferCount: DWORD;          // number of back buffers requested
866
      dwBackBufferCount: DWORD;          // number of back buffers requested
859
      case Integer of
867
      case Integer of
860
      0: (
868
      0: (
861
        dwMipMapCount: DWORD;            // number of mip-map levels requested
869
        dwMipMapCount: DWORD;            // number of mip-map levels requested
862
        dwAlphaBitDepth: DWORD;          // depth of alpha buffer requested
870
        dwAlphaBitDepth: DWORD;          // depth of alpha buffer requested
863
        dwReserved: DWORD;               // reserved
871
        dwReserved: DWORD;               // reserved
864
        lpSurface: Pointer;              // pointer to the associated surface memory
872
        lpSurface: Pointer;              // pointer to the associated surface memory
865
        ddckCKDestOverlay: TDDColorKey;  // color key for destination overlay use
873
        ddckCKDestOverlay: TDDColorKey;  // color key for destination overlay use
866
        ddckCKDestBlt: TDDColorKey;      // color key for destination blt use
874
        ddckCKDestBlt: TDDColorKey;      // color key for destination blt use
867
        ddckCKSrcOverlay: TDDColorKey;   // color key for source overlay use
875
        ddckCKSrcOverlay: TDDColorKey;   // color key for source overlay use
868
        ddckCKSrcBlt: TDDColorKey;       // color key for source blt use
876
        ddckCKSrcBlt: TDDColorKey;       // color key for source blt use
869
        ddpfPixelFormat: TDDPixelFormat; // pixel format description of the surface
877
        ddpfPixelFormat: TDDPixelFormat; // pixel format description of the surface
870
        ddsCaps: TDDSCaps2;              // direct draw surface capabilities
878
        ddsCaps: TDDSCaps2;              // direct draw surface capabilities
871
        dwTextureStage: DWORD;           // stage in multitexture cascade
879
        dwTextureStage: DWORD;           // stage in multitexture cascade
872
       );
880
       );
873
      1: (
881
      1: (
874
        dwRefreshRate: DWORD;          // refresh rate (used when display mode is described)
882
        dwRefreshRate: DWORD;          // refresh rate (used when display mode is described)
875
       );
883
       );
876
     );
884
     );
877
  end;
885
  end;
878
 
886
 
879
(*
887
(*
880
 * TDDOptSurfaceDesc
888
 * TDDOptSurfaceDesc
881
 *)
889
 *)
882
 
890
 
883
  PDDOptSurfaceDesc = ^TDDOptSurfaceDesc;
891
  PDDOptSurfaceDesc = ^TDDOptSurfaceDesc;
884
  TDDOptSurfaceDesc = packed record
892
  TDDOptSurfaceDesc = packed record
885
    dwSize : DWORD;             // size of the DDOPTSURFACEDESC structure
893
    dwSize : DWORD;             // size of the DDOPTSURFACEDESC structure
886
    dwFlags : DWORD;            // determines what fields are valid
894
    dwFlags : DWORD;            // determines what fields are valid
887
    ddSCaps : TDDSCaps2;        // Common caps like: Memory type
895
    ddSCaps : TDDSCaps2;        // Common caps like: Memory type
888
    ddOSCaps : TDDOSCaps;       // Common caps like: Memory type
896
    ddOSCaps : TDDOSCaps;       // Common caps like: Memory type
889
    guid : TGUID;               // Compression technique GUID
897
    guid : TGUID;               // Compression technique GUID
890
    dwCompressionRatio : DWORD; // Compression ratio
898
    dwCompressionRatio : DWORD; // Compression ratio
891
  end;
899
  end;
892
 
900
 
893
(*
901
(*
894
 * DDCOLORCONTROL
902
 * DDCOLORCONTROL
895
 *)
903
 *)
896
  PDDColorControl = ^TDDColorControl;
904
  PDDColorControl = ^TDDColorControl;
897
  TDDColorControl = packed record
905
  TDDColorControl = packed record
898
    dwSize: DWORD;
906
    dwSize: DWORD;
899
    dwFlags: DWORD;
907
    dwFlags: DWORD;
900
    lBrightness: LongInt;
908
    lBrightness: LongInt;
901
    lContrast: LongInt;
909
    lContrast: LongInt;
902
    lHue: LongInt;
910
    lHue: LongInt;
903
    lSaturation: LongInt;
911
    lSaturation: LongInt;
904
    lSharpness: LongInt;
912
    lSharpness: LongInt;
905
    lGamma: LongInt;
913
    lGamma: LongInt;
906
    lColorEnable: LongInt;
914
    lColorEnable: LongInt;
907
    dwReserved1: DWORD;
915
    dwReserved1: DWORD;
908
  end;
916
  end;
909
 
917
 
910
(*
918
(*
911
 * callbacks
919
 * callbacks
912
 *)
920
 *)
913
 
921
 
914
{$IFNDEF WINNT}
922
{$IFNDEF WINNT}
915
  TDDEnumModesCallback = function (const lpDDSurfaceDesc: TDDSurfaceDesc;
923
  TDDEnumModesCallback = function (const lpDDSurfaceDesc: TDDSurfaceDesc;
916
      lpContext: Pointer) : HResult; stdcall;
924
      lpContext: Pointer) : HResult; stdcall;
917
  TDDEnumModesCallback2 = function (const lpDDSurfaceDesc: TDDSurfaceDesc2;
925
  TDDEnumModesCallback2 = function (const lpDDSurfaceDesc: TDDSurfaceDesc2;
918
      lpContext: Pointer) : HResult; stdcall;
926
      lpContext: Pointer) : HResult; stdcall;
919
  TDDEnumSurfacesCallback = function (lpDDSurface: IDirectDrawSurface;
927
  TDDEnumSurfacesCallback = function (lpDDSurface: IDirectDrawSurface;
920
      const lpDDSurfaceDesc: TDDSurfaceDesc; lpContext: Pointer) : HResult; stdcall;
928
      const lpDDSurfaceDesc: TDDSurfaceDesc; lpContext: Pointer) : HResult; stdcall;
921
  TDDEnumSurfacesCallback2 = function (lpDDSurface: IDirectDrawSurface4;
929
  TDDEnumSurfacesCallback2 = function (lpDDSurface: IDirectDrawSurface4;
922
      const lpDDSurfaceDesc: TDDSurfaceDesc2; lpContext: Pointer) : HResult; stdcall;
930
      const lpDDSurfaceDesc: TDDSurfaceDesc2; lpContext: Pointer) : HResult; stdcall;
923
  TDDEnumSurfacesCallback7 = function (lpDDSurface: IDirectDrawSurface7;
931
  TDDEnumSurfacesCallback7 = function (lpDDSurface: IDirectDrawSurface7;
924
      const lpDDSurfaceDesc: TDDSurfaceDesc2; lpContext: Pointer) : HResult; stdcall;
932
      const lpDDSurfaceDesc: TDDSurfaceDesc2; lpContext: Pointer) : HResult; stdcall;
925
{$ENDIF}
933
{$ENDIF}
926
 
934
 
927
(*
935
(*
928
 * INTERACES FOLLOW:
936
 * INTERACES FOLLOW:
929
 *      IDirectDraw
937
 *      IDirectDraw
930
 *      IDirectDrawClipper
938
 *      IDirectDrawClipper
931
 *      IDirectDrawPalette
939
 *      IDirectDrawPalette
932
 *      IDirectDrawSurface
940
 *      IDirectDrawSurface
933
 *)
941
 *)
934
 
942
 
935
(*
943
(*
936
 * IDirectDraw
944
 * IDirectDraw
937
 *)
945
 *)
938
 
946
 
939
  IDirectDraw = interface (IUnknown)
947
  IDirectDraw = interface (IUnknown)
940
    ['{6C14DB80-A733-11CE-A521-0020AF0BE560}']
948
    ['{6C14DB80-A733-11CE-A521-0020AF0BE560}']
941
    (*** IDirectDraw methods ***)
949
    (*** IDirectDraw methods ***)
942
    function Compact: HResult; stdcall;
950
    function Compact: HResult; stdcall;
943
    function CreateClipper (dwFlags: DWORD;
951
    function CreateClipper (dwFlags: DWORD;
944
        out lplpDDClipper: IDirectDrawClipper;
952
        out lplpDDClipper: IDirectDrawClipper;
945
        pUnkOuter: IUnknown) : HResult; stdcall;
953
        pUnkOuter: IUnknown) : HResult; stdcall;
946
    function CreatePalette (dwFlags: DWORD; lpColorTable: pointer;
954
    function CreatePalette (dwFlags: DWORD; lpColorTable: pointer;
947
        out lplpDDPalette: IDirectDrawPalette;
955
        out lplpDDPalette: IDirectDrawPalette;
948
        pUnkOuter: IUnknown) : HResult; stdcall;
956
        pUnkOuter: IUnknown) : HResult; stdcall;
949
    function CreateSurface (var lpDDSurfaceDesc: TDDSurfaceDesc;
957
    function CreateSurface (var lpDDSurfaceDesc: TDDSurfaceDesc;
950
        out lplpDDSurface: IDirectDrawSurface;
958
        out lplpDDSurface: IDirectDrawSurface;
951
        pUnkOuter: IUnknown) : HResult; stdcall;
959
        pUnkOuter: IUnknown) : HResult; stdcall;
952
    function DuplicateSurface (lpDDSurface: IDirectDrawSurface;
960
    function DuplicateSurface (lpDDSurface: IDirectDrawSurface;
953
        out lplpDupDDSurface: IDirectDrawSurface) : HResult; stdcall;
961
        out lplpDupDDSurface: IDirectDrawSurface) : HResult; stdcall;
954
    function EnumDisplayModes (dwFlags: DWORD;
962
    function EnumDisplayModes (dwFlags: DWORD;
955
        lpDDSurfaceDesc: PDDSurfaceDesc; lpContext: Pointer;
963
        lpDDSurfaceDesc: PDDSurfaceDesc; lpContext: Pointer;
956
        lpEnumModesCallback: TDDEnumModesCallback) : HResult; stdcall;
964
        lpEnumModesCallback: TDDEnumModesCallback) : HResult; stdcall;
957
    function EnumSurfaces (dwFlags: DWORD; const lpDDSD: TDDSurfaceDesc;
965
    function EnumSurfaces (dwFlags: DWORD; const lpDDSD: TDDSurfaceDesc;
958
        lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback) :
966
        lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback) :
959
        HResult; stdcall;
967
        HResult; stdcall;
960
    function FlipToGDISurface: HResult; stdcall;
968
    function FlipToGDISurface: HResult; stdcall;
961
    function GetCaps (lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps) : HResult; stdcall;
969
    function GetCaps (lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps) : HResult; stdcall;
962
    function GetDisplayMode (out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
970
    function GetDisplayMode (out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
963
    function GetFourCCCodes (var lpNumCodes: DWORD; lpCodes: PDWORD) : HResult; stdcall;
971
    function GetFourCCCodes (var lpNumCodes: DWORD; lpCodes: PDWORD) : HResult; stdcall;
964
    function GetGDISurface (out lplpGDIDDSSurface: IDirectDrawSurface) :
972
    function GetGDISurface (out lplpGDIDDSSurface: IDirectDrawSurface) :
965
        HResult; stdcall;
973
        HResult; stdcall;
966
    function GetMonitorFrequency (out lpdwFrequency: DWORD) : HResult; stdcall;
974
    function GetMonitorFrequency (out lpdwFrequency: DWORD) : HResult; stdcall;
967
    function GetScanLine (out lpdwScanLine: DWORD) : HResult; stdcall;
975
    function GetScanLine (out lpdwScanLine: DWORD) : HResult; stdcall;
968
    function GetVerticalBlankStatus (out lpbIsInVB: BOOL) : HResult; stdcall;
976
    function GetVerticalBlankStatus (out lpbIsInVB: BOOL) : HResult; stdcall;
969
    function Initialize (lpGUID: PGUID) : HResult; stdcall;
977
    function Initialize (lpGUID: PGUID) : HResult; stdcall;
970
    function RestoreDisplayMode: HResult; stdcall;
978
    function RestoreDisplayMode: HResult; stdcall;
971
    function SetCooperativeLevel (hWnd: HWND; dwFlags: DWORD) : HResult; stdcall;
979
    function SetCooperativeLevel (hWnd: HWND; dwFlags: DWORD) : HResult; stdcall;
972
    (*** Warning!  SetDisplayMode differs between DirectDraw 1 and DirectDraw 2 ***)
980
    (*** Warning!  SetDisplayMode differs between DirectDraw 1 and DirectDraw 2 ***)
973
    function SetDisplayMode (dwWidth: DWORD; dwHeight: DWORD;
981
    function SetDisplayMode (dwWidth: DWORD; dwHeight: DWORD;
974
        dwBpp: DWORD) : HResult; stdcall;
982
        dwBpp: DWORD) : HResult; stdcall;
975
    function WaitForVerticalBlank (dwFlags: DWORD; hEvent: THandle) :
983
    function WaitForVerticalBlank (dwFlags: DWORD; hEvent: THandle) :
976
        HResult; stdcall;
984
        HResult; stdcall;
977
  end;
985
  end;
978
 
986
 
979
  IDirectDraw2 = interface (IUnknown)
987
  IDirectDraw2 = interface (IUnknown)
980
    ['{B3A6F3E0-2B43-11CF-A2DE-00AA00B93356}']
988
    ['{B3A6F3E0-2B43-11CF-A2DE-00AA00B93356}']
981
    (*** IDirectDraw methods ***)
989
    (*** IDirectDraw methods ***)
982
    function Compact: HResult; stdcall;
990
    function Compact: HResult; stdcall;
983
    function CreateClipper (dwFlags: DWORD;
991
    function CreateClipper (dwFlags: DWORD;
984
        out lplpDDClipper: IDirectDrawClipper;
992
        out lplpDDClipper: IDirectDrawClipper;
985
        pUnkOuter: IUnknown) : HResult; stdcall;
993
        pUnkOuter: IUnknown) : HResult; stdcall;
986
    function CreatePalette (dwFlags: DWORD; lpColorTable: pointer;
994
    function CreatePalette (dwFlags: DWORD; lpColorTable: pointer;
987
        out lplpDDPalette: IDirectDrawPalette;
995
        out lplpDDPalette: IDirectDrawPalette;
988
        pUnkOuter: IUnknown) : HResult; stdcall;
996
        pUnkOuter: IUnknown) : HResult; stdcall;
989
    function CreateSurface (var lpDDSurfaceDesc: TDDSurfaceDesc;
997
    function CreateSurface (var lpDDSurfaceDesc: TDDSurfaceDesc;
990
        out lplpDDSurface: IDirectDrawSurface;
998
        out lplpDDSurface: IDirectDrawSurface;
991
        pUnkOuter: IUnknown) : HResult; stdcall;
999
        pUnkOuter: IUnknown) : HResult; stdcall;
992
    function DuplicateSurface (lpDDSurface: IDirectDrawSurface;
1000
    function DuplicateSurface (lpDDSurface: IDirectDrawSurface;
993
        out lplpDupDDSurface: IDirectDrawSurface) : HResult; stdcall;
1001
        out lplpDupDDSurface: IDirectDrawSurface) : HResult; stdcall;
994
    function EnumDisplayModes (dwFlags: DWORD;
1002
    function EnumDisplayModes (dwFlags: DWORD;
995
        lpDDSurfaceDesc: PDDSurfaceDesc; lpContext: Pointer;
1003
        lpDDSurfaceDesc: PDDSurfaceDesc; lpContext: Pointer;
996
        lpEnumModesCallback: TDDEnumModesCallback) : HResult; stdcall;
1004
        lpEnumModesCallback: TDDEnumModesCallback) : HResult; stdcall;
997
    function EnumSurfaces (dwFlags: DWORD; var lpDDSD: TDDSurfaceDesc;
1005
    function EnumSurfaces (dwFlags: DWORD; var lpDDSD: TDDSurfaceDesc;
998
        lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback) :
1006
        lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback) :
999
        HResult; stdcall;
1007
        HResult; stdcall;
1000
    function FlipToGDISurface: HResult; stdcall;
1008
    function FlipToGDISurface: HResult; stdcall;
1001
    function GetCaps (lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps) : HResult; stdcall;
1009
    function GetCaps (lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps) : HResult; stdcall;
1002
    function GetDisplayMode (out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
1010
    function GetDisplayMode (out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
1003
    function GetFourCCCodes (var lpNumCodes: DWORD; lpCodes: PDWORD) : HResult; stdcall;
1011
    function GetFourCCCodes (var lpNumCodes: DWORD; lpCodes: PDWORD) : HResult; stdcall;
1004
    function GetGDISurface (out lplpGDIDDSSurface: IDirectDrawSurface) : HResult; stdcall;
1012
    function GetGDISurface (out lplpGDIDDSSurface: IDirectDrawSurface) : HResult; stdcall;
1005
    function GetMonitorFrequency (out lpdwFrequency: DWORD) : HResult; stdcall;
1013
    function GetMonitorFrequency (out lpdwFrequency: DWORD) : HResult; stdcall;
1006
    function GetScanLine (out lpdwScanLine: DWORD) : HResult; stdcall;
1014
    function GetScanLine (out lpdwScanLine: DWORD) : HResult; stdcall;
1007
    function GetVerticalBlankStatus (out lpbIsInVB: BOOL) : HResult; stdcall;
1015
    function GetVerticalBlankStatus (out lpbIsInVB: BOOL) : HResult; stdcall;
1008
    function Initialize (lpGUID: PGUID) : HResult; stdcall;
1016
    function Initialize (lpGUID: PGUID) : HResult; stdcall;
1009
    function RestoreDisplayMode: HResult; stdcall;
1017
    function RestoreDisplayMode: HResult; stdcall;
1010
    function SetCooperativeLevel (hWnd: HWND; dwFlags: DWORD) : HResult; stdcall;
1018
    function SetCooperativeLevel (hWnd: HWND; dwFlags: DWORD) : HResult; stdcall;
1011
(*** Warning!  SetDisplayMode differs between DirectDraw 1 and DirectDraw 2 ***)
1019
(*** Warning!  SetDisplayMode differs between DirectDraw 1 and DirectDraw 2 ***)
1012
    function SetDisplayMode (dwWidth: DWORD; dwHeight: DWORD; dwBPP: DWORD;
1020
    function SetDisplayMode (dwWidth: DWORD; dwHeight: DWORD; dwBPP: DWORD;
1013
        dwRefreshRate: DWORD; dwFlags: DWORD) : HResult; stdcall;
1021
        dwRefreshRate: DWORD; dwFlags: DWORD) : HResult; stdcall;
1014
    function WaitForVerticalBlank (dwFlags: DWORD; hEvent: THandle) :
1022
    function WaitForVerticalBlank (dwFlags: DWORD; hEvent: THandle) :
1015
        HResult; stdcall;
1023
        HResult; stdcall;
1016
    (*** Added in the v2 interface ***)
1024
    (*** Added in the v2 interface ***)
1017
    function GetAvailableVidMem (var lpDDSCaps: TDDSCaps;
1025
    function GetAvailableVidMem (var lpDDSCaps: TDDSCaps;
1018
        out lpdwTotal, lpdwFree: DWORD) : HResult; stdcall;
1026
        out lpdwTotal, lpdwFree: DWORD) : HResult; stdcall;
1019
  end;
1027
  end;
1020
 
1028
 
1021
  IDirectDraw4 = interface (IUnknown)
1029
  IDirectDraw4 = interface (IUnknown)
1022
    ['{9c59509a-39bd-11d1-8c4a-00c04fd930c5}']
1030
    ['{9c59509a-39bd-11d1-8c4a-00c04fd930c5}']
1023
    (*** IDirectDraw methods ***)
1031
    (*** IDirectDraw methods ***)
1024
    function Compact: HResult; stdcall;
1032
    function Compact: HResult; stdcall;
1025
    function CreateClipper (dwFlags: DWORD;
1033
    function CreateClipper (dwFlags: DWORD;
1026
        out lplpDDClipper: IDirectDrawClipper;
1034
        out lplpDDClipper: IDirectDrawClipper;
1027
        pUnkOuter: IUnknown) : HResult; stdcall;
1035
        pUnkOuter: IUnknown) : HResult; stdcall;
1028
    function CreatePalette (dwFlags: DWORD; lpColorTable: pointer;
1036
    function CreatePalette (dwFlags: DWORD; lpColorTable: pointer;
1029
        out lplpDDPalette: IDirectDrawPalette;
1037
        out lplpDDPalette: IDirectDrawPalette;
1030
        pUnkOuter: IUnknown) : HResult; stdcall;
1038
        pUnkOuter: IUnknown) : HResult; stdcall;
1031
    function CreateSurface (const lpDDSurfaceDesc: TDDSurfaceDesc2;
1039
    function CreateSurface (const lpDDSurfaceDesc: TDDSurfaceDesc2;
1032
        out lplpDDSurface: IDirectDrawSurface4;
1040
        out lplpDDSurface: IDirectDrawSurface4;
1033
        pUnkOuter: IUnknown) : HResult; stdcall;
1041
        pUnkOuter: IUnknown) : HResult; stdcall;
1034
    function DuplicateSurface (lpDDSurface: IDirectDrawSurface4;
1042
    function DuplicateSurface (lpDDSurface: IDirectDrawSurface4;
1035
        out lplpDupDDSurface: IDirectDrawSurface4) : HResult; stdcall;
1043
        out lplpDupDDSurface: IDirectDrawSurface4) : HResult; stdcall;
1036
    function EnumDisplayModes (dwFlags: DWORD;
1044
    function EnumDisplayModes (dwFlags: DWORD;
1037
        lpDDSurfaceDesc: PDDSurfaceDesc2; lpContext: Pointer;
1045
        lpDDSurfaceDesc: PDDSurfaceDesc2; lpContext: Pointer;
1038
        lpEnumModesCallback: TDDEnumModesCallback2) : HResult; stdcall;
1046
        lpEnumModesCallback: TDDEnumModesCallback2) : HResult; stdcall;
1039
    function EnumSurfaces (dwFlags: DWORD; const lpDDSD: TDDSurfaceDesc2;
1047
    function EnumSurfaces (dwFlags: DWORD; const lpDDSD: TDDSurfaceDesc2;
1040
        lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback2) :
1048
        lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback2) :
1041
        HResult; stdcall;
1049
        HResult; stdcall;
1042
    function FlipToGDISurface: HResult; stdcall;
1050
    function FlipToGDISurface: HResult; stdcall;
1043
    function GetCaps (lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps) : HResult; stdcall;
1051
    function GetCaps (lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps) : HResult; stdcall;
1044
    function GetDisplayMode (out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
1052
    function GetDisplayMode (out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
1045
    function GetFourCCCodes (var lpNumCodes: DWORD; lpCodes: PDWORD) : HResult; stdcall;
1053
    function GetFourCCCodes (var lpNumCodes: DWORD; lpCodes: PDWORD) : HResult; stdcall;
1046
    function GetGDISurface (out lplpGDIDDSSurface: IDirectDrawSurface4) :
1054
    function GetGDISurface (out lplpGDIDDSSurface: IDirectDrawSurface4) :
1047
        HResult; stdcall;
1055
        HResult; stdcall;
1048
    function GetMonitorFrequency (out lpdwFrequency: DWORD) : HResult; stdcall;
1056
    function GetMonitorFrequency (out lpdwFrequency: DWORD) : HResult; stdcall;
1049
    function GetScanLine (out lpdwScanLine: DWORD) : HResult; stdcall;
1057
    function GetScanLine (out lpdwScanLine: DWORD) : HResult; stdcall;
1050
    function GetVerticalBlankStatus (out lpbIsInVB: BOOL) : HResult; stdcall;
1058
    function GetVerticalBlankStatus (out lpbIsInVB: BOOL) : HResult; stdcall;
1051
    function Initialize (lpGUID: PGUID) : HResult; stdcall;
1059
    function Initialize (lpGUID: PGUID) : HResult; stdcall;
1052
    function RestoreDisplayMode: HResult; stdcall;
1060
    function RestoreDisplayMode: HResult; stdcall;
1053
    function SetCooperativeLevel (hWnd: HWND; dwFlags: DWORD) : HResult; stdcall;
1061
    function SetCooperativeLevel (hWnd: HWND; dwFlags: DWORD) : HResult; stdcall;
1054
(*** Warning!  SetDisplayMode differs between DirectDraw 1 and DirectDraw 2 ***)
1062
(*** Warning!  SetDisplayMode differs between DirectDraw 1 and DirectDraw 2 ***)
1055
    function SetDisplayMode (dwWidth: DWORD; dwHeight: DWORD; dwBPP: DWORD;
1063
    function SetDisplayMode (dwWidth: DWORD; dwHeight: DWORD; dwBPP: DWORD;
1056
        dwRefreshRate: DWORD; dwFlags: DWORD) : HResult; stdcall;
1064
        dwRefreshRate: DWORD; dwFlags: DWORD) : HResult; stdcall;
1057
    function WaitForVerticalBlank (dwFlags: DWORD; hEvent: THandle) :
1065
    function WaitForVerticalBlank (dwFlags: DWORD; hEvent: THandle) :
1058
        HResult; stdcall;
1066
        HResult; stdcall;
1059
    (*** Added in the v2 interface ***)
1067
    (*** Added in the v2 interface ***)
1060
    function GetAvailableVidMem (const lpDDSCaps: TDDSCaps2;
1068
    function GetAvailableVidMem (const lpDDSCaps: TDDSCaps2;
1061
        out lpdwTotal, lpdwFree: DWORD) : HResult; stdcall;
1069
        out lpdwTotal, lpdwFree: DWORD) : HResult; stdcall;
1062
    (*** Added in the V4 Interface ***)
1070
    (*** Added in the V4 Interface ***)
1063
    function GetSurfaceFromDC (hdc : Windows.HDC;
1071
    function GetSurfaceFromDC (hdc : Windows.HDC;
1064
        out lpDDS4: IDirectDrawSurface4) : HResult; stdcall;
1072
        out lpDDS4: IDirectDrawSurface4) : HResult; stdcall;
1065
    function RestoreAllSurfaces : HResult; stdcall;
1073
    function RestoreAllSurfaces : HResult; stdcall;
1066
    function TestCooperativeLevel : HResult; stdcall;
1074
    function TestCooperativeLevel : HResult; stdcall;
1067
    function GetDeviceIdentifier (out lpdddi: TDDDeviceIdentifier;
1075
    function GetDeviceIdentifier (out lpdddi: TDDDeviceIdentifier;
1068
        dwFlags: DWORD) : HResult; stdcall;
1076
        dwFlags: DWORD) : HResult; stdcall;
1069
  end;
1077
  end;
1070
 
1078
 
1071
  IDirectDraw7 = interface (IUnknown)
1079
  IDirectDraw7 = interface (IUnknown)
1072
    ['{15e65ec0-3b9c-11d2-b92f-00609797ea5b}']
1080
    ['{15e65ec0-3b9c-11d2-b92f-00609797ea5b}']
1073
    (*** IDirectDraw methods ***)
1081
    (*** IDirectDraw methods ***)
1074
    function Compact: HResult; stdcall;
1082
    function Compact: HResult; stdcall;
1075
    function CreateClipper (dwFlags: DWORD;
1083
    function CreateClipper (dwFlags: DWORD;
1076
        out lplpDDClipper: IDirectDrawClipper;
1084
        out lplpDDClipper: IDirectDrawClipper;
1077
        pUnkOuter: IUnknown) : HResult; stdcall;
1085
        pUnkOuter: IUnknown) : HResult; stdcall;
1078
    function CreatePalette (dwFlags: DWORD; lpColorTable: pointer;
1086
    function CreatePalette (dwFlags: DWORD; lpColorTable: pointer;
1079
        out lplpDDPalette: IDirectDrawPalette;
1087
        out lplpDDPalette: IDirectDrawPalette;
1080
        pUnkOuter: IUnknown) : HResult; stdcall;
1088
        pUnkOuter: IUnknown) : HResult; stdcall;
1081
    function CreateSurface (const lpDDSurfaceDesc: TDDSurfaceDesc2;
1089
    function CreateSurface (const lpDDSurfaceDesc: TDDSurfaceDesc2;
1082
        out lplpDDSurface: IDirectDrawSurface7;
1090
        out lplpDDSurface: IDirectDrawSurface7;
1083
        pUnkOuter: IUnknown) : HResult; stdcall;
1091
        pUnkOuter: IUnknown) : HResult; stdcall;
1084
    function DuplicateSurface (lpDDSurface: IDirectDrawSurface7;
1092
    function DuplicateSurface (lpDDSurface: IDirectDrawSurface7;
1085
        out lplpDupDDSurface: IDirectDrawSurface7) : HResult; stdcall;
1093
        out lplpDupDDSurface: IDirectDrawSurface7) : HResult; stdcall;
1086
    function EnumDisplayModes (dwFlags: DWORD;
1094
    function EnumDisplayModes (dwFlags: DWORD;
1087
        lpDDSurfaceDesc: PDDSurfaceDesc2; lpContext: Pointer;
1095
        lpDDSurfaceDesc: PDDSurfaceDesc2; lpContext: Pointer;
1088
        lpEnumModesCallback: TDDEnumModesCallback2) : HResult; stdcall;
1096
        lpEnumModesCallback: TDDEnumModesCallback2) : HResult; stdcall;
1089
    function EnumSurfaces (dwFlags: DWORD; const lpDDSD: TDDSurfaceDesc2;
1097
    function EnumSurfaces (dwFlags: DWORD; const lpDDSD: TDDSurfaceDesc2;
1090
        lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback7) :
1098
        lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback7) :
1091
        HResult; stdcall;
1099
        HResult; stdcall;
1092
    function FlipToGDISurface: HResult; stdcall;
1100
    function FlipToGDISurface: HResult; stdcall;
1093
    function GetCaps (lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps) : HResult; stdcall;
1101
    function GetCaps (lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps) : HResult; stdcall;
1094
    function GetDisplayMode (out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
1102
    function GetDisplayMode (out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
1095
    function GetFourCCCodes (var lpNumCodes: DWORD; lpCodes: PDWORD) : HResult; stdcall;
1103
    function GetFourCCCodes (var lpNumCodes: DWORD; lpCodes: PDWORD) : HResult; stdcall;
1096
    function GetGDISurface (out lplpGDIDDSSurface: IDirectDrawSurface7) :
1104
    function GetGDISurface (out lplpGDIDDSSurface: IDirectDrawSurface7) :
1097
        HResult; stdcall;
1105
        HResult; stdcall;
1098
    function GetMonitorFrequency (out lpdwFrequency: DWORD) : HResult; stdcall;
1106
    function GetMonitorFrequency (out lpdwFrequency: DWORD) : HResult; stdcall;
1099
    function GetScanLine (out lpdwScanLine: DWORD) : HResult; stdcall;
1107
    function GetScanLine (out lpdwScanLine: DWORD) : HResult; stdcall;
1100
    function GetVerticalBlankStatus (out lpbIsInVB: BOOL) : HResult; stdcall;
1108
    function GetVerticalBlankStatus (out lpbIsInVB: BOOL) : HResult; stdcall;
1101
    function Initialize (lpGUID: PGUID) : HResult; stdcall;
1109
    function Initialize (lpGUID: PGUID) : HResult; stdcall;
1102
    function RestoreDisplayMode: HResult; stdcall;
1110
    function RestoreDisplayMode: HResult; stdcall;
1103
    function SetCooperativeLevel (hWnd: HWND; dwFlags: DWORD) : HResult; stdcall;
1111
    function SetCooperativeLevel (hWnd: HWND; dwFlags: DWORD) : HResult; stdcall;
1104
    function SetDisplayMode (dwWidth: DWORD; dwHeight: DWORD; dwBPP: DWORD;
1112
    function SetDisplayMode (dwWidth: DWORD; dwHeight: DWORD; dwBPP: DWORD;
1105
        dwRefreshRate: DWORD; dwFlags: DWORD) : HResult; stdcall;
1113
        dwRefreshRate: DWORD; dwFlags: DWORD) : HResult; stdcall;
1106
    function WaitForVerticalBlank (dwFlags: DWORD; hEvent: THandle) :
1114
    function WaitForVerticalBlank (dwFlags: DWORD; hEvent: THandle) :
1107
        HResult; stdcall;
1115
        HResult; stdcall;
1108
    (*** Added in the v2 interface ***)
1116
    (*** Added in the v2 interface ***)
1109
    function GetAvailableVidMem (const lpDDSCaps: TDDSCaps2;
1117
    function GetAvailableVidMem (const lpDDSCaps: TDDSCaps2;
1110
        out lpdwTotal, lpdwFree: DWORD) : HResult; stdcall;
1118
        out lpdwTotal, lpdwFree: DWORD) : HResult; stdcall;
1111
    (*** Added in the V4 Interface ***)
1119
    (*** Added in the V4 Interface ***)
1112
    function GetSurfaceFromDC (hdc : Windows.HDC;
1120
    function GetSurfaceFromDC (hdc : Windows.HDC;
1113
        out lpDDS: IDirectDrawSurface7) : HResult; stdcall;
1121
        out lpDDS: IDirectDrawSurface7) : HResult; stdcall;
1114
    function RestoreAllSurfaces : HResult; stdcall;
1122
    function RestoreAllSurfaces : HResult; stdcall;
1115
    function TestCooperativeLevel : HResult; stdcall;
1123
    function TestCooperativeLevel : HResult; stdcall;
1116
    function GetDeviceIdentifier (out lpdddi: TDDDeviceIdentifier2;
1124
    function GetDeviceIdentifier (out lpdddi: TDDDeviceIdentifier2;
1117
        dwFlags: DWORD) : HResult; stdcall;
1125
        dwFlags: DWORD) : HResult; stdcall;
1118
    function StartModeTest(const lpModesToTest; dwNumEntries, dwFlags: DWORD) : HResult; stdcall;
1126
    function StartModeTest(const lpModesToTest; dwNumEntries, dwFlags: DWORD) : HResult; stdcall;
1119
    function EvaluateMode(dwFlags: DWORD; out pSecondsUntilTimeout: DWORD) : HResult; stdcall;
1127
    function EvaluateMode(dwFlags: DWORD; out pSecondsUntilTimeout: DWORD) : HResult; stdcall;
1120
  end;
1128
  end;
1121
 
1129
 
1122
 
1130
 
1123
 
1131
 
1124
(*
1132
(*
1125
 * IDirectDrawPalette
1133
 * IDirectDrawPalette
1126
 *)
1134
 *)
1127
 
1135
 
1128
  IDirectDrawPalette = interface (IUnknown)
1136
  IDirectDrawPalette = interface (IUnknown)
1129
    ['{6C14DB84-A733-11CE-A521-0020AF0BE560}']
1137
    ['{6C14DB84-A733-11CE-A521-0020AF0BE560}']
1130
    (*** IDirectDrawPalette methods ***)
1138
    (*** IDirectDrawPalette methods ***)
1131
    function GetCaps (out lpdwCaps: DWORD) : HResult; stdcall;
1139
    function GetCaps (out lpdwCaps: DWORD) : HResult; stdcall;
1132
    function GetEntries (dwFlags: DWORD; dwBase: DWORD; dwNumEntries: DWORD;
1140
    function GetEntries (dwFlags: DWORD; dwBase: DWORD; dwNumEntries: DWORD;
1133
        lpEntries: pointer) : HResult; stdcall;
1141
        lpEntries: pointer) : HResult; stdcall;
1134
    function Initialize (lpDD: IDirectDraw; dwFlags: DWORD;
1142
    function Initialize (lpDD: IDirectDraw; dwFlags: DWORD;
1135
        lpDDColorTable: pointer) : HResult; stdcall;
1143
        lpDDColorTable: pointer) : HResult; stdcall;
1136
    function SetEntries (dwFlags: DWORD; dwStartingEntry: DWORD;
1144
    function SetEntries (dwFlags: DWORD; dwStartingEntry: DWORD;
1137
        dwCount: DWORD; lpEntries: pointer) : HResult; stdcall;
1145
        dwCount: DWORD; lpEntries: pointer) : HResult; stdcall;
1138
  end;
1146
  end;
1139
 
1147
 
1140
(*
1148
(*
1141
 * IDirectDrawClipper
1149
 * IDirectDrawClipper
1142
 *)
1150
 *)
1143
 
1151
 
1144
  IDirectDrawClipper = interface (IUnknown)
1152
  IDirectDrawClipper = interface (IUnknown)
1145
    ['{6C14DB85-A733-11CE-A521-0020AF0BE560}']
1153
    ['{6C14DB85-A733-11CE-A521-0020AF0BE560}']
1146
    (*** IDirectDrawClipper methods ***)
1154
    (*** IDirectDrawClipper methods ***)
1147
    function GetClipList (lpRect: PRect; lpClipList: PRgnData;
1155
    function GetClipList (lpRect: PRect; lpClipList: PRgnData;
1148
        var lpdwSize: DWORD) : HResult; stdcall;
1156
        var lpdwSize: DWORD) : HResult; stdcall;
1149
    function GetHWnd (out lphWnd: HWND) : HResult; stdcall;
1157
    function GetHWnd (out lphWnd: HWND) : HResult; stdcall;
1150
    function Initialize (lpDD: IDirectDraw; dwFlags: DWORD) : HResult; stdcall;
1158
    function Initialize (lpDD: IDirectDraw; dwFlags: DWORD) : HResult; stdcall;
1151
    function IsClipListChanged (out lpbChanged: BOOL) : HResult; stdcall;
1159
    function IsClipListChanged (out lpbChanged: BOOL) : HResult; stdcall;
1152
    function SetClipList (lpClipList: PRgnData; dwFlags: DWORD) : HResult; stdcall;
1160
    function SetClipList (lpClipList: PRgnData; dwFlags: DWORD) : HResult; stdcall;
1153
    function SetHWnd (dwFlags: DWORD; hWnd: HWND) : HResult; stdcall;
1161
    function SetHWnd (dwFlags: DWORD; hWnd: HWND) : HResult; stdcall;
1154
  end;
1162
  end;
1155
 
1163
 
1156
(*
1164
(*
1157
 * IDirectDrawSurface and related interfaces
1165
 * IDirectDrawSurface and related interfaces
1158
 *)
1166
 *)
1159
 
1167
 
1160
  IDirectDrawSurface = interface (IUnknown)
1168
  IDirectDrawSurface = interface (IUnknown)
1161
    ['{6C14DB81-A733-11CE-A521-0020AF0BE560}']
1169
    ['{6C14DB81-A733-11CE-A521-0020AF0BE560}']
1162
    (*** IDirectDrawSurface methods ***)
1170
    (*** IDirectDrawSurface methods ***)
1163
    function AddAttachedSurface (lpDDSAttachedSurface: IDirectDrawSurface) :
1171
    function AddAttachedSurface (lpDDSAttachedSurface: IDirectDrawSurface) :
1164
        HResult; stdcall;
1172
        HResult; stdcall;
1165
    function AddOverlayDirtyRect (const lpRect: TRect) : HResult; stdcall;
1173
    function AddOverlayDirtyRect (const lpRect: TRect) : HResult; stdcall;
1166
    function Blt (lpDestRect: PRect;
1174
    function Blt (lpDestRect: PRect;
1167
        lpDDSrcSurface: IDirectDrawSurface; lpSrcRect: PRect;
1175
        lpDDSrcSurface: IDirectDrawSurface; lpSrcRect: PRect;
1168
        dwFlags: DWORD; lpDDBltFx: PDDBltFX) : HResult; stdcall;
1176
        dwFlags: DWORD; lpDDBltFx: PDDBltFX) : HResult; stdcall;
1169
    function BltBatch (const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
1177
    function BltBatch (const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
1170
        dwFlags: DWORD) : HResult; stdcall;
1178
        dwFlags: DWORD) : HResult; stdcall;
1171
    function BltFast (dwX: DWORD; dwY: DWORD;
1179
    function BltFast (dwX: DWORD; dwY: DWORD;
1172
        lpDDSrcSurface: IDirectDrawSurface; lpSrcRect: PRect;
1180
        lpDDSrcSurface: IDirectDrawSurface; lpSrcRect: PRect;
1173
        dwTrans: DWORD) : HResult; stdcall;
1181
        dwTrans: DWORD) : HResult; stdcall;
1174
    function DeleteAttachedSurface (dwFlags: DWORD;
1182
    function DeleteAttachedSurface (dwFlags: DWORD;
1175
        lpDDSAttachedSurface: IDirectDrawSurface) : HResult; stdcall;
1183
        lpDDSAttachedSurface: IDirectDrawSurface) : HResult; stdcall;
1176
    function EnumAttachedSurfaces (lpContext: Pointer;
1184
    function EnumAttachedSurfaces (lpContext: Pointer;
1177
        lpEnumSurfacesCallback: TDDEnumSurfacesCallback) : HResult; stdcall;
1185
        lpEnumSurfacesCallback: TDDEnumSurfacesCallback) : HResult; stdcall;
1178
    function EnumOverlayZOrders (dwFlags: DWORD; lpContext: Pointer;
1186
    function EnumOverlayZOrders (dwFlags: DWORD; lpContext: Pointer;
1179
        lpfnCallback: TDDEnumSurfacesCallback) : HResult; stdcall;
1187
        lpfnCallback: TDDEnumSurfacesCallback) : HResult; stdcall;
1180
    function Flip (lpDDSurfaceTargetOverride: IDirectDrawSurface;
1188
    function Flip (lpDDSurfaceTargetOverride: IDirectDrawSurface;
1181
        dwFlags: DWORD) : HResult; stdcall;
1189
        dwFlags: DWORD) : HResult; stdcall;
1182
    function GetAttachedSurface (var lpDDSCaps: TDDSCaps;
1190
    function GetAttachedSurface (var lpDDSCaps: TDDSCaps;
1183
        (*out*)var lplpDDAttachedSurface: IDirectDrawSurface) : HResult; stdcall;
1191
        (*out*)var lplpDDAttachedSurface: IDirectDrawSurface) : HResult; stdcall;
1184
    function GetBltStatus (dwFlags: DWORD) : HResult; stdcall;
1192
    function GetBltStatus (dwFlags: DWORD) : HResult; stdcall;
1185
    function GetCaps (out lpDDSCaps: TDDSCaps) : HResult; stdcall;
1193
    function GetCaps (out lpDDSCaps: TDDSCaps) : HResult; stdcall;
1186
    function GetClipper (out lplpDDClipper: IDirectDrawClipper) : HResult; stdcall;
1194
    function GetClipper (out lplpDDClipper: IDirectDrawClipper) : HResult; stdcall;
1187
    function GetColorKey (dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
1195
    function GetColorKey (dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
1188
        HResult; stdcall;
1196
        HResult; stdcall;
1189
    function GetDC (out lphDC: HDC) : HResult; stdcall;
1197
    function GetDC (out lphDC: HDC) : HResult; stdcall;
1190
    function GetFlipStatus (dwFlags: DWORD) : HResult; stdcall;
1198
    function GetFlipStatus (dwFlags: DWORD) : HResult; stdcall;
1191
    function GetOverlayPosition (out lplX, lplY: LongInt) : HResult; stdcall;
1199
    function GetOverlayPosition (out lplX, lplY: LongInt) : HResult; stdcall;
1192
    function GetPalette (out lplpDDPalette: IDirectDrawPalette) : HResult; stdcall;
1200
    function GetPalette (out lplpDDPalette: IDirectDrawPalette) : HResult; stdcall;
1193
    function GetPixelFormat (out lpDDPixelFormat: TDDPixelFormat) : HResult; stdcall;
1201
    function GetPixelFormat (out lpDDPixelFormat: TDDPixelFormat) : HResult; stdcall;
1194
    function GetSurfaceDesc (out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
1202
    function GetSurfaceDesc (out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
1195
    function Initialize (lpDD: IDirectDraw;
1203
    function Initialize (lpDD: IDirectDraw;
1196
        out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
1204
        out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
1197
    function IsLost: HResult; stdcall;
1205
    function IsLost: HResult; stdcall;
1198
    function Lock (lpDestRect: PRect; out lpDDSurfaceDesc:
1206
    function Lock (lpDestRect: PRect; out lpDDSurfaceDesc:
1199
        TDDSurfaceDesc; dwFlags: DWORD; hEvent: THandle) : HResult; stdcall;
1207
        TDDSurfaceDesc; dwFlags: DWORD; hEvent: THandle) : HResult; stdcall;
1200
    function ReleaseDC (hDC: Windows.HDC) : HResult; stdcall;
1208
    function ReleaseDC (hDC: Windows.HDC) : HResult; stdcall;
1201
    function _Restore: HResult; stdcall;
1209
    function _Restore: HResult; stdcall;
1202
    function SetClipper (lpDDClipper: IDirectDrawClipper) : HResult; stdcall;
1210
    function SetClipper (lpDDClipper: IDirectDrawClipper) : HResult; stdcall;
1203
    function SetColorKey (dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
1211
    function SetColorKey (dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
1204
        HResult; stdcall;
1212
        HResult; stdcall;
1205
    function SetOverlayPosition (lX, lY: LongInt) : HResult; stdcall;
1213
    function SetOverlayPosition (lX, lY: LongInt) : HResult; stdcall;
1206
    function SetPalette (lpDDPalette: IDirectDrawPalette) : HResult; stdcall;
1214
    function SetPalette (lpDDPalette: IDirectDrawPalette) : HResult; stdcall;
1207
    function Unlock (lpSurfaceData: Pointer) : HResult; stdcall;
1215
    function Unlock (lpSurfaceData: Pointer) : HResult; stdcall;
1208
    function UpdateOverlay (lpSrcRect: PRect;
1216
    function UpdateOverlay (lpSrcRect: PRect;
1209
        lpDDDestSurface: IDirectDrawSurface; lpDestRect: PRect;
1217
        lpDDDestSurface: IDirectDrawSurface; lpDestRect: PRect;
1210
        dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX) : HResult; stdcall;
1218
        dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX) : HResult; stdcall;
1211
    function UpdateOverlayDisplay (dwFlags: DWORD) : HResult; stdcall;
1219
    function UpdateOverlayDisplay (dwFlags: DWORD) : HResult; stdcall;
1212
    function UpdateOverlayZOrder (dwFlags: DWORD;
1220
    function UpdateOverlayZOrder (dwFlags: DWORD;
1213
        lpDDSReference: IDirectDrawSurface) : HResult; stdcall;
1221
        lpDDSReference: IDirectDrawSurface) : HResult; stdcall;
1214
  end;
1222
  end;
1215
 
1223
 
1216
(*
1224
(*
1217
 * IDirectDrawSurface2 and related interfaces
1225
 * IDirectDrawSurface2 and related interfaces
1218
 *)
1226
 *)
1219
 
1227
 
1220
  IDirectDrawSurface2 = interface (IUnknown)
1228
  IDirectDrawSurface2 = interface (IUnknown)
1221
    ['{57805885-6eec-11cf-9441-a82303c10e27}']
1229
    ['{57805885-6eec-11cf-9441-a82303c10e27}']
1222
    (*** IDirectDrawSurface methods ***)
1230
    (*** IDirectDrawSurface methods ***)
1223
    function AddAttachedSurface (lpDDSAttachedSurface: IDirectDrawSurface2) :
1231
    function AddAttachedSurface (lpDDSAttachedSurface: IDirectDrawSurface2) :
1224
        HResult; stdcall;
1232
        HResult; stdcall;
1225
    function AddOverlayDirtyRect (const lpRect: TRect) : HResult; stdcall;
1233
    function AddOverlayDirtyRect (const lpRect: TRect) : HResult; stdcall;
1226
    function Blt (lpDestRect: PRect;
1234
    function Blt (lpDestRect: PRect;
1227
        lpDDSrcSurface: IDirectDrawSurface2; lpSrcRect: PRect;
1235
        lpDDSrcSurface: IDirectDrawSurface2; lpSrcRect: PRect;
1228
        dwFlags: DWORD; lpDDBltFx: PDDBltFX) : HResult; stdcall;
1236
        dwFlags: DWORD; lpDDBltFx: PDDBltFX) : HResult; stdcall;
1229
    function BltBatch (const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
1237
    function BltBatch (const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
1230
        dwFlags: DWORD) : HResult; stdcall;
1238
        dwFlags: DWORD) : HResult; stdcall;
1231
    function BltFast (dwX: DWORD; dwY: DWORD;
1239
    function BltFast (dwX: DWORD; dwY: DWORD;
1232
        lpDDSrcSurface: IDirectDrawSurface2; lpSrcRect: PRect;
1240
        lpDDSrcSurface: IDirectDrawSurface2; lpSrcRect: PRect;
1233
        dwTrans: DWORD) : HResult; stdcall;
1241
        dwTrans: DWORD) : HResult; stdcall;
1234
    function DeleteAttachedSurface (dwFlags: DWORD;
1242
    function DeleteAttachedSurface (dwFlags: DWORD;
1235
        lpDDSAttachedSurface: IDirectDrawSurface2) : HResult; stdcall;
1243
        lpDDSAttachedSurface: IDirectDrawSurface2) : HResult; stdcall;
1236
    function EnumAttachedSurfaces (lpContext: Pointer;
1244
    function EnumAttachedSurfaces (lpContext: Pointer;
1237
        lpEnumSurfacesCallback: TDDEnumSurfacesCallback) : HResult; stdcall;
1245
        lpEnumSurfacesCallback: TDDEnumSurfacesCallback) : HResult; stdcall;
1238
    function EnumOverlayZOrders (dwFlags: DWORD; lpContext: Pointer;
1246
    function EnumOverlayZOrders (dwFlags: DWORD; lpContext: Pointer;
1239
        lpfnCallback: TDDEnumSurfacesCallback) : HResult; stdcall;
1247
        lpfnCallback: TDDEnumSurfacesCallback) : HResult; stdcall;
1240
    function Flip (lpDDSurfaceTargetOverride: IDirectDrawSurface2;
1248
    function Flip (lpDDSurfaceTargetOverride: IDirectDrawSurface2;
1241
        dwFlags: DWORD) : HResult; stdcall;
1249
        dwFlags: DWORD) : HResult; stdcall;
1242
    function GetAttachedSurface (var lpDDSCaps: TDDSCaps;
1250
    function GetAttachedSurface (var lpDDSCaps: TDDSCaps;
1243
        out lplpDDAttachedSurface: IDirectDrawSurface2) : HResult; stdcall;
1251
        out lplpDDAttachedSurface: IDirectDrawSurface2) : HResult; stdcall;
1244
    function GetBltStatus (dwFlags: DWORD) : HResult; stdcall;
1252
    function GetBltStatus (dwFlags: DWORD) : HResult; stdcall;
1245
    function GetCaps (out lpDDSCaps: TDDSCaps) : HResult; stdcall;
1253
    function GetCaps (out lpDDSCaps: TDDSCaps) : HResult; stdcall;
1246
    function GetClipper (out lplpDDClipper: IDirectDrawClipper) : HResult; stdcall;
1254
    function GetClipper (out lplpDDClipper: IDirectDrawClipper) : HResult; stdcall;
1247
    function GetColorKey (dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
1255
    function GetColorKey (dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
1248
        HResult; stdcall;
1256
        HResult; stdcall;
1249
    function GetDC (out lphDC: HDC) : HResult; stdcall;
1257
    function GetDC (out lphDC: HDC) : HResult; stdcall;
1250
    function GetFlipStatus (dwFlags: DWORD) : HResult; stdcall;
1258
    function GetFlipStatus (dwFlags: DWORD) : HResult; stdcall;
1251
    function GetOverlayPosition (out lplX, lplY: LongInt) : HResult; stdcall;
1259
    function GetOverlayPosition (out lplX, lplY: LongInt) : HResult; stdcall;
1252
    function GetPalette (out lplpDDPalette: IDirectDrawPalette) : HResult; stdcall;
1260
    function GetPalette (out lplpDDPalette: IDirectDrawPalette) : HResult; stdcall;
1253
    function GetPixelFormat (out lpDDPixelFormat: TDDPixelFormat) : HResult; stdcall;
1261
    function GetPixelFormat (out lpDDPixelFormat: TDDPixelFormat) : HResult; stdcall;
1254
    function GetSurfaceDesc (out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
1262
    function GetSurfaceDesc (out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
1255
    function Initialize (lpDD: IDirectDraw;
1263
    function Initialize (lpDD: IDirectDraw;
1256
        out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
1264
        out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
1257
    function IsLost: HResult; stdcall;
1265
    function IsLost: HResult; stdcall;
1258
    function Lock (lpDestRect: PRect;
1266
    function Lock (lpDestRect: PRect;
1259
        out lpDDSurfaceDesc: TDDSurfaceDesc; dwFlags: DWORD;
1267
        out lpDDSurfaceDesc: TDDSurfaceDesc; dwFlags: DWORD;
1260
        hEvent: THandle) : HResult; stdcall;
1268
        hEvent: THandle) : HResult; stdcall;
1261
    function ReleaseDC (hDC: Windows.HDC) : HResult; stdcall;
1269
    function ReleaseDC (hDC: Windows.HDC) : HResult; stdcall;
1262
    function _Restore: HResult; stdcall;
1270
    function _Restore: HResult; stdcall;
1263
    function SetClipper (lpDDClipper: IDirectDrawClipper) : HResult; stdcall;
1271
    function SetClipper (lpDDClipper: IDirectDrawClipper) : HResult; stdcall;
1264
    function SetColorKey (dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
1272
    function SetColorKey (dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
1265
        HResult; stdcall;
1273
        HResult; stdcall;
1266
    function SetOverlayPosition (lX, lY: LongInt) : HResult; stdcall;
1274
    function SetOverlayPosition (lX, lY: LongInt) : HResult; stdcall;
1267
    function SetPalette (lpDDPalette: IDirectDrawPalette) : HResult; stdcall;
1275
    function SetPalette (lpDDPalette: IDirectDrawPalette) : HResult; stdcall;
1268
    function Unlock (lpSurfaceData: Pointer) : HResult; stdcall;
1276
    function Unlock (lpSurfaceData: Pointer) : HResult; stdcall;
1269
    function UpdateOverlay (lpSrcRect: PRect;
1277
    function UpdateOverlay (lpSrcRect: PRect;
1270
        lpDDDestSurface: IDirectDrawSurface2; lpDestRect: PRect;
1278
        lpDDDestSurface: IDirectDrawSurface2; lpDestRect: PRect;
1271
        dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX) : HResult; stdcall;
1279
        dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX) : HResult; stdcall;
1272
    function UpdateOverlayDisplay (dwFlags: DWORD) : HResult; stdcall;
1280
    function UpdateOverlayDisplay (dwFlags: DWORD) : HResult; stdcall;
1273
    function UpdateOverlayZOrder (dwFlags: DWORD;
1281
    function UpdateOverlayZOrder (dwFlags: DWORD;
1274
        lpDDSReference: IDirectDrawSurface2) : HResult; stdcall;
1282
        lpDDSReference: IDirectDrawSurface2) : HResult; stdcall;
1275
    (*** Added in the v2 interface ***)
1283
    (*** Added in the v2 interface ***)
1276
    function GetDDInterface (var lplpDD: IDirectDraw) : HResult; stdcall;
1284
    function GetDDInterface (var lplpDD: IDirectDraw) : HResult; stdcall;
1277
    function PageLock (dwFlags: DWORD) : HResult; stdcall;
1285
    function PageLock (dwFlags: DWORD) : HResult; stdcall;
1278
    function PageUnlock (dwFlags: DWORD) : HResult; stdcall;
1286
    function PageUnlock (dwFlags: DWORD) : HResult; stdcall;
1279
  end;
1287
  end;
1280
 
1288
 
1281
  IDirectDrawSurface3 = interface (IUnknown)
1289
  IDirectDrawSurface3 = interface (IUnknown)
1282
    ['{DA044E00-69B2-11D0-A1D5-00AA00B8DFBB}']
1290
    ['{DA044E00-69B2-11D0-A1D5-00AA00B8DFBB}']
1283
    (*** IDirectDrawSurface methods ***)
1291
    (*** IDirectDrawSurface methods ***)
1284
    function AddAttachedSurface (lpDDSAttachedSurface: IDirectDrawSurface3) :
1292
    function AddAttachedSurface (lpDDSAttachedSurface: IDirectDrawSurface3) :
1285
        HResult; stdcall;
1293
        HResult; stdcall;
1286
    function AddOverlayDirtyRect (const lpRect: TRect) : HResult; stdcall;
1294
    function AddOverlayDirtyRect (const lpRect: TRect) : HResult; stdcall;
1287
    function Blt (lpDestRect: PRect;
1295
    function Blt (lpDestRect: PRect;
1288
        lpDDSrcSurface: IDirectDrawSurface3; lpSrcRect: PRect;
1296
        lpDDSrcSurface: IDirectDrawSurface3; lpSrcRect: PRect;
1289
        dwFlags: DWORD; lpDDBltFx: PDDBltFX) : HResult; stdcall;
1297
        dwFlags: DWORD; lpDDBltFx: PDDBltFX) : HResult; stdcall;
1290
    function BltBatch (const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
1298
    function BltBatch (const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
1291
        dwFlags: DWORD) : HResult; stdcall;
1299
        dwFlags: DWORD) : HResult; stdcall;
1292
    function BltFast (dwX: DWORD; dwY: DWORD;
1300
    function BltFast (dwX: DWORD; dwY: DWORD;
1293
        lpDDSrcSurface: IDirectDrawSurface3; lpSrcRect: PRect;
1301
        lpDDSrcSurface: IDirectDrawSurface3; lpSrcRect: PRect;
1294
        dwTrans: DWORD) : HResult; stdcall;
1302
        dwTrans: DWORD) : HResult; stdcall;
1295
    function DeleteAttachedSurface (dwFlags: DWORD;
1303
    function DeleteAttachedSurface (dwFlags: DWORD;
1296
        lpDDSAttachedSurface: IDirectDrawSurface3) : HResult; stdcall;
1304
        lpDDSAttachedSurface: IDirectDrawSurface3) : HResult; stdcall;
1297
    function EnumAttachedSurfaces (lpContext: Pointer;
1305
    function EnumAttachedSurfaces (lpContext: Pointer;
1298
        lpEnumSurfacesCallback: TDDEnumSurfacesCallback) : HResult; stdcall;
1306
        lpEnumSurfacesCallback: TDDEnumSurfacesCallback) : HResult; stdcall;
1299
    function EnumOverlayZOrders (dwFlags: DWORD; lpContext: Pointer;
1307
    function EnumOverlayZOrders (dwFlags: DWORD; lpContext: Pointer;
1300
        lpfnCallback: TDDEnumSurfacesCallback) : HResult; stdcall;
1308
        lpfnCallback: TDDEnumSurfacesCallback) : HResult; stdcall;
1301
    function Flip (lpDDSurfaceTargetOverride: IDirectDrawSurface3;
1309
    function Flip (lpDDSurfaceTargetOverride: IDirectDrawSurface3;
1302
        dwFlags: DWORD) : HResult; stdcall;
1310
        dwFlags: DWORD) : HResult; stdcall;
1303
    function GetAttachedSurface (var lpDDSCaps: TDDSCaps;
1311
    function GetAttachedSurface (var lpDDSCaps: TDDSCaps;
1304
        out lplpDDAttachedSurface: IDirectDrawSurface3) : HResult; stdcall;
1312
        out lplpDDAttachedSurface: IDirectDrawSurface3) : HResult; stdcall;
1305
    function GetBltStatus (dwFlags: DWORD) : HResult; stdcall;
1313
    function GetBltStatus (dwFlags: DWORD) : HResult; stdcall;
1306
    function GetCaps (out lpDDSCaps: TDDSCaps) : HResult; stdcall;
1314
    function GetCaps (out lpDDSCaps: TDDSCaps) : HResult; stdcall;
1307
    function GetClipper (out lplpDDClipper: IDirectDrawClipper) : HResult; stdcall;
1315
    function GetClipper (out lplpDDClipper: IDirectDrawClipper) : HResult; stdcall;
1308
    function GetColorKey (dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
1316
    function GetColorKey (dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
1309
        HResult; stdcall;
1317
        HResult; stdcall;
1310
    function GetDC (out lphDC: HDC) : HResult; stdcall;
1318
    function GetDC (out lphDC: HDC) : HResult; stdcall;
1311
    function GetFlipStatus (dwFlags: DWORD) : HResult; stdcall;
1319
    function GetFlipStatus (dwFlags: DWORD) : HResult; stdcall;
1312
    function GetOverlayPosition (out lplX, lplY: LongInt) : HResult; stdcall;
1320
    function GetOverlayPosition (out lplX, lplY: LongInt) : HResult; stdcall;
1313
    function GetPalette (out lplpDDPalette: IDirectDrawPalette) : HResult; stdcall;
1321
    function GetPalette (out lplpDDPalette: IDirectDrawPalette) : HResult; stdcall;
1314
    function GetPixelFormat (out lpDDPixelFormat: TDDPixelFormat) : HResult; stdcall;
1322
    function GetPixelFormat (out lpDDPixelFormat: TDDPixelFormat) : HResult; stdcall;
1315
    function GetSurfaceDesc (out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
1323
    function GetSurfaceDesc (out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
1316
    function Initialize (lpDD: IDirectDraw;
1324
    function Initialize (lpDD: IDirectDraw;
1317
        out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
1325
        out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
1318
    function IsLost: HResult; stdcall;
1326
    function IsLost: HResult; stdcall;
1319
    function Lock (lpDestRect: PRect;
1327
    function Lock (lpDestRect: PRect;
1320
        out lpDDSurfaceDesc: TDDSurfaceDesc; dwFlags: DWORD;
1328
        out lpDDSurfaceDesc: TDDSurfaceDesc; dwFlags: DWORD;
1321
        hEvent: THandle) : HResult; stdcall;
1329
        hEvent: THandle) : HResult; stdcall;
1322
    function ReleaseDC (hDC: Windows.HDC) : HResult; stdcall;
1330
    function ReleaseDC (hDC: Windows.HDC) : HResult; stdcall;
1323
    function _Restore: HResult; stdcall;
1331
    function _Restore: HResult; stdcall;
1324
    function SetClipper (lpDDClipper: IDirectDrawClipper) : HResult; stdcall;
1332
    function SetClipper (lpDDClipper: IDirectDrawClipper) : HResult; stdcall;
1325
    function SetColorKey (dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
1333
    function SetColorKey (dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
1326
        HResult; stdcall;
1334
        HResult; stdcall;
1327
    function SetOverlayPosition (lX, lY: LongInt) : HResult; stdcall;
1335
    function SetOverlayPosition (lX, lY: LongInt) : HResult; stdcall;
1328
    function SetPalette (lpDDPalette: IDirectDrawPalette) : HResult; stdcall;
1336
    function SetPalette (lpDDPalette: IDirectDrawPalette) : HResult; stdcall;
1329
    function Unlock (lpSurfaceData: Pointer) : HResult; stdcall;
1337
    function Unlock (lpSurfaceData: Pointer) : HResult; stdcall;
1330
    function UpdateOverlay (lpSrcRect: PRect;
1338
    function UpdateOverlay (lpSrcRect: PRect;
1331
        lpDDDestSurface: IDirectDrawSurface3; lpDestRect: PRect;
1339
        lpDDDestSurface: IDirectDrawSurface3; lpDestRect: PRect;
1332
        dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX) : HResult; stdcall;
1340
        dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX) : HResult; stdcall;
1333
    function UpdateOverlayDisplay (dwFlags: DWORD) : HResult; stdcall;
1341
    function UpdateOverlayDisplay (dwFlags: DWORD) : HResult; stdcall;
1334
    function UpdateOverlayZOrder (dwFlags: DWORD;
1342
    function UpdateOverlayZOrder (dwFlags: DWORD;
1335
        lpDDSReference: IDirectDrawSurface3) : HResult; stdcall;
1343
        lpDDSReference: IDirectDrawSurface3) : HResult; stdcall;
1336
    (*** Added in the v2 interface ***)
1344
    (*** Added in the v2 interface ***)
1337
    function GetDDInterface (out lplpDD: IDirectDraw) : HResult; stdcall;
1345
    function GetDDInterface (out lplpDD: IDirectDraw) : HResult; stdcall;
1338
    function PageLock (dwFlags: DWORD) : HResult; stdcall;
1346
    function PageLock (dwFlags: DWORD) : HResult; stdcall;
1339
    function PageUnlock (dwFlags: DWORD) : HResult; stdcall;
1347
    function PageUnlock (dwFlags: DWORD) : HResult; stdcall;
1340
    (*** Added in the V3 interface ***)
1348
    (*** Added in the V3 interface ***)
1341
    function SetSurfaceDesc(const lpddsd: TDDSurfaceDesc; dwFlags: DWORD) : HResult; stdcall;
1349
    function SetSurfaceDesc(const lpddsd: TDDSurfaceDesc; dwFlags: DWORD) : HResult; stdcall;
1342
  end;
1350
  end;
1343
 
1351
 
1344
(*
1352
(*
1345
 * IDirectDrawSurface4 and related interfaces
1353
 * IDirectDrawSurface4 and related interfaces
1346
 *)
1354
 *)
1347
  IDirectDrawSurface4 = interface (IUnknown)
1355
  IDirectDrawSurface4 = interface (IUnknown)
1348
    ['{0B2B8630-AD35-11D0-8EA6-00609797EA5B}']
1356
    ['{0B2B8630-AD35-11D0-8EA6-00609797EA5B}']
1349
    (*** IDirectDrawSurface methods ***)
1357
    (*** IDirectDrawSurface methods ***)
1350
    function AddAttachedSurface (lpDDSAttachedSurface: IDirectDrawSurface4) :
1358
    function AddAttachedSurface (lpDDSAttachedSurface: IDirectDrawSurface4) :
1351
        HResult; stdcall;
1359
        HResult; stdcall;
1352
    function AddOverlayDirtyRect (const lpRect: TRect) : HResult; stdcall;
1360
    function AddOverlayDirtyRect (const lpRect: TRect) : HResult; stdcall;
1353
    function Blt (lpDestRect: PRect;
1361
    function Blt (lpDestRect: PRect;
1354
        lpDDSrcSurface: IDirectDrawSurface4; lpSrcRect: PRect;
1362
        lpDDSrcSurface: IDirectDrawSurface4; lpSrcRect: PRect;
1355
        dwFlags: DWORD; lpDDBltFx: PDDBltFX) : HResult; stdcall;
1363
        dwFlags: DWORD; lpDDBltFx: PDDBltFX) : HResult; stdcall;
1356
    function BltBatch (const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
1364
    function BltBatch (const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
1357
        dwFlags: DWORD) : HResult; stdcall;
1365
        dwFlags: DWORD) : HResult; stdcall;
1358
    function BltFast (dwX: DWORD; dwY: DWORD;
1366
    function BltFast (dwX: DWORD; dwY: DWORD;
1359
        lpDDSrcSurface: IDirectDrawSurface4; lpSrcRect: PRect;
1367
        lpDDSrcSurface: IDirectDrawSurface4; lpSrcRect: PRect;
1360
        dwTrans: DWORD) : HResult; stdcall;
1368
        dwTrans: DWORD) : HResult; stdcall;
1361
    function DeleteAttachedSurface (dwFlags: DWORD;
1369
    function DeleteAttachedSurface (dwFlags: DWORD;
1362
        lpDDSAttachedSurface: IDirectDrawSurface4) : HResult; stdcall;
1370
        lpDDSAttachedSurface: IDirectDrawSurface4) : HResult; stdcall;
1363
    function EnumAttachedSurfaces (lpContext: Pointer;
1371
    function EnumAttachedSurfaces (lpContext: Pointer;
1364
        lpEnumSurfacesCallback: TDDEnumSurfacesCallback2) : HResult; stdcall;
1372
        lpEnumSurfacesCallback: TDDEnumSurfacesCallback2) : HResult; stdcall;
1365
    function EnumOverlayZOrders (dwFlags: DWORD; lpContext: Pointer;
1373
    function EnumOverlayZOrders (dwFlags: DWORD; lpContext: Pointer;
1366
        lpfnCallback: TDDEnumSurfacesCallback2) : HResult; stdcall;
1374
        lpfnCallback: TDDEnumSurfacesCallback2) : HResult; stdcall;
1367
    function Flip (lpDDSurfaceTargetOverride: IDirectDrawSurface4;
1375
    function Flip (lpDDSurfaceTargetOverride: IDirectDrawSurface4;
1368
        dwFlags: DWORD) : HResult; stdcall;
1376
        dwFlags: DWORD) : HResult; stdcall;
1369
    function GetAttachedSurface (const lpDDSCaps: TDDSCaps2;
1377
    function GetAttachedSurface (const lpDDSCaps: TDDSCaps2;
1370
        out lplpDDAttachedSurface: IDirectDrawSurface4) : HResult; stdcall;
1378
        out lplpDDAttachedSurface: IDirectDrawSurface4) : HResult; stdcall;
1371
    function GetBltStatus (dwFlags: DWORD) : HResult; stdcall;
1379
    function GetBltStatus (dwFlags: DWORD) : HResult; stdcall;
1372
    function GetCaps (out lpDDSCaps: TDDSCaps2) : HResult; stdcall;
1380
    function GetCaps (out lpDDSCaps: TDDSCaps2) : HResult; stdcall;
1373
    function GetClipper (out lplpDDClipper: IDirectDrawClipper) : HResult; stdcall;
1381
    function GetClipper (out lplpDDClipper: IDirectDrawClipper) : HResult; stdcall;
1374
    function GetColorKey (dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
1382
    function GetColorKey (dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
1375
        HResult; stdcall;
1383
        HResult; stdcall;
1376
    function GetDC (out lphDC: HDC) : HResult; stdcall;
1384
    function GetDC (out lphDC: HDC) : HResult; stdcall;
1377
    function GetFlipStatus (dwFlags: DWORD) : HResult; stdcall;
1385
    function GetFlipStatus (dwFlags: DWORD) : HResult; stdcall;
1378
    function GetOverlayPosition (out lplX, lplY: LongInt) : HResult; stdcall;
1386
    function GetOverlayPosition (out lplX, lplY: LongInt) : HResult; stdcall;
1379
    function GetPalette (out lplpDDPalette: IDirectDrawPalette) : HResult; stdcall;
1387
    function GetPalette (out lplpDDPalette: IDirectDrawPalette) : HResult; stdcall;
1380
    function GetPixelFormat (out lpDDPixelFormat: TDDPixelFormat) : HResult; stdcall;
1388
    function GetPixelFormat (out lpDDPixelFormat: TDDPixelFormat) : HResult; stdcall;
1381
    function GetSurfaceDesc (out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
1389
    function GetSurfaceDesc (out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
1382
    function Initialize (lpDD: IDirectDraw;
1390
    function Initialize (lpDD: IDirectDraw;
1383
        out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
1391
        out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
1384
    function IsLost: HResult; stdcall;
1392
    function IsLost: HResult; stdcall;
1385
    function Lock (lpDestRect: PRect;
1393
    function Lock (lpDestRect: PRect;
1386
        out lpDDSurfaceDesc: TDDSurfaceDesc2; dwFlags: DWORD;
1394
        out lpDDSurfaceDesc: TDDSurfaceDesc2; dwFlags: DWORD;
1387
        hEvent: THandle) : HResult; stdcall;
1395
        hEvent: THandle) : HResult; stdcall;
1388
    function ReleaseDC (hDC: Windows.HDC) : HResult; stdcall;
1396
    function ReleaseDC (hDC: Windows.HDC) : HResult; stdcall;
1389
    function _Restore: HResult; stdcall;
1397
    function _Restore: HResult; stdcall;
1390
    function SetClipper (lpDDClipper: IDirectDrawClipper) : HResult; stdcall;
1398
    function SetClipper (lpDDClipper: IDirectDrawClipper) : HResult; stdcall;
1391
    function SetColorKey (dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
1399
    function SetColorKey (dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
1392
        HResult; stdcall;
1400
        HResult; stdcall;
1393
    function SetOverlayPosition (lX, lY: LongInt) : HResult; stdcall;
1401
    function SetOverlayPosition (lX, lY: LongInt) : HResult; stdcall;
1394
    function SetPalette (lpDDPalette: IDirectDrawPalette) : HResult; stdcall;
1402
    function SetPalette (lpDDPalette: IDirectDrawPalette) : HResult; stdcall;
1395
    function Unlock (lpRect: PRect) : HResult; stdcall;
1403
    function Unlock (lpRect: PRect) : HResult; stdcall;
1396
    function UpdateOverlay (lpSrcRect: PRect;
1404
    function UpdateOverlay (lpSrcRect: PRect;
1397
        lpDDDestSurface: IDirectDrawSurface4; lpDestRect: PRect;
1405
        lpDDDestSurface: IDirectDrawSurface4; lpDestRect: PRect;
1398
        dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX) : HResult; stdcall;
1406
        dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX) : HResult; stdcall;
1399
    function UpdateOverlayDisplay (dwFlags: DWORD) : HResult; stdcall;
1407
    function UpdateOverlayDisplay (dwFlags: DWORD) : HResult; stdcall;
1400
    function UpdateOverlayZOrder (dwFlags: DWORD;
1408
    function UpdateOverlayZOrder (dwFlags: DWORD;
1401
        lpDDSReference: IDirectDrawSurface4) : HResult; stdcall;
1409
        lpDDSReference: IDirectDrawSurface4) : HResult; stdcall;
1402
    (*** Added in the v2 interface ***)
1410
    (*** Added in the v2 interface ***)
1403
    function GetDDInterface (out lplpDD: IUnknown) : HResult; stdcall;
1411
    function GetDDInterface (out lplpDD: IUnknown) : HResult; stdcall;
1404
    function PageLock (dwFlags: DWORD) : HResult; stdcall;
1412
    function PageLock (dwFlags: DWORD) : HResult; stdcall;
1405
    function PageUnlock (dwFlags: DWORD) : HResult; stdcall;
1413
    function PageUnlock (dwFlags: DWORD) : HResult; stdcall;
1406
    (*** Added in the V3 interface ***)
1414
    (*** Added in the V3 interface ***)
1407
    function SetSurfaceDesc(const lpddsd2: TDDSurfaceDesc2; dwFlags: DWORD) : HResult; stdcall;
1415
    function SetSurfaceDesc(const lpddsd2: TDDSurfaceDesc2; dwFlags: DWORD) : HResult; stdcall;
1408
    (*** Added in the v4 interface ***)
1416
    (*** Added in the v4 interface ***)
1409
    function SetPrivateData(const guidTag: TGUID; lpData: pointer;
1417
    function SetPrivateData(const guidTag: TGUID; lpData: pointer;
1410
        cbSize: DWORD; dwFlags: DWORD) : HResult; stdcall;
1418
        cbSize: DWORD; dwFlags: DWORD) : HResult; stdcall;
1411
    function GetPrivateData(const guidTag: TGUID; lpBuffer: pointer;
1419
    function GetPrivateData(const guidTag: TGUID; lpBuffer: pointer;
1412
        var lpcbBufferSize: DWORD) : HResult; stdcall;
1420
        var lpcbBufferSize: DWORD) : HResult; stdcall;
1413
    function FreePrivateData(const guidTag: TGUID) : HResult; stdcall;
1421
    function FreePrivateData(const guidTag: TGUID) : HResult; stdcall;
1414
    function GetUniquenessValue(out lpValue: DWORD) : HResult; stdcall;
1422
    function GetUniquenessValue(out lpValue: DWORD) : HResult; stdcall;
1415
    function ChangeUniquenessValue : HResult; stdcall;
1423
    function ChangeUniquenessValue : HResult; stdcall;
1416
  end;
1424
  end;
1417
 
1425
 
1418
  IDirectDrawSurface7 = interface (IUnknown)
1426
  IDirectDrawSurface7 = interface (IUnknown)
1419
    ['{06675a80-3b9b-11d2-b92f-00609797ea5b}']
1427
    ['{06675a80-3b9b-11d2-b92f-00609797ea5b}']
1420
    (*** IDirectDrawSurface methods ***)
1428
    (*** IDirectDrawSurface methods ***)
1421
    function AddAttachedSurface (lpDDSAttachedSurface: IDirectDrawSurface7) :
1429
    function AddAttachedSurface (lpDDSAttachedSurface: IDirectDrawSurface7) :
1422
        HResult; stdcall;
1430
        HResult; stdcall;
1423
    function AddOverlayDirtyRect (const lpRect: TRect) : HResult; stdcall;
1431
    function AddOverlayDirtyRect (const lpRect: TRect) : HResult; stdcall;
1424
    function Blt (lpDestRect: PRect;
1432
    function Blt (lpDestRect: PRect;
1425
        lpDDSrcSurface: IDirectDrawSurface7; lpSrcRect: PRect;
1433
        lpDDSrcSurface: IDirectDrawSurface7; lpSrcRect: PRect;
1426
        dwFlags: DWORD; lpDDBltFx: PDDBltFX) : HResult; stdcall;
1434
        dwFlags: DWORD; lpDDBltFx: PDDBltFX) : HResult; stdcall;
1427
    function BltBatch (const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
1435
    function BltBatch (const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
1428
        dwFlags: DWORD) : HResult; stdcall;
1436
        dwFlags: DWORD) : HResult; stdcall;
1429
    function BltFast (dwX: DWORD; dwY: DWORD;
1437
    function BltFast (dwX: DWORD; dwY: DWORD;
1430
        lpDDSrcSurface: IDirectDrawSurface7; lpSrcRect: PRect;
1438
        lpDDSrcSurface: IDirectDrawSurface7; lpSrcRect: PRect;
1431
        dwTrans: DWORD) : HResult; stdcall;
1439
        dwTrans: DWORD) : HResult; stdcall;
1432
    function DeleteAttachedSurface (dwFlags: DWORD;
1440
    function DeleteAttachedSurface (dwFlags: DWORD;
1433
        lpDDSAttachedSurface: IDirectDrawSurface7) : HResult; stdcall;
1441
        lpDDSAttachedSurface: IDirectDrawSurface7) : HResult; stdcall;
1434
    function EnumAttachedSurfaces (lpContext: Pointer;
1442
    function EnumAttachedSurfaces (lpContext: Pointer;
1435
        lpEnumSurfacesCallback: TDDEnumSurfacesCallback7) : HResult; stdcall;
1443
        lpEnumSurfacesCallback: TDDEnumSurfacesCallback7) : HResult; stdcall;
1436
    function EnumOverlayZOrders (dwFlags: DWORD; lpContext: Pointer;
1444
    function EnumOverlayZOrders (dwFlags: DWORD; lpContext: Pointer;
1437
        lpfnCallback: TDDEnumSurfacesCallback7) : HResult; stdcall;
1445
        lpfnCallback: TDDEnumSurfacesCallback7) : HResult; stdcall;
1438
    function Flip (lpDDSurfaceTargetOverride: IDirectDrawSurface7;
1446
    function Flip (lpDDSurfaceTargetOverride: IDirectDrawSurface7;
1439
        dwFlags: DWORD) : HResult; stdcall;
1447
        dwFlags: DWORD) : HResult; stdcall;
1440
    function GetAttachedSurface (const lpDDSCaps: TDDSCaps2;
1448
    function GetAttachedSurface (const lpDDSCaps: TDDSCaps2;
1441
        out lplpDDAttachedSurface: IDirectDrawSurface7) : HResult; stdcall;
1449
        out lplpDDAttachedSurface: IDirectDrawSurface7) : HResult; stdcall;
1442
    function GetBltStatus (dwFlags: DWORD) : HResult; stdcall;
1450
    function GetBltStatus (dwFlags: DWORD) : HResult; stdcall;
1443
    function GetCaps (out lpDDSCaps: TDDSCaps2) : HResult; stdcall;
1451
    function GetCaps (out lpDDSCaps: TDDSCaps2) : HResult; stdcall;
1444
    function GetClipper (out lplpDDClipper: IDirectDrawClipper) : HResult; stdcall;
1452
    function GetClipper (out lplpDDClipper: IDirectDrawClipper) : HResult; stdcall;
1445
    function GetColorKey (dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
1453
    function GetColorKey (dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
1446
        HResult; stdcall;
1454
        HResult; stdcall;
1447
    function GetDC (out lphDC: HDC) : HResult; stdcall;
1455
    function GetDC (out lphDC: HDC) : HResult; stdcall;
1448
    function GetFlipStatus (dwFlags: DWORD) : HResult; stdcall;
1456
    function GetFlipStatus (dwFlags: DWORD) : HResult; stdcall;
1449
    function GetOverlayPosition (out lplX, lplY: LongInt) : HResult; stdcall;
1457
    function GetOverlayPosition (out lplX, lplY: LongInt) : HResult; stdcall;
1450
    function GetPalette (out lplpDDPalette: IDirectDrawPalette) : HResult; stdcall;
1458
    function GetPalette (out lplpDDPalette: IDirectDrawPalette) : HResult; stdcall;
1451
    function GetPixelFormat (out lpDDPixelFormat: TDDPixelFormat) : HResult; stdcall;
1459
    function GetPixelFormat (out lpDDPixelFormat: TDDPixelFormat) : HResult; stdcall;
1452
    function GetSurfaceDesc (out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
1460
    function GetSurfaceDesc (out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
1453
    function Initialize (lpDD: IDirectDraw;
1461
    function Initialize (lpDD: IDirectDraw;
1454
        out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
1462
        out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
1455
    function IsLost: HResult; stdcall;
1463
    function IsLost: HResult; stdcall;
1456
    function Lock (lpDestRect: PRect;
1464
    function Lock (lpDestRect: PRect;
1457
        out lpDDSurfaceDesc: TDDSurfaceDesc2; dwFlags: DWORD;
1465
        out lpDDSurfaceDesc: TDDSurfaceDesc2; dwFlags: DWORD;
1458
        hEvent: THandle) : HResult; stdcall;
1466
        hEvent: THandle) : HResult; stdcall;
1459
    function ReleaseDC (hDC: Windows.HDC) : HResult; stdcall;
1467
    function ReleaseDC (hDC: Windows.HDC) : HResult; stdcall;
1460
    function _Restore: HResult; stdcall;
1468
    function _Restore: HResult; stdcall;
1461
    function SetClipper (lpDDClipper: IDirectDrawClipper) : HResult; stdcall;
1469
    function SetClipper (lpDDClipper: IDirectDrawClipper) : HResult; stdcall;
1462
    function SetColorKey (dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
1470
    function SetColorKey (dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
1463
        HResult; stdcall;
1471
        HResult; stdcall;
1464
    function SetOverlayPosition (lX, lY: LongInt) : HResult; stdcall;
1472
    function SetOverlayPosition (lX, lY: LongInt) : HResult; stdcall;
1465
    function SetPalette (lpDDPalette: IDirectDrawPalette) : HResult; stdcall;
1473
    function SetPalette (lpDDPalette: IDirectDrawPalette) : HResult; stdcall;
1466
    function Unlock (lpRect: PRect) : HResult; stdcall;
1474
    function Unlock (lpRect: PRect) : HResult; stdcall;
1467
    function UpdateOverlay (lpSrcRect: PRect;
1475
    function UpdateOverlay (lpSrcRect: PRect;
1468
        lpDDDestSurface: IDirectDrawSurface7; lpDestRect: PRect;
1476
        lpDDDestSurface: IDirectDrawSurface7; lpDestRect: PRect;
1469
        dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX) : HResult; stdcall;
1477
        dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX) : HResult; stdcall;
1470
    function UpdateOverlayDisplay (dwFlags: DWORD) : HResult; stdcall;
1478
    function UpdateOverlayDisplay (dwFlags: DWORD) : HResult; stdcall;
1471
    function UpdateOverlayZOrder (dwFlags: DWORD;
1479
    function UpdateOverlayZOrder (dwFlags: DWORD;
1472
        lpDDSReference: IDirectDrawSurface7) : HResult; stdcall;
1480
        lpDDSReference: IDirectDrawSurface7) : HResult; stdcall;
1473
    (*** Added in the v2 interface ***)
1481
    (*** Added in the v2 interface ***)
1474
    function GetDDInterface (out lplpDD: IUnknown) : HResult; stdcall;
1482
    function GetDDInterface (out lplpDD: IUnknown) : HResult; stdcall;
1475
    function PageLock (dwFlags: DWORD) : HResult; stdcall;
1483
    function PageLock (dwFlags: DWORD) : HResult; stdcall;
1476
    function PageUnlock (dwFlags: DWORD) : HResult; stdcall;
1484
    function PageUnlock (dwFlags: DWORD) : HResult; stdcall;
1477
    (*** Added in the V3 interface ***)
1485
    (*** Added in the V3 interface ***)
1478
    function SetSurfaceDesc(const lpddsd2: TDDSurfaceDesc2; dwFlags: DWORD) : HResult; stdcall;
1486
    function SetSurfaceDesc(const lpddsd2: TDDSurfaceDesc2; dwFlags: DWORD) : HResult; stdcall;
1479
    (*** Added in the v4 interface ***)
1487
    (*** Added in the v4 interface ***)
1480
    function SetPrivateData(const guidTag: TGUID; lpData: pointer;
1488
    function SetPrivateData(const guidTag: TGUID; lpData: pointer;
1481
        cbSize: DWORD; dwFlags: DWORD) : HResult; stdcall;
1489
        cbSize: DWORD; dwFlags: DWORD) : HResult; stdcall;
1482
    function GetPrivateData(const guidTag: TGUID; lpBuffer: pointer;
1490
    function GetPrivateData(const guidTag: TGUID; lpBuffer: pointer;
1483
        var lpcbBufferSize: DWORD) : HResult; stdcall;
1491
        var lpcbBufferSize: DWORD) : HResult; stdcall;
1484
    function FreePrivateData(const guidTag: TGUID) : HResult; stdcall;
1492
    function FreePrivateData(const guidTag: TGUID) : HResult; stdcall;
1485
    function GetUniquenessValue(out lpValue: DWORD) : HResult; stdcall;
1493
    function GetUniquenessValue(out lpValue: DWORD) : HResult; stdcall;
1486
    function ChangeUniquenessValue : HResult; stdcall;
1494
    function ChangeUniquenessValue : HResult; stdcall;
1487
    (*** Moved Texture7 methods here ***)
1495
    (*** Moved Texture7 methods here ***)
1488
    function SetPriority(dwPriority: DWORD) : HResult; stdcall;
1496
    function SetPriority(dwPriority: DWORD) : HResult; stdcall;
1489
    function GetPriority(out lpdwPriority: DWORD) : HResult; stdcall;
1497
    function GetPriority(out lpdwPriority: DWORD) : HResult; stdcall;
1490
    function SetLOD(dwMaxLOD: DWORD) : HResult; stdcall;
1498
    function SetLOD(dwMaxLOD: DWORD) : HResult; stdcall;
1491
    function GetLOD(out lpdwMaxLOD: DWORD) : HResult; stdcall;
1499
    function GetLOD(out lpdwMaxLOD: DWORD) : HResult; stdcall;
1492
  end;
1500
  end;
1493
 
1501
 
1494
  IDirectDrawColorControl = interface (IUnknown)
1502
  IDirectDrawColorControl = interface (IUnknown)
1495
    ['{4B9F0EE0-0D7E-11D0-9B06-00A0C903A3B8}']
1503
    ['{4B9F0EE0-0D7E-11D0-9B06-00A0C903A3B8}']
1496
    function GetColorControls(out lpColorControl: TDDColorControl) : HResult; stdcall;
1504
    function GetColorControls(out lpColorControl: TDDColorControl) : HResult; stdcall;
1497
    function SetColorControls(const lpColorControl: TDDColorControl) : HResult; stdcall;
1505
    function SetColorControls(const lpColorControl: TDDColorControl) : HResult; stdcall;
1498
  end;
1506
  end;
1499
 
1507
 
1500
(*
1508
(*
1501
 * IDirectDrawGammaControl
1509
 * IDirectDrawGammaControl
1502
 *)
1510
 *)
1503
  IDirectDrawGammaControl = interface (IUnknown)
1511
  IDirectDrawGammaControl = interface (IUnknown)
1504
    ['{69C11C3E-B46B-11D1-AD7A-00C04FC29B4E}']
1512
    ['{69C11C3E-B46B-11D1-AD7A-00C04FC29B4E}']
1505
    function GetGammaRamp (dwFlags: DWORD; out lpRampData: TDDGammaRamp)
1513
    function GetGammaRamp (dwFlags: DWORD; out lpRampData: TDDGammaRamp)
1506
        : HResult; stdcall;
1514
        : HResult; stdcall;
1507
    function SetGammaRamp (dwFlags: DWORD; const lpRampData: TDDGammaRamp)
1515
    function SetGammaRamp (dwFlags: DWORD; const lpRampData: TDDGammaRamp)
1508
        : HResult; stdcall;
1516
        : HResult; stdcall;
1509
  end;
1517
  end;
1510
 
1518
 
1511
type
1519
type
1512
  IID_IDirectDraw = IDirectDraw;
1520
  IID_IDirectDraw = IDirectDraw;
1513
  IID_IDirectDraw2 = IDirectDraw2;
1521
  IID_IDirectDraw2 = IDirectDraw2;
1514
  IID_IDirectDraw4 = IDirectDraw4;
1522
  IID_IDirectDraw4 = IDirectDraw4;
1515
  IID_IDirectDraw7 = IDirectDraw7;
1523
  IID_IDirectDraw7 = IDirectDraw7;
1516
  IID_IDirectDrawSurface = IDirectDrawSurface;
1524
  IID_IDirectDrawSurface = IDirectDrawSurface;
1517
  IID_IDirectDrawSurface2 = IDirectDrawSurface2;
1525
  IID_IDirectDrawSurface2 = IDirectDrawSurface2;
1518
  IID_IDirectDrawSurface3 = IDirectDrawSurface3;
1526
  IID_IDirectDrawSurface3 = IDirectDrawSurface3;
1519
  IID_IDirectDrawSurface4 = IDirectDrawSurface4;
1527
  IID_IDirectDrawSurface4 = IDirectDrawSurface4;
1520
  IID_IDirectDrawSurface7 = IDirectDrawSurface7;
1528
  IID_IDirectDrawSurface7 = IDirectDrawSurface7;
1521
 
1529
 
1522
  IID_IDirectDrawPalette = IDirectDrawPalette;
1530
  IID_IDirectDrawPalette = IDirectDrawPalette;
1523
  IID_IDirectDrawClipper = IDirectDrawClipper;
1531
  IID_IDirectDrawClipper = IDirectDrawClipper;
1524
  IID_IDirectDrawColorControl = IDirectDrawColorControl;
1532
  IID_IDirectDrawColorControl = IDirectDrawColorControl;
1525
  IID_IDirectDrawGammaControl = IDirectDrawGammaControl;
1533
  IID_IDirectDrawGammaControl = IDirectDrawGammaControl;
1526
 
1534
 
1527
const  
1535
const  
1528
(*
1536
(*
1529
 * ddsCaps field is valid.
1537
 * ddsCaps field is valid.
1530
 *)
1538
 *)
1531
  DDSD_CAPS               = $00000001;     // default
1539
  DDSD_CAPS               = $00000001;     // default
1532
 
1540
 
1533
(*
1541
(*
1534
 * dwHeight field is valid.
1542
 * dwHeight field is valid.
1535
 *)
1543
 *)
1536
  DDSD_HEIGHT             = $00000002;
1544
  DDSD_HEIGHT             = $00000002;
1537
 
1545
 
1538
(*
1546
(*
1539
 * dwWidth field is valid.
1547
 * dwWidth field is valid.
1540
 *)
1548
 *)
1541
  DDSD_WIDTH              = $00000004;
1549
  DDSD_WIDTH              = $00000004;
1542
 
1550
 
1543
(*
1551
(*
1544
 * lPitch is valid.
1552
 * lPitch is valid.
1545
 *)
1553
 *)
1546
  DDSD_PITCH              = $00000008;
1554
  DDSD_PITCH              = $00000008;
1547
 
1555
 
1548
(*
1556
(*
1549
 * dwBackBufferCount is valid.
1557
 * dwBackBufferCount is valid.
1550
 *)
1558
 *)
1551
  DDSD_BACKBUFFERCOUNT    = $00000020;
1559
  DDSD_BACKBUFFERCOUNT    = $00000020;
1552
 
1560
 
1553
(*
1561
(*
1554
 * dwZBufferBitDepth is valid.  (shouldnt be used in DDSURFACEDESC2)
1562
 * dwZBufferBitDepth is valid.  (shouldnt be used in DDSURFACEDESC2)
1555
 *)
1563
 *)
1556
  DDSD_ZBUFFERBITDEPTH    = $00000040;
1564
  DDSD_ZBUFFERBITDEPTH    = $00000040;
1557
 
1565
 
1558
(*
1566
(*
1559
 * dwAlphaBitDepth is valid.
1567
 * dwAlphaBitDepth is valid.
1560
 *)
1568
 *)
1561
   DDSD_ALPHABITDEPTH      = $00000080;
1569
   DDSD_ALPHABITDEPTH      = $00000080;
1562
 
1570
 
1563
(*
1571
(*
1564
 * lpSurface is valid.
1572
 * lpSurface is valid.
1565
 *)
1573
 *)
1566
  DDSD_LPSURFACE           = $00000800;
1574
  DDSD_LPSURFACE           = $00000800;
1567
 
1575
 
1568
(*
1576
(*
1569
 * ddpfPixelFormat is valid.
1577
 * ddpfPixelFormat is valid.
1570
 *)
1578
 *)
1571
  DDSD_PIXELFORMAT        = $00001000;
1579
  DDSD_PIXELFORMAT        = $00001000;
1572
 
1580
 
1573
(*
1581
(*
1574
 * ddckCKDestOverlay is valid.
1582
 * ddckCKDestOverlay is valid.
1575
 *)
1583
 *)
1576
  DDSD_CKDESTOVERLAY      = $00002000;
1584
  DDSD_CKDESTOVERLAY      = $00002000;
1577
 
1585
 
1578
(*
1586
(*
1579
 * ddckCKDestBlt is valid.
1587
 * ddckCKDestBlt is valid.
1580
 *)
1588
 *)
1581
  DDSD_CKDESTBLT          = $00004000;
1589
  DDSD_CKDESTBLT          = $00004000;
1582
 
1590
 
1583
(*
1591
(*
1584
 * ddckCKSrcOverlay is valid.
1592
 * ddckCKSrcOverlay is valid.
1585
 *)
1593
 *)
1586
  DDSD_CKSRCOVERLAY       = $00008000;
1594
  DDSD_CKSRCOVERLAY       = $00008000;
1587
 
1595
 
1588
(*
1596
(*
1589
 * ddckCKSrcBlt is valid.
1597
 * ddckCKSrcBlt is valid.
1590
 *)
1598
 *)
1591
  DDSD_CKSRCBLT           = $00010000;
1599
  DDSD_CKSRCBLT           = $00010000;
1592
 
1600
 
1593
(*
1601
(*
1594
 * dwMipMapCount is valid.
1602
 * dwMipMapCount is valid.
1595
 *)
1603
 *)
1596
  DDSD_MIPMAPCOUNT        = $00020000;
1604
  DDSD_MIPMAPCOUNT        = $00020000;
1597
 
1605
 
1598
 (*
1606
 (*
1599
  * dwRefreshRate is valid
1607
  * dwRefreshRate is valid
1600
  *)
1608
  *)
1601
  DDSD_REFRESHRATE        = $00040000;
1609
  DDSD_REFRESHRATE        = $00040000;
1602
 
1610
 
1603
(*
1611
(*
1604
 * dwLinearSize is valid
1612
 * dwLinearSize is valid
1605
 *)
1613
 *)
1606
  DDSD_LINEARSIZE         = $00080000;
1614
  DDSD_LINEARSIZE         = $00080000;
1607
 
1615
 
1608
(*
1616
(*
1609
 * dwTextureStage is valid
1617
 * dwTextureStage is valid
1610
 *)
1618
 *)
1611
  DDSD_TEXTURESTAGE       = $00100000;
1619
  DDSD_TEXTURESTAGE       = $00100000;
1612
 
1620
 
1613
(*
1621
(*
1614
 * All input fields are valid.
1622
 * All input fields are valid.
1615
 *)
1623
 *)
1616
  DDSD_ALL                = $001ff9ee;
1624
  DDSD_ALL                = $001ff9ee;
1617
 
1625
 
1618
 
1626
 
1619
(*
1627
(*
1620
 * guid field is valid.
1628
 * guid field is valid.
1621
 *)
1629
 *)
1622
  DDOSD_GUID                  = $00000001;
1630
  DDOSD_GUID                  = $00000001;
1623
 
1631
 
1624
(*
1632
(*
1625
 * dwCompressionRatio field is valid.
1633
 * dwCompressionRatio field is valid.
1626
 *)
1634
 *)
1627
  DDOSD_COMPRESSION_RATIO     = $00000002;
1635
  DDOSD_COMPRESSION_RATIO     = $00000002;
1628
 
1636
 
1629
(*
1637
(*
1630
 * ddSCaps field is valid.
1638
 * ddSCaps field is valid.
1631
 *)
1639
 *)
1632
  DDOSD_SCAPS                 = $00000004;
1640
  DDOSD_SCAPS                 = $00000004;
1633
 
1641
 
1634
(*
1642
(*
1635
 * ddOSCaps field is valid.
1643
 * ddOSCaps field is valid.
1636
 *)
1644
 *)
1637
  DDOSD_OSCAPS                = $00000008;
1645
  DDOSD_OSCAPS                = $00000008;
1638
 
1646
 
1639
(*
1647
(*
1640
 * All input fields are valid.
1648
 * All input fields are valid.
1641
 *)
1649
 *)
1642
  DDOSD_ALL                   = $0000000f;
1650
  DDOSD_ALL                   = $0000000f;
1643
 
1651
 
1644
(*
1652
(*
1645
 * The surface's optimized pixelformat is compressed
1653
 * The surface's optimized pixelformat is compressed
1646
 *)
1654
 *)
1647
  DDOSDCAPS_OPTCOMPRESSED                       = $00000001;
1655
  DDOSDCAPS_OPTCOMPRESSED                       = $00000001;
1648
 
1656
 
1649
(*
1657
(*
1650
 * The surface's optimized pixelformat is reordered
1658
 * The surface's optimized pixelformat is reordered
1651
 *)
1659
 *)
1652
  DDOSDCAPS_OPTREORDERED                        = $00000002;
1660
  DDOSDCAPS_OPTREORDERED                        = $00000002;
1653
 
1661
 
1654
(*
1662
(*
1655
 * The opt surface is a monolithic mipmap
1663
 * The opt surface is a monolithic mipmap
1656
 *)
1664
 *)
1657
  DDOSDCAPS_MONOLITHICMIPMAP            = $00000004;
1665
  DDOSDCAPS_MONOLITHICMIPMAP            = $00000004;
1658
 
1666
 
1659
(*
1667
(*
1660
 * The valid Surf caps:
1668
 * The valid Surf caps:
1661
 *   DDSCAPS_SYSTEMMEMORY       = $00000800;
1669
 *   DDSCAPS_SYSTEMMEMORY       = $00000800;
1662
 *   DDSCAPS_VIDEOMEMORY        = $00004000;
1670
 *   DDSCAPS_VIDEOMEMORY        = $00004000;
1663
 *   DDSCAPS_LOCALVIDMEM        = $10000000;
1671
 *   DDSCAPS_LOCALVIDMEM        = $10000000;
1664
 *   DDSCAPS_NONLOCALVIDMEM     = $20000000;
1672
 *   DDSCAPS_NONLOCALVIDMEM     = $20000000;
1665
 *)
1673
 *)
1666
  DDOSDCAPS_VALIDSCAPS          = $30004800;
1674
  DDOSDCAPS_VALIDSCAPS          = $30004800;
1667
 
1675
 
1668
(*
1676
(*
1669
 * The valid OptSurf caps
1677
 * The valid OptSurf caps
1670
 *)
1678
 *)
1671
  DDOSDCAPS_VALIDOSCAPS                 = $00000007;
1679
  DDOSDCAPS_VALIDOSCAPS                 = $00000007;
1672
 
1680
 
1673
 
1681
 
1674
(*
1682
(*
1675
 * DDCOLORCONTROL
1683
 * DDCOLORCONTROL
1676
 *)
1684
 *)
1677
 
1685
 
1678
(*
1686
(*
1679
 * lBrightness field is valid.
1687
 * lBrightness field is valid.
1680
 *)
1688
 *)
1681
  DDCOLOR_BRIGHTNESS            = $00000001;
1689
  DDCOLOR_BRIGHTNESS            = $00000001;
1682
 
1690
 
1683
(*
1691
(*
1684
 * lContrast field is valid.
1692
 * lContrast field is valid.
1685
 *)
1693
 *)
1686
  DDCOLOR_CONTRAST              = $00000002;
1694
  DDCOLOR_CONTRAST              = $00000002;
1687
 
1695
 
1688
(*
1696
(*
1689
 * lHue field is valid.
1697
 * lHue field is valid.
1690
 *)
1698
 *)
1691
  DDCOLOR_HUE                   = $00000004;
1699
  DDCOLOR_HUE                   = $00000004;
1692
 
1700
 
1693
(*
1701
(*
1694
 * lSaturation field is valid.
1702
 * lSaturation field is valid.
1695
 *)
1703
 *)
1696
  DDCOLOR_SATURATION            = $00000008;
1704
  DDCOLOR_SATURATION            = $00000008;
1697
 
1705
 
1698
(*
1706
(*
1699
 * lSharpness field is valid.
1707
 * lSharpness field is valid.
1700
 *)
1708
 *)
1701
  DDCOLOR_SHARPNESS             = $00000010;
1709
  DDCOLOR_SHARPNESS             = $00000010;
1702
 
1710
 
1703
(*
1711
(*
1704
 * lGamma field is valid.
1712
 * lGamma field is valid.
1705
 *)
1713
 *)
1706
  DDCOLOR_GAMMA                 = $00000020;
1714
  DDCOLOR_GAMMA                 = $00000020;
1707
 
1715
 
1708
(*
1716
(*
1709
 * lColorEnable field is valid.
1717
 * lColorEnable field is valid.
1710
 *)
1718
 *)
1711
  DDCOLOR_COLORENABLE           = $00000040;
1719
  DDCOLOR_COLORENABLE           = $00000040;
1712
 
1720
 
1713
 
1721
 
1714
 
1722
 
1715
(*============================================================================
1723
(*============================================================================
1716
 *
1724
 *
1717
 * Direct Draw Capability Flags
1725
 * Direct Draw Capability Flags
1718
 *
1726
 *
1719
 * These flags are used to describe the capabilities of a given Surface.
1727
 * These flags are used to describe the capabilities of a given Surface.
1720
 * All flags are bit flags.
1728
 * All flags are bit flags.
1721
 *
1729
 *
1722
 *==========================================================================*)
1730
 *==========================================================================*)
1723
 
1731
 
1724
(****************************************************************************
1732
(****************************************************************************
1725
 *
1733
 *
1726
 * DIRECTDRAWSURFACE CAPABILITY FLAGS
1734
 * DIRECTDRAWSURFACE CAPABILITY FLAGS
1727
 *
1735
 *
1728
 ****************************************************************************)
1736
 ****************************************************************************)
1729
(*
1737
(*
1730
 * This bit currently has no meaning.
1738
 * This bit currently has no meaning.
1731
 *)
1739
 *)
1732
  DDSCAPS_RESERVED1                       = $00000001;
1740
  DDSCAPS_RESERVED1                       = $00000001;
1733
 
1741
 
1734
(*
1742
(*
1735
 * Indicates that this surface contains alpha-only information.
1743
 * Indicates that this surface contains alpha-only information.
1736
 * (To determine if a surface is RGBA/YUVA, the pixel format must be
1744
 * (To determine if a surface is RGBA/YUVA, the pixel format must be
1737
 * interrogated.)
1745
 * interrogated.)
1738
 *)
1746
 *)
1739
  DDSCAPS_ALPHA                           = $00000002;
1747
  DDSCAPS_ALPHA                           = $00000002;
1740
 
1748
 
1741
(*
1749
(*
1742
 * Indicates that this surface is a backbuffer.  It is generally
1750
 * Indicates that this surface is a backbuffer.  It is generally
1743
 * set by CreateSurface when the DDSCAPS_FLIP capability bit is set.
1751
 * set by CreateSurface when the DDSCAPS_FLIP capability bit is set.
1744
 * It indicates that this surface is THE back buffer of a surface
1752
 * It indicates that this surface is THE back buffer of a surface
1745
 * flipping structure.  DirectDraw supports N surfaces in a
1753
 * flipping structure.  DirectDraw supports N surfaces in a
1746
 * surface flipping structure.  Only the surface that immediately
1754
 * surface flipping structure.  Only the surface that immediately
1747
 * precedeces the DDSCAPS_FRONTBUFFER has this capability bit set.
1755
 * precedeces the DDSCAPS_FRONTBUFFER has this capability bit set.
1748
 * The other surfaces are identified as back buffers by the presence
1756
 * The other surfaces are identified as back buffers by the presence
1749
 * of the DDSCAPS_FLIP capability, their attachment order, and the
1757
 * of the DDSCAPS_FLIP capability, their attachment order, and the
1750
 * absence of the DDSCAPS_FRONTBUFFER and DDSCAPS_BACKBUFFER
1758
 * absence of the DDSCAPS_FRONTBUFFER and DDSCAPS_BACKBUFFER
1751
 * capabilities.  The bit is sent to CreateSurface when a standalone
1759
 * capabilities.  The bit is sent to CreateSurface when a standalone
1752
 * back buffer is being created.  This surface could be attached to
1760
 * back buffer is being created.  This surface could be attached to
1753
 * a front buffer and/or back buffers to form a flipping surface
1761
 * a front buffer and/or back buffers to form a flipping surface
1754
 * structure after the CreateSurface call.  See AddAttachments for
1762
 * structure after the CreateSurface call.  See AddAttachments for
1755
 * a detailed description of the behaviors in this case.
1763
 * a detailed description of the behaviors in this case.
1756
 *)
1764
 *)
1757
  DDSCAPS_BACKBUFFER                      = $00000004;
1765
  DDSCAPS_BACKBUFFER                      = $00000004;
1758
 
1766
 
1759
(*
1767
(*
1760
 * Indicates a complex surface structure is being described.  A
1768
 * Indicates a complex surface structure is being described.  A
1761
 * complex surface structure results in the creation of more than
1769
 * complex surface structure results in the creation of more than
1762
 * one surface.  The additional surfaces are attached to the root
1770
 * one surface.  The additional surfaces are attached to the root
1763
 * surface.  The complex structure can only be destroyed by
1771
 * surface.  The complex structure can only be destroyed by
1764
 * destroying the root.
1772
 * destroying the root.
1765
 *)
1773
 *)
1766
  DDSCAPS_COMPLEX                         = $00000008;
1774
  DDSCAPS_COMPLEX                         = $00000008;
1767
 
1775
 
1768
(*
1776
(*
1769
 * Indicates that this surface is a part of a surface flipping structure.
1777
 * Indicates that this surface is a part of a surface flipping structure.
1770
 * When it is passed to CreateSurface the DDSCAPS_FRONTBUFFER and
1778
 * When it is passed to CreateSurface the DDSCAPS_FRONTBUFFER and
1771
 * DDSCAP_BACKBUFFER bits are not set.  They are set by CreateSurface
1779
 * DDSCAP_BACKBUFFER bits are not set.  They are set by CreateSurface
1772
 * on the resulting creations.  The dwBackBufferCount field in the
1780
 * on the resulting creations.  The dwBackBufferCount field in the
1773
 * TDDSurfaceDesc structure must be set to at least 1 in order for
1781
 * TDDSurfaceDesc structure must be set to at least 1 in order for
1774
 * the CreateSurface call to succeed.  The DDSCAPS_COMPLEX capability
1782
 * the CreateSurface call to succeed.  The DDSCAPS_COMPLEX capability
1775
 * must always be set with creating multiple surfaces through CreateSurface.
1783
 * must always be set with creating multiple surfaces through CreateSurface.
1776
 *)
1784
 *)
1777
  DDSCAPS_FLIP                            = $00000010;
1785
  DDSCAPS_FLIP                            = $00000010;
1778
 
1786
 
1779
(*
1787
(*
1780
 * Indicates that this surface is THE front buffer of a surface flipping
1788
 * Indicates that this surface is THE front buffer of a surface flipping
1781
 * structure.  It is generally set by CreateSurface when the DDSCAPS_FLIP
1789
 * structure.  It is generally set by CreateSurface when the DDSCAPS_FLIP
1782
 * capability bit is set.
1790
 * capability bit is set.
1783
 * If this capability is sent to CreateSurface then a standalonw front buffer
1791
 * If this capability is sent to CreateSurface then a standalonw front buffer
1784
 * is created.  This surface will not have the DDSCAPS_FLIP capability.
1792
 * is created.  This surface will not have the DDSCAPS_FLIP capability.
1785
 * It can be attached to other back buffers to form a flipping structure.
1793
 * It can be attached to other back buffers to form a flipping structure.
1786
 * See AddAttachments for a detailed description of the behaviors in this
1794
 * See AddAttachments for a detailed description of the behaviors in this
1787
 * case.
1795
 * case.
1788
 *)
1796
 *)
1789
  DDSCAPS_FRONTBUFFER                     = $00000020;
1797
  DDSCAPS_FRONTBUFFER                     = $00000020;
1790
 
1798
 
1791
(*
1799
(*
1792
 * Indicates that this surface is any offscreen surface that is not an overlay,
1800
 * Indicates that this surface is any offscreen surface that is not an overlay,
1793
 * texture, zbuffer, front buffer, back buffer, or alpha surface.  It is used
1801
 * texture, zbuffer, front buffer, back buffer, or alpha surface.  It is used
1794
 * to identify plain vanilla surfaces.
1802
 * to identify plain vanilla surfaces.
1795
 *)
1803
 *)
1796
  DDSCAPS_OFFSCREENPLAIN                  = $00000040;
1804
  DDSCAPS_OFFSCREENPLAIN                  = $00000040;
1797
 
1805
 
1798
(*
1806
(*
1799
 * Indicates that this surface is an overlay.  It may or may not be directly visible
1807
 * Indicates that this surface is an overlay.  It may or may not be directly visible
1800
 * depending on whether or not it is currently being overlayed onto the primary
1808
 * depending on whether or not it is currently being overlayed onto the primary
1801
 * surface.  DDSCAPS_VISIBLE can be used to determine whether or not it is being
1809
 * surface.  DDSCAPS_VISIBLE can be used to determine whether or not it is being
1802
 * overlayed at the moment.
1810
 * overlayed at the moment.
1803
 *)
1811
 *)
1804
  DDSCAPS_OVERLAY                         = $00000080;
1812
  DDSCAPS_OVERLAY                         = $00000080;
1805
 
1813
 
1806
(*
1814
(*
1807
 * Indicates that unique DirectDrawPalette objects can be created and
1815
 * Indicates that unique DirectDrawPalette objects can be created and
1808
 * attached to this surface.
1816
 * attached to this surface.
1809
 *)
1817
 *)
1810
  DDSCAPS_PALETTE                         = $00000100;
1818
  DDSCAPS_PALETTE                         = $00000100;
1811
 
1819
 
1812
(*
1820
(*
1813
 * Indicates that this surface is the primary surface.  The primary
1821
 * Indicates that this surface is the primary surface.  The primary
1814
 * surface represents what the user is seeing at the moment.
1822
 * surface represents what the user is seeing at the moment.
1815
 *)
1823
 *)
1816
  DDSCAPS_PRIMARYSURFACE                  = $00000200;
1824
  DDSCAPS_PRIMARYSURFACE                  = $00000200;
1817
 
1825
 
1818
(*
1826
(*
1819
 * This flag used to be DDSCAPS_PRIMARYSURFACELEFT, which is now
1827
 * This flag used to be DDSCAPS_PRIMARYSURFACELEFT, which is now
1820
 * obsolete.
1828
 * obsolete.
1821
 *)
1829
 *)
1822
  DDSCAPS_RESERVED3              = $00000400;
1830
  DDSCAPS_RESERVED3              = $00000400;
1823
(*
1831
(*
1824
 * Indicates that this surface is the primary surface for the left eye.
1832
 * Indicates that this surface is the primary surface for the left eye.
1825
 * The primary surface for the left eye represents what the user is seeing
1833
 * The primary surface for the left eye represents what the user is seeing
1826
 * at the moment with the users left eye.  When this surface is created the
1834
 * at the moment with the users left eye.  When this surface is created the
1827
 * DDSCAPS_PRIMARYSURFACE represents what the user is seeing with the users
1835
 * DDSCAPS_PRIMARYSURFACE represents what the user is seeing with the users
1828
 * right eye.
1836
 * right eye.
1829
 *)
1837
 *)
1830
  DDSCAPS_PRIMARYSURFACELEFT = DDSCAPS_RESERVED3;
1838
  DDSCAPS_PRIMARYSURFACELEFT = DDSCAPS_RESERVED3;
1831
 
1839
 
1832
(*
1840
(*
1833
 * Indicates that this surface memory was allocated in system memory
1841
 * Indicates that this surface memory was allocated in system memory
1834
 *)
1842
 *)
1835
  DDSCAPS_SYSTEMMEMORY                    = $00000800;
1843
  DDSCAPS_SYSTEMMEMORY                    = $00000800;
1836
 
1844
 
1837
(*
1845
(*
1838
 * Indicates that this surface can be used as a 3D texture.  It does not
1846
 * Indicates that this surface can be used as a 3D texture.  It does not
1839
 * indicate whether or not the surface is being used for that purpose.
1847
 * indicate whether or not the surface is being used for that purpose.
1840
 *)
1848
 *)
1841
  DDSCAPS_TEXTURE                         = $00001000;
1849
  DDSCAPS_TEXTURE                         = $00001000;
1842
 
1850
 
1843
(*
1851
(*
1844
 * Indicates that a surface may be a destination for 3D rendering.  This
1852
 * Indicates that a surface may be a destination for 3D rendering.  This
1845
 * bit must be set in order to query for a Direct3D Device Interface
1853
 * bit must be set in order to query for a Direct3D Device Interface
1846
 * from this surface.
1854
 * from this surface.
1847
 *)
1855
 *)
1848
  DDSCAPS_3DDEVICE                        = $00002000;
1856
  DDSCAPS_3DDEVICE                        = $00002000;
1849
 
1857
 
1850
(*
1858
(*
1851
 * Indicates that this surface exists in video memory.
1859
 * Indicates that this surface exists in video memory.
1852
 *)
1860
 *)
1853
  DDSCAPS_VIDEOMEMORY                     = $00004000;
1861
  DDSCAPS_VIDEOMEMORY                     = $00004000;
1854
 
1862
 
1855
(*
1863
(*
1856
 * Indicates that changes made to this surface are immediately visible.
1864
 * Indicates that changes made to this surface are immediately visible.
1857
 * It is always set for the primary surface and is set for overlays while
1865
 * It is always set for the primary surface and is set for overlays while
1858
 * they are being overlayed and texture maps while they are being textured.
1866
 * they are being overlayed and texture maps while they are being textured.
1859
 *)
1867
 *)
1860
  DDSCAPS_VISIBLE                         = $00008000;
1868
  DDSCAPS_VISIBLE                         = $00008000;
1861
 
1869
 
1862
(*
1870
(*
1863
 * Indicates that only writes are permitted to the surface.  Read accesses
1871
 * Indicates that only writes are permitted to the surface.  Read accesses
1864
 * from the surface may or may not generate a protection fault, but the
1872
 * from the surface may or may not generate a protection fault, but the
1865
 * results of a read from this surface will not be meaningful.  READ ONLY.
1873
 * results of a read from this surface will not be meaningful.  READ ONLY.
1866
 *)
1874
 *)
1867
  DDSCAPS_WRITEONLY                       = $00010000;
1875
  DDSCAPS_WRITEONLY                       = $00010000;
1868
 
1876
 
1869
(*
1877
(*
1870
 * Indicates that this surface is a z buffer. A z buffer does not contain
1878
 * Indicates that this surface is a z buffer. A z buffer does not contain
1871
 * displayable information.  Instead it contains bit depth information that is
1879
 * displayable information.  Instead it contains bit depth information that is
1872
 * used to determine which pixels are visible and which are obscured.
1880
 * used to determine which pixels are visible and which are obscured.
1873
 *)
1881
 *)
1874
  DDSCAPS_ZBUFFER                         = $00020000;
1882
  DDSCAPS_ZBUFFER                         = $00020000;
1875
 
1883
 
1876
(*
1884
(*
1877
 * Indicates surface will have a DC associated long term
1885
 * Indicates surface will have a DC associated long term
1878
 *)
1886
 *)
1879
  DDSCAPS_OWNDC                           = $00040000;
1887
  DDSCAPS_OWNDC                           = $00040000;
1880
 
1888
 
1881
(*
1889
(*
1882
 * Indicates surface should be able to receive live video
1890
 * Indicates surface should be able to receive live video
1883
 *)
1891
 *)
1884
  DDSCAPS_LIVEVIDEO                       = $00080000;
1892
  DDSCAPS_LIVEVIDEO                       = $00080000;
1885
 
1893
 
1886
(*
1894
(*
1887
 * Indicates surface should be able to have a stream decompressed
1895
 * Indicates surface should be able to have a stream decompressed
1888
 * to it by the hardware.
1896
 * to it by the hardware.
1889
 *)
1897
 *)
1890
  DDSCAPS_HWCODEC                         = $00100000;
1898
  DDSCAPS_HWCODEC                         = $00100000;
1891
 
1899
 
1892
(*
1900
(*
1893
 * Surface is a ModeX surface.
1901
 * Surface is a ModeX surface.
1894
 *
1902
 *
1895
 *)
1903
 *)
1896
  DDSCAPS_MODEX                           = $00200000;
1904
  DDSCAPS_MODEX                           = $00200000;
1897
 
1905
 
1898
(*
1906
(*
1899
 * Indicates surface is one level of a mip-map. This surface will
1907
 * Indicates surface is one level of a mip-map. This surface will
1900
 * be attached to other DDSCAPS_MIPMAP surfaces to form the mip-map.
1908
 * be attached to other DDSCAPS_MIPMAP surfaces to form the mip-map.
1901
 * This can be done explicitly, by creating a number of surfaces and
1909
 * This can be done explicitly, by creating a number of surfaces and
1902
 * attaching them with AddAttachedSurface or by implicitly by CreateSurface.
1910
 * attaching them with AddAttachedSurface or by implicitly by CreateSurface.
1903
 * If this bit is set then DDSCAPS_TEXTURE must also be set.
1911
 * If this bit is set then DDSCAPS_TEXTURE must also be set.
1904
 *)
1912
 *)
1905
  DDSCAPS_MIPMAP                          = $00400000;
1913
  DDSCAPS_MIPMAP                          = $00400000;
1906
 
1914
 
1907
(*
1915
(*
1908
 * This bit is reserved. It should not be specified.
1916
 * This bit is reserved. It should not be specified.
1909
 *)
1917
 *)
1910
  DDSCAPS_RESERVED2                       = $00800000;
1918
  DDSCAPS_RESERVED2                       = $00800000;
1911
 
1919
 
1912
(*
1920
(*
1913
 * Indicates that memory for the surface is not allocated until the surface
1921
 * Indicates that memory for the surface is not allocated until the surface
1914
 * is loaded (via the Direct3D texture Load() function).
1922
 * is loaded (via the Direct3D texture Load() function).
1915
 *)
1923
 *)
1916
  DDSCAPS_ALLOCONLOAD                     = $04000000;
1924
  DDSCAPS_ALLOCONLOAD                     = $04000000;
1917
 
1925
 
1918
(*
1926
(*
1919
 * Indicates that the surface will recieve data from a video port.
1927
 * Indicates that the surface will recieve data from a video port.
1920
 *)
1928
 *)
1921
  DDSCAPS_VIDEOPORT                       = $08000000;
1929
  DDSCAPS_VIDEOPORT                       = $08000000;
1922
 
1930
 
1923
(*
1931
(*
1924
 * Indicates that a video memory surface is resident in true, local video
1932
 * Indicates that a video memory surface is resident in true, local video
1925
 * memory rather than non-local video memory. If this flag is specified then
1933
 * memory rather than non-local video memory. If this flag is specified then
1926
 * so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with
1934
 * so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with
1927
 * DDSCAPS_NONLOCALVIDMEM.
1935
 * DDSCAPS_NONLOCALVIDMEM.
1928
 *)
1936
 *)
1929
  DDSCAPS_LOCALVIDMEM                     = $10000000;
1937
  DDSCAPS_LOCALVIDMEM                     = $10000000;
1930
 
1938
 
1931
(*
1939
(*
1932
 * Indicates that a video memory surface is resident in non-local video
1940
 * Indicates that a video memory surface is resident in non-local video
1933
 * memory rather than true, local video memory. If this flag is specified
1941
 * memory rather than true, local video memory. If this flag is specified
1934
 * then so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with
1942
 * then so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with
1935
 * DDSCAPS_LOCALVIDMEM.
1943
 * DDSCAPS_LOCALVIDMEM.
1936
 *)
1944
 *)
1937
  DDSCAPS_NONLOCALVIDMEM                  = $20000000;
1945
  DDSCAPS_NONLOCALVIDMEM                  = $20000000;
1938
 
1946
 
1939
(*
1947
(*
1940
 * Indicates that this surface is a standard VGA mode surface, and not a
1948
 * Indicates that this surface is a standard VGA mode surface, and not a
1941
 * ModeX surface. (This flag will never be set in combination with the
1949
 * ModeX surface. (This flag will never be set in combination with the
1942
 * DDSCAPS_MODEX flag).
1950
 * DDSCAPS_MODEX flag).
1943
 *)
1951
 *)
1944
  DDSCAPS_STANDARDVGAMODE                 = $40000000;
1952
  DDSCAPS_STANDARDVGAMODE                 = $40000000;
1945
 
1953
 
1946
(*
1954
(*
1947
 * Indicates that this surface will be an optimized surface. This flag is
1955
 * Indicates that this surface will be an optimized surface. This flag is
1948
 * currently only valid in conjunction with the DDSCAPS_TEXTURE flag. The surface
1956
 * currently only valid in conjunction with the DDSCAPS_TEXTURE flag. The surface
1949
 * will be created without any underlying video memory until loaded.
1957
 * will be created without any underlying video memory until loaded.
1950
 *)
1958
 *)
1951
  DDSCAPS_OPTIMIZED                       = $80000000;
1959
  DDSCAPS_OPTIMIZED                       = $80000000;
1952
 
1960
 
1953
 
1961
 
1954
 
1962
 
1955
(*
1963
(*
1956
 * Indicates that this surface will receive data from a video port using
1964
 * Indicates that this surface will receive data from a video port using
1957
 * the de-interlacing hardware.  This allows the driver to allocate memory
1965
 * the de-interlacing hardware.  This allows the driver to allocate memory
1958
 * for any extra buffers that may be required.  The DDSCAPS_VIDEOPORT and
1966
 * for any extra buffers that may be required.  The DDSCAPS_VIDEOPORT and
1959
 * DDSCAPS_OVERLAY flags must also be set.
1967
 * DDSCAPS_OVERLAY flags must also be set.
1960
 *)
1968
 *)
1961
  DDSCAPS2_HARDWAREDEINTERLACE            = $00000002;
1969
  DDSCAPS2_HARDWAREDEINTERLACE            = $00000002;
1962
 
1970
 
1963
(*
1971
(*
1964
 * Indicates to the driver that this surface will be locked very frequently
1972
 * Indicates to the driver that this surface will be locked very frequently
1965
 * (for procedural textures, dynamic lightmaps, etc). Surfaces with this cap
1973
 * (for procedural textures, dynamic lightmaps, etc). Surfaces with this cap
1966
 * set must also have DDSCAPS_TEXTURE. This cap cannot be used with
1974
 * set must also have DDSCAPS_TEXTURE. This cap cannot be used with
1967
 * DDSCAPS2_HINTSTATIC and DDSCAPS2_OPAQUE.
1975
 * DDSCAPS2_HINTSTATIC and DDSCAPS2_OPAQUE.
1968
 *)
1976
 *)
1969
  DDSCAPS2_HINTDYNAMIC                  = $00000004;
1977
  DDSCAPS2_HINTDYNAMIC                  = $00000004;
1970
 
1978
 
1971
(*
1979
(*
1972
 * Indicates to the driver that this surface can be re-ordered/retiled on
1980
 * Indicates to the driver that this surface can be re-ordered/retiled on
1973
 * load. This operation will not change the size of the texture. It is
1981
 * load. This operation will not change the size of the texture. It is
1974
 * relatively fast and symmetrical, since the application may lock these
1982
 * relatively fast and symmetrical, since the application may lock these
1975
 * bits (although it will take a performance hit when doing so). Surfaces
1983
 * bits (although it will take a performance hit when doing so). Surfaces
1976
 * with this cap set must also have DDSCAPS_TEXTURE. This cap cannot be
1984
 * with this cap set must also have DDSCAPS_TEXTURE. This cap cannot be
1977
 * used with DDSCAPS2_HINTDYNAMIC and DDSCAPS2_OPAQUE.
1985
 * used with DDSCAPS2_HINTDYNAMIC and DDSCAPS2_OPAQUE.
1978
 *)
1986
 *)
1979
  DDSCAPS2_HINTSTATIC                   = $00000008;
1987
  DDSCAPS2_HINTSTATIC                   = $00000008;
1980
 
1988
 
1981
(*
1989
(*
1982
 * Indicates that the client would like this texture surface to be managed by the
1990
 * Indicates that the client would like this texture surface to be managed by the
1983
 * DirectDraw/Direct3D runtime. Surfaces with this cap set must also have
1991
 * DirectDraw/Direct3D runtime. Surfaces with this cap set must also have
1984
 * DDSCAPS_TEXTURE and DDSCAPS_SYSTEMMEMORY.
1992
 * DDSCAPS_TEXTURE and DDSCAPS_SYSTEMMEMORY.
1985
 *)
1993
 *)
1986
  DDSCAPS2_TEXTUREMANAGE                  = $00000010;
1994
  DDSCAPS2_TEXTUREMANAGE                  = $00000010;
1987
 
1995
 
1988
(*
1996
(*
1989
 * These bits are reserved for internal use *)
1997
 * These bits are reserved for internal use *)
1990
  DDSCAPS2_RESERVED1                      = $00000020;
1998
  DDSCAPS2_RESERVED1                      = $00000020;
1991
  DDSCAPS2_RESERVED2                      = $00000040;
1999
  DDSCAPS2_RESERVED2                      = $00000040;
1992
 
2000
 
1993
(*
2001
(*
1994
 * Indicates to the driver that this surface will never be locked again.
2002
 * Indicates to the driver that this surface will never be locked again.
1995
 * The driver is free to optimize this surface via retiling and actual compression.
2003
 * The driver is free to optimize this surface via retiling and actual compression.
1996
 * All calls to Lock() or Blts from this surface will fail. Surfaces with this
2004
 * All calls to Lock() or Blts from this surface will fail. Surfaces with this
1997
 * cap set must also have DDSCAPS_TEXTURE. This cap cannot be used with
2005
 * cap set must also have DDSCAPS_TEXTURE. This cap cannot be used with
1998
 * DDSCAPS2_HINTDYNAMIC and DDSCAPS2_HINTSTATIC.
2006
 * DDSCAPS2_HINTDYNAMIC and DDSCAPS2_HINTSTATIC.
1999
 *)
2007
 *)
2000
  DDSCAPS2_OPAQUE                         = $00000080;
2008
  DDSCAPS2_OPAQUE                         = $00000080;
2001
 
2009
 
2002
(*
2010
(*
2003
 * Applications should set this bit at CreateSurface time to indicate that they
2011
 * Applications should set this bit at CreateSurface time to indicate that they
2004
 * intend to use antialiasing. Only valid if DDSCAPS_3DDEVICE is also set.
2012
 * intend to use antialiasing. Only valid if DDSCAPS_3DDEVICE is also set.
2005
 *)
2013
 *)
2006
  DDSCAPS2_HINTANTIALIASING               = $00000100;
2014
  DDSCAPS2_HINTANTIALIASING               = $00000100;
2007
 
2015
 
2008
(*
2016
(*
2009
 * This flag is used at CreateSurface time to indicate that this set of
2017
 * This flag is used at CreateSurface time to indicate that this set of
2010
 * surfaces is a cubic environment map
2018
 * surfaces is a cubic environment map
2011
 *)
2019
 *)
2012
  DDSCAPS2_CUBEMAP                        = $00000200;
2020
  DDSCAPS2_CUBEMAP                        = $00000200;
2013
 
2021
 
2014
(*
2022
(*
2015
 * These flags preform two functions:
2023
 * These flags preform two functions:
2016
 * - At CreateSurface time, they define which of the six cube faces are
2024
 * - At CreateSurface time, they define which of the six cube faces are
2017
 *   required by the application.
2025
 *   required by the application.
2018
 * - After creation, each face in the cubemap will have exactly one of these
2026
 * - After creation, each face in the cubemap will have exactly one of these
2019
 *   bits set.
2027
 *   bits set.
2020
 *)
2028
 *)
2021
  DDSCAPS2_CUBEMAP_POSITIVEX              = $00000400;
2029
  DDSCAPS2_CUBEMAP_POSITIVEX              = $00000400;
2022
  DDSCAPS2_CUBEMAP_NEGATIVEX              = $00000800;
2030
  DDSCAPS2_CUBEMAP_NEGATIVEX              = $00000800;
2023
  DDSCAPS2_CUBEMAP_POSITIVEY              = $00001000;
2031
  DDSCAPS2_CUBEMAP_POSITIVEY              = $00001000;
2024
  DDSCAPS2_CUBEMAP_NEGATIVEY              = $00002000;
2032
  DDSCAPS2_CUBEMAP_NEGATIVEY              = $00002000;
2025
  DDSCAPS2_CUBEMAP_POSITIVEZ              = $00004000;
2033
  DDSCAPS2_CUBEMAP_POSITIVEZ              = $00004000;
2026
  DDSCAPS2_CUBEMAP_NEGATIVEZ              = $00008000;
2034
  DDSCAPS2_CUBEMAP_NEGATIVEZ              = $00008000;
2027
 
2035
 
2028
(*
2036
(*
2029
 * This macro may be used to specify all faces of a cube map at CreateSurface time
2037
 * This macro may be used to specify all faces of a cube map at CreateSurface time
2030
 *)
2038
 *)
2031
  DDSCAPS2_CUBEMAP_ALLFACES = ( DDSCAPS2_CUBEMAP_POSITIVEX or
2039
  DDSCAPS2_CUBEMAP_ALLFACES = ( DDSCAPS2_CUBEMAP_POSITIVEX or
2032
                                DDSCAPS2_CUBEMAP_NEGATIVEX or
2040
                                DDSCAPS2_CUBEMAP_NEGATIVEX or
2033
                                DDSCAPS2_CUBEMAP_POSITIVEY or
2041
                                DDSCAPS2_CUBEMAP_POSITIVEY or
2034
                                DDSCAPS2_CUBEMAP_NEGATIVEY or
2042
                                DDSCAPS2_CUBEMAP_NEGATIVEY or
2035
                                DDSCAPS2_CUBEMAP_POSITIVEZ or
2043
                                DDSCAPS2_CUBEMAP_POSITIVEZ or
2036
                                DDSCAPS2_CUBEMAP_NEGATIVEZ );
2044
                                DDSCAPS2_CUBEMAP_NEGATIVEZ );
2037
 
2045
 
2038
 
2046
 
2039
(*
2047
(*
2040
 * This flag is an additional flag which is present on mipmap sublevels from DX7 onwards
2048
 * This flag is an additional flag which is present on mipmap sublevels from DX7 onwards
2041
 * It enables easier use of GetAttachedSurface rather than EnumAttachedSurfaces for surface
2049
 * It enables easier use of GetAttachedSurface rather than EnumAttachedSurfaces for surface
2042
 * constructs such as Cube Maps, wherein there are more than one mipmap surface attached
2050
 * constructs such as Cube Maps, wherein there are more than one mipmap surface attached
2043
 * to the root surface.
2051
 * to the root surface.
2044
 * This caps bit is ignored by CreateSurface
2052
 * This caps bit is ignored by CreateSurface
2045
 *)
2053
 *)
2046
  DDSCAPS2_MIPMAPSUBLEVEL                 = $00010000;
2054
  DDSCAPS2_MIPMAPSUBLEVEL                 = $00010000;
2047
 
2055
 
2048
(* This flag indicates that the texture should be managed by D3D only *)
2056
(* This flag indicates that the texture should be managed by D3D only *)
2049
  DDSCAPS2_D3DTEXTUREMANAGE               = $00020000;
2057
  DDSCAPS2_D3DTEXTUREMANAGE               = $00020000;
2050
 
2058
 
2051
(* This flag indicates that the managed surface can be safely lost *)
2059
(* This flag indicates that the managed surface can be safely lost *)
2052
  DDSCAPS2_DONOTPERSIST                   = $00040000;
2060
  DDSCAPS2_DONOTPERSIST                   = $00040000;
2053
 
2061
 
2054
(* indicates that this surface is part of a stereo flipping chain *)
2062
(* indicates that this surface is part of a stereo flipping chain *)
2055
  DDSCAPS2_STEREOSURFACELEFT              = $00080000;
2063
  DDSCAPS2_STEREOSURFACELEFT              = $00080000;
2056
 
2064
 
2057
 
2065
 
2058
 
2066
 
2059
 (****************************************************************************
2067
 (****************************************************************************
2060
 *
2068
 *
2061
 * DIRECTDRAW DRIVER CAPABILITY FLAGS
2069
 * DIRECTDRAW DRIVER CAPABILITY FLAGS
2062
 *
2070
 *
2063
 ****************************************************************************)
2071
 ****************************************************************************)
2064
 
2072
 
2065
(*
2073
(*
2066
 * Display hardware has 3D acceleration.
2074
 * Display hardware has 3D acceleration.
2067
 *)
2075
 *)
2068
  DDCAPS_3D                       = $00000001;
2076
  DDCAPS_3D                       = $00000001;
2069
 
2077
 
2070
(*
2078
(*
2071
 * Indicates that DirectDraw will support only dest rectangles that are aligned
2079
 * Indicates that DirectDraw will support only dest rectangles that are aligned
2072
 * on DIRECTDRAWCAPS.dwAlignBoundaryDest boundaries of the surface, respectively.
2080
 * on DIRECTDRAWCAPS.dwAlignBoundaryDest boundaries of the surface, respectively.
2073
 * READ ONLY.
2081
 * READ ONLY.
2074
 *)
2082
 *)
2075
  DDCAPS_ALIGNBOUNDARYDEST        = $00000002;
2083
  DDCAPS_ALIGNBOUNDARYDEST        = $00000002;
2076
 
2084
 
2077
(*
2085
(*
2078
 * Indicates that DirectDraw will support only source rectangles  whose sizes in
2086
 * Indicates that DirectDraw will support only source rectangles  whose sizes in
2079
 * BYTEs are DIRECTDRAWCAPS.dwAlignSizeDest multiples, respectively.  READ ONLY.
2087
 * BYTEs are DIRECTDRAWCAPS.dwAlignSizeDest multiples, respectively.  READ ONLY.
2080
 *)
2088
 *)
2081
  DDCAPS_ALIGNSIZEDEST            = $00000004;
2089
  DDCAPS_ALIGNSIZEDEST            = $00000004;
2082
(*
2090
(*
2083
 * Indicates that DirectDraw will support only source rectangles that are aligned
2091
 * Indicates that DirectDraw will support only source rectangles that are aligned
2084
 * on DIRECTDRAWCAPS.dwAlignBoundarySrc boundaries of the surface, respectively.
2092
 * on DIRECTDRAWCAPS.dwAlignBoundarySrc boundaries of the surface, respectively.
2085
 * READ ONLY.
2093
 * READ ONLY.
2086
 *)
2094
 *)
2087
  DDCAPS_ALIGNBOUNDARYSRC         = $00000008;
2095
  DDCAPS_ALIGNBOUNDARYSRC         = $00000008;
2088
 
2096
 
2089
(*
2097
(*
2090
 * Indicates that DirectDraw will support only source rectangles  whose sizes in
2098
 * Indicates that DirectDraw will support only source rectangles  whose sizes in
2091
 * BYTEs are DIRECTDRAWCAPS.dwAlignSizeSrc multiples, respectively.  READ ONLY.
2099
 * BYTEs are DIRECTDRAWCAPS.dwAlignSizeSrc multiples, respectively.  READ ONLY.
2092
 *)
2100
 *)
2093
  DDCAPS_ALIGNSIZESRC             = $00000010;
2101
  DDCAPS_ALIGNSIZESRC             = $00000010;
2094
 
2102
 
2095
(*
2103
(*
2096
 * Indicates that DirectDraw will create video memory surfaces that have a stride
2104
 * Indicates that DirectDraw will create video memory surfaces that have a stride
2097
 * alignment equal to DIRECTDRAWCAPS.dwAlignStride.  READ ONLY.
2105
 * alignment equal to DIRECTDRAWCAPS.dwAlignStride.  READ ONLY.
2098
 *)
2106
 *)
2099
  DDCAPS_ALIGNSTRIDE              = $00000020;
2107
  DDCAPS_ALIGNSTRIDE              = $00000020;
2100
 
2108
 
2101
(*
2109
(*
2102
 * Display hardware is capable of blt operations.
2110
 * Display hardware is capable of blt operations.
2103
 *)
2111
 *)
2104
  DDCAPS_BLT                      = $00000040;
2112
  DDCAPS_BLT                      = $00000040;
2105
 
2113
 
2106
(*
2114
(*
2107
 * Display hardware is capable of asynchronous blt operations.
2115
 * Display hardware is capable of asynchronous blt operations.
2108
 *)
2116
 *)
2109
  DDCAPS_BLTQUEUE                 = $00000080;
2117
  DDCAPS_BLTQUEUE                 = $00000080;
2110
 
2118
 
2111
(*
2119
(*
2112
 * Display hardware is capable of color space conversions during the blt operation.
2120
 * Display hardware is capable of color space conversions during the blt operation.
2113
 *)
2121
 *)
2114
  DDCAPS_BLTFOURCC                = $00000100;
2122
  DDCAPS_BLTFOURCC                = $00000100;
2115
 
2123
 
2116
(*
2124
(*
2117
 * Display hardware is capable of stretching during blt operations.
2125
 * Display hardware is capable of stretching during blt operations.
2118
 *)
2126
 *)
2119
  DDCAPS_BLTSTRETCH               = $00000200;
2127
  DDCAPS_BLTSTRETCH               = $00000200;
2120
 
2128
 
2121
(*
2129
(*
2122
 * Display hardware is shared with GDI.
2130
 * Display hardware is shared with GDI.
2123
 *)
2131
 *)
2124
  DDCAPS_GDI                      = $00000400;
2132
  DDCAPS_GDI                      = $00000400;
2125
 
2133
 
2126
(*
2134
(*
2127
 * Display hardware can overlay.
2135
 * Display hardware can overlay.
2128
 *)
2136
 *)
2129
  DDCAPS_OVERLAY                  = $00000800;
2137
  DDCAPS_OVERLAY                  = $00000800;
2130
 
2138
 
2131
(*
2139
(*
2132
 * Set if display hardware supports overlays but can not clip them.
2140
 * Set if display hardware supports overlays but can not clip them.
2133
 *)
2141
 *)
2134
  DDCAPS_OVERLAYCANTCLIP          = $00001000;
2142
  DDCAPS_OVERLAYCANTCLIP          = $00001000;
2135
 
2143
 
2136
(*
2144
(*
2137
 * Indicates that overlay hardware is capable of color space conversions during
2145
 * Indicates that overlay hardware is capable of color space conversions during
2138
 * the overlay operation.
2146
 * the overlay operation.
2139
 *)
2147
 *)
2140
  DDCAPS_OVERLAYFOURCC            = $00002000;
2148
  DDCAPS_OVERLAYFOURCC            = $00002000;
2141
 
2149
 
2142
(*
2150
(*
2143
 * Indicates that stretching can be done by the overlay hardware.
2151
 * Indicates that stretching can be done by the overlay hardware.
2144
 *)
2152
 *)
2145
  DDCAPS_OVERLAYSTRETCH           = $00004000;
2153
  DDCAPS_OVERLAYSTRETCH           = $00004000;
2146
 
2154
 
2147
(*
2155
(*
2148
 * Indicates that unique DirectDrawPalettes can be created for DirectDrawSurfaces
2156
 * Indicates that unique DirectDrawPalettes can be created for DirectDrawSurfaces
2149
 * other than the primary surface.
2157
 * other than the primary surface.
2150
 *)
2158
 *)
2151
  DDCAPS_PALETTE                  = $00008000;
2159
  DDCAPS_PALETTE                  = $00008000;
2152
 
2160
 
2153
(*
2161
(*
2154
 * Indicates that palette changes can be syncd with the veritcal refresh.
2162
 * Indicates that palette changes can be syncd with the veritcal refresh.
2155
 *)
2163
 *)
2156
  DDCAPS_PALETTEVSYNC             = $00010000;
2164
  DDCAPS_PALETTEVSYNC             = $00010000;
2157
 
2165
 
2158
(*
2166
(*
2159
 * Display hardware can return the current scan line.
2167
 * Display hardware can return the current scan line.
2160
 *)
2168
 *)
2161
  DDCAPS_READSCANLINE             = $00020000;
2169
  DDCAPS_READSCANLINE             = $00020000;
2162
 
2170
 
2163
(*
2171
(*
2164
 * Display hardware has stereo vision capabilities.  DDSCAPS_PRIMARYSURFACELEFT
2172
 * Display hardware has stereo vision capabilities.  DDSCAPS_PRIMARYSURFACELEFT
2165
 * can be created.
2173
 * can be created.
2166
 *)
2174
 *)
2167
  DDCAPS_STEREOVIEW               = $00040000;
2175
  DDCAPS_STEREOVIEW               = $00040000;
2168
 
2176
 
2169
(*
2177
(*
2170
 * Display hardware is capable of generating a vertical blank interrupt.
2178
 * Display hardware is capable of generating a vertical blank interrupt.
2171
 *)
2179
 *)
2172
  DDCAPS_VBI                      = $00080000;
2180
  DDCAPS_VBI                      = $00080000;
2173
 
2181
 
2174
(*
2182
(*
2175
 * Supports the use of z buffers with blt operations.
2183
 * Supports the use of z buffers with blt operations.
2176
 *)
2184
 *)
2177
  DDCAPS_ZBLTS                    = $00100000;
2185
  DDCAPS_ZBLTS                    = $00100000;
2178
 
2186
 
2179
(*
2187
(*
2180
 * Supports Z Ordering of overlays.
2188
 * Supports Z Ordering of overlays.
2181
 *)
2189
 *)
2182
  DDCAPS_ZOVERLAYS                = $00200000;
2190
  DDCAPS_ZOVERLAYS                = $00200000;
2183
 
2191
 
2184
(*
2192
(*
2185
 * Supports color key
2193
 * Supports color key
2186
 *)
2194
 *)
2187
  DDCAPS_COLORKEY                 = $00400000;
2195
  DDCAPS_COLORKEY                 = $00400000;
2188
 
2196
 
2189
(*
2197
(*
2190
 * Supports alpha surfaces
2198
 * Supports alpha surfaces
2191
 *)
2199
 *)
2192
  DDCAPS_ALPHA                    = $00800000;
2200
  DDCAPS_ALPHA                    = $00800000;
2193
 
2201
 
2194
(*
2202
(*
2195
 * colorkey is hardware assisted(DDCAPS_COLORKEY will also be set)
2203
 * colorkey is hardware assisted(DDCAPS_COLORKEY will also be set)
2196
 *)
2204
 *)
2197
  DDCAPS_COLORKEYHWASSIST         = $01000000;
2205
  DDCAPS_COLORKEYHWASSIST         = $01000000;
2198
 
2206
 
2199
(*
2207
(*
2200
 * no hardware support at all
2208
 * no hardware support at all
2201
 *)
2209
 *)
2202
  DDCAPS_NOHARDWARE               = $02000000;
2210
  DDCAPS_NOHARDWARE               = $02000000;
2203
 
2211
 
2204
(*
2212
(*
2205
 * Display hardware is capable of color fill with bltter
2213
 * Display hardware is capable of color fill with bltter
2206
 *)
2214
 *)
2207
  DDCAPS_BLTCOLORFILL             = $04000000;
2215
  DDCAPS_BLTCOLORFILL             = $04000000;
2208
 
2216
 
2209
(*
2217
(*
2210
 * Display hardware is bank switched, and potentially very slow at
2218
 * Display hardware is bank switched, and potentially very slow at
2211
 * random access to VRAM.
2219
 * random access to VRAM.
2212
 *)
2220
 *)
2213
  DDCAPS_BANKSWITCHED             = $08000000;
2221
  DDCAPS_BANKSWITCHED             = $08000000;
2214
 
2222
 
2215
(*
2223
(*
2216
 * Display hardware is capable of depth filling Z-buffers with bltter
2224
 * Display hardware is capable of depth filling Z-buffers with bltter
2217
 *)
2225
 *)
2218
  DDCAPS_BLTDEPTHFILL             = $10000000;
2226
  DDCAPS_BLTDEPTHFILL             = $10000000;
2219
 
2227
 
2220
(*
2228
(*
2221
 * Display hardware is capable of clipping while bltting.
2229
 * Display hardware is capable of clipping while bltting.
2222
 *)
2230
 *)
2223
  DDCAPS_CANCLIP                  = $20000000;
2231
  DDCAPS_CANCLIP                  = $20000000;
2224
 
2232
 
2225
(*
2233
(*
2226
 * Display hardware is capable of clipping while stretch bltting.
2234
 * Display hardware is capable of clipping while stretch bltting.
2227
 *)
2235
 *)
2228
  DDCAPS_CANCLIPSTRETCHED         = $40000000;
2236
  DDCAPS_CANCLIPSTRETCHED         = $40000000;
2229
 
2237
 
2230
(*
2238
(*
2231
 * Display hardware is capable of bltting to or from system memory
2239
 * Display hardware is capable of bltting to or from system memory
2232
 *)
2240
 *)
2233
  DDCAPS_CANBLTSYSMEM             = $80000000;
2241
  DDCAPS_CANBLTSYSMEM             = $80000000;
2234
 
2242
 
2235
 
2243
 
2236
 (****************************************************************************
2244
 (****************************************************************************
2237
 *
2245
 *
2238
 * MORE DIRECTDRAW DRIVER CAPABILITY FLAGS (dwCaps2)
2246
 * MORE DIRECTDRAW DRIVER CAPABILITY FLAGS (dwCaps2)
2239
 *
2247
 *
2240
 ****************************************************************************)
2248
 ****************************************************************************)
2241
 
2249
 
2242
(*
2250
(*
2243
 * Display hardware is certified
2251
 * Display hardware is certified
2244
 *)
2252
 *)
2245
  DDCAPS2_CERTIFIED               = $00000001;
2253
  DDCAPS2_CERTIFIED               = $00000001;
2246
 
2254
 
2247
(*
2255
(*
2248
 * Driver cannot interleave 2D operations (lock and blt) to surfaces with
2256
 * Driver cannot interleave 2D operations (lock and blt) to surfaces with
2249
 * Direct3D rendering operations between calls to BeginScene() and EndScene()
2257
 * Direct3D rendering operations between calls to BeginScene() and EndScene()
2250
 *)
2258
 *)
2251
  DDCAPS2_NO2DDURING3DSCENE       = $00000002;
2259
  DDCAPS2_NO2DDURING3DSCENE       = $00000002;
2252
 
2260
 
2253
(*
2261
(*
2254
 * Display hardware contains a video port
2262
 * Display hardware contains a video port
2255
 *)
2263
 *)
2256
  DDCAPS2_VIDEOPORT               = $00000004;
2264
  DDCAPS2_VIDEOPORT               = $00000004;
2257
 
2265
 
2258
(*
2266
(*
2259
 * The overlay can be automatically flipped according to the video port
2267
 * The overlay can be automatically flipped according to the video port
2260
 * VSYNCs, providing automatic doubled buffered display of video port
2268
 * VSYNCs, providing automatic doubled buffered display of video port
2261
 * data using an overlay
2269
 * data using an overlay
2262
 *)
2270
 *)
2263
  DDCAPS2_AUTOFLIPOVERLAY         = $00000008;
2271
  DDCAPS2_AUTOFLIPOVERLAY         = $00000008;
2264
 
2272
 
2265
(*
2273
(*
2266
 * Overlay can display each field of interlaced data individually while
2274
 * Overlay can display each field of interlaced data individually while
2267
 * it is interleaved in memory without causing jittery artifacts.
2275
 * it is interleaved in memory without causing jittery artifacts.
2268
 *)
2276
 *)
2269
  DDCAPS2_CANBOBINTERLEAVED     = $00000010;
2277
  DDCAPS2_CANBOBINTERLEAVED     = $00000010;
2270
 
2278
 
2271
(*
2279
(*
2272
 * Overlay can display each field of interlaced data individually while
2280
 * Overlay can display each field of interlaced data individually while
2273
 * it is not interleaved in memory without causing jittery artifacts.
2281
 * it is not interleaved in memory without causing jittery artifacts.
2274
 *)
2282
 *)
2275
  DDCAPS2_CANBOBNONINTERLEAVED  = $00000020;
2283
  DDCAPS2_CANBOBNONINTERLEAVED  = $00000020;
2276
 
2284
 
2277
(*
2285
(*
2278
 * The overlay surface contains color controls (brightness, sharpness, etc.)
2286
 * The overlay surface contains color controls (brightness, sharpness, etc.)
2279
 *)
2287
 *)
2280
  DDCAPS2_COLORCONTROLOVERLAY   = $00000040;
2288
  DDCAPS2_COLORCONTROLOVERLAY   = $00000040;
2281
 
2289
 
2282
(*
2290
(*
2283
 * The primary surface contains color controls (gamma, etc.)
2291
 * The primary surface contains color controls (gamma, etc.)
2284
 *)
2292
 *)
2285
  DDCAPS2_COLORCONTROLPRIMARY   = $00000080;
2293
  DDCAPS2_COLORCONTROLPRIMARY   = $00000080;
2286
 
2294
 
2287
(*
2295
(*
2288
 * RGBZ -> RGB supported for 16:16 RGB:Z
2296
 * RGBZ -> RGB supported for 16:16 RGB:Z
2289
 *)
2297
 *)
2290
  DDCAPS2_CANDROPZ16BIT         = $00000100;
2298
  DDCAPS2_CANDROPZ16BIT         = $00000100;
2291
 
2299
 
2292
(*
2300
(*
2293
 * Driver supports non-local video memory.
2301
 * Driver supports non-local video memory.
2294
 *)
2302
 *)
2295
  DDCAPS2_NONLOCALVIDMEM          = $00000200;
2303
  DDCAPS2_NONLOCALVIDMEM          = $00000200;
2296
 
2304
 
2297
(*
2305
(*
2298
 * Dirver supports non-local video memory but has different capabilities for
2306
 * Dirver supports non-local video memory but has different capabilities for
2299
 * non-local video memory surfaces. If this bit is set then so must
2307
 * non-local video memory surfaces. If this bit is set then so must
2300
 * DDCAPS2_NONLOCALVIDMEM.
2308
 * DDCAPS2_NONLOCALVIDMEM.
2301
 *)
2309
 *)
2302
  DDCAPS2_NONLOCALVIDMEMCAPS      = $00000400;
2310
  DDCAPS2_NONLOCALVIDMEMCAPS      = $00000400;
2303
 
2311
 
2304
(*
2312
(*
2305
 * Driver neither requires nor prefers surfaces to be pagelocked when performing
2313
 * Driver neither requires nor prefers surfaces to be pagelocked when performing
2306
 * blts involving system memory surfaces
2314
 * blts involving system memory surfaces
2307
 *)
2315
 *)
2308
  DDCAPS2_NOPAGELOCKREQUIRED      = $00000800;
2316
  DDCAPS2_NOPAGELOCKREQUIRED      = $00000800;
2309
 
2317
 
2310
(*
2318
(*
2311
 * Driver can create surfaces which are wider than the primary surface
2319
 * Driver can create surfaces which are wider than the primary surface
2312
 *)
2320
 *)
2313
  DDCAPS2_WIDESURFACES            = $00001000;
2321
  DDCAPS2_WIDESURFACES            = $00001000;
2314
 
2322
 
2315
(*
2323
(*
2316
 * Driver supports bob without using a video port by handling the
2324
 * Driver supports bob without using a video port by handling the
2317
 * DDFLIP_ODD and DDFLIP_EVEN flags specified in Flip.
2325
 * DDFLIP_ODD and DDFLIP_EVEN flags specified in Flip.
2318
 *)
2326
 *)
2319
  DDCAPS2_CANFLIPODDEVEN          = $00002000;
2327
  DDCAPS2_CANFLIPODDEVEN          = $00002000;
2320
 
2328
 
2321
(*
2329
(*
2322
 * Driver supports bob using hardware
2330
 * Driver supports bob using hardware
2323
 *)
2331
 *)
2324
  DDCAPS2_CANBOBHARDWARE          = $00004000;
2332
  DDCAPS2_CANBOBHARDWARE          = $00004000;
2325
 
2333
 
2326
(*
2334
(*
2327
 * Driver supports bltting any FOURCC surface to another surface of the same FOURCC
2335
 * Driver supports bltting any FOURCC surface to another surface of the same FOURCC
2328
 *)
2336
 *)
2329
  DDCAPS2_COPYFOURCC              = $00008000;
2337
  DDCAPS2_COPYFOURCC              = $00008000;
2330
 
2338
 
2331
 
2339
 
2332
(*
2340
(*
2333
 * Driver supports loadable gamma ramps for the primary surface
2341
 * Driver supports loadable gamma ramps for the primary surface
2334
 *)
2342
 *)
2335
  DDCAPS2_PRIMARYGAMMA            = $00020000;
2343
  DDCAPS2_PRIMARYGAMMA            = $00020000;
2336
 
2344
 
2337
(*
2345
(*
2338
 * Driver can render in windowed mode.
2346
 * Driver can render in windowed mode.
2339
 *)
2347
 *)
2340
  DDCAPS2_CANRENDERWINDOWED       = $00080000;
2348
  DDCAPS2_CANRENDERWINDOWED       = $00080000;
2341
 
2349
 
2342
(*
2350
(*
2343
 * A calibrator is available to adjust the gamma ramp according to the
2351
 * A calibrator is available to adjust the gamma ramp according to the
2344
 * physical display properties so that the result will be identical on
2352
 * physical display properties so that the result will be identical on
2345
 * all calibrated systems.
2353
 * all calibrated systems.
2346
 *)
2354
 *)
2347
  DDCAPS2_CANCALIBRATEGAMMA       = $00100000;
2355
  DDCAPS2_CANCALIBRATEGAMMA       = $00100000;
2348
 
2356
 
2349
(*
2357
(*
2350
 * Indicates that the driver will respond to DDFLIP_INTERVALn flags
2358
 * Indicates that the driver will respond to DDFLIP_INTERVALn flags
2351
 *)
2359
 *)
2352
  DDCAPS2_FLIPINTERVAL            = $00200000;
2360
  DDCAPS2_FLIPINTERVAL            = $00200000;
2353
 
2361
 
2354
(*
2362
(*
2355
 * Indicates that the driver will respond to DDFLIP_NOVSYNC
2363
 * Indicates that the driver will respond to DDFLIP_NOVSYNC
2356
 *)
2364
 *)
2357
   DDCAPS2_FLIPNOVSYNC             = $00400000;
2365
   DDCAPS2_FLIPNOVSYNC             = $00400000;
2358
 
2366
 
2359
(*
2367
(*
2360
 * Driver supports management of video memory, if this flag is ON,
2368
 * Driver supports management of video memory, if this flag is ON,
2361
 * driver manages the texture if requested with DDSCAPS2_TEXTUREMANAGE on
2369
 * driver manages the texture if requested with DDSCAPS2_TEXTUREMANAGE on
2362
 * DirectX manages the texture if this flag is OFF and surface has DDSCAPS2_TEXTUREMANAGE on
2370
 * DirectX manages the texture if this flag is OFF and surface has DDSCAPS2_TEXTUREMANAGE on
2363
 *)
2371
 *)
2364
  DDCAPS2_CANMANAGETEXTURE        = $00800000;
2372
  DDCAPS2_CANMANAGETEXTURE        = $00800000;
2365
 
2373
 
2366
(*
2374
(*
2367
 * The Direct3D texture manager uses this cap to decide whether to put managed
2375
 * The Direct3D texture manager uses this cap to decide whether to put managed
2368
 * surfaces in non-local video memory. If the cap is set, the texture manager will
2376
 * surfaces in non-local video memory. If the cap is set, the texture manager will
2369
 * put managed surfaces in non-local vidmem. Drivers that cannot texture from
2377
 * put managed surfaces in non-local vidmem. Drivers that cannot texture from
2370
 * local vidmem SHOULD NOT set this cap.
2378
 * local vidmem SHOULD NOT set this cap.
2371
 *)
2379
 *)
2372
  DDCAPS2_TEXMANINNONLOCALVIDMEM  = $01000000;
2380
  DDCAPS2_TEXMANINNONLOCALVIDMEM  = $01000000;
2373
 
2381
 
2374
(*
2382
(*
2375
 * Indicates that the driver supports DX7 type of stereo in at least one mode (which may
2383
 * Indicates that the driver supports DX7 type of stereo in at least one mode (which may
2376
 * not necessarily be the current mode). Applications should use IDirectDraw7 (or higher)
2384
 * not necessarily be the current mode). Applications should use IDirectDraw7 (or higher)
2377
 * ::EnumDisplayModes and check the DDSURFACEDESC.ddsCaps.dwCaps2 field for the presence of
2385
 * ::EnumDisplayModes and check the DDSURFACEDESC.ddsCaps.dwCaps2 field for the presence of
2378
 * DDSCAPS2_STEREOSURFACELEFT to check if a particular mode supports stereo. The application
2386
 * DDSCAPS2_STEREOSURFACELEFT to check if a particular mode supports stereo. The application
2379
 * can also use IDirectDraw7(or higher)::GetDisplayMode to check the current mode.
2387
 * can also use IDirectDraw7(or higher)::GetDisplayMode to check the current mode.
2380
 *)
2388
 *)
2381
  DDCAPS2_STEREO                  = $02000000;
2389
  DDCAPS2_STEREO                  = $02000000;
2382
 
2390
 
2383
(*
2391
(*
2384
 * This caps bit is intended for internal DirectDraw use.
2392
 * This caps bit is intended for internal DirectDraw use.
2385
 * -It is only valid if DDCAPS2_NONLOCALVIDMEMCAPS is set.
2393
 * -It is only valid if DDCAPS2_NONLOCALVIDMEMCAPS is set.
2386
 * -If this bit is set, then DDCAPS_CANBLTSYSMEM MUST be set by the driver (and
2394
 * -If this bit is set, then DDCAPS_CANBLTSYSMEM MUST be set by the driver (and
2387
 *  all the assoicated system memory blt caps must be correct).
2395
 *  all the assoicated system memory blt caps must be correct).
2388
 * -It implies that the system->video blt caps in DDCAPS also apply to system to
2396
 * -It implies that the system->video blt caps in DDCAPS also apply to system to
2389
 *  nonlocal blts. I.e. the dwSVBCaps, dwSVBCKeyCaps, dwSVBFXCaps and dwSVBRops
2397
 *  nonlocal blts. I.e. the dwSVBCaps, dwSVBCKeyCaps, dwSVBFXCaps and dwSVBRops
2390
 *  members of DDCAPS (DDCORECAPS) are filled in correctly.
2398
 *  members of DDCAPS (DDCORECAPS) are filled in correctly.
2391
 * -Any blt from system to nonlocal memory that matches these caps bits will
2399
 * -Any blt from system to nonlocal memory that matches these caps bits will
2392
 *  be passed to the driver.
2400
 *  be passed to the driver.
2393
 *
2401
 *
2394
 * NOTE: This is intended to enable the driver itself to do efficient reordering
2402
 * NOTE: This is intended to enable the driver itself to do efficient reordering
2395
 * of textures. This is NOT meant to imply that hardware can write into AGP memory.
2403
 * of textures. This is NOT meant to imply that hardware can write into AGP memory.
2396
 * This operation is not currently supported.
2404
 * This operation is not currently supported.
2397
 *)
2405
 *)
2398
  DDCAPS2_SYSTONONLOCAL_AS_SYSTOLOCAL   = $04000000;
2406
  DDCAPS2_SYSTONONLOCAL_AS_SYSTOLOCAL   = $04000000;
2399
 
2407
 
2400
(****************************************************************************
2408
(****************************************************************************
2401
 *
2409
 *
2402
 * DIRECTDRAW FX ALPHA CAPABILITY FLAGS
2410
 * DIRECTDRAW FX ALPHA CAPABILITY FLAGS
2403
 *
2411
 *
2404
 ****************************************************************************)
2412
 ****************************************************************************)
2405
 
2413
 
2406
(*
2414
(*
2407
 * Supports alpha blending around the edge of a source color keyed surface.
2415
 * Supports alpha blending around the edge of a source color keyed surface.
2408
 * For Blt.
2416
 * For Blt.
2409
 *)
2417
 *)
2410
  DDFXALPHACAPS_BLTALPHAEDGEBLEND         = $00000001;
2418
  DDFXALPHACAPS_BLTALPHAEDGEBLEND         = $00000001;
2411
 
2419
 
2412
(*
2420
(*
2413
 * Supports alpha information in the pixel format.  The bit depth of alpha
2421
 * Supports alpha information in the pixel format.  The bit depth of alpha
2414
 * information in the pixel format can be 1,2,4, or 8.  The alpha value becomes
2422
 * information in the pixel format can be 1,2,4, or 8.  The alpha value becomes
2415
 * more opaque as the alpha value increases.  (0 is transparent.)
2423
 * more opaque as the alpha value increases.  (0 is transparent.)
2416
 * For Blt.
2424
 * For Blt.
2417
 *)
2425
 *)
2418
  DDFXALPHACAPS_BLTALPHAPIXELS            = $00000002;
2426
  DDFXALPHACAPS_BLTALPHAPIXELS            = $00000002;
2419
 
2427
 
2420
(*
2428
(*
2421
 * Supports alpha information in the pixel format.  The bit depth of alpha
2429
 * Supports alpha information in the pixel format.  The bit depth of alpha
2422
 * information in the pixel format can be 1,2,4, or 8.  The alpha value
2430
 * information in the pixel format can be 1,2,4, or 8.  The alpha value
2423
 * becomes more transparent as the alpha value increases.  (0 is opaque.)
2431
 * becomes more transparent as the alpha value increases.  (0 is opaque.)
2424
 * This flag can only be set if DDCAPS_ALPHA is set.
2432
 * This flag can only be set if DDCAPS_ALPHA is set.
2425
 * For Blt.
2433
 * For Blt.
2426
 *)
2434
 *)
2427
  DDFXALPHACAPS_BLTALPHAPIXELSNEG         = $00000004;
2435
  DDFXALPHACAPS_BLTALPHAPIXELSNEG         = $00000004;
2428
 
2436
 
2429
(*
2437
(*
2430
 * Supports alpha only surfaces.  The bit depth of an alpha only surface can be
2438
 * Supports alpha only surfaces.  The bit depth of an alpha only surface can be
2431
 * 1,2,4, or 8.  The alpha value becomes more opaque as the alpha value increases.
2439
 * 1,2,4, or 8.  The alpha value becomes more opaque as the alpha value increases.
2432
 * (0 is transparent.)
2440
 * (0 is transparent.)
2433
 * For Blt.
2441
 * For Blt.
2434
 *)
2442
 *)
2435
  DDFXALPHACAPS_BLTALPHASURFACES          = $00000008;
2443
  DDFXALPHACAPS_BLTALPHASURFACES          = $00000008;
2436
 
2444
 
2437
(*
2445
(*
2438
 * The depth of the alpha channel data can range can be 1,2,4, or 8.
2446
 * The depth of the alpha channel data can range can be 1,2,4, or 8.
2439
 * The NEG suffix indicates that this alpha channel becomes more transparent
2447
 * The NEG suffix indicates that this alpha channel becomes more transparent
2440
 * as the alpha value increases. (0 is opaque.)  This flag can only be set if
2448
 * as the alpha value increases. (0 is opaque.)  This flag can only be set if
2441
 * DDCAPS_ALPHA is set.
2449
 * DDCAPS_ALPHA is set.
2442
 * For Blt.
2450
 * For Blt.
2443
 *)
2451
 *)
2444
  DDFXALPHACAPS_BLTALPHASURFACESNEG       = $00000010;
2452
  DDFXALPHACAPS_BLTALPHASURFACESNEG       = $00000010;
2445
 
2453
 
2446
(*
2454
(*
2447
 * Supports alpha blending around the edge of a source color keyed surface.
2455
 * Supports alpha blending around the edge of a source color keyed surface.
2448
 * For Overlays.
2456
 * For Overlays.
2449
 *)
2457
 *)
2450
  DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND     = $00000020;
2458
  DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND     = $00000020;
2451
 
2459
 
2452
(*
2460
(*
2453
 * Supports alpha information in the pixel format.  The bit depth of alpha
2461
 * Supports alpha information in the pixel format.  The bit depth of alpha
2454
 * information in the pixel format can be 1,2,4, or 8.  The alpha value becomes
2462
 * information in the pixel format can be 1,2,4, or 8.  The alpha value becomes
2455
 * more opaque as the alpha value increases.  (0 is transparent.)
2463
 * more opaque as the alpha value increases.  (0 is transparent.)
2456
 * For Overlays.
2464
 * For Overlays.
2457
 *)
2465
 *)
2458
  DDFXALPHACAPS_OVERLAYALPHAPIXELS        = $00000040;
2466
  DDFXALPHACAPS_OVERLAYALPHAPIXELS        = $00000040;
2459
 
2467
 
2460
(*
2468
(*
2461
 * Supports alpha information in the pixel format.  The bit depth of alpha
2469
 * Supports alpha information in the pixel format.  The bit depth of alpha
2462
 * information in the pixel format can be 1,2,4, or 8.  The alpha value
2470
 * information in the pixel format can be 1,2,4, or 8.  The alpha value
2463
 * becomes more transparent as the alpha value increases.  (0 is opaque.)
2471
 * becomes more transparent as the alpha value increases.  (0 is opaque.)
2464
 * This flag can only be set if DDCAPS_ALPHA is set.
2472
 * This flag can only be set if DDCAPS_ALPHA is set.
2465
 * For Overlays.
2473
 * For Overlays.
2466
 *)
2474
 *)
2467
  DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG     = $00000080;
2475
  DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG     = $00000080;
2468
 
2476
 
2469
(*
2477
(*
2470
 * Supports alpha only surfaces.  The bit depth of an alpha only surface can be
2478
 * Supports alpha only surfaces.  The bit depth of an alpha only surface can be
2471
 * 1,2,4, or 8.  The alpha value becomes more opaque as the alpha value increases.
2479
 * 1,2,4, or 8.  The alpha value becomes more opaque as the alpha value increases.
2472
 * (0 is transparent.)
2480
 * (0 is transparent.)
2473
 * For Overlays.
2481
 * For Overlays.
2474
 *)
2482
 *)
2475
  DDFXALPHACAPS_OVERLAYALPHASURFACES      = $00000100;
2483
  DDFXALPHACAPS_OVERLAYALPHASURFACES      = $00000100;
2476
 
2484
 
2477
(*
2485
(*
2478
 * The depth of the alpha channel data can range can be 1,2,4, or 8.  
2486
 * The depth of the alpha channel data can range can be 1,2,4, or 8.  
2479
 * The NEG suffix indicates that this alpha channel becomes more transparent
2487
 * The NEG suffix indicates that this alpha channel becomes more transparent
2480
 * as the alpha value increases. (0 is opaque.)  This flag can only be set if
2488
 * as the alpha value increases. (0 is opaque.)  This flag can only be set if
2481
 * DDCAPS_ALPHA is set.
2489
 * DDCAPS_ALPHA is set.
2482
 * For Overlays.
2490
 * For Overlays.
2483
 *)
2491
 *)
2484
  DDFXALPHACAPS_OVERLAYALPHASURFACESNEG   = $00000200;
2492
  DDFXALPHACAPS_OVERLAYALPHASURFACESNEG   = $00000200;
2485
 
2493
 
2486
(****************************************************************************
2494
(****************************************************************************
2487
 *
2495
 *
2488
 * DIRECTDRAW FX CAPABILITY FLAGS
2496
 * DIRECTDRAW FX CAPABILITY FLAGS
2489
 *
2497
 *
2490
 ****************************************************************************)
2498
 ****************************************************************************)
2491
 
2499
 
2492
(*
2500
(*
2493
 * Uses arithmetic operations to stretch and shrink surfaces during blt
2501
 * Uses arithmetic operations to stretch and shrink surfaces during blt
2494
 * rather than pixel doubling techniques.  Along the Y axis.
2502
 * rather than pixel doubling techniques.  Along the Y axis.
2495
 *)
2503
 *)
2496
  DDFXCAPS_BLTARITHSTRETCHY       = $00000020;
2504
  DDFXCAPS_BLTARITHSTRETCHY       = $00000020;
2497
 
2505
 
2498
(*
2506
(*
2499
 * Uses arithmetic operations to stretch during blt
2507
 * Uses arithmetic operations to stretch during blt
2500
 * rather than pixel doubling techniques.  Along the Y axis. Only
2508
 * rather than pixel doubling techniques.  Along the Y axis. Only
2501
 * works for x1, x2, etc.
2509
 * works for x1, x2, etc.
2502
 *)
2510
 *)
2503
  DDFXCAPS_BLTARITHSTRETCHYN      = $00000010;
2511
  DDFXCAPS_BLTARITHSTRETCHYN      = $00000010;
2504
 
2512
 
2505
(*
2513
(*
2506
 * Supports mirroring left to right in blt.
2514
 * Supports mirroring left to right in blt.
2507
 *)
2515
 *)
2508
  DDFXCAPS_BLTMIRRORLEFTRIGHT     = $00000040;
2516
  DDFXCAPS_BLTMIRRORLEFTRIGHT     = $00000040;
2509
 
2517
 
2510
(*
2518
(*
2511
 * Supports mirroring top to bottom in blt.
2519
 * Supports mirroring top to bottom in blt.
2512
 *)
2520
 *)
2513
  DDFXCAPS_BLTMIRRORUPDOWN        = $00000080;
2521
  DDFXCAPS_BLTMIRRORUPDOWN        = $00000080;
2514
 
2522
 
2515
(*
2523
(*
2516
 * Supports arbitrary rotation for blts.
2524
 * Supports arbitrary rotation for blts.
2517
 *)
2525
 *)
2518
  DDFXCAPS_BLTROTATION            = $00000100;
2526
  DDFXCAPS_BLTROTATION            = $00000100;
2519
 
2527
 
2520
(*
2528
(*
2521
 * Supports 90 degree rotations for blts.
2529
 * Supports 90 degree rotations for blts.
2522
 *)
2530
 *)
2523
   DDFXCAPS_BLTROTATION90          = $00000200;
2531
   DDFXCAPS_BLTROTATION90          = $00000200;
2524
 
2532
 
2525
(*
2533
(*
2526
 * DirectDraw supports arbitrary shrinking of a surface along the
2534
 * DirectDraw supports arbitrary shrinking of a surface along the
2527
 * x axis (horizontal direction) for blts.
2535
 * x axis (horizontal direction) for blts.
2528
 *)
2536
 *)
2529
  DDFXCAPS_BLTSHRINKX             = $00000400;
2537
  DDFXCAPS_BLTSHRINKX             = $00000400;
2530
 
2538
 
2531
(*
2539
(*
2532
 * DirectDraw supports integer shrinking (1x,2x,) of a surface
2540
 * DirectDraw supports integer shrinking (1x,2x,) of a surface
2533
 * along the x axis (horizontal direction) for blts.
2541
 * along the x axis (horizontal direction) for blts.
2534
 *)
2542
 *)
2535
  DDFXCAPS_BLTSHRINKXN            = $00000800;
2543
  DDFXCAPS_BLTSHRINKXN            = $00000800;
2536
 
2544
 
2537
(*
2545
(*
2538
 * DirectDraw supports arbitrary shrinking of a surface along the
2546
 * DirectDraw supports arbitrary shrinking of a surface along the
2539
 * y axis (horizontal direction) for blts.  
2547
 * y axis (horizontal direction) for blts.  
2540
 *)
2548
 *)
2541
  DDFXCAPS_BLTSHRINKY             = $00001000;
2549
  DDFXCAPS_BLTSHRINKY             = $00001000;
2542
 
2550
 
2543
(*
2551
(*
2544
 * DirectDraw supports integer shrinking (1x,2x,) of a surface
2552
 * DirectDraw supports integer shrinking (1x,2x,) of a surface
2545
 * along the y axis (vertical direction) for blts.
2553
 * along the y axis (vertical direction) for blts.
2546
 *)
2554
 *)
2547
  DDFXCAPS_BLTSHRINKYN            = $00002000;
2555
  DDFXCAPS_BLTSHRINKYN            = $00002000;
2548
 
2556
 
2549
(*
2557
(*
2550
 * DirectDraw supports arbitrary stretching of a surface along the
2558
 * DirectDraw supports arbitrary stretching of a surface along the
2551
 * x axis (horizontal direction) for blts.
2559
 * x axis (horizontal direction) for blts.
2552
 *)
2560
 *)
2553
  DDFXCAPS_BLTSTRETCHX            = $00004000;
2561
  DDFXCAPS_BLTSTRETCHX            = $00004000;
2554
 
2562
 
2555
(*
2563
(*
2556
 * DirectDraw supports integer stretching (1x,2x,) of a surface
2564
 * DirectDraw supports integer stretching (1x,2x,) of a surface
2557
 * along the x axis (horizontal direction) for blts.
2565
 * along the x axis (horizontal direction) for blts.
2558
 *)
2566
 *)
2559
  DDFXCAPS_BLTSTRETCHXN           = $00008000;
2567
  DDFXCAPS_BLTSTRETCHXN           = $00008000;
2560
 
2568
 
2561
(*
2569
(*
2562
 * DirectDraw supports arbitrary stretching of a surface along the
2570
 * DirectDraw supports arbitrary stretching of a surface along the
2563
 * y axis (horizontal direction) for blts.  
2571
 * y axis (horizontal direction) for blts.  
2564
 *)
2572
 *)
2565
  DDFXCAPS_BLTSTRETCHY            = $00010000;
2573
  DDFXCAPS_BLTSTRETCHY            = $00010000;
2566
 
2574
 
2567
(*
2575
(*
2568
 * DirectDraw supports integer stretching (1x,2x,) of a surface
2576
 * DirectDraw supports integer stretching (1x,2x,) of a surface
2569
 * along the y axis (vertical direction) for blts.  
2577
 * along the y axis (vertical direction) for blts.  
2570
 *)
2578
 *)
2571
  DDFXCAPS_BLTSTRETCHYN           = $00020000;
2579
  DDFXCAPS_BLTSTRETCHYN           = $00020000;
2572
 
2580
 
2573
(*
2581
(*
2574
 * Uses arithmetic operations to stretch and shrink surfaces during
2582
 * Uses arithmetic operations to stretch and shrink surfaces during
2575
 * overlay rather than pixel doubling techniques.  Along the Y axis
2583
 * overlay rather than pixel doubling techniques.  Along the Y axis
2576
 * for overlays.
2584
 * for overlays.
2577
 *)
2585
 *)
2578
  DDFXCAPS_OVERLAYARITHSTRETCHY   = $00040000;
2586
  DDFXCAPS_OVERLAYARITHSTRETCHY   = $00040000;
2579
 
2587
 
2580
(*
2588
(*
2581
 * Uses arithmetic operations to stretch surfaces during
2589
 * Uses arithmetic operations to stretch surfaces during
2582
 * overlay rather than pixel doubling techniques.  Along the Y axis
2590
 * overlay rather than pixel doubling techniques.  Along the Y axis
2583
 * for overlays. Only works for x1, x2, etc.
2591
 * for overlays. Only works for x1, x2, etc.
2584
 *)
2592
 *)
2585
  DDFXCAPS_OVERLAYARITHSTRETCHYN  = $00000008;
2593
  DDFXCAPS_OVERLAYARITHSTRETCHYN  = $00000008;
2586
 
2594
 
2587
(*
2595
(*
2588
 * DirectDraw supports arbitrary shrinking of a surface along the
2596
 * DirectDraw supports arbitrary shrinking of a surface along the
2589
 * x axis (horizontal direction) for overlays.
2597
 * x axis (horizontal direction) for overlays.
2590
 *)
2598
 *)
2591
  DDFXCAPS_OVERLAYSHRINKX         = $00080000;
2599
  DDFXCAPS_OVERLAYSHRINKX         = $00080000;
2592
 
2600
 
2593
(*
2601
(*
2594
 * DirectDraw supports integer shrinking (1x,2x,) of a surface
2602
 * DirectDraw supports integer shrinking (1x,2x,) of a surface
2595
 * along the x axis (horizontal direction) for overlays.
2603
 * along the x axis (horizontal direction) for overlays.
2596
 *)
2604
 *)
2597
  DDFXCAPS_OVERLAYSHRINKXN        = $00100000;
2605
  DDFXCAPS_OVERLAYSHRINKXN        = $00100000;
2598
 
2606
 
2599
(*
2607
(*
2600
 * DirectDraw supports arbitrary shrinking of a surface along the
2608
 * DirectDraw supports arbitrary shrinking of a surface along the
2601
 * y axis (horizontal direction) for overlays.
2609
 * y axis (horizontal direction) for overlays.
2602
 *)
2610
 *)
2603
  DDFXCAPS_OVERLAYSHRINKY         = $00200000;
2611
  DDFXCAPS_OVERLAYSHRINKY         = $00200000;
2604
 
2612
 
2605
(*
2613
(*
2606
 * DirectDraw supports integer shrinking (1x,2x,) of a surface
2614
 * DirectDraw supports integer shrinking (1x,2x,) of a surface
2607
 * along the y axis (vertical direction) for overlays.  
2615
 * along the y axis (vertical direction) for overlays.  
2608
 *)
2616
 *)
2609
  DDFXCAPS_OVERLAYSHRINKYN        = $00400000;
2617
  DDFXCAPS_OVERLAYSHRINKYN        = $00400000;
2610
 
2618
 
2611
(*
2619
(*
2612
 * DirectDraw supports arbitrary stretching of a surface along the
2620
 * DirectDraw supports arbitrary stretching of a surface along the
2613
 * x axis (horizontal direction) for overlays.
2621
 * x axis (horizontal direction) for overlays.
2614
 *)
2622
 *)
2615
  DDFXCAPS_OVERLAYSTRETCHX        = $00800000;
2623
  DDFXCAPS_OVERLAYSTRETCHX        = $00800000;
2616
 
2624
 
2617
(*
2625
(*
2618
 * DirectDraw supports integer stretching (1x,2x,) of a surface
2626
 * DirectDraw supports integer stretching (1x,2x,) of a surface
2619
 * along the x axis (horizontal direction) for overlays.
2627
 * along the x axis (horizontal direction) for overlays.
2620
 *)
2628
 *)
2621
  DDFXCAPS_OVERLAYSTRETCHXN       = $01000000;
2629
  DDFXCAPS_OVERLAYSTRETCHXN       = $01000000;
2622
 
2630
 
2623
(*
2631
(*
2624
 * DirectDraw supports arbitrary stretching of a surface along the
2632
 * DirectDraw supports arbitrary stretching of a surface along the
2625
 * y axis (horizontal direction) for overlays.  
2633
 * y axis (horizontal direction) for overlays.  
2626
 *)
2634
 *)
2627
  DDFXCAPS_OVERLAYSTRETCHY        = $02000000;
2635
  DDFXCAPS_OVERLAYSTRETCHY        = $02000000;
2628
 
2636
 
2629
(*
2637
(*
2630
 * DirectDraw supports integer stretching (1x,2x,) of a surface
2638
 * DirectDraw supports integer stretching (1x,2x,) of a surface
2631
 * along the y axis (vertical direction) for overlays.  
2639
 * along the y axis (vertical direction) for overlays.  
2632
 *)
2640
 *)
2633
  DDFXCAPS_OVERLAYSTRETCHYN       = $04000000;
2641
  DDFXCAPS_OVERLAYSTRETCHYN       = $04000000;
2634
 
2642
 
2635
(*
2643
(*
2636
 * DirectDraw supports mirroring of overlays across the vertical axis
2644
 * DirectDraw supports mirroring of overlays across the vertical axis
2637
 *)
2645
 *)
2638
  DDFXCAPS_OVERLAYMIRRORLEFTRIGHT = $08000000;
2646
  DDFXCAPS_OVERLAYMIRRORLEFTRIGHT = $08000000;
2639
 
2647
 
2640
(*
2648
(*
2641
 * DirectDraw supports mirroring of overlays across the horizontal axis
2649
 * DirectDraw supports mirroring of overlays across the horizontal axis
2642
 *)
2650
 *)
2643
  DDFXCAPS_OVERLAYMIRRORUPDOWN    = $10000000;
2651
  DDFXCAPS_OVERLAYMIRRORUPDOWN    = $10000000;
2644
 
2652
 
2645
(*
2653
(*
2646
 * Driver can do alpha blending for blits.
2654
 * Driver can do alpha blending for blits.
2647
 *)
2655
 *)
2648
  DDFXCAPS_BLTALPHA             = $00000001;
2656
  DDFXCAPS_BLTALPHA             = $00000001;
2649
 
2657
 
2650
(*
2658
(*
2651
 * Driver can do geometric transformations (or warps) for blits.
2659
 * Driver can do geometric transformations (or warps) for blits.
2652
 *)
2660
 *)
2653
  DDFXCAPS_BLTTRANSFORM         = $00000002;
2661
  DDFXCAPS_BLTTRANSFORM         = $00000002;
2654
 
2662
 
2655
(*
2663
(*
2656
 * Driver can do surface-reconstruction filtering for warped blits.
2664
 * Driver can do surface-reconstruction filtering for warped blits.
2657
 *)
2665
 *)
2658
  DDFXCAPS_BLTFILTER           = DDFXCAPS_BLTARITHSTRETCHY;
2666
  DDFXCAPS_BLTFILTER           = DDFXCAPS_BLTARITHSTRETCHY;
2659
 
2667
 
2660
(*
2668
(*
2661
 * Driver can do alpha blending for overlays.
2669
 * Driver can do alpha blending for overlays.
2662
 *)
2670
 *)
2663
  DDFXCAPS_OVERLAYALPHA                 = $00000004;
2671
  DDFXCAPS_OVERLAYALPHA                 = $00000004;
2664
 
2672
 
2665
(*
2673
(*
2666
 * Driver can do geometric transformations (or warps) for overlays.
2674
 * Driver can do geometric transformations (or warps) for overlays.
2667
 *)
2675
 *)
2668
  DDFXCAPS_OVERLAYTRANSFORM     = $20000000;
2676
  DDFXCAPS_OVERLAYTRANSFORM     = $20000000;
2669
 
2677
 
2670
(*
2678
(*
2671
 * Driver can do surface-reconstruction filtering for warped overlays.
2679
 * Driver can do surface-reconstruction filtering for warped overlays.
2672
 *)
2680
 *)
2673
  DDFXCAPS_OVERLAYFILTER              = DDFXCAPS_OVERLAYARITHSTRETCHY;
2681
  DDFXCAPS_OVERLAYFILTER              = DDFXCAPS_OVERLAYARITHSTRETCHY;
2674
 
2682
 
2675
(****************************************************************************
2683
(****************************************************************************
2676
 *
2684
 *
2677
 * DIRECTDRAW STEREO VIEW CAPABILITIES
2685
 * DIRECTDRAW STEREO VIEW CAPABILITIES
2678
 *
2686
 *
2679
 ****************************************************************************)
2687
 ****************************************************************************)
2680
 
2688
 
2681
(*
2689
(*
2682
 * This flag used to be DDSVCAPS_ENIGMA, which is now obsolete
2690
 * This flag used to be DDSVCAPS_ENIGMA, which is now obsolete
2683
 * The stereo view is accomplished via enigma encoding.
2691
 * The stereo view is accomplished via enigma encoding.
2684
 *)
2692
 *)
2685
  DDSVCAPS_RESERVED1                 = $00000001;
2693
  DDSVCAPS_RESERVED1                 = $00000001;
2686
  DDSVCAPS_ENIGMA                 = DDSVCAPS_RESERVED1;
2694
  DDSVCAPS_ENIGMA                 = DDSVCAPS_RESERVED1;
2687
 
2695
 
2688
(*
2696
(*
2689
 * This flag used to be DDSVCAPS_FLICKER, which is now obsolete
2697
 * This flag used to be DDSVCAPS_FLICKER, which is now obsolete
2690
 * The stereo view is accomplished via high frequency flickering.
2698
 * The stereo view is accomplished via high frequency flickering.
2691
 *)
2699
 *)
2692
  DDSVCAPS_RESERVED2                = $00000002;
2700
  DDSVCAPS_RESERVED2                = $00000002;
2693
  DDSVCAPS_FLICKER                = DDSVCAPS_RESERVED2;
2701
  DDSVCAPS_FLICKER                = DDSVCAPS_RESERVED2;
2694
 
2702
 
2695
(*
2703
(*
2696
 * This flag used to be DDSVCAPS_REDBLUE, which is now obsolete
2704
 * This flag used to be DDSVCAPS_REDBLUE, which is now obsolete
2697
 * The stereo view is accomplished via red and blue filters applied
2705
 * The stereo view is accomplished via red and blue filters applied
2698
 * to the left and right eyes.  All images must adapt their colorspaces
2706
 * to the left and right eyes.  All images must adapt their colorspaces
2699
 * for this process.
2707
 * for this process.
2700
 *)
2708
 *)
2701
  DDSVCAPS_RESERVED3                = $00000004;
2709
  DDSVCAPS_RESERVED3                = $00000004;
2702
  DDSVCAPS_REDBLUE                = DDSVCAPS_RESERVED3;
2710
  DDSVCAPS_REDBLUE                = DDSVCAPS_RESERVED3;
2703
 
2711
 
2704
(*
2712
(*
2705
 * This flag used to be DDSVCAPS_SPLIT, which is now obsolete
2713
 * This flag used to be DDSVCAPS_SPLIT, which is now obsolete
2706
 * The stereo view is accomplished with split screen technology.
2714
 * The stereo view is accomplished with split screen technology.
2707
 *)
2715
 *)
2708
  DDSVCAPS_RESERVED4                  = $00000008;
2716
  DDSVCAPS_RESERVED4                  = $00000008;
2709
  DDSVCAPS_SPLIT                  = DDSVCAPS_RESERVED4;
2717
  DDSVCAPS_SPLIT                  = DDSVCAPS_RESERVED4;
2710
 
2718
 
2711
(*
2719
(*
2712
 * The stereo view is accomplished with switching technology
2720
 * The stereo view is accomplished with switching technology
2713
 *)
2721
 *)
2714
  DDSVCAPS_STEREOSEQUENTIAL       = $00000010;
2722
  DDSVCAPS_STEREOSEQUENTIAL       = $00000010;
2715
 
2723
 
2716
(****************************************************************************
2724
(****************************************************************************
2717
 *
2725
 *
2718
 * DIRECTDRAWPALETTE CAPABILITIES
2726
 * DIRECTDRAWPALETTE CAPABILITIES
2719
 *
2727
 *
2720
 ****************************************************************************)
2728
 ****************************************************************************)
2721
 
2729
 
2722
(*
2730
(*
2723
 * Index is 4 bits.  There are sixteen color entries in the palette table.
2731
 * Index is 4 bits.  There are sixteen color entries in the palette table.
2724
 *)
2732
 *)
2725
  DDPCAPS_4BIT                    = $00000001;
2733
  DDPCAPS_4BIT                    = $00000001;
2726
 
2734
 
2727
(*
2735
(*
2728
 * Index is onto a 8 bit color index.  This field is only valid with the
2736
 * Index is onto a 8 bit color index.  This field is only valid with the
2729
 * DDPCAPS_1BIT, DDPCAPS_2BIT or DDPCAPS_4BIT capability and the target
2737
 * DDPCAPS_1BIT, DDPCAPS_2BIT or DDPCAPS_4BIT capability and the target
2730
 * surface is in 8bpp. Each color entry is one byte long and is an index
2738
 * surface is in 8bpp. Each color entry is one byte long and is an index
2731
 * into destination surface's 8bpp palette.
2739
 * into destination surface's 8bpp palette.
2732
 *)
2740
 *)
2733
  DDPCAPS_8BITENTRIES             = $00000002;
2741
  DDPCAPS_8BITENTRIES             = $00000002;
2734
 
2742
 
2735
(*
2743
(*
2736
 * Index is 8 bits.  There are 256 color entries in the palette table.
2744
 * Index is 8 bits.  There are 256 color entries in the palette table.
2737
 *)
2745
 *)
2738
  DDPCAPS_8BIT                    = $00000004;
2746
  DDPCAPS_8BIT                    = $00000004;
2739
 
2747
 
2740
(*
2748
(*
2741
 * Indicates that this DIRECTDRAWPALETTE should use the palette color array
2749
 * Indicates that this DIRECTDRAWPALETTE should use the palette color array
2742
 * passed into the lpDDColorArray parameter to initialize the DIRECTDRAWPALETTE
2750
 * passed into the lpDDColorArray parameter to initialize the DIRECTDRAWPALETTE
2743
 * object.
2751
 * object.
2744
 * This flag is obsolete. DirectDraw always initializes the color array from
2752
 * This flag is obsolete. DirectDraw always initializes the color array from
2745
 * the lpDDColorArray parameter. The definition remains for source-level
2753
 * the lpDDColorArray parameter. The definition remains for source-level
2746
 * compatibility.
2754
 * compatibility.
2747
 *)
2755
 *)
2748
  DDPCAPS_INITIALIZE              = $00000008;
2756
  DDPCAPS_INITIALIZE              = $00000008;
2749
 
2757
 
2750
(*
2758
(*
2751
 * This palette is the one attached to the primary surface.  Changing this
2759
 * This palette is the one attached to the primary surface.  Changing this
2752
 * table has immediate effect on the display unless DDPSETPAL_VSYNC is specified
2760
 * table has immediate effect on the display unless DDPSETPAL_VSYNC is specified
2753
 * and supported.
2761
 * and supported.
2754
 *)
2762
 *)
2755
  DDPCAPS_PRIMARYSURFACE          = $00000010;
2763
  DDPCAPS_PRIMARYSURFACE          = $00000010;
2756
 
2764
 
2757
(*
2765
(*
2758
 * This palette is the one attached to the primary surface left.  Changing
2766
 * This palette is the one attached to the primary surface left.  Changing
2759
 * this table has immediate effect on the display for the left eye unless
2767
 * this table has immediate effect on the display for the left eye unless
2760
 * DDPSETPAL_VSYNC is specified and supported.
2768
 * DDPSETPAL_VSYNC is specified and supported.
2761
 *)
2769
 *)
2762
  DDPCAPS_PRIMARYSURFACELEFT      = $00000020;
2770
  DDPCAPS_PRIMARYSURFACELEFT      = $00000020;
2763
 
2771
 
2764
(*
2772
(*
2765
 * This palette can have all 256 entries defined
2773
 * This palette can have all 256 entries defined
2766
 *)
2774
 *)
2767
  DDPCAPS_ALLOW256                = $00000040;
2775
  DDPCAPS_ALLOW256                = $00000040;
2768
 
2776
 
2769
(*
2777
(*
2770
 * This palette can have modifications to it synced with the monitors
2778
 * This palette can have modifications to it synced with the monitors
2771
 * refresh rate.
2779
 * refresh rate.
2772
 *)
2780
 *)
2773
  DDPCAPS_VSYNC                   = $00000080;
2781
  DDPCAPS_VSYNC                   = $00000080;
2774
 
2782
 
2775
(*
2783
(*
2776
 * Index is 1 bit.  There are two color entries in the palette table.
2784
 * Index is 1 bit.  There are two color entries in the palette table.
2777
 *)
2785
 *)
2778
  DDPCAPS_1BIT                    = $00000100;
2786
  DDPCAPS_1BIT                    = $00000100;
2779
 
2787
 
2780
(*
2788
(*
2781
 * Index is 2 bit.  There are four color entries in the palette table.
2789
 * Index is 2 bit.  There are four color entries in the palette table.
2782
 *)
2790
 *)
2783
  DDPCAPS_2BIT                    = $00000200;
2791
  DDPCAPS_2BIT                    = $00000200;
2784
 
2792
 
2785
(*
2793
(*
2786
 * The peFlags member of PALETTEENTRY denotes an 8 bit alpha value
2794
 * The peFlags member of PALETTEENTRY denotes an 8 bit alpha value
2787
 *)
2795
 *)
2788
  DDPCAPS_ALPHA                 = $00000400;
2796
  DDPCAPS_ALPHA                 = $00000400;
2789
 
2797
 
2790
(****************************************************************************
2798
(****************************************************************************
2791
 *
2799
 *
2792
 * DIRECTDRAWPALETTE SETENTRY CONSTANTS
2800
 * DIRECTDRAWPALETTE SETENTRY CONSTANTS
2793
 *
2801
 *
2794
 ****************************************************************************)
2802
 ****************************************************************************)
2795
 
2803
 
2796
 
2804
 
2797
(****************************************************************************
2805
(****************************************************************************
2798
 *
2806
 *
2799
 * DIRECTDRAWPALETTE GETENTRY CONSTANTS
2807
 * DIRECTDRAWPALETTE GETENTRY CONSTANTS
2800
 *
2808
 *
2801
 ****************************************************************************)
2809
 ****************************************************************************)
2802
 
2810
 
2803
(* 0 is the only legal value *)
2811
(* 0 is the only legal value *)
2804
 
2812
 
2805
(****************************************************************************
2813
(****************************************************************************
2806
 *
2814
 *
2807
 * DIRECTDRAWSURFACE SETPALETTE CONSTANTS
2815
 * DIRECTDRAWSURFACE SETPALETTE CONSTANTS
2808
 *
2816
 *
2809
 ****************************************************************************)
2817
 ****************************************************************************)
2810
 
2818
 
2811
(*
2819
(*
2812
 * The passed pointer is an IUnknown ptr. The cbData argument to SetPrivateData
2820
 * The passed pointer is an IUnknown ptr. The cbData argument to SetPrivateData
2813
 * must be set to sizeof(IUnknown^). DirectDraw will call AddRef through this
2821
 * must be set to sizeof(IUnknown^). DirectDraw will call AddRef through this
2814
 * pointer and Release when the private data is destroyed. This includes when
2822
 * pointer and Release when the private data is destroyed. This includes when
2815
 * the surface or palette is destroyed before such priovate data is destroyed.
2823
 * the surface or palette is destroyed before such priovate data is destroyed.
2816
 *)
2824
 *)
2817
  DDSPD_IUNKNOWNPOINTER           = $00000001;
2825
  DDSPD_IUNKNOWNPOINTER           = $00000001;
2818
 
2826
 
2819
(*
2827
(*
2820
 * Private data is only valid for the current state of the object,
2828
 * Private data is only valid for the current state of the object,
2821
 * as determined by the uniqueness value.
2829
 * as determined by the uniqueness value.
2822
 *)
2830
 *)
2823
  DDSPD_VOLATILE                  = $00000002;
2831
  DDSPD_VOLATILE                  = $00000002;
2824
 
2832
 
2825
(****************************************************************************
2833
(****************************************************************************
2826
 *
2834
 *
2827
 * DIRECTDRAWSURFACE SETPALETTE CONSTANTS
2835
 * DIRECTDRAWSURFACE SETPALETTE CONSTANTS
2828
 *
2836
 *
2829
 ****************************************************************************)
2837
 ****************************************************************************)
2830
 
2838
 
2831
 
2839
 
2832
(****************************************************************************
2840
(****************************************************************************
2833
 *
2841
 *
2834
 * DIRECTDRAW BITDEPTH CONSTANTS
2842
 * DIRECTDRAW BITDEPTH CONSTANTS
2835
 *
2843
 *
2836
 * NOTE:  These are only used to indicate supported bit depths.   These
2844
 * NOTE:  These are only used to indicate supported bit depths.   These
2837
 * are flags only, they are not to be used as an actual bit depth.   The
2845
 * are flags only, they are not to be used as an actual bit depth.   The
2838
 * absolute numbers 1, 2, 4, 8, 16, 24 and 32 are used to indicate actual
2846
 * absolute numbers 1, 2, 4, 8, 16, 24 and 32 are used to indicate actual
2839
 * bit depths in a surface or for changing the display mode.
2847
 * bit depths in a surface or for changing the display mode.
2840
 *
2848
 *
2841
 ****************************************************************************)
2849
 ****************************************************************************)
2842
 
2850
 
2843
(*
2851
(*
2844
 * 1 bit per pixel.
2852
 * 1 bit per pixel.
2845
 *)
2853
 *)
2846
  DDBD_1                  = $00004000;
2854
  DDBD_1                  = $00004000;
2847
 
2855
 
2848
(*
2856
(*
2849
 * 2 bits per pixel.
2857
 * 2 bits per pixel.
2850
 *)
2858
 *)
2851
  DDBD_2                  = $00002000;
2859
  DDBD_2                  = $00002000;
2852
 
2860
 
2853
(*
2861
(*
2854
 * 4 bits per pixel.
2862
 * 4 bits per pixel.
2855
 *)
2863
 *)
2856
  DDBD_4                  = $00001000;
2864
  DDBD_4                  = $00001000;
2857
 
2865
 
2858
(*
2866
(*
2859
 * 8 bits per pixel.
2867
 * 8 bits per pixel.
2860
 *)
2868
 *)
2861
  DDBD_8                  = $00000800;
2869
  DDBD_8                  = $00000800;
2862
 
2870
 
2863
(*
2871
(*
2864
 * 16 bits per pixel.
2872
 * 16 bits per pixel.
2865
 *)
2873
 *)
2866
  DDBD_16                 = $00000400;
2874
  DDBD_16                 = $00000400;
2867
 
2875
 
2868
(*
2876
(*
2869
 * 24 bits per pixel.
2877
 * 24 bits per pixel.
2870
 *)
2878
 *)
2871
  DDBD_24                 = $00000200;
2879
  DDBD_24                 = $00000200;
2872
 
2880
 
2873
(*
2881
(*
2874
 * 32 bits per pixel.
2882
 * 32 bits per pixel.
2875
 *)
2883
 *)
2876
  DDBD_32                 = $00000100;
2884
  DDBD_32                 = $00000100;
2877
 
2885
 
2878
(****************************************************************************
2886
(****************************************************************************
2879
 *
2887
 *
2880
 * DIRECTDRAWSURFACE SET/GET COLOR KEY FLAGS
2888
 * DIRECTDRAWSURFACE SET/GET COLOR KEY FLAGS
2881
 *
2889
 *
2882
 ****************************************************************************)
2890
 ****************************************************************************)
2883
 
2891
 
2884
(*
2892
(*
2885
 * Set if the structure contains a color space.  Not set if the structure
2893
 * Set if the structure contains a color space.  Not set if the structure
2886
 * contains a single color key.
2894
 * contains a single color key.
2887
 *)
2895
 *)
2888
  DDCKEY_COLORSPACE       = $00000001;
2896
  DDCKEY_COLORSPACE       = $00000001;
2889
 
2897
 
2890
(*
2898
(*
2891
 * Set if the structure specifies a color key or color space which is to be
2899
 * Set if the structure specifies a color key or color space which is to be
2892
 * used as a destination color key for blt operations.
2900
 * used as a destination color key for blt operations.
2893
 *)
2901
 *)
2894
  DDCKEY_DESTBLT          = $00000002;
2902
  DDCKEY_DESTBLT          = $00000002;
2895
 
2903
 
2896
(*
2904
(*
2897
 * Set if the structure specifies a color key or color space which is to be
2905
 * Set if the structure specifies a color key or color space which is to be
2898
 * used as a destination color key for overlay operations.
2906
 * used as a destination color key for overlay operations.
2899
 *)
2907
 *)
2900
  DDCKEY_DESTOVERLAY      = $00000004;
2908
  DDCKEY_DESTOVERLAY      = $00000004;
2901
 
2909
 
2902
(*
2910
(*
2903
 * Set if the structure specifies a color key or color space which is to be
2911
 * Set if the structure specifies a color key or color space which is to be
2904
 * used as a source color key for blt operations.
2912
 * used as a source color key for blt operations.
2905
 *)
2913
 *)
2906
  DDCKEY_SRCBLT           = $00000008;
2914
  DDCKEY_SRCBLT           = $00000008;
2907
 
2915
 
2908
(*
2916
(*
2909
 * Set if the structure specifies a color key or color space which is to be
2917
 * Set if the structure specifies a color key or color space which is to be
2910
 * used as a source color key for overlay operations.
2918
 * used as a source color key for overlay operations.
2911
 *)
2919
 *)
2912
  DDCKEY_SRCOVERLAY       = $00000010;
2920
  DDCKEY_SRCOVERLAY       = $00000010;
2913
 
2921
 
2914
 
2922
 
2915
(****************************************************************************
2923
(****************************************************************************
2916
 *
2924
 *
2917
 * DIRECTDRAW COLOR KEY CAPABILITY FLAGS
2925
 * DIRECTDRAW COLOR KEY CAPABILITY FLAGS
2918
 *
2926
 *
2919
 ****************************************************************************)
2927
 ****************************************************************************)
2920
 
2928
 
2921
(*
2929
(*
2922
 * Supports transparent blting using a color key to identify the replaceable
2930
 * Supports transparent blting using a color key to identify the replaceable
2923
 * bits of the destination surface for RGB colors.
2931
 * bits of the destination surface for RGB colors.
2924
 *)
2932
 *)
2925
  DDCKEYCAPS_DESTBLT                      = $00000001;
2933
  DDCKEYCAPS_DESTBLT                      = $00000001;
2926
 
2934
 
2927
(*
2935
(*
2928
 * Supports transparent blting using a color space to identify the replaceable
2936
 * Supports transparent blting using a color space to identify the replaceable
2929
 * bits of the destination surface for RGB colors.
2937
 * bits of the destination surface for RGB colors.
2930
 *)
2938
 *)
2931
  DDCKEYCAPS_DESTBLTCLRSPACE              = $00000002;
2939
  DDCKEYCAPS_DESTBLTCLRSPACE              = $00000002;
2932
 
2940
 
2933
(*
2941
(*
2934
 * Supports transparent blting using a color space to identify the replaceable
2942
 * Supports transparent blting using a color space to identify the replaceable
2935
 * bits of the destination surface for YUV colors.
2943
 * bits of the destination surface for YUV colors.
2936
 *)
2944
 *)
2937
  DDCKEYCAPS_DESTBLTCLRSPACEYUV           = $00000004;
2945
  DDCKEYCAPS_DESTBLTCLRSPACEYUV           = $00000004;
2938
 
2946
 
2939
(*
2947
(*
2940
 * Supports transparent blting using a color key to identify the replaceable
2948
 * Supports transparent blting using a color key to identify the replaceable
2941
 * bits of the destination surface for YUV colors.
2949
 * bits of the destination surface for YUV colors.
2942
 *)
2950
 *)
2943
  DDCKEYCAPS_DESTBLTYUV                   = $00000008;
2951
  DDCKEYCAPS_DESTBLTYUV                   = $00000008;
2944
 
2952
 
2945
(*
2953
(*
2946
 * Supports overlaying using colorkeying of the replaceable bits of the surface
2954
 * Supports overlaying using colorkeying of the replaceable bits of the surface
2947
 * being overlayed for RGB colors.
2955
 * being overlayed for RGB colors.
2948
 *)
2956
 *)
2949
  DDCKEYCAPS_DESTOVERLAY                  = $00000010;
2957
  DDCKEYCAPS_DESTOVERLAY                  = $00000010;
2950
 
2958
 
2951
(*
2959
(*
2952
 * Supports a color space as the color key for the destination for RGB colors.
2960
 * Supports a color space as the color key for the destination for RGB colors.
2953
 *)
2961
 *)
2954
  DDCKEYCAPS_DESTOVERLAYCLRSPACE          = $00000020;
2962
  DDCKEYCAPS_DESTOVERLAYCLRSPACE          = $00000020;
2955
 
2963
 
2956
(*
2964
(*
2957
 * Supports a color space as the color key for the destination for YUV colors.
2965
 * Supports a color space as the color key for the destination for YUV colors.
2958
 *)
2966
 *)
2959
  DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV       = $00000040;
2967
  DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV       = $00000040;
2960
 
2968
 
2961
(*
2969
(*
2962
 * Supports only one active destination color key value for visible overlay
2970
 * Supports only one active destination color key value for visible overlay
2963
 * surfaces.
2971
 * surfaces.
2964
 *)
2972
 *)
2965
  DDCKEYCAPS_DESTOVERLAYONEACTIVE         = $00000080;
2973
  DDCKEYCAPS_DESTOVERLAYONEACTIVE         = $00000080;
2966
 
2974
 
2967
(*
2975
(*
2968
 * Supports overlaying using colorkeying of the replaceable bits of the
2976
 * Supports overlaying using colorkeying of the replaceable bits of the
2969
 * surface being overlayed for YUV colors.
2977
 * surface being overlayed for YUV colors.
2970
 *)
2978
 *)
2971
  DDCKEYCAPS_DESTOVERLAYYUV               = $00000100;
2979
  DDCKEYCAPS_DESTOVERLAYYUV               = $00000100;
2972
 
2980
 
2973
(*
2981
(*
2974
 * Supports transparent blting using the color key for the source with
2982
 * Supports transparent blting using the color key for the source with
2975
 * this surface for RGB colors.
2983
 * this surface for RGB colors.
2976
 *)
2984
 *)
2977
  DDCKEYCAPS_SRCBLT                       = $00000200;
2985
  DDCKEYCAPS_SRCBLT                       = $00000200;
2978
 
2986
 
2979
(*
2987
(*
2980
 * Supports transparent blting using a color space for the source with
2988
 * Supports transparent blting using a color space for the source with
2981
 * this surface for RGB colors.
2989
 * this surface for RGB colors.
2982
 *)
2990
 *)
2983
  DDCKEYCAPS_SRCBLTCLRSPACE               = $00000400;
2991
  DDCKEYCAPS_SRCBLTCLRSPACE               = $00000400;
2984
 
2992
 
2985
(*
2993
(*
2986
 * Supports transparent blting using a color space for the source with
2994
 * Supports transparent blting using a color space for the source with
2987
 * this surface for YUV colors.
2995
 * this surface for YUV colors.
2988
 *)
2996
 *)
2989
  DDCKEYCAPS_SRCBLTCLRSPACEYUV            = $00000800;
2997
  DDCKEYCAPS_SRCBLTCLRSPACEYUV            = $00000800;
2990
 
2998
 
2991
(*
2999
(*
2992
 * Supports transparent blting using the color key for the source with
3000
 * Supports transparent blting using the color key for the source with
2993
 * this surface for YUV colors.
3001
 * this surface for YUV colors.
2994
 *)
3002
 *)
2995
  DDCKEYCAPS_SRCBLTYUV                    = $00001000;
3003
  DDCKEYCAPS_SRCBLTYUV                    = $00001000;
2996
 
3004
 
2997
(*
3005
(*
2998
 * Supports overlays using the color key for the source with this
3006
 * Supports overlays using the color key for the source with this
2999
 * overlay surface for RGB colors.
3007
 * overlay surface for RGB colors.
3000
 *)
3008
 *)
3001
  DDCKEYCAPS_SRCOVERLAY                   = $00002000;
3009
  DDCKEYCAPS_SRCOVERLAY                   = $00002000;
3002
 
3010
 
3003
(*
3011
(*
3004
 * Supports overlays using a color space as the source color key for
3012
 * Supports overlays using a color space as the source color key for
3005
 * the overlay surface for RGB colors.
3013
 * the overlay surface for RGB colors.
3006
 *)
3014
 *)
3007
  DDCKEYCAPS_SRCOVERLAYCLRSPACE           = $00004000;
3015
  DDCKEYCAPS_SRCOVERLAYCLRSPACE           = $00004000;
3008
 
3016
 
3009
(*
3017
(*
3010
 * Supports overlays using a color space as the source color key for
3018
 * Supports overlays using a color space as the source color key for
3011
 * the overlay surface for YUV colors.
3019
 * the overlay surface for YUV colors.
3012
 *)
3020
 *)
3013
  DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV        = $00008000;
3021
  DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV        = $00008000;
3014
 
3022
 
3015
(*
3023
(*
3016
 * Supports only one active source color key value for visible
3024
 * Supports only one active source color key value for visible
3017
 * overlay surfaces.
3025
 * overlay surfaces.
3018
 *)
3026
 *)
3019
  DDCKEYCAPS_SRCOVERLAYONEACTIVE          = $00010000;
3027
  DDCKEYCAPS_SRCOVERLAYONEACTIVE          = $00010000;
3020
 
3028
 
3021
(*
3029
(*
3022
 * Supports overlays using the color key for the source with this
3030
 * Supports overlays using the color key for the source with this
3023
 * overlay surface for YUV colors.
3031
 * overlay surface for YUV colors.
3024
 *)
3032
 *)
3025
  DDCKEYCAPS_SRCOVERLAYYUV                = $00020000;
3033
  DDCKEYCAPS_SRCOVERLAYYUV                = $00020000;
3026
 
3034
 
3027
(*
3035
(*
3028
 * there are no bandwidth trade-offs for using colorkey with an overlay
3036
 * there are no bandwidth trade-offs for using colorkey with an overlay
3029
 *)
3037
 *)
3030
  DDCKEYCAPS_NOCOSTOVERLAY                = $00040000;
3038
  DDCKEYCAPS_NOCOSTOVERLAY                = $00040000;
3031
 
3039
 
3032
 
3040
 
3033
(****************************************************************************
3041
(****************************************************************************
3034
 *
3042
 *
3035
 * DIRECTDRAW PIXELFORMAT FLAGS
3043
 * DIRECTDRAW PIXELFORMAT FLAGS
3036
 *
3044
 *
3037
 ****************************************************************************)
3045
 ****************************************************************************)
3038
 
3046
 
3039
(*
3047
(*
3040
 * The surface has alpha channel information in the pixel format.
3048
 * The surface has alpha channel information in the pixel format.
3041
 *)
3049
 *)
3042
  DDPF_ALPHAPIXELS                        = $00000001;
3050
  DDPF_ALPHAPIXELS                        = $00000001;
3043
 
3051
 
3044
(*
3052
(*
3045
 * The pixel format contains alpha only information
3053
 * The pixel format contains alpha only information
3046
 *)
3054
 *)
3047
  DDPF_ALPHA                              = $00000002;
3055
  DDPF_ALPHA                              = $00000002;
3048
 
3056
 
3049
(*
3057
(*
3050
 * The FourCC code is valid.
3058
 * The FourCC code is valid.
3051
 *)
3059
 *)
3052
  DDPF_FOURCC                             = $00000004;
3060
  DDPF_FOURCC                             = $00000004;
3053
 
3061
 
3054
(*
3062
(*
3055
 * The surface is 4-bit color indexed.
3063
 * The surface is 4-bit color indexed.
3056
 *)
3064
 *)
3057
  DDPF_PALETTEINDEXED4                    = $00000008;
3065
  DDPF_PALETTEINDEXED4                    = $00000008;
3058
 
3066
 
3059
(*
3067
(*
3060
 * The surface is indexed into a palette which stores indices
3068
 * The surface is indexed into a palette which stores indices
3061
 * into the destination surface's 8-bit palette.
3069
 * into the destination surface's 8-bit palette.
3062
 *)
3070
 *)
3063
  DDPF_PALETTEINDEXEDTO8                  = $00000010;
3071
  DDPF_PALETTEINDEXEDTO8                  = $00000010;
3064
 
3072
 
3065
(*
3073
(*
3066
 * The surface is 8-bit color indexed.
3074
 * The surface is 8-bit color indexed.
3067
 *)
3075
 *)
3068
  DDPF_PALETTEINDEXED8                    = $00000020;
3076
  DDPF_PALETTEINDEXED8                    = $00000020;
3069
 
3077
 
3070
(*
3078
(*
3071
 * The RGB data in the pixel format structure is valid.
3079
 * The RGB data in the pixel format structure is valid.
3072
 *)
3080
 *)
3073
  DDPF_RGB                                = $00000040;
3081
  DDPF_RGB                                = $00000040;
3074
 
3082
 
3075
(*
3083
(*
3076
 * The surface will accept pixel data in the format specified
3084
 * The surface will accept pixel data in the format specified
3077
 * and compress it during the write.
3085
 * and compress it during the write.
3078
 *)
3086
 *)
3079
  DDPF_COMPRESSED                         = $00000080;
3087
  DDPF_COMPRESSED                         = $00000080;
3080
 
3088
 
3081
(*
3089
(*
3082
 * The surface will accept RGB data and translate it during
3090
 * The surface will accept RGB data and translate it during
3083
 * the write to YUV data.  The format of the data to be written
3091
 * the write to YUV data.  The format of the data to be written
3084
 * will be contained in the pixel format structure.  The DDPF_RGB
3092
 * will be contained in the pixel format structure.  The DDPF_RGB
3085
 * flag will be set.
3093
 * flag will be set.
3086
 *)
3094
 *)
3087
  DDPF_RGBTOYUV                           = $00000100;
3095
  DDPF_RGBTOYUV                           = $00000100;
3088
 
3096
 
3089
(*
3097
(*
3090
 * pixel format is YUV - YUV data in pixel format struct is valid
3098
 * pixel format is YUV - YUV data in pixel format struct is valid
3091
 *)
3099
 *)
3092
  DDPF_YUV                                = $00000200;
3100
  DDPF_YUV                                = $00000200;
3093
 
3101
 
3094
(*
3102
(*
3095
 * pixel format is a z buffer only surface
3103
 * pixel format is a z buffer only surface
3096
 *)
3104
 *)
3097
  DDPF_ZBUFFER                            = $00000400;
3105
  DDPF_ZBUFFER                            = $00000400;
3098
 
3106
 
3099
(*
3107
(*
3100
 * The surface is 1-bit color indexed.
3108
 * The surface is 1-bit color indexed.
3101
 *)
3109
 *)
3102
  DDPF_PALETTEINDEXED1                    = $00000800;
3110
  DDPF_PALETTEINDEXED1                    = $00000800;
3103
 
3111
 
3104
(*
3112
(*
3105
 * The surface is 2-bit color indexed.
3113
 * The surface is 2-bit color indexed.
3106
 *)
3114
 *)
3107
  DDPF_PALETTEINDEXED2                    = $00001000;
3115
  DDPF_PALETTEINDEXED2                    = $00001000;
3108
 
3116
 
3109
(*
3117
(*
3110
 * The surface contains Z information in the pixels
3118
 * The surface contains Z information in the pixels
3111
 *)
3119
 *)
3112
  DDPF_ZPIXELS                          = $00002000;
3120
  DDPF_ZPIXELS                          = $00002000;
3113
 
3121
 
3114
(*
3122
(*
3115
 * The surface contains stencil information along with Z
3123
 * The surface contains stencil information along with Z
3116
 *)
3124
 *)
3117
  DDPF_STENCILBUFFER                    = $00004000;
3125
  DDPF_STENCILBUFFER                    = $00004000;
3118
 
3126
 
3119
(*
3127
(*
3120
 * Premultiplied alpha format -- the color components have been
3128
 * Premultiplied alpha format -- the color components have been
3121
 * premultiplied by the alpha component.
3129
 * premultiplied by the alpha component.
3122
 *)
3130
 *)
3123
  DDPF_ALPHAPREMULT                     = $00008000;
3131
  DDPF_ALPHAPREMULT                     = $00008000;
3124
 
3132
 
3125
 
3133
 
3126
(*
3134
(*
3127
 * Luminance data in the pixel format is valid.
3135
 * Luminance data in the pixel format is valid.
3128
 * Use this flag for luminance-only or luminance+alpha surfaces,
3136
 * Use this flag for luminance-only or luminance+alpha surfaces,
3129
 * the bit depth is then ddpf.dwLuminanceBitCount.
3137
 * the bit depth is then ddpf.dwLuminanceBitCount.
3130
 *)
3138
 *)
3131
  DDPF_LUMINANCE                          = $00020000;
3139
  DDPF_LUMINANCE                          = $00020000;
3132
 
3140
 
3133
(*
3141
(*
3134
 * Luminance data in the pixel format is valid.
3142
 * Luminance data in the pixel format is valid.
3135
 * Use this flag when hanging luminance off bumpmap surfaces,
3143
 * Use this flag when hanging luminance off bumpmap surfaces,
3136
 * the bit mask for the luminance portion of the pixel is then
3144
 * the bit mask for the luminance portion of the pixel is then
3137
 * ddpf.dwBumpLuminanceBitMask
3145
 * ddpf.dwBumpLuminanceBitMask
3138
 *)
3146
 *)
3139
  DDPF_BUMPLUMINANCE                      = $00040000;
3147
  DDPF_BUMPLUMINANCE                      = $00040000;
3140
 
3148
 
3141
(*
3149
(*
3142
 * Bump map dUdV data in the pixel format is valid.
3150
 * Bump map dUdV data in the pixel format is valid.
3143
 *)
3151
 *)
3144
  DDPF_BUMPDUDV                           = $00080000;
3152
  DDPF_BUMPDUDV                           = $00080000;
3145
 
3153
 
3146
(*===========================================================================
3154
(*===========================================================================
3147
 *
3155
 *
3148
 *
3156
 *
3149
 * DIRECTDRAW CALLBACK FLAGS
3157
 * DIRECTDRAW CALLBACK FLAGS
3150
 *
3158
 *
3151
 *
3159
 *
3152
 *==========================================================================*)
3160
 *==========================================================================*)
3153
 
3161
 
3154
(****************************************************************************
3162
(****************************************************************************
3155
 *
3163
 *
3156
 * DIRECTDRAW ENUMSURFACES FLAGS
3164
 * DIRECTDRAW ENUMSURFACES FLAGS
3157
 *
3165
 *
3158
 ****************************************************************************)
3166
 ****************************************************************************)
3159
 
3167
 
3160
(*
3168
(*
3161
 * Enumerate all of the surfaces that meet the search criterion.
3169
 * Enumerate all of the surfaces that meet the search criterion.
3162
 *)
3170
 *)
3163
  DDENUMSURFACES_ALL                      = $00000001;
3171
  DDENUMSURFACES_ALL                      = $00000001;
3164
 
3172
 
3165
(*
3173
(*
3166
 * A search hit is a surface that matches the surface description.
3174
 * A search hit is a surface that matches the surface description.
3167
 *)
3175
 *)
3168
  DDENUMSURFACES_MATCH                    = $00000002;
3176
  DDENUMSURFACES_MATCH                    = $00000002;
3169
 
3177
 
3170
(*
3178
(*
3171
 * A search hit is a surface that does not match the surface description.
3179
 * A search hit is a surface that does not match the surface description.
3172
 *)
3180
 *)
3173
  DDENUMSURFACES_NOMATCH                  = $00000004;
3181
  DDENUMSURFACES_NOMATCH                  = $00000004;
3174
 
3182
 
3175
(*
3183
(*
3176
 * Enumerate the first surface that can be created which meets the search criterion.
3184
 * Enumerate the first surface that can be created which meets the search criterion.
3177
 *)
3185
 *)
3178
  DDENUMSURFACES_CANBECREATED             = $00000008;
3186
  DDENUMSURFACES_CANBECREATED             = $00000008;
3179
 
3187
 
3180
(*
3188
(*
3181
 * Enumerate the surfaces that already exist that meet the search criterion.
3189
 * Enumerate the surfaces that already exist that meet the search criterion.
3182
 *)
3190
 *)
3183
  DDENUMSURFACES_DOESEXIST                = $00000010;
3191
  DDENUMSURFACES_DOESEXIST                = $00000010;
3184
 
3192
 
3185
(****************************************************************************
3193
(****************************************************************************
3186
 *
3194
 *
3187
 * DIRECTDRAW SETDISPLAYMODE FLAGS
3195
 * DIRECTDRAW SETDISPLAYMODE FLAGS
3188
 *
3196
 *
3189
 ****************************************************************************)
3197
 ****************************************************************************)
3190
 
3198
 
3191
(*
3199
(*
3192
 * The desired mode is a standard VGA mode
3200
 * The desired mode is a standard VGA mode
3193
 *)
3201
 *)
3194
  DDSDM_STANDARDVGAMODE                   = $00000001;
3202
  DDSDM_STANDARDVGAMODE                   = $00000001;
3195
 
3203
 
3196
(****************************************************************************
3204
(****************************************************************************
3197
 *
3205
 *
3198
 * DIRECTDRAW ENUMDISPLAYMODES FLAGS
3206
 * DIRECTDRAW ENUMDISPLAYMODES FLAGS
3199
 *
3207
 *
3200
 ****************************************************************************)
3208
 ****************************************************************************)
3201
 
3209
 
3202
(*
3210
(*
3203
 * Enumerate Modes with different refresh rates.  EnumDisplayModes guarantees
3211
 * Enumerate Modes with different refresh rates.  EnumDisplayModes guarantees
3204
 * that a particular mode will be enumerated only once.  This flag specifies whether
3212
 * that a particular mode will be enumerated only once.  This flag specifies whether
3205
 * the refresh rate is taken into account when determining if a mode is unique.
3213
 * the refresh rate is taken into account when determining if a mode is unique.
3206
 *)
3214
 *)
3207
  DDEDM_REFRESHRATES                      = $00000001;
3215
  DDEDM_REFRESHRATES                      = $00000001;
3208
 
3216
 
3209
(*
3217
(*
3210
 * Enumerate VGA modes. Specify this flag if you wish to enumerate supported VGA
3218
 * Enumerate VGA modes. Specify this flag if you wish to enumerate supported VGA
3211
 * modes such as mode 0x13 in addition to the usual ModeX modes (which are always
3219
 * modes such as mode 0x13 in addition to the usual ModeX modes (which are always
3212
 * enumerated if the application has previously called SetCooperativeLevel with the
3220
 * enumerated if the application has previously called SetCooperativeLevel with the
3213
 * DDSCL_ALLOWMODEX flag set).
3221
 * DDSCL_ALLOWMODEX flag set).
3214
 *)
3222
 *)
3215
  DDEDM_STANDARDVGAMODES                  = $00000002;
3223
  DDEDM_STANDARDVGAMODES                  = $00000002;
3216
 
3224
 
3217
 
3225
 
3218
(****************************************************************************
3226
(****************************************************************************
3219
 *
3227
 *
3220
 * DIRECTDRAW SETCOOPERATIVELEVEL FLAGS
3228
 * DIRECTDRAW SETCOOPERATIVELEVEL FLAGS
3221
 *
3229
 *
3222
 ****************************************************************************)
3230
 ****************************************************************************)
3223
 
3231
 
3224
(*
3232
(*
3225
 * Exclusive mode owner will be responsible for the entire primary surface.
3233
 * Exclusive mode owner will be responsible for the entire primary surface.
3226
 * GDI can be ignored. used with DD
3234
 * GDI can be ignored. used with DD
3227
 *)
3235
 *)
3228
  DDSCL_FULLSCREEN                        = $00000001;
3236
  DDSCL_FULLSCREEN                        = $00000001;
3229
 
3237
 
3230
(*
3238
(*
3231
 * allow CTRL_ALT_DEL to work while in fullscreen exclusive mode
3239
 * allow CTRL_ALT_DEL to work while in fullscreen exclusive mode
3232
 *)
3240
 *)
3233
  DDSCL_ALLOWREBOOT                       = $00000002;
3241
  DDSCL_ALLOWREBOOT                       = $00000002;
3234
 
3242
 
3235
(*
3243
(*
3236
 * prevents DDRAW from modifying the application window.
3244
 * prevents DDRAW from modifying the application window.
3237
 * prevents DDRAW from minimize/restore the application window on activation.
3245
 * prevents DDRAW from minimize/restore the application window on activation.
3238
 *)
3246
 *)
3239
  DDSCL_NOWINDOWCHANGES                   = $00000004;
3247
  DDSCL_NOWINDOWCHANGES                   = $00000004;
3240
 
3248
 
3241
(*
3249
(*
3242
 * app wants to work as a regular Windows application
3250
 * app wants to work as a regular Windows application
3243
 *)
3251
 *)
3244
  DDSCL_NORMAL                            = $00000008;
3252
  DDSCL_NORMAL                            = $00000008;
3245
 
3253
 
3246
(*
3254
(*
3247
 * app wants exclusive access
3255
 * app wants exclusive access
3248
 *)
3256
 *)
3249
  DDSCL_EXCLUSIVE                         = $00000010;
3257
  DDSCL_EXCLUSIVE                         = $00000010;
3250
 
3258
 
3251
 
3259
 
3252
(*
3260
(*
3253
 * app can deal with non-windows display modes
3261
 * app can deal with non-windows display modes
3254
 *)
3262
 *)
3255
  DDSCL_ALLOWMODEX                        = $00000040;
3263
  DDSCL_ALLOWMODEX                        = $00000040;
3256
 
3264
 
3257
(*
3265
(*
3258
 * this window will receive the focus messages
3266
 * this window will receive the focus messages
3259
 *)
3267
 *)
3260
  DDSCL_SETFOCUSWINDOW                    = $00000080;
3268
  DDSCL_SETFOCUSWINDOW                    = $00000080;
3261
 
3269
 
3262
(*
3270
(*
3263
 * this window is associated with the DDRAW object and will
3271
 * this window is associated with the DDRAW object and will
3264
 * cover the screen in fullscreen mode
3272
 * cover the screen in fullscreen mode
3265
 *)
3273
 *)
3266
  DDSCL_SETDEVICEWINDOW                   = $00000100;
3274
  DDSCL_SETDEVICEWINDOW                   = $00000100;
3267
 
3275
 
3268
(*
3276
(*
3269
 * app wants DDRAW to create a window to be associated with the
3277
 * app wants DDRAW to create a window to be associated with the
3270
 * DDRAW object
3278
 * DDRAW object
3271
 *)
3279
 *)
3272
  DDSCL_CREATEDEVICEWINDOW                = $00000200;
3280
  DDSCL_CREATEDEVICEWINDOW                = $00000200;
3273
 
3281
 
3274
(*
3282
(*
3275
 * App explicitly asks DDRAW/D3D to be multithread safe. This makes D3D
3283
 * App explicitly asks DDRAW/D3D to be multithread safe. This makes D3D
3276
 * take the global crtisec more frequently.
3284
 * take the global crtisec more frequently.
3277
 *)
3285
 *)
3278
  DDSCL_MULTITHREADED                     = $00000400;
3286
  DDSCL_MULTITHREADED                     = $00000400;
3279
 
3287
 
3280
(*
3288
(*
3281
 * App hints that it would like to keep the FPU set up for optimal Direct3D
3289
 * App hints that it would like to keep the FPU set up for optimal Direct3D
3282
 * performance (single precision and exceptions disabled) so Direct3D
3290
 * performance (single precision and exceptions disabled) so Direct3D
3283
 * does not need to explicitly set the FPU each time
3291
 * does not need to explicitly set the FPU each time
3284
 *)
3292
 *)
3285
  DDSCL_FPUSETUP                          = $00000800;
3293
  DDSCL_FPUSETUP                          = $00000800;
3286
 
3294
 
3287
(*
3295
(*
3288
 * App specifies that it needs either double precision FPU or FPU exceptions
3296
 * App specifies that it needs either double precision FPU or FPU exceptions
3289
 * enabled. This makes Direct3D explicitly set the FPU state eah time it is
3297
 * enabled. This makes Direct3D explicitly set the FPU state eah time it is
3290
 * called. Setting the flag will reduce Direct3D performance. The flag is
3298
 * called. Setting the flag will reduce Direct3D performance. The flag is
3291
 * assumed by default in DirectX 6 and earlier. See also DDSCL_FPUSETUP
3299
 * assumed by default in DirectX 6 and earlier. See also DDSCL_FPUSETUP
3292
 *)
3300
 *)
3293
  DDSCL_FPUPRESERVE                          = $00001000;
3301
  DDSCL_FPUPRESERVE                          = $00001000;
3294
 
3302
 
3295
(****************************************************************************
3303
(****************************************************************************
3296
 *
3304
 *
3297
 * DIRECTDRAW BLT FLAGS
3305
 * DIRECTDRAW BLT FLAGS
3298
 *
3306
 *
3299
 ****************************************************************************)
3307
 ****************************************************************************)
3300
 
3308
 
3301
(*
3309
(*
3302
 * Use the alpha information in the pixel format or the alpha channel surface
3310
 * Use the alpha information in the pixel format or the alpha channel surface
3303
 * attached to the destination surface as the alpha channel for this blt.
3311
 * attached to the destination surface as the alpha channel for this blt.
3304
 *)
3312
 *)
3305
  DDBLT_ALPHADEST                         = $00000001;
3313
  DDBLT_ALPHADEST                         = $00000001;
3306
 
3314
 
3307
(*
3315
(*
3308
 * Use the dwConstAlphaDest field in the TDDBltFX structure as the alpha channel
3316
 * Use the dwConstAlphaDest field in the TDDBltFX structure as the alpha channel
3309
 * for the destination surface for this blt.
3317
 * for the destination surface for this blt.
3310
 *)
3318
 *)
3311
  DDBLT_ALPHADESTCONSTOVERRIDE            = $00000002;
3319
  DDBLT_ALPHADESTCONSTOVERRIDE            = $00000002;
3312
 
3320
 
3313
(*
3321
(*
3314
 * The NEG suffix indicates that the destination surface becomes more
3322
 * The NEG suffix indicates that the destination surface becomes more
3315
 * transparent as the alpha value increases. (0 is opaque)
3323
 * transparent as the alpha value increases. (0 is opaque)
3316
 *)
3324
 *)
3317
  DDBLT_ALPHADESTNEG                      = $00000004;
3325
  DDBLT_ALPHADESTNEG                      = $00000004;
3318
 
3326
 
3319
(*
3327
(*
3320
 * Use the lpDDSAlphaDest field in the TDDBltFX structure as the alpha
3328
 * Use the lpDDSAlphaDest field in the TDDBltFX structure as the alpha
3321
 * channel for the destination for this blt.
3329
 * channel for the destination for this blt.
3322
 *)
3330
 *)
3323
  DDBLT_ALPHADESTSURFACEOVERRIDE          = $00000008;
3331
  DDBLT_ALPHADESTSURFACEOVERRIDE          = $00000008;
3324
 
3332
 
3325
(*
3333
(*
3326
 * Use the dwAlphaEdgeBlend field in the TDDBltFX structure as the alpha channel
3334
 * Use the dwAlphaEdgeBlend field in the TDDBltFX structure as the alpha channel
3327
 * for the edges of the image that border the color key colors.
3335
 * for the edges of the image that border the color key colors.
3328
 *)
3336
 *)
3329
  DDBLT_ALPHAEDGEBLEND                    = $00000010;
3337
  DDBLT_ALPHAEDGEBLEND                    = $00000010;
3330
 
3338
 
3331
(*
3339
(*
3332
 * Use the alpha information in the pixel format or the alpha channel surface
3340
 * Use the alpha information in the pixel format or the alpha channel surface
3333
 * attached to the source surface as the alpha channel for this blt.
3341
 * attached to the source surface as the alpha channel for this blt.
3334
 *)
3342
 *)
3335
  DDBLT_ALPHASRC                          = $00000020;
3343
  DDBLT_ALPHASRC                          = $00000020;
3336
 
3344
 
3337
(*
3345
(*
3338
 * Use the dwConstAlphaSrc field in the TDDBltFX structure as the alpha channel
3346
 * Use the dwConstAlphaSrc field in the TDDBltFX structure as the alpha channel
3339
 * for the source for this blt.
3347
 * for the source for this blt.
3340
 *)
3348
 *)
3341
  DDBLT_ALPHASRCCONSTOVERRIDE             = $00000040;
3349
  DDBLT_ALPHASRCCONSTOVERRIDE             = $00000040;
3342
 
3350
 
3343
(*
3351
(*
3344
 * The NEG suffix indicates that the source surface becomes more transparent
3352
 * The NEG suffix indicates that the source surface becomes more transparent
3345
 * as the alpha value increases. (0 is opaque)
3353
 * as the alpha value increases. (0 is opaque)
3346
 *)
3354
 *)
3347
  DDBLT_ALPHASRCNEG                       = $00000080;
3355
  DDBLT_ALPHASRCNEG                       = $00000080;
3348
 
3356
 
3349
(*
3357
(*
3350
 * Use the lpDDSAlphaSrc field in the TDDBltFX structure as the alpha channel
3358
 * Use the lpDDSAlphaSrc field in the TDDBltFX structure as the alpha channel
3351
 * for the source for this blt.
3359
 * for the source for this blt.
3352
 *)
3360
 *)
3353
  DDBLT_ALPHASRCSURFACEOVERRIDE           = $00000100;
3361
  DDBLT_ALPHASRCSURFACEOVERRIDE           = $00000100;
3354
 
3362
 
3355
(*
3363
(*
3356
 * Do this blt asynchronously through the FIFO in the order received.  If
3364
 * Do this blt asynchronously through the FIFO in the order received.  If
3357
 * there is no room in the hardware FIFO fail the call.
3365
 * there is no room in the hardware FIFO fail the call.
3358
 *)
3366
 *)
3359
  DDBLT_ASYNC                             = $00000200;
3367
  DDBLT_ASYNC                             = $00000200;
3360
 
3368
 
3361
(*
3369
(*
3362
 * Uses the dwFillColor field in the TDDBltFX structure as the RGB color
3370
 * Uses the dwFillColor field in the TDDBltFX structure as the RGB color
3363
 * to fill the destination rectangle on the destination surface with.
3371
 * to fill the destination rectangle on the destination surface with.
3364
 *)
3372
 *)
3365
  DDBLT_COLORFILL                         = $00000400;
3373
  DDBLT_COLORFILL                         = $00000400;
3366
 
3374
 
3367
(*
3375
(*
3368
 * Uses the dwDDFX field in the TDDBltFX structure to specify the effects
3376
 * Uses the dwDDFX field in the TDDBltFX structure to specify the effects
3369
 * to use for the blt.
3377
 * to use for the blt.
3370
 *)
3378
 *)
3371
  DDBLT_DDFX                              = $00000800;
3379
  DDBLT_DDFX                              = $00000800;
3372
 
3380
 
3373
(*
3381
(*
3374
 * Uses the dwDDROPS field in the TDDBltFX structure to specify the ROPS
3382
 * Uses the dwDDROPS field in the TDDBltFX structure to specify the ROPS
3375
 * that are not part of the Win32 API.
3383
 * that are not part of the Win32 API.
3376
 *)
3384
 *)
3377
  DDBLT_DDROPS                            = $00001000;
3385
  DDBLT_DDROPS                            = $00001000;
3378
 
3386
 
3379
(*
3387
(*
3380
 * Use the color key associated with the destination surface.
3388
 * Use the color key associated with the destination surface.
3381
 *)
3389
 *)
3382
  DDBLT_KEYDEST                           = $00002000;
3390
  DDBLT_KEYDEST                           = $00002000;
3383
 
3391
 
3384
(*
3392
(*
3385
 * Use the dckDestColorkey field in the TDDBltFX structure as the color key
3393
 * Use the dckDestColorkey field in the TDDBltFX structure as the color key
3386
 * for the destination surface.
3394
 * for the destination surface.
3387
 *)
3395
 *)
3388
  DDBLT_KEYDESTOVERRIDE                   = $00004000;
3396
  DDBLT_KEYDESTOVERRIDE                   = $00004000;
3389
 
3397
 
3390
(*
3398
(*
3391
 * Use the color key associated with the source surface.
3399
 * Use the color key associated with the source surface.
3392
 *)
3400
 *)
3393
  DDBLT_KEYSRC                            = $00008000;
3401
  DDBLT_KEYSRC                            = $00008000;
3394
 
3402
 
3395
(*
3403
(*
3396
 * Use the dckSrcColorkey field in the TDDBltFX structure as the color key
3404
 * Use the dckSrcColorkey field in the TDDBltFX structure as the color key
3397
 * for the source surface.
3405
 * for the source surface.
3398
 *)
3406
 *)
3399
  DDBLT_KEYSRCOVERRIDE                    = $00010000;
3407
  DDBLT_KEYSRCOVERRIDE                    = $00010000;
3400
 
3408
 
3401
(*
3409
(*
3402
 * Use the dwROP field in the TDDBltFX structure for the raster operation
3410
 * Use the dwROP field in the TDDBltFX structure for the raster operation
3403
 * for this blt.  These ROPs are the same as the ones defined in the Win32 API.
3411
 * for this blt.  These ROPs are the same as the ones defined in the Win32 API.
3404
 *)
3412
 *)
3405
  DDBLT_ROP                               = $00020000;
3413
  DDBLT_ROP                               = $00020000;
3406
 
3414
 
3407
(*
3415
(*
3408
 * Use the dwRotationAngle field in the TDDBltFX structure as the angle
3416
 * Use the dwRotationAngle field in the TDDBltFX structure as the angle
3409
 * (specified in 1/100th of a degree) to rotate the surface.
3417
 * (specified in 1/100th of a degree) to rotate the surface.
3410
 *)
3418
 *)
3411
  DDBLT_ROTATIONANGLE                     = $00040000;
3419
  DDBLT_ROTATIONANGLE                     = $00040000;
3412
 
3420
 
3413
(*
3421
(*
3414
 * Z-buffered blt using the z-buffers attached to the source and destination
3422
 * Z-buffered blt using the z-buffers attached to the source and destination
3415
 * surfaces and the dwZBufferOpCode field in the TDDBltFX structure as the
3423
 * surfaces and the dwZBufferOpCode field in the TDDBltFX structure as the
3416
 * z-buffer opcode.
3424
 * z-buffer opcode.
3417
 *)
3425
 *)
3418
  DDBLT_ZBUFFER                           = $00080000;
3426
  DDBLT_ZBUFFER                           = $00080000;
3419
 
3427
 
3420
(*
3428
(*
3421
 * Z-buffered blt using the dwConstDest Zfield and the dwZBufferOpCode field
3429
 * Z-buffered blt using the dwConstDest Zfield and the dwZBufferOpCode field
3422
 * in the TDDBltFX structure as the z-buffer and z-buffer opcode respectively
3430
 * in the TDDBltFX structure as the z-buffer and z-buffer opcode respectively
3423
 * for the destination.
3431
 * for the destination.
3424
 *)
3432
 *)
3425
  DDBLT_ZBUFFERDESTCONSTOVERRIDE          = $00100000;
3433
  DDBLT_ZBUFFERDESTCONSTOVERRIDE          = $00100000;
3426
 
3434
 
3427
(*
3435
(*
3428
 * Z-buffered blt using the lpDDSDestZBuffer field and the dwZBufferOpCode
3436
 * Z-buffered blt using the lpDDSDestZBuffer field and the dwZBufferOpCode
3429
 * field in the TDDBltFX structure as the z-buffer and z-buffer opcode
3437
 * field in the TDDBltFX structure as the z-buffer and z-buffer opcode
3430
 * respectively for the destination.
3438
 * respectively for the destination.
3431
 *)
3439
 *)
3432
  DDBLT_ZBUFFERDESTOVERRIDE               = $00200000;
3440
  DDBLT_ZBUFFERDESTOVERRIDE               = $00200000;
3433
 
3441
 
3434
(*
3442
(*
3435
 * Z-buffered blt using the dwConstSrcZ field and the dwZBufferOpCode field
3443
 * Z-buffered blt using the dwConstSrcZ field and the dwZBufferOpCode field
3436
 * in the TDDBltFX structure as the z-buffer and z-buffer opcode respectively
3444
 * in the TDDBltFX structure as the z-buffer and z-buffer opcode respectively
3437
 * for the source.
3445
 * for the source.
3438
 *)
3446
 *)
3439
  DDBLT_ZBUFFERSRCCONSTOVERRIDE           = $00400000;
3447
  DDBLT_ZBUFFERSRCCONSTOVERRIDE           = $00400000;
3440
 
3448
 
3441
(*
3449
(*
3442
 * Z-buffered blt using the lpDDSSrcZBuffer field and the dwZBufferOpCode
3450
 * Z-buffered blt using the lpDDSSrcZBuffer field and the dwZBufferOpCode
3443
 * field in the TDDBltFX structure as the z-buffer and z-buffer opcode
3451
 * field in the TDDBltFX structure as the z-buffer and z-buffer opcode
3444
 * respectively for the source.
3452
 * respectively for the source.
3445
 *)
3453
 *)
3446
   DDBLT_ZBUFFERSRCOVERRIDE                = $00800000;
3454
   DDBLT_ZBUFFERSRCOVERRIDE                = $00800000;
3447
 
3455
 
3448
(*
3456
(*
3449
 * wait until the device is ready to handle the blt
3457
 * wait until the device is ready to handle the blt
3450
 * this will cause blt to not return DDERR_WASSTILLDRAWING
3458
 * this will cause blt to not return DDERR_WASSTILLDRAWING
3451
 *)
3459
 *)
3452
  DDBLT_WAIT                              = $01000000;
3460
  DDBLT_WAIT                              = $01000000;
3453
 
3461
 
3454
(*
3462
(*
3455
 * Uses the dwFillDepth field in the TDDBltFX structure as the depth value
3463
 * Uses the dwFillDepth field in the TDDBltFX structure as the depth value
3456
 * to fill the destination rectangle on the destination Z-buffer surface
3464
 * to fill the destination rectangle on the destination Z-buffer surface
3457
 * with.
3465
 * with.
3458
 *)
3466
 *)
3459
  DDBLT_DEPTHFILL                         = $02000000;
3467
  DDBLT_DEPTHFILL                         = $02000000;
3460
 
3468
 
3461
(*
3469
(*
3462
 * wait until the device is ready to handle the blt
3470
 * wait until the device is ready to handle the blt
3463
 * this will cause blt to not return DDERR_WASSTILLDRAWING
3471
 * this will cause blt to not return DDERR_WASSTILLDRAWING
3464
 *)
3472
 *)
3465
  DDBLT_DONOTWAIT                         = $08000000;
3473
  DDBLT_DONOTWAIT                         = $08000000;
3466
 
3474
 
3467
(****************************************************************************
3475
(****************************************************************************
3468
 *
3476
 *
3469
 * BLTFAST FLAGS
3477
 * BLTFAST FLAGS
3470
 *
3478
 *
3471
 ****************************************************************************)
3479
 ****************************************************************************)
3472
 
3480
 
3473
  DDBLTFAST_NOCOLORKEY                    = $00000000;
3481
  DDBLTFAST_NOCOLORKEY                    = $00000000;
3474
  DDBLTFAST_SRCCOLORKEY                   = $00000001;
3482
  DDBLTFAST_SRCCOLORKEY                   = $00000001;
3475
  DDBLTFAST_DESTCOLORKEY                  = $00000002;
3483
  DDBLTFAST_DESTCOLORKEY                  = $00000002;
3476
  DDBLTFAST_WAIT                          = $00000010;
3484
  DDBLTFAST_WAIT                          = $00000010;
3477
  DDBLTFAST_DONOTWAIT                     = $00000020;
3485
  DDBLTFAST_DONOTWAIT                     = $00000020;
3478
 
3486
 
3479
(****************************************************************************
3487
(****************************************************************************
3480
 *
3488
 *
3481
 * FLIP FLAGS
3489
 * FLIP FLAGS
3482
 *
3490
 *
3483
 ****************************************************************************)
3491
 ****************************************************************************)
3484
 
3492
 
3485
 
3493
 
3486
  DDFLIP_WAIT                          = $00000001;
3494
  DDFLIP_WAIT                          = $00000001;
3487
 
3495
 
3488
(*
3496
(*
3489
 * Indicates that the target surface contains the even field of video data.
3497
 * Indicates that the target surface contains the even field of video data.
3490
 * This flag is only valid with an overlay surface.
3498
 * This flag is only valid with an overlay surface.
3491
 *)
3499
 *)
3492
  DDFLIP_EVEN                          = $00000002;
3500
  DDFLIP_EVEN                          = $00000002;
3493
 
3501
 
3494
(*
3502
(*
3495
 * Indicates that the target surface contains the odd field of video data.
3503
 * Indicates that the target surface contains the odd field of video data.
3496
 * This flag is only valid with an overlay surface.
3504
 * This flag is only valid with an overlay surface.
3497
 *)
3505
 *)
3498
  DDFLIP_ODD                           = $00000004;
3506
  DDFLIP_ODD                           = $00000004;
3499
 
3507
 
3500
(*
3508
(*
3501
 * Causes DirectDraw to perform the physical flip immediately and return
3509
 * Causes DirectDraw to perform the physical flip immediately and return
3502
 * to the application. Typically, what was the front buffer but is now the back
3510
 * to the application. Typically, what was the front buffer but is now the back
3503
 * buffer will still be visible (depending on timing) until the next vertical
3511
 * buffer will still be visible (depending on timing) until the next vertical
3504
 * retrace. Subsequent operations involving the two flipped surfaces will
3512
 * retrace. Subsequent operations involving the two flipped surfaces will
3505
 * not check to see if the physical flip has finished (i.e. will not return
3513
 * not check to see if the physical flip has finished (i.e. will not return
3506
 * DDERR_WASSTILLDRAWING for that reason (but may for other reasons)).
3514
 * DDERR_WASSTILLDRAWING for that reason (but may for other reasons)).
3507
 * This allows an application to perform Flips at a higher frequency than the
3515
 * This allows an application to perform Flips at a higher frequency than the
3508
 * monitor refresh rate, but may introduce visible artifacts.
3516
 * monitor refresh rate, but may introduce visible artifacts.
3509
 * Only effective if DDCAPS2_FLIPNOVSYNC is set. If that bit is not set,
3517
 * Only effective if DDCAPS2_FLIPNOVSYNC is set. If that bit is not set,
3510
 * DDFLIP_NOVSYNC has no effect.
3518
 * DDFLIP_NOVSYNC has no effect.
3511
 *)
3519
 *)
3512
  DDFLIP_NOVSYNC                       = $00000008;
3520
  DDFLIP_NOVSYNC                       = $00000008;
3513
 
3521
 
3514
 
3522
 
3515
(*
3523
(*
3516
 * Flip Interval Flags. These flags indicate how many vertical retraces to wait between
3524
 * Flip Interval Flags. These flags indicate how many vertical retraces to wait between
3517
 * each flip. The default is one. DirectDraw will return DDERR_WASSTILLDRAWING for each
3525
 * each flip. The default is one. DirectDraw will return DDERR_WASSTILLDRAWING for each
3518
 * surface involved in the flip until the specified number of vertical retraces has
3526
 * surface involved in the flip until the specified number of vertical retraces has
3519
 * ocurred. Only effective if DDCAPS2_FLIPINTERVAL is set. If that bit is not set,
3527
 * ocurred. Only effective if DDCAPS2_FLIPINTERVAL is set. If that bit is not set,
3520
 * DDFLIP_INTERVALn has no effect.
3528
 * DDFLIP_INTERVALn has no effect.
3521
 *)
3529
 *)
3522
 
3530
 
3523
(*
3531
(*
3524
 * DirectDraw will flip on every other vertical sync
3532
 * DirectDraw will flip on every other vertical sync
3525
 *)
3533
 *)
3526
  DDFLIP_INTERVAL2                     = $02000000;
3534
  DDFLIP_INTERVAL2                     = $02000000;
3527
 
3535
 
3528
 
3536
 
3529
(*
3537
(*
3530
 * DirectDraw will flip on every third vertical sync
3538
 * DirectDraw will flip on every third vertical sync
3531
 *)
3539
 *)
3532
  DDFLIP_INTERVAL3                     = $03000000;
3540
  DDFLIP_INTERVAL3                     = $03000000;
3533
 
3541
 
3534
 
3542
 
3535
(*
3543
(*
3536
 * DirectDraw will flip on every fourth vertical sync
3544
 * DirectDraw will flip on every fourth vertical sync
3537
 *)
3545
 *)
3538
  DDFLIP_INTERVAL4                     = $04000000;
3546
  DDFLIP_INTERVAL4                     = $04000000;
3539
 
3547
 
3540
(*
3548
(*
3541
 * DirectDraw will flip and display a main stereo surface
3549
 * DirectDraw will flip and display a main stereo surface
3542
 *)
3550
 *)
3543
  DDFLIP_STEREO                        = $00000010;
3551
  DDFLIP_STEREO                        = $00000010;
3544
 
3552
 
3545
(*
3553
(*
3546
 * On IDirectDrawSurface7 and higher interfaces, the default is DDFLIP_WAIT. If you wish
3554
 * On IDirectDrawSurface7 and higher interfaces, the default is DDFLIP_WAIT. If you wish
3547
 * to override the default and use time when the accelerator is busy (as denoted by
3555
 * to override the default and use time when the accelerator is busy (as denoted by
3548
 * the DDERR_WASSTILLDRAWING return code) then use DDFLIP_DONOTWAIT.
3556
 * the DDERR_WASSTILLDRAWING return code) then use DDFLIP_DONOTWAIT.
3549
 *)
3557
 *)
3550
  DDFLIP_DONOTWAIT                     = $00000020;
3558
  DDFLIP_DONOTWAIT                     = $00000020;
3551
 
3559
 
3552
(****************************************************************************
3560
(****************************************************************************
3553
 *
3561
 *
3554
 * DIRECTDRAW SURFACE OVERLAY FLAGS
3562
 * DIRECTDRAW SURFACE OVERLAY FLAGS
3555
 *
3563
 *
3556
 ****************************************************************************)
3564
 ****************************************************************************)
3557
 
3565
 
3558
(*
3566
(*
3559
 * Use the alpha information in the pixel format or the alpha channel surface
3567
 * Use the alpha information in the pixel format or the alpha channel surface
3560
 * attached to the destination surface as the alpha channel for the
3568
 * attached to the destination surface as the alpha channel for the
3561
 * destination overlay.
3569
 * destination overlay.
3562
 *)
3570
 *)
3563
  DDOVER_ALPHADEST                        = $00000001;
3571
  DDOVER_ALPHADEST                        = $00000001;
3564
 
3572
 
3565
(*
3573
(*
3566
 * Use the dwConstAlphaDest field in the TDDOverlayFX structure as the
3574
 * Use the dwConstAlphaDest field in the TDDOverlayFX structure as the
3567
 * destination alpha channel for this overlay.
3575
 * destination alpha channel for this overlay.
3568
 *)
3576
 *)
3569
  DDOVER_ALPHADESTCONSTOVERRIDE           = $00000002;
3577
  DDOVER_ALPHADESTCONSTOVERRIDE           = $00000002;
3570
 
3578
 
3571
(*
3579
(*
3572
 * The NEG suffix indicates that the destination surface becomes more
3580
 * The NEG suffix indicates that the destination surface becomes more
3573
 * transparent as the alpha value increases.
3581
 * transparent as the alpha value increases.
3574
 *)
3582
 *)
3575
  DDOVER_ALPHADESTNEG                     = $00000004;
3583
  DDOVER_ALPHADESTNEG                     = $00000004;
3576
 
3584
 
3577
(*
3585
(*
3578
 * Use the lpDDSAlphaDest field in the TDDOverlayFX structure as the alpha
3586
 * Use the lpDDSAlphaDest field in the TDDOverlayFX structure as the alpha
3579
 * channel destination for this overlay.
3587
 * channel destination for this overlay.
3580
 *)
3588
 *)
3581
  DDOVER_ALPHADESTSURFACEOVERRIDE         = $00000008;
3589
  DDOVER_ALPHADESTSURFACEOVERRIDE         = $00000008;
3582
 
3590
 
3583
(*
3591
(*
3584
 * Use the dwAlphaEdgeBlend field in the TDDOverlayFX structure as the alpha
3592
 * Use the dwAlphaEdgeBlend field in the TDDOverlayFX structure as the alpha
3585
 * channel for the edges of the image that border the color key colors.
3593
 * channel for the edges of the image that border the color key colors.
3586
 *)
3594
 *)
3587
  DDOVER_ALPHAEDGEBLEND                   = $00000010;
3595
  DDOVER_ALPHAEDGEBLEND                   = $00000010;
3588
 
3596
 
3589
(*
3597
(*
3590
 * Use the alpha information in the pixel format or the alpha channel surface
3598
 * Use the alpha information in the pixel format or the alpha channel surface
3591
 * attached to the source surface as the source alpha channel for this overlay.
3599
 * attached to the source surface as the source alpha channel for this overlay.
3592
 *)
3600
 *)
3593
  DDOVER_ALPHASRC                         = $00000020;
3601
  DDOVER_ALPHASRC                         = $00000020;
3594
 
3602
 
3595
(*
3603
(*
3596
 * Use the dwConstAlphaSrc field in the TDDOverlayFX structure as the source
3604
 * Use the dwConstAlphaSrc field in the TDDOverlayFX structure as the source
3597
 * alpha channel for this overlay.
3605
 * alpha channel for this overlay.
3598
 *)
3606
 *)
3599
  DDOVER_ALPHASRCCONSTOVERRIDE            = $00000040;
3607
  DDOVER_ALPHASRCCONSTOVERRIDE            = $00000040;
3600
 
3608
 
3601
(*
3609
(*
3602
 * The NEG suffix indicates that the source surface becomes more transparent
3610
 * The NEG suffix indicates that the source surface becomes more transparent
3603
 * as the alpha value increases.
3611
 * as the alpha value increases.
3604
 *)
3612
 *)
3605
  DDOVER_ALPHASRCNEG                      = $00000080;
3613
  DDOVER_ALPHASRCNEG                      = $00000080;
3606
 
3614
 
3607
(*
3615
(*
3608
 * Use the lpDDSAlphaSrc field in the TDDOverlayFX structure as the alpha channel
3616
 * Use the lpDDSAlphaSrc field in the TDDOverlayFX structure as the alpha channel
3609
 * source for this overlay.
3617
 * source for this overlay.
3610
 *)
3618
 *)
3611
  DDOVER_ALPHASRCSURFACEOVERRIDE          = $00000100;
3619
  DDOVER_ALPHASRCSURFACEOVERRIDE          = $00000100;
3612
 
3620
 
3613
(*
3621
(*
3614
 * Turn this overlay off.
3622
 * Turn this overlay off.
3615
 *)
3623
 *)
3616
  DDOVER_HIDE                             = $00000200;
3624
  DDOVER_HIDE                             = $00000200;
3617
 
3625
 
3618
(*
3626
(*
3619
 * Use the color key associated with the destination surface.
3627
 * Use the color key associated with the destination surface.
3620
 *)
3628
 *)
3621
  DDOVER_KEYDEST                          = $00000400;
3629
  DDOVER_KEYDEST                          = $00000400;
3622
 
3630
 
3623
(*
3631
(*
3624
 * Use the dckDestColorkey field in the TDDOverlayFX structure as the color key
3632
 * Use the dckDestColorkey field in the TDDOverlayFX structure as the color key
3625
 * for the destination surface
3633
 * for the destination surface
3626
 *)
3634
 *)
3627
  DDOVER_KEYDESTOVERRIDE                  = $00000800;
3635
  DDOVER_KEYDESTOVERRIDE                  = $00000800;
3628
 
3636
 
3629
(*
3637
(*
3630
 * Use the color key associated with the source surface.
3638
 * Use the color key associated with the source surface.
3631
 *)
3639
 *)
3632
  DDOVER_KEYSRC                           = $00001000;
3640
  DDOVER_KEYSRC                           = $00001000;
3633
 
3641
 
3634
(*
3642
(*
3635
 * Use the dckSrcColorkey field in the TDDOverlayFX structure as the color key
3643
 * Use the dckSrcColorkey field in the TDDOverlayFX structure as the color key
3636
 * for the source surface.
3644
 * for the source surface.
3637
 *)
3645
 *)
3638
  DDOVER_KEYSRCOVERRIDE                   = $00002000;
3646
  DDOVER_KEYSRCOVERRIDE                   = $00002000;
3639
 
3647
 
3640
(*
3648
(*
3641
 * Turn this overlay on.
3649
 * Turn this overlay on.
3642
 *)
3650
 *)
3643
  DDOVER_SHOW                             = $00004000;
3651
  DDOVER_SHOW                             = $00004000;
3644
 
3652
 
3645
(*
3653
(*
3646
 * Add a dirty rect to an emulated overlayed surface.
3654
 * Add a dirty rect to an emulated overlayed surface.
3647
 *)
3655
 *)
3648
  DDOVER_ADDDIRTYRECT                     = $00008000;
3656
  DDOVER_ADDDIRTYRECT                     = $00008000;
3649
 
3657
 
3650
(*
3658
(*
3651
 * Redraw all dirty rects on an emulated overlayed surface.
3659
 * Redraw all dirty rects on an emulated overlayed surface.
3652
 *)
3660
 *)
3653
  DDOVER_REFRESHDIRTYRECTS                = $00010000;
3661
  DDOVER_REFRESHDIRTYRECTS                = $00010000;
3654
 
3662
 
3655
(*
3663
(*
3656
 * Redraw the entire surface on an emulated overlayed surface.
3664
 * Redraw the entire surface on an emulated overlayed surface.
3657
 *)
3665
 *)
3658
  DDOVER_REFRESHALL                      = $00020000;
3666
  DDOVER_REFRESHALL                      = $00020000;
3659
 
3667
 
3660
(*
3668
(*
3661
 * Use the overlay FX flags to define special overlay FX
3669
 * Use the overlay FX flags to define special overlay FX
3662
 *)
3670
 *)
3663
  DDOVER_DDFX                             = $00080000;
3671
  DDOVER_DDFX                             = $00080000;
3664
 
3672
 
3665
(*
3673
(*
3666
 * Autoflip the overlay when ever the video port autoflips
3674
 * Autoflip the overlay when ever the video port autoflips
3667
 *)
3675
 *)
3668
  DDOVER_AUTOFLIP                         = $00100000;
3676
  DDOVER_AUTOFLIP                         = $00100000;
3669
 
3677
 
3670
(*
3678
(*
3671
 * Display each field of video port data individually without
3679
 * Display each field of video port data individually without
3672
 * causing any jittery artifacts
3680
 * causing any jittery artifacts
3673
 *)
3681
 *)
3674
  DDOVER_BOB                              = $00200000;
3682
  DDOVER_BOB                              = $00200000;
3675
 
3683
 
3676
(*
3684
(*
3677
 * Indicates that bob/weave decisions should not be overridden by other
3685
 * Indicates that bob/weave decisions should not be overridden by other
3678
 * interfaces.
3686
 * interfaces.
3679
 *)
3687
 *)
3680
  DDOVER_OVERRIDEBOBWEAVE                 = $00400000;
3688
  DDOVER_OVERRIDEBOBWEAVE                 = $00400000;
3681
 
3689
 
3682
(*
3690
(*
3683
 * Indicates that the surface memory is composed of interleaved fields.
3691
 * Indicates that the surface memory is composed of interleaved fields.
3684
 *)
3692
 *)
3685
  DDOVER_INTERLEAVED                      = $00800000;
3693
  DDOVER_INTERLEAVED                      = $00800000;
3686
 
3694
 
3687
(*
3695
(*
3688
 * Indicates that bob will be performed using hardware rather than
3696
 * Indicates that bob will be performed using hardware rather than
3689
 * software or emulated.
3697
 * software or emulated.
3690
 *)
3698
 *)
3691
  DDOVER_BOBHARDWARE                    = $01000000;
3699
  DDOVER_BOBHARDWARE                    = $01000000;
3692
 
3700
 
3693
(*
3701
(*
3694
 * Indicates that overlay FX structure contains valid ARGB scaling factors.
3702
 * Indicates that overlay FX structure contains valid ARGB scaling factors.
3695
 *)
3703
 *)
3696
  DDOVER_ARGBSCALEFACTORS                 = $02000000;
3704
  DDOVER_ARGBSCALEFACTORS                 = $02000000;
3697
 
3705
 
3698
(*
3706
(*
3699
 * Indicates that ARGB scaling factors can be degraded to fit driver capabilities.
3707
 * Indicates that ARGB scaling factors can be degraded to fit driver capabilities.
3700
 *)
3708
 *)
3701
  DDOVER_DEGRADEARGBSCALING               = $04000000;
3709
  DDOVER_DEGRADEARGBSCALING               = $04000000;
3702
 
3710
 
3703
(****************************************************************************
3711
(****************************************************************************
3704
 *
3712
 *
3705
 * DIRECTDRAWSURFACE LOCK FLAGS
3713
 * DIRECTDRAWSURFACE LOCK FLAGS
3706
 *
3714
 *
3707
 ****************************************************************************)
3715
 ****************************************************************************)
3708
 
3716
 
3709
(*
3717
(*
3710
 * The default.  Set to indicate that Lock should return a valid memory pointer
3718
 * The default.  Set to indicate that Lock should return a valid memory pointer
3711
 * to the top of the specified rectangle.  If no rectangle is specified then a
3719
 * to the top of the specified rectangle.  If no rectangle is specified then a
3712
 * pointer to the top of the surface is returned.
3720
 * pointer to the top of the surface is returned.
3713
 *)
3721
 *)
3714
  DDLOCK_SURFACEMEMORYPTR                 = $00000000;    // = default
3722
  DDLOCK_SURFACEMEMORYPTR                 = $00000000;    // = default
3715
 
3723
 
3716
(*
3724
(*
3717
 * Set to indicate that Lock should wait until it can obtain a valid memory
3725
 * Set to indicate that Lock should wait until it can obtain a valid memory
3718
 * pointer before returning.  If this bit is set, Lock will never return
3726
 * pointer before returning.  If this bit is set, Lock will never return
3719
 * DDERR_WASSTILLDRAWING.
3727
 * DDERR_WASSTILLDRAWING.
3720
 *)
3728
 *)
3721
  DDLOCK_WAIT                             = $00000001;
3729
  DDLOCK_WAIT                             = $00000001;
3722
 
3730
 
3723
(*
3731
(*
3724
 * Set if an event handle is being passed to Lock.  Lock will trigger the event
3732
 * Set if an event handle is being passed to Lock.  Lock will trigger the event
3725
 * when it can return the surface memory pointer requested.
3733
 * when it can return the surface memory pointer requested.
3726
 *)
3734
 *)
3727
  DDLOCK_EVENT                            = $00000002;
3735
  DDLOCK_EVENT                            = $00000002;
3728
 
3736
 
3729
(*
3737
(*
3730
 * Indicates that the surface being locked will only be read from.
3738
 * Indicates that the surface being locked will only be read from.
3731
 *)
3739
 *)
3732
  DDLOCK_READONLY                         = $00000010;
3740
  DDLOCK_READONLY                         = $00000010;
3733
 
3741
 
3734
(*
3742
(*
3735
 * Indicates that the surface being locked will only be written to
3743
 * Indicates that the surface being locked will only be written to
3736
 *)
3744
 *)
3737
  DDLOCK_WRITEONLY                        = $00000020;
3745
  DDLOCK_WRITEONLY                        = $00000020;
3738
 
3746
 
3739
(*
3747
(*
3740
 * Indicates that a system wide lock should not be taken when this surface
3748
 * Indicates that a system wide lock should not be taken when this surface
3741
 * is locked. This has several advantages (cursor responsiveness, ability
3749
 * is locked. This has several advantages (cursor responsiveness, ability
3742
 * to call more Windows functions, easier debugging) when locking video
3750
 * to call more Windows functions, easier debugging) when locking video
3743
 * memory surfaces. However, an application specifying this flag must
3751
 * memory surfaces. However, an application specifying this flag must
3744
 * comply with a number of conditions documented in the help file.
3752
 * comply with a number of conditions documented in the help file.
3745
 * Furthermore, this flag cannot be specified when locking the primary.
3753
 * Furthermore, this flag cannot be specified when locking the primary.
3746
 *)
3754
 *)
3747
  DDLOCK_NOSYSLOCK                        = $00000800;
3755
  DDLOCK_NOSYSLOCK                        = $00000800;
3748
 
3756
 
3749
(*
3757
(*
3750
 * Used only with Direct3D Vertex Buffer Locks. Indicates that no vertices
3758
 * Used only with Direct3D Vertex Buffer Locks. Indicates that no vertices
3751
 * that were referred to in Draw*PrimtiveVB calls since the start of the
3759
 * that were referred to in Draw*PrimtiveVB calls since the start of the
3752
 * frame (or the last lock without this flag) will be modified during the
3760
 * frame (or the last lock without this flag) will be modified during the
3753
 * lock. This can be useful when one is only appending data to the vertex
3761
 * lock. This can be useful when one is only appending data to the vertex
3754
 * buffer
3762
 * buffer
3755
 *)
3763
 *)
3756
  DDLOCK_NOOVERWRITE                      = $00001000;
3764
  DDLOCK_NOOVERWRITE                      = $00001000;
3757
 
3765
 
3758
(*
3766
(*
3759
 * Indicates that no assumptions will be made about the contents of the
3767
 * Indicates that no assumptions will be made about the contents of the
3760
 * surface or vertex buffer during this lock.
3768
 * surface or vertex buffer during this lock.
3761
 * This enables two things:
3769
 * This enables two things:
3762
 * -    Direct3D or the driver may provide an alternative memory
3770
 * -    Direct3D or the driver may provide an alternative memory
3763
 *      area as the vertex buffer. This is useful when one plans to clear the
3771
 *      area as the vertex buffer. This is useful when one plans to clear the
3764
 *      contents of the vertex buffer and fill in new data.
3772
 *      contents of the vertex buffer and fill in new data.
3765
 * -    Drivers sometimes store surface data in a re-ordered format.
3773
 * -    Drivers sometimes store surface data in a re-ordered format.
3766
 *      When the application locks the surface, the driver is forced to un-re-order
3774
 *      When the application locks the surface, the driver is forced to un-re-order
3767
 *      the surface data before allowing the application to see the surface contents.
3775
 *      the surface data before allowing the application to see the surface contents.
3768
 *      This flag is a hint to the driver that it can skip the un-re-ordering process
3776
 *      This flag is a hint to the driver that it can skip the un-re-ordering process
3769
 *      since the application plans to overwrite every single pixel in the surface
3777
 *      since the application plans to overwrite every single pixel in the surface
3770
 *      or locked rectangle (and so erase any un-re-ordered pixels anyway).
3778
 *      or locked rectangle (and so erase any un-re-ordered pixels anyway).
3771
 *      Applications should always set this flag when they intend to overwrite the entire
3779
 *      Applications should always set this flag when they intend to overwrite the entire
3772
 *      surface or locked rectangle.
3780
 *      surface or locked rectangle.
3773
 *)
3781
 *)
3774
  DDLOCK_DISCARDCONTENTS                  = $00002000;
3782
  DDLOCK_DISCARDCONTENTS                  = $00002000;
3775
 (*
3783
 (*
3776
  * DDLOCK_OKTOSWAP is an older, less informative name for DDLOCK_DISCARDCONTENTS
3784
  * DDLOCK_OKTOSWAP is an older, less informative name for DDLOCK_DISCARDCONTENTS
3777
  *)
3785
  *)
3778
  DDLOCK_OKTOSWAP                         = $00002000;
3786
  DDLOCK_OKTOSWAP                         = $00002000;
3779
 
3787
 
3780
(*
3788
(*
3781
 * On IDirectDrawSurface7 and higher interfaces, the default is DDLOCK_WAIT. If you wish
3789
 * On IDirectDrawSurface7 and higher interfaces, the default is DDLOCK_WAIT. If you wish
3782
 * to override the default and use time when the accelerator is busy (as denoted by
3790
 * to override the default and use time when the accelerator is busy (as denoted by
3783
 * the DDERR_WASSTILLDRAWING return code) then use DDLOCK_DONOTWAIT.
3791
 * the DDERR_WASSTILLDRAWING return code) then use DDLOCK_DONOTWAIT.
3784
 *)
3792
 *)
3785
  DDLOCK_DONOTWAIT                        = $00004000;
3793
  DDLOCK_DONOTWAIT                        = $00004000;
3786
 
3794
 
3787
 
3795
 
3788
(****************************************************************************
3796
(****************************************************************************
3789
 *
3797
 *
3790
 * DIRECTDRAWSURFACE PAGELOCK FLAGS
3798
 * DIRECTDRAWSURFACE PAGELOCK FLAGS
3791
 *
3799
 *
3792
 ****************************************************************************)
3800
 ****************************************************************************)
3793
 
3801
 
3794
(*
3802
(*
3795
 * No flags defined at present
3803
 * No flags defined at present
3796
 *)
3804
 *)
3797
 
3805
 
3798
 
3806
 
3799
(****************************************************************************
3807
(****************************************************************************
3800
 *
3808
 *
3801
 * DIRECTDRAWSURFACE PAGEUNLOCK FLAGS
3809
 * DIRECTDRAWSURFACE PAGEUNLOCK FLAGS
3802
 *
3810
 *
3803
 ****************************************************************************)
3811
 ****************************************************************************)
3804
 
3812
 
3805
(*
3813
(*
3806
 * No flags defined at present
3814
 * No flags defined at present
3807
 *)
3815
 *)
3808
 
3816
 
3809
 
3817
 
3810
(****************************************************************************
3818
(****************************************************************************
3811
 *
3819
 *
3812
 * DIRECTDRAWSURFACE BLT FX FLAGS
3820
 * DIRECTDRAWSURFACE BLT FX FLAGS
3813
 *
3821
 *
3814
 ****************************************************************************)
3822
 ****************************************************************************)
3815
 
3823
 
3816
(*
3824
(*
3817
 * If stretching, use arithmetic stretching along the Y axis for this blt.
3825
 * If stretching, use arithmetic stretching along the Y axis for this blt.
3818
 *)
3826
 *)
3819
  DDBLTFX_ARITHSTRETCHY                   = $00000001;
3827
  DDBLTFX_ARITHSTRETCHY                   = $00000001;
3820
 
3828
 
3821
(*
3829
(*
3822
 * Do this blt mirroring the surface left to right.  Spin the
3830
 * Do this blt mirroring the surface left to right.  Spin the
3823
 * surface around its y-axis.
3831
 * surface around its y-axis.
3824
 *)
3832
 *)
3825
  DDBLTFX_MIRRORLEFTRIGHT                 = $00000002;
3833
  DDBLTFX_MIRRORLEFTRIGHT                 = $00000002;
3826
 
3834
 
3827
(*
3835
(*
3828
 * Do this blt mirroring the surface up and down.  Spin the surface
3836
 * Do this blt mirroring the surface up and down.  Spin the surface
3829
 * around its x-axis.
3837
 * around its x-axis.
3830
 *)
3838
 *)
3831
  DDBLTFX_MIRRORUPDOWN                    = $00000004;
3839
  DDBLTFX_MIRRORUPDOWN                    = $00000004;
3832
 
3840
 
3833
(*
3841
(*
3834
 * Schedule this blt to avoid tearing.
3842
 * Schedule this blt to avoid tearing.
3835
 *)
3843
 *)
3836
  DDBLTFX_NOTEARING                       = $00000008;
3844
  DDBLTFX_NOTEARING                       = $00000008;
3837
 
3845
 
3838
(*
3846
(*
3839
 * Do this blt rotating the surface one hundred and eighty degrees.
3847
 * Do this blt rotating the surface one hundred and eighty degrees.
3840
 *)
3848
 *)
3841
  DDBLTFX_ROTATE180                       = $00000010;
3849
  DDBLTFX_ROTATE180                       = $00000010;
3842
 
3850
 
3843
(*
3851
(*
3844
 * Do this blt rotating the surface two hundred and seventy degrees.
3852
 * Do this blt rotating the surface two hundred and seventy degrees.
3845
 *)
3853
 *)
3846
  DDBLTFX_ROTATE270                       = $00000020;
3854
  DDBLTFX_ROTATE270                       = $00000020;
3847
 
3855
 
3848
(*
3856
(*
3849
 * Do this blt rotating the surface ninety degrees.
3857
 * Do this blt rotating the surface ninety degrees.
3850
 *)
3858
 *)
3851
  DDBLTFX_ROTATE90                        = $00000040;
3859
  DDBLTFX_ROTATE90                        = $00000040;
3852
 
3860
 
3853
(*
3861
(*
3854
 * Do this z blt using dwZBufferLow and dwZBufferHigh as  range values
3862
 * Do this z blt using dwZBufferLow and dwZBufferHigh as  range values
3855
 * specified to limit the bits copied from the source surface.
3863
 * specified to limit the bits copied from the source surface.
3856
 *)
3864
 *)
3857
  DDBLTFX_ZBUFFERRANGE                    = $00000080;
3865
  DDBLTFX_ZBUFFERRANGE                    = $00000080;
3858
 
3866
 
3859
(*
3867
(*
3860
 * Do this z blt adding the dwZBufferBaseDest to each of the sources z values
3868
 * Do this z blt adding the dwZBufferBaseDest to each of the sources z values
3861
 * before comparing it with the desting z values.
3869
 * before comparing it with the desting z values.
3862
 *)
3870
 *)
3863
  DDBLTFX_ZBUFFERBASEDEST                 = $00000100;
3871
  DDBLTFX_ZBUFFERBASEDEST                 = $00000100;
3864
 
3872
 
3865
(****************************************************************************
3873
(****************************************************************************
3866
 *
3874
 *
3867
 * DIRECTDRAWSURFACE OVERLAY FX FLAGS
3875
 * DIRECTDRAWSURFACE OVERLAY FX FLAGS
3868
 *
3876
 *
3869
 ****************************************************************************)
3877
 ****************************************************************************)
3870
 
3878
 
3871
(*
3879
(*
3872
 * If stretching, use arithmetic stretching along the Y axis for this overlay.
3880
 * If stretching, use arithmetic stretching along the Y axis for this overlay.
3873
 *)
3881
 *)
3874
  DDOVERFX_ARITHSTRETCHY                  = $00000001;
3882
  DDOVERFX_ARITHSTRETCHY                  = $00000001;
3875
 
3883
 
3876
(*
3884
(*
3877
 * Mirror the overlay across the vertical axis
3885
 * Mirror the overlay across the vertical axis
3878
 *)
3886
 *)
3879
  DDOVERFX_MIRRORLEFTRIGHT                = $00000002;
3887
  DDOVERFX_MIRRORLEFTRIGHT                = $00000002;
3880
 
3888
 
3881
(*
3889
(*
3882
 * Mirror the overlay across the horizontal axis
3890
 * Mirror the overlay across the horizontal axis
3883
 *)
3891
 *)
3884
  DDOVERFX_MIRRORUPDOWN                   = $00000004;
3892
  DDOVERFX_MIRRORUPDOWN                   = $00000004;
3885
 
3893
 
3886
(****************************************************************************
3894
(****************************************************************************
3887
 *
3895
 *
3888
 * Flags for dwDDFX member of DDSPRITEFX structure
3896
 * Flags for dwDDFX member of DDSPRITEFX structure
3889
 *
3897
 *
3890
 ****************************************************************************)
3898
 ****************************************************************************)
3891
(*
3899
(*
3892
 * Use affine transformation matrix in fTransform member.
3900
 * Use affine transformation matrix in fTransform member.
3893
 *)
3901
 *)
3894
  DDSPRITEFX_AFFINETRANSFORM            = $00000001;
3902
  DDSPRITEFX_AFFINETRANSFORM            = $00000001;
3895
 
3903
 
3896
(*
3904
(*
3897
 * Use RGBA scaling factors in ddrgbaScaleFactors member.
3905
 * Use RGBA scaling factors in ddrgbaScaleFactors member.
3898
 *)
3906
 *)
3899
  DDSPRITEFX_RGBASCALING                        = $00000002;
3907
  DDSPRITEFX_RGBASCALING                        = $00000002;
3900
 
3908
 
3901
(*
3909
(*
3902
 * Degrade RGBA scaling factors to accommodate driver's capabilities.
3910
 * Degrade RGBA scaling factors to accommodate driver's capabilities.
3903
 *)
3911
 *)
3904
  DDSPRITEFX_DEGRADERGBASCALING         = $00000004;
3912
  DDSPRITEFX_DEGRADERGBASCALING         = $00000004;
3905
 
3913
 
3906
(*
3914
(*
3907
 * Do bilinear filtering of stretched or warped sprite.
3915
 * Do bilinear filtering of stretched or warped sprite.
3908
 *)
3916
 *)
3909
  DDSPRITEFX_BILINEARFILTER                     = $00000008;
3917
  DDSPRITEFX_BILINEARFILTER                     = $00000008;
3910
 
3918
 
3911
(*
3919
(*
3912
 * Do "blur" filtering of stretched or warped sprite.
3920
 * Do "blur" filtering of stretched or warped sprite.
3913
 *)
3921
 *)
3914
  DDSPRITEFX_BLURFILTER                         = $00000010;
3922
  DDSPRITEFX_BLURFILTER                         = $00000010;
3915
 
3923
 
3916
(*
3924
(*
3917
 * Do "flat" filtering of stretched or warped sprite.
3925
 * Do "flat" filtering of stretched or warped sprite.
3918
 *)
3926
 *)
3919
  DDSPRITEFX_FLATFILTER                         = $00000020;
3927
  DDSPRITEFX_FLATFILTER                         = $00000020;
3920
 
3928
 
3921
(*
3929
(*
3922
 * Degrade filtering operation to accommodate driver's capabilities.
3930
 * Degrade filtering operation to accommodate driver's capabilities.
3923
 *)
3931
 *)
3924
  DDSPRITEFX_DEGRADEFILTER              = $00000040;
3932
  DDSPRITEFX_DEGRADEFILTER              = $00000040;
3925
 
3933
 
3926
(****************************************************************************
3934
(****************************************************************************
3927
 *
3935
 *
3928
 * DIRECTDRAW WAITFORVERTICALBLANK FLAGS
3936
 * DIRECTDRAW WAITFORVERTICALBLANK FLAGS
3929
 *
3937
 *
3930
 ****************************************************************************)
3938
 ****************************************************************************)
3931
 
3939
 
3932
(*
3940
(*
3933
 * return when the vertical blank interval begins
3941
 * return when the vertical blank interval begins
3934
 *)
3942
 *)
3935
  DDWAITVB_BLOCKBEGIN                     = $00000001;
3943
  DDWAITVB_BLOCKBEGIN                     = $00000001;
3936
 
3944
 
3937
(*
3945
(*
3938
 * set up an event to trigger when the vertical blank begins
3946
 * set up an event to trigger when the vertical blank begins
3939
 *)
3947
 *)
3940
  DDWAITVB_BLOCKBEGINEVENT                = $00000002;
3948
  DDWAITVB_BLOCKBEGINEVENT                = $00000002;
3941
 
3949
 
3942
(*
3950
(*
3943
 * return when the vertical blank interval ends and display begins
3951
 * return when the vertical blank interval ends and display begins
3944
 *)
3952
 *)
3945
  DDWAITVB_BLOCKEND                       = $00000004;
3953
  DDWAITVB_BLOCKEND                       = $00000004;
3946
 
3954
 
3947
(****************************************************************************
3955
(****************************************************************************
3948
 *
3956
 *
3949
 * DIRECTDRAW GETFLIPSTATUS FLAGS
3957
 * DIRECTDRAW GETFLIPSTATUS FLAGS
3950
 *
3958
 *
3951
 ****************************************************************************)
3959
 ****************************************************************************)
3952
 
3960
 
3953
(*
3961
(*
3954
 * is it OK to flip now?
3962
 * is it OK to flip now?
3955
 *)
3963
 *)
3956
  DDGFS_CANFLIP                   = $00000001;
3964
  DDGFS_CANFLIP                   = $00000001;
3957
 
3965
 
3958
(*
3966
(*
3959
 * is the last flip finished?
3967
 * is the last flip finished?
3960
 *)
3968
 *)
3961
  DDGFS_ISFLIPDONE                = $00000002;
3969
  DDGFS_ISFLIPDONE                = $00000002;
3962
 
3970
 
3963
(****************************************************************************
3971
(****************************************************************************
3964
 *
3972
 *
3965
 * DIRECTDRAW GETBLTSTATUS FLAGS
3973
 * DIRECTDRAW GETBLTSTATUS FLAGS
3966
 *
3974
 *
3967
 ****************************************************************************)
3975
 ****************************************************************************)
3968
 
3976
 
3969
(*
3977
(*
3970
 * is it OK to blt now?
3978
 * is it OK to blt now?
3971
 *)
3979
 *)
3972
  DDGBS_CANBLT                    = $00000001;
3980
  DDGBS_CANBLT                    = $00000001;
3973
 
3981
 
3974
(*
3982
(*
3975
 * is the blt to the surface finished?
3983
 * is the blt to the surface finished?
3976
 *)
3984
 *)
3977
  DDGBS_ISBLTDONE                 = $00000002;
3985
  DDGBS_ISBLTDONE                 = $00000002;
3978
 
3986
 
3979
 
3987
 
3980
(****************************************************************************
3988
(****************************************************************************
3981
 *
3989
 *
3982
 * DIRECTDRAW ENUMOVERLAYZORDER FLAGS
3990
 * DIRECTDRAW ENUMOVERLAYZORDER FLAGS
3983
 *
3991
 *
3984
 ****************************************************************************)
3992
 ****************************************************************************)
3985
 
3993
 
3986
(*
3994
(*
3987
 * Enumerate overlays back to front.
3995
 * Enumerate overlays back to front.
3988
 *)
3996
 *)
3989
  DDENUMOVERLAYZ_BACKTOFRONT      = $00000000;
3997
  DDENUMOVERLAYZ_BACKTOFRONT      = $00000000;
3990
 
3998
 
3991
(*
3999
(*
3992
 * Enumerate overlays front to back
4000
 * Enumerate overlays front to back
3993
 *)
4001
 *)
3994
  DDENUMOVERLAYZ_FRONTTOBACK      = $00000001;
4002
  DDENUMOVERLAYZ_FRONTTOBACK      = $00000001;
3995
 
4003
 
3996
(****************************************************************************
4004
(****************************************************************************
3997
 *
4005
 *
3998
 * DIRECTDRAW UPDATEOVERLAYZORDER FLAGS
4006
 * DIRECTDRAW UPDATEOVERLAYZORDER FLAGS
3999
 *
4007
 *
4000
 ****************************************************************************)
4008
 ****************************************************************************)
4001
 
4009
 
4002
(*
4010
(*
4003
 * Send overlay to front
4011
 * Send overlay to front
4004
 *)
4012
 *)
4005
  DDOVERZ_SENDTOFRONT             = $00000000;
4013
  DDOVERZ_SENDTOFRONT             = $00000000;
4006
 
4014
 
4007
(*
4015
(*
4008
 * Send overlay to back
4016
 * Send overlay to back
4009
 *)
4017
 *)
4010
  DDOVERZ_SENDTOBACK              = $00000001;
4018
  DDOVERZ_SENDTOBACK              = $00000001;
4011
 
4019
 
4012
(*
4020
(*
4013
 * Move Overlay forward
4021
 * Move Overlay forward
4014
 *)
4022
 *)
4015
  DDOVERZ_MOVEFORWARD             = $00000002;
4023
  DDOVERZ_MOVEFORWARD             = $00000002;
4016
 
4024
 
4017
(*
4025
(*
4018
 * Move Overlay backward
4026
 * Move Overlay backward
4019
 *)
4027
 *)
4020
  DDOVERZ_MOVEBACKWARD            = $00000003;
4028
  DDOVERZ_MOVEBACKWARD            = $00000003;
4021
 
4029
 
4022
(*
4030
(*
4023
 * Move Overlay in front of relative surface
4031
 * Move Overlay in front of relative surface
4024
 *)
4032
 *)
4025
  DDOVERZ_INSERTINFRONTOF         = $00000004;
4033
  DDOVERZ_INSERTINFRONTOF         = $00000004;
4026
 
4034
 
4027
(*
4035
(*
4028
 * Move Overlay in back of relative surface
4036
 * Move Overlay in back of relative surface
4029
 *)
4037
 *)
4030
  DDOVERZ_INSERTINBACKOF          = $00000005;
4038
  DDOVERZ_INSERTINBACKOF          = $00000005;
4031
 
4039
 
4032
(****************************************************************************
4040
(****************************************************************************
4033
 *
4041
 *
4034
 * DIRECTDRAW SETGAMMARAMP FLAGS
4042
 * DIRECTDRAW SETGAMMARAMP FLAGS
4035
 *
4043
 *
4036
 ****************************************************************************)
4044
 ****************************************************************************)
4037
 
4045
 
4038
(*
4046
(*
4039
 * Request calibrator to adjust the gamma ramp according to the physical
4047
 * Request calibrator to adjust the gamma ramp according to the physical
4040
 * properties of the display so that the result should appear identical
4048
 * properties of the display so that the result should appear identical
4041
 * on all systems.
4049
 * on all systems.
4042
 *)
4050
 *)
4043
  DDSGR_CALIBRATE                        = $00000001;
4051
  DDSGR_CALIBRATE                        = $00000001;
4044
 
4052
 
4045
(****************************************************************************
4053
(****************************************************************************
4046
 *
4054
 *
4047
 * DIRECTDRAW STARTMODETEST FLAGS
4055
 * DIRECTDRAW STARTMODETEST FLAGS
4048
 *
4056
 *
4049
 ****************************************************************************)
4057
 ****************************************************************************)
4050
 
4058
 
4051
(*
4059
(*
4052
 * Indicates that the mode being tested has passed
4060
 * Indicates that the mode being tested has passed
4053
 *)
4061
 *)
4054
 DDSMT_ISTESTREQUIRED                   = $00000001;
4062
 DDSMT_ISTESTREQUIRED                   = $00000001;
4055
 
4063
 
4056
 
4064
 
4057
(****************************************************************************
4065
(****************************************************************************
4058
 *
4066
 *
4059
 * DIRECTDRAW EVALUATEMODE FLAGS
4067
 * DIRECTDRAW EVALUATEMODE FLAGS
4060
 *
4068
 *
4061
 ****************************************************************************)
4069
 ****************************************************************************)
4062
 
4070
 
4063
(*
4071
(*
4064
 * Indicates that the mode being tested has passed
4072
 * Indicates that the mode being tested has passed
4065
 *)
4073
 *)
4066
 DDEM_MODEPASSED                        = $00000001;
4074
 DDEM_MODEPASSED                        = $00000001;
4067
 
4075
 
4068
(*
4076
(*
4069
 * Indicates that the mode being tested has failed
4077
 * Indicates that the mode being tested has failed
4070
 *)
4078
 *)
4071
 DDEM_MODEFAILED                        = $00000002;
4079
 DDEM_MODEFAILED                        = $00000002;
4072
 
4080
 
4073
(*===========================================================================
4081
(*===========================================================================
4074
 *
4082
 *
4075
 *
4083
 *
4076
 * DIRECTDRAW RETURN CODES
4084
 * DIRECTDRAW RETURN CODES
4077
 *
4085
 *
4078
 * The return values from DirectDraw Commands and Surface that return an HResult
4086
 * The return values from DirectDraw Commands and Surface that return an HResult
4079
 * are codes from DirectDraw concerning the results of the action
4087
 * are codes from DirectDraw concerning the results of the action
4080
 * requested by DirectDraw.
4088
 * requested by DirectDraw.
4081
 *
4089
 *
4082
 *==========================================================================*)
4090
 *==========================================================================*)
4083
 
4091
 
4084
(*
4092
(*
4085
 * Status is OK
4093
 * Status is OK
4086
 *
4094
 *
4087
 * Issued by: DirectDraw Commands and all callbacks
4095
 * Issued by: DirectDraw Commands and all callbacks
4088
 *)
4096
 *)
4089
  DD_OK                                   = 0;
4097
  DD_OK                                   = 0;
4090
  DD_FALSE                                = S_FALSE;
4098
  DD_FALSE                                = S_FALSE;
4091
 
4099
 
4092
(****************************************************************************
4100
(****************************************************************************
4093
 *
4101
 *
4094
 * DIRECTDRAW ENUMCALLBACK RETURN VALUES
4102
 * DIRECTDRAW ENUMCALLBACK RETURN VALUES
4095
 *
4103
 *
4096
 * EnumCallback returns are used to control the flow of the DIRECTDRAW and
4104
 * EnumCallback returns are used to control the flow of the DIRECTDRAW and
4097
 * DIRECTDRAWSURFACE object enumerations.   They can only be returned by
4105
 * DIRECTDRAWSURFACE object enumerations.   They can only be returned by
4098
 * enumeration callback routines.
4106
 * enumeration callback routines.
4099
 *
4107
 *
4100
 ****************************************************************************)
4108
 ****************************************************************************)
4101
 
4109
 
4102
(*
4110
(*
4103
 * stop the enumeration
4111
 * stop the enumeration
4104
 *)
4112
 *)
4105
  DDENUMRET_CANCEL                        = 0;
4113
  DDENUMRET_CANCEL                        = 0;
4106
 
4114
 
4107
(*
4115
(*
4108
 * continue the enumeration
4116
 * continue the enumeration
4109
 *)
4117
 *)
4110
  DDENUMRET_OK                            = 1;
4118
  DDENUMRET_OK                            = 1;
4111
 
4119
 
4112
(****************************************************************************
4120
(****************************************************************************
4113
 *
4121
 *
4114
 * DIRECTDRAW ERRORS
4122
 * DIRECTDRAW ERRORS
4115
 *
4123
 *
4116
 * Errors are represented by negative values and cannot be combined.
4124
 * Errors are represented by negative values and cannot be combined.
4117
 *
4125
 *
4118
 ****************************************************************************)
4126
 ****************************************************************************)
4119
 
4127
 
4120
  _FACDD = $876;
4128
  _FACDD = $876;
4121
  MAKE_DDHRESULT = HResult(1 shl 31) or HResult(_FACDD shl 16);
4129
  MAKE_DDHRESULT = HResult(1 shl 31) or HResult(_FACDD shl 16);
4122
 
4130
 
4123
 
4131
 
4124
(*
4132
(*
4125
 * This object is already initialized
4133
 * This object is already initialized
4126
 *)
4134
 *)
4127
  DDERR_ALREADYINITIALIZED                = MAKE_DDHRESULT + 5;
4135
  DDERR_ALREADYINITIALIZED                = MAKE_DDHRESULT + 5;
4128
 
4136
 
4129
(*
4137
(*
4130
 * This surface can not be attached to the requested surface.
4138
 * This surface can not be attached to the requested surface.
4131
 *)
4139
 *)
4132
  DDERR_CANNOTATTACHSURFACE               = MAKE_DDHRESULT + 10;
4140
  DDERR_CANNOTATTACHSURFACE               = MAKE_DDHRESULT + 10;
4133
 
4141
 
4134
(*
4142
(*
4135
 * This surface can not be detached from the requested surface.
4143
 * This surface can not be detached from the requested surface.
4136
 *)
4144
 *)
4137
  DDERR_CANNOTDETACHSURFACE               = MAKE_DDHRESULT + 20;
4145
  DDERR_CANNOTDETACHSURFACE               = MAKE_DDHRESULT + 20;
4138
 
4146
 
4139
(*
4147
(*
4140
 * Support is currently not available.
4148
 * Support is currently not available.
4141
 *)
4149
 *)
4142
  DDERR_CURRENTLYNOTAVAIL                 = MAKE_DDHRESULT + 40;
4150
  DDERR_CURRENTLYNOTAVAIL                 = MAKE_DDHRESULT + 40;
4143
 
4151
 
4144
(*
4152
(*
4145
 * An exception was encountered while performing the requested operation
4153
 * An exception was encountered while performing the requested operation
4146
 *)
4154
 *)
4147
  DDERR_EXCEPTION                         = MAKE_DDHRESULT + 55;
4155
  DDERR_EXCEPTION                         = MAKE_DDHRESULT + 55;
4148
 
4156
 
4149
(*
4157
(*
4150
 * Generic failure.
4158
 * Generic failure.
4151
 *)
4159
 *)
4152
  DDERR_GENERIC                           = E_FAIL;
4160
  DDERR_GENERIC                           = E_FAIL;
4153
 
4161
 
4154
(*
4162
(*
4155
 * Height of rectangle provided is not a multiple of reqd alignment
4163
 * Height of rectangle provided is not a multiple of reqd alignment
4156
 *)
4164
 *)
4157
  DDERR_HEIGHTALIGN                       = MAKE_DDHRESULT + 90;
4165
  DDERR_HEIGHTALIGN                       = MAKE_DDHRESULT + 90;
4158
 
4166
 
4159
(*
4167
(*
4160
 * Unable to match primary surface creation request with existing
4168
 * Unable to match primary surface creation request with existing
4161
 * primary surface.
4169
 * primary surface.
4162
 *)
4170
 *)
4163
  DDERR_INCOMPATIBLEPRIMARY               = MAKE_DDHRESULT + 95;
4171
  DDERR_INCOMPATIBLEPRIMARY               = MAKE_DDHRESULT + 95;
4164
 
4172
 
4165
(*
4173
(*
4166
 * One or more of the caps bits passed to the callback are incorrect.
4174
 * One or more of the caps bits passed to the callback are incorrect.
4167
 *)
4175
 *)
4168
  DDERR_INVALIDCAPS                       = MAKE_DDHRESULT + 100;
4176
  DDERR_INVALIDCAPS                       = MAKE_DDHRESULT + 100;
4169
 
4177
 
4170
(*
4178
(*
4171
 * DirectDraw does not support provided Cliplist.
4179
 * DirectDraw does not support provided Cliplist.
4172
 *)
4180
 *)
4173
  DDERR_INVALIDCLIPLIST                   = MAKE_DDHRESULT + 110;
4181
  DDERR_INVALIDCLIPLIST                   = MAKE_DDHRESULT + 110;
4174
 
4182
 
4175
(*
4183
(*
4176
 * DirectDraw does not support the requested mode
4184
 * DirectDraw does not support the requested mode
4177
 *)
4185
 *)
4178
  DDERR_INVALIDMODE                       = MAKE_DDHRESULT + 120;
4186
  DDERR_INVALIDMODE                       = MAKE_DDHRESULT + 120;
4179
 
4187
 
4180
(*
4188
(*
4181
 * DirectDraw received a pointer that was an invalid DIRECTDRAW object.
4189
 * DirectDraw received a pointer that was an invalid DIRECTDRAW object.
4182
 *)
4190
 *)
4183
  DDERR_INVALIDOBJECT                     = MAKE_DDHRESULT + 130;
4191
  DDERR_INVALIDOBJECT                     = MAKE_DDHRESULT + 130;
4184
 
4192
 
4185
(*
4193
(*
4186
 * One or more of the parameters passed to the callback function are
4194
 * One or more of the parameters passed to the callback function are
4187
 * incorrect.
4195
 * incorrect.
4188
 *)
4196
 *)
4189
  DDERR_INVALIDPARAMS                     = E_INVALIDARG;
4197
  DDERR_INVALIDPARAMS                     = E_INVALIDARG;
4190
 
4198
 
4191
(*
4199
(*
4192
 * pixel format was invalid as specified
4200
 * pixel format was invalid as specified
4193
 *)
4201
 *)
4194
  DDERR_INVALIDPIXELFORMAT                = MAKE_DDHRESULT + 145;
4202
  DDERR_INVALIDPIXELFORMAT                = MAKE_DDHRESULT + 145;
4195
 
4203
 
4196
(*
4204
(*
4197
 * Rectangle provided was invalid.
4205
 * Rectangle provided was invalid.
4198
 *)
4206
 *)
4199
  DDERR_INVALIDRECT                       = MAKE_DDHRESULT + 150;
4207
  DDERR_INVALIDRECT                       = MAKE_DDHRESULT + 150;
4200
 
4208
 
4201
(*
4209
(*
4202
 * Operation could not be carried out because one or more surfaces are locked
4210
 * Operation could not be carried out because one or more surfaces are locked
4203
 *)
4211
 *)
4204
  DDERR_LOCKEDSURFACES                    = MAKE_DDHRESULT + 160;
4212
  DDERR_LOCKEDSURFACES                    = MAKE_DDHRESULT + 160;
4205
 
4213
 
4206
(*
4214
(*
4207
 * There is no 3D present.
4215
 * There is no 3D present.
4208
 *)
4216
 *)
4209
  DDERR_NO3D                              = MAKE_DDHRESULT + 170;
4217
  DDERR_NO3D                              = MAKE_DDHRESULT + 170;
4210
 
4218
 
4211
(*
4219
(*
4212
 * Operation could not be carried out because there is no alpha accleration
4220
 * Operation could not be carried out because there is no alpha accleration
4213
 * hardware present or available.
4221
 * hardware present or available.
4214
 *)
4222
 *)
4215
  DDERR_NOALPHAHW                         = MAKE_DDHRESULT + 180;
4223
  DDERR_NOALPHAHW                         = MAKE_DDHRESULT + 180;
4216
 
4224
 
4217
(*
4225
(*
4218
 * Operation could not be carried out because there is no stereo
4226
 * Operation could not be carried out because there is no stereo
4219
 * hardware present or available.
4227
 * hardware present or available.
4220
 *)
4228
 *)
4221
  DDERR_NOSTEREOHARDWARE          = MAKE_DDHRESULT + 181;
4229
  DDERR_NOSTEREOHARDWARE          = MAKE_DDHRESULT + 181;
4222
 
4230
 
4223
(*
4231
(*
4224
 * Operation could not be carried out because there is no hardware
4232
 * Operation could not be carried out because there is no hardware
4225
 * present which supports stereo surfaces
4233
 * present which supports stereo surfaces
4226
 *)
4234
 *)
4227
  DDERR_NOSURFACELEFT             = MAKE_DDHRESULT + 182;
4235
  DDERR_NOSURFACELEFT             = MAKE_DDHRESULT + 182;
4228
 
4236
 
4229
(*
4237
(*
4230
 * no clip list available
4238
 * no clip list available
4231
 *)
4239
 *)
4232
  DDERR_NOCLIPLIST                        = MAKE_DDHRESULT + 205;
4240
  DDERR_NOCLIPLIST                        = MAKE_DDHRESULT + 205;
4233
 
4241
 
4234
(*
4242
(*
4235
 * Operation could not be carried out because there is no color conversion
4243
 * Operation could not be carried out because there is no color conversion
4236
 * hardware present or available.
4244
 * hardware present or available.
4237
 *)
4245
 *)
4238
  DDERR_NOCOLORCONVHW                     = MAKE_DDHRESULT + 210;
4246
  DDERR_NOCOLORCONVHW                     = MAKE_DDHRESULT + 210;
4239
 
4247
 
4240
(*
4248
(*
4241
 * Create function called without DirectDraw object method SetCooperativeLevel
4249
 * Create function called without DirectDraw object method SetCooperativeLevel
4242
 * being called.
4250
 * being called.
4243
 *)
4251
 *)
4244
  DDERR_NOCOOPERATIVELEVELSET             = MAKE_DDHRESULT + 212;
4252
  DDERR_NOCOOPERATIVELEVELSET             = MAKE_DDHRESULT + 212;
4245
 
4253
 
4246
(*
4254
(*
4247
 * Surface doesn't currently have a color key
4255
 * Surface doesn't currently have a color key
4248
 *)
4256
 *)
4249
  DDERR_NOCOLORKEY                        = MAKE_DDHRESULT + 215;
4257
  DDERR_NOCOLORKEY                        = MAKE_DDHRESULT + 215;
4250
 
4258
 
4251
(*
4259
(*
4252
 * Operation could not be carried out because there is no hardware support
4260
 * Operation could not be carried out because there is no hardware support
4253
 * of the dest color key.
4261
 * of the dest color key.
4254
 *)
4262
 *)
4255
  DDERR_NOCOLORKEYHW                      = MAKE_DDHRESULT + 220;
4263
  DDERR_NOCOLORKEYHW                      = MAKE_DDHRESULT + 220;
4256
 
4264
 
4257
(*
4265
(*
4258
 * No DirectDraw support possible with current display driver
4266
 * No DirectDraw support possible with current display driver
4259
 *)
4267
 *)
4260
  DDERR_NODIRECTDRAWSUPPORT               = MAKE_DDHRESULT + 222;
4268
  DDERR_NODIRECTDRAWSUPPORT               = MAKE_DDHRESULT + 222;
4261
 
4269
 
4262
(*
4270
(*
4263
 * Operation requires the application to have exclusive mode but the
4271
 * Operation requires the application to have exclusive mode but the
4264
 * application does not have exclusive mode.
4272
 * application does not have exclusive mode.
4265
 *)
4273
 *)
4266
  DDERR_NOEXCLUSIVEMODE                   = MAKE_DDHRESULT + 225;
4274
  DDERR_NOEXCLUSIVEMODE                   = MAKE_DDHRESULT + 225;
4267
 
4275
 
4268
(*
4276
(*
4269
 * Flipping visible surfaces is not supported.
4277
 * Flipping visible surfaces is not supported.
4270
 *)
4278
 *)
4271
  DDERR_NOFLIPHW                          = MAKE_DDHRESULT + 230;
4279
  DDERR_NOFLIPHW                          = MAKE_DDHRESULT + 230;
4272
 
4280
 
4273
(*
4281
(*
4274
 * There is no GDI present.
4282
 * There is no GDI present.
4275
 *)
4283
 *)
4276
  DDERR_NOGDI                             = MAKE_DDHRESULT + 240;
4284
  DDERR_NOGDI                             = MAKE_DDHRESULT + 240;
4277
 
4285
 
4278
(*
4286
(*
4279
 * Operation could not be carried out because there is no hardware present
4287
 * Operation could not be carried out because there is no hardware present
4280
 * or available.
4288
 * or available.
4281
 *)
4289
 *)
4282
  DDERR_NOMIRRORHW                        = MAKE_DDHRESULT + 250;
4290
  DDERR_NOMIRRORHW                        = MAKE_DDHRESULT + 250;
4283
 
4291
 
4284
(*
4292
(*
4285
 * Requested item was not found
4293
 * Requested item was not found
4286
 *)
4294
 *)
4287
  DDERR_NOTFOUND                          = MAKE_DDHRESULT + 255;
4295
  DDERR_NOTFOUND                          = MAKE_DDHRESULT + 255;
4288
 
4296
 
4289
(*
4297
(*
4290
 * Operation could not be carried out because there is no overlay hardware
4298
 * Operation could not be carried out because there is no overlay hardware
4291
 * present or available.
4299
 * present or available.
4292
 *)
4300
 *)
4293
  DDERR_NOOVERLAYHW                       = MAKE_DDHRESULT + 260;
4301
  DDERR_NOOVERLAYHW                       = MAKE_DDHRESULT + 260;
4294
 
4302
 
4295
(*
4303
(*
4296
 * Operation could not be carried out because the source and destination
4304
 * Operation could not be carried out because the source and destination
4297
 * rectangles are on the same surface and overlap each other.
4305
 * rectangles are on the same surface and overlap each other.
4298
 *)
4306
 *)
4299
  DDERR_OVERLAPPINGRECTS                = MAKE_DDHRESULT + 270;
4307
  DDERR_OVERLAPPINGRECTS                = MAKE_DDHRESULT + 270;
4300
 
4308
 
4301
(*
4309
(*
4302
 * Operation could not be carried out because there is no appropriate raster
4310
 * Operation could not be carried out because there is no appropriate raster
4303
 * op hardware present or available.
4311
 * op hardware present or available.
4304
 *)
4312
 *)
4305
  DDERR_NORASTEROPHW                      = MAKE_DDHRESULT + 280;
4313
  DDERR_NORASTEROPHW                      = MAKE_DDHRESULT + 280;
4306
 
4314
 
4307
(*
4315
(*
4308
 * Operation could not be carried out because there is no rotation hardware
4316
 * Operation could not be carried out because there is no rotation hardware
4309
 * present or available.
4317
 * present or available.
4310
 *)
4318
 *)
4311
  DDERR_NOROTATIONHW                      = MAKE_DDHRESULT + 290;
4319
  DDERR_NOROTATIONHW                      = MAKE_DDHRESULT + 290;
4312
 
4320
 
4313
(*
4321
(*
4314
 * Operation could not be carried out because there is no hardware support
4322
 * Operation could not be carried out because there is no hardware support
4315
 * for stretching
4323
 * for stretching
4316
 *)
4324
 *)
4317
  DDERR_NOSTRETCHHW                       = MAKE_DDHRESULT + 310;
4325
  DDERR_NOSTRETCHHW                       = MAKE_DDHRESULT + 310;
4318
 
4326
 
4319
(*
4327
(*
4320
 * DirectDrawSurface is not in 4 bit color palette and the requested operation
4328
 * DirectDrawSurface is not in 4 bit color palette and the requested operation
4321
 * requires 4 bit color palette.
4329
 * requires 4 bit color palette.
4322
 *)
4330
 *)
4323
  DDERR_NOT4BITCOLOR                      = MAKE_DDHRESULT + 316;
4331
  DDERR_NOT4BITCOLOR                      = MAKE_DDHRESULT + 316;
4324
 
4332
 
4325
(*
4333
(*
4326
 * DirectDrawSurface is not in 4 bit color index palette and the requested
4334
 * DirectDrawSurface is not in 4 bit color index palette and the requested
4327
 * operation requires 4 bit color index palette.
4335
 * operation requires 4 bit color index palette.
4328
 *)
4336
 *)
4329
  DDERR_NOT4BITCOLORINDEX                 = MAKE_DDHRESULT + 317;
4337
  DDERR_NOT4BITCOLORINDEX                 = MAKE_DDHRESULT + 317;
4330
 
4338
 
4331
(*
4339
(*
4332
 * DirectDraw Surface is not in 8 bit color mode and the requested operation
4340
 * DirectDraw Surface is not in 8 bit color mode and the requested operation
4333
 * requires 8 bit color.
4341
 * requires 8 bit color.
4334
 *)
4342
 *)
4335
  DDERR_NOT8BITCOLOR                      = MAKE_DDHRESULT + 320;
4343
  DDERR_NOT8BITCOLOR                      = MAKE_DDHRESULT + 320;
4336
 
4344
 
4337
(*
4345
(*
4338
 * Operation could not be carried out because there is no texture mapping
4346
 * Operation could not be carried out because there is no texture mapping
4339
 * hardware present or available.
4347
 * hardware present or available.
4340
 *)
4348
 *)
4341
  DDERR_NOTEXTUREHW                       = MAKE_DDHRESULT + 330;
4349
  DDERR_NOTEXTUREHW                       = MAKE_DDHRESULT + 330;
4342
 
4350
 
4343
(*
4351
(*
4344
 * Operation could not be carried out because there is no hardware support
4352
 * Operation could not be carried out because there is no hardware support
4345
 * for vertical blank synchronized operations.
4353
 * for vertical blank synchronized operations.
4346
 *)
4354
 *)
4347
  DDERR_NOVSYNCHW                         = MAKE_DDHRESULT + 335;
4355
  DDERR_NOVSYNCHW                         = MAKE_DDHRESULT + 335;
4348
 
4356
 
4349
(*
4357
(*
4350
 * Operation could not be carried out because there is no hardware support
4358
 * Operation could not be carried out because there is no hardware support
4351
 * for zbuffer blting.
4359
 * for zbuffer blting.
4352
 *)
4360
 *)
4353
  DDERR_NOZBUFFERHW                       = MAKE_DDHRESULT + 340;
4361
  DDERR_NOZBUFFERHW                       = MAKE_DDHRESULT + 340;
4354
 
4362
 
4355
(*
4363
(*
4356
 * Overlay surfaces could not be z layered based on their BltOrder because
4364
 * Overlay surfaces could not be z layered based on their BltOrder because
4357
 * the hardware does not support z layering of overlays.
4365
 * the hardware does not support z layering of overlays.
4358
 *)
4366
 *)
4359
  DDERR_NOZOVERLAYHW                      = MAKE_DDHRESULT + 350;
4367
  DDERR_NOZOVERLAYHW                      = MAKE_DDHRESULT + 350;
4360
 
4368
 
4361
(*
4369
(*
4362
 * The hardware needed for the requested operation has already been
4370
 * The hardware needed for the requested operation has already been
4363
 * allocated.
4371
 * allocated.
4364
 *)
4372
 *)
4365
  DDERR_OUTOFCAPS                         = MAKE_DDHRESULT + 360;
4373
  DDERR_OUTOFCAPS                         = MAKE_DDHRESULT + 360;
4366
 
4374
 
4367
(*
4375
(*
4368
 * DirectDraw does not have enough memory to perform the operation.
4376
 * DirectDraw does not have enough memory to perform the operation.
4369
 *)
4377
 *)
4370
  DDERR_OUTOFMEMORY                       = E_OUTOFMEMORY;
4378
  DDERR_OUTOFMEMORY                       = E_OUTOFMEMORY;
4371
 
4379
 
4372
(*
4380
(*
4373
 * DirectDraw does not have enough memory to perform the operation.
4381
 * DirectDraw does not have enough memory to perform the operation.
4374
 *)
4382
 *)
4375
  DDERR_OUTOFVIDEOMEMORY                  = MAKE_DDHRESULT + 380;
4383
  DDERR_OUTOFVIDEOMEMORY                  = MAKE_DDHRESULT + 380;
4376
 
4384
 
4377
(*
4385
(*
4378
 * hardware does not support clipped overlays
4386
 * hardware does not support clipped overlays
4379
 *)
4387
 *)
4380
  DDERR_OVERLAYCANTCLIP                   = MAKE_DDHRESULT + 382;
4388
  DDERR_OVERLAYCANTCLIP                   = MAKE_DDHRESULT + 382;
4381
 
4389
 
4382
(*
4390
(*
4383
 * Can only have ony color key active at one time for overlays
4391
 * Can only have ony color key active at one time for overlays
4384
 *)
4392
 *)
4385
  DDERR_OVERLAYCOLORKEYONLYONEACTIVE      = MAKE_DDHRESULT + 384;
4393
  DDERR_OVERLAYCOLORKEYONLYONEACTIVE      = MAKE_DDHRESULT + 384;
4386
 
4394
 
4387
(*
4395
(*
4388
 * Access to this palette is being refused because the palette is already
4396
 * Access to this palette is being refused because the palette is already
4389
 * locked by another thread.
4397
 * locked by another thread.
4390
 *)
4398
 *)
4391
  DDERR_PALETTEBUSY                       = MAKE_DDHRESULT + 387;
4399
  DDERR_PALETTEBUSY                       = MAKE_DDHRESULT + 387;
4392
 
4400
 
4393
(*
4401
(*
4394
 * No src color key specified for this operation.
4402
 * No src color key specified for this operation.
4395
 *)
4403
 *)
4396
  DDERR_COLORKEYNOTSET                    = MAKE_DDHRESULT + 400;
4404
  DDERR_COLORKEYNOTSET                    = MAKE_DDHRESULT + 400;
4397
 
4405
 
4398
(*
4406
(*
4399
 * This surface is already attached to the surface it is being attached to.
4407
 * This surface is already attached to the surface it is being attached to.
4400
 *)
4408
 *)
4401
  DDERR_SURFACEALREADYATTACHED            = MAKE_DDHRESULT + 410;
4409
  DDERR_SURFACEALREADYATTACHED            = MAKE_DDHRESULT + 410;
4402
 
4410
 
4403
(*
4411
(*
4404
 * This surface is already a dependency of the surface it is being made a
4412
 * This surface is already a dependency of the surface it is being made a
4405
 * dependency of.
4413
 * dependency of.
4406
 *)
4414
 *)
4407
  DDERR_SURFACEALREADYDEPENDENT           = MAKE_DDHRESULT + 420;
4415
  DDERR_SURFACEALREADYDEPENDENT           = MAKE_DDHRESULT + 420;
4408
 
4416
 
4409
(*
4417
(*
4410
 * Access to this surface is being refused because the surface is already
4418
 * Access to this surface is being refused because the surface is already
4411
 * locked by another thread.
4419
 * locked by another thread.
4412
 *)
4420
 *)
4413
  DDERR_SURFACEBUSY                       = MAKE_DDHRESULT + 430;
4421
  DDERR_SURFACEBUSY                       = MAKE_DDHRESULT + 430;
4414
 
4422
 
4415
(*
4423
(*
4416
 * Access to this surface is being refused because no driver exists
4424
 * Access to this surface is being refused because no driver exists
4417
 * which can supply a pointer to the surface.
4425
 * which can supply a pointer to the surface.
4418
 * This is most likely to happen when attempting to lock the primary
4426
 * This is most likely to happen when attempting to lock the primary
4419
 * surface when no DCI provider is present.
4427
 * surface when no DCI provider is present.
4420
 * Will also happen on attempts to lock an optimized surface.
4428
 * Will also happen on attempts to lock an optimized surface.
4421
 *)
4429
 *)
4422
  DDERR_CANTLOCKSURFACE                   = MAKE_DDHRESULT + 435;
4430
  DDERR_CANTLOCKSURFACE                   = MAKE_DDHRESULT + 435;
4423
 
4431
 
4424
(*
4432
(*
4425
 * Access to Surface refused because Surface is obscured.
4433
 * Access to Surface refused because Surface is obscured.
4426
 *)
4434
 *)
4427
  DDERR_SURFACEISOBSCURED                 = MAKE_DDHRESULT + 440;
4435
  DDERR_SURFACEISOBSCURED                 = MAKE_DDHRESULT + 440;
4428
 
4436
 
4429
(*
4437
(*
4430
 * Access to this surface is being refused because the surface is gone.
4438
 * Access to this surface is being refused because the surface is gone.
4431
 * The DIRECTDRAWSURFACE object representing this surface should
4439
 * The DIRECTDRAWSURFACE object representing this surface should
4432
 * have Restore called on it.
4440
 * have Restore called on it.
4433
 *)
4441
 *)
4434
  DDERR_SURFACELOST                       = MAKE_DDHRESULT + 450;
4442
  DDERR_SURFACELOST                       = MAKE_DDHRESULT + 450;
4435
 
4443
 
4436
(*
4444
(*
4437
 * The requested surface is not attached.
4445
 * The requested surface is not attached.
4438
 *)
4446
 *)
4439
  DDERR_SURFACENOTATTACHED                = MAKE_DDHRESULT + 460;
4447
  DDERR_SURFACENOTATTACHED                = MAKE_DDHRESULT + 460;
4440
 
4448
 
4441
(*
4449
(*
4442
 * Height requested by DirectDraw is too large.
4450
 * Height requested by DirectDraw is too large.
4443
 *)
4451
 *)
4444
  DDERR_TOOBIGHEIGHT                      = MAKE_DDHRESULT + 470;
4452
  DDERR_TOOBIGHEIGHT                      = MAKE_DDHRESULT + 470;
4445
 
4453
 
4446
(*
4454
(*
4447
 * Size requested by DirectDraw is too large --  The individual height and
4455
 * Size requested by DirectDraw is too large --  The individual height and
4448
 * width are OK.
4456
 * width are OK.
4449
 *)
4457
 *)
4450
  DDERR_TOOBIGSIZE                        = MAKE_DDHRESULT + 480;
4458
  DDERR_TOOBIGSIZE                        = MAKE_DDHRESULT + 480;
4451
 
4459
 
4452
(*
4460
(*
4453
 * Width requested by DirectDraw is too large.
4461
 * Width requested by DirectDraw is too large.
4454
 *)
4462
 *)
4455
  DDERR_TOOBIGWIDTH                       = MAKE_DDHRESULT + 490;
4463
  DDERR_TOOBIGWIDTH                       = MAKE_DDHRESULT + 490;
4456
 
4464
 
4457
(*
4465
(*
4458
 * Action not supported.
4466
 * Action not supported.
4459
 *)
4467
 *)
4460
  DDERR_UNSUPPORTED                       = E_NOTIMPL;
4468
  DDERR_UNSUPPORTED                       = E_NOTIMPL;
4461
 
4469
 
4462
(*
4470
(*
4463
 * FOURCC format requested is unsupported by DirectDraw
4471
 * FOURCC format requested is unsupported by DirectDraw
4464
 *)
4472
 *)
4465
  DDERR_UNSUPPORTEDFORMAT                 = MAKE_DDHRESULT + 510;
4473
  DDERR_UNSUPPORTEDFORMAT                 = MAKE_DDHRESULT + 510;
4466
 
4474
 
4467
(*
4475
(*
4468
 * Bitmask in the pixel format requested is unsupported by DirectDraw
4476
 * Bitmask in the pixel format requested is unsupported by DirectDraw
4469
 *)
4477
 *)
4470
  DDERR_UNSUPPORTEDMASK                   = MAKE_DDHRESULT + 520;
4478
  DDERR_UNSUPPORTEDMASK                   = MAKE_DDHRESULT + 520;
4471
 
4479
 
4472
(*
4480
(*
4473
 * The specified stream contains invalid data
4481
 * The specified stream contains invalid data
4474
 *)
4482
 *)
4475
  DDERR_INVALIDSTREAM                     = MAKE_DDHRESULT + 521;
4483
  DDERR_INVALIDSTREAM                     = MAKE_DDHRESULT + 521;
4476
 
4484
 
4477
(*
4485
(*
4478
 * vertical blank is in progress
4486
 * vertical blank is in progress
4479
 *)
4487
 *)
4480
  DDERR_VERTICALBLANKINPROGRESS           = MAKE_DDHRESULT + 537;
4488
  DDERR_VERTICALBLANKINPROGRESS           = MAKE_DDHRESULT + 537;
4481
 
4489
 
4482
(*
4490
(*
4483
 * Informs DirectDraw that the previous Blt which is transfering information
4491
 * Informs DirectDraw that the previous Blt which is transfering information
4484
 * to or from this Surface is incomplete.
4492
 * to or from this Surface is incomplete.
4485
 *)
4493
 *)
4486
  DDERR_WASSTILLDRAWING                   = MAKE_DDHRESULT + 540;
4494
  DDERR_WASSTILLDRAWING                   = MAKE_DDHRESULT + 540;
4487
 
4495
 
4488
(*
4496
(*
4489
 * The specified surface type requires specification of the COMPLEX flag
4497
 * The specified surface type requires specification of the COMPLEX flag
4490
 *)
4498
 *)
4491
  DDERR_DDSCAPSCOMPLEXREQUIRED            = MAKE_DDHRESULT + 542;
4499
  DDERR_DDSCAPSCOMPLEXREQUIRED            = MAKE_DDHRESULT + 542;
4492
 
4500
 
4493
(*
4501
(*
4494
 * Rectangle provided was not horizontally aligned on reqd. boundary
4502
 * Rectangle provided was not horizontally aligned on reqd. boundary
4495
 *)
4503
 *)
4496
  DDERR_XALIGN                            = MAKE_DDHRESULT + 560;
4504
  DDERR_XALIGN                            = MAKE_DDHRESULT + 560;
4497
 
4505
 
4498
(*
4506
(*
4499
 * The GUID passed to DirectDrawCreate is not a valid DirectDraw driver
4507
 * The GUID passed to DirectDrawCreate is not a valid DirectDraw driver
4500
 * identifier.
4508
 * identifier.
4501
 *)
4509
 *)
4502
  DDERR_INVALIDDIRECTDRAWGUID             = MAKE_DDHRESULT + 561;
4510
  DDERR_INVALIDDIRECTDRAWGUID             = MAKE_DDHRESULT + 561;
4503
 
4511
 
4504
(*
4512
(*
4505
 * A DirectDraw object representing this driver has already been created
4513
 * A DirectDraw object representing this driver has already been created
4506
 * for this process.
4514
 * for this process.
4507
 *)
4515
 *)
4508
  DDERR_DIRECTDRAWALREADYCREATED          = MAKE_DDHRESULT + 562;
4516
  DDERR_DIRECTDRAWALREADYCREATED          = MAKE_DDHRESULT + 562;
4509
 
4517
 
4510
(*
4518
(*
4511
 * A hardware only DirectDraw object creation was attempted but the driver
4519
 * A hardware only DirectDraw object creation was attempted but the driver
4512
 * did not support any hardware.
4520
 * did not support any hardware.
4513
 *)
4521
 *)
4514
  DDERR_NODIRECTDRAWHW                    = MAKE_DDHRESULT + 563;
4522
  DDERR_NODIRECTDRAWHW                    = MAKE_DDHRESULT + 563;
4515
 
4523
 
4516
(*
4524
(*
4517
 * this process already has created a primary surface
4525
 * this process already has created a primary surface
4518
 *)
4526
 *)
4519
  DDERR_PRIMARYSURFACEALREADYEXISTS       = MAKE_DDHRESULT + 564;
4527
  DDERR_PRIMARYSURFACEALREADYEXISTS       = MAKE_DDHRESULT + 564;
4520
 
4528
 
4521
(*
4529
(*
4522
 * software emulation not available.
4530
 * software emulation not available.
4523
 *)
4531
 *)
4524
  DDERR_NOEMULATION                       = MAKE_DDHRESULT + 565;
4532
  DDERR_NOEMULATION                       = MAKE_DDHRESULT + 565;
4525
 
4533
 
4526
(*
4534
(*
4527
 * region passed to Clipper::GetClipList is too small.
4535
 * region passed to Clipper::GetClipList is too small.
4528
 *)
4536
 *)
4529
  DDERR_REGIONTOOSMALL                    = MAKE_DDHRESULT + 566;
4537
  DDERR_REGIONTOOSMALL                    = MAKE_DDHRESULT + 566;
4530
 
4538
 
4531
(*
4539
(*
4532
 * an attempt was made to set a clip list for a clipper objec that
4540
 * an attempt was made to set a clip list for a clipper objec that
4533
 * is already monitoring an hwnd.
4541
 * is already monitoring an hwnd.
4534
 *)
4542
 *)
4535
  DDERR_CLIPPERISUSINGHWND                = MAKE_DDHRESULT + 567;
4543
  DDERR_CLIPPERISUSINGHWND                = MAKE_DDHRESULT + 567;
4536
 
4544
 
4537
(*
4545
(*
4538
 * No clipper object attached to surface object
4546
 * No clipper object attached to surface object
4539
 *)
4547
 *)
4540
  DDERR_NOCLIPPERATTACHED                 = MAKE_DDHRESULT + 568;
4548
  DDERR_NOCLIPPERATTACHED                 = MAKE_DDHRESULT + 568;
4541
 
4549
 
4542
(*
4550
(*
4543
 * Clipper notification requires an HWND or
4551
 * Clipper notification requires an HWND or
4544
 * no HWND has previously been set as the CooperativeLevel HWND.
4552
 * no HWND has previously been set as the CooperativeLevel HWND.
4545
 *)
4553
 *)
4546
  DDERR_NOHWND                            = MAKE_DDHRESULT + 569;
4554
  DDERR_NOHWND                            = MAKE_DDHRESULT + 569;
4547
 
4555
 
4548
(*
4556
(*
4549
 * HWND used by DirectDraw CooperativeLevel has been subclassed,
4557
 * HWND used by DirectDraw CooperativeLevel has been subclassed,
4550
 * this prevents DirectDraw from restoring state.
4558
 * this prevents DirectDraw from restoring state.
4551
 *)
4559
 *)
4552
  DDERR_HWNDSUBCLASSED                    = MAKE_DDHRESULT + 570;
4560
  DDERR_HWNDSUBCLASSED                    = MAKE_DDHRESULT + 570;
4553
 
4561
 
4554
(*
4562
(*
4555
 * The CooperativeLevel HWND has already been set.
4563
 * The CooperativeLevel HWND has already been set.
4556
 * It can not be reset while the process has surfaces or palettes created.
4564
 * It can not be reset while the process has surfaces or palettes created.
4557
 *)
4565
 *)
4558
  DDERR_HWNDALREADYSET                    = MAKE_DDHRESULT + 571;
4566
  DDERR_HWNDALREADYSET                    = MAKE_DDHRESULT + 571;
4559
 
4567
 
4560
(*
4568
(*
4561
 * No palette object attached to this surface.
4569
 * No palette object attached to this surface.
4562
 *)
4570
 *)
4563
  DDERR_NOPALETTEATTACHED                 = MAKE_DDHRESULT + 572;
4571
  DDERR_NOPALETTEATTACHED                 = MAKE_DDHRESULT + 572;
4564
 
4572
 
4565
(*
4573
(*
4566
 * No hardware support for 16 or 256 color palettes.
4574
 * No hardware support for 16 or 256 color palettes.
4567
 *)
4575
 *)
4568
  DDERR_NOPALETTEHW                       = MAKE_DDHRESULT + 573;
4576
  DDERR_NOPALETTEHW                       = MAKE_DDHRESULT + 573;
4569
 
4577
 
4570
(*
4578
(*
4571
 * If a clipper object is attached to the source surface passed into a
4579
 * If a clipper object is attached to the source surface passed into a
4572
 * BltFast call.
4580
 * BltFast call.
4573
 *)
4581
 *)
4574
  DDERR_BLTFASTCANTCLIP                   = MAKE_DDHRESULT + 574;
4582
  DDERR_BLTFASTCANTCLIP                   = MAKE_DDHRESULT + 574;
4575
 
4583
 
4576
(*
4584
(*
4577
 * No blter.
4585
 * No blter.
4578
 *)
4586
 *)
4579
  DDERR_NOBLTHW                           = MAKE_DDHRESULT + 575;
4587
  DDERR_NOBLTHW                           = MAKE_DDHRESULT + 575;
4580
 
4588
 
4581
(*
4589
(*
4582
 * No DirectDraw ROP hardware.
4590
 * No DirectDraw ROP hardware.
4583
 *)
4591
 *)
4584
  DDERR_NODDROPSHW                        = MAKE_DDHRESULT + 576;
4592
  DDERR_NODDROPSHW                        = MAKE_DDHRESULT + 576;
4585
 
4593
 
4586
(*
4594
(*
4587
 * returned when GetOverlayPosition is called on a hidden overlay
4595
 * returned when GetOverlayPosition is called on a hidden overlay
4588
 *)
4596
 *)
4589
  DDERR_OVERLAYNOTVISIBLE                 = MAKE_DDHRESULT + 577;
4597
  DDERR_OVERLAYNOTVISIBLE                 = MAKE_DDHRESULT + 577;
4590
 
4598
 
4591
(*
4599
(*
4592
 * returned when GetOverlayPosition is called on a overlay that UpdateOverlay
4600
 * returned when GetOverlayPosition is called on a overlay that UpdateOverlay
4593
 * has never been called on to establish a destionation.
4601
 * has never been called on to establish a destionation.
4594
 *)
4602
 *)
4595
  DDERR_NOOVERLAYDEST                     = MAKE_DDHRESULT + 578;
4603
  DDERR_NOOVERLAYDEST                     = MAKE_DDHRESULT + 578;
4596
 
4604
 
4597
(*
4605
(*
4598
 * returned when the position of the overlay on the destionation is no longer
4606
 * returned when the position of the overlay on the destionation is no longer
4599
 * legal for that destionation.
4607
 * legal for that destionation.
4600
 *)
4608
 *)
4601
  DDERR_INVALIDPOSITION                   = MAKE_DDHRESULT + 579;
4609
  DDERR_INVALIDPOSITION                   = MAKE_DDHRESULT + 579;
4602
 
4610
 
4603
(*
4611
(*
4604
 * returned when an overlay member is called for a non-overlay surface
4612
 * returned when an overlay member is called for a non-overlay surface
4605
 *)
4613
 *)
4606
  DDERR_NOTAOVERLAYSURFACE                = MAKE_DDHRESULT + 580;
4614
  DDERR_NOTAOVERLAYSURFACE                = MAKE_DDHRESULT + 580;
4607
 
4615
 
4608
(*
4616
(*
4609
 * An attempt was made to set the cooperative level when it was already
4617
 * An attempt was made to set the cooperative level when it was already
4610
 * set to exclusive.
4618
 * set to exclusive.
4611
 *)
4619
 *)
4612
  DDERR_EXCLUSIVEMODEALREADYSET           = MAKE_DDHRESULT + 581;
4620
  DDERR_EXCLUSIVEMODEALREADYSET           = MAKE_DDHRESULT + 581;
4613
 
4621
 
4614
(*
4622
(*
4615
 * An attempt has been made to flip a surface that is not flippable.
4623
 * An attempt has been made to flip a surface that is not flippable.
4616
 *)
4624
 *)
4617
  DDERR_NOTFLIPPABLE                      = MAKE_DDHRESULT + 582;
4625
  DDERR_NOTFLIPPABLE                      = MAKE_DDHRESULT + 582;
4618
 
4626
 
4619
(*
4627
(*
4620
 * Can't duplicate primary & 3D surfaces, or surfaces that are implicitly
4628
 * Can't duplicate primary & 3D surfaces, or surfaces that are implicitly
4621
 * created.
4629
 * created.
4622
 *)
4630
 *)
4623
  DDERR_CANTDUPLICATE                     = MAKE_DDHRESULT + 583;
4631
  DDERR_CANTDUPLICATE                     = MAKE_DDHRESULT + 583;
4624
 
4632
 
4625
(*
4633
(*
4626
 * Surface was not locked.  An attempt to unlock a surface that was not
4634
 * Surface was not locked.  An attempt to unlock a surface that was not
4627
 * locked at all, or by this process, has been attempted.
4635
 * locked at all, or by this process, has been attempted.
4628
 *)
4636
 *)
4629
  DDERR_NOTLOCKED                         = MAKE_DDHRESULT + 584;
4637
  DDERR_NOTLOCKED                         = MAKE_DDHRESULT + 584;
4630
 
4638
 
4631
(*
4639
(*
4632
 * Windows can not create any more DCs, or a DC was requested for a paltte-indexed
4640
 * Windows can not create any more DCs, or a DC was requested for a paltte-indexed
4633
 * surface when the surface had no palette AND the display mode was not palette-indexed
4641
 * surface when the surface had no palette AND the display mode was not palette-indexed
4634
 * (in this case DirectDraw cannot select a proper palette into the DC)
4642
 * (in this case DirectDraw cannot select a proper palette into the DC)
4635
 *)
4643
 *)
4636
  DDERR_CANTCREATEDC                      = MAKE_DDHRESULT + 585;
4644
  DDERR_CANTCREATEDC                      = MAKE_DDHRESULT + 585;
4637
 
4645
 
4638
(*
4646
(*
4639
 * No DC was ever created for this surface.
4647
 * No DC was ever created for this surface.
4640
 *)
4648
 *)
4641
  DDERR_NODC                              = MAKE_DDHRESULT + 586;
4649
  DDERR_NODC                              = MAKE_DDHRESULT + 586;
4642
 
4650
 
4643
(*
4651
(*
4644
 * This surface can not be restored because it was created in a different
4652
 * This surface can not be restored because it was created in a different
4645
 * mode.
4653
 * mode.
4646
 *)
4654
 *)
4647
  DDERR_WRONGMODE                         = MAKE_DDHRESULT + 587;
4655
  DDERR_WRONGMODE                         = MAKE_DDHRESULT + 587;
4648
 
4656
 
4649
(*
4657
(*
4650
 * This surface can not be restored because it is an implicitly created
4658
 * This surface can not be restored because it is an implicitly created
4651
 * surface.
4659
 * surface.
4652
 *)
4660
 *)
4653
  DDERR_IMPLICITLYCREATED                 = MAKE_DDHRESULT + 588;
4661
  DDERR_IMPLICITLYCREATED                 = MAKE_DDHRESULT + 588;
4654
 
4662
 
4655
(*
4663
(*
4656
 * The surface being used is not a palette-based surface
4664
 * The surface being used is not a palette-based surface
4657
 *)
4665
 *)
4658
  DDERR_NOTPALETTIZED                     = MAKE_DDHRESULT + 589;
4666
  DDERR_NOTPALETTIZED                     = MAKE_DDHRESULT + 589;
4659
 
4667
 
4660
(*
4668
(*
4661
 * The display is currently in an unsupported mode
4669
 * The display is currently in an unsupported mode
4662
 *)
4670
 *)
4663
  DDERR_UNSUPPORTEDMODE                   = MAKE_DDHRESULT + 590;
4671
  DDERR_UNSUPPORTEDMODE                   = MAKE_DDHRESULT + 590;
4664
 
4672
 
4665
(*
4673
(*
4666
 * Operation could not be carried out because there is no mip-map
4674
 * Operation could not be carried out because there is no mip-map
4667
 * texture mapping hardware present or available.
4675
 * texture mapping hardware present or available.
4668
 *)
4676
 *)
4669
  DDERR_NOMIPMAPHW                        = MAKE_DDHRESULT + 591;
4677
  DDERR_NOMIPMAPHW                        = MAKE_DDHRESULT + 591;
4670
 
4678
 
4671
(*
4679
(*
4672
 * The requested action could not be performed because the surface was of
4680
 * The requested action could not be performed because the surface was of
4673
 * the wrong type.
4681
 * the wrong type.
4674
 *)
4682
 *)
4675
  DDERR_INVALIDSURFACETYPE                = MAKE_DDHRESULT + 592;
4683
  DDERR_INVALIDSURFACETYPE                = MAKE_DDHRESULT + 592;
4676
 
4684
 
4677
(*
4685
(*
4678
 * Device does not support optimized surfaces, therefore no video memory optimized surfaces
4686
 * Device does not support optimized surfaces, therefore no video memory optimized surfaces
4679
 *)
4687
 *)
4680
  DDERR_NOOPTIMIZEHW                      = MAKE_DDHRESULT + 600;
4688
  DDERR_NOOPTIMIZEHW                      = MAKE_DDHRESULT + 600;
4681
 
4689
 
4682
(*
4690
(*
4683
 * Surface is an optimized surface, but has not yet been allocated any memory
4691
 * Surface is an optimized surface, but has not yet been allocated any memory
4684
 *)
4692
 *)
4685
  DDERR_NOTLOADED                         = MAKE_DDHRESULT + 601;
4693
  DDERR_NOTLOADED                         = MAKE_DDHRESULT + 601;
4686
 
4694
 
4687
(*
4695
(*
4688
 * Attempt was made to create or set a device window without first setting
4696
 * Attempt was made to create or set a device window without first setting
4689
 * the focus window
4697
 * the focus window
4690
 *)
4698
 *)
4691
  DDERR_NOFOCUSWINDOW                     = MAKE_DDHRESULT + 602;
4699
  DDERR_NOFOCUSWINDOW                     = MAKE_DDHRESULT + 602;
4692
 
4700
 
4693
(*
4701
(*
4694
 * Attempt was made to set a palette on a mipmap sublevel
4702
 * Attempt was made to set a palette on a mipmap sublevel
4695
 *)
4703
 *)
4696
  DDERR_NOTONMIPMAPSUBLEVEL               = MAKE_DDHRESULT + 603;
4704
  DDERR_NOTONMIPMAPSUBLEVEL               = MAKE_DDHRESULT + 603;
4697
 
4705
 
4698
(*
4706
(*
4699
 * A DC has already been returned for this surface. Only one DC can be
4707
 * A DC has already been returned for this surface. Only one DC can be
4700
 * retrieved per surface.
4708
 * retrieved per surface.
4701
 *)
4709
 *)
4702
  DDERR_DCALREADYCREATED                  = MAKE_DDHRESULT + 620;
4710
  DDERR_DCALREADYCREATED                  = MAKE_DDHRESULT + 620;
4703
 
4711
 
4704
(*
4712
(*
4705
 * An attempt was made to allocate non-local video memory from a device
4713
 * An attempt was made to allocate non-local video memory from a device
4706
 * that does not support non-local video memory.
4714
 * that does not support non-local video memory.
4707
 *)
4715
 *)
4708
  DDERR_NONONLOCALVIDMEM                  = MAKE_DDHRESULT + 630;
4716
  DDERR_NONONLOCALVIDMEM                  = MAKE_DDHRESULT + 630;
4709
 
4717
 
4710
(*
4718
(*
4711
 * The attempt to page lock a surface failed.
4719
 * The attempt to page lock a surface failed.
4712
 *)
4720
 *)
4713
  DDERR_CANTPAGELOCK                      = MAKE_DDHRESULT + 640;
4721
  DDERR_CANTPAGELOCK                      = MAKE_DDHRESULT + 640;
4714
 
4722
 
4715
(*
4723
(*
4716
 * The attempt to page unlock a surface failed.
4724
 * The attempt to page unlock a surface failed.
4717
 *)
4725
 *)
4718
  DDERR_CANTPAGEUNLOCK                    = MAKE_DDHRESULT + 660;
4726
  DDERR_CANTPAGEUNLOCK                    = MAKE_DDHRESULT + 660;
4719
 
4727
 
4720
(*
4728
(*
4721
 * An attempt was made to page unlock a surface with no outstanding page locks.
4729
 * An attempt was made to page unlock a surface with no outstanding page locks.
4722
 *)
4730
 *)
4723
  DDERR_NOTPAGELOCKED                     = MAKE_DDHRESULT + 680;
4731
  DDERR_NOTPAGELOCKED                     = MAKE_DDHRESULT + 680;
4724
 
4732
 
4725
(*
4733
(*
4726
 * There is more data available than the specified buffer size could hold
4734
 * There is more data available than the specified buffer size could hold
4727
 *)
4735
 *)
4728
  DDERR_MOREDATA                                = MAKE_DDHRESULT + 690;
4736
  DDERR_MOREDATA                                = MAKE_DDHRESULT + 690;
4729
 
4737
 
4730
(*
4738
(*
4731
 * The data has expired and is therefore no longer valid.
4739
 * The data has expired and is therefore no longer valid.
4732
 *)
4740
 *)
4733
  DDERR_EXPIRED                           = MAKE_DDHRESULT + 691;
4741
  DDERR_EXPIRED                           = MAKE_DDHRESULT + 691;
4734
 
4742
 
4735
(*
4743
(*
4736
 * The mode test has finished executing.
4744
 * The mode test has finished executing.
4737
 *)
4745
 *)
4738
 DDERR_TESTFINISHED                      = MAKE_DDHRESULT + 692;
4746
 DDERR_TESTFINISHED                      = MAKE_DDHRESULT + 692;
4739
 
4747
 
4740
(*
4748
(*
4741
 * The mode test has switched to a new mode.
4749
 * The mode test has switched to a new mode.
4742
 *)
4750
 *)
4743
 DDERR_NEWMODE                           = MAKE_DDHRESULT + 693;
4751
 DDERR_NEWMODE                           = MAKE_DDHRESULT + 693;
4744
 
4752
 
4745
(*
4753
(*
4746
 * D3D has not yet been initialized.
4754
 * D3D has not yet been initialized.
4747
 *)
4755
 *)
4748
 DDERR_D3DNOTINITIALIZED                 = MAKE_DDHRESULT + 694;
4756
 DDERR_D3DNOTINITIALIZED                 = MAKE_DDHRESULT + 694;
4749
 
4757
 
4750
(*
4758
(*
4751
 * The video port is not active
4759
 * The video port is not active
4752
 *)
4760
 *)
4753
  DDERR_VIDEONOTACTIVE                          = MAKE_DDHRESULT + 695;
4761
  DDERR_VIDEONOTACTIVE                          = MAKE_DDHRESULT + 695;
4754
 
4762
 
4755
(*
4763
(*
4756
 * The monitor does not have EDID data.
4764
 * The monitor does not have EDID data.
4757
 *)
4765
 *)
4758
 DDERR_NOMONITORINFORMATION             = MAKE_DDHRESULT + 696;
4766
 DDERR_NOMONITORINFORMATION             = MAKE_DDHRESULT + 696;
4759
 
4767
 
4760
(*
4768
(*
4761
 * The driver does not enumerate display mode refresh rates.
4769
 * The driver does not enumerate display mode refresh rates.
4762
 *)
4770
 *)
4763
 DDERR_NODRIVERSUPPORT                  = MAKE_DDHRESULT + 697;
4771
 DDERR_NODRIVERSUPPORT                  = MAKE_DDHRESULT + 697;
4764
 
4772
 
4765
(*
4773
(*
4766
 * Surfaces created by one direct draw device cannot be used directly by
4774
 * Surfaces created by one direct draw device cannot be used directly by
4767
 * another direct draw device.
4775
 * another direct draw device.
4768
 *)
4776
 *)
4769
  DDERR_DEVICEDOESNTOWNSURFACE                  = MAKE_DDHRESULT + 699;
4777
  DDERR_DEVICEDOESNTOWNSURFACE                  = MAKE_DDHRESULT + 699;
4770
 
4778
 
4771
(*
4779
(*
4772
 * An attempt was made to invoke an interface member of a DirectDraw object
4780
 * An attempt was made to invoke an interface member of a DirectDraw object
4773
 * created by CoCreateInstance() before it was initialized.
4781
 * created by CoCreateInstance() before it was initialized.
4774
 *)
4782
 *)
4775
  DDERR_NOTINITIALIZED                    = CO_E_NOTINITIALIZED;
4783
  DDERR_NOTINITIALIZED                    = CO_E_NOTINITIALIZED;
4776
 
4784
 
4777
(* Alpha bit depth constants *)
4785
(* Alpha bit depth constants *)
4778
 
4786
 
4779
(*
4787
(*
4780
 * API's
4788
 * API's
4781
 *)
4789
 *)
4782
 
4790
 
4783
type
4791
type
4784
  HMonitor = THandle;
4792
  HMonitor = THandle;
4785
 
4793
 
4786
  TDDEnumCallbackA = function (lpGUID: PGUID; lpDriverDescription: PAnsiChar;
4794
  TDDEnumCallbackA = function (lpGUID: PGUID; lpDriverDescription: PAnsiChar;
4787
      lpDriverName: PAnsiChar; lpContext: Pointer) : BOOL; stdcall;
4795
      lpDriverName: PAnsiChar; lpContext: Pointer) : BOOL; stdcall;
4788
  TDDEnumCallbackW = function (lpGUID: PGUID; lpDriverDescription: PWideChar;
4796
  TDDEnumCallbackW = function (lpGUID: PGUID; lpDriverDescription: PWideChar;
4789
      lpDriverName: PWideChar; lpContext: Pointer) : BOOL; stdcall;
4797
      lpDriverName: PWideChar; lpContext: Pointer) : BOOL; stdcall;
4790
{$IFDEF UNICODE}
4798
{$IFDEF UNICODE}
4791
  TDDEnumCallback = TDDEnumCallbackW;
4799
  TDDEnumCallback = TDDEnumCallbackW;
4792
{$ELSE}
4800
{$ELSE}
4793
  TDDEnumCallback = TDDEnumCallbackA;
4801
  TDDEnumCallback = TDDEnumCallbackA;
4794
{$ENDIF}
4802
{$ENDIF}
4795
 
4803
 
4796
  TDDEnumCallbackExA = function (lpGUID: PGUID; lpDriverDescription: PAnsiChar;
4804
  TDDEnumCallbackExA = function (lpGUID: PGUID; lpDriverDescription: PAnsiChar;
4797
      lpDriverName: PAnsiChar; lpContext: Pointer; Monitor: HMonitor) : BOOL;
4805
      lpDriverName: PAnsiChar; lpContext: Pointer; Monitor: HMonitor) : BOOL;
4798
      stdcall;
4806
      stdcall;
4799
  TDDEnumCallbackExW = function (lpGUID: PGUID; lpDriverDescription: PWideChar;
4807
  TDDEnumCallbackExW = function (lpGUID: PGUID; lpDriverDescription: PWideChar;
4800
      lpDriverName: PWideChar; lpContext: Pointer; Monitor: HMonitor) : BOOL;
4808
      lpDriverName: PWideChar; lpContext: Pointer; Monitor: HMonitor) : BOOL;
4801
      stdcall;
4809
      stdcall;
4802
     
4810
     
4803
{$IFDEF UNICODE}
4811
{$IFDEF UNICODE}
4804
  TDDEnumCallbackEx = TDDEnumCallbackExW;
4812
  TDDEnumCallbackEx = TDDEnumCallbackExW;
4805
{$ELSE}
4813
{$ELSE}
4806
  TDDEnumCallbackEx = TDDEnumCallbackExA;
4814
  TDDEnumCallbackEx = TDDEnumCallbackExA;
4807
{$ENDIF}
4815
{$ENDIF}
4808
 
4816
 
4809
var
4817
var
4810
  DirectDrawEnumerateA : function (lpCallback: TDDEnumCallbackA;
4818
  DirectDrawEnumerateA : function (lpCallback: TDDEnumCallbackA;
4811
       lpContext: Pointer) : HResult; stdcall;
4819
       lpContext: Pointer) : HResult; stdcall;
4812
  DirectDrawEnumerateW : function (lpCallback: TDDEnumCallbackW;
4820
  DirectDrawEnumerateW : function (lpCallback: TDDEnumCallbackW;
4813
       lpContext: Pointer) : HResult; stdcall;
4821
       lpContext: Pointer) : HResult; stdcall;
4814
  DirectDrawEnumerate : function (lpCallback: TDDEnumCallback;
4822
  DirectDrawEnumerate : function (lpCallback: TDDEnumCallback;
4815
       lpContext: Pointer) : HResult; stdcall;
4823
       lpContext: Pointer) : HResult; stdcall;
4816
 
4824
 
4817
  DirectDrawEnumerateExA : function (lpCallback: TDDEnumCallbackExA;
4825
  DirectDrawEnumerateExA : function (lpCallback: TDDEnumCallbackExA;
4818
       lpContext: Pointer; dwFlags: DWORD) : HResult; stdcall;
4826
       lpContext: Pointer; dwFlags: DWORD) : HResult; stdcall;
4819
  DirectDrawEnumerateExW : function (lpCallback: TDDEnumCallbackExW;
4827
  DirectDrawEnumerateExW : function (lpCallback: TDDEnumCallbackExW;
4820
       lpContext: Pointer; dwFlags: DWORD) : HResult; stdcall;
4828
       lpContext: Pointer; dwFlags: DWORD) : HResult; stdcall;
4821
  DirectDrawEnumerateEx : function (lpCallback: TDDEnumCallbackEx;
4829
  DirectDrawEnumerateEx : function (lpCallback: TDDEnumCallbackEx;
4822
       lpContext: Pointer; dwFlags: DWORD) : HResult; stdcall;
4830
       lpContext: Pointer; dwFlags: DWORD) : HResult; stdcall;
4823
 
4831
 
4824
  DirectDrawCreate : function (lpGUID: PGUID;
4832
  DirectDrawCreate : function (lpGUID: PGUID;
4825
       out lplpDD: IDirectDraw;
4833
       out lplpDD: IDirectDraw;
4826
       pUnkOuter: IUnknown) : HResult; stdcall;
4834
       pUnkOuter: IUnknown) : HResult; stdcall;
4827
  DirectDrawCreateEx : function  (lpGUID: PGUID;
4835
  DirectDrawCreateEx : function  (lpGUID: PGUID;
4828
       out lplpDD: IDirectDraw7; const iid: TGUID;
4836
       out lplpDD: IDirectDraw7; const iid: TGUID;
4829
       pUnkOuter: IUnknown) : HResult; stdcall;
4837
       pUnkOuter: IUnknown) : HResult; stdcall;
4830
  DirectDrawCreateClipper : function (dwFlags: DWORD;
4838
  DirectDrawCreateClipper : function (dwFlags: DWORD;
4831
       out lplpDDClipper: IDirectDrawClipper;
4839
       out lplpDDClipper: IDirectDrawClipper;
4832
       pUnkOuter: IUnknown) : HResult; stdcall;
4840
       pUnkOuter: IUnknown) : HResult; stdcall;
4833
 
4841
 
4834
const
4842
const
4835
(*
4843
(*
4836
 * Flags for DirectDrawEnumerateEx
4844
 * Flags for DirectDrawEnumerateEx
4837
 * DirectDrawEnumerateEx supercedes DirectDrawEnumerate. You must use GetProcAddress to
4845
 * DirectDrawEnumerateEx supercedes DirectDrawEnumerate. You must use GetProcAddress to
4838
 * obtain a function pointer (of type LPDIRECTDRAWENUMERATEEX) to DirectDrawEnumerateEx.
4846
 * obtain a function pointer (of type LPDIRECTDRAWENUMERATEEX) to DirectDrawEnumerateEx.
4839
 * By default, only the primary display device is enumerated.
4847
 * By default, only the primary display device is enumerated.
4840
 * DirectDrawEnumerate is equivalent to DirectDrawEnumerate(,,DDENUM_NONDISPLAYDEVICES)
4848
 * DirectDrawEnumerate is equivalent to DirectDrawEnumerate(,,DDENUM_NONDISPLAYDEVICES)
4841
 *)
4849
 *)
4842
 
4850
 
4843
(*
4851
(*
4844
 * This flag causes enumeration of any GDI display devices which are part of
4852
 * This flag causes enumeration of any GDI display devices which are part of
4845
 * the Windows Desktop
4853
 * the Windows Desktop
4846
 *)
4854
 *)
4847
  DDENUM_ATTACHEDSECONDARYDEVICES     = $00000001;
4855
  DDENUM_ATTACHEDSECONDARYDEVICES     = $00000001;
4848
 
4856
 
4849
(*
4857
(*
4850
 * This flag causes enumeration of any GDI display devices which are not
4858
 * This flag causes enumeration of any GDI display devices which are not
4851
 * part of the Windows Desktop
4859
 * part of the Windows Desktop
4852
 *)
4860
 *)
4853
  DDENUM_DETACHEDSECONDARYDEVICES     = $00000002;
4861
  DDENUM_DETACHEDSECONDARYDEVICES     = $00000002;
4854
 
4862
 
4855
(*
4863
(*
4856
 * This flag causes enumeration of non-display devices
4864
 * This flag causes enumeration of non-display devices
4857
 *)
4865
 *)
4858
  DDENUM_NONDISPLAYDEVICES            = $00000004;
4866
  DDENUM_NONDISPLAYDEVICES            = $00000004;
4859
 
4867
 
4860
  REGSTR_KEY_DDHW_DESCRIPTION = 'Description';
4868
  REGSTR_KEY_DDHW_DESCRIPTION = 'Description';
4861
  REGSTR_KEY_DDHW_DRIVERNAME  = 'DriverName';
4869
  REGSTR_KEY_DDHW_DRIVERNAME  = 'DriverName';
4862
  REGSTR_PATH_DDHW            = 'Hardware\DirectDrawDrivers';
4870
  REGSTR_PATH_DDHW            = 'Hardware\DirectDrawDrivers';
4863
 
4871
 
4864
  DDCREATE_HARDWAREONLY       = $00000001;
4872
  DDCREATE_HARDWAREONLY       = $00000001;
4865
  DDCREATE_EMULATIONONLY      = $00000002;
4873
  DDCREATE_EMULATIONONLY      = $00000002;
4866
 
4874
 
4867
(*
4875
(*
4868
 * Macros for interpretting DDEVICEIDENTIFIER2.dwWHQLLevel
4876
 * Macros for interpretting DDEVICEIDENTIFIER2.dwWHQLLevel
4869
 *)
4877
 *)
4870
function GET_WHQL_YEAR(dwWHQLLevel: DWORD) : DWORD;
4878
function GET_WHQL_YEAR(dwWHQLLevel: DWORD) : DWORD;
4871
function GET_WHQL_MONTH(dwWHQLLevel: DWORD) : DWORD;
4879
function GET_WHQL_MONTH(dwWHQLLevel: DWORD) : DWORD;
4872
function GET_WHQL_DAY(dwWHQLLevel: DWORD) : DWORD;
4880
function GET_WHQL_DAY(dwWHQLLevel: DWORD) : DWORD;
4873
 
4881
 
4874
 
4882
 
4875
(*==========================================================================;
4883
(*==========================================================================;
4876
 *
4884
 *
4877
 *  Copyright (C) 1996-1997 Microsoft Corporation.  All Rights Reserved.
4885
 *  Copyright (C) 1996-1997 Microsoft Corporation.  All Rights Reserved.
4878
 *
4886
 *
4879
 *  File:       dvp.h
4887
 *  File:       dvp.h
4880
 *  Content:    DirectDrawVideoPort include file
4888
 *  Content:    DirectDrawVideoPort include file
4881
 *
4889
 *
4882
 ***************************************************************************)
4890
 ***************************************************************************)
4883
 
4891
 
4884
const
4892
const
4885
(*
4893
(*
4886
 * GUIDS used by DirectDrawVideoPort objects
4894
 * GUIDS used by DirectDrawVideoPort objects
4887
 *)
4895
 *)
4888
  DDVPTYPE_E_HREFH_VREFH: TGUID =
4896
  DDVPTYPE_E_HREFH_VREFH: TGUID =
4889
      (D1:$54F39980;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
4897
      (D1:$54F39980;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
4890
  DDVPTYPE_E_HREFH_VREFL: TGUID =
4898
  DDVPTYPE_E_HREFH_VREFL: TGUID =
4891
      (D1:$92783220;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
4899
      (D1:$92783220;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
4892
  DDVPTYPE_E_HREFL_VREFH: TGUID =
4900
  DDVPTYPE_E_HREFL_VREFH: TGUID =
4893
      (D1:$A07A02E0;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
4901
      (D1:$A07A02E0;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
4894
  DDVPTYPE_E_HREFL_VREFL: TGUID =
4902
  DDVPTYPE_E_HREFL_VREFL: TGUID =
4895
      (D1:$E09C77E0;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
4903
      (D1:$E09C77E0;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
4896
  DDVPTYPE_CCIR656: TGUID =
4904
  DDVPTYPE_CCIR656: TGUID =
4897
      (D1:$FCA326A0;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
4905
      (D1:$FCA326A0;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
4898
  DDVPTYPE_BROOKTREE: TGUID =
4906
  DDVPTYPE_BROOKTREE: TGUID =
4899
      (D1:$1352A560;D2:$DA61;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
4907
      (D1:$1352A560;D2:$DA61;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
4900
  DDVPTYPE_PHILIPS: TGUID =
4908
  DDVPTYPE_PHILIPS: TGUID =
4901
      (D1:$332CF160;D2:$DA61;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
4909
      (D1:$332CF160;D2:$DA61;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
4902
 
4910
 
4903
(*
4911
(*
4904
 * GUIDS used to describe connections
4912
 * GUIDS used to describe connections
4905
 *)
4913
 *)
4906
 
4914
 
4907
(*============================================================================
4915
(*============================================================================
4908
 *
4916
 *
4909
 * DirectDraw Structures
4917
 * DirectDraw Structures
4910
 *
4918
 *
4911
 * Various structures used to invoke DirectDraw.
4919
 * Various structures used to invoke DirectDraw.
4912
 *
4920
 *
4913
 *==========================================================================*)
4921
 *==========================================================================*)
4914
 
4922
 
4915
type
4923
type
4916
 
4924
 
4917
(*
4925
(*
4918
 * TDDVideoPortConnect
4926
 * TDDVideoPortConnect
4919
 *)
4927
 *)
4920
  PDDVideoPortConnect = ^TDDVideoPortConnect;
4928
  PDDVideoPortConnect = ^TDDVideoPortConnect;
4921
  TDDVideoPortConnect = packed record
4929
  TDDVideoPortConnect = packed record
4922
    dwSize: DWORD;        // size of the TDDVideoPortConnect structure
4930
    dwSize: DWORD;        // size of the TDDVideoPortConnect structure
4923
    dwPortWidth: DWORD;   // Width of the video port
4931
    dwPortWidth: DWORD;   // Width of the video port
4924
    guidTypeID: TGUID;    // Description of video port connection
4932
    guidTypeID: TGUID;    // Description of video port connection
4925
    dwFlags: DWORD;       // Connection flags
4933
    dwFlags: DWORD;       // Connection flags
4926
    dwReserved1: DWORD;   // Reserved, set to zero.
4934
    dwReserved1: DWORD;   // Reserved, set to zero.
4927
  end;
4935
  end;
4928
 
4936
 
4929
(*
4937
(*
4930
 * TDDVideoPortCaps
4938
 * TDDVideoPortCaps
4931
 *)
4939
 *)
4932
  PDDVideoPortCaps = ^TDDVideoPortCaps;
4940
  PDDVideoPortCaps = ^TDDVideoPortCaps;
4933
  TDDVideoPortCaps = packed record
4941
  TDDVideoPortCaps = packed record
4934
    dwSize: DWORD;                          // size of the TDDVideoPortCaps structure
4942
    dwSize: DWORD;                          // size of the TDDVideoPortCaps structure
4935
    dwFlags: DWORD;                         // indicates which fields contain data
4943
    dwFlags: DWORD;                         // indicates which fields contain data
4936
    dwMaxWidth: DWORD;                      // max width of the video port field
4944
    dwMaxWidth: DWORD;                      // max width of the video port field
4937
    dwMaxVBIWidth: DWORD;                   // max width of the VBI data
4945
    dwMaxVBIWidth: DWORD;                   // max width of the VBI data
4938
    dwMaxHeight: DWORD;                     // max height of the video port field
4946
    dwMaxHeight: DWORD;                     // max height of the video port field
4939
    dwVideoPortID: DWORD;                   // Video port ID (0 - (dwMaxVideoPorts -1))
4947
    dwVideoPortID: DWORD;                   // Video port ID (0 - (dwMaxVideoPorts -1))
4940
    dwCaps: DWORD;                          // Video port capabilities
4948
    dwCaps: DWORD;                          // Video port capabilities
4941
    dwFX: DWORD;                            // More video port capabilities
4949
    dwFX: DWORD;                            // More video port capabilities
4942
    dwNumAutoFlipSurfaces: DWORD;           // Number of autoflippable surfaces
4950
    dwNumAutoFlipSurfaces: DWORD;           // Number of autoflippable surfaces
4943
    dwAlignVideoPortBoundary: DWORD;        // Byte restriction of placement within the surface
4951
    dwAlignVideoPortBoundary: DWORD;        // Byte restriction of placement within the surface
4944
    dwAlignVideoPortPrescaleWidth: DWORD;   // Byte restriction of width after prescaling
4952
    dwAlignVideoPortPrescaleWidth: DWORD;   // Byte restriction of width after prescaling
4945
    dwAlignVideoPortCropBoundary: DWORD;    // Byte restriction of left cropping
4953
    dwAlignVideoPortCropBoundary: DWORD;    // Byte restriction of left cropping
4946
    dwAlignVideoPortCropWidth: DWORD;       // Byte restriction of cropping width
4954
    dwAlignVideoPortCropWidth: DWORD;       // Byte restriction of cropping width
4947
    dwPreshrinkXStep: DWORD;                // Width can be shrunk in steps of 1/x
4955
    dwPreshrinkXStep: DWORD;                // Width can be shrunk in steps of 1/x
4948
    dwPreshrinkYStep: DWORD;                // Height can be shrunk in steps of 1/x
4956
    dwPreshrinkYStep: DWORD;                // Height can be shrunk in steps of 1/x
4949
    dwNumVBIAutoFlipSurfaces: DWORD;        // Number of VBI autoflippable surfaces
4957
    dwNumVBIAutoFlipSurfaces: DWORD;        // Number of VBI autoflippable surfaces
4950
    dwNumPreferredAutoflip: DWORD;      // Optimal number of autoflippable surfaces for hardware
4958
    dwNumPreferredAutoflip: DWORD;      // Optimal number of autoflippable surfaces for hardware
4951
    wNumFilterTapsX: WORD;              // Number of taps the prescaler uses in the X direction (0 - no prescale, 1 - replication, etc.)
4959
    wNumFilterTapsX: WORD;              // Number of taps the prescaler uses in the X direction (0 - no prescale, 1 - replication, etc.)
4952
    wNumFilterTapsY: WORD;              // Number of taps the prescaler uses in the Y direction (0 - no prescale, 1 - replication, etc.)
4960
    wNumFilterTapsY: WORD;              // Number of taps the prescaler uses in the Y direction (0 - no prescale, 1 - replication, etc.)
4953
  end;
4961
  end;
4954
 
4962
 
4955
const
4963
const
4956
(*
4964
(*
4957
 * The dwMaxWidth and dwMaxVBIWidth members are valid
4965
 * The dwMaxWidth and dwMaxVBIWidth members are valid
4958
 *)
4966
 *)
4959
  DDVPD_WIDTH = $00000001;
4967
  DDVPD_WIDTH = $00000001;
4960
 
4968
 
4961
(*
4969
(*
4962
 * The dwMaxHeight member is valid
4970
 * The dwMaxHeight member is valid
4963
 *)
4971
 *)
4964
  DDVPD_HEIGHT = $00000002;
4972
  DDVPD_HEIGHT = $00000002;
4965
 
4973
 
4966
(*
4974
(*
4967
 * The dwVideoPortID member is valid
4975
 * The dwVideoPortID member is valid
4968
 *)
4976
 *)
4969
  DDVPD_ID = $00000004;
4977
  DDVPD_ID = $00000004;
4970
 
4978
 
4971
(*
4979
(*
4972
 * The dwCaps member is valid
4980
 * The dwCaps member is valid
4973
 *)
4981
 *)
4974
  DDVPD_CAPS = $00000008;
4982
  DDVPD_CAPS = $00000008;
4975
 
4983
 
4976
(*
4984
(*
4977
 * The dwFX member is valid
4985
 * The dwFX member is valid
4978
 *)
4986
 *)
4979
  DDVPD_FX = $00000010;
4987
  DDVPD_FX = $00000010;
4980
 
4988
 
4981
(*
4989
(*
4982
 * The dwNumAutoFlipSurfaces member is valid
4990
 * The dwNumAutoFlipSurfaces member is valid
4983
 *)
4991
 *)
4984
  DDVPD_AUTOFLIP = $00000020;
4992
  DDVPD_AUTOFLIP = $00000020;
4985
 
4993
 
4986
(*
4994
(*
4987
 * All of the alignment members are valid
4995
 * All of the alignment members are valid
4988
 *)
4996
 *)
4989
  DDVPD_ALIGN = $00000040;
4997
  DDVPD_ALIGN = $00000040;
4990
 
4998
 
4991
(*
4999
(*
4992
 * The dwNumPreferredAutoflip member is valid
5000
 * The dwNumPreferredAutoflip member is valid
4993
 *)
5001
 *)
4994
  DDVPD_PREFERREDAUTOFLIP = $00000080;
5002
  DDVPD_PREFERREDAUTOFLIP = $00000080;
4995
 
5003
 
4996
(*
5004
(*
4997
 * The wNumFilterTapsX and wNumFilterTapsY fields are valid
5005
 * The wNumFilterTapsX and wNumFilterTapsY fields are valid
4998
 *)
5006
 *)
4999
  DDVPD_FILTERQUALITY     = $00000100;
5007
  DDVPD_FILTERQUALITY     = $00000100;
5000
 
5008
 
5001
type
5009
type
5002
(*
5010
(*
5003
 * TDDVideoPortDesc
5011
 * TDDVideoPortDesc
5004
 *)
5012
 *)
5005
  PDDVideoPortDesc = ^TDDVideoPortDesc;
5013
  PDDVideoPortDesc = ^TDDVideoPortDesc;
5006
  TDDVideoPortDesc = packed record
5014
  TDDVideoPortDesc = packed record
5007
    dwSize: DWORD;                       // size of the TDDVideoPortDesc structure
5015
    dwSize: DWORD;                       // size of the TDDVideoPortDesc structure
5008
    dwFieldWidth: DWORD;                 // width of the video port field
5016
    dwFieldWidth: DWORD;                 // width of the video port field
5009
    dwVBIWidth: DWORD;                   // width of the VBI data
5017
    dwVBIWidth: DWORD;                   // width of the VBI data
5010
    dwFieldHeight: DWORD;                // height of the video port field
5018
    dwFieldHeight: DWORD;                // height of the video port field
5011
    dwMicrosecondsPerField: DWORD;       // Microseconds per video field
5019
    dwMicrosecondsPerField: DWORD;       // Microseconds per video field
5012
    dwMaxPixelsPerSecond: DWORD;         // Maximum pixel rate per second
5020
    dwMaxPixelsPerSecond: DWORD;         // Maximum pixel rate per second
5013
    dwVideoPortID: DWORD;                // Video port ID (0 - (dwMaxVideoPorts -1))
5021
    dwVideoPortID: DWORD;                // Video port ID (0 - (dwMaxVideoPorts -1))
5014
    dwReserved1: DWORD;                  // Reserved for future use - set to zero
5022
    dwReserved1: DWORD;                  // Reserved for future use - set to zero
5015
    VideoPortType: TDDVideoPortConnect;  // Description of video port connection
5023
    VideoPortType: TDDVideoPortConnect;  // Description of video port connection
5016
    dwReserved2: DWORD;                  // Reserved for future use - set to zero
5024
    dwReserved2: DWORD;                  // Reserved for future use - set to zero
5017
    dwReserved3: DWORD;                  // Reserved for future use - set to zero
5025
    dwReserved3: DWORD;                  // Reserved for future use - set to zero
5018
  end;
5026
  end;
5019
 
5027
 
5020
(*
5028
(*
5021
 * TDDVideoPortInfo
5029
 * TDDVideoPortInfo
5022
 *)
5030
 *)
5023
  PDDVideoPortInfo = ^TDDVideoPortInfo;
5031
  PDDVideoPortInfo = ^TDDVideoPortInfo;
5024
  TDDVideoPortInfo = packed record
5032
  TDDVideoPortInfo = packed record
5025
    dwSize: DWORD;                            // Size of the structure
5033
    dwSize: DWORD;                            // Size of the structure
5026
    dwOriginX: DWORD;                         // Placement of the video data within the surface.
5034
    dwOriginX: DWORD;                         // Placement of the video data within the surface.
5027
    dwOriginY: DWORD;                         // Placement of the video data within the surface.
5035
    dwOriginY: DWORD;                         // Placement of the video data within the surface.
5028
    dwVPFlags: DWORD;                         // Video port options
5036
    dwVPFlags: DWORD;                         // Video port options
5029
    rCrop: TRect;                             // Cropping rectangle (optional).
5037
    rCrop: TRect;                             // Cropping rectangle (optional).
5030
    dwPrescaleWidth: DWORD;                   // Determines pre-scaling/zooming in the X direction (optional).
5038
    dwPrescaleWidth: DWORD;                   // Determines pre-scaling/zooming in the X direction (optional).
5031
    dwPrescaleHeight: DWORD;                  // Determines pre-scaling/zooming in the Y direction (optional).
5039
    dwPrescaleHeight: DWORD;                  // Determines pre-scaling/zooming in the Y direction (optional).
5032
    lpddpfInputFormat: PDDPixelFormat;       // Video format written to the video port
5040
    lpddpfInputFormat: PDDPixelFormat;       // Video format written to the video port
5033
    lpddpfVBIInputFormat: PDDPixelFormat;    // Input format of the VBI data
5041
    lpddpfVBIInputFormat: PDDPixelFormat;    // Input format of the VBI data
5034
    lpddpfVBIOutputFormat: PDDPixelFormat;   // Output format of the data
5042
    lpddpfVBIOutputFormat: PDDPixelFormat;   // Output format of the data
5035
    dwVBIHeight: DWORD;                       // Specifies the number of lines of data within the vertical blanking interval.
5043
    dwVBIHeight: DWORD;                       // Specifies the number of lines of data within the vertical blanking interval.
5036
    dwReserved1: DWORD;                       // Reserved for future use - set to zero
5044
    dwReserved1: DWORD;                       // Reserved for future use - set to zero
5037
    dwReserved2: DWORD;                       // Reserved for future use - set to zero
5045
    dwReserved2: DWORD;                       // Reserved for future use - set to zero
5038
  end;
5046
  end;
5039
 
5047
 
5040
(*
5048
(*
5041
 * TDDVideoPortBandWidth
5049
 * TDDVideoPortBandWidth
5042
 *)
5050
 *)
5043
  PDDVideoPortBandWidth = ^TDDVideoPortBandWidth;
5051
  PDDVideoPortBandWidth = ^TDDVideoPortBandWidth;
5044
  TDDVideoPortBandWidth = packed record
5052
  TDDVideoPortBandWidth = packed record
5045
    dwSize: DWORD;                 // Size of the structure
5053
    dwSize: DWORD;                 // Size of the structure
5046
    dwCaps: DWORD;
5054
    dwCaps: DWORD;
5047
    dwOverlay: DWORD;              // Zoom factor at which overlay is supported
5055
    dwOverlay: DWORD;              // Zoom factor at which overlay is supported
5048
    dwColorkey: DWORD;             // Zoom factor at which overlay w/ colorkey is supported
5056
    dwColorkey: DWORD;             // Zoom factor at which overlay w/ colorkey is supported
5049
    dwYInterpolate: DWORD;         // Zoom factor at which overlay w/ Y interpolation is supported
5057
    dwYInterpolate: DWORD;         // Zoom factor at which overlay w/ Y interpolation is supported
5050
    dwYInterpAndColorkey: DWORD;   // Zoom factor at which ovelray w/ Y interpolation and colorkeying is supported
5058
    dwYInterpAndColorkey: DWORD;   // Zoom factor at which ovelray w/ Y interpolation and colorkeying is supported
5051
    dwReserved1: DWORD;            // Reserved for future use - set to zero
5059
    dwReserved1: DWORD;            // Reserved for future use - set to zero
5052
    dwReserved2: DWORD;            // Reserved for future use - set to zero
5060
    dwReserved2: DWORD;            // Reserved for future use - set to zero
5053
  end;
5061
  end;
5054
 
5062
 
5055
(*
5063
(*
5056
 * TDDVideoPortStatus
5064
 * TDDVideoPortStatus
5057
 *)
5065
 *)
5058
  PDDVideoPortStatus = ^TDDVideoPortStatus;
5066
  PDDVideoPortStatus = ^TDDVideoPortStatus;
5059
  TDDVideoPortStatus = record
5067
  TDDVideoPortStatus = record
5060
    dwSize: DWORD;                       // Size of the structure
5068
    dwSize: DWORD;                       // Size of the structure
5061
    bInUse: BOOL;                        // TRUE if video port is currently being used
5069
    bInUse: BOOL;                        // TRUE if video port is currently being used
5062
    dwFlags: DWORD;                      // Currently not used
5070
    dwFlags: DWORD;                      // Currently not used
5063
    dwReserved1: DWORD;                  // Reserved for future use
5071
    dwReserved1: DWORD;                  // Reserved for future use
5064
    VideoPortType: TDDVideoPortConnect;  // Information about the connection
5072
    VideoPortType: TDDVideoPortConnect;  // Information about the connection
5065
    dwReserved2: DWORD;                  // Reserved for future use
5073
    dwReserved2: DWORD;                  // Reserved for future use
5066
    dwReserved3: DWORD;                  // Reserved for future use
5074
    dwReserved3: DWORD;                  // Reserved for future use
5067
  end;
5075
  end;
5068
 
5076
 
5069
const
5077
const
5070
(*============================================================================
5078
(*============================================================================
5071
 *
5079
 *
5072
 * Video Port Flags
5080
 * Video Port Flags
5073
 *
5081
 *
5074
 * All flags are bit flags.
5082
 * All flags are bit flags.
5075
 *
5083
 *
5076
 *==========================================================================*)
5084
 *==========================================================================*)
5077
 
5085
 
5078
(****************************************************************************
5086
(****************************************************************************
5079
 *
5087
 *
5080
 * VIDEOPORT TDDVideoPortConnect FLAGS
5088
 * VIDEOPORT TDDVideoPortConnect FLAGS
5081
 *
5089
 *
5082
 ****************************************************************************)
5090
 ****************************************************************************)
5083
 
5091
 
5084
(*
5092
(*
5085
 * When this is set by the driver and passed to the client, this
5093
 * When this is set by the driver and passed to the client, this
5086
 * indicates that the video port is capable of double clocking the data.
5094
 * indicates that the video port is capable of double clocking the data.
5087
 * When this is set by the client, this indicates that the video port
5095
 * When this is set by the client, this indicates that the video port
5088
 * should enable double clocking.  This flag is only valid with external
5096
 * should enable double clocking.  This flag is only valid with external
5089
 * syncs.
5097
 * syncs.
5090
 *)
5098
 *)
5091
  DDVPCONNECT_DOUBLECLOCK = $00000001;
5099
  DDVPCONNECT_DOUBLECLOCK = $00000001;
5092
 
5100
 
5093
(*
5101
(*
5094
 * When this is set by the driver and passed to the client, this
5102
 * When this is set by the driver and passed to the client, this
5095
 * indicates that the video port is capable of using an external VACT
5103
 * indicates that the video port is capable of using an external VACT
5096
 * signal. When this is set by the client, this indicates that the
5104
 * signal. When this is set by the client, this indicates that the
5097
 * video port should use the external VACT signal.
5105
 * video port should use the external VACT signal.
5098
 *)
5106
 *)
5099
  DDVPCONNECT_VACT = $00000002;
5107
  DDVPCONNECT_VACT = $00000002;
5100
 
5108
 
5101
(*
5109
(*
5102
 * When this is set by the driver and passed to the client, this
5110
 * When this is set by the driver and passed to the client, this
5103
 * indicates that the video port is capable of treating even fields
5111
 * indicates that the video port is capable of treating even fields
5104
 * like odd fields and visa versa.  When this is set by the client,
5112
 * like odd fields and visa versa.  When this is set by the client,
5105
 * this indicates that the video port should treat even fields like odd
5113
 * this indicates that the video port should treat even fields like odd
5106
 * fields.
5114
 * fields.
5107
 *)
5115
 *)
5108
  DDVPCONNECT_INVERTPOLARITY = $00000004;
5116
  DDVPCONNECT_INVERTPOLARITY = $00000004;
5109
 
5117
 
5110
(*
5118
(*
5111
 * Indicates that any data written to the video port during the VREF
5119
 * Indicates that any data written to the video port during the VREF
5112
 * period will not be written into the frame buffer. This flag is read only.
5120
 * period will not be written into the frame buffer. This flag is read only.
5113
 *)
5121
 *)
5114
  DDVPCONNECT_DISCARDSVREFDATA = $00000008;
5122
  DDVPCONNECT_DISCARDSVREFDATA = $00000008;
5115
 
5123
 
5116
(*
5124
(*
5117
 * When this is set be the driver and passed to the client, this
5125
 * When this is set be the driver and passed to the client, this
5118
 * indicates that the device will write half lines into the frame buffer
5126
 * indicates that the device will write half lines into the frame buffer
5119
 * if half lines are provided by the decoder.  If this is set by the client,
5127
 * if half lines are provided by the decoder.  If this is set by the client,
5120
 * this indicates that the decoder will be supplying half lines.
5128
 * this indicates that the decoder will be supplying half lines.
5121
 *)
5129
 *)
5122
  DDVPCONNECT_HALFLINE = $00000010;
5130
  DDVPCONNECT_HALFLINE = $00000010;
5123
 
5131
 
5124
(*
5132
(*
5125
 * Indicates that the signal is interlaced. This flag is only
5133
 * Indicates that the signal is interlaced. This flag is only
5126
 * set by the client.
5134
 * set by the client.
5127
 *)
5135
 *)
5128
  DDVPCONNECT_INTERLACED = $00000020;
5136
  DDVPCONNECT_INTERLACED = $00000020;
5129
 
5137
 
5130
(*
5138
(*
5131
 * Indicates that video port is shareable and that this video port
5139
 * Indicates that video port is shareable and that this video port
5132
 * will use the even fields.  This flag is only set by the client.
5140
 * will use the even fields.  This flag is only set by the client.
5133
 *)
5141
 *)
5134
  DDVPCONNECT_SHAREEVEN = $00000040;
5142
  DDVPCONNECT_SHAREEVEN = $00000040;
5135
 
5143
 
5136
(*
5144
(*
5137
 * Indicates that video port is shareable and that this video port
5145
 * Indicates that video port is shareable and that this video port
5138
 * will use the odd fields.  This flag is only set by the client.
5146
 * will use the odd fields.  This flag is only set by the client.
5139
 *)
5147
 *)
5140
  DDVPCONNECT_SHAREODD = $00000080;
5148
  DDVPCONNECT_SHAREODD = $00000080;
5141
 
5149
 
5142
(****************************************************************************
5150
(****************************************************************************
5143
 *
5151
 *
5144
 * VIDEOPORT TDDVideoPortDesc CAPS
5152
 * VIDEOPORT TDDVideoPortDesc CAPS
5145
 *
5153
 *
5146
 ****************************************************************************)
5154
 ****************************************************************************)
5147
 
5155
 
5148
(*
5156
(*
5149
 * Flip can be performed automatically to avoid tearing.
5157
 * Flip can be performed automatically to avoid tearing.
5150
 *)
5158
 *)
5151
  DDVPCAPS_AUTOFLIP = $00000001;
5159
  DDVPCAPS_AUTOFLIP = $00000001;
5152
 
5160
 
5153
(*
5161
(*
5154
 * Supports interlaced video
5162
 * Supports interlaced video
5155
 *)
5163
 *)
5156
  DDVPCAPS_INTERLACED = $00000002;
5164
  DDVPCAPS_INTERLACED = $00000002;
5157
 
5165
 
5158
(*
5166
(*
5159
 * Supports non-interlaced video
5167
 * Supports non-interlaced video
5160
 *)
5168
 *)
5161
  DDVPCAPS_NONINTERLACED = $00000004;
5169
  DDVPCAPS_NONINTERLACED = $00000004;
5162
 
5170
 
5163
(*
5171
(*
5164
 * Indicates that the device can return whether the current field
5172
 * Indicates that the device can return whether the current field
5165
 * of an interlaced signal is even or odd.
5173
 * of an interlaced signal is even or odd.
5166
 *)
5174
 *)
5167
  DDVPCAPS_READBACKFIELD = $00000008;
5175
  DDVPCAPS_READBACKFIELD = $00000008;
5168
 
5176
 
5169
(*
5177
(*
5170
 * Indicates that the device can return the current line of video
5178
 * Indicates that the device can return the current line of video
5171
 * being written into the frame buffer.
5179
 * being written into the frame buffer.
5172
 *)
5180
 *)
5173
  DDVPCAPS_READBACKLINE = $00000010;
5181
  DDVPCAPS_READBACKLINE = $00000010;
5174
 
5182
 
5175
(*
5183
(*
5176
 * Allows two gen-locked video streams to share a single video port,
5184
 * Allows two gen-locked video streams to share a single video port,
5177
 * where one stream uses the even fields and the other uses the odd
5185
 * where one stream uses the even fields and the other uses the odd
5178
 * fields. Separate parameters (including address, scaling,
5186
 * fields. Separate parameters (including address, scaling,
5179
 * cropping, etc.) are maintained for both fields.)
5187
 * cropping, etc.) are maintained for both fields.)
5180
 *)
5188
 *)
5181
  DDVPCAPS_SHAREABLE = $00000020;
5189
  DDVPCAPS_SHAREABLE = $00000020;
5182
 
5190
 
5183
(*
5191
(*
5184
 * Even fields of video can be automatically discarded.
5192
 * Even fields of video can be automatically discarded.
5185
 *)
5193
 *)
5186
  DDVPCAPS_SKIPEVENFIELDS = $00000040;
5194
  DDVPCAPS_SKIPEVENFIELDS = $00000040;
5187
 
5195
 
5188
(*
5196
(*
5189
 * Odd fields of video can be automatically discarded.
5197
 * Odd fields of video can be automatically discarded.
5190
 *)
5198
 *)
5191
  DDVPCAPS_SKIPODDFIELDS = $00000080;
5199
  DDVPCAPS_SKIPODDFIELDS = $00000080;
5192
 
5200
 
5193
(*
5201
(*
5194
 * Indicates that the device is capable of driving the graphics
5202
 * Indicates that the device is capable of driving the graphics
5195
 * VSYNC with the video port VSYNC.
5203
 * VSYNC with the video port VSYNC.
5196
 *)
5204
 *)
5197
  DDVPCAPS_SYNCMASTER = $00000100;
5205
  DDVPCAPS_SYNCMASTER = $00000100;
5198
 
5206
 
5199
(*
5207
(*
5200
 * Indicates that data within the vertical blanking interval can
5208
 * Indicates that data within the vertical blanking interval can
5201
 * be written to a different surface.
5209
 * be written to a different surface.
5202
 *)
5210
 *)
5203
  DDVPCAPS_VBISURFACE = $00000200;
5211
  DDVPCAPS_VBISURFACE = $00000200;
5204
 
5212
 
5205
(*
5213
(*
5206
 * Indicates that the video port can perform color operations
5214
 * Indicates that the video port can perform color operations
5207
 * on the incoming data before it is written to the frame buffer.
5215
 * on the incoming data before it is written to the frame buffer.
5208
 *)
5216
 *)
5209
  DDVPCAPS_COLORCONTROL = $00000400;
5217
  DDVPCAPS_COLORCONTROL = $00000400;
5210
 
5218
 
5211
(*
5219
(*
5212
 * Indicates that the video port can accept VBI data in a different
5220
 * Indicates that the video port can accept VBI data in a different
5213
 * width or format than the regular video data.
5221
 * width or format than the regular video data.
5214
 *)
5222
 *)
5215
  DDVPCAPS_OVERSAMPLEDVBI = $00000800;
5223
  DDVPCAPS_OVERSAMPLEDVBI = $00000800;
5216
 
5224
 
5217
(*
5225
(*
5218
 * Indicates that the video port can write data directly to system memory
5226
 * Indicates that the video port can write data directly to system memory
5219
 *)
5227
 *)
5220
  DDVPCAPS_SYSTEMMEMORY = $00001000;
5228
  DDVPCAPS_SYSTEMMEMORY = $00001000;
5221
 
5229
 
5222
(*
5230
(*
5223
 * Indicates that the VBI and video portions of the video stream can
5231
 * Indicates that the VBI and video portions of the video stream can
5224
 * be controlled by an independent processes.
5232
 * be controlled by an independent processes.
5225
 *)
5233
 *)
5226
  DDVPCAPS_VBIANDVIDEOINDEPENDENT       = $00002000;
5234
  DDVPCAPS_VBIANDVIDEOINDEPENDENT       = $00002000;
5227
 
5235
 
5228
(*
5236
(*
5229
 * Indicates that the video port contains high quality hardware
5237
 * Indicates that the video port contains high quality hardware
5230
 * de-interlacing hardware that should be used instead of the
5238
 * de-interlacing hardware that should be used instead of the
5231
 * bob/weave algorithms.
5239
 * bob/weave algorithms.
5232
 *)
5240
 *)
5233
  DDVPCAPS_HARDWAREDEINTERLACE          = $00004000;
5241
  DDVPCAPS_HARDWAREDEINTERLACE          = $00004000;
5234
 
5242
 
5235
(****************************************************************************
5243
(****************************************************************************
5236
 *
5244
 *
5237
 * VIDEOPORT TDDVideoPortDesc FX
5245
 * VIDEOPORT TDDVideoPortDesc FX
5238
 *
5246
 *
5239
 ****************************************************************************)
5247
 ****************************************************************************)
5240
 
5248
 
5241
(*
5249
(*
5242
 * Limited cropping is available to crop out the vertical interval data.
5250
 * Limited cropping is available to crop out the vertical interval data.
5243
 *)
5251
 *)
5244
  DDVPFX_CROPTOPDATA = $00000001;
5252
  DDVPFX_CROPTOPDATA = $00000001;
5245
 
5253
 
5246
(*
5254
(*
5247
 * Incoming data can be cropped in the X direction before it is written
5255
 * Incoming data can be cropped in the X direction before it is written
5248
 * to the surface.
5256
 * to the surface.
5249
 *)
5257
 *)
5250
  DDVPFX_CROPX = $00000002;
5258
  DDVPFX_CROPX = $00000002;
5251
 
5259
 
5252
(*
5260
(*
5253
 * Incoming data can be cropped in the Y direction before it is written
5261
 * Incoming data can be cropped in the Y direction before it is written
5254
 * to the surface.
5262
 * to the surface.
5255
 *)
5263
 *)
5256
  DDVPFX_CROPY = $00000004;
5264
  DDVPFX_CROPY = $00000004;
5257
 
5265
 
5258
(*
5266
(*
5259
 * Supports interleaving interlaced fields in memory.
5267
 * Supports interleaving interlaced fields in memory.
5260
 *)
5268
 *)
5261
  DDVPFX_INTERLEAVE = $00000008;
5269
  DDVPFX_INTERLEAVE = $00000008;
5262
 
5270
 
5263
(*
5271
(*
5264
 * Supports mirroring left to right as the video data is written
5272
 * Supports mirroring left to right as the video data is written
5265
 * into the frame buffer.
5273
 * into the frame buffer.
5266
 *)
5274
 *)
5267
  DDVPFX_MIRRORLEFTRIGHT = $00000010;
5275
  DDVPFX_MIRRORLEFTRIGHT = $00000010;
5268
 
5276
 
5269
(*
5277
(*
5270
 * Supports mirroring top to bottom as the video data is written
5278
 * Supports mirroring top to bottom as the video data is written
5271
 * into the frame buffer.
5279
 * into the frame buffer.
5272
 *)
5280
 *)
5273
  DDVPFX_MIRRORUPDOWN = $00000020;
5281
  DDVPFX_MIRRORUPDOWN = $00000020;
5274
 
5282
 
5275
(*
5283
(*
5276
 * Data can be arbitrarily shrunk in the X direction before it
5284
 * Data can be arbitrarily shrunk in the X direction before it
5277
 * is written to the surface.
5285
 * is written to the surface.
5278
 *)
5286
 *)
5279
  DDVPFX_PRESHRINKX = $00000040;
5287
  DDVPFX_PRESHRINKX = $00000040;
5280
 
5288
 
5281
(*
5289
(*
5282
 * Data can be arbitrarily shrunk in the Y direction before it
5290
 * Data can be arbitrarily shrunk in the Y direction before it
5283
 * is written to the surface.
5291
 * is written to the surface.
5284
 *)
5292
 *)
5285
  DDVPFX_PRESHRINKY = $00000080;
5293
  DDVPFX_PRESHRINKY = $00000080;
5286
 
5294
 
5287
(*
5295
(*
5288
 * Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the X
5296
 * Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the X
5289
 * direction before it is written to the surface.
5297
 * direction before it is written to the surface.
5290
 *)
5298
 *)
5291
  DDVPFX_PRESHRINKXB = $00000100;
5299
  DDVPFX_PRESHRINKXB = $00000100;
5292
 
5300
 
5293
(*
5301
(*
5294
 * Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the Y
5302
 * Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the Y
5295
 * direction before it is written to the surface.
5303
 * direction before it is written to the surface.
5296
 *)
5304
 *)
5297
  DDVPFX_PRESHRINKYB = $00000200;
5305
  DDVPFX_PRESHRINKYB = $00000200;
5298
 
5306
 
5299
(*
5307
(*
5300
 * Data can be shrunk in increments of 1/x in the X direction
5308
 * Data can be shrunk in increments of 1/x in the X direction
5301
 * (where X is specified in the TDDVideoPortCaps.dwPreshrinkXStep)
5309
 * (where X is specified in the TDDVideoPortCaps.dwPreshrinkXStep)
5302
 * before it is written to the surface.
5310
 * before it is written to the surface.
5303
 *)
5311
 *)
5304
  DDVPFX_PRESHRINKXS = $00000400;
5312
  DDVPFX_PRESHRINKXS = $00000400;
5305
 
5313
 
5306
(*
5314
(*
5307
 * Data can be shrunk in increments of 1/x in the Y direction
5315
 * Data can be shrunk in increments of 1/x in the Y direction
5308
 * (where X is specified in the TDDVideoPortCaps.dwPreshrinkYStep)
5316
 * (where X is specified in the TDDVideoPortCaps.dwPreshrinkYStep)
5309
 * before it is written to the surface.
5317
 * before it is written to the surface.
5310
 *)
5318
 *)
5311
  DDVPFX_PRESHRINKYS = $00000800;
5319
  DDVPFX_PRESHRINKYS = $00000800;
5312
 
5320
 
5313
(*
5321
(*
5314
 * Data can be arbitrarily stretched in the X direction before
5322
 * Data can be arbitrarily stretched in the X direction before
5315
 * it is written to the surface.
5323
 * it is written to the surface.
5316
 *)
5324
 *)
5317
  DDVPFX_PRESTRETCHX = $00001000;
5325
  DDVPFX_PRESTRETCHX = $00001000;
5318
 
5326
 
5319
(*
5327
(*
5320
 * Data can be arbitrarily stretched in the Y direction before
5328
 * Data can be arbitrarily stretched in the Y direction before
5321
 * it is written to the surface.
5329
 * it is written to the surface.
5322
 *)
5330
 *)
5323
  DDVPFX_PRESTRETCHY = $00002000;
5331
  DDVPFX_PRESTRETCHY = $00002000;
5324
 
5332
 
5325
(*
5333
(*
5326
 * Data can be integer stretched in the X direction before it is
5334
 * Data can be integer stretched in the X direction before it is
5327
 * written to the surface.
5335
 * written to the surface.
5328
 *)
5336
 *)
5329
  DDVPFX_PRESTRETCHXN = $00004000;
5337
  DDVPFX_PRESTRETCHXN = $00004000;
5330
 
5338
 
5331
(*
5339
(*
5332
 * Data can be integer stretched in the Y direction before it is
5340
 * Data can be integer stretched in the Y direction before it is
5333
 * written to the surface.
5341
 * written to the surface.
5334
 *)
5342
 *)
5335
  DDVPFX_PRESTRETCHYN = $00008000;
5343
  DDVPFX_PRESTRETCHYN = $00008000;
5336
 
5344
 
5337
(*
5345
(*
5338
 * Indicates that data within the vertical blanking interval can
5346
 * Indicates that data within the vertical blanking interval can
5339
 * be converted independently of the remaining video data.
5347
 * be converted independently of the remaining video data.
5340
 *)
5348
 *)
5341
  DDVPFX_VBICONVERT = $00010000;
5349
  DDVPFX_VBICONVERT = $00010000;
5342
 
5350
 
5343
(*
5351
(*
5344
 * Indicates that scaling can be disabled for data within the
5352
 * Indicates that scaling can be disabled for data within the
5345
 * vertical blanking interval.
5353
 * vertical blanking interval.
5346
 *)
5354
 *)
5347
  DDVPFX_VBINOSCALE = $00020000;
5355
  DDVPFX_VBINOSCALE = $00020000;
5348
 
5356
 
5349
(*
5357
(*
5350
 * Indicates that the video data can ignore the left and right
5358
 * Indicates that the video data can ignore the left and right
5351
 * cropping coordinates when cropping oversampled VBI data.
5359
 * cropping coordinates when cropping oversampled VBI data.
5352
 *)
5360
 *)
5353
  DDVPFX_IGNOREVBIXCROP = $00040000;
5361
  DDVPFX_IGNOREVBIXCROP = $00040000;
5354
 
5362
 
5355
(*
5363
(*
5356
 * Indicates that interleaving can be disabled for data within the
5364
 * Indicates that interleaving can be disabled for data within the
5357
 * vertical blanking interval.
5365
 * vertical blanking interval.
5358
 *)
5366
 *)
5359
  DDVPFX_VBINOINTERLEAVE     = $00080000;
5367
  DDVPFX_VBINOINTERLEAVE     = $00080000;
5360
 
5368
 
5361
(****************************************************************************
5369
(****************************************************************************
5362
 *
5370
 *
5363
 * VIDEOPORT TDDVideoPortInfo FLAGS
5371
 * VIDEOPORT TDDVideoPortInfo FLAGS
5364
 *
5372
 *
5365
 ****************************************************************************)
5373
 ****************************************************************************)
5366
 
5374
 
5367
(*
5375
(*
5368
 * Perform automatic flipping.   Auto-flipping is performed between
5376
 * Perform automatic flipping.   Auto-flipping is performed between
5369
 * the overlay surface that was attached to the video port using
5377
 * the overlay surface that was attached to the video port using
5370
 * IDirectDrawVideoPort::AttachSurface and the overlay surfaces that
5378
 * IDirectDrawVideoPort::AttachSurface and the overlay surfaces that
5371
 * are attached to the surface via the IDirectDrawSurface::AttachSurface
5379
 * are attached to the surface via the IDirectDrawSurface::AttachSurface
5372
 * method.  The flip order is the order in which the overlay surfaces
5380
 * method.  The flip order is the order in which the overlay surfaces
5373
 * were. attached.
5381
 * were. attached.
5374
 *)
5382
 *)
5375
  DDVP_AUTOFLIP = $00000001;
5383
  DDVP_AUTOFLIP = $00000001;
5376
 
5384
 
5377
(*
5385
(*
5378
 * Perform conversion using the ddpfOutputFormat information.
5386
 * Perform conversion using the ddpfOutputFormat information.
5379
 *)
5387
 *)
5380
  DDVP_CONVERT = $00000002;
5388
  DDVP_CONVERT = $00000002;
5381
 
5389
 
5382
(*
5390
(*
5383
 * Perform cropping using the specified rectangle.
5391
 * Perform cropping using the specified rectangle.
5384
 *)
5392
 *)
5385
  DDVP_CROP = $00000004;
5393
  DDVP_CROP = $00000004;
5386
 
5394
 
5387
(*
5395
(*
5388
 * Indicates that interlaced fields should be interleaved in memory.
5396
 * Indicates that interlaced fields should be interleaved in memory.
5389
 *)
5397
 *)
5390
  DDVP_INTERLEAVE = $00000008;
5398
  DDVP_INTERLEAVE = $00000008;
5391
 
5399
 
5392
(*
5400
(*
5393
 * Indicates that the data should be mirrored left to right as it's
5401
 * Indicates that the data should be mirrored left to right as it's
5394
 * written into the frame buffer.
5402
 * written into the frame buffer.
5395
 *)
5403
 *)
5396
  DDVP_MIRRORLEFTRIGHT = $00000010;
5404
  DDVP_MIRRORLEFTRIGHT = $00000010;
5397
 
5405
 
5398
(*
5406
(*
5399
 * Indicates that the data should be mirrored top to bottom as it's
5407
 * Indicates that the data should be mirrored top to bottom as it's
5400
 * written into the frame buffer.
5408
 * written into the frame buffer.
5401
 *)
5409
 *)
5402
  DDVP_MIRRORUPDOWN = $00000020;
5410
  DDVP_MIRRORUPDOWN = $00000020;
5403
 
5411
 
5404
(*
5412
(*
5405
 * Perform pre-scaling/zooming based on the pre-scale parameters.
5413
 * Perform pre-scaling/zooming based on the pre-scale parameters.
5406
 *)
5414
 *)
5407
  DDVP_PRESCALE = $00000040;
5415
  DDVP_PRESCALE = $00000040;
5408
 
5416
 
5409
(*
5417
(*
5410
 * Ignore input of even fields.
5418
 * Ignore input of even fields.
5411
 *)
5419
 *)
5412
  DDVP_SKIPEVENFIELDS = $00000080;
5420
  DDVP_SKIPEVENFIELDS = $00000080;
5413
 
5421
 
5414
(*
5422
(*
5415
 * Ignore input of odd fields.
5423
 * Ignore input of odd fields.
5416
 *)
5424
 *)
5417
  DDVP_SKIPODDFIELDS = $00000100;
5425
  DDVP_SKIPODDFIELDS = $00000100;
5418
 
5426
 
5419
(*
5427
(*
5420
 * Drive the graphics VSYNCs using the video port VYSNCs.
5428
 * Drive the graphics VSYNCs using the video port VYSNCs.
5421
 *)
5429
 *)
5422
  DDVP_SYNCMASTER = $00000200;
5430
  DDVP_SYNCMASTER = $00000200;
5423
 
5431
 
5424
(*
5432
(*
5425
 * The ddpfVBIOutputFormatFormat member contains data that should be used
5433
 * The ddpfVBIOutputFormatFormat member contains data that should be used
5426
 * to convert the data within the vertical blanking interval.
5434
 * to convert the data within the vertical blanking interval.
5427
 *)
5435
 *)
5428
  DDVP_VBICONVERT = $00000400;
5436
  DDVP_VBICONVERT = $00000400;
5429
 
5437
 
5430
(*
5438
(*
5431
 * Indicates that data within the vertical blanking interval
5439
 * Indicates that data within the vertical blanking interval
5432
 * should not be scaled.
5440
 * should not be scaled.
5433
 *)
5441
 *)
5434
  DDVP_VBINOSCALE = $00000800;
5442
  DDVP_VBINOSCALE = $00000800;
5435
 
5443
 
5436
(*
5444
(*
5437
 * Indicates that these bob/weave decisions should not be
5445
 * Indicates that these bob/weave decisions should not be
5438
 * overriden by other interfaces.
5446
 * overriden by other interfaces.
5439
 *)
5447
 *)
5440
  DDVP_OVERRIDEBOBWEAVE = $00001000;
5448
  DDVP_OVERRIDEBOBWEAVE = $00001000;
5441
 
5449
 
5442
(*
5450
(*
5443
 * Indicates that the video data should ignore the left and right
5451
 * Indicates that the video data should ignore the left and right
5444
 * cropping coordinates when cropping the VBI data.
5452
 * cropping coordinates when cropping the VBI data.
5445
 *)
5453
 *)
5446
  DDVP_IGNOREVBIXCROP = $00002000;
5454
  DDVP_IGNOREVBIXCROP = $00002000;
5447
 
5455
 
5448
(*
5456
(*
5449
 * Indicates that interleaving can be disabled for data within the
5457
 * Indicates that interleaving can be disabled for data within the
5450
 * vertical blanking interval.
5458
 * vertical blanking interval.
5451
 *)
5459
 *)
5452
  DDVP_VBINOINTERLEAVE                  = $00004000;
5460
  DDVP_VBINOINTERLEAVE                  = $00004000;
5453
 
5461
 
5454
(*
5462
(*
5455
 * Indicates that the video port should use the hardware
5463
 * Indicates that the video port should use the hardware
5456
 * de-interlacing hardware.
5464
 * de-interlacing hardware.
5457
 *)
5465
 *)
5458
  DDVP_HARDWAREDEINTERLACE              = $00008000;
5466
  DDVP_HARDWAREDEINTERLACE              = $00008000;
5459
 
5467
 
5460
(****************************************************************************
5468
(****************************************************************************
5461
 *
5469
 *
5462
 * DIRIRECTDRAWVIDEOPORT GETINPUTFORMAT/GETOUTPUTFORMAT FLAGS
5470
 * DIRIRECTDRAWVIDEOPORT GETINPUTFORMAT/GETOUTPUTFORMAT FLAGS
5463
 *
5471
 *
5464
 ****************************************************************************)
5472
 ****************************************************************************)
5465
 
5473
 
5466
(*
5474
(*
5467
 * Return formats for the video data
5475
 * Return formats for the video data
5468
 *)
5476
 *)
5469
  DDVPFORMAT_VIDEO = $00000001;
5477
  DDVPFORMAT_VIDEO = $00000001;
5470
 
5478
 
5471
(*
5479
(*
5472
 * Return formats for the VBI data
5480
 * Return formats for the VBI data
5473
 *)
5481
 *)
5474
  DDVPFORMAT_VBI = $00000002;
5482
  DDVPFORMAT_VBI = $00000002;
5475
 
5483
 
5476
(****************************************************************************
5484
(****************************************************************************
5477
 *
5485
 *
5478
 * DIRIRECTDRAWVIDEOPORT SETTARGETSURFACE FLAGS
5486
 * DIRIRECTDRAWVIDEOPORT SETTARGETSURFACE FLAGS
5479
 *
5487
 *
5480
 ****************************************************************************)
5488
 ****************************************************************************)
5481
 
5489
 
5482
(*
5490
(*
5483
 * Surface should receive video data (and VBI data if a surface
5491
 * Surface should receive video data (and VBI data if a surface
5484
 * is not explicitly attached for that purpose)
5492
 * is not explicitly attached for that purpose)
5485
 *)
5493
 *)
5486
  DDVPTARGET_VIDEO = $00000001;
5494
  DDVPTARGET_VIDEO = $00000001;
5487
 
5495
 
5488
(*
5496
(*
5489
 * Surface should receive VBI data
5497
 * Surface should receive VBI data
5490
 *)
5498
 *)
5491
  DDVPTARGET_VBI = $00000002;
5499
  DDVPTARGET_VBI = $00000002;
5492
 
5500
 
5493
(****************************************************************************
5501
(****************************************************************************
5494
 *
5502
 *
5495
 * DIRIRECTDRAWVIDEOPORT WAITFORSYNC FLAGS
5503
 * DIRIRECTDRAWVIDEOPORT WAITFORSYNC FLAGS
5496
 *
5504
 *
5497
 ****************************************************************************)
5505
 ****************************************************************************)
5498
 
5506
 
5499
(*
5507
(*
5500
 * Waits until the beginning of the next VSYNC
5508
 * Waits until the beginning of the next VSYNC
5501
 *)
5509
 *)
5502
  DDVPWAIT_BEGIN = $00000001;
5510
  DDVPWAIT_BEGIN = $00000001;
5503
 
5511
 
5504
(*
5512
(*
5505
 * Waits until the end of the next/current VSYNC
5513
 * Waits until the end of the next/current VSYNC
5506
 *)
5514
 *)
5507
  DDVPWAIT_END = $00000002;
5515
  DDVPWAIT_END = $00000002;
5508
 
5516
 
5509
(*
5517
(*
5510
 * Waits until the beginning of the specified line
5518
 * Waits until the beginning of the specified line
5511
 *)
5519
 *)
5512
  DDVPWAIT_LINE = $00000003;
5520
  DDVPWAIT_LINE = $00000003;
5513
 
5521
 
5514
(****************************************************************************
5522
(****************************************************************************
5515
 *
5523
 *
5516
 * DIRECTDRAWVIDEOPORT FLIP FLAGS
5524
 * DIRECTDRAWVIDEOPORT FLIP FLAGS
5517
 *
5525
 *
5518
 ****************************************************************************)
5526
 ****************************************************************************)
5519
 
5527
 
5520
(*
5528
(*
5521
 * Flips the normal video surface
5529
 * Flips the normal video surface
5522
 *)
5530
 *)
5523
  DDVPFLIP_VIDEO = $00000001;
5531
  DDVPFLIP_VIDEO = $00000001;
5524
 
5532
 
5525
(*
5533
(*
5526
 * Flips the VBI surface
5534
 * Flips the VBI surface
5527
 *)
5535
 *)
5528
  DDVPFLIP_VBI = $00000002;
5536
  DDVPFLIP_VBI = $00000002;
5529
 
5537
 
5530
(****************************************************************************
5538
(****************************************************************************
5531
 *
5539
 *
5532
 * DIRIRECTDRAWVIDEOPORT GETVIDEOSIGNALSTATUS VALUES
5540
 * DIRIRECTDRAWVIDEOPORT GETVIDEOSIGNALSTATUS VALUES
5533
 *
5541
 *
5534
 ****************************************************************************)
5542
 ****************************************************************************)
5535
 
5543
 
5536
(*
5544
(*
5537
 * No video signal is present at the video port
5545
 * No video signal is present at the video port
5538
 *)
5546
 *)
5539
  DDVPSQ_NOSIGNAL = $00000001;
5547
  DDVPSQ_NOSIGNAL = $00000001;
5540
 
5548
 
5541
(*
5549
(*
5542
 * A valid video signal is present at the video port
5550
 * A valid video signal is present at the video port
5543
 *)
5551
 *)
5544
  DDVPSQ_SIGNALOK = $00000002;
5552
  DDVPSQ_SIGNALOK = $00000002;
5545
 
5553
 
5546
(****************************************************************************
5554
(****************************************************************************
5547
 *
5555
 *
5548
 * VIDEOPORTBANDWIDTH Flags
5556
 * VIDEOPORTBANDWIDTH Flags
5549
 *
5557
 *
5550
 ****************************************************************************)
5558
 ****************************************************************************)
5551
 
5559
 
5552
(*
5560
(*
5553
 * The specified height/width refer to the size of the video port data
5561
 * The specified height/width refer to the size of the video port data
5554
 * written into memory, after prescaling has occured.
5562
 * written into memory, after prescaling has occured.
5555
 *)
5563
 *)
5556
  DDVPB_VIDEOPORT = $00000001;
5564
  DDVPB_VIDEOPORT = $00000001;
5557
 
5565
 
5558
(*
5566
(*
5559
 * The specified height/width refer to the source size of the overlay.
5567
 * The specified height/width refer to the source size of the overlay.
5560
 *)
5568
 *)
5561
  DDVPB_OVERLAY = $00000002;
5569
  DDVPB_OVERLAY = $00000002;
5562
 
5570
 
5563
(*
5571
(*
5564
 * This is a query for the device to return which caps this device requires.
5572
 * This is a query for the device to return which caps this device requires.
5565
 *)
5573
 *)
5566
  DDVPB_TYPE = $00000004;
5574
  DDVPB_TYPE = $00000004;
5567
 
5575
 
5568
(****************************************************************************
5576
(****************************************************************************
5569
 *
5577
 *
5570
 * VIDEOPORTBANDWIDTH Caps
5578
 * VIDEOPORTBANDWIDTH Caps
5571
 *
5579
 *
5572
 ****************************************************************************)
5580
 ****************************************************************************)
5573
 
5581
 
5574
(*
5582
(*
5575
 * The bandwidth for this device is dependant on the overlay source size.
5583
 * The bandwidth for this device is dependant on the overlay source size.
5576
 *)
5584
 *)
5577
  DDVPBCAPS_SOURCE = $00000001;
5585
  DDVPBCAPS_SOURCE = $00000001;
5578
 
5586
 
5579
(*
5587
(*
5580
 * The bandwidth for this device is dependant on the overlay destination
5588
 * The bandwidth for this device is dependant on the overlay destination
5581
 * size.
5589
 * size.
5582
 *)
5590
 *)
5583
  DDVPBCAPS_DESTINATION = $00000002;
5591
  DDVPBCAPS_DESTINATION = $00000002;
5584
 
5592
 
5585
(****************************************************************************
5593
(****************************************************************************
5586
 *
5594
 *
5587
 * DDVIDEOPORTCONTAINER CreateVideoPort flags
5595
 * DDVIDEOPORTCONTAINER CreateVideoPort flags
5588
 *
5596
 *
5589
 ****************************************************************************)
5597
 ****************************************************************************)
5590
 
5598
 
5591
(*
5599
(*
5592
 * The process only wants to control the VBI portion of the video stream.
5600
 * The process only wants to control the VBI portion of the video stream.
5593
 *)
5601
 *)
5594
  DDVPCREATE_VBIONLY                    = $00000001;
5602
  DDVPCREATE_VBIONLY                    = $00000001;
5595
 
5603
 
5596
(*
5604
(*
5597
 * The process only wants to control the non-VBI (video) portion of
5605
 * The process only wants to control the non-VBI (video) portion of
5598
 * the video stream.
5606
 * the video stream.
5599
 *)
5607
 *)
5600
  DDVPCREATE_VIDEOONLY                  = $00000002;
5608
  DDVPCREATE_VIDEOONLY                  = $00000002;
5601
 
5609
 
5602
(****************************************************************************
5610
(****************************************************************************
5603
 *
5611
 *
5604
 * DDVIDEOPORTSTATUS flags
5612
 * DDVIDEOPORTSTATUS flags
5605
 *
5613
 *
5606
 ****************************************************************************)
5614
 ****************************************************************************)
5607
 
5615
 
5608
(*
5616
(*
5609
 * The video port interface is only controlling the VBI portion of the
5617
 * The video port interface is only controlling the VBI portion of the
5610
 * video stream
5618
 * video stream
5611
 *)
5619
 *)
5612
  DDVPSTATUS_VBIONLY                    = $00000001;
5620
  DDVPSTATUS_VBIONLY                    = $00000001;
5613
 
5621
 
5614
(*
5622
(*
5615
 * The video port interface is only controlling the video portion of the
5623
 * The video port interface is only controlling the video portion of the
5616
 * video stream
5624
 * video stream
5617
 *)
5625
 *)
5618
  DDVPSTATUS_VIDEOONLY                  = $00000002;
5626
  DDVPSTATUS_VIDEOONLY                  = $00000002;
5619
 
5627
 
5620
 
5628
 
5621
type
5629
type
5622
(*
5630
(*
5623
 * API's
5631
 * API's
5624
 *)
5632
 *)
5625
 
5633
 
5626
  TDDEnumVideoCallback = function (lpTDDVideoPortCaps: PDDVideoPortCaps;
5634
  TDDEnumVideoCallback = function (lpTDDVideoPortCaps: PDDVideoPortCaps;
5627
      lpContext: Pointer) : HResult; stdcall;
5635
      lpContext: Pointer) : HResult; stdcall;
5628
 
5636
 
5629
(*
5637
(*
5630
 * INTERACES FOLLOW:
5638
 * INTERACES FOLLOW:
5631
 *      IDirectDrawVideoPort
5639
 *      IDirectDrawVideoPort
5632
 *      IVideoPort
5640
 *      IVideoPort
5633
 *)
5641
 *)
5634
 
5642
 
5635
 
5643
 
5636
(*
5644
(*
5637
 * IDirectDrawVideoPort
5645
 * IDirectDrawVideoPort
5638
 *)
5646
 *)
5639
  IDirectDrawVideoPort = interface (IUnknown)
5647
  IDirectDrawVideoPort = interface (IUnknown)
5640
    ['{B36D93E0-2B43-11CF-A2DE-00AA00B93356}']
5648
    ['{B36D93E0-2B43-11CF-A2DE-00AA00B93356}']
5641
    (*** IDirectDrawVideoPort methods ***)
5649
    (*** IDirectDrawVideoPort methods ***)
5642
    function Flip(lpDDSurface: IDirectDrawSurface; dwFlags: DWORD) : HResult; stdcall;
5650
    function Flip(lpDDSurface: IDirectDrawSurface; dwFlags: DWORD) : HResult; stdcall;
5643
    function GetBandwidthInfo(var lpddpfFormat: TDDPixelFormat;
5651
    function GetBandwidthInfo(var lpddpfFormat: TDDPixelFormat;
5644
        dwWidth: DWORD; dwHeight: DWORD; dwFlags: DWORD;
5652
        dwWidth: DWORD; dwHeight: DWORD; dwFlags: DWORD;
5645
        var lpBandwidth: TDDVideoPortBandWidth) : HResult; stdcall;
5653
        var lpBandwidth: TDDVideoPortBandWidth) : HResult; stdcall;
5646
    function GetColorControls(var lpColorControl: TDDColorControl) : HResult; stdcall;
5654
    function GetColorControls(var lpColorControl: TDDColorControl) : HResult; stdcall;
5647
    function GetInputFormats(var lpNumFormats: DWORD; var lpFormats:
5655
    function GetInputFormats(var lpNumFormats: DWORD; var lpFormats:
5648
        TDDPixelFormat; dwFlags: DWORD) : HResult; stdcall;
5656
        TDDPixelFormat; dwFlags: DWORD) : HResult; stdcall;
5649
    function GetOutputFormats(var lpInputFormat: TDDPixelFormat;
5657
    function GetOutputFormats(var lpInputFormat: TDDPixelFormat;
5650
        var lpNumFormats: DWORD; lpFormats: PDDPixelFormat; dwFlags: DWORD)
5658
        var lpNumFormats: DWORD; lpFormats: PDDPixelFormat; dwFlags: DWORD)
5651
        : HResult; stdcall;
5659
        : HResult; stdcall;
5652
    function GetFieldPolarity(var lpbVideoField: BOOL) : HResult; stdcall;
5660
    function GetFieldPolarity(var lpbVideoField: BOOL) : HResult; stdcall;
5653
    function GetVideoLine(var lpdwLine: DWORD) : HResult; stdcall;
5661
    function GetVideoLine(var lpdwLine: DWORD) : HResult; stdcall;
5654
    function GetVideoSignalStatus(varlpdwStatus: DWORD) : HResult; stdcall;
5662
    function GetVideoSignalStatus(varlpdwStatus: DWORD) : HResult; stdcall;
5655
    function SetColorControls(var lpColorControl: TDDColorControl) : HResult; stdcall;
5663
    function SetColorControls(var lpColorControl: TDDColorControl) : HResult; stdcall;
5656
    function SetTargetSurface(lpDDSurface: IDirectDrawSurface; dwFlags: DWORD) :
5664
    function SetTargetSurface(lpDDSurface: IDirectDrawSurface; dwFlags: DWORD) :
5657
        HResult; stdcall;
5665
        HResult; stdcall;
5658
    function StartVideo(var lpVideoInfo: TDDVideoPortInfo) : HResult; stdcall;
5666
    function StartVideo(var lpVideoInfo: TDDVideoPortInfo) : HResult; stdcall;
5659
    function StopVideo: HResult; stdcall;
5667
    function StopVideo: HResult; stdcall;
5660
    function UpdateVideo(var lpVideoInfo: TDDVideoPortInfo) : HResult; stdcall;
5668
    function UpdateVideo(var lpVideoInfo: TDDVideoPortInfo) : HResult; stdcall;
5661
    function WaitForSync(dwFlags: DWORD; dwLine: DWORD; dwTimeout: DWORD) :
5669
    function WaitForSync(dwFlags: DWORD; dwLine: DWORD; dwTimeout: DWORD) :
5662
        HResult; stdcall;
5670
        HResult; stdcall;
5663
  end;
5671
  end;
5664
 
5672
 
5665
(*
5673
(*
5666
 * IDirectDrawVideoPortContainer
5674
 * IDirectDrawVideoPortContainer
5667
 *)
5675
 *)
5668
  IDDVideoPortContainer = interface (IUnknown)
5676
  IDDVideoPortContainer = interface (IUnknown)
5669
    ['{6C142760-A733-11CE-A521-0020AF0BE560}']
5677
    ['{6C142760-A733-11CE-A521-0020AF0BE560}']
5670
    (*** IDDVideoPortContainer methods ***)
5678
    (*** IDDVideoPortContainer methods ***)
5671
    function CreateVideoPort(dwFlags: DWORD; var lpTDDVideoPortDesc:
5679
    function CreateVideoPort(dwFlags: DWORD; var lpTDDVideoPortDesc:
5672
        TDDVideoPortDesc; var lplpDDVideoPort: IDirectDrawVideoPort;
5680
        TDDVideoPortDesc; var lplpDDVideoPort: IDirectDrawVideoPort;
5673
        pUnkOuter: IUnknown) : HResult; stdcall;
5681
        pUnkOuter: IUnknown) : HResult; stdcall;
5674
    function EnumVideoPorts(dwFlags: DWORD;
5682
    function EnumVideoPorts(dwFlags: DWORD;
5675
        lpTDDVideoPortCaps: PDDVideoPortCaps; lpContext: Pointer;
5683
        lpTDDVideoPortCaps: PDDVideoPortCaps; lpContext: Pointer;
5676
        lpEnumVideoCallback: TDDEnumVideoCallback) : HResult; stdcall;
5684
        lpEnumVideoCallback: TDDEnumVideoCallback) : HResult; stdcall;
5677
    function GetVideoPortConnectInfo(dwPortId: DWORD; var lpNumEntries: DWORD;
5685
    function GetVideoPortConnectInfo(dwPortId: DWORD; var lpNumEntries: DWORD;
5678
        lpConnectInfo: PDDVideoPortConnect) : HResult; stdcall;
5686
        lpConnectInfo: PDDVideoPortConnect) : HResult; stdcall;
5679
    function QueryVideoPortStatus(dwPortId: DWORD;
5687
    function QueryVideoPortStatus(dwPortId: DWORD;
5680
        var lpVPStatus: TDDVideoPortStatus) : HResult; stdcall;
5688
        var lpVPStatus: TDDVideoPortStatus) : HResult; stdcall;
5681
  end;
5689
  end;
5682
 
5690
 
5683
  IID_IDDVideoPortContainer = IDDVideoPortContainer;
5691
  IID_IDDVideoPortContainer = IDDVideoPortContainer;
5684
  IID_IDirectDrawVideoPort = IDirectDrawVideoPort;
5692
  IID_IDirectDrawVideoPort = IDirectDrawVideoPort;
5685
 
5693
 
5686
 
5694
 
5687
//Direct3D file
5695
//Direct3D file
5688
(*==========================================================================;
5696
(*==========================================================================;
5689
 *
5697
 *
5690
 *  Copyright (C) 1995-1998 Microsoft Corporation.  All Rights Reserved.
5698
 *  Copyright (C) 1995-1998 Microsoft Corporation.  All Rights Reserved.
5691
 *
5699
 *
5692
 *  Files:   d3dtypes.h d3dcaps.h d3d.h
5700
 *  Files:   d3dtypes.h d3dcaps.h d3d.h
5693
 *
5701
 *
5694
 *  DirectX 7.0 Delphi adaptation by Erik Unger
5702
 *  DirectX 7.0 Delphi adaptation by Erik Unger
5695
 *
5703
 *
5696
 *  Modyfied: 26-Jun-2000
5704
 *  Modyfied: 26-Jun-2000
5697
 *
5705
 *
5698
 *  Download: http://www.delphi-jedi.org/DelphiGraphics/
5706
 *  Download: http://www.delphi-jedi.org/DelphiGraphics/
5699
 *  E-Mail: DelphiDirectX@next-reality.com
5707
 *  E-Mail: DelphiDirectX@next-reality.com
5700
 *
5708
 *
5701
 ***************************************************************************)
5709
 ***************************************************************************)
5702
 
5710
 
5703
(* TD3DValue is the fundamental Direct3D fractional data type *)
5711
(* TD3DValue is the fundamental Direct3D fractional data type *)
5704
 
5712
 
5705
type
5713
type
5706
  TRefClsID = TGUID;
5714
  TRefClsID = TGUID;
5707
 
5715
 
5708
type
5716
type
5709
  TD3DValue = Single;
5717
  TD3DValue = Single;
5710
  TD3DFixed = LongInt;
5718
  TD3DFixed = LongInt;
5711
  float = TD3DValue;
5719
  float = TD3DValue;
5712
  PD3DColor = ^TD3DColor;
5720
  PD3DColor = ^TD3DColor;
5713
  TD3DColor = DWORD;
5721
  TD3DColor = DWORD;
5714
 
5722
 
5715
function D3DVal(val: variant) : float;
5723
function D3DVal(val: variant) : float;
5716
function D3DDivide(a,b: double) : float;
5724
function D3DDivide(a,b: double) : float;
5717
function D3DMultiply(a,b: double) : float;
5725
function D3DMultiply(a,b: double) : float;
5718
 
5726
 
5719
(*
5727
(*
5720
 * Format of CI colors is
5728
 * Format of CI colors is
5721
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
5729
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
5722
 *  |    alpha      |         color index           |   fraction    |
5730
 *  |    alpha      |         color index           |   fraction    |
5723
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
5731
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
5724
 *)
5732
 *)
5725
 
5733
 
5726
// #define CI_GETALPHA(ci)    ((ci) >> 24)
5734
// #define CI_GETALPHA(ci)    ((ci) >> 24)
5727
function CI_GETALPHA(ci: DWORD) : DWORD;
5735
function CI_GETALPHA(ci: DWORD) : DWORD;
5728
 
5736
 
5729
// #define CI_GETINDEX(ci)    (((ci) >> 8) & 0xffff)
5737
// #define CI_GETINDEX(ci)    (((ci) >> 8) & 0xffff)
5730
function CI_GETINDEX(ci: DWORD) : DWORD;
5738
function CI_GETINDEX(ci: DWORD) : DWORD;
5731
 
5739
 
5732
// #define CI_GETFRACTION(ci) ((ci) & 0xff)
5740
// #define CI_GETFRACTION(ci) ((ci) & 0xff)
5733
function CI_GETFRACTION(ci: DWORD) : DWORD;
5741
function CI_GETFRACTION(ci: DWORD) : DWORD;
5734
 
5742
 
5735
// #define CI_ROUNDINDEX(ci)  CI_GETINDEX((ci) + 0x80)
5743
// #define CI_ROUNDINDEX(ci)  CI_GETINDEX((ci) + 0x80)
5736
function CI_ROUNDINDEX(ci: DWORD) : DWORD;
5744
function CI_ROUNDINDEX(ci: DWORD) : DWORD;
5737
 
5745
 
5738
// #define CI_MASKALPHA(ci)   ((ci) & 0xffffff)
5746
// #define CI_MASKALPHA(ci)   ((ci) & 0xffffff)
5739
function CI_MASKALPHA(ci: DWORD) : DWORD;
5747
function CI_MASKALPHA(ci: DWORD) : DWORD;
5740
 
5748
 
5741
// #define CI_MAKE(a, i, f)    (((a) << 24) | ((i) << 8) | (f))
5749
// #define CI_MAKE(a, i, f)    (((a) << 24) | ((i) << 8) | (f))
5742
function CI_MAKE(a,i,f: DWORD) : DWORD;
5750
function CI_MAKE(a,i,f: DWORD) : DWORD;
5743
 
5751
 
5744
(*
5752
(*
5745
 * Format of RGBA colors is
5753
 * Format of RGBA colors is
5746
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
5754
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
5747
 *  |    alpha      |      red      |     green     |     blue      |
5755
 *  |    alpha      |      red      |     green     |     blue      |
5748
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
5756
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
5749
 *)
5757
 *)
5750
 
5758
 
5751
// #define RGBA_GETALPHA(rgb)      ((rgb) >> 24)
5759
// #define RGBA_GETALPHA(rgb)      ((rgb) >> 24)
5752
function RGBA_GETALPHA(rgb: TD3DColor) : DWORD;
5760
function RGBA_GETALPHA(rgb: TD3DColor) : DWORD;
5753
 
5761
 
5754
// #define RGBA_GETRED(rgb)        (((rgb) >> 16) & 0xff)
5762
// #define RGBA_GETRED(rgb)        (((rgb) >> 16) & 0xff)
5755
function RGBA_GETRED(rgb: TD3DColor) : DWORD;
5763
function RGBA_GETRED(rgb: TD3DColor) : DWORD;
5756
 
5764
 
5757
// #define RGBA_GETGREEN(rgb)      (((rgb) >> 8) & 0xff)
5765
// #define RGBA_GETGREEN(rgb)      (((rgb) >> 8) & 0xff)
5758
function RGBA_GETGREEN(rgb: TD3DColor) : DWORD;
5766
function RGBA_GETGREEN(rgb: TD3DColor) : DWORD;
5759
 
5767
 
5760
// #define RGBA_GETBLUE(rgb)       ((rgb) & 0xff)
5768
// #define RGBA_GETBLUE(rgb)       ((rgb) & 0xff)
5761
function RGBA_GETBLUE(rgb: TD3DColor) : DWORD;
5769
function RGBA_GETBLUE(rgb: TD3DColor) : DWORD;
5762
 
5770
 
5763
// #define RGBA_MAKE(r, g, b, a)   ((TD3DColor) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)))
5771
// #define RGBA_MAKE(r, g, b, a)   ((TD3DColor) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)))
5764
function RGBA_MAKE(r, g, b, a: DWORD) : TD3DColor;
5772
function RGBA_MAKE(r, g, b, a: DWORD) : TD3DColor;
5765
 
5773
 
5766
(* D3DRGB and D3DRGBA may be used as initialisers for D3DCOLORs
5774
(* D3DRGB and D3DRGBA may be used as initialisers for D3DCOLORs
5767
 * The float values must be in the range 0..1
5775
 * The float values must be in the range 0..1
5768
 *)
5776
 *)
5769
 
5777
 
5770
// #define D3DRGB(r, g, b) \
5778
// #define D3DRGB(r, g, b) \
5771
//     (0xff000000L | (((long)((r) * 255)) << 16) | (((long)((g) * 255)) << 8) | (long)((b) * 255))
5779
//     (0xff000000L | (((long)((r) * 255)) << 16) | (((long)((g) * 255)) << 8) | (long)((b) * 255))
5772
function D3DRGB(r, g, b: float) : TD3DColor;
5780
function D3DRGB(r, g, b: float) : TD3DColor;
5773
 
5781
 
5774
// #define D3DRGBA(r, g, b, a) \
5782
// #define D3DRGBA(r, g, b, a) \
5775
//     (  (((long)((a) * 255)) << 24) | (((long)((r) * 255)) << 16) \
5783
//     (  (((long)((a) * 255)) << 24) | (((long)((r) * 255)) << 16) \
5776
//     |   (((long)((g) * 255)) << 8) | (long)((b) * 255) \
5784
//     |   (((long)((g) * 255)) << 8) | (long)((b) * 255) \
5777
//    )
5785
//    )
5778
function D3DRGBA(r, g, b, a: float) : TD3DColor;
5786
function D3DRGBA(r, g, b, a: float) : TD3DColor;
5779
 
5787
 
5780
(*
5788
(*
5781
 * Format of RGB colors is
5789
 * Format of RGB colors is
5782
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
5790
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
5783
 *  |    ignored    |      red      |     green     |     blue      |
5791
 *  |    ignored    |      red      |     green     |     blue      |
5784
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
5792
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
5785
 *)
5793
 *)
5786
 
5794
 
5787
// #define RGB_GETRED(rgb)         (((rgb) >> 16) & 0xff)
5795
// #define RGB_GETRED(rgb)         (((rgb) >> 16) & 0xff)
5788
function RGB_GETRED(rgb: TD3DColor) : DWORD;
5796
function RGB_GETRED(rgb: TD3DColor) : DWORD;
5789
 
5797
 
5790
// #define RGB_GETGREEN(rgb)       (((rgb) >> 8) & 0xff)
5798
// #define RGB_GETGREEN(rgb)       (((rgb) >> 8) & 0xff)
5791
function RGB_GETGREEN(rgb: TD3DColor) : DWORD;
5799
function RGB_GETGREEN(rgb: TD3DColor) : DWORD;
5792
 
5800
 
5793
// #define RGB_GETBLUE(rgb)        ((rgb) & 0xff)
5801
// #define RGB_GETBLUE(rgb)        ((rgb) & 0xff)
5794
function RGB_GETBLUE(rgb: TD3DColor) : DWORD;
5802
function RGB_GETBLUE(rgb: TD3DColor) : DWORD;
5795
 
5803
 
5796
// #define RGBA_SETALPHA(rgba, x) (((x) << 24) | ((rgba) & 0x00ffffff))
5804
// #define RGBA_SETALPHA(rgba, x) (((x) << 24) | ((rgba) & 0x00ffffff))
5797
function RGBA_SETALPHA(rgba: TD3DColor; x: DWORD) : TD3DColor;
5805
function RGBA_SETALPHA(rgba: TD3DColor; x: DWORD) : TD3DColor;
5798
 
5806
 
5799
// #define RGB_MAKE(r, g, b)       ((TD3DColor) (((r) << 16) | ((g) << 8) | (b)))
5807
// #define RGB_MAKE(r, g, b)       ((TD3DColor) (((r) << 16) | ((g) << 8) | (b)))
5800
function RGB_MAKE(r, g, b: DWORD) : TD3DColor;
5808
function RGB_MAKE(r, g, b: DWORD) : TD3DColor;
5801
 
5809
 
5802
// #define RGBA_TORGB(rgba)       ((TD3DColor) ((rgba) & 0xffffff))
5810
// #define RGBA_TORGB(rgba)       ((TD3DColor) ((rgba) & 0xffffff))
5803
function RGBA_TORGB(rgba: TD3DColor) : TD3DColor;
5811
function RGBA_TORGB(rgba: TD3DColor) : TD3DColor;
5804
 
5812
 
5805
// #define RGB_TORGBA(rgb)        ((TD3DColor) ((rgb) | 0xff000000))
5813
// #define RGB_TORGBA(rgb)        ((TD3DColor) ((rgb) | 0xff000000))
5806
function RGB_TORGBA(rgb: TD3DColor) : TD3DColor;
5814
function RGB_TORGBA(rgb: TD3DColor) : TD3DColor;
5807
 
5815
 
5808
(*
5816
(*
5809
 * Flags for Enumerate functions
5817
 * Flags for Enumerate functions
5810
 *)
5818
 *)
5811
const
5819
const
5812
 
5820
 
5813
(*
5821
(*
5814
 * Stop the enumeration
5822
 * Stop the enumeration
5815
 *)
5823
 *)
5816
 
5824
 
5817
  D3DENUMRET_CANCEL                        = DDENUMRET_CANCEL;
5825
  D3DENUMRET_CANCEL                        = DDENUMRET_CANCEL;
5818
 
5826
 
5819
(*
5827
(*
5820
 * Continue the enumeration
5828
 * Continue the enumeration
5821
 *)
5829
 *)
5822
 
5830
 
5823
  D3DENUMRET_OK                            = DDENUMRET_OK;
5831
  D3DENUMRET_OK                            = DDENUMRET_OK;
5824
 
5832
 
5825
type
5833
type
5826
  TD3DValidateCallback = function (lpUserArg: Pointer;
5834
  TD3DValidateCallback = function (lpUserArg: Pointer;
5827
      dwOffset: DWORD): HResult; stdcall;
5835
      dwOffset: DWORD): HResult; stdcall;
5828
  TD3DEnumTextureFormatsCallback = function (var lpDdsd: TDDSurfaceDesc;
5836
  TD3DEnumTextureFormatsCallback = function (var lpDdsd: TDDSurfaceDesc;
5829
      lpContext: Pointer): HResult; stdcall;
5837
      lpContext: Pointer): HResult; stdcall;
5830
  TD3DEnumPixelFormatsCallback = function (var lpDDPixFmt: TDDPixelFormat;
5838
  TD3DEnumPixelFormatsCallback = function (var lpDDPixFmt: TDDPixelFormat;
5831
      lpContext: Pointer): HResult; stdcall;
5839
      lpContext: Pointer): HResult; stdcall;
5832
 
5840
 
5833
 
5841
 
5834
  PD3DMaterialHandle = ^TD3DMaterialHandle;
5842
  PD3DMaterialHandle = ^TD3DMaterialHandle;
5835
  TD3DMaterialHandle = DWORD;
5843
  TD3DMaterialHandle = DWORD;
5836
 
5844
 
5837
  PD3DTextureHandle = ^TD3DTextureHandle;
5845
  PD3DTextureHandle = ^TD3DTextureHandle;
5838
  TD3DTextureHandle = DWORD;
5846
  TD3DTextureHandle = DWORD;
5839
 
5847
 
5840
  PD3DMatrixHandle = ^TD3DMatrixHandle;
5848
  PD3DMatrixHandle = ^TD3DMatrixHandle;
5841
  TD3DMatrixHandle = DWORD;
5849
  TD3DMatrixHandle = DWORD;
5842
 
5850
 
5843
  PD3DColorValue = ^TD3DColorValue;
5851
  PD3DColorValue = ^TD3DColorValue;
5844
  TD3DColorValue = packed record
5852
  TD3DColorValue = packed record
5845
    case Integer of
5853
    case Integer of
5846
    0: (
5854
    0: (
5847
      r: TD3DValue;
5855
      r: TD3DValue;
5848
      g: TD3DValue;
5856
      g: TD3DValue;
5849
      b: TD3DValue;
5857
      b: TD3DValue;
5850
      a: TD3DValue;
5858
      a: TD3DValue;
5851
     );
5859
     );
5852
    1: (
5860
    1: (
5853
      dvR: TD3DValue;
5861
      dvR: TD3DValue;
5854
      dvG: TD3DValue;
5862
      dvG: TD3DValue;
5855
      dvB: TD3DValue;
5863
      dvB: TD3DValue;
5856
      dvA: TD3DValue;
5864
      dvA: TD3DValue;
5857
     );
5865
     );
5858
  end;
5866
  end;
5859
 
5867
 
5860
  PD3DRect = ^TD3DRect;
5868
  PD3DRect = ^TD3DRect;
5861
  TD3DRect = packed record
5869
  TD3DRect = packed record
5862
    case Integer of
5870
    case Integer of
5863
    0: (
5871
    0: (
5864
      x1: LongInt;
5872
      x1: LongInt;
5865
      y1: LongInt;
5873
      y1: LongInt;
5866
      x2: LongInt;
5874
      x2: LongInt;
5867
      y2: LongInt;
5875
      y2: LongInt;
5868
     );
5876
     );
5869
    1: (
5877
    1: (
5870
      lX1: LongInt;
5878
      lX1: LongInt;
5871
      lY1: LongInt;
5879
      lY1: LongInt;
5872
      lX2: LongInt;
5880
      lX2: LongInt;
5873
      lY2: LongInt;
5881
      lY2: LongInt;
5874
     );
5882
     );
5875
     2: (
5883
     2: (
5876
       a: array[0..3] of LongInt;
5884
       a: array[0..3] of LongInt;
5877
     );
5885
     );
5878
  end;
5886
  end;
5879
 
5887
 
5880
  PD3DVector = ^TD3DVector;
5888
  PD3DVector = ^TD3DVector;
5881
  TD3DVector = packed record
5889
  TD3DVector = packed record
5882
    case Integer of
5890
    case Integer of
5883
    0: (
5891
    0: (
5884
      x: TD3DValue;
5892
      x: TD3DValue;
5885
      y: TD3DValue;
5893
      y: TD3DValue;
5886
      z: TD3DValue;
5894
      z: TD3DValue;
5887
     );
5895
     );
5888
    1: (
5896
    1: (
5889
      dvX: TD3DValue;
5897
      dvX: TD3DValue;
5890
      dvY: TD3DValue;
5898
      dvY: TD3DValue;
5891
      dvZ: TD3DValue;
5899
      dvZ: TD3DValue;
5892
     );
5900
     );
5893
  end;
5901
  end;
5894
 
5902
 
5895
(******************************************************************
5903
(******************************************************************
5896
 *                                                                *
5904
 *                                                                *
5897
 *   D3DVec.inl                                                   *
5905
 *   D3DVec.inl                                                   *
5898
 *                                                                *
5906
 *                                                                *
5899
 *   Float-valued 3D vector class for Direct3D.                   *
5907
 *   Float-valued 3D vector class for Direct3D.                   *
5900
 *                                                                *
5908
 *                                                                *
5901
 *   Copyright (c) 1996-1998 Microsoft Corp. All rights reserved. *
5909
 *   Copyright (c) 1996-1998 Microsoft Corp. All rights reserved. *
5902
 *                                                                *
5910
 *                                                                *
5903
 ******************************************************************)
5911
 ******************************************************************)
5904
 
5912
 
5905
    // Addition and subtraction
5913
    // Addition and subtraction
5906
  function VectorAdd(const v1, v2: TD3DVector) : TD3DVector;
5914
  function VectorAdd(const v1, v2: TD3DVector) : TD3DVector;
5907
  function VectorSub(const v1, v2: TD3DVector) : TD3DVector;
5915
  function VectorSub(const v1, v2: TD3DVector) : TD3DVector;
5908
    // Scalar multiplication and division
5916
    // Scalar multiplication and division
5909
  function VectorMulS(const v: TD3DVector; s: TD3DValue) : TD3DVector;
5917
  function VectorMulS(const v: TD3DVector; s: TD3DValue) : TD3DVector;
5910
  function VectorDivS(const v: TD3DVector; s: TD3DValue) : TD3DVector;
5918
  function VectorDivS(const v: TD3DVector; s: TD3DValue) : TD3DVector;
5911
    // Memberwise multiplication and division
5919
    // Memberwise multiplication and division
5912
  function VectorMul(const v1, v2: TD3DVector) : TD3DVector;
5920
  function VectorMul(const v1, v2: TD3DVector) : TD3DVector;
5913
  function VectorDiv(const v1, v2: TD3DVector) : TD3DVector;
5921
  function VectorDiv(const v1, v2: TD3DVector) : TD3DVector;
5914
    // Vector dominance
5922
    // Vector dominance
5915
  function VectorSmaller(v1, v2: TD3DVector) : boolean;
5923
  function VectorSmaller(v1, v2: TD3DVector) : boolean;
5916
  function VectorSmallerEquel(v1, v2: TD3DVector) : boolean;
5924
  function VectorSmallerEquel(v1, v2: TD3DVector) : boolean;
5917
    // Bitwise equality
5925
    // Bitwise equality
5918
  function VectorEquel(v1, v2: TD3DVector) : boolean;
5926
  function VectorEquel(v1, v2: TD3DVector) : boolean;
5919
    // Length-related functions
5927
    // Length-related functions
5920
  function VectorSquareMagnitude(v: TD3DVector) : TD3DValue;
5928
  function VectorSquareMagnitude(v: TD3DVector) : TD3DValue;
5921
  function VectorMagnitude(v: TD3DVector) : TD3DValue;
5929
  function VectorMagnitude(v: TD3DVector) : TD3DValue;
5922
    // Returns vector with same direction and unit length
5930
    // Returns vector with same direction and unit length
5923
  function VectorNormalize(const v: TD3DVector) : TD3DVector;
5931
  function VectorNormalize(const v: TD3DVector) : TD3DVector;
5924
    // Return min/max component of the input vector
5932
    // Return min/max component of the input vector
5925
  function VectorMin(v: TD3DVector) : TD3DValue;
5933
  function VectorMin(v: TD3DVector) : TD3DValue;
5926
  function VectorMax(v: TD3DVector) : TD3DValue;
5934
  function VectorMax(v: TD3DVector) : TD3DValue;
5927
    // Return memberwise min/max of input vectors
5935
    // Return memberwise min/max of input vectors
5928
  function VectorMinimize(const v1, v2: TD3DVector) : TD3DVector;
5936
  function VectorMinimize(const v1, v2: TD3DVector) : TD3DVector;
5929
  function VectorMaximize(const v1, v2: TD3DVector) : TD3DVector;
5937
  function VectorMaximize(const v1, v2: TD3DVector) : TD3DVector;
5930
    // Dot and cross product
5938
    // Dot and cross product
5931
  function VectorDotProduct(v1, v2: TD3DVector) : TD3DValue;
5939
  function VectorDotProduct(v1, v2: TD3DVector) : TD3DValue;
5932
  function VectorCrossProduct(const v1, v2: TD3DVector) : TD3DVector;
5940
  function VectorCrossProduct(const v1, v2: TD3DVector) : TD3DVector;
5933
 
5941
 
5934
type
5942
type
5935
(*
5943
(*
5936
 * Vertex data types supported in an ExecuteBuffer.
5944
 * Vertex data types supported in an ExecuteBuffer.
5937
 *)
5945
 *)
5938
 
5946
 
5939
(*
5947
(*
5940
 * Homogeneous vertices
5948
 * Homogeneous vertices
5941
 *)
5949
 *)
5942
 
5950
 
5943
  PD3DHVertex = ^TD3DHVertex;
5951
  PD3DHVertex = ^TD3DHVertex;
5944
  TD3DHVertex = packed record
5952
  TD3DHVertex = packed record
5945
    dwFlags: DWORD;        (* Homogeneous clipping flags *)
5953
    dwFlags: DWORD;        (* Homogeneous clipping flags *)
5946
    case Integer of
5954
    case Integer of
5947
    0: (
5955
    0: (
5948
      hx: TD3DValue;
5956
      hx: TD3DValue;
5949
      hy: TD3DValue;
5957
      hy: TD3DValue;
5950
      hz: TD3DValue;
5958
      hz: TD3DValue;
5951
     );
5959
     );
5952
    1: (
5960
    1: (
5953
      dvHX: TD3DValue;
5961
      dvHX: TD3DValue;
5954
      dvHY: TD3DValue;
5962
      dvHY: TD3DValue;
5955
      dvHZ: TD3DValue;
5963
      dvHZ: TD3DValue;
5956
     );
5964
     );
5957
  end;
5965
  end;
5958
 
5966
 
5959
(*
5967
(*
5960
 * Transformed/lit vertices
5968
 * Transformed/lit vertices
5961
 *)
5969
 *)
5962
 
5970
 
5963
  PD3DTLVertex = ^TD3DTLVertex;
5971
  PD3DTLVertex = ^TD3DTLVertex;
5964
  TD3DTLVertex = packed record
5972
  TD3DTLVertex = packed record
5965
    case Integer of
5973
    case Integer of
5966
    0: (
5974
    0: (
5967
      sx: TD3DValue;             (* Screen coordinates *)
5975
      sx: TD3DValue;             (* Screen coordinates *)
5968
      sy: TD3DValue;
5976
      sy: TD3DValue;
5969
      sz: TD3DValue;
5977
      sz: TD3DValue;
5970
      rhw: TD3DValue;            (* Reciprocal of homogeneous w *)
5978
      rhw: TD3DValue;            (* Reciprocal of homogeneous w *)
5971
      color: TD3DColor;          (* Vertex color *)
5979
      color: TD3DColor;          (* Vertex color *)
5972
      specular: TD3DColor;       (* Specular component of vertex *)
5980
      specular: TD3DColor;       (* Specular component of vertex *)
5973
      tu: TD3DValue;             (* Texture coordinates *)
5981
      tu: TD3DValue;             (* Texture coordinates *)
5974
      tv: TD3DValue;
5982
      tv: TD3DValue;
5975
     );
5983
     );
5976
    1: (
5984
    1: (
5977
      dvSX: TD3DValue;
5985
      dvSX: TD3DValue;
5978
      dvSY: TD3DValue;
5986
      dvSY: TD3DValue;
5979
      dvSZ: TD3DValue;
5987
      dvSZ: TD3DValue;
5980
      dvRHW: TD3DValue;
5988
      dvRHW: TD3DValue;
5981
      dcColor: TD3DColor;
5989
      dcColor: TD3DColor;
5982
      dcSpecular: TD3DColor;
5990
      dcSpecular: TD3DColor;
5983
      dvTU: TD3DValue;
5991
      dvTU: TD3DValue;
5984
      dvTV: TD3DValue;
5992
      dvTV: TD3DValue;
5985
     );
5993
     );
5986
  end;
5994
  end;
5987
 
5995
 
5988
(*
5996
(*
5989
 * Untransformed/lit vertices
5997
 * Untransformed/lit vertices
5990
 *)
5998
 *)
5991
 
5999
 
5992
  PD3DLVertex = ^TD3DLVertex;
6000
  PD3DLVertex = ^TD3DLVertex;
5993
  TD3DLVertex = packed record
6001
  TD3DLVertex = packed record
5994
    case Integer of
6002
    case Integer of
5995
    0: (
6003
    0: (
5996
      x: TD3DValue;             (* Homogeneous coordinates *)
6004
      x: TD3DValue;             (* Homogeneous coordinates *)
5997
      y: TD3DValue;
6005
      y: TD3DValue;
5998
      z: TD3DValue;
6006
      z: TD3DValue;
5999
      dwReserved: DWORD;
6007
      dwReserved: DWORD;
6000
      color: TD3DColor;         (* Vertex color *)
6008
      color: TD3DColor;         (* Vertex color *)
6001
      specular: TD3DColor;      (* Specular component of vertex *)
6009
      specular: TD3DColor;      (* Specular component of vertex *)
6002
      tu: TD3DValue;            (* Texture coordinates *)
6010
      tu: TD3DValue;            (* Texture coordinates *)
6003
      tv: TD3DValue;
6011
      tv: TD3DValue;
6004
     );
6012
     );
6005
    1: (
6013
    1: (
6006
      dvX: TD3DValue;
6014
      dvX: TD3DValue;
6007
      dvY: TD3DValue;
6015
      dvY: TD3DValue;
6008
      dvZ: TD3DValue;
6016
      dvZ: TD3DValue;
6009
      UNIONFILLER1d: DWORD;
6017
      UNIONFILLER1d: DWORD;
6010
      dcColor: TD3DColor;
6018
      dcColor: TD3DColor;
6011
      dcSpecular: TD3DColor;
6019
      dcSpecular: TD3DColor;
6012
      dvTU: TD3DValue;
6020
      dvTU: TD3DValue;
6013
      dvTV: TD3DValue;
6021
      dvTV: TD3DValue;
6014
     );
6022
     );
6015
  end;
6023
  end;
6016
 
6024
 
6017
(*
6025
(*
6018
 * Untransformed/unlit vertices
6026
 * Untransformed/unlit vertices
6019
 *)
6027
 *)
6020
 
6028
 
6021
  PD3DVertex = ^TD3DVertex;
6029
  PD3DVertex = ^TD3DVertex;
6022
  TD3DVertex = packed record
6030
  TD3DVertex = packed record
6023
    case Integer of
6031
    case Integer of
6024
    0: (
6032
    0: (
6025
      x: TD3DValue;             (* Homogeneous coordinates *)
6033
      x: TD3DValue;             (* Homogeneous coordinates *)
6026
      y: TD3DValue;
6034
      y: TD3DValue;
6027
      z: TD3DValue;
6035
      z: TD3DValue;
6028
      nx: TD3DValue;            (* Normal *)
6036
      nx: TD3DValue;            (* Normal *)
6029
      ny: TD3DValue;
6037
      ny: TD3DValue;
6030
      nz: TD3DValue;
6038
      nz: TD3DValue;
6031
      tu: TD3DValue;            (* Texture coordinates *)
6039
      tu: TD3DValue;            (* Texture coordinates *)
6032
      tv: TD3DValue;
6040
      tv: TD3DValue;
6033
     );
6041
     );
6034
    1: (
6042
    1: (
6035
      dvX: TD3DValue;
6043
      dvX: TD3DValue;
6036
      dvY: TD3DValue;
6044
      dvY: TD3DValue;
6037
      dvZ: TD3DValue;
6045
      dvZ: TD3DValue;
6038
      dvNX: TD3DValue;
6046
      dvNX: TD3DValue;
6039
      dvNY: TD3DValue;
6047
      dvNY: TD3DValue;
6040
      dvNZ: TD3DValue;
6048
      dvNZ: TD3DValue;
6041
      dvTU: TD3DValue;
6049
      dvTU: TD3DValue;
6042
      dvTV: TD3DValue;
6050
      dvTV: TD3DValue;
6043
     );
6051
     );
6044
  end;
6052
  end;
6045
 
6053
 
6046
(*
6054
(*
6047
 * Matrix, viewport, and tranformation structures and definitions.
6055
 * Matrix, viewport, and tranformation structures and definitions.
6048
 *)
6056
 *)
6049
 
6057
 
6050
  PD3DMatrix = ^TD3DMatrix;
6058
  PD3DMatrix = ^TD3DMatrix;
6051
  TD3DMatrix = packed record
6059
  TD3DMatrix = packed record
6052
    case integer of
6060
    case integer of
6053
      0 : (_11, _12, _13, _14: TD3DValue;
6061
      0 : (_11, _12, _13, _14: TD3DValue;
6054
           _21, _22, _23, _24: TD3DValue;
6062
           _21, _22, _23, _24: TD3DValue;
6055
           _31, _32, _33, _34: TD3DValue;
6063
           _31, _32, _33, _34: TD3DValue;
6056
           _41, _42, _43, _44: TD3DValue);
6064
           _41, _42, _43, _44: TD3DValue);
6057
      1 : (m : array [0..3, 0..3] of TD3DValue);
6065
      1 : (m : array [0..3, 0..3] of TD3DValue);
6058
  end;
6066
  end;
6059
 
6067
 
6060
  PD3DViewport = ^TD3DViewport;
6068
  PD3DViewport = ^TD3DViewport;
6061
  TD3DViewport = packed record
6069
  TD3DViewport = packed record
6062
    dwSize: DWORD;
6070
    dwSize: DWORD;
6063
    dwX: DWORD;
6071
    dwX: DWORD;
6064
    dwY: DWORD;                (* Top left *)
6072
    dwY: DWORD;                (* Top left *)
6065
    dwWidth: DWORD;
6073
    dwWidth: DWORD;
6066
    dwHeight: DWORD;           (* Dimensions *)
6074
    dwHeight: DWORD;           (* Dimensions *)
6067
    dvScaleX: TD3DValue;       (* Scale homogeneous to screen *)
6075
    dvScaleX: TD3DValue;       (* Scale homogeneous to screen *)
6068
    dvScaleY: TD3DValue;       (* Scale homogeneous to screen *)
6076
    dvScaleY: TD3DValue;       (* Scale homogeneous to screen *)
6069
    dvMaxX: TD3DValue;         (* Min/max homogeneous x coord *)
6077
    dvMaxX: TD3DValue;         (* Min/max homogeneous x coord *)
6070
    dvMaxY: TD3DValue;         (* Min/max homogeneous y coord *)
6078
    dvMaxY: TD3DValue;         (* Min/max homogeneous y coord *)
6071
    dvMinZ: TD3DValue;
6079
    dvMinZ: TD3DValue;
6072
    dvMaxZ: TD3DValue;         (* Min/max homogeneous z coord *)
6080
    dvMaxZ: TD3DValue;         (* Min/max homogeneous z coord *)
6073
  end;
6081
  end;
6074
 
6082
 
6075
  PD3DViewport2 = ^TD3DViewport2;
6083
  PD3DViewport2 = ^TD3DViewport2;
6076
  TD3DViewport2 = packed record
6084
  TD3DViewport2 = packed record
6077
    dwSize: DWORD;
6085
    dwSize: DWORD;
6078
    dwX: DWORD;
6086
    dwX: DWORD;
6079
    dwY: DWORD;                (* Viewport Top left *)
6087
    dwY: DWORD;                (* Viewport Top left *)
6080
    dwWidth: DWORD;
6088
    dwWidth: DWORD;
6081
    dwHeight: DWORD;           (* Viewport Dimensions *)
6089
    dwHeight: DWORD;           (* Viewport Dimensions *)
6082
    dvClipX: TD3DValue;        (* Top left of clip volume *)
6090
    dvClipX: TD3DValue;        (* Top left of clip volume *)
6083
    dvClipY: TD3DValue;
6091
    dvClipY: TD3DValue;
6084
    dvClipWidth: TD3DValue;    (* Clip Volume Dimensions *)
6092
    dvClipWidth: TD3DValue;    (* Clip Volume Dimensions *)
6085
    dvClipHeight: TD3DValue;
6093
    dvClipHeight: TD3DValue;
6086
    dvMinZ: TD3DValue;         (* Min/max of clip Volume *)
6094
    dvMinZ: TD3DValue;         (* Min/max of clip Volume *)
6087
    dvMaxZ: TD3DValue;
6095
    dvMaxZ: TD3DValue;
6088
  end;
6096
  end;
6089
 
6097
 
6090
  PD3DViewport7 = ^TD3DViewport7;
6098
  PD3DViewport7 = ^TD3DViewport7;
6091
  TD3DViewport7 = packed record
6099
  TD3DViewport7 = packed record
6092
    dwX: DWORD;
6100
    dwX: DWORD;
6093
    dwY: DWORD;                (* Viewport Top left *)
6101
    dwY: DWORD;                (* Viewport Top left *)
6094
    dwWidth: DWORD;
6102
    dwWidth: DWORD;
6095
    dwHeight: DWORD;           (* Viewport Dimensions *)
6103
    dwHeight: DWORD;           (* Viewport Dimensions *)
6096
    dvMinZ: TD3DValue;         (* Min/max of clip Volume *)
6104
    dvMinZ: TD3DValue;         (* Min/max of clip Volume *)
6097
    dvMaxZ: TD3DValue;
6105
    dvMaxZ: TD3DValue;
6098
  end;
6106
  end;
6099
 
6107
 
6100
(*
6108
(*
6101
 * Values for clip fields.
6109
 * Values for clip fields.
6102
 *)
6110
 *)
6103
 
6111
 
6104
const
6112
const
6105
// Max number of user clipping planes, supported in D3D.
6113
// Max number of user clipping planes, supported in D3D.
6106
  D3DMAXUSERCLIPPLANES  = 32;
6114
  D3DMAXUSERCLIPPLANES  = 32;
6107
 
6115
 
6108
// These bits could be ORed together to use with D3DRENDERSTATE_CLIPPLANEENABLE
6116
// These bits could be ORed together to use with D3DRENDERSTATE_CLIPPLANEENABLE
6109
//
6117
//
6110
  D3DCLIPPLANE0 = (1 shl 0);
6118
  D3DCLIPPLANE0 = (1 shl 0);
6111
  D3DCLIPPLANE1 = (1 shl 1);
6119
  D3DCLIPPLANE1 = (1 shl 1);
6112
  D3DCLIPPLANE2 = (1 shl 2);
6120
  D3DCLIPPLANE2 = (1 shl 2);
6113
  D3DCLIPPLANE3 = (1 shl 3);
6121
  D3DCLIPPLANE3 = (1 shl 3);
6114
  D3DCLIPPLANE4 = (1 shl 4);
6122
  D3DCLIPPLANE4 = (1 shl 4);
6115
  D3DCLIPPLANE5 = (1 shl 5);
6123
  D3DCLIPPLANE5 = (1 shl 5);
6116
 
6124
 
6117
const
6125
const
6118
  D3DCLIP_LEFT                            = $00000001;
6126
  D3DCLIP_LEFT                            = $00000001;
6119
  D3DCLIP_RIGHT                           = $00000002;
6127
  D3DCLIP_RIGHT                           = $00000002;
6120
  D3DCLIP_TOP                             = $00000004;
6128
  D3DCLIP_TOP                             = $00000004;
6121
  D3DCLIP_BOTTOM                          = $00000008;
6129
  D3DCLIP_BOTTOM                          = $00000008;
6122
  D3DCLIP_FRONT                           = $00000010;
6130
  D3DCLIP_FRONT                           = $00000010;
6123
  D3DCLIP_BACK                            = $00000020;
6131
  D3DCLIP_BACK                            = $00000020;
6124
  D3DCLIP_GEN0                            = $00000040;
6132
  D3DCLIP_GEN0                            = $00000040;
6125
  D3DCLIP_GEN1                            = $00000080;
6133
  D3DCLIP_GEN1                            = $00000080;
6126
  D3DCLIP_GEN2                            = $00000100;
6134
  D3DCLIP_GEN2                            = $00000100;
6127
  D3DCLIP_GEN3                            = $00000200;
6135
  D3DCLIP_GEN3                            = $00000200;
6128
  D3DCLIP_GEN4                            = $00000400;
6136
  D3DCLIP_GEN4                            = $00000400;
6129
  D3DCLIP_GEN5                            = $00000800;
6137
  D3DCLIP_GEN5                            = $00000800;
6130
 
6138
 
6131
(*
6139
(*
6132
 * Values for d3d status.
6140
 * Values for d3d status.
6133
 *)
6141
 *)
6134
 
6142
 
6135
  D3DSTATUS_CLIPUNIONLEFT                 = D3DCLIP_LEFT;
6143
  D3DSTATUS_CLIPUNIONLEFT                 = D3DCLIP_LEFT;
6136
  D3DSTATUS_CLIPUNIONRIGHT                = D3DCLIP_RIGHT;
6144
  D3DSTATUS_CLIPUNIONRIGHT                = D3DCLIP_RIGHT;
6137
  D3DSTATUS_CLIPUNIONTOP                  = D3DCLIP_TOP;
6145
  D3DSTATUS_CLIPUNIONTOP                  = D3DCLIP_TOP;
6138
  D3DSTATUS_CLIPUNIONBOTTOM               = D3DCLIP_BOTTOM;
6146
  D3DSTATUS_CLIPUNIONBOTTOM               = D3DCLIP_BOTTOM;
6139
  D3DSTATUS_CLIPUNIONFRONT                = D3DCLIP_FRONT;
6147
  D3DSTATUS_CLIPUNIONFRONT                = D3DCLIP_FRONT;
6140
  D3DSTATUS_CLIPUNIONBACK                 = D3DCLIP_BACK;
6148
  D3DSTATUS_CLIPUNIONBACK                 = D3DCLIP_BACK;
6141
  D3DSTATUS_CLIPUNIONGEN0                 = D3DCLIP_GEN0;
6149
  D3DSTATUS_CLIPUNIONGEN0                 = D3DCLIP_GEN0;
6142
  D3DSTATUS_CLIPUNIONGEN1                 = D3DCLIP_GEN1;
6150
  D3DSTATUS_CLIPUNIONGEN1                 = D3DCLIP_GEN1;
6143
  D3DSTATUS_CLIPUNIONGEN2                 = D3DCLIP_GEN2;
6151
  D3DSTATUS_CLIPUNIONGEN2                 = D3DCLIP_GEN2;
6144
  D3DSTATUS_CLIPUNIONGEN3                 = D3DCLIP_GEN3;
6152
  D3DSTATUS_CLIPUNIONGEN3                 = D3DCLIP_GEN3;
6145
  D3DSTATUS_CLIPUNIONGEN4                 = D3DCLIP_GEN4;
6153
  D3DSTATUS_CLIPUNIONGEN4                 = D3DCLIP_GEN4;
6146
  D3DSTATUS_CLIPUNIONGEN5                 = D3DCLIP_GEN5;
6154
  D3DSTATUS_CLIPUNIONGEN5                 = D3DCLIP_GEN5;
6147
 
6155
 
6148
  D3DSTATUS_CLIPINTERSECTIONLEFT          = $00001000;
6156
  D3DSTATUS_CLIPINTERSECTIONLEFT          = $00001000;
6149
  D3DSTATUS_CLIPINTERSECTIONRIGHT         = $00002000;
6157
  D3DSTATUS_CLIPINTERSECTIONRIGHT         = $00002000;
6150
  D3DSTATUS_CLIPINTERSECTIONTOP           = $00004000;
6158
  D3DSTATUS_CLIPINTERSECTIONTOP           = $00004000;
6151
  D3DSTATUS_CLIPINTERSECTIONBOTTOM        = $00008000;
6159
  D3DSTATUS_CLIPINTERSECTIONBOTTOM        = $00008000;
6152
  D3DSTATUS_CLIPINTERSECTIONFRONT         = $00010000;
6160
  D3DSTATUS_CLIPINTERSECTIONFRONT         = $00010000;
6153
  D3DSTATUS_CLIPINTERSECTIONBACK          = $00020000;
6161
  D3DSTATUS_CLIPINTERSECTIONBACK          = $00020000;
6154
  D3DSTATUS_CLIPINTERSECTIONGEN0          = $00040000;
6162
  D3DSTATUS_CLIPINTERSECTIONGEN0          = $00040000;
6155
  D3DSTATUS_CLIPINTERSECTIONGEN1          = $00080000;
6163
  D3DSTATUS_CLIPINTERSECTIONGEN1          = $00080000;
6156
  D3DSTATUS_CLIPINTERSECTIONGEN2          = $00100000;
6164
  D3DSTATUS_CLIPINTERSECTIONGEN2          = $00100000;
6157
  D3DSTATUS_CLIPINTERSECTIONGEN3          = $00200000;
6165
  D3DSTATUS_CLIPINTERSECTIONGEN3          = $00200000;
6158
  D3DSTATUS_CLIPINTERSECTIONGEN4          = $00400000;
6166
  D3DSTATUS_CLIPINTERSECTIONGEN4          = $00400000;
6159
  D3DSTATUS_CLIPINTERSECTIONGEN5          = $00800000;
6167
  D3DSTATUS_CLIPINTERSECTIONGEN5          = $00800000;
6160
  D3DSTATUS_ZNOTVISIBLE                   = $01000000;
6168
  D3DSTATUS_ZNOTVISIBLE                   = $01000000;
6161
(* Do not use 0x80000000 for any status flags in future as it is reserved *)
6169
(* Do not use 0x80000000 for any status flags in future as it is reserved *)
6162
 
6170
 
6163
  D3DSTATUS_CLIPUNIONALL = (
6171
  D3DSTATUS_CLIPUNIONALL = (
6164
            D3DSTATUS_CLIPUNIONLEFT or
6172
            D3DSTATUS_CLIPUNIONLEFT or
6165
            D3DSTATUS_CLIPUNIONRIGHT or
6173
            D3DSTATUS_CLIPUNIONRIGHT or
6166
            D3DSTATUS_CLIPUNIONTOP or
6174
            D3DSTATUS_CLIPUNIONTOP or
6167
            D3DSTATUS_CLIPUNIONBOTTOM or
6175
            D3DSTATUS_CLIPUNIONBOTTOM or
6168
            D3DSTATUS_CLIPUNIONFRONT or
6176
            D3DSTATUS_CLIPUNIONFRONT or
6169
            D3DSTATUS_CLIPUNIONBACK or
6177
            D3DSTATUS_CLIPUNIONBACK or
6170
            D3DSTATUS_CLIPUNIONGEN0 or
6178
            D3DSTATUS_CLIPUNIONGEN0 or
6171
            D3DSTATUS_CLIPUNIONGEN1 or
6179
            D3DSTATUS_CLIPUNIONGEN1 or
6172
            D3DSTATUS_CLIPUNIONGEN2 or
6180
            D3DSTATUS_CLIPUNIONGEN2 or
6173
            D3DSTATUS_CLIPUNIONGEN3 or
6181
            D3DSTATUS_CLIPUNIONGEN3 or
6174
            D3DSTATUS_CLIPUNIONGEN4 or
6182
            D3DSTATUS_CLIPUNIONGEN4 or
6175
            D3DSTATUS_CLIPUNIONGEN5);
6183
            D3DSTATUS_CLIPUNIONGEN5);
6176
 
6184
 
6177
  D3DSTATUS_CLIPINTERSECTIONALL = (
6185
  D3DSTATUS_CLIPINTERSECTIONALL = (
6178
            D3DSTATUS_CLIPINTERSECTIONLEFT or
6186
            D3DSTATUS_CLIPINTERSECTIONLEFT or
6179
            D3DSTATUS_CLIPINTERSECTIONRIGHT or
6187
            D3DSTATUS_CLIPINTERSECTIONRIGHT or
6180
            D3DSTATUS_CLIPINTERSECTIONTOP or
6188
            D3DSTATUS_CLIPINTERSECTIONTOP or
6181
            D3DSTATUS_CLIPINTERSECTIONBOTTOM or
6189
            D3DSTATUS_CLIPINTERSECTIONBOTTOM or
6182
            D3DSTATUS_CLIPINTERSECTIONFRONT or
6190
            D3DSTATUS_CLIPINTERSECTIONFRONT or
6183
            D3DSTATUS_CLIPINTERSECTIONBACK or
6191
            D3DSTATUS_CLIPINTERSECTIONBACK or
6184
            D3DSTATUS_CLIPINTERSECTIONGEN0 or
6192
            D3DSTATUS_CLIPINTERSECTIONGEN0 or
6185
            D3DSTATUS_CLIPINTERSECTIONGEN1 or
6193
            D3DSTATUS_CLIPINTERSECTIONGEN1 or
6186
            D3DSTATUS_CLIPINTERSECTIONGEN2 or
6194
            D3DSTATUS_CLIPINTERSECTIONGEN2 or
6187
            D3DSTATUS_CLIPINTERSECTIONGEN3 or
6195
            D3DSTATUS_CLIPINTERSECTIONGEN3 or
6188
            D3DSTATUS_CLIPINTERSECTIONGEN4 or
6196
            D3DSTATUS_CLIPINTERSECTIONGEN4 or
6189
            D3DSTATUS_CLIPINTERSECTIONGEN5);
6197
            D3DSTATUS_CLIPINTERSECTIONGEN5);
6190
 
6198
 
6191
  D3DSTATUS_DEFAULT = (
6199
  D3DSTATUS_DEFAULT = (
6192
            D3DSTATUS_CLIPINTERSECTIONALL or
6200
            D3DSTATUS_CLIPINTERSECTIONALL or
6193
            D3DSTATUS_ZNOTVISIBLE);
6201
            D3DSTATUS_ZNOTVISIBLE);
6194
 
6202
 
6195
(*
6203
(*
6196
 * Options for direct transform calls
6204
 * Options for direct transform calls
6197
 *)
6205
 *)
6198
 
6206
 
6199
  D3DTRANSFORM_CLIPPED       = $00000001;
6207
  D3DTRANSFORM_CLIPPED       = $00000001;
6200
  D3DTRANSFORM_UNCLIPPED     = $00000002;
6208
  D3DTRANSFORM_UNCLIPPED     = $00000002;
6201
 
6209
 
6202
type
6210
type
6203
  PD3DTransformData = ^TD3DTransformData;
6211
  PD3DTransformData = ^TD3DTransformData;
6204
  TD3DTransformData = packed record
6212
  TD3DTransformData = packed record
6205
    dwSize: DWORD;
6213
    dwSize: DWORD;
6206
    lpIn: Pointer;             (* Input vertices *)
6214
    lpIn: Pointer;             (* Input vertices *)
6207
    dwInSize: DWORD;           (* Stride of input vertices *)
6215
    dwInSize: DWORD;           (* Stride of input vertices *)
6208
    lpOut: Pointer;            (* Output vertices *)
6216
    lpOut: Pointer;            (* Output vertices *)
6209
    dwOutSize: DWORD;          (* Stride of output vertices *)
6217
    dwOutSize: DWORD;          (* Stride of output vertices *)
6210
    lpHOut: ^TD3DHVertex;       (* Output homogeneous vertices *)
6218
    lpHOut: ^TD3DHVertex;       (* Output homogeneous vertices *)
6211
    dwClip: DWORD;             (* Clipping hint *)
6219
    dwClip: DWORD;             (* Clipping hint *)
6212
    dwClipIntersection: DWORD;
6220
    dwClipIntersection: DWORD;
6213
    dwClipUnion: DWORD;        (* Union of all clip flags *)
6221
    dwClipUnion: DWORD;        (* Union of all clip flags *)
6214
    drExtent: TD3DRect;         (* Extent of transformed vertices *)
6222
    drExtent: TD3DRect;         (* Extent of transformed vertices *)
6215
  end;
6223
  end;
6216
 
6224
 
6217
(*
6225
(*
6218
 * Structure defining position and direction properties for lighting.
6226
 * Structure defining position and direction properties for lighting.
6219
 *)
6227
 *)
6220
 
6228
 
6221
  PD3DLightingElement = ^TD3DLightingElement;
6229
  PD3DLightingElement = ^TD3DLightingElement;
6222
  TD3DLightingElement = packed record
6230
  TD3DLightingElement = packed record
6223
    dvPosition: TD3DVector;           (* Lightable point in model space *)
6231
    dvPosition: TD3DVector;           (* Lightable point in model space *)
6224
    dvNormal: TD3DVector;             (* Normalised unit vector *)
6232
    dvNormal: TD3DVector;             (* Normalised unit vector *)
6225
  end;
6233
  end;
6226
 
6234
 
6227
(*
6235
(*
6228
 * Structure defining material properties for lighting.
6236
 * Structure defining material properties for lighting.
6229
 *)
6237
 *)
6230
 
6238
 
6231
  PD3DMaterial = ^TD3DMaterial;
6239
  PD3DMaterial = ^TD3DMaterial;
6232
  TD3DMaterial = packed record
6240
  TD3DMaterial = packed record
6233
    dwSize: DWORD;
6241
    dwSize: DWORD;
6234
    case Integer of
6242
    case Integer of
6235
    0: (
6243
    0: (
6236
      diffuse: TD3DColorValue;        (* Diffuse color RGBA *)
6244
      diffuse: TD3DColorValue;        (* Diffuse color RGBA *)
6237
      ambient: TD3DColorValue;        (* Ambient color RGB *)
6245
      ambient: TD3DColorValue;        (* Ambient color RGB *)
6238
      specular: TD3DColorValue;       (* Specular 'shininess' *)
6246
      specular: TD3DColorValue;       (* Specular 'shininess' *)
6239
      emissive: TD3DColorValue;       (* Emissive color RGB *)
6247
      emissive: TD3DColorValue;       (* Emissive color RGB *)
6240
      power: TD3DValue;               (* Sharpness if specular highlight *)
6248
      power: TD3DValue;               (* Sharpness if specular highlight *)
6241
      hTexture: TD3DTextureHandle;    (* Handle to texture map *)
6249
      hTexture: TD3DTextureHandle;    (* Handle to texture map *)
6242
      dwRampSize: DWORD;
6250
      dwRampSize: DWORD;
6243
     );
6251
     );
6244
    1: (
6252
    1: (
6245
      dcvDiffuse: TD3DColorValue;
6253
      dcvDiffuse: TD3DColorValue;
6246
      dcvAmbient: TD3DColorValue;
6254
      dcvAmbient: TD3DColorValue;
6247
      dcvSpecular: TD3DColorValue;
6255
      dcvSpecular: TD3DColorValue;
6248
      dcvEmissive: TD3DColorValue;
6256
      dcvEmissive: TD3DColorValue;
6249
      dvPower: TD3DValue;
6257
      dvPower: TD3DValue;
6250
     );
6258
     );
6251
  end;
6259
  end;
6252
 
6260
 
6253
  PD3DMaterial7 = ^TD3DMaterial7;
6261
  PD3DMaterial7 = ^TD3DMaterial7;
6254
  TD3DMaterial7 = packed record
6262
  TD3DMaterial7 = packed record
6255
    case Integer of
6263
    case Integer of
6256
    0: (
6264
    0: (
6257
      diffuse: TD3DColorValue;        (* Diffuse color RGBA *)
6265
      diffuse: TD3DColorValue;        (* Diffuse color RGBA *)
6258
      ambient: TD3DColorValue;        (* Ambient color RGB *)
6266
      ambient: TD3DColorValue;        (* Ambient color RGB *)
6259
      specular: TD3DColorValue;       (* Specular 'shininess' *)
6267
      specular: TD3DColorValue;       (* Specular 'shininess' *)
6260
      emissive: TD3DColorValue;       (* Emissive color RGB *)
6268
      emissive: TD3DColorValue;       (* Emissive color RGB *)
6261
      power: TD3DValue;               (* Sharpness if specular highlight *)
6269
      power: TD3DValue;               (* Sharpness if specular highlight *)
6262
     );
6270
     );
6263
    1: (
6271
    1: (
6264
      dcvDiffuse: TD3DColorValue;
6272
      dcvDiffuse: TD3DColorValue;
6265
      dcvAmbient: TD3DColorValue;
6273
      dcvAmbient: TD3DColorValue;
6266
      dcvSpecular: TD3DColorValue;
6274
      dcvSpecular: TD3DColorValue;
6267
      dcvEmissive: TD3DColorValue;
6275
      dcvEmissive: TD3DColorValue;
6268
      dvPower: TD3DValue;
6276
      dvPower: TD3DValue;
6269
     );
6277
     );
6270
  end;
6278
  end;
6271
 
6279
 
6272
  PD3DLightType = ^TD3DLightType;
6280
  PD3DLightType = ^TD3DLightType;
6273
  TD3DLightType = (
6281
  TD3DLightType = (
6274
    D3DLIGHT_INVALID_0,
6282
    D3DLIGHT_INVALID_0,
6275
    D3DLIGHT_POINT,
6283
    D3DLIGHT_POINT,
6276
    D3DLIGHT_SPOT,
6284
    D3DLIGHT_SPOT,
6277
    D3DLIGHT_DIRECTIONAL,
6285
    D3DLIGHT_DIRECTIONAL,
6278
// Note: The following light type (D3DLIGHT_PARALLELPOINT)
6286
// Note: The following light type (D3DLIGHT_PARALLELPOINT)
6279
// is no longer supported from D3D for DX7 onwards.
6287
// is no longer supported from D3D for DX7 onwards.
6280
    D3DLIGHT_PARALLELPOINT,
6288
    D3DLIGHT_PARALLELPOINT,
6281
    D3DLIGHT_GLSPOT);
6289
    D3DLIGHT_GLSPOT);
6282
 
6290
 
6283
(*
6291
(*
6284
 * Structure defining a light source and its properties.
6292
 * Structure defining a light source and its properties.
6285
 *)
6293
 *)
6286
 
6294
 
6287
  PD3DLight = ^TD3DLight;
6295
  PD3DLight = ^TD3DLight;
6288
  TD3DLight = packed record
6296
  TD3DLight = packed record
6289
    dwSize: DWORD;
6297
    dwSize: DWORD;
6290
    dltType: TD3DLightType;     (* Type of light source *)
6298
    dltType: TD3DLightType;     (* Type of light source *)
6291
    dcvColor: TD3DColorValue;   (* Color of light *)
6299
    dcvColor: TD3DColorValue;   (* Color of light *)
6292
    dvPosition: TD3DVector;     (* Position in world space *)
6300
    dvPosition: TD3DVector;     (* Position in world space *)
6293
    dvDirection: TD3DVector;    (* Direction in world space *)
6301
    dvDirection: TD3DVector;    (* Direction in world space *)
6294
    dvRange: TD3DValue;         (* Cutoff range *)
6302
    dvRange: TD3DValue;         (* Cutoff range *)
6295
    dvFalloff: TD3DValue;       (* Falloff *)
6303
    dvFalloff: TD3DValue;       (* Falloff *)
6296
    dvAttenuation0: TD3DValue;  (* Constant attenuation *)
6304
    dvAttenuation0: TD3DValue;  (* Constant attenuation *)
6297
    dvAttenuation1: TD3DValue;  (* Linear attenuation *)
6305
    dvAttenuation1: TD3DValue;  (* Linear attenuation *)
6298
    dvAttenuation2: TD3DValue;  (* Quadratic attenuation *)
6306
    dvAttenuation2: TD3DValue;  (* Quadratic attenuation *)
6299
    dvTheta: TD3DValue;         (* Inner angle of spotlight cone *)
6307
    dvTheta: TD3DValue;         (* Inner angle of spotlight cone *)
6300
    dvPhi: TD3DValue;           (* Outer angle of spotlight cone *)
6308
    dvPhi: TD3DValue;           (* Outer angle of spotlight cone *)
6301
  end;
6309
  end;
6302
 
6310
 
6303
  PD3DLight7 = ^TD3DLight7;
6311
  PD3DLight7 = ^TD3DLight7;
6304
  TD3DLight7 = packed record
6312
  TD3DLight7 = packed record
6305
    dltType: TD3DLightType;     (* Type of light source *)
6313
    dltType: TD3DLightType;     (* Type of light source *)
6306
    dcvDiffuse: TD3DColorValue; (* Diffuse color of light *)
6314
    dcvDiffuse: TD3DColorValue; (* Diffuse color of light *)
6307
    dcvSpecular: TD3DColorValue;(* Specular color of light *)
6315
    dcvSpecular: TD3DColorValue;(* Specular color of light *)
6308
    dcvAmbient: TD3DColorValue; (* Ambient color of light *)
6316
    dcvAmbient: TD3DColorValue; (* Ambient color of light *)
6309
    dvPosition: TD3DVector;     (* Position in world space *)
6317
    dvPosition: TD3DVector;     (* Position in world space *)
6310
    dvDirection: TD3DVector;    (* Direction in world space *)
6318
    dvDirection: TD3DVector;    (* Direction in world space *)
6311
    dvRange: TD3DValue;         (* Cutoff range *)
6319
    dvRange: TD3DValue;         (* Cutoff range *)
6312
    dvFalloff: TD3DValue;       (* Falloff *)
6320
    dvFalloff: TD3DValue;       (* Falloff *)
6313
    dvAttenuation0: TD3DValue;  (* Constant attenuation *)
6321
    dvAttenuation0: TD3DValue;  (* Constant attenuation *)
6314
    dvAttenuation1: TD3DValue;  (* Linear attenuation *)
6322
    dvAttenuation1: TD3DValue;  (* Linear attenuation *)
6315
    dvAttenuation2: TD3DValue;  (* Quadratic attenuation *)
6323
    dvAttenuation2: TD3DValue;  (* Quadratic attenuation *)
6316
    dvTheta: TD3DValue;         (* Inner angle of spotlight cone *)
6324
    dvTheta: TD3DValue;         (* Inner angle of spotlight cone *)
6317
    dvPhi: TD3DValue;           (* Outer angle of spotlight cone *)
6325
    dvPhi: TD3DValue;           (* Outer angle of spotlight cone *)
6318
  end;
6326
  end;
6319
 
6327
 
6320
(*
6328
(*
6321
 * Structure defining a light source and its properties.
6329
 * Structure defining a light source and its properties.
6322
 *)
6330
 *)
6323
 
6331
 
6324
(* flags bits *)
6332
(* flags bits *)
6325
const
6333
const
6326
  D3DLIGHT_ACTIVE                       = $00000001;
6334
  D3DLIGHT_ACTIVE                       = $00000001;
6327
  D3DLIGHT_NO_SPECULAR  = $00000002;
6335
  D3DLIGHT_NO_SPECULAR  = $00000002;
6328
  D3DLIGHT_ALL = D3DLIGHT_ACTIVE or D3DLIGHT_ACTIVE;
6336
  D3DLIGHT_ALL = D3DLIGHT_ACTIVE or D3DLIGHT_ACTIVE;
6329
 
6337
 
6330
(* maximum valid light range *)
6338
(* maximum valid light range *)
6331
  D3DLIGHT_RANGE_MAX            = 1.8439088915e+18; //sqrt(FLT_MAX);
6339
  D3DLIGHT_RANGE_MAX            = 1.8439088915e+18; //sqrt(FLT_MAX);
6332
 
6340
 
6333
type
6341
type
6334
  PD3DLight2 = ^TD3DLight2;
6342
  PD3DLight2 = ^TD3DLight2;
6335
  TD3DLight2 = packed record
6343
  TD3DLight2 = packed record
6336
    dwSize: DWORD;
6344
    dwSize: DWORD;
6337
    dltType: TD3DLightType;     (* Type of light source *)
6345
    dltType: TD3DLightType;     (* Type of light source *)
6338
    dcvColor: TD3DColorValue;   (* Color of light *)
6346
    dcvColor: TD3DColorValue;   (* Color of light *)
6339
    dvPosition: TD3DVector;     (* Position in world space *)
6347
    dvPosition: TD3DVector;     (* Position in world space *)
6340
    dvDirection: TD3DVector;    (* Direction in world space *)
6348
    dvDirection: TD3DVector;    (* Direction in world space *)
6341
    dvRange: TD3DValue;         (* Cutoff range *)
6349
    dvRange: TD3DValue;         (* Cutoff range *)
6342
    dvFalloff: TD3DValue;       (* Falloff *)
6350
    dvFalloff: TD3DValue;       (* Falloff *)
6343
    dvAttenuation0: TD3DValue;  (* Constant attenuation *)
6351
    dvAttenuation0: TD3DValue;  (* Constant attenuation *)
6344
    dvAttenuation1: TD3DValue;  (* Linear attenuation *)
6352
    dvAttenuation1: TD3DValue;  (* Linear attenuation *)
6345
    dvAttenuation2: TD3DValue;  (* Quadratic attenuation *)
6353
    dvAttenuation2: TD3DValue;  (* Quadratic attenuation *)
6346
    dvTheta: TD3DValue;         (* Inner angle of spotlight cone *)
6354
    dvTheta: TD3DValue;         (* Inner angle of spotlight cone *)
6347
    dvPhi: TD3DValue;           (* Outer angle of spotlight cone *)
6355
    dvPhi: TD3DValue;           (* Outer angle of spotlight cone *)
6348
    dwFlags: DWORD;
6356
    dwFlags: DWORD;
6349
  end;
6357
  end;
6350
 
6358
 
6351
  PD3DLightData = ^TD3DLightData;
6359
  PD3DLightData = ^TD3DLightData;
6352
  TD3DLightData = packed record
6360
  TD3DLightData = packed record
6353
    dwSize: DWORD;
6361
    dwSize: DWORD;
6354
    lpIn: ^TD3DLightingElement;   (* Input positions and normals *)
6362
    lpIn: ^TD3DLightingElement;   (* Input positions and normals *)
6355
    dwInSize: DWORD;             (* Stride of input elements *)
6363
    dwInSize: DWORD;             (* Stride of input elements *)
6356
    lpOut: ^TD3DTLVertex;         (* Output colors *)
6364
    lpOut: ^TD3DTLVertex;         (* Output colors *)
6357
    dwOutSize: DWORD;            (* Stride of output colors *)
6365
    dwOutSize: DWORD;            (* Stride of output colors *)
6358
  end;
6366
  end;
6359
 
6367
 
6360
(*
6368
(*
6361
 * Before DX5, these values were in an enum called
6369
 * Before DX5, these values were in an enum called
6362
 * TD3DColorModel. This was not correct, since they are
6370
 * TD3DColorModel. This was not correct, since they are
6363
 * bit flags. A driver can surface either or both flags
6371
 * bit flags. A driver can surface either or both flags
6364
 * in the dcmColorModel member of D3DDEVICEDESC.
6372
 * in the dcmColorModel member of D3DDEVICEDESC.
6365
 *)
6373
 *)
6366
 
6374
 
6367
type
6375
type
6368
  TD3DColorModel = DWORD;
6376
  TD3DColorModel = DWORD;
6369
 
6377
 
6370
const
6378
const
6371
  D3DCOLOR_MONO = 1;
6379
  D3DCOLOR_MONO = 1;
6372
  D3DCOLOR_RGB  = 2;
6380
  D3DCOLOR_RGB  = 2;
6373
 
6381
 
6374
(*
6382
(*
6375
 * Options for clearing
6383
 * Options for clearing
6376
 *)
6384
 *)
6377
 
6385
 
6378
const
6386
const
6379
  D3DCLEAR_TARGET            = $00000001; (* Clear target surface *)
6387
  D3DCLEAR_TARGET            = $00000001; (* Clear target surface *)
6380
  D3DCLEAR_ZBUFFER           = $00000002; (* Clear target z buffer *)
6388
  D3DCLEAR_ZBUFFER           = $00000002; (* Clear target z buffer *)
6381
  D3DCLEAR_STENCIL           = $00000004; (* Clear stencil planes *)
6389
  D3DCLEAR_STENCIL           = $00000004; (* Clear stencil planes *)
6382
 
6390
 
6383
(*
6391
(*
6384
 * Execute buffers are allocated via Direct3D.  These buffers may then
6392
 * Execute buffers are allocated via Direct3D.  These buffers may then
6385
 * be filled by the application with instructions to execute along with
6393
 * be filled by the application with instructions to execute along with
6386
 * vertex data.
6394
 * vertex data.
6387
 *)
6395
 *)
6388
 
6396
 
6389
(*
6397
(*
6390
 * Supported op codes for execute instructions.
6398
 * Supported op codes for execute instructions.
6391
 *)
6399
 *)
6392
 
6400
 
6393
type
6401
type
6394
  PD3DOpcode = ^TD3DOpcode;
6402
  PD3DOpcode = ^TD3DOpcode;
6395
  TD3DOpcode = (
6403
  TD3DOpcode = (
6396
    D3DOP_INVALID_0,
6404
    D3DOP_INVALID_0,
6397
    D3DOP_POINT,
6405
    D3DOP_POINT,
6398
    D3DOP_LINE,
6406
    D3DOP_LINE,
6399
    D3DOP_TRIANGLE,
6407
    D3DOP_TRIANGLE,
6400
    D3DOP_MATRIXLOAD,
6408
    D3DOP_MATRIXLOAD,
6401
    D3DOP_MATRIXMULTIPLY,
6409
    D3DOP_MATRIXMULTIPLY,
6402
    D3DOP_STATETRANSFORM,
6410
    D3DOP_STATETRANSFORM,
6403
    D3DOP_STATELIGHT,
6411
    D3DOP_STATELIGHT,
6404
    D3DOP_STATERENDER,
6412
    D3DOP_STATERENDER,
6405
    D3DOP_PROCESSVERTICES,
6413
    D3DOP_PROCESSVERTICES,
6406
    D3DOP_TEXTURELOAD,
6414
    D3DOP_TEXTURELOAD,
6407
    D3DOP_EXIT,
6415
    D3DOP_EXIT,
6408
    D3DOP_BRANCHFORWARD,
6416
    D3DOP_BRANCHFORWARD,
6409
    D3DOP_SPAN,
6417
    D3DOP_SPAN,
6410
    D3DOP_SETSTATUS);
6418
    D3DOP_SETSTATUS);
6411
 
6419
 
6412
  PD3DInstruction = ^TD3DInstruction;
6420
  PD3DInstruction = ^TD3DInstruction;
6413
  TD3DInstruction = packed record
6421
  TD3DInstruction = packed record
6414
    bOpcode: BYTE;   (* Instruction opcode *)
6422
    bOpcode: BYTE;   (* Instruction opcode *)
6415
    bSize: BYTE;     (* Size of each instruction data unit *)
6423
    bSize: BYTE;     (* Size of each instruction data unit *)
6416
    wCount: WORD;    (* Count of instruction data units to follow *)
6424
    wCount: WORD;    (* Count of instruction data units to follow *)
6417
  end;
6425
  end;
6418
 
6426
 
6419
(*
6427
(*
6420
 * Structure for texture loads
6428
 * Structure for texture loads
6421
 *)
6429
 *)
6422
 
6430
 
6423
  PD3DTextureLoad = ^TD3DTextureLoad;
6431
  PD3DTextureLoad = ^TD3DTextureLoad;
6424
  TD3DTextureLoad = packed record
6432
  TD3DTextureLoad = packed record
6425
    hDestTexture: TD3DTextureHandle;
6433
    hDestTexture: TD3DTextureHandle;
6426
    hSrcTexture: TD3DTextureHandle;
6434
    hSrcTexture: TD3DTextureHandle;
6427
  end;
6435
  end;
6428
 
6436
 
6429
(*
6437
(*
6430
 * Structure for picking
6438
 * Structure for picking
6431
 *)
6439
 *)
6432
 
6440
 
6433
  PD3DPickRecord = ^TD3DPickRecord;
6441
  PD3DPickRecord = ^TD3DPickRecord;
6434
  TD3DPickRecord = packed record
6442
  TD3DPickRecord = packed record
6435
    bOpcode: BYTE;
6443
    bOpcode: BYTE;
6436
    bPad: BYTE;
6444
    bPad: BYTE;
6437
    dwOffset: DWORD;
6445
    dwOffset: DWORD;
6438
    dvZ: TD3DValue;
6446
    dvZ: TD3DValue;
6439
  end;
6447
  end;
6440
 
6448
 
6441
(*
6449
(*
6442
 * The following defines the rendering states which can be set in the
6450
 * The following defines the rendering states which can be set in the
6443
 * execute buffer.
6451
 * execute buffer.
6444
 *)
6452
 *)
6445
 
6453
 
6446
  PD3DShadeMode = ^TD3DShadeMode;
6454
  PD3DShadeMode = ^TD3DShadeMode;
6447
  TD3DShadeMode = (
6455
  TD3DShadeMode = (
6448
    D3DSHADE_INVALID_0,
6456
    D3DSHADE_INVALID_0,
6449
    D3DSHADE_FLAT,
6457
    D3DSHADE_FLAT,
6450
    D3DSHADE_GOURAUD,
6458
    D3DSHADE_GOURAUD,
6451
    D3DSHADE_PHONG);
6459
    D3DSHADE_PHONG);
6452
 
6460
 
6453
  PD3DFillMode = ^TD3DFillMode;
6461
  PD3DFillMode = ^TD3DFillMode;
6454
  TD3DFillMode = (
6462
  TD3DFillMode = (
6455
    D3DFILL_INVALID_0,
6463
    D3DFILL_INVALID_0,
6456
    D3DFILL_POINT,
6464
    D3DFILL_POINT,
6457
    D3DFILL_WIREFRAME,
6465
    D3DFILL_WIREFRAME,
6458
    D3DFILL_SOLID);
6466
    D3DFILL_SOLID);
6459
 
6467
 
6460
  PD3DLinePattern = ^TD3DLinePattern;
6468
  PD3DLinePattern = ^TD3DLinePattern;
6461
  TD3DLinePattern = packed record
6469
  TD3DLinePattern = packed record
6462
    wRepeatFactor: WORD;
6470
    wRepeatFactor: WORD;
6463
    wLinePattern: WORD;
6471
    wLinePattern: WORD;
6464
  end;
6472
  end;
6465
 
6473
 
6466
  PD3DTextureFilter = ^TD3DTextureFilter;
6474
  PD3DTextureFilter = ^TD3DTextureFilter;
6467
  TD3DTextureFilter = (
6475
  TD3DTextureFilter = (
6468
    D3DFILTER_INVALID_0,
6476
    D3DFILTER_INVALID_0,
6469
    D3DFILTER_NEAREST,
6477
    D3DFILTER_NEAREST,
6470
    D3DFILTER_LINEAR,
6478
    D3DFILTER_LINEAR,
6471
    D3DFILTER_MIPNEAREST,
6479
    D3DFILTER_MIPNEAREST,
6472
    D3DFILTER_MIPLINEAR,
6480
    D3DFILTER_MIPLINEAR,
6473
    D3DFILTER_LINEARMIPNEAREST,
6481
    D3DFILTER_LINEARMIPNEAREST,
6474
    D3DFILTER_LINEARMIPLINEAR);
6482
    D3DFILTER_LINEARMIPLINEAR);
6475
 
6483
 
6476
  PD3DBlend = ^TD3DBlend;
6484
  PD3DBlend = ^TD3DBlend;
6477
  TD3DBlend = (
6485
  TD3DBlend = (
6478
    D3DBLEND_INVALID_0,
6486
    D3DBLEND_INVALID_0,
6479
    D3DBLEND_ZERO,
6487
    D3DBLEND_ZERO,
6480
    D3DBLEND_ONE,
6488
    D3DBLEND_ONE,
6481
    D3DBLEND_SRCCOLOR,
6489
    D3DBLEND_SRCCOLOR,
6482
    D3DBLEND_INVSRCCOLOR,
6490
    D3DBLEND_INVSRCCOLOR,
6483
    D3DBLEND_SRCALPHA,
6491
    D3DBLEND_SRCALPHA,
6484
    D3DBLEND_INVSRCALPHA,
6492
    D3DBLEND_INVSRCALPHA,
6485
    D3DBLEND_DESTALPHA,
6493
    D3DBLEND_DESTALPHA,
6486
    D3DBLEND_INVDESTALPHA,
6494
    D3DBLEND_INVDESTALPHA,
6487
    D3DBLEND_DESTCOLOR,
6495
    D3DBLEND_DESTCOLOR,
6488
    D3DBLEND_INVDESTCOLOR,
6496
    D3DBLEND_INVDESTCOLOR,
6489
    D3DBLEND_SRCALPHASAT,
6497
    D3DBLEND_SRCALPHASAT,
6490
    D3DBLEND_BOTHSRCALPHA,
6498
    D3DBLEND_BOTHSRCALPHA,
6491
    D3DBLEND_BOTHINVSRCALPHA);
6499
    D3DBLEND_BOTHINVSRCALPHA);
6492
 
6500
 
6493
  PD3DTextureBlend = ^TD3DTextureBlend;
6501
  PD3DTextureBlend = ^TD3DTextureBlend;
6494
  TD3DTextureBlend = (
6502
  TD3DTextureBlend = (
6495
    D3DTBLEND_INVALID_0,
6503
    D3DTBLEND_INVALID_0,
6496
    D3DTBLEND_DECAL,
6504
    D3DTBLEND_DECAL,
6497
    D3DTBLEND_MODULATE,
6505
    D3DTBLEND_MODULATE,
6498
    D3DTBLEND_DECALALPHA,
6506
    D3DTBLEND_DECALALPHA,
6499
    D3DTBLEND_MODULATEALPHA,
6507
    D3DTBLEND_MODULATEALPHA,
6500
    D3DTBLEND_DECALMASK,
6508
    D3DTBLEND_DECALMASK,
6501
    D3DTBLEND_MODULATEMASK,
6509
    D3DTBLEND_MODULATEMASK,
6502
    D3DTBLEND_COPY,
6510
    D3DTBLEND_COPY,
6503
    D3DTBLEND_ADD);
6511
    D3DTBLEND_ADD);
6504
 
6512
 
6505
  PD3DTextureAddress = ^TD3DTextureAddress;
6513
  PD3DTextureAddress = ^TD3DTextureAddress;
6506
  TD3DTextureAddress = (
6514
  TD3DTextureAddress = (
6507
    D3DTADDRESS_INVALID_0,
6515
    D3DTADDRESS_INVALID_0,
6508
    D3DTADDRESS_WRAP,
6516
    D3DTADDRESS_WRAP,
6509
    D3DTADDRESS_MIRROR,
6517
    D3DTADDRESS_MIRROR,
6510
    D3DTADDRESS_CLAMP,
6518
    D3DTADDRESS_CLAMP,
6511
    D3DTADDRESS_BORDER);
6519
    D3DTADDRESS_BORDER);
6512
 
6520
 
6513
  PD3DCull = ^TD3DCull;
6521
  PD3DCull = ^TD3DCull;
6514
  TD3DCull = (
6522
  TD3DCull = (
6515
    D3DCULL_INVALID_0,
6523
    D3DCULL_INVALID_0,
6516
    D3DCULL_NONE,
6524
    D3DCULL_NONE,
6517
    D3DCULL_CW,
6525
    D3DCULL_CW,
6518
    D3DCULL_CCW);
6526
    D3DCULL_CCW);
6519
 
6527
 
6520
  PD3DCmpFunc = ^TD3DCmpFunc;
6528
  PD3DCmpFunc = ^TD3DCmpFunc;
6521
  TD3DCmpFunc = (
6529
  TD3DCmpFunc = (
6522
    D3DCMP_INVALID_0,
6530
    D3DCMP_INVALID_0,
6523
    D3DCMP_NEVER,
6531
    D3DCMP_NEVER,
6524
    D3DCMP_LESS,
6532
    D3DCMP_LESS,
6525
    D3DCMP_EQUAL,
6533
    D3DCMP_EQUAL,
6526
    D3DCMP_LESSEQUAL,
6534
    D3DCMP_LESSEQUAL,
6527
    D3DCMP_GREATER,
6535
    D3DCMP_GREATER,
6528
    D3DCMP_NOTEQUAL,
6536
    D3DCMP_NOTEQUAL,
6529
    D3DCMP_GREATEREQUAL,
6537
    D3DCMP_GREATEREQUAL,
6530
    D3DCMP_ALWAYS);
6538
    D3DCMP_ALWAYS);
6531
 
6539
 
6532
  PD3DStencilOp = ^TD3DStencilOp;
6540
  PD3DStencilOp = ^TD3DStencilOp;
6533
  TD3DStencilOp = (
6541
  TD3DStencilOp = (
6534
    D3DSTENCILOP_INVALID_0,
6542
    D3DSTENCILOP_INVALID_0,
6535
    D3DSTENCILOP_KEEP,
6543
    D3DSTENCILOP_KEEP,
6536
    D3DSTENCILOP_ZERO,
6544
    D3DSTENCILOP_ZERO,
6537
    D3DSTENCILOP_REPLACE,
6545
    D3DSTENCILOP_REPLACE,
6538
    D3DSTENCILOP_INCRSAT,
6546
    D3DSTENCILOP_INCRSAT,
6539
    D3DSTENCILOP_DECRSAT,
6547
    D3DSTENCILOP_DECRSAT,
6540
    D3DSTENCILOP_INVERT,
6548
    D3DSTENCILOP_INVERT,
6541
    D3DSTENCILOP_INCR,
6549
    D3DSTENCILOP_INCR,
6542
    D3DSTENCILOP_DECR);
6550
    D3DSTENCILOP_DECR);
6543
   
6551
   
6544
  PD3DFogMode = ^TD3DFogMode;
6552
  PD3DFogMode = ^TD3DFogMode;
6545
  TD3DFogMode = (
6553
  TD3DFogMode = (
6546
    D3DFOG_NONE,
6554
    D3DFOG_NONE,
6547
    D3DFOG_EXP,
6555
    D3DFOG_EXP,
6548
    D3DFOG_EXP2,
6556
    D3DFOG_EXP2,
6549
    D3DFOG_LINEAR);
6557
    D3DFOG_LINEAR);
6550
 
6558
 
6551
  PD3DZBufferType = ^TD3DZBufferType;
6559
  PD3DZBufferType = ^TD3DZBufferType;
6552
  TD3DZBufferType = (
6560
  TD3DZBufferType = (
6553
    D3DZB_FALSE,
6561
    D3DZB_FALSE,
6554
    D3DZB_TRUE,   // Z buffering
6562
    D3DZB_TRUE,   // Z buffering
6555
    D3DZB_USEW);  // W buffering
6563
    D3DZB_USEW);  // W buffering
6556
 
6564
 
6557
  PD3DAntialiasMode = ^TD3DAntialiasMode;
6565
  PD3DAntialiasMode = ^TD3DAntialiasMode;
6558
  TD3DAntialiasMode = (
6566
  TD3DAntialiasMode = (
6559
    D3DANTIALIAS_NONE,
6567
    D3DANTIALIAS_NONE,
6560
    D3DANTIALIAS_SORTDEPENDENT,
6568
    D3DANTIALIAS_SORTDEPENDENT,
6561
    D3DANTIALIAS_SORTINDEPENDENT);
6569
    D3DANTIALIAS_SORTINDEPENDENT);
6562
 
6570
 
6563
// Vertex types supported by Direct3D
6571
// Vertex types supported by Direct3D
6564
  PD3DVertexType = ^TD3DVertexType;
6572
  PD3DVertexType = ^TD3DVertexType;
6565
  TD3DVertexType = (
6573
  TD3DVertexType = (
6566
    D3DVT_INVALID_0,
6574
    D3DVT_INVALID_0,
6567
    D3DVT_VERTEX,
6575
    D3DVT_VERTEX,
6568
    D3DVT_LVERTEX,
6576
    D3DVT_LVERTEX,
6569
    D3DVT_TLVERTEX);
6577
    D3DVT_TLVERTEX);
6570
 
6578
 
6571
// Primitives supported by draw-primitive API
6579
// Primitives supported by draw-primitive API
6572
  PD3DPrimitiveType = ^TD3DPrimitiveType;
6580
  PD3DPrimitiveType = ^TD3DPrimitiveType;
6573
  TD3DPrimitiveType = (
6581
  TD3DPrimitiveType = (
6574
    D3DPT_INVALID_0,
6582
    D3DPT_INVALID_0,
6575
    D3DPT_POINTLIST,
6583
    D3DPT_POINTLIST,
6576
    D3DPT_LINELIST,
6584
    D3DPT_LINELIST,
6577
    D3DPT_LINESTRIP,
6585
    D3DPT_LINESTRIP,
6578
    D3DPT_TRIANGLELIST,
6586
    D3DPT_TRIANGLELIST,
6579
    D3DPT_TRIANGLESTRIP,
6587
    D3DPT_TRIANGLESTRIP,
6580
    D3DPT_TRIANGLEFAN);
6588
    D3DPT_TRIANGLEFAN);
6581
 
6589
 
6582
(*
6590
(*
6583
 * Amount to add to a state to generate the override for that state.
6591
 * Amount to add to a state to generate the override for that state.
6584
 *)
6592
 *)
6585
 
6593
 
6586
const
6594
const
6587
  D3DSTATE_OVERRIDE_BIAS          = 256;
6595
  D3DSTATE_OVERRIDE_BIAS          = 256;
6588
 
6596
 
6589
(*
6597
(*
6590
 * A state which sets the override flag for the specified state type.
6598
 * A state which sets the override flag for the specified state type.
6591
 *)
6599
 *)
6592
 
6600
 
6593
function D3DSTATE_OVERRIDE(StateType: DWORD) : DWORD;
6601
function D3DSTATE_OVERRIDE(StateType: DWORD) : DWORD;
6594
 
6602
 
6595
type
6603
type
6596
  PD3DTransformStateType = ^TD3DTransformStateType;
6604
  PD3DTransformStateType = ^TD3DTransformStateType;
6597
  TD3DTransformStateType = DWORD;
6605
  TD3DTransformStateType = DWORD;
6598
const
6606
const
6599
  D3DTRANSFORMSTATE_WORLD         = 1;
6607
  D3DTRANSFORMSTATE_WORLD         = 1;
6600
  D3DTRANSFORMSTATE_VIEW          = 2;
6608
  D3DTRANSFORMSTATE_VIEW          = 2;
6601
  D3DTRANSFORMSTATE_PROJECTION    = 3;
6609
  D3DTRANSFORMSTATE_PROJECTION    = 3;
6602
  D3DTRANSFORMSTATE_WORLD1        = 4;  // 2nd matrix to blend
6610
  D3DTRANSFORMSTATE_WORLD1        = 4;  // 2nd matrix to blend
6603
  D3DTRANSFORMSTATE_WORLD2        = 5;  // 3rd matrix to blend
6611
  D3DTRANSFORMSTATE_WORLD2        = 5;  // 3rd matrix to blend
6604
  D3DTRANSFORMSTATE_WORLD3        = 6;  // 4th matrix to blend
6612
  D3DTRANSFORMSTATE_WORLD3        = 6;  // 4th matrix to blend
6605
  D3DTRANSFORMSTATE_TEXTURE0      = 16;
6613
  D3DTRANSFORMSTATE_TEXTURE0      = 16;
6606
  D3DTRANSFORMSTATE_TEXTURE1      = 17;
6614
  D3DTRANSFORMSTATE_TEXTURE1      = 17;
6607
  D3DTRANSFORMSTATE_TEXTURE2      = 18;
6615
  D3DTRANSFORMSTATE_TEXTURE2      = 18;
6608
  D3DTRANSFORMSTATE_TEXTURE3      = 19;
6616
  D3DTRANSFORMSTATE_TEXTURE3      = 19;
6609
  D3DTRANSFORMSTATE_TEXTURE4      = 20;
6617
  D3DTRANSFORMSTATE_TEXTURE4      = 20;
6610
  D3DTRANSFORMSTATE_TEXTURE5      = 21;
6618
  D3DTRANSFORMSTATE_TEXTURE5      = 21;
6611
  D3DTRANSFORMSTATE_TEXTURE6      = 22;
6619
  D3DTRANSFORMSTATE_TEXTURE6      = 22;
6612
  D3DTRANSFORMSTATE_TEXTURE7      = 23;
6620
  D3DTRANSFORMSTATE_TEXTURE7      = 23;
6613
 
6621
 
6614
type
6622
type
6615
  PD3DLightStateType = ^TD3DLightStateType;
6623
  PD3DLightStateType = ^TD3DLightStateType;
6616
  TD3DLightStateType = (
6624
  TD3DLightStateType = (
6617
    D3DLIGHTSTATE_INVALID_0,
6625
    D3DLIGHTSTATE_INVALID_0,
6618
    D3DLIGHTSTATE_MATERIAL,
6626
    D3DLIGHTSTATE_MATERIAL,
6619
    D3DLIGHTSTATE_AMBIENT,
6627
    D3DLIGHTSTATE_AMBIENT,
6620
    D3DLIGHTSTATE_COLORMODEL,
6628
    D3DLIGHTSTATE_COLORMODEL,
6621
    D3DLIGHTSTATE_FOGMODE,
6629
    D3DLIGHTSTATE_FOGMODE,
6622
    D3DLIGHTSTATE_FOGSTART,
6630
    D3DLIGHTSTATE_FOGSTART,
6623
    D3DLIGHTSTATE_FOGEND,
6631
    D3DLIGHTSTATE_FOGEND,
6624
    D3DLIGHTSTATE_FOGDENSITY,
6632
    D3DLIGHTSTATE_FOGDENSITY,
6625
    D3DLIGHTSTATE_COLORVERTEX);
6633
    D3DLIGHTSTATE_COLORVERTEX);
6626
 
6634
 
6627
  PD3DRenderStateType = ^TD3DRenderStateType;
6635
  PD3DRenderStateType = ^TD3DRenderStateType;
6628
  TD3DRenderStateType = DWORD;
6636
  TD3DRenderStateType = DWORD;
6629
const
6637
const
6630
    D3DRENDERSTATE_ANTIALIAS          = 2;    (* D3DANTIALIASMODE *)
6638
    D3DRENDERSTATE_ANTIALIAS          = 2;    (* D3DANTIALIASMODE *)
6631
    D3DRENDERSTATE_TEXTUREPERSPECTIVE = 4;    (* TRUE for perspective correction *)
6639
    D3DRENDERSTATE_TEXTUREPERSPECTIVE = 4;    (* TRUE for perspective correction *)
6632
    D3DRENDERSTATE_ZENABLE            = 7;    (* D3DZBUFFERTYPE (or TRUE/FALSE for legacy) *)
6640
    D3DRENDERSTATE_ZENABLE            = 7;    (* D3DZBUFFERTYPE (or TRUE/FALSE for legacy) *)
6633
    D3DRENDERSTATE_FILLMODE           = 8;    (* D3DFILL_MODE        *)
6641
    D3DRENDERSTATE_FILLMODE           = 8;    (* D3DFILL_MODE        *)
6634
    D3DRENDERSTATE_SHADEMODE          = 9;    (* D3DSHADEMODE *)
6642
    D3DRENDERSTATE_SHADEMODE          = 9;    (* D3DSHADEMODE *)
6635
    D3DRENDERSTATE_LINEPATTERN        = 10;   (* D3DLINEPATTERN *)
6643
    D3DRENDERSTATE_LINEPATTERN        = 10;   (* D3DLINEPATTERN *)
6636
    D3DRENDERSTATE_ZWRITEENABLE       = 14;   (* TRUE to enable z writes *)
6644
    D3DRENDERSTATE_ZWRITEENABLE       = 14;   (* TRUE to enable z writes *)
6637
    D3DRENDERSTATE_ALPHATESTENABLE    = 15;   (* TRUE to enable alpha tests *)
6645
    D3DRENDERSTATE_ALPHATESTENABLE    = 15;   (* TRUE to enable alpha tests *)
6638
    D3DRENDERSTATE_LASTPIXEL          = 16;   (* TRUE for last-pixel on lines *)
6646
    D3DRENDERSTATE_LASTPIXEL          = 16;   (* TRUE for last-pixel on lines *)
6639
    D3DRENDERSTATE_SRCBLEND           = 19;   (* D3DBLEND *)
6647
    D3DRENDERSTATE_SRCBLEND           = 19;   (* D3DBLEND *)
6640
    D3DRENDERSTATE_DESTBLEND          = 20;   (* D3DBLEND *)
6648
    D3DRENDERSTATE_DESTBLEND          = 20;   (* D3DBLEND *)
6641
    D3DRENDERSTATE_CULLMODE           = 22;   (* D3DCULL *)
6649
    D3DRENDERSTATE_CULLMODE           = 22;   (* D3DCULL *)
6642
    D3DRENDERSTATE_ZFUNC              = 23;   (* D3DCMPFUNC *)
6650
    D3DRENDERSTATE_ZFUNC              = 23;   (* D3DCMPFUNC *)
6643
    D3DRENDERSTATE_ALPHAREF           = 24;   (* D3DFIXED *)
6651
    D3DRENDERSTATE_ALPHAREF           = 24;   (* D3DFIXED *)
6644
    D3DRENDERSTATE_ALPHAFUNC          = 25;   (* D3DCMPFUNC *)
6652
    D3DRENDERSTATE_ALPHAFUNC          = 25;   (* D3DCMPFUNC *)
6645
    D3DRENDERSTATE_DITHERENABLE       = 26;   (* TRUE to enable dithering *)
6653
    D3DRENDERSTATE_DITHERENABLE       = 26;   (* TRUE to enable dithering *)
6646
    D3DRENDERSTATE_ALPHABLENDENABLE   = 27;   (* TRUE to enable alpha blending *)
6654
    D3DRENDERSTATE_ALPHABLENDENABLE   = 27;   (* TRUE to enable alpha blending *)
6647
    D3DRENDERSTATE_FOGENABLE          = 28;   (* TRUE to enable fog blending *)
6655
    D3DRENDERSTATE_FOGENABLE          = 28;   (* TRUE to enable fog blending *)
6648
    D3DRENDERSTATE_SPECULARENABLE     = 29;   (* TRUE to enable specular *)
6656
    D3DRENDERSTATE_SPECULARENABLE     = 29;   (* TRUE to enable specular *)
6649
    D3DRENDERSTATE_ZVISIBLE           = 30;   (* TRUE to enable z checking *)
6657
    D3DRENDERSTATE_ZVISIBLE           = 30;   (* TRUE to enable z checking *)
6650
    D3DRENDERSTATE_STIPPLEDALPHA      = 33;   (* TRUE to enable stippled alpha (RGB device only) *)
6658
    D3DRENDERSTATE_STIPPLEDALPHA      = 33;   (* TRUE to enable stippled alpha (RGB device only) *)
6651
    D3DRENDERSTATE_FOGCOLOR           = 34;   (* D3DCOLOR *)
6659
    D3DRENDERSTATE_FOGCOLOR           = 34;   (* D3DCOLOR *)
6652
    D3DRENDERSTATE_FOGTABLEMODE       = 35;   (* D3DFOGMODE *)
6660
    D3DRENDERSTATE_FOGTABLEMODE       = 35;   (* D3DFOGMODE *)
6653
    D3DRENDERSTATE_FOGSTART           = 36;   (* Fog start (for both vertex and pixel fog) *)
6661
    D3DRENDERSTATE_FOGSTART           = 36;   (* Fog start (for both vertex and pixel fog) *)
6654
    D3DRENDERSTATE_FOGEND             = 37;   (* Fog end      *)
6662
    D3DRENDERSTATE_FOGEND             = 37;   (* Fog end      *)
6655
    D3DRENDERSTATE_FOGDENSITY         = 38;   (* Fog density  *)
6663
    D3DRENDERSTATE_FOGDENSITY         = 38;   (* Fog density  *)
6656
    D3DRENDERSTATE_EDGEANTIALIAS      = 40;   (* TRUE to enable edge antialiasing *)
6664
    D3DRENDERSTATE_EDGEANTIALIAS      = 40;   (* TRUE to enable edge antialiasing *)
6657
    D3DRENDERSTATE_COLORKEYENABLE     = 41;   (* TRUE to enable source colorkeyed textures *)
6665
    D3DRENDERSTATE_COLORKEYENABLE     = 41;   (* TRUE to enable source colorkeyed textures *)
6658
    D3DRENDERSTATE_ZBIAS              = 47;   (* LONG Z bias *)
6666
    D3DRENDERSTATE_ZBIAS              = 47;   (* LONG Z bias *)
6659
    D3DRENDERSTATE_RANGEFOGENABLE     = 48;   (* Enables range-based fog *)
6667
    D3DRENDERSTATE_RANGEFOGENABLE     = 48;   (* Enables range-based fog *)
6660
 
6668
 
6661
    D3DRENDERSTATE_STENCILENABLE      = 52;   (* BOOL enable/disable stenciling *)
6669
    D3DRENDERSTATE_STENCILENABLE      = 52;   (* BOOL enable/disable stenciling *)
6662
    D3DRENDERSTATE_STENCILFAIL        = 53;   (* D3DSTENCILOP to do if stencil test fails *)
6670
    D3DRENDERSTATE_STENCILFAIL        = 53;   (* D3DSTENCILOP to do if stencil test fails *)
6663
    D3DRENDERSTATE_STENCILZFAIL       = 54;   (* D3DSTENCILOP to do if stencil test passes and Z test fails *)
6671
    D3DRENDERSTATE_STENCILZFAIL       = 54;   (* D3DSTENCILOP to do if stencil test passes and Z test fails *)
6664
    D3DRENDERSTATE_STENCILPASS        = 55;   (* D3DSTENCILOP to do if both stencil and Z tests pass *)
6672
    D3DRENDERSTATE_STENCILPASS        = 55;   (* D3DSTENCILOP to do if both stencil and Z tests pass *)
6665
    D3DRENDERSTATE_STENCILFUNC        = 56;   (* D3DCMPFUNC fn.  Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true *)
6673
    D3DRENDERSTATE_STENCILFUNC        = 56;   (* D3DCMPFUNC fn.  Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true *)
6666
    D3DRENDERSTATE_STENCILREF         = 57;   (* Reference value used in stencil test *)
6674
    D3DRENDERSTATE_STENCILREF         = 57;   (* Reference value used in stencil test *)
6667
    D3DRENDERSTATE_STENCILMASK        = 58;   (* Mask value used in stencil test *)
6675
    D3DRENDERSTATE_STENCILMASK        = 58;   (* Mask value used in stencil test *)
6668
    D3DRENDERSTATE_STENCILWRITEMASK   = 59;   (* Write mask applied to values written to stencil buffer *)
6676
    D3DRENDERSTATE_STENCILWRITEMASK   = 59;   (* Write mask applied to values written to stencil buffer *)
6669
    D3DRENDERSTATE_TEXTUREFACTOR      = 60;   (* D3DCOLOR used for multi-texture blend *)
6677
    D3DRENDERSTATE_TEXTUREFACTOR      = 60;   (* D3DCOLOR used for multi-texture blend *)
6670
 
6678
 
6671
    (*
6679
    (*
6672
     * 128 values [128; 255] are reserved for texture coordinate wrap flags.
6680
     * 128 values [128; 255] are reserved for texture coordinate wrap flags.
6673
     * These are constructed with the D3DWRAP_U and D3DWRAP_V macros. Using
6681
     * These are constructed with the D3DWRAP_U and D3DWRAP_V macros. Using
6674
     * a flags word preserves forward compatibility with texture coordinates
6682
     * a flags word preserves forward compatibility with texture coordinates
6675
     * that are >2D.
6683
     * that are >2D.
6676
     *)
6684
     *)
6677
    D3DRENDERSTATE_WRAP0              = 128;  (* wrap for 1st texture coord. set *)
6685
    D3DRENDERSTATE_WRAP0              = 128;  (* wrap for 1st texture coord. set *)
6678
    D3DRENDERSTATE_WRAP1              = 129;  (* wrap for 2nd texture coord. set *)
6686
    D3DRENDERSTATE_WRAP1              = 129;  (* wrap for 2nd texture coord. set *)
6679
    D3DRENDERSTATE_WRAP2              = 130;  (* wrap for 3rd texture coord. set *)
6687
    D3DRENDERSTATE_WRAP2              = 130;  (* wrap for 3rd texture coord. set *)
6680
    D3DRENDERSTATE_WRAP3              = 131;  (* wrap for 4th texture coord. set *)
6688
    D3DRENDERSTATE_WRAP3              = 131;  (* wrap for 4th texture coord. set *)
6681
    D3DRENDERSTATE_WRAP4              = 132;  (* wrap for 5th texture coord. set *)
6689
    D3DRENDERSTATE_WRAP4              = 132;  (* wrap for 5th texture coord. set *)
6682
    D3DRENDERSTATE_WRAP5              = 133;  (* wrap for 6th texture coord. set *)
6690
    D3DRENDERSTATE_WRAP5              = 133;  (* wrap for 6th texture coord. set *)
6683
    D3DRENDERSTATE_WRAP6              = 134;  (* wrap for 7th texture coord. set *)
6691
    D3DRENDERSTATE_WRAP6              = 134;  (* wrap for 7th texture coord. set *)
6684
    D3DRENDERSTATE_WRAP7              = 135;  (* wrap for 8th texture coord. set *)
6692
    D3DRENDERSTATE_WRAP7              = 135;  (* wrap for 8th texture coord. set *)
6685
    D3DRENDERSTATE_CLIPPING            = 136;
6693
    D3DRENDERSTATE_CLIPPING            = 136;
6686
    D3DRENDERSTATE_LIGHTING            = 137;
6694
    D3DRENDERSTATE_LIGHTING            = 137;
6687
    D3DRENDERSTATE_EXTENTS             = 138;
6695
    D3DRENDERSTATE_EXTENTS             = 138;
6688
    D3DRENDERSTATE_AMBIENT             = 139;
6696
    D3DRENDERSTATE_AMBIENT             = 139;
6689
    D3DRENDERSTATE_FOGVERTEXMODE       = 140;
6697
    D3DRENDERSTATE_FOGVERTEXMODE       = 140;
6690
    D3DRENDERSTATE_COLORVERTEX         = 141;
6698
    D3DRENDERSTATE_COLORVERTEX         = 141;
6691
    D3DRENDERSTATE_LOCALVIEWER         = 142;
6699
    D3DRENDERSTATE_LOCALVIEWER         = 142;
6692
    D3DRENDERSTATE_NORMALIZENORMALS    = 143;
6700
    D3DRENDERSTATE_NORMALIZENORMALS    = 143;
6693
    D3DRENDERSTATE_COLORKEYBLENDENABLE = 144;
6701
    D3DRENDERSTATE_COLORKEYBLENDENABLE = 144;
6694
    D3DRENDERSTATE_DIFFUSEMATERIALSOURCE    = 145;
6702
    D3DRENDERSTATE_DIFFUSEMATERIALSOURCE    = 145;
6695
    D3DRENDERSTATE_SPECULARMATERIALSOURCE   = 146;
6703
    D3DRENDERSTATE_SPECULARMATERIALSOURCE   = 146;
6696
    D3DRENDERSTATE_AMBIENTMATERIALSOURCE    = 147;
6704
    D3DRENDERSTATE_AMBIENTMATERIALSOURCE    = 147;
6697
    D3DRENDERSTATE_EMISSIVEMATERIALSOURCE   = 148;
6705
    D3DRENDERSTATE_EMISSIVEMATERIALSOURCE   = 148;
6698
    D3DRENDERSTATE_VERTEXBLEND              = 151;
6706
    D3DRENDERSTATE_VERTEXBLEND              = 151;
6699
    D3DRENDERSTATE_CLIPPLANEENABLE          = 152;
6707
    D3DRENDERSTATE_CLIPPLANEENABLE          = 152;
6700
 
6708
 
6701
//
6709
//
6702
// retired renderstates - not supported for DX7 interfaces
6710
// retired renderstates - not supported for DX7 interfaces
6703
//
6711
//
6704
    D3DRENDERSTATE_TEXTUREHANDLE      = 1;    (* Texture handle for legacy interfaces (Texture;Texture2) *)
6712
    D3DRENDERSTATE_TEXTUREHANDLE      = 1;    (* Texture handle for legacy interfaces (Texture;Texture2) *)
6705
    D3DRENDERSTATE_TEXTUREADDRESS     = 3;    (* D3DTEXTUREADDRESS  *)
6713
    D3DRENDERSTATE_TEXTUREADDRESS     = 3;    (* D3DTEXTUREADDRESS  *)
6706
    D3DRENDERSTATE_WRAPU              = 5;    (* TRUE for wrapping in u *)
6714
    D3DRENDERSTATE_WRAPU              = 5;    (* TRUE for wrapping in u *)
6707
    D3DRENDERSTATE_WRAPV              = 6;    (* TRUE for wrapping in v *)
6715
    D3DRENDERSTATE_WRAPV              = 6;    (* TRUE for wrapping in v *)
6708
    D3DRENDERSTATE_MONOENABLE         = 11;   (* TRUE to enable mono rasterization *)
6716
    D3DRENDERSTATE_MONOENABLE         = 11;   (* TRUE to enable mono rasterization *)
6709
    D3DRENDERSTATE_ROP2               = 12;   (* ROP2 *)
6717
    D3DRENDERSTATE_ROP2               = 12;   (* ROP2 *)
6710
    D3DRENDERSTATE_PLANEMASK          = 13;   (* DWORD physical plane mask *)
6718
    D3DRENDERSTATE_PLANEMASK          = 13;   (* DWORD physical plane mask *)
6711
    D3DRENDERSTATE_TEXTUREMAG         = 17;   (* D3DTEXTUREFILTER *)
6719
    D3DRENDERSTATE_TEXTUREMAG         = 17;   (* D3DTEXTUREFILTER *)
6712
    D3DRENDERSTATE_TEXTUREMIN         = 18;   (* D3DTEXTUREFILTER *)
6720
    D3DRENDERSTATE_TEXTUREMIN         = 18;   (* D3DTEXTUREFILTER *)
6713
    D3DRENDERSTATE_TEXTUREMAPBLEND    = 21;   (* D3DTEXTUREBLEND *)
6721
    D3DRENDERSTATE_TEXTUREMAPBLEND    = 21;   (* D3DTEXTUREBLEND *)
6714
    D3DRENDERSTATE_SUBPIXEL           = 31;   (* TRUE to enable subpixel correction *)
6722
    D3DRENDERSTATE_SUBPIXEL           = 31;   (* TRUE to enable subpixel correction *)
6715
    D3DRENDERSTATE_SUBPIXELX          = 32;   (* TRUE to enable correction in X only *)
6723
    D3DRENDERSTATE_SUBPIXELX          = 32;   (* TRUE to enable correction in X only *)
6716
    D3DRENDERSTATE_STIPPLEENABLE      = 39;   (* TRUE to enable stippling *)
6724
    D3DRENDERSTATE_STIPPLEENABLE      = 39;   (* TRUE to enable stippling *)
6717
    D3DRENDERSTATE_BORDERCOLOR        = 43;   (* Border color for texturing w/border *)
6725
    D3DRENDERSTATE_BORDERCOLOR        = 43;   (* Border color for texturing w/border *)
6718
    D3DRENDERSTATE_TEXTUREADDRESSU    = 44;   (* Texture addressing mode for U coordinate *)
6726
    D3DRENDERSTATE_TEXTUREADDRESSU    = 44;   (* Texture addressing mode for U coordinate *)
6719
    D3DRENDERSTATE_TEXTUREADDRESSV    = 45;   (* Texture addressing mode for V coordinate *)
6727
    D3DRENDERSTATE_TEXTUREADDRESSV    = 45;   (* Texture addressing mode for V coordinate *)
6720
    D3DRENDERSTATE_MIPMAPLODBIAS      = 46;   (* D3DVALUE Mipmap LOD bias *)
6728
    D3DRENDERSTATE_MIPMAPLODBIAS      = 46;   (* D3DVALUE Mipmap LOD bias *)
6721
    D3DRENDERSTATE_ANISOTROPY         = 49;   (* Max. anisotropy. 1 = no anisotropy *)
6729
    D3DRENDERSTATE_ANISOTROPY         = 49;   (* Max. anisotropy. 1 = no anisotropy *)
6722
    D3DRENDERSTATE_FLUSHBATCH         = 50;   (* Explicit flush for DP batching (DX5 Only) *)
6730
    D3DRENDERSTATE_FLUSHBATCH         = 50;   (* Explicit flush for DP batching (DX5 Only) *)
6723
    D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT=51; (* BOOL enable sort-independent transparency *)
6731
    D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT=51; (* BOOL enable sort-independent transparency *)
6724
    D3DRENDERSTATE_STIPPLEPATTERN00   = 64;   (* Stipple pattern 01...  *)
6732
    D3DRENDERSTATE_STIPPLEPATTERN00   = 64;   (* Stipple pattern 01...  *)
6725
    D3DRENDERSTATE_STIPPLEPATTERN01   = 65;
6733
    D3DRENDERSTATE_STIPPLEPATTERN01   = 65;
6726
    D3DRENDERSTATE_STIPPLEPATTERN02   = 66;
6734
    D3DRENDERSTATE_STIPPLEPATTERN02   = 66;
6727
    D3DRENDERSTATE_STIPPLEPATTERN03   = 67;
6735
    D3DRENDERSTATE_STIPPLEPATTERN03   = 67;
6728
    D3DRENDERSTATE_STIPPLEPATTERN04   = 68;
6736
    D3DRENDERSTATE_STIPPLEPATTERN04   = 68;
6729
    D3DRENDERSTATE_STIPPLEPATTERN05   = 69;
6737
    D3DRENDERSTATE_STIPPLEPATTERN05   = 69;
6730
    D3DRENDERSTATE_STIPPLEPATTERN06   = 70;
6738
    D3DRENDERSTATE_STIPPLEPATTERN06   = 70;
6731
    D3DRENDERSTATE_STIPPLEPATTERN07   = 71;
6739
    D3DRENDERSTATE_STIPPLEPATTERN07   = 71;
6732
    D3DRENDERSTATE_STIPPLEPATTERN08   = 72;
6740
    D3DRENDERSTATE_STIPPLEPATTERN08   = 72;
6733
    D3DRENDERSTATE_STIPPLEPATTERN09   = 73;
6741
    D3DRENDERSTATE_STIPPLEPATTERN09   = 73;
6734
    D3DRENDERSTATE_STIPPLEPATTERN10   = 74;
6742
    D3DRENDERSTATE_STIPPLEPATTERN10   = 74;
6735
    D3DRENDERSTATE_STIPPLEPATTERN11   = 75;
6743
    D3DRENDERSTATE_STIPPLEPATTERN11   = 75;
6736
    D3DRENDERSTATE_STIPPLEPATTERN12   = 76;
6744
    D3DRENDERSTATE_STIPPLEPATTERN12   = 76;
6737
    D3DRENDERSTATE_STIPPLEPATTERN13   = 77;
6745
    D3DRENDERSTATE_STIPPLEPATTERN13   = 77;
6738
    D3DRENDERSTATE_STIPPLEPATTERN14   = 78;
6746
    D3DRENDERSTATE_STIPPLEPATTERN14   = 78;
6739
    D3DRENDERSTATE_STIPPLEPATTERN15   = 79;
6747
    D3DRENDERSTATE_STIPPLEPATTERN15   = 79;
6740
    D3DRENDERSTATE_STIPPLEPATTERN16   = 80;
6748
    D3DRENDERSTATE_STIPPLEPATTERN16   = 80;
6741
    D3DRENDERSTATE_STIPPLEPATTERN17   = 81;
6749
    D3DRENDERSTATE_STIPPLEPATTERN17   = 81;
6742
    D3DRENDERSTATE_STIPPLEPATTERN18   = 82;
6750
    D3DRENDERSTATE_STIPPLEPATTERN18   = 82;
6743
    D3DRENDERSTATE_STIPPLEPATTERN19   = 83;
6751
    D3DRENDERSTATE_STIPPLEPATTERN19   = 83;
6744
    D3DRENDERSTATE_STIPPLEPATTERN20   = 84;
6752
    D3DRENDERSTATE_STIPPLEPATTERN20   = 84;
6745
    D3DRENDERSTATE_STIPPLEPATTERN21   = 85;
6753
    D3DRENDERSTATE_STIPPLEPATTERN21   = 85;
6746
    D3DRENDERSTATE_STIPPLEPATTERN22   = 86;
6754
    D3DRENDERSTATE_STIPPLEPATTERN22   = 86;
6747
    D3DRENDERSTATE_STIPPLEPATTERN23   = 87;
6755
    D3DRENDERSTATE_STIPPLEPATTERN23   = 87;
6748
    D3DRENDERSTATE_STIPPLEPATTERN24   = 88;
6756
    D3DRENDERSTATE_STIPPLEPATTERN24   = 88;
6749
    D3DRENDERSTATE_STIPPLEPATTERN25   = 89;
6757
    D3DRENDERSTATE_STIPPLEPATTERN25   = 89;
6750
    D3DRENDERSTATE_STIPPLEPATTERN26   = 90;
6758
    D3DRENDERSTATE_STIPPLEPATTERN26   = 90;
6751
    D3DRENDERSTATE_STIPPLEPATTERN27   = 91;
6759
    D3DRENDERSTATE_STIPPLEPATTERN27   = 91;
6752
    D3DRENDERSTATE_STIPPLEPATTERN28   = 92;
6760
    D3DRENDERSTATE_STIPPLEPATTERN28   = 92;
6753
    D3DRENDERSTATE_STIPPLEPATTERN29   = 93;
6761
    D3DRENDERSTATE_STIPPLEPATTERN29   = 93;
6754
    D3DRENDERSTATE_STIPPLEPATTERN30   = 94;
6762
    D3DRENDERSTATE_STIPPLEPATTERN30   = 94;
6755
    D3DRENDERSTATE_STIPPLEPATTERN31   = 95;
6763
    D3DRENDERSTATE_STIPPLEPATTERN31   = 95;
6756
 
6764
 
6757
//
6765
//
6758
// retired renderstate names - the values are still used under new naming conventions
6766
// retired renderstate names - the values are still used under new naming conventions
6759
//
6767
//
6760
    D3DRENDERSTATE_FOGTABLESTART      = 36;   (* Fog table start    *)
6768
    D3DRENDERSTATE_FOGTABLESTART      = 36;   (* Fog table start    *)
6761
    D3DRENDERSTATE_FOGTABLEEND        = 37;   (* Fog table end      *)
6769
    D3DRENDERSTATE_FOGTABLEEND        = 37;   (* Fog table end      *)
6762
    D3DRENDERSTATE_FOGTABLEDENSITY    = 38;   (* Fog table density  *)
6770
    D3DRENDERSTATE_FOGTABLEDENSITY    = 38;   (* Fog table density  *)
6763
 
6771
 
6764
type
6772
type
6765
// Values for material source
6773
// Values for material source
6766
  PD3DMateralColorSource = ^TD3DMateralColorSource;
6774
  PD3DMateralColorSource = ^TD3DMateralColorSource;
6767
  TD3DMateralColorSource = (
6775
  TD3DMateralColorSource = (
6768
    D3DMCS_MATERIAL,              // Color from material is used
6776
    D3DMCS_MATERIAL,              // Color from material is used
6769
    D3DMCS_COLOR1,                // Diffuse vertex color is used
6777
    D3DMCS_COLOR1,                // Diffuse vertex color is used
6770
    D3DMCS_COLOR2                 // Specular vertex color is used
6778
    D3DMCS_COLOR2                 // Specular vertex color is used
6771
  );
6779
  );
6772
 
6780
 
6773
const
6781
const
6774
  // For back-compatibility with legacy compilations
6782
  // For back-compatibility with legacy compilations
6775
  D3DRENDERSTATE_BLENDENABLE = D3DRENDERSTATE_ALPHABLENDENABLE;
6783
  D3DRENDERSTATE_BLENDENABLE = D3DRENDERSTATE_ALPHABLENDENABLE;
6776
 
6784
 
6777
 
6785
 
6778
// Bias to apply to the texture coordinate set to apply a wrap to.
6786
// Bias to apply to the texture coordinate set to apply a wrap to.
6779
   D3DRENDERSTATE_WRAPBIAS                = 128;
6787
   D3DRENDERSTATE_WRAPBIAS                = 128;
6780
 
6788
 
6781
(* Flags to construct the WRAP render states *)
6789
(* Flags to construct the WRAP render states *)
6782
  D3DWRAP_U   = $00000001;
6790
  D3DWRAP_U   = $00000001;
6783
  D3DWRAP_V   = $00000002;
6791
  D3DWRAP_V   = $00000002;
6784
 
6792
 
6785
(* Flags to construct the WRAP render states for 1D thru 4D texture coordinates *)
6793
(* Flags to construct the WRAP render states for 1D thru 4D texture coordinates *)
6786
  D3DWRAPCOORD_0   = $00000001;    // same as D3DWRAP_U
6794
  D3DWRAPCOORD_0   = $00000001;    // same as D3DWRAP_U
6787
  D3DWRAPCOORD_1   = $00000002;    // same as D3DWRAP_V
6795
  D3DWRAPCOORD_1   = $00000002;    // same as D3DWRAP_V
6788
  D3DWRAPCOORD_2   = $00000004;
6796
  D3DWRAPCOORD_2   = $00000004;
6789
  D3DWRAPCOORD_3   = $00000008;
6797
  D3DWRAPCOORD_3   = $00000008;
6790
 
6798
 
6791
function D3DRENDERSTATE_STIPPLEPATTERN(y: integer) : TD3DRenderStateType;
6799
function D3DRENDERSTATE_STIPPLEPATTERN(y: integer) : TD3DRenderStateType;
6792
 
6800
 
6793
type
6801
type
6794
  PD3DState = ^TD3DState;
6802
  PD3DState = ^TD3DState;
6795
  TD3DState = packed record
6803
  TD3DState = packed record
6796
    case Integer of
6804
    case Integer of
6797
    0: (
6805
    0: (
6798
      dtstTransformStateType: TD3DTransformStateType;
6806
      dtstTransformStateType: TD3DTransformStateType;
6799
      dwArg: Array [ 0..0 ] of DWORD;
6807
      dwArg: Array [ 0..0 ] of DWORD;
6800
     );
6808
     );
6801
    1: (
6809
    1: (
6802
      dlstLightStateType: TD3DLightStateType;
6810
      dlstLightStateType: TD3DLightStateType;
6803
      dvArg: Array [ 0..0 ] of TD3DValue;
6811
      dvArg: Array [ 0..0 ] of TD3DValue;
6804
     );
6812
     );
6805
    2: (
6813
    2: (
6806
      drstRenderStateType: TD3DRenderStateType;
6814
      drstRenderStateType: TD3DRenderStateType;
6807
     );
6815
     );
6808
  end;
6816
  end;
6809
 
6817
 
6810
(*
6818
(*
6811
 * Operation used to load matrices
6819
 * Operation used to load matrices
6812
 * hDstMat = hSrcMat
6820
 * hDstMat = hSrcMat
6813
 *)
6821
 *)
6814
  PD3DMatrixLoad = ^TD3DMatrixLoad;
6822
  PD3DMatrixLoad = ^TD3DMatrixLoad;
6815
  TD3DMatrixLoad = packed record
6823
  TD3DMatrixLoad = packed record
6816
    hDestMatrix: TD3DMatrixHandle;   (* Destination matrix *)
6824
    hDestMatrix: TD3DMatrixHandle;   (* Destination matrix *)
6817
    hSrcMatrix: TD3DMatrixHandle;    (* Source matrix *)
6825
    hSrcMatrix: TD3DMatrixHandle;    (* Source matrix *)
6818
  end;
6826
  end;
6819
 
6827
 
6820
(*
6828
(*
6821
 * Operation used to multiply matrices
6829
 * Operation used to multiply matrices
6822
 * hDstMat = hSrcMat1 * hSrcMat2
6830
 * hDstMat = hSrcMat1 * hSrcMat2
6823
 *)
6831
 *)
6824
  PD3DMatrixMultiply = ^TD3DMatrixMultiply;
6832
  PD3DMatrixMultiply = ^TD3DMatrixMultiply;
6825
  TD3DMatrixMultiply = packed record
6833
  TD3DMatrixMultiply = packed record
6826
    hDestMatrix: TD3DMatrixHandle;   (* Destination matrix *)
6834
    hDestMatrix: TD3DMatrixHandle;   (* Destination matrix *)
6827
    hSrcMatrix1: TD3DMatrixHandle;   (* First source matrix *)
6835
    hSrcMatrix1: TD3DMatrixHandle;   (* First source matrix *)
6828
    hSrcMatrix2: TD3DMatrixHandle;   (* Second source matrix *)
6836
    hSrcMatrix2: TD3DMatrixHandle;   (* Second source matrix *)
6829
  end;
6837
  end;
6830
 
6838
 
6831
(*
6839
(*
6832
 * Operation used to transform and light vertices.
6840
 * Operation used to transform and light vertices.
6833
 *)
6841
 *)
6834
  PD3DProcessVertices = ^TD3DProcessVertices;
6842
  PD3DProcessVertices = ^TD3DProcessVertices;
6835
  TD3DProcessVertices = packed record
6843
  TD3DProcessVertices = packed record
6836
    dwFlags: DWORD;           (* Do we transform or light or just copy? *)
6844
    dwFlags: DWORD;           (* Do we transform or light or just copy? *)
6837
    wStart: WORD;             (* Index to first vertex in source *)
6845
    wStart: WORD;             (* Index to first vertex in source *)
6838
    wDest: WORD;              (* Index to first vertex in local buffer *)
6846
    wDest: WORD;              (* Index to first vertex in local buffer *)
6839
    dwCount: DWORD;           (* Number of vertices to be processed *)
6847
    dwCount: DWORD;           (* Number of vertices to be processed *)
6840
    dwReserved: DWORD;        (* Must be zero *)
6848
    dwReserved: DWORD;        (* Must be zero *)
6841
  end;
6849
  end;
6842
 
6850
 
6843
const
6851
const
6844
  D3DPROCESSVERTICES_TRANSFORMLIGHT       = $00000000;
6852
  D3DPROCESSVERTICES_TRANSFORMLIGHT       = $00000000;
6845
  D3DPROCESSVERTICES_TRANSFORM            = $00000001;
6853
  D3DPROCESSVERTICES_TRANSFORM            = $00000001;
6846
  D3DPROCESSVERTICES_COPY                 = $00000002;
6854
  D3DPROCESSVERTICES_COPY                 = $00000002;
6847
  D3DPROCESSVERTICES_OPMASK               = $00000007;
6855
  D3DPROCESSVERTICES_OPMASK               = $00000007;
6848
 
6856
 
6849
  D3DPROCESSVERTICES_UPDATEEXTENTS        = $00000008;
6857
  D3DPROCESSVERTICES_UPDATEEXTENTS        = $00000008;
6850
  D3DPROCESSVERTICES_NOCOLOR              = $00000010;
6858
  D3DPROCESSVERTICES_NOCOLOR              = $00000010;
6851
 
6859
 
6852
 
6860
 
6853
(*
6861
(*
6854
 * State enumerants for per-stage texture processing.
6862
 * State enumerants for per-stage texture processing.
6855
 *)
6863
 *)
6856
type
6864
type
6857
  PD3DTextureStageStateType = ^TD3DTextureStageStateType;
6865
  PD3DTextureStageStateType = ^TD3DTextureStageStateType;
6858
  TD3DTextureStageStateType = DWORD;
6866
  TD3DTextureStageStateType = DWORD;
6859
const
6867
const
6860
  D3DTSS_COLOROP        =  1; (* D3DTEXTUREOP - per-stage blending controls for color channels *)
6868
  D3DTSS_COLOROP        =  1; (* D3DTEXTUREOP - per-stage blending controls for color channels *)
6861
  D3DTSS_COLORARG1      =  2; (* D3DTA_* (texture arg) *)
6869
  D3DTSS_COLORARG1      =  2; (* D3DTA_* (texture arg) *)
6862
  D3DTSS_COLORARG2      =  3; (* D3DTA_* (texture arg) *)
6870
  D3DTSS_COLORARG2      =  3; (* D3DTA_* (texture arg) *)
6863
  D3DTSS_ALPHAOP        =  4; (* D3DTEXTUREOP - per-stage blending controls for alpha channel *)
6871
  D3DTSS_ALPHAOP        =  4; (* D3DTEXTUREOP - per-stage blending controls for alpha channel *)
6864
  D3DTSS_ALPHAARG1      =  5; (* D3DTA_* (texture arg) *)
6872
  D3DTSS_ALPHAARG1      =  5; (* D3DTA_* (texture arg) *)
6865
  D3DTSS_ALPHAARG2      =  6; (* D3DTA_* (texture arg) *)
6873
  D3DTSS_ALPHAARG2      =  6; (* D3DTA_* (texture arg) *)
6866
  D3DTSS_BUMPENVMAT00   =  7; (* D3DVALUE (bump mapping matrix) *)
6874
  D3DTSS_BUMPENVMAT00   =  7; (* D3DVALUE (bump mapping matrix) *)
6867
  D3DTSS_BUMPENVMAT01   =  8; (* D3DVALUE (bump mapping matrix) *)
6875
  D3DTSS_BUMPENVMAT01   =  8; (* D3DVALUE (bump mapping matrix) *)
6868
  D3DTSS_BUMPENVMAT10   =  9; (* D3DVALUE (bump mapping matrix) *)
6876
  D3DTSS_BUMPENVMAT10   =  9; (* D3DVALUE (bump mapping matrix) *)
6869
  D3DTSS_BUMPENVMAT11   = 10; (* D3DVALUE (bump mapping matrix) *)
6877
  D3DTSS_BUMPENVMAT11   = 10; (* D3DVALUE (bump mapping matrix) *)
6870
  D3DTSS_TEXCOORDINDEX  = 11; (* identifies which set of texture coordinates index this texture *)
6878
  D3DTSS_TEXCOORDINDEX  = 11; (* identifies which set of texture coordinates index this texture *)
6871
  D3DTSS_ADDRESS        = 12; (* D3DTEXTUREADDRESS for both coordinates *)
6879
  D3DTSS_ADDRESS        = 12; (* D3DTEXTUREADDRESS for both coordinates *)
6872
  D3DTSS_ADDRESSU       = 13; (* D3DTEXTUREADDRESS for U coordinate *)
6880
  D3DTSS_ADDRESSU       = 13; (* D3DTEXTUREADDRESS for U coordinate *)
6873
  D3DTSS_ADDRESSV       = 14; (* D3DTEXTUREADDRESS for V coordinate *)
6881
  D3DTSS_ADDRESSV       = 14; (* D3DTEXTUREADDRESS for V coordinate *)
6874
  D3DTSS_BORDERCOLOR    = 15; (* D3DCOLOR *)
6882
  D3DTSS_BORDERCOLOR    = 15; (* D3DCOLOR *)
6875
  D3DTSS_MAGFILTER      = 16; (* D3DTEXTUREMAGFILTER filter to use for magnification *)
6883
  D3DTSS_MAGFILTER      = 16; (* D3DTEXTUREMAGFILTER filter to use for magnification *)
6876
  D3DTSS_MINFILTER      = 17; (* D3DTEXTUREMINFILTER filter to use for minification *)
6884
  D3DTSS_MINFILTER      = 17; (* D3DTEXTUREMINFILTER filter to use for minification *)
6877
  D3DTSS_MIPFILTER      = 18; (* D3DTEXTUREMIPFILTER filter to use between mipmaps during minification *)
6885
  D3DTSS_MIPFILTER      = 18; (* D3DTEXTUREMIPFILTER filter to use between mipmaps during minification *)
6878
  D3DTSS_MIPMAPLODBIAS  = 19; (* D3DVALUE Mipmap LOD bias *)
6886
  D3DTSS_MIPMAPLODBIAS  = 19; (* D3DVALUE Mipmap LOD bias *)
6879
  D3DTSS_MAXMIPLEVEL    = 20; (* DWORD 0..(n-1) LOD index of largest map to use (0 == largest) *)
6887
  D3DTSS_MAXMIPLEVEL    = 20; (* DWORD 0..(n-1) LOD index of largest map to use (0 == largest) *)
6880
  D3DTSS_MAXANISOTROPY  = 21; (* DWORD maximum anisotropy *)
6888
  D3DTSS_MAXANISOTROPY  = 21; (* DWORD maximum anisotropy *)
6881
  D3DTSS_BUMPENVLSCALE  = 22; (* D3DVALUE scale for bump map luminance *)
6889
  D3DTSS_BUMPENVLSCALE  = 22; (* D3DVALUE scale for bump map luminance *)
6882
  D3DTSS_BUMPENVLOFFSET = 23; (* D3DVALUE offset for bump map luminance *)
6890
  D3DTSS_BUMPENVLOFFSET = 23; (* D3DVALUE offset for bump map luminance *)
6883
  D3DTSS_TEXTURETRANSFORMFLAGS = 24; (* D3DTEXTURETRANSFORMFLAGS controls texture transform *)
6891
  D3DTSS_TEXTURETRANSFORMFLAGS = 24; (* D3DTEXTURETRANSFORMFLAGS controls texture transform *)
6884
 
6892
 
6885
// Values, used with D3DTSS_TEXCOORDINDEX, to specify that the vertex data(position
6893
// Values, used with D3DTSS_TEXCOORDINDEX, to specify that the vertex data(position
6886
// and normal in the camera space) should be taken as texture coordinates
6894
// and normal in the camera space) should be taken as texture coordinates
6887
// Low 16 bits are used to specify texture coordinate index, to take the WRAP mode from
6895
// Low 16 bits are used to specify texture coordinate index, to take the WRAP mode from
6888
//
6896
//
6889
  D3DTSS_TCI_PASSTHRU                             = $00000000;
6897
  D3DTSS_TCI_PASSTHRU                             = $00000000;
6890
  D3DTSS_TCI_CAMERASPACENORMAL                    = $00010000;
6898
  D3DTSS_TCI_CAMERASPACENORMAL                    = $00010000;
6891
  D3DTSS_TCI_CAMERASPACEPOSITION                  = $00020000;
6899
  D3DTSS_TCI_CAMERASPACEPOSITION                  = $00020000;
6892
  D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR          = $00030000;
6900
  D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR          = $00030000;
6893
 
6901
 
6894
type
6902
type
6895
(*
6903
(*
6896
 * Enumerations for COLOROP and ALPHAOP texture blending operations set in
6904
 * Enumerations for COLOROP and ALPHAOP texture blending operations set in
6897
 * texture processing stage controls in D3DRENDERSTATE.
6905
 * texture processing stage controls in D3DRENDERSTATE.
6898
 *)
6906
 *)
6899
  PD3DTextureOp = ^TD3DTextureOp;
6907
  PD3DTextureOp = ^TD3DTextureOp;
6900
  TD3DTextureOp = (
6908
  TD3DTextureOp = (
6901
    D3DTOP_INVALID_0,
6909
    D3DTOP_INVALID_0,
6902
// Control
6910
// Control
6903
    D3DTOP_DISABLE   ,      // disables stage
6911
    D3DTOP_DISABLE   ,      // disables stage
6904
    D3DTOP_SELECTARG1,      // the default
6912
    D3DTOP_SELECTARG1,      // the default
6905
    D3DTOP_SELECTARG2,
6913
    D3DTOP_SELECTARG2,
6906
 
6914
 
6907
// Modulate
6915
// Modulate
6908
    D3DTOP_MODULATE  ,      // multiply args together
6916
    D3DTOP_MODULATE  ,      // multiply args together
6909
    D3DTOP_MODULATE2X,      // multiply and  1 bit
6917
    D3DTOP_MODULATE2X,      // multiply and  1 bit
6910
    D3DTOP_MODULATE4X,      // multiply and  2 bits
6918
    D3DTOP_MODULATE4X,      // multiply and  2 bits
6911
 
6919
 
6912
// Add
6920
// Add
6913
    D3DTOP_ADD        ,   // add arguments together
6921
    D3DTOP_ADD        ,   // add arguments together
6914
    D3DTOP_ADDSIGNED  ,   // add with -0.5 bias
6922
    D3DTOP_ADDSIGNED  ,   // add with -0.5 bias
6915
    D3DTOP_ADDSIGNED2X,   // as above but left  1 bit
6923
    D3DTOP_ADDSIGNED2X,   // as above but left  1 bit
6916
    D3DTOP_SUBTRACT   ,   // Arg1 - Arg2, with no saturation
6924
    D3DTOP_SUBTRACT   ,   // Arg1 - Arg2, with no saturation
6917
    D3DTOP_ADDSMOOTH  ,   // add 2 args, subtract product
6925
    D3DTOP_ADDSMOOTH  ,   // add 2 args, subtract product
6918
                          // Arg1 + Arg2 - Arg1*Arg2
6926
                          // Arg1 + Arg2 - Arg1*Arg2
6919
                          // = Arg1 + (1-Arg1)*Arg2
6927
                          // = Arg1 + (1-Arg1)*Arg2
6920
 
6928
 
6921
// Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha)
6929
// Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha)
6922
    D3DTOP_BLENDDIFFUSEALPHA  , // iterated alpha
6930
    D3DTOP_BLENDDIFFUSEALPHA  , // iterated alpha
6923
    D3DTOP_BLENDTEXTUREALPHA  , // texture alpha
6931
    D3DTOP_BLENDTEXTUREALPHA  , // texture alpha
6924
    D3DTOP_BLENDFACTORALPHA   , // alpha from D3DRENDERSTATE_TEXTUREFACTOR
6932
    D3DTOP_BLENDFACTORALPHA   , // alpha from D3DRENDERSTATE_TEXTUREFACTOR
6925
    // Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha)
6933
    // Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha)
6926
    D3DTOP_BLENDTEXTUREALPHAPM, // texture alpha
6934
    D3DTOP_BLENDTEXTUREALPHAPM, // texture alpha
6927
    D3DTOP_BLENDCURRENTALPHA  , // by alpha of current color
6935
    D3DTOP_BLENDCURRENTALPHA  , // by alpha of current color
6928
 
6936
 
6929
// Specular mapping
6937
// Specular mapping
6930
    D3DTOP_PREMODULATE           ,     // modulate with next texture before use
6938
    D3DTOP_PREMODULATE           ,     // modulate with next texture before use
6931
    D3DTOP_MODULATEALPHA_ADDCOLOR,     // Arg1.RGB + Arg1.A*Arg2.RGB
6939
    D3DTOP_MODULATEALPHA_ADDCOLOR,     // Arg1.RGB + Arg1.A*Arg2.RGB
6932
                                       // COLOROP only
6940
                                       // COLOROP only
6933
    D3DTOP_MODULATECOLOR_ADDALPHA,     // Arg1.RGB*Arg2.RGB + Arg1.A
6941
    D3DTOP_MODULATECOLOR_ADDALPHA,     // Arg1.RGB*Arg2.RGB + Arg1.A
6934
                                            // COLOROP only
6942
                                            // COLOROP only
6935
    D3DTOP_MODULATEINVALPHA_ADDCOLOR,  // (1-Arg1.A)*Arg2.RGB + Arg1.RGB
6943
    D3DTOP_MODULATEINVALPHA_ADDCOLOR,  // (1-Arg1.A)*Arg2.RGB + Arg1.RGB
6936
                                       // COLOROP only
6944
                                       // COLOROP only
6937
    D3DTOP_MODULATEINVCOLOR_ADDALPHA,  // (1-Arg1.RGB)*Arg2.RGB + Arg1.A
6945
    D3DTOP_MODULATEINVCOLOR_ADDALPHA,  // (1-Arg1.RGB)*Arg2.RGB + Arg1.A
6938
                                            // COLOROP only
6946
                                            // COLOROP only
6939
 
6947
 
6940
// Bump mapping
6948
// Bump mapping
6941
    D3DTOP_BUMPENVMAP         , // per pixel env map perturbation
6949
    D3DTOP_BUMPENVMAP         , // per pixel env map perturbation
6942
    D3DTOP_BUMPENVMAPLUMINANCE, // with luminance channel
6950
    D3DTOP_BUMPENVMAPLUMINANCE, // with luminance channel
6943
    // This can do either diffuse or specular bump mapping with correct input.
6951
    // This can do either diffuse or specular bump mapping with correct input.
6944
    // Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B)
6952
    // Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B)
6945
    // where each component has been scaled and offset to make it signed.
6953
    // where each component has been scaled and offset to make it signed.
6946
    // The result is replicated into all four (including alpha) channels.
6954
    // The result is replicated into all four (including alpha) channels.
6947
    // This is a valid COLOROP only.
6955
    // This is a valid COLOROP only.
6948
    D3DTOP_DOTPRODUCT3
6956
    D3DTOP_DOTPRODUCT3
6949
  );
6957
  );
6950
 
6958
 
6951
(*
6959
(*
6952
 * Values for COLORARG1,2 and ALPHAARG1,2 texture blending operations
6960
 * Values for COLORARG1,2 and ALPHAARG1,2 texture blending operations
6953
 * set in texture processing stage controls in D3DRENDERSTATE.
6961
 * set in texture processing stage controls in D3DRENDERSTATE.
6954
 *)
6962
 *)
6955
const
6963
const
6956
  D3DTA_SELECTMASK        = $0000000f;  // mask for arg selector
6964
  D3DTA_SELECTMASK        = $0000000f;  // mask for arg selector
6957
  D3DTA_DIFFUSE           = $00000000;  // select diffuse color
6965
  D3DTA_DIFFUSE           = $00000000;  // select diffuse color
6958
  D3DTA_CURRENT           = $00000001;  // select result of previous stage
6966
  D3DTA_CURRENT           = $00000001;  // select result of previous stage
6959
  D3DTA_TEXTURE           = $00000002;  // select texture color
6967
  D3DTA_TEXTURE           = $00000002;  // select texture color
6960
  D3DTA_TFACTOR           = $00000003;  // select RENDERSTATE_TEXTUREFACTOR
6968
  D3DTA_TFACTOR           = $00000003;  // select RENDERSTATE_TEXTUREFACTOR
6961
  D3DTA_SPECULAR          = $00000004;  // select specular color
6969
  D3DTA_SPECULAR          = $00000004;  // select specular color
6962
  D3DTA_COMPLEMENT        = $00000010;  // take 1.0 - x
6970
  D3DTA_COMPLEMENT        = $00000010;  // take 1.0 - x
6963
  D3DTA_ALPHAREPLICATE    = $00000020;  // replicate alpha to color components
6971
  D3DTA_ALPHAREPLICATE    = $00000020;  // replicate alpha to color components
6964
 
6972
 
6965
(*
6973
(*
6966
 *  IDirect3DTexture2 State Filter Types
6974
 *  IDirect3DTexture2 State Filter Types
6967
 *)
6975
 *)
6968
type
6976
type
6969
  PD3DTextureMagFilter = ^TD3DTextureMagFilter;
6977
  PD3DTextureMagFilter = ^TD3DTextureMagFilter;
6970
  TD3DTextureMagFilter = (
6978
  TD3DTextureMagFilter = (
6971
    D3DTFG_INVALID_0,
6979
    D3DTFG_INVALID_0,
6972
    D3DTFG_POINT        ,    // nearest
6980
    D3DTFG_POINT        ,    // nearest
6973
    D3DTFG_LINEAR       ,    // linear interpolation
6981
    D3DTFG_LINEAR       ,    // linear interpolation
6974
    D3DTFG_FLATCUBIC    ,    // cubic
6982
    D3DTFG_FLATCUBIC    ,    // cubic
6975
    D3DTFG_GAUSSIANCUBIC,    // different cubic kernel
6983
    D3DTFG_GAUSSIANCUBIC,    // different cubic kernel
6976
    D3DTFG_ANISOTROPIC
6984
    D3DTFG_ANISOTROPIC
6977
  );
6985
  );
6978
 
6986
 
6979
  PD3DTextureMinFilter = ^TD3DTextureMinFilter;
6987
  PD3DTextureMinFilter = ^TD3DTextureMinFilter;
6980
  TD3DTextureMinFilter = (
6988
  TD3DTextureMinFilter = (
6981
    D3DTFN_INVALID_0,
6989
    D3DTFN_INVALID_0,
6982
    D3DTFN_POINT      ,    // nearest
6990
    D3DTFN_POINT      ,    // nearest
6983
    D3DTFN_LINEAR     ,    // linear interpolation
6991
    D3DTFN_LINEAR     ,    // linear interpolation
6984
    D3DTFN_ANISOTROPIC
6992
    D3DTFN_ANISOTROPIC
6985
  );
6993
  );
6986
 
6994
 
6987
  PD3DTextureMipFilter = ^TD3DTextureMipFilter;
6995
  PD3DTextureMipFilter = ^TD3DTextureMipFilter;
6988
  TD3DTextureMipFilter = (
6996
  TD3DTextureMipFilter = (
6989
    D3DTFP_INVALID_0,
6997
    D3DTFP_INVALID_0,
6990
    D3DTFP_NONE   ,    // mipmapping disabled (use MAG filter)
6998
    D3DTFP_NONE   ,    // mipmapping disabled (use MAG filter)
6991
    D3DTFP_POINT  ,    // nearest
6999
    D3DTFP_POINT  ,    // nearest
6992
    D3DTFP_LINEAR      // linear interpolation
7000
    D3DTFP_LINEAR      // linear interpolation
6993
  );
7001
  );
6994
 
7002
 
6995
 
7003
 
6996
(*
7004
(*
6997
 * Triangle flags
7005
 * Triangle flags
6998
 *)
7006
 *)
6999
 
7007
 
7000
(*
7008
(*
7001
 * Tri strip and fan flags.
7009
 * Tri strip and fan flags.
7002
 * START loads all three vertices
7010
 * START loads all three vertices
7003
 * EVEN and ODD load just v3 with even or odd culling
7011
 * EVEN and ODD load just v3 with even or odd culling
7004
 * START_FLAT contains a count from 0 to 29 that allows the
7012
 * START_FLAT contains a count from 0 to 29 that allows the
7005
 * whole strip or fan to be culled in one hit.
7013
 * whole strip or fan to be culled in one hit.
7006
 * e.g. for a quad len = 1
7014
 * e.g. for a quad len = 1
7007
 *)
7015
 *)
7008
const
7016
const
7009
  D3DTRIFLAG_START                        = $00000000;
7017
  D3DTRIFLAG_START                        = $00000000;
7010
// #define D3DTRIFLAG_STARTFLAT(len) (len)         (* 0 < len < 30 *)
7018
// #define D3DTRIFLAG_STARTFLAT(len) (len)         (* 0 < len < 30 *)
7011
function D3DTRIFLAG_STARTFLAT(len: DWORD) : DWORD;
7019
function D3DTRIFLAG_STARTFLAT(len: DWORD) : DWORD;
7012
 
7020
 
7013
const
7021
const
7014
  D3DTRIFLAG_ODD                          = $0000001e;
7022
  D3DTRIFLAG_ODD                          = $0000001e;
7015
  D3DTRIFLAG_EVEN                         = $0000001f;
7023
  D3DTRIFLAG_EVEN                         = $0000001f;
7016
 
7024
 
7017
(*
7025
(*
7018
 * Triangle edge flags
7026
 * Triangle edge flags
7019
 * enable edges for wireframe or antialiasing
7027
 * enable edges for wireframe or antialiasing
7020
 *)
7028
 *)
7021
  D3DTRIFLAG_EDGEENABLE1                  = $00000100; (* v0-v1 edge *)
7029
  D3DTRIFLAG_EDGEENABLE1                  = $00000100; (* v0-v1 edge *)
7022
  D3DTRIFLAG_EDGEENABLE2                  = $00000200; (* v1-v2 edge *)
7030
  D3DTRIFLAG_EDGEENABLE2                  = $00000200; (* v1-v2 edge *)
7023
  D3DTRIFLAG_EDGEENABLE3                  = $00000400; (* v2-v0 edge *)
7031
  D3DTRIFLAG_EDGEENABLE3                  = $00000400; (* v2-v0 edge *)
7024
  D3DTRIFLAG_EDGEENABLETRIANGLE = (
7032
  D3DTRIFLAG_EDGEENABLETRIANGLE = (
7025
      D3DTRIFLAG_EDGEENABLE1 or D3DTRIFLAG_EDGEENABLE2 or D3DTRIFLAG_EDGEENABLE3);
7033
      D3DTRIFLAG_EDGEENABLE1 or D3DTRIFLAG_EDGEENABLE2 or D3DTRIFLAG_EDGEENABLE3);
7026
 
7034
 
7027
(*
7035
(*
7028
 * Primitive structures and related defines.  Vertex offsets are to types
7036
 * Primitive structures and related defines.  Vertex offsets are to types
7029
 * TD3DVertex, TD3DLVertex, or TD3DTLVertex.
7037
 * TD3DVertex, TD3DLVertex, or TD3DTLVertex.
7030
 *)
7038
 *)
7031
 
7039
 
7032
(*
7040
(*
7033
 * Triangle list primitive structure
7041
 * Triangle list primitive structure
7034
 *)
7042
 *)
7035
type
7043
type
7036
  PD3DTriangle = ^TD3DTriangle;
7044
  PD3DTriangle = ^TD3DTriangle;
7037
  TD3DTriangle = packed record
7045
  TD3DTriangle = packed record
7038
    case Integer of
7046
    case Integer of
7039
    0: (
7047
    0: (
7040
      v1: WORD;            (* Vertex indices *)
7048
      v1: WORD;            (* Vertex indices *)
7041
      v2: WORD;
7049
      v2: WORD;
7042
      v3: WORD;
7050
      v3: WORD;
7043
      wFlags: WORD;        (* Edge (and other) flags *)
7051
      wFlags: WORD;        (* Edge (and other) flags *)
7044
     );
7052
     );
7045
    1: (
7053
    1: (
7046
      wV1: WORD;
7054
      wV1: WORD;
7047
      wV2: WORD;
7055
      wV2: WORD;
7048
      wV3: WORD;
7056
      wV3: WORD;
7049
     );
7057
     );
7050
  end;
7058
  end;
7051
 
7059
 
7052
(*
7060
(*
7053
 * Line strip structure.
7061
 * Line strip structure.
7054
 * The instruction count - 1 defines the number of line segments.
7062
 * The instruction count - 1 defines the number of line segments.
7055
 *)
7063
 *)
7056
  PD3DLine = ^TD3DLine;
7064
  PD3DLine = ^TD3DLine;
7057
  TD3DLine = packed record
7065
  TD3DLine = packed record
7058
    case Integer of
7066
    case Integer of
7059
    0: (
7067
    0: (
7060
      v1: WORD;            (* Vertex indices *)
7068
      v1: WORD;            (* Vertex indices *)
7061
      v2: WORD;
7069
      v2: WORD;
7062
     );
7070
     );
7063
    1: (
7071
    1: (
7064
      wV1: WORD;
7072
      wV1: WORD;
7065
      wV2: WORD;
7073
      wV2: WORD;
7066
     );
7074
     );
7067
  end;
7075
  end;
7068
 
7076
 
7069
(*
7077
(*
7070
 * Span structure
7078
 * Span structure
7071
 * Spans join a list of points with the same y value.
7079
 * Spans join a list of points with the same y value.
7072
 * If the y value changes, a new span is started.
7080
 * If the y value changes, a new span is started.
7073
 *)
7081
 *)
7074
  PD3DSpan = ^TD3DSpan;
7082
  PD3DSpan = ^TD3DSpan;
7075
  TD3DSpan = packed record
7083
  TD3DSpan = packed record
7076
    wCount: WORD;        (* Number of spans *)
7084
    wCount: WORD;        (* Number of spans *)
7077
    wFirst: WORD;        (* Index to first vertex *)
7085
    wFirst: WORD;        (* Index to first vertex *)
7078
  end;
7086
  end;
7079
 
7087
 
7080
(*
7088
(*
7081
 * Point structure
7089
 * Point structure
7082
 *)
7090
 *)
7083
  PD3DPoint = ^TD3DPoint;
7091
  PD3DPoint = ^TD3DPoint;
7084
  TD3DPoint = packed record
7092
  TD3DPoint = packed record
7085
    wCount: WORD;        (* number of points         *)
7093
    wCount: WORD;        (* number of points         *)
7086
    wFirst: WORD;        (* index to first vertex    *)
7094
    wFirst: WORD;        (* index to first vertex    *)
7087
  end;
7095
  end;
7088
 
7096
 
7089
(*
7097
(*
7090
 * Forward branch structure.
7098
 * Forward branch structure.
7091
 * Mask is logically anded with the driver status mask
7099
 * Mask is logically anded with the driver status mask
7092
 * if the result equals 'value', the branch is taken.
7100
 * if the result equals 'value', the branch is taken.
7093
 *)
7101
 *)
7094
  PD3DBranch = ^TD3DBranch;
7102
  PD3DBranch = ^TD3DBranch;
7095
  TD3DBranch = packed record
7103
  TD3DBranch = packed record
7096
    dwMask: DWORD;         (* Bitmask against D3D status *)
7104
    dwMask: DWORD;         (* Bitmask against D3D status *)
7097
    dwValue: DWORD;
7105
    dwValue: DWORD;
7098
    bNegate: BOOL;         (* TRUE to negate comparison *)
7106
    bNegate: BOOL;         (* TRUE to negate comparison *)
7099
    dwOffset: DWORD;       (* How far to branch forward (0 for exit)*)
7107
    dwOffset: DWORD;       (* How far to branch forward (0 for exit)*)
7100
  end;
7108
  end;
7101
 
7109
 
7102
(*
7110
(*
7103
 * Status used for set status instruction.
7111
 * Status used for set status instruction.
7104
 * The D3D status is initialised on device creation
7112
 * The D3D status is initialised on device creation
7105
 * and is modified by all execute calls.
7113
 * and is modified by all execute calls.
7106
 *)
7114
 *)
7107
  PD3DStatus = ^TD3DStatus;
7115
  PD3DStatus = ^TD3DStatus;
7108
  TD3DStatus = packed record
7116
  TD3DStatus = packed record
7109
    dwFlags: DWORD;        (* Do we set extents or status *)
7117
    dwFlags: DWORD;        (* Do we set extents or status *)
7110
    dwStatus: DWORD;       (* D3D status *)
7118
    dwStatus: DWORD;       (* D3D status *)
7111
    drExtent: TD3DRect;
7119
    drExtent: TD3DRect;
7112
  end;
7120
  end;
7113
 
7121
 
7114
const
7122
const
7115
  D3DSETSTATUS_STATUS    = $00000001;
7123
  D3DSETSTATUS_STATUS    = $00000001;
7116
  D3DSETSTATUS_EXTENTS   = $00000002;
7124
  D3DSETSTATUS_EXTENTS   = $00000002;
7117
  D3DSETSTATUS_ALL      = (D3DSETSTATUS_STATUS or D3DSETSTATUS_EXTENTS);
7125
  D3DSETSTATUS_ALL      = (D3DSETSTATUS_STATUS or D3DSETSTATUS_EXTENTS);
7118
 
7126
 
7119
type
7127
type
7120
  PD3DClipStatus = ^TD3DClipStatus;
7128
  PD3DClipStatus = ^TD3DClipStatus;
7121
  TD3DClipStatus = packed record
7129
  TD3DClipStatus = packed record
7122
    dwFlags : DWORD; (* Do we set 2d extents, 3D extents or status *)
7130
    dwFlags : DWORD; (* Do we set 2d extents, 3D extents or status *)
7123
    dwStatus : DWORD; (* Clip status *)
7131
    dwStatus : DWORD; (* Clip status *)
7124
    minx, maxx : float; (* X extents *)
7132
    minx, maxx : float; (* X extents *)
7125
    miny, maxy : float; (* Y extents *)
7133
    miny, maxy : float; (* Y extents *)
7126
    minz, maxz : float; (* Z extents *)
7134
    minz, maxz : float; (* Z extents *)
7127
  end;
7135
  end;
7128
 
7136
 
7129
const
7137
const
7130
  D3DCLIPSTATUS_STATUS        = $00000001;
7138
  D3DCLIPSTATUS_STATUS        = $00000001;
7131
  D3DCLIPSTATUS_EXTENTS2      = $00000002;
7139
  D3DCLIPSTATUS_EXTENTS2      = $00000002;
7132
  D3DCLIPSTATUS_EXTENTS3      = $00000004;
7140
  D3DCLIPSTATUS_EXTENTS3      = $00000004;
7133
 
7141
 
7134
(*
7142
(*
7135
 * Statistics structure
7143
 * Statistics structure
7136
 *)
7144
 *)
7137
type
7145
type
7138
  PD3DStats = ^TD3DStats;
7146
  PD3DStats = ^TD3DStats;
7139
  TD3DStats = packed record
7147
  TD3DStats = packed record
7140
    dwSize: DWORD;
7148
    dwSize: DWORD;
7141
    dwTrianglesDrawn: DWORD;
7149
    dwTrianglesDrawn: DWORD;
7142
    dwLinesDrawn: DWORD;
7150
    dwLinesDrawn: DWORD;
7143
    dwPointsDrawn: DWORD;
7151
    dwPointsDrawn: DWORD;
7144
    dwSpansDrawn: DWORD;
7152
    dwSpansDrawn: DWORD;
7145
    dwVerticesProcessed: DWORD;
7153
    dwVerticesProcessed: DWORD;
7146
  end;
7154
  end;
7147
 
7155
 
7148
(*
7156
(*
7149
 * Execute options.
7157
 * Execute options.
7150
 * When calling using D3DEXECUTE_UNCLIPPED all the primitives
7158
 * When calling using D3DEXECUTE_UNCLIPPED all the primitives
7151
 * inside the buffer must be contained within the viewport.
7159
 * inside the buffer must be contained within the viewport.
7152
 *)
7160
 *)
7153
const
7161
const
7154
  D3DEXECUTE_CLIPPED       = $00000001;
7162
  D3DEXECUTE_CLIPPED       = $00000001;
7155
  D3DEXECUTE_UNCLIPPED     = $00000002;
7163
  D3DEXECUTE_UNCLIPPED     = $00000002;
7156
 
7164
 
7157
type
7165
type
7158
  PD3DExecuteData = ^TD3DExecuteData;
7166
  PD3DExecuteData = ^TD3DExecuteData;
7159
  TD3DExecuteData = packed record
7167
  TD3DExecuteData = packed record
7160
    dwSize: DWORD;
7168
    dwSize: DWORD;
7161
    dwVertexOffset: DWORD;
7169
    dwVertexOffset: DWORD;
7162
    dwVertexCount: DWORD;
7170
    dwVertexCount: DWORD;
7163
    dwInstructionOffset: DWORD;
7171
    dwInstructionOffset: DWORD;
7164
    dwInstructionLength: DWORD;
7172
    dwInstructionLength: DWORD;
7165
    dwHVertexOffset: DWORD;
7173
    dwHVertexOffset: DWORD;
7166
    dsStatus: TD3DStatus;       (* Status after execute *)
7174
    dsStatus: TD3DStatus;       (* Status after execute *)
7167
  end;
7175
  end;
7168
 
7176
 
7169
(*
7177
(*
7170
 * Palette flags.
7178
 * Palette flags.
7171
 * This are or'ed with the peFlags in the PALETTEENTRYs passed to DirectDraw.
7179
 * This are or'ed with the peFlags in the PALETTEENTRYs passed to DirectDraw.
7172
 *)
7180
 *)
7173
 
7181
 
7174
const
7182
const
7175
  D3DPAL_FREE     = $00;    (* Renderer may use this entry freely *)
7183
  D3DPAL_FREE     = $00;    (* Renderer may use this entry freely *)
7176
  D3DPAL_READONLY = $40;    (* Renderer may not set this entry *)
7184
  D3DPAL_READONLY = $40;    (* Renderer may not set this entry *)
7177
  D3DPAL_RESERVED = $80;    (* Renderer may not use this entry *)
7185
  D3DPAL_RESERVED = $80;    (* Renderer may not use this entry *)
7178
 
7186
 
7179
 
7187
 
7180
type
7188
type
7181
  PD3DVertexBufferDesc = ^TD3DVertexBufferDesc;
7189
  PD3DVertexBufferDesc = ^TD3DVertexBufferDesc;
7182
  TD3DVertexBufferDesc = packed record
7190
  TD3DVertexBufferDesc = packed record
7183
    dwSize : DWORD;
7191
    dwSize : DWORD;
7184
    dwCaps : DWORD;
7192
    dwCaps : DWORD;
7185
    dwFVF : DWORD;
7193
    dwFVF : DWORD;
7186
    dwNumVertices : DWORD;
7194
    dwNumVertices : DWORD;
7187
  end;
7195
  end;
7188
 
7196
 
7189
const
7197
const
7190
(* These correspond to DDSCAPS_* flags *)
7198
(* These correspond to DDSCAPS_* flags *)
7191
  D3DVBCAPS_SYSTEMMEMORY      = $00000800;
7199
  D3DVBCAPS_SYSTEMMEMORY      = $00000800;
7192
  D3DVBCAPS_WRITEONLY         = $00010000;
7200
  D3DVBCAPS_WRITEONLY         = $00010000;
7193
  D3DVBCAPS_OPTIMIZED         = $80000000;
7201
  D3DVBCAPS_OPTIMIZED         = $80000000;
7194
  D3DVBCAPS_DONOTCLIP         = $00000001;
7202
  D3DVBCAPS_DONOTCLIP         = $00000001;
7195
 
7203
 
7196
(* Vertex Operations for ProcessVertices *)
7204
(* Vertex Operations for ProcessVertices *)
7197
  D3DVOP_LIGHT      = (1 shl 10);
7205
  D3DVOP_LIGHT      = (1 shl 10);
7198
  D3DVOP_TRANSFORM  = (1 shl 0);
7206
  D3DVOP_TRANSFORM  = (1 shl 0);
7199
  D3DVOP_CLIP       = (1 shl 2);
7207
  D3DVOP_CLIP       = (1 shl 2);
7200
  D3DVOP_EXTENTS    = (1 shl 3);
7208
  D3DVOP_EXTENTS    = (1 shl 3);
7201
 
7209
 
7202
(* The maximum number of vertices user can pass to any d3d
7210
(* The maximum number of vertices user can pass to any d3d
7203
   drawing function or to create vertex buffer with
7211
   drawing function or to create vertex buffer with
7204
*)
7212
*)
7205
  D3DMAXNUMVERTICES  =  ((1 shl 16) - 1);
7213
  D3DMAXNUMVERTICES  =  ((1 shl 16) - 1);
7206
(* The maximum number of primitives user can pass to any d3d
7214
(* The maximum number of primitives user can pass to any d3d
7207
   drawing function.
7215
   drawing function.
7208
*)
7216
*)
7209
  D3DMAXNUMPRIMITIVES = ((1 shl 16) - 1);
7217
  D3DMAXNUMPRIMITIVES = ((1 shl 16) - 1);
7210
 
7218
 
7211
(* Bits for dwFlags in ProcessVertices call *)
7219
(* Bits for dwFlags in ProcessVertices call *)
7212
  D3DPV_DONOTCOPYDATA = (1 shl 0);
7220
  D3DPV_DONOTCOPYDATA = (1 shl 0);
7213
 
7221
 
7214
//-------------------------------------------------------------------
7222
//-------------------------------------------------------------------
7215
 
7223
 
7216
// Flexible vertex format bits
7224
// Flexible vertex format bits
7217
//
7225
//
7218
  D3DFVF_RESERVED0        = $001;
7226
  D3DFVF_RESERVED0        = $001;
7219
  D3DFVF_POSITION_MASK    = $00E;
7227
  D3DFVF_POSITION_MASK    = $00E;
7220
  D3DFVF_XYZ              = $002;
7228
  D3DFVF_XYZ              = $002;
7221
  D3DFVF_XYZRHW           = $004;
7229
  D3DFVF_XYZRHW           = $004;
7222
  D3DFVF_XYZB1            = $006;
7230
  D3DFVF_XYZB1            = $006;
7223
  D3DFVF_XYZB2            = $008;
7231
  D3DFVF_XYZB2            = $008;
7224
  D3DFVF_XYZB3            = $00a;
7232
  D3DFVF_XYZB3            = $00a;
7225
  D3DFVF_XYZB4            = $00c;
7233
  D3DFVF_XYZB4            = $00c;
7226
  D3DFVF_XYZB5            = $00e;
7234
  D3DFVF_XYZB5            = $00e;
7227
 
7235
 
7228
  D3DFVF_NORMAL           = $010;
7236
  D3DFVF_NORMAL           = $010;
7229
  D3DFVF_RESERVED1        = $020;
7237
  D3DFVF_RESERVED1        = $020;
7230
  D3DFVF_DIFFUSE          = $040;
7238
  D3DFVF_DIFFUSE          = $040;
7231
  D3DFVF_SPECULAR         = $080;
7239
  D3DFVF_SPECULAR         = $080;
7232
 
7240
 
7233
  D3DFVF_TEXCOUNT_MASK    = $f00;
7241
  D3DFVF_TEXCOUNT_MASK    = $f00;
7234
  D3DFVF_TEXCOUNT_SHIFT   = 8;
7242
  D3DFVF_TEXCOUNT_SHIFT   = 8;
7235
  D3DFVF_TEX0             = $000;
7243
  D3DFVF_TEX0             = $000;
7236
  D3DFVF_TEX1             = $100;
7244
  D3DFVF_TEX1             = $100;
7237
  D3DFVF_TEX2             = $200;
7245
  D3DFVF_TEX2             = $200;
7238
  D3DFVF_TEX3             = $300;
7246
  D3DFVF_TEX3             = $300;
7239
  D3DFVF_TEX4             = $400;
7247
  D3DFVF_TEX4             = $400;
7240
  D3DFVF_TEX5             = $500;
7248
  D3DFVF_TEX5             = $500;
7241
  D3DFVF_TEX6             = $600;
7249
  D3DFVF_TEX6             = $600;
7242
  D3DFVF_TEX7             = $700;
7250
  D3DFVF_TEX7             = $700;
7243
  D3DFVF_TEX8             = $800;
7251
  D3DFVF_TEX8             = $800;
7244
 
7252
 
7245
  D3DFVF_RESERVED2        = $f000;  // 4 reserved bits
7253
  D3DFVF_RESERVED2        = $f000;  // 4 reserved bits
7246
 
7254
 
7247
  D3DFVF_VERTEX = ( D3DFVF_XYZ or D3DFVF_NORMAL or D3DFVF_TEX1 );
7255
  D3DFVF_VERTEX = ( D3DFVF_XYZ or D3DFVF_NORMAL or D3DFVF_TEX1 );
7248
  D3DFVF_LVERTEX = ( D3DFVF_XYZ or D3DFVF_RESERVED1 or D3DFVF_DIFFUSE or
7256
  D3DFVF_LVERTEX = ( D3DFVF_XYZ or D3DFVF_RESERVED1 or D3DFVF_DIFFUSE or
7249
                         D3DFVF_SPECULAR or D3DFVF_TEX1 );
7257
                         D3DFVF_SPECULAR or D3DFVF_TEX1 );
7250
  D3DFVF_TLVERTEX = ( D3DFVF_XYZRHW or D3DFVF_DIFFUSE or D3DFVF_SPECULAR or
7258
  D3DFVF_TLVERTEX = ( D3DFVF_XYZRHW or D3DFVF_DIFFUSE or D3DFVF_SPECULAR or
7251
                          D3DFVF_TEX1 );
7259
                          D3DFVF_TEX1 );
7252
 
7260
 
7253
type
7261
type
7254
  PD3DDP_PtrStride = ^TD3DDP_PtrStride;
7262
  PD3DDP_PtrStride = ^TD3DDP_PtrStride;
7255
  TD3DDP_PtrStride = packed record
7263
  TD3DDP_PtrStride = packed record
7256
    lpvData : pointer;
7264
    lpvData : pointer;
7257
    dwStride : DWORD;
7265
    dwStride : DWORD;
7258
  end;
7266
  end;
7259
 
7267
 
7260
const
7268
const
7261
  D3DDP_MAXTEXCOORD = 8;
7269
  D3DDP_MAXTEXCOORD = 8;
7262
 
7270
 
7263
type
7271
type
7264
  PD3DDrawPrimitiveStridedData = ^TD3DDrawPrimitiveStridedData;
7272
  PD3DDrawPrimitiveStridedData = ^TD3DDrawPrimitiveStridedData;
7265
  TD3DDrawPrimitiveStridedData = packed record
7273
  TD3DDrawPrimitiveStridedData = packed record
7266
    position : TD3DDP_PtrStride;
7274
    position : TD3DDP_PtrStride;
7267
    normal : TD3DDP_PtrStride;
7275
    normal : TD3DDP_PtrStride;
7268
    diffuse : TD3DDP_PtrStride;
7276
    diffuse : TD3DDP_PtrStride;
7269
    specular : TD3DDP_PtrStride;
7277
    specular : TD3DDP_PtrStride;
7270
    textureCoords : array [0..D3DDP_MAXTEXCOORD-1] of TD3DDP_PtrStride;
7278
    textureCoords : array [0..D3DDP_MAXTEXCOORD-1] of TD3DDP_PtrStride;
7271
  end;
7279
  end;
7272
 
7280
 
7273
//---------------------------------------------------------------------
7281
//---------------------------------------------------------------------
7274
// ComputeSphereVisibility return values
7282
// ComputeSphereVisibility return values
7275
//
7283
//
7276
const
7284
const
7277
  D3DVIS_INSIDE_FRUSTUM      = 0;
7285
  D3DVIS_INSIDE_FRUSTUM      = 0;
7278
  D3DVIS_INTERSECT_FRUSTUM   = 1;
7286
  D3DVIS_INTERSECT_FRUSTUM   = 1;
7279
  D3DVIS_OUTSIDE_FRUSTUM     = 2;
7287
  D3DVIS_OUTSIDE_FRUSTUM     = 2;
7280
  D3DVIS_INSIDE_LEFT         = 0;
7288
  D3DVIS_INSIDE_LEFT         = 0;
7281
  D3DVIS_INTERSECT_LEFT      = (1 shl 2);
7289
  D3DVIS_INTERSECT_LEFT      = (1 shl 2);
7282
  D3DVIS_OUTSIDE_LEFT        = (2 shl 2);
7290
  D3DVIS_OUTSIDE_LEFT        = (2 shl 2);
7283
  D3DVIS_INSIDE_RIGHT        = 0;
7291
  D3DVIS_INSIDE_RIGHT        = 0;
7284
  D3DVIS_INTERSECT_RIGHT     = (1 shl 4);
7292
  D3DVIS_INTERSECT_RIGHT     = (1 shl 4);
7285
  D3DVIS_OUTSIDE_RIGHT       = (2 shl 4);
7293
  D3DVIS_OUTSIDE_RIGHT       = (2 shl 4);
7286
  D3DVIS_INSIDE_TOP          = 0;
7294
  D3DVIS_INSIDE_TOP          = 0;
7287
  D3DVIS_INTERSECT_TOP       = (1 shl 6);
7295
  D3DVIS_INTERSECT_TOP       = (1 shl 6);
7288
  D3DVIS_OUTSIDE_TOP         = (2 shl 6);
7296
  D3DVIS_OUTSIDE_TOP         = (2 shl 6);
7289
  D3DVIS_INSIDE_BOTTOM       = 0;
7297
  D3DVIS_INSIDE_BOTTOM       = 0;
7290
  D3DVIS_INTERSECT_BOTTOM    = (1 shl 8);
7298
  D3DVIS_INTERSECT_BOTTOM    = (1 shl 8);
7291
  D3DVIS_OUTSIDE_BOTTOM      = (2 shl 8);
7299
  D3DVIS_OUTSIDE_BOTTOM      = (2 shl 8);
7292
  D3DVIS_INSIDE_NEAR         = 0;
7300
  D3DVIS_INSIDE_NEAR         = 0;
7293
  D3DVIS_INTERSECT_NEAR      = (1 shl 10);
7301
  D3DVIS_INTERSECT_NEAR      = (1 shl 10);
7294
  D3DVIS_OUTSIDE_NEAR        = (2 shl 10);
7302
  D3DVIS_OUTSIDE_NEAR        = (2 shl 10);
7295
  D3DVIS_INSIDE_FAR          = 0;
7303
  D3DVIS_INSIDE_FAR          = 0;
7296
  D3DVIS_INTERSECT_FAR       = (1 shl 12);
7304
  D3DVIS_INTERSECT_FAR       = (1 shl 12);
7297
  D3DVIS_OUTSIDE_FAR         = (2 shl 12);
7305
  D3DVIS_OUTSIDE_FAR         = (2 shl 12);
7298
 
7306
 
7299
  D3DVIS_MASK_FRUSTUM        = (3 shl 0);
7307
  D3DVIS_MASK_FRUSTUM        = (3 shl 0);
7300
  D3DVIS_MASK_LEFT           = (3 shl 2);
7308
  D3DVIS_MASK_LEFT           = (3 shl 2);
7301
  D3DVIS_MASK_RIGHT          = (3 shl 4);
7309
  D3DVIS_MASK_RIGHT          = (3 shl 4);
7302
  D3DVIS_MASK_TOP            = (3 shl 6);
7310
  D3DVIS_MASK_TOP            = (3 shl 6);
7303
  D3DVIS_MASK_BOTTOM         = (3 shl 8);
7311
  D3DVIS_MASK_BOTTOM         = (3 shl 8);
7304
  D3DVIS_MASK_NEAR           = (3 shl 10);
7312
  D3DVIS_MASK_NEAR           = (3 shl 10);
7305
  D3DVIS_MASK_FAR            = (3 shl 12);
7313
  D3DVIS_MASK_FAR            = (3 shl 12);
7306
 
7314
 
7307
// To be used with GetInfo()
7315
// To be used with GetInfo()
7308
  D3DDEVINFOID_TEXTUREMANAGER    = 1;
7316
  D3DDEVINFOID_TEXTUREMANAGER    = 1;
7309
  D3DDEVINFOID_D3DTEXTUREMANAGER = 2;
7317
  D3DDEVINFOID_D3DTEXTUREMANAGER = 2;
7310
  D3DDEVINFOID_TEXTURING         = 3;
7318
  D3DDEVINFOID_TEXTURING         = 3;
7311
 
7319
 
7312
type
7320
type
7313
  PD3DStateBlockType = ^TD3DStateBlockType;
7321
  PD3DStateBlockType = ^TD3DStateBlockType;
7314
  TD3DStateBlockType = (
7322
  TD3DStateBlockType = (
7315
    D3DSBT_INVALID_0   ,
7323
    D3DSBT_INVALID_0   ,
7316
    D3DSBT_ALL         , // capture all state
7324
    D3DSBT_ALL         , // capture all state
7317
    D3DSBT_PIXELSTATE  , // capture pixel state
7325
    D3DSBT_PIXELSTATE  , // capture pixel state
7318
    D3DSBT_VERTEXSTATE   // capture vertex state
7326
    D3DSBT_VERTEXSTATE   // capture vertex state
7319
  );
7327
  );
7320
 
7328
 
7321
// The D3DVERTEXBLENDFLAGS type is used with D3DRENDERSTATE_VERTEXBLEND state.
7329
// The D3DVERTEXBLENDFLAGS type is used with D3DRENDERSTATE_VERTEXBLEND state.
7322
//
7330
//
7323
  PD3DVertexBlendFlags = ^TD3DVertexBlendFlags;
7331
  PD3DVertexBlendFlags = ^TD3DVertexBlendFlags;
7324
  TD3DVertexBlendFlags = (
7332
  TD3DVertexBlendFlags = (
7325
    D3DVBLEND_DISABLE , // Disable vertex blending
7333
    D3DVBLEND_DISABLE , // Disable vertex blending
7326
    D3DVBLEND_1WEIGHT , // blend between 2 matrices
7334
    D3DVBLEND_1WEIGHT , // blend between 2 matrices
7327
    D3DVBLEND_2WEIGHTS, // blend between 3 matrices
7335
    D3DVBLEND_2WEIGHTS, // blend between 3 matrices
7328
    D3DVBLEND_3WEIGHTS  // blend between 4 matrices
7336
    D3DVBLEND_3WEIGHTS  // blend between 4 matrices
7329
  );
7337
  );
7330
 
7338
 
7331
  PD3DTextureTransformFlags = ^TD3DTextureTransformFlags;
7339
  PD3DTextureTransformFlags = ^TD3DTextureTransformFlags;
7332
  TD3DTextureTransformFlags = (
7340
  TD3DTextureTransformFlags = (
7333
    D3DTTFF_DISABLE ,    // texture coordinates are passed directly
7341
    D3DTTFF_DISABLE ,    // texture coordinates are passed directly
7334
    D3DTTFF_COUNT1  ,    // rasterizer should expect 1-D texture coords
7342
    D3DTTFF_COUNT1  ,    // rasterizer should expect 1-D texture coords
7335
    D3DTTFF_COUNT2  ,    // rasterizer should expect 2-D texture coords
7343
    D3DTTFF_COUNT2  ,    // rasterizer should expect 2-D texture coords
7336
    D3DTTFF_COUNT3  ,    // rasterizer should expect 3-D texture coords
7344
    D3DTTFF_COUNT3  ,    // rasterizer should expect 3-D texture coords
7337
    D3DTTFF_COUNT4       // rasterizer should expect 4-D texture coords
7345
    D3DTTFF_COUNT4       // rasterizer should expect 4-D texture coords
7338
  );
7346
  );
7339
 
7347
 
7340
const
7348
const
7341
  D3DTTFF_PROJECTED       = TD3DTextureTransformFlags(256); // texcoords to be divided by COUNTth element
7349
  D3DTTFF_PROJECTED       = TD3DTextureTransformFlags(256); // texcoords to be divided by COUNTth element
7342
 
7350
 
7343
// Macros to set texture coordinate format bits in the FVF id
7351
// Macros to set texture coordinate format bits in the FVF id
7344
 
7352
 
7345
D3DFVF_TEXTUREFORMAT2 = 0;         // Two floating point values
7353
D3DFVF_TEXTUREFORMAT2 = 0;         // Two floating point values
7346
D3DFVF_TEXTUREFORMAT1 = 3;         // One floating point value
7354
D3DFVF_TEXTUREFORMAT1 = 3;         // One floating point value
7347
D3DFVF_TEXTUREFORMAT3 = 1;         // Three floating point values
7355
D3DFVF_TEXTUREFORMAT3 = 1;         // Three floating point values
7348
D3DFVF_TEXTUREFORMAT4 = 2;         // Four floating point values
7356
D3DFVF_TEXTUREFORMAT4 = 2;         // Four floating point values
7349
 
7357
 
7350
function D3DFVF_TEXCOORDSIZE3(CoordIndex: DWORD) : DWORD;
7358
function D3DFVF_TEXCOORDSIZE3(CoordIndex: DWORD) : DWORD;
7351
function D3DFVF_TEXCOORDSIZE2(CoordIndex: DWORD) : DWORD;
7359
function D3DFVF_TEXCOORDSIZE2(CoordIndex: DWORD) : DWORD;
7352
function D3DFVF_TEXCOORDSIZE4(CoordIndex: DWORD) : DWORD;
7360
function D3DFVF_TEXCOORDSIZE4(CoordIndex: DWORD) : DWORD;
7353
function D3DFVF_TEXCOORDSIZE1(CoordIndex: DWORD) : DWORD;
7361
function D3DFVF_TEXCOORDSIZE1(CoordIndex: DWORD) : DWORD;
7354
 
7362
 
7355
(*==========================================================================;
7363
(*==========================================================================;
7356
 *
7364
 *
7357
 *
7365
 *
7358
 *  File:       d3dcaps.h
7366
 *  File:       d3dcaps.h
7359
 *  Content:    Direct3D capabilities include file
7367
 *  Content:    Direct3D capabilities include file
7360
 *
7368
 *
7361
 ***************************************************************************)
7369
 ***************************************************************************)
7362
 
7370
 
7363
(* Description of capabilities of transform *)
7371
(* Description of capabilities of transform *)
7364
 
7372
 
7365
type
7373
type
7366
  PD3DTransformCaps = ^TD3DTransformCaps;
7374
  PD3DTransformCaps = ^TD3DTransformCaps;
7367
  TD3DTransformCaps = packed record
7375
  TD3DTransformCaps = packed record
7368
    dwSize: DWORD;
7376
    dwSize: DWORD;
7369
    dwCaps: DWORD;
7377
    dwCaps: DWORD;
7370
  end;
7378
  end;
7371
 
7379
 
7372
const
7380
const
7373
  D3DTRANSFORMCAPS_CLIP         = $00000001; (* Will clip whilst transforming *)
7381
  D3DTRANSFORMCAPS_CLIP         = $00000001; (* Will clip whilst transforming *)
7374
 
7382
 
7375
(* Description of capabilities of lighting *)
7383
(* Description of capabilities of lighting *)
7376
 
7384
 
7377
type
7385
type
7378
  PD3DLightingCaps = ^TD3DLightingCaps;
7386
  PD3DLightingCaps = ^TD3DLightingCaps;
7379
  TD3DLightingCaps = packed record
7387
  TD3DLightingCaps = packed record
7380
    dwSize: DWORD;
7388
    dwSize: DWORD;
7381
    dwCaps: DWORD;                   (* Lighting caps *)
7389
    dwCaps: DWORD;                   (* Lighting caps *)
7382
    dwLightingModel: DWORD;          (* Lighting model - RGB or mono *)
7390
    dwLightingModel: DWORD;          (* Lighting model - RGB or mono *)
7383
    dwNumLights: DWORD;              (* Number of lights that can be handled *)
7391
    dwNumLights: DWORD;              (* Number of lights that can be handled *)
7384
  end;
7392
  end;
7385
 
7393
 
7386
const
7394
const
7387
  D3DLIGHTINGMODEL_RGB            = $00000001;
7395
  D3DLIGHTINGMODEL_RGB            = $00000001;
7388
  D3DLIGHTINGMODEL_MONO           = $00000002;
7396
  D3DLIGHTINGMODEL_MONO           = $00000002;
7389
 
7397
 
7390
  D3DLIGHTCAPS_POINT              = $00000001; (* Point lights supported *)
7398
  D3DLIGHTCAPS_POINT              = $00000001; (* Point lights supported *)
7391
  D3DLIGHTCAPS_SPOT               = $00000002; (* Spot lights supported *)
7399
  D3DLIGHTCAPS_SPOT               = $00000002; (* Spot lights supported *)
7392
  D3DLIGHTCAPS_DIRECTIONAL        = $00000004; (* Directional lights supported *)
7400
  D3DLIGHTCAPS_DIRECTIONAL        = $00000004; (* Directional lights supported *)
7393
  D3DLIGHTCAPS_PARALLELPOINT      = $00000008; (* Parallel point lights supported *)
7401
  D3DLIGHTCAPS_PARALLELPOINT      = $00000008; (* Parallel point lights supported *)
7394
  D3DLIGHTCAPS_GLSPOT             = $00000010; (* GL syle spot lights supported *)
7402
  D3DLIGHTCAPS_GLSPOT             = $00000010; (* GL syle spot lights supported *)
7395
 
7403
 
7396
(* Description of capabilities for each primitive type *)
7404
(* Description of capabilities for each primitive type *)
7397
 
7405
 
7398
type
7406
type
7399
  PD3DPrimCaps = ^TD3DPrimCaps;
7407
  PD3DPrimCaps = ^TD3DPrimCaps;
7400
  TD3DPrimCaps = packed record
7408
  TD3DPrimCaps = packed record
7401
    dwSize: DWORD;
7409
    dwSize: DWORD;
7402
    dwMiscCaps: DWORD;                 (* Capability flags *)
7410
    dwMiscCaps: DWORD;                 (* Capability flags *)
7403
    dwRasterCaps: DWORD;
7411
    dwRasterCaps: DWORD;
7404
    dwZCmpCaps: DWORD;
7412
    dwZCmpCaps: DWORD;
7405
    dwSrcBlendCaps: DWORD;
7413
    dwSrcBlendCaps: DWORD;
7406
    dwDestBlendCaps: DWORD;
7414
    dwDestBlendCaps: DWORD;
7407
    dwAlphaCmpCaps: DWORD;
7415
    dwAlphaCmpCaps: DWORD;
7408
    dwShadeCaps: DWORD;
7416
    dwShadeCaps: DWORD;
7409
    dwTextureCaps: DWORD;
7417
    dwTextureCaps: DWORD;
7410
    dwTextureFilterCaps: DWORD;
7418
    dwTextureFilterCaps: DWORD;
7411
    dwTextureBlendCaps: DWORD;
7419
    dwTextureBlendCaps: DWORD;
7412
    dwTextureAddressCaps: DWORD;
7420
    dwTextureAddressCaps: DWORD;
7413
    dwStippleWidth: DWORD;             (* maximum width and height of *)
7421
    dwStippleWidth: DWORD;             (* maximum width and height of *)
7414
    dwStippleHeight: DWORD;            (* of supported stipple (up to 32x32) *)
7422
    dwStippleHeight: DWORD;            (* of supported stipple (up to 32x32) *)
7415
  end;
7423
  end;
7416
 
7424
 
7417
const
7425
const
7418
(* TD3DPrimCaps dwMiscCaps *)
7426
(* TD3DPrimCaps dwMiscCaps *)
7419
 
7427
 
7420
  D3DPMISCCAPS_MASKPLANES         = $00000001;
7428
  D3DPMISCCAPS_MASKPLANES         = $00000001;
7421
  D3DPMISCCAPS_MASKZ              = $00000002;
7429
  D3DPMISCCAPS_MASKZ              = $00000002;
7422
  D3DPMISCCAPS_LINEPATTERNREP     = $00000004;
7430
  D3DPMISCCAPS_LINEPATTERNREP     = $00000004;
7423
  D3DPMISCCAPS_CONFORMANT         = $00000008;
7431
  D3DPMISCCAPS_CONFORMANT         = $00000008;
7424
  D3DPMISCCAPS_CULLNONE           = $00000010;
7432
  D3DPMISCCAPS_CULLNONE           = $00000010;
7425
  D3DPMISCCAPS_CULLCW             = $00000020;
7433
  D3DPMISCCAPS_CULLCW             = $00000020;
7426
  D3DPMISCCAPS_CULLCCW            = $00000040;
7434
  D3DPMISCCAPS_CULLCCW            = $00000040;
7427
 
7435
 
7428
(* TD3DPrimCaps dwRasterCaps *)
7436
(* TD3DPrimCaps dwRasterCaps *)
7429
 
7437
 
7430
  D3DPRASTERCAPS_DITHER           = $00000001;
7438
  D3DPRASTERCAPS_DITHER           = $00000001;
7431
  D3DPRASTERCAPS_ROP2             = $00000002;
7439
  D3DPRASTERCAPS_ROP2             = $00000002;
7432
  D3DPRASTERCAPS_XOR              = $00000004;
7440
  D3DPRASTERCAPS_XOR              = $00000004;
7433
  D3DPRASTERCAPS_PAT              = $00000008;
7441
  D3DPRASTERCAPS_PAT              = $00000008;
7434
  D3DPRASTERCAPS_ZTEST            = $00000010;
7442
  D3DPRASTERCAPS_ZTEST            = $00000010;
7435
  D3DPRASTERCAPS_SUBPIXEL         = $00000020;
7443
  D3DPRASTERCAPS_SUBPIXEL         = $00000020;
7436
  D3DPRASTERCAPS_SUBPIXELX        = $00000040;
7444
  D3DPRASTERCAPS_SUBPIXELX        = $00000040;
7437
  D3DPRASTERCAPS_FOGVERTEX        = $00000080;
7445
  D3DPRASTERCAPS_FOGVERTEX        = $00000080;
7438
  D3DPRASTERCAPS_FOGTABLE         = $00000100;
7446
  D3DPRASTERCAPS_FOGTABLE         = $00000100;
7439
  D3DPRASTERCAPS_STIPPLE          = $00000200;
7447
  D3DPRASTERCAPS_STIPPLE          = $00000200;
7440
  D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT   = $00000400;
7448
  D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT   = $00000400;
7441
  D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT = $00000800;
7449
  D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT = $00000800;
7442
  D3DPRASTERCAPS_ANTIALIASEDGES           = $00001000;
7450
  D3DPRASTERCAPS_ANTIALIASEDGES           = $00001000;
7443
  D3DPRASTERCAPS_MIPMAPLODBIAS            = $00002000;
7451
  D3DPRASTERCAPS_MIPMAPLODBIAS            = $00002000;
7444
  D3DPRASTERCAPS_ZBIAS                    = $00004000;
7452
  D3DPRASTERCAPS_ZBIAS                    = $00004000;
7445
  D3DPRASTERCAPS_ZBUFFERLESSHSR           = $00008000;
7453
  D3DPRASTERCAPS_ZBUFFERLESSHSR           = $00008000;
7446
  D3DPRASTERCAPS_FOGRANGE                 = $00010000;
7454
  D3DPRASTERCAPS_FOGRANGE                 = $00010000;
7447
  D3DPRASTERCAPS_ANISOTROPY               = $00020000;
7455
  D3DPRASTERCAPS_ANISOTROPY               = $00020000;
7448
  D3DPRASTERCAPS_WBUFFER                      = $00040000;
7456
  D3DPRASTERCAPS_WBUFFER                      = $00040000;
7449
  D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT   = $00080000;
7457
  D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT   = $00080000;
7450
  D3DPRASTERCAPS_WFOG                         = $00100000;
7458
  D3DPRASTERCAPS_WFOG                         = $00100000;
7451
  D3DPRASTERCAPS_ZFOG                         = $00200000;
7459
  D3DPRASTERCAPS_ZFOG                         = $00200000;
7452
 
7460
 
7453
(* TD3DPrimCaps dwZCmpCaps, dwAlphaCmpCaps *)
7461
(* TD3DPrimCaps dwZCmpCaps, dwAlphaCmpCaps *)
7454
 
7462
 
7455
const
7463
const
7456
  D3DPCMPCAPS_NEVER               = $00000001;
7464
  D3DPCMPCAPS_NEVER               = $00000001;
7457
  D3DPCMPCAPS_LESS                = $00000002;
7465
  D3DPCMPCAPS_LESS                = $00000002;
7458
  D3DPCMPCAPS_EQUAL               = $00000004;
7466
  D3DPCMPCAPS_EQUAL               = $00000004;
7459
  D3DPCMPCAPS_LESSEQUAL           = $00000008;
7467
  D3DPCMPCAPS_LESSEQUAL           = $00000008;
7460
  D3DPCMPCAPS_GREATER             = $00000010;
7468
  D3DPCMPCAPS_GREATER             = $00000010;
7461
  D3DPCMPCAPS_NOTEQUAL            = $00000020;
7469
  D3DPCMPCAPS_NOTEQUAL            = $00000020;
7462
  D3DPCMPCAPS_GREATEREQUAL        = $00000040;
7470
  D3DPCMPCAPS_GREATEREQUAL        = $00000040;
7463
  D3DPCMPCAPS_ALWAYS              = $00000080;
7471
  D3DPCMPCAPS_ALWAYS              = $00000080;
7464
 
7472
 
7465
(* TD3DPrimCaps dwSourceBlendCaps, dwDestBlendCaps *)
7473
(* TD3DPrimCaps dwSourceBlendCaps, dwDestBlendCaps *)
7466
 
7474
 
7467
  D3DPBLENDCAPS_ZERO              = $00000001;
7475
  D3DPBLENDCAPS_ZERO              = $00000001;
7468
  D3DPBLENDCAPS_ONE               = $00000002;
7476
  D3DPBLENDCAPS_ONE               = $00000002;
7469
  D3DPBLENDCAPS_SRCCOLOR          = $00000004;
7477
  D3DPBLENDCAPS_SRCCOLOR          = $00000004;
7470
  D3DPBLENDCAPS_INVSRCCOLOR       = $00000008;
7478
  D3DPBLENDCAPS_INVSRCCOLOR       = $00000008;
7471
  D3DPBLENDCAPS_SRCALPHA          = $00000010;
7479
  D3DPBLENDCAPS_SRCALPHA          = $00000010;
7472
  D3DPBLENDCAPS_INVSRCALPHA       = $00000020;
7480
  D3DPBLENDCAPS_INVSRCALPHA       = $00000020;
7473
  D3DPBLENDCAPS_DESTALPHA         = $00000040;
7481
  D3DPBLENDCAPS_DESTALPHA         = $00000040;
7474
  D3DPBLENDCAPS_INVDESTALPHA      = $00000080;
7482
  D3DPBLENDCAPS_INVDESTALPHA      = $00000080;
7475
  D3DPBLENDCAPS_DESTCOLOR         = $00000100;
7483
  D3DPBLENDCAPS_DESTCOLOR         = $00000100;
7476
  D3DPBLENDCAPS_INVDESTCOLOR      = $00000200;
7484
  D3DPBLENDCAPS_INVDESTCOLOR      = $00000200;
7477
  D3DPBLENDCAPS_SRCALPHASAT       = $00000400;
7485
  D3DPBLENDCAPS_SRCALPHASAT       = $00000400;
7478
  D3DPBLENDCAPS_BOTHSRCALPHA      = $00000800;
7486
  D3DPBLENDCAPS_BOTHSRCALPHA      = $00000800;
7479
  D3DPBLENDCAPS_BOTHINVSRCALPHA   = $00001000;
7487
  D3DPBLENDCAPS_BOTHINVSRCALPHA   = $00001000;
7480
 
7488
 
7481
(* TD3DPrimCaps dwShadeCaps *)
7489
(* TD3DPrimCaps dwShadeCaps *)
7482
 
7490
 
7483
  D3DPSHADECAPS_COLORFLATMONO             = $00000001;
7491
  D3DPSHADECAPS_COLORFLATMONO             = $00000001;
7484
  D3DPSHADECAPS_COLORFLATRGB              = $00000002;
7492
  D3DPSHADECAPS_COLORFLATRGB              = $00000002;
7485
  D3DPSHADECAPS_COLORGOURAUDMONO          = $00000004;
7493
  D3DPSHADECAPS_COLORGOURAUDMONO          = $00000004;
7486
  D3DPSHADECAPS_COLORGOURAUDRGB           = $00000008;
7494
  D3DPSHADECAPS_COLORGOURAUDRGB           = $00000008;
7487
  D3DPSHADECAPS_COLORPHONGMONO            = $00000010;
7495
  D3DPSHADECAPS_COLORPHONGMONO            = $00000010;
7488
  D3DPSHADECAPS_COLORPHONGRGB             = $00000020;
7496
  D3DPSHADECAPS_COLORPHONGRGB             = $00000020;
7489
 
7497
 
7490
  D3DPSHADECAPS_SPECULARFLATMONO          = $00000040;
7498
  D3DPSHADECAPS_SPECULARFLATMONO          = $00000040;
7491
  D3DPSHADECAPS_SPECULARFLATRGB           = $00000080;
7499
  D3DPSHADECAPS_SPECULARFLATRGB           = $00000080;
7492
  D3DPSHADECAPS_SPECULARGOURAUDMONO       = $00000100;
7500
  D3DPSHADECAPS_SPECULARGOURAUDMONO       = $00000100;
7493
  D3DPSHADECAPS_SPECULARGOURAUDRGB        = $00000200;
7501
  D3DPSHADECAPS_SPECULARGOURAUDRGB        = $00000200;
7494
  D3DPSHADECAPS_SPECULARPHONGMONO         = $00000400;
7502
  D3DPSHADECAPS_SPECULARPHONGMONO         = $00000400;
7495
  D3DPSHADECAPS_SPECULARPHONGRGB          = $00000800;
7503
  D3DPSHADECAPS_SPECULARPHONGRGB          = $00000800;
7496
 
7504
 
7497
  D3DPSHADECAPS_ALPHAFLATBLEND            = $00001000;
7505
  D3DPSHADECAPS_ALPHAFLATBLEND            = $00001000;
7498
  D3DPSHADECAPS_ALPHAFLATSTIPPLED         = $00002000;
7506
  D3DPSHADECAPS_ALPHAFLATSTIPPLED         = $00002000;
7499
  D3DPSHADECAPS_ALPHAGOURAUDBLEND         = $00004000;
7507
  D3DPSHADECAPS_ALPHAGOURAUDBLEND         = $00004000;
7500
  D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED      = $00008000;
7508
  D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED      = $00008000;
7501
  D3DPSHADECAPS_ALPHAPHONGBLEND           = $00010000;
7509
  D3DPSHADECAPS_ALPHAPHONGBLEND           = $00010000;
7502
  D3DPSHADECAPS_ALPHAPHONGSTIPPLED        = $00020000;
7510
  D3DPSHADECAPS_ALPHAPHONGSTIPPLED        = $00020000;
7503
 
7511
 
7504
  D3DPSHADECAPS_FOGFLAT                   = $00040000;
7512
  D3DPSHADECAPS_FOGFLAT                   = $00040000;
7505
  D3DPSHADECAPS_FOGGOURAUD                = $00080000;
7513
  D3DPSHADECAPS_FOGGOURAUD                = $00080000;
7506
  D3DPSHADECAPS_FOGPHONG                  = $00100000;
7514
  D3DPSHADECAPS_FOGPHONG                  = $00100000;
7507
 
7515
 
7508
(* TD3DPrimCaps dwTextureCaps *)
7516
(* TD3DPrimCaps dwTextureCaps *)
7509
 
7517
 
7510
(*
7518
(*
7511
 * Perspective-correct texturing is supported
7519
 * Perspective-correct texturing is supported
7512
 *)
7520
 *)
7513
  D3DPTEXTURECAPS_PERSPECTIVE     = $00000001;
7521
  D3DPTEXTURECAPS_PERSPECTIVE     = $00000001;
7514
 
7522
 
7515
(*
7523
(*
7516
 * Power-of-2 texture dimensions are required
7524
 * Power-of-2 texture dimensions are required
7517
 *)
7525
 *)
7518
  D3DPTEXTURECAPS_POW2            = $00000002;
7526
  D3DPTEXTURECAPS_POW2            = $00000002;
7519
 
7527
 
7520
(*
7528
(*
7521
 * Alpha in texture pixels is supported
7529
 * Alpha in texture pixels is supported
7522
 *)
7530
 *)
7523
  D3DPTEXTURECAPS_ALPHA           = $00000004;
7531
  D3DPTEXTURECAPS_ALPHA           = $00000004;
7524
 
7532
 
7525
(*
7533
(*
7526
 * Color-keyed textures are supported
7534
 * Color-keyed textures are supported
7527
 *)
7535
 *)
7528
  D3DPTEXTURECAPS_TRANSPARENCY    = $00000008;
7536
  D3DPTEXTURECAPS_TRANSPARENCY    = $00000008;
7529
 
7537
 
7530
(*
7538
(*
7531
 * obsolete, see D3DPTADDRESSCAPS_BORDER
7539
 * obsolete, see D3DPTADDRESSCAPS_BORDER
7532
 *)
7540
 *)
7533
  D3DPTEXTURECAPS_BORDER          = $00000010;
7541
  D3DPTEXTURECAPS_BORDER          = $00000010;
7534
 
7542
 
7535
(*
7543
(*
7536
 * Only square textures are supported
7544
 * Only square textures are supported
7537
 *)
7545
 *)
7538
  D3DPTEXTURECAPS_SQUAREONLY      = $00000020;
7546
  D3DPTEXTURECAPS_SQUAREONLY      = $00000020;
7539
 
7547
 
7540
(*
7548
(*
7541
 * Texture indices are not scaled by the texture size prior
7549
 * Texture indices are not scaled by the texture size prior
7542
 * to interpolation.
7550
 * to interpolation.
7543
 *)
7551
 *)
7544
  D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE = $00000040;
7552
  D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE = $00000040;
7545
 
7553
 
7546
(*
7554
(*
7547
 * Device can draw alpha from texture palettes
7555
 * Device can draw alpha from texture palettes
7548
 *)
7556
 *)
7549
  D3DPTEXTURECAPS_ALPHAPALETTE    = $00000080;
7557
  D3DPTEXTURECAPS_ALPHAPALETTE    = $00000080;
7550
 
7558
 
7551
(*
7559
(*
7552
 * Device can use non-POW2 textures if:
7560
 * Device can use non-POW2 textures if:
7553
 *  1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage
7561
 *  1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage
7554
 *  2) D3DRS_WRAP(N) is zero for this texture's coordinates
7562
 *  2) D3DRS_WRAP(N) is zero for this texture's coordinates
7555
 *  3) mip mapping is not enabled (use magnification filter only)
7563
 *  3) mip mapping is not enabled (use magnification filter only)
7556
 *)
7564
 *)
7557
  D3DPTEXTURECAPS_NONPOW2CONDITIONAL  = $00000100;
7565
  D3DPTEXTURECAPS_NONPOW2CONDITIONAL  = $00000100;
7558
 
7566
 
7559
// 0x00000200L unused
7567
// 0x00000200L unused
7560
 
7568
 
7561
(*
7569
(*
7562
 * Device can divide transformed texture coordinates by the
7570
 * Device can divide transformed texture coordinates by the
7563
 * COUNTth texture coordinate (can do D3DTTFF_PROJECTED)
7571
 * COUNTth texture coordinate (can do D3DTTFF_PROJECTED)
7564
 *)
7572
 *)
7565
  D3DPTEXTURECAPS_PROJECTED  = $00000400;
7573
  D3DPTEXTURECAPS_PROJECTED  = $00000400;
7566
 
7574
 
7567
(*
7575
(*
7568
 * Device can do cubemap textures
7576
 * Device can do cubemap textures
7569
 *)
7577
 *)
7570
  D3DPTEXTURECAPS_CUBEMAP           = $00000800;
7578
  D3DPTEXTURECAPS_CUBEMAP           = $00000800;
7571
 
7579
 
7572
  D3DPTEXTURECAPS_COLORKEYBLEND     = $00001000;
7580
  D3DPTEXTURECAPS_COLORKEYBLEND     = $00001000;
7573
 
7581
 
7574
 
7582
 
7575
(* TD3DPrimCaps dwTextureFilterCaps *)
7583
(* TD3DPrimCaps dwTextureFilterCaps *)
7576
 
7584
 
7577
  D3DPTFILTERCAPS_NEAREST         = $00000001;
7585
  D3DPTFILTERCAPS_NEAREST         = $00000001;
7578
  D3DPTFILTERCAPS_LINEAR          = $00000002;
7586
  D3DPTFILTERCAPS_LINEAR          = $00000002;
7579
  D3DPTFILTERCAPS_MIPNEAREST      = $00000004;
7587
  D3DPTFILTERCAPS_MIPNEAREST      = $00000004;
7580
  D3DPTFILTERCAPS_MIPLINEAR       = $00000008;
7588
  D3DPTFILTERCAPS_MIPLINEAR       = $00000008;
7581
  D3DPTFILTERCAPS_LINEARMIPNEAREST = $00000010;
7589
  D3DPTFILTERCAPS_LINEARMIPNEAREST = $00000010;
7582
  D3DPTFILTERCAPS_LINEARMIPLINEAR = $00000020;
7590
  D3DPTFILTERCAPS_LINEARMIPLINEAR = $00000020;
7583
 
7591
 
7584
(* Device3 Min Filter *)
7592
(* Device3 Min Filter *)
7585
  D3DPTFILTERCAPS_MINFPOINT       = $00000100;
7593
  D3DPTFILTERCAPS_MINFPOINT       = $00000100;
7586
  D3DPTFILTERCAPS_MINFLINEAR      = $00000200;
7594
  D3DPTFILTERCAPS_MINFLINEAR      = $00000200;
7587
  D3DPTFILTERCAPS_MINFANISOTROPIC = $00000400;
7595
  D3DPTFILTERCAPS_MINFANISOTROPIC = $00000400;
7588
 
7596
 
7589
(* Device3 Mip Filter *)
7597
(* Device3 Mip Filter *)
7590
  D3DPTFILTERCAPS_MIPFPOINT       = $00010000;
7598
  D3DPTFILTERCAPS_MIPFPOINT       = $00010000;
7591
  D3DPTFILTERCAPS_MIPFLINEAR      = $00020000;
7599
  D3DPTFILTERCAPS_MIPFLINEAR      = $00020000;
7592
 
7600
 
7593
(* Device3 Mag Filter *)
7601
(* Device3 Mag Filter *)
7594
  D3DPTFILTERCAPS_MAGFPOINT         = $01000000;
7602
  D3DPTFILTERCAPS_MAGFPOINT         = $01000000;
7595
  D3DPTFILTERCAPS_MAGFLINEAR        = $02000000;
7603
  D3DPTFILTERCAPS_MAGFLINEAR        = $02000000;
7596
  D3DPTFILTERCAPS_MAGFANISOTROPIC   = $04000000;
7604
  D3DPTFILTERCAPS_MAGFANISOTROPIC   = $04000000;
7597
  D3DPTFILTERCAPS_MAGFAFLATCUBIC    = $08000000;
7605
  D3DPTFILTERCAPS_MAGFAFLATCUBIC    = $08000000;
7598
  D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC = $10000000;
7606
  D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC = $10000000;
7599
 
7607
 
7600
(* TD3DPrimCaps dwTextureBlendCaps *)
7608
(* TD3DPrimCaps dwTextureBlendCaps *)
7601
 
7609
 
7602
  D3DPTBLENDCAPS_DECAL            = $00000001;
7610
  D3DPTBLENDCAPS_DECAL            = $00000001;
7603
  D3DPTBLENDCAPS_MODULATE         = $00000002;
7611
  D3DPTBLENDCAPS_MODULATE         = $00000002;
7604
  D3DPTBLENDCAPS_DECALALPHA       = $00000004;
7612
  D3DPTBLENDCAPS_DECALALPHA       = $00000004;
7605
  D3DPTBLENDCAPS_MODULATEALPHA    = $00000008;
7613
  D3DPTBLENDCAPS_MODULATEALPHA    = $00000008;
7606
  D3DPTBLENDCAPS_DECALMASK        = $00000010;
7614
  D3DPTBLENDCAPS_DECALMASK        = $00000010;
7607
  D3DPTBLENDCAPS_MODULATEMASK     = $00000020;
7615
  D3DPTBLENDCAPS_MODULATEMASK     = $00000020;
7608
  D3DPTBLENDCAPS_COPY             = $00000040;
7616
  D3DPTBLENDCAPS_COPY             = $00000040;
7609
  D3DPTBLENDCAPS_ADD                      = $00000080;
7617
  D3DPTBLENDCAPS_ADD                      = $00000080;
7610
 
7618
 
7611
(* TD3DPrimCaps dwTextureAddressCaps *)
7619
(* TD3DPrimCaps dwTextureAddressCaps *)
7612
  D3DPTADDRESSCAPS_WRAP           = $00000001;
7620
  D3DPTADDRESSCAPS_WRAP           = $00000001;
7613
  D3DPTADDRESSCAPS_MIRROR         = $00000002;
7621
  D3DPTADDRESSCAPS_MIRROR         = $00000002;
7614
  D3DPTADDRESSCAPS_CLAMP          = $00000004;
7622
  D3DPTADDRESSCAPS_CLAMP          = $00000004;
7615
  D3DPTADDRESSCAPS_BORDER         = $00000008;
7623
  D3DPTADDRESSCAPS_BORDER         = $00000008;
7616
  D3DPTADDRESSCAPS_INDEPENDENTUV  = $00000010;
7624
  D3DPTADDRESSCAPS_INDEPENDENTUV  = $00000010;
7617
 
7625
 
7618
(* D3DDEVICEDESC dwStencilCaps *)
7626
(* D3DDEVICEDESC dwStencilCaps *)
7619
 
7627
 
7620
  D3DSTENCILCAPS_KEEP     = $00000001;
7628
  D3DSTENCILCAPS_KEEP     = $00000001;
7621
  D3DSTENCILCAPS_ZERO     = $00000002;
7629
  D3DSTENCILCAPS_ZERO     = $00000002;
7622
  D3DSTENCILCAPS_REPLACE  = $00000004;
7630
  D3DSTENCILCAPS_REPLACE  = $00000004;
7623
  D3DSTENCILCAPS_INCRSAT  = $00000008;
7631
  D3DSTENCILCAPS_INCRSAT  = $00000008;
7624
  D3DSTENCILCAPS_DECRSAT  = $00000010;
7632
  D3DSTENCILCAPS_DECRSAT  = $00000010;
7625
  D3DSTENCILCAPS_INVERT   = $00000020;
7633
  D3DSTENCILCAPS_INVERT   = $00000020;
7626
  D3DSTENCILCAPS_INCR     = $00000040;
7634
  D3DSTENCILCAPS_INCR     = $00000040;
7627
  D3DSTENCILCAPS_DECR     = $00000080;
7635
  D3DSTENCILCAPS_DECR     = $00000080;
7628
 
7636
 
7629
(* D3DDEVICEDESC dwTextureOpCaps *)
7637
(* D3DDEVICEDESC dwTextureOpCaps *)
7630
 
7638
 
7631
  D3DTEXOPCAPS_DISABLE                    = $00000001;
7639
  D3DTEXOPCAPS_DISABLE                    = $00000001;
7632
  D3DTEXOPCAPS_SELECTARG1                 = $00000002;
7640
  D3DTEXOPCAPS_SELECTARG1                 = $00000002;
7633
  D3DTEXOPCAPS_SELECTARG2                 = $00000004;
7641
  D3DTEXOPCAPS_SELECTARG2                 = $00000004;
7634
  D3DTEXOPCAPS_MODULATE                   = $00000008;
7642
  D3DTEXOPCAPS_MODULATE                   = $00000008;
7635
  D3DTEXOPCAPS_MODULATE2X                 = $00000010;
7643
  D3DTEXOPCAPS_MODULATE2X                 = $00000010;
7636
  D3DTEXOPCAPS_MODULATE4X                 = $00000020;
7644
  D3DTEXOPCAPS_MODULATE4X                 = $00000020;
7637
  D3DTEXOPCAPS_ADD                        = $00000040;
7645
  D3DTEXOPCAPS_ADD                        = $00000040;
7638
  D3DTEXOPCAPS_ADDSIGNED                  = $00000080;
7646
  D3DTEXOPCAPS_ADDSIGNED                  = $00000080;
7639
  D3DTEXOPCAPS_ADDSIGNED2X                = $00000100;
7647
  D3DTEXOPCAPS_ADDSIGNED2X                = $00000100;
7640
  D3DTEXOPCAPS_SUBTRACT                   = $00000200;
7648
  D3DTEXOPCAPS_SUBTRACT                   = $00000200;
7641
  D3DTEXOPCAPS_ADDSMOOTH                  = $00000400;
7649
  D3DTEXOPCAPS_ADDSMOOTH                  = $00000400;
7642
  D3DTEXOPCAPS_BLENDDIFFUSEALPHA          = $00000800;
7650
  D3DTEXOPCAPS_BLENDDIFFUSEALPHA          = $00000800;
7643
  D3DTEXOPCAPS_BLENDTEXTUREALPHA          = $00001000;
7651
  D3DTEXOPCAPS_BLENDTEXTUREALPHA          = $00001000;
7644
  D3DTEXOPCAPS_BLENDFACTORALPHA           = $00002000;
7652
  D3DTEXOPCAPS_BLENDFACTORALPHA           = $00002000;
7645
  D3DTEXOPCAPS_BLENDTEXTUREALPHAPM        = $00004000;
7653
  D3DTEXOPCAPS_BLENDTEXTUREALPHAPM        = $00004000;
7646
  D3DTEXOPCAPS_BLENDCURRENTALPHA          = $00008000;
7654
  D3DTEXOPCAPS_BLENDCURRENTALPHA          = $00008000;
7647
  D3DTEXOPCAPS_PREMODULATE                = $00010000;
7655
  D3DTEXOPCAPS_PREMODULATE                = $00010000;
7648
  D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR     = $00020000;
7656
  D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR     = $00020000;
7649
  D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA     = $00040000;
7657
  D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA     = $00040000;
7650
  D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR  = $00080000;
7658
  D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR  = $00080000;
7651
  D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA  = $00100000;
7659
  D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA  = $00100000;
7652
  D3DTEXOPCAPS_BUMPENVMAP                 = $00200000;
7660
  D3DTEXOPCAPS_BUMPENVMAP                 = $00200000;
7653
  D3DTEXOPCAPS_BUMPENVMAPLUMINANCE        = $00400000;
7661
  D3DTEXOPCAPS_BUMPENVMAPLUMINANCE        = $00400000;
7654
  D3DTEXOPCAPS_DOTPRODUCT3                = $00800000;
7662
  D3DTEXOPCAPS_DOTPRODUCT3                = $00800000;
7655
 
7663
 
7656
(* D3DDEVICEDESC dwFVFCaps flags *)
7664
(* D3DDEVICEDESC dwFVFCaps flags *)
7657
 
7665
 
7658
  D3DFVFCAPS_TEXCOORDCOUNTMASK    = $0000ffff; (* mask for texture coordinate count field *)
7666
  D3DFVFCAPS_TEXCOORDCOUNTMASK    = $0000ffff; (* mask for texture coordinate count field *)
7659
  D3DFVFCAPS_DONOTSTRIPELEMENTS   = $00080000; (* Device prefers that vertex elements not be stripped *)
7667
  D3DFVFCAPS_DONOTSTRIPELEMENTS   = $00080000; (* Device prefers that vertex elements not be stripped *)
7660
 
7668
 
7661
(*
7669
(*
7662
 * Description for a device.
7670
 * Description for a device.
7663
 * This is used to describe a device that is to be created or to query
7671
 * This is used to describe a device that is to be created or to query
7664
 * the current device.
7672
 * the current device.
7665
 *)
7673
 *)
7666
 
7674
 
7667
type
7675
type
7668
  PD3DDeviceDesc = ^TD3DDeviceDesc;
7676
  PD3DDeviceDesc = ^TD3DDeviceDesc;
7669
  TD3DDeviceDesc = packed record
7677
  TD3DDeviceDesc = packed record
7670
    dwSize: DWORD;                       (* Size of TD3DDeviceDesc structure *)
7678
    dwSize: DWORD;                       (* Size of TD3DDeviceDesc structure *)
7671
    dwFlags: DWORD;                      (* Indicates which fields have valid data *)
7679
    dwFlags: DWORD;                      (* Indicates which fields have valid data *)
7672
    dcmColorModel: TD3DColorModel;        (* Color model of device *)
7680
    dcmColorModel: TD3DColorModel;        (* Color model of device *)
7673
    dwDevCaps: DWORD;                    (* Capabilities of device *)
7681
    dwDevCaps: DWORD;                    (* Capabilities of device *)
7674
    dtcTransformCaps: TD3DTransformCaps;  (* Capabilities of transform *)
7682
    dtcTransformCaps: TD3DTransformCaps;  (* Capabilities of transform *)
7675
    bClipping: BOOL;                     (* Device can do 3D clipping *)
7683
    bClipping: BOOL;                     (* Device can do 3D clipping *)
7676
    dlcLightingCaps: TD3DLightingCaps;    (* Capabilities of lighting *)
7684
    dlcLightingCaps: TD3DLightingCaps;    (* Capabilities of lighting *)
7677
    dpcLineCaps: TD3DPrimCaps;
7685
    dpcLineCaps: TD3DPrimCaps;
7678
    dpcTriCaps: TD3DPrimCaps;
7686
    dpcTriCaps: TD3DPrimCaps;
7679
    dwDeviceRenderBitDepth: DWORD;       (* One of DDBB_8, 16, etc.. *)
7687
    dwDeviceRenderBitDepth: DWORD;       (* One of DDBB_8, 16, etc.. *)
7680
    dwDeviceZBufferBitDepth: DWORD;      (* One of DDBD_16, 32, etc.. *)
7688
    dwDeviceZBufferBitDepth: DWORD;      (* One of DDBD_16, 32, etc.. *)
7681
    dwMaxBufferSize: DWORD;              (* Maximum execute buffer size *)
7689
    dwMaxBufferSize: DWORD;              (* Maximum execute buffer size *)
7682
    dwMaxVertexCount: DWORD;             (* Maximum vertex count *)
7690
    dwMaxVertexCount: DWORD;             (* Maximum vertex count *)
7683
    // *** New fields for DX5 *** //
7691
    // *** New fields for DX5 *** //
7684
 
7692
 
7685
    // Width and height caps are 0 for legacy HALs.
7693
    // Width and height caps are 0 for legacy HALs.
7686
    dwMinTextureWidth, dwMinTextureHeight  : DWORD;
7694
    dwMinTextureWidth, dwMinTextureHeight  : DWORD;
7687
    dwMaxTextureWidth, dwMaxTextureHeight  : DWORD;
7695
    dwMaxTextureWidth, dwMaxTextureHeight  : DWORD;
7688
    dwMinStippleWidth, dwMaxStippleWidth   : DWORD;
7696
    dwMinStippleWidth, dwMaxStippleWidth   : DWORD;
7689
    dwMinStippleHeight, dwMaxStippleHeight : DWORD;
7697
    dwMinStippleHeight, dwMaxStippleHeight : DWORD;
7690
 
7698
 
7691
    // New fields for DX6
7699
    // New fields for DX6
7692
    dwMaxTextureRepeat : DWORD;
7700
    dwMaxTextureRepeat : DWORD;
7693
    dwMaxTextureAspectRatio : DWORD;
7701
    dwMaxTextureAspectRatio : DWORD;
7694
    dwMaxAnisotropy : DWORD;
7702
    dwMaxAnisotropy : DWORD;
7695
 
7703
 
7696
    // Guard band that the rasterizer can accommodate
7704
    // Guard band that the rasterizer can accommodate
7697
    // Screen-space vertices inside this space but outside the viewport
7705
    // Screen-space vertices inside this space but outside the viewport
7698
    // will get clipped properly.
7706
    // will get clipped properly.
7699
    dvGuardBandLeft : TD3DValue;
7707
    dvGuardBandLeft : TD3DValue;
7700
    dvGuardBandTop : TD3DValue;
7708
    dvGuardBandTop : TD3DValue;
7701
    dvGuardBandRight : TD3DValue;
7709
    dvGuardBandRight : TD3DValue;
7702
    dvGuardBandBottom : TD3DValue;
7710
    dvGuardBandBottom : TD3DValue;
7703
 
7711
 
7704
    dvExtentsAdjust : TD3DValue;
7712
    dvExtentsAdjust : TD3DValue;
7705
    dwStencilCaps : DWORD;
7713
    dwStencilCaps : DWORD;
7706
 
7714
 
7707
    dwFVFCaps : DWORD;  (* low 4 bits: 0 implies TLVERTEX only, 1..8 imply FVF aware *)
7715
    dwFVFCaps : DWORD;  (* low 4 bits: 0 implies TLVERTEX only, 1..8 imply FVF aware *)
7708
    dwTextureOpCaps : DWORD;
7716
    dwTextureOpCaps : DWORD;
7709
    wMaxTextureBlendStages : WORD;
7717
    wMaxTextureBlendStages : WORD;
7710
    wMaxSimultaneousTextures : WORD;
7718
    wMaxSimultaneousTextures : WORD;
7711
  end;
7719
  end;
7712
 
7720
 
7713
  PD3DDeviceDesc7 = ^TD3DDeviceDesc7;
7721
  PD3DDeviceDesc7 = ^TD3DDeviceDesc7;
7714
  TD3DDeviceDesc7 = packed record
7722
  TD3DDeviceDesc7 = packed record
7715
    dwDevCaps:               DWORD;             (* Capabilities of device *)
7723
    dwDevCaps:               DWORD;             (* Capabilities of device *)
7716
    dpcLineCaps:             TD3DPrimCaps;
7724
    dpcLineCaps:             TD3DPrimCaps;
7717
    dpcTriCaps:              TD3DPrimCaps;
7725
    dpcTriCaps:              TD3DPrimCaps;
7718
    dwDeviceRenderBitDepth:  DWORD;             (* One of DDBB_8, 16, etc.. *)
7726
    dwDeviceRenderBitDepth:  DWORD;             (* One of DDBB_8, 16, etc.. *)
7719
    dwDeviceZBufferBitDepth: DWORD;             (* One of DDBD_16, 32, etc.. *)
7727
    dwDeviceZBufferBitDepth: DWORD;             (* One of DDBD_16, 32, etc.. *)
7720
 
7728
 
7721
    dwMinTextureWidth, dwMinTextureHeight: DWORD;
7729
    dwMinTextureWidth, dwMinTextureHeight: DWORD;
7722
    dwMaxTextureWidth, dwMaxTextureHeight: DWORD;
7730
    dwMaxTextureWidth, dwMaxTextureHeight: DWORD;
7723
 
7731
 
7724
    dwMaxTextureRepeat:                    DWORD;
7732
    dwMaxTextureRepeat:                    DWORD;
7725
    dwMaxTextureAspectRatio:               DWORD;
7733
    dwMaxTextureAspectRatio:               DWORD;
7726
    dwMaxAnisotropy:                       DWORD;
7734
    dwMaxAnisotropy:                       DWORD;
7727
 
7735
 
7728
    dvGuardBandLeft:                       TD3DValue;
7736
    dvGuardBandLeft:                       TD3DValue;
7729
    dvGuardBandTop:                        TD3DValue;
7737
    dvGuardBandTop:                        TD3DValue;
7730
    dvGuardBandRight:                      TD3DValue;
7738
    dvGuardBandRight:                      TD3DValue;
7731
    dvGuardBandBottom:                     TD3DValue;
7739
    dvGuardBandBottom:                     TD3DValue;
7732
 
7740
 
7733
    dvExtentsAdjust:                       TD3DValue;
7741
    dvExtentsAdjust:                       TD3DValue;
7734
    dwStencilCaps:                         DWORD;
7742
    dwStencilCaps:                         DWORD;
7735
 
7743
 
7736
    dwFVFCaps:                             DWORD;
7744
    dwFVFCaps:                             DWORD;
7737
    dwTextureOpCaps:                       DWORD;
7745
    dwTextureOpCaps:                       DWORD;
7738
    wMaxTextureBlendStages:                WORD;
7746
    wMaxTextureBlendStages:                WORD;
7739
    wMaxSimultaneousTextures:              WORD;
7747
    wMaxSimultaneousTextures:              WORD;
7740
 
7748
 
7741
    dwMaxActiveLights:                     DWORD;
7749
    dwMaxActiveLights:                     DWORD;
7742
    dvMaxVertexW:                          TD3DValue;
7750
    dvMaxVertexW:                          TD3DValue;
7743
    deviceGUID:                            TGUID;
7751
    deviceGUID:                            TGUID;
7744
 
7752
 
7745
    wMaxUserClipPlanes:                    WORD;
7753
    wMaxUserClipPlanes:                    WORD;
7746
    wMaxVertexBlendMatrices:               WORD;
7754
    wMaxVertexBlendMatrices:               WORD;
7747
 
7755
 
7748
    dwVertexProcessingCaps:                DWORD;
7756
    dwVertexProcessingCaps:                DWORD;
7749
 
7757
 
7750
    dwReserved1:                           DWORD;
7758
    dwReserved1:                           DWORD;
7751
    dwReserved2:                           DWORD;
7759
    dwReserved2:                           DWORD;
7752
    dwReserved3:                           DWORD;
7760
    dwReserved3:                           DWORD;
7753
    dwReserved4:                           DWORD;
7761
    dwReserved4:                           DWORD;
7754
  end;
7762
  end;
7755
 
7763
 
7756
const
7764
const
7757
  D3DDEVICEDESCSIZE = sizeof(TD3DDeviceDesc);
7765
  D3DDEVICEDESCSIZE = sizeof(TD3DDeviceDesc);
7758
  D3DDEVICEDESC7SIZE = sizeof(TD3DDeviceDesc7);
7766
  D3DDEVICEDESC7SIZE = sizeof(TD3DDeviceDesc7);
7759
 
7767
 
7760
type
7768
type
7761
  TD3DEnumDevicesCallbackA = function (lpGuid: PGUID; // nil for the default device
7769
  TD3DEnumDevicesCallbackA = function (lpGuid: PGUID; // nil for the default device
7762
      lpDeviceDescription: PAnsiChar; lpDeviceName: PAnsiChar;
7770
      lpDeviceDescription: PAnsiChar; lpDeviceName: PAnsiChar;
7763
      var lpD3DHWDeviceDesc: TD3DDeviceDesc;
7771
      var lpD3DHWDeviceDesc: TD3DDeviceDesc;
7764
      var lpD3DHELDeviceDesc: TD3DDeviceDesc;
7772
      var lpD3DHELDeviceDesc: TD3DDeviceDesc;
7765
      lpContext : pointer) : HResult; stdcall;
7773
      lpContext : pointer) : HResult; stdcall;
7766
  TD3DEnumDevicesCallback = TD3DEnumDevicesCallbackA;
7774
  TD3DEnumDevicesCallback = TD3DEnumDevicesCallbackA;
7767
 
7775
 
7768
  TD3DEnumDevicesCallback7A = function (
7776
  TD3DEnumDevicesCallback7A = function (
7769
      lpDeviceDescription: PAnsiChar; lpDeviceName: PAnsiChar;
7777
      lpDeviceDescription: PAnsiChar; lpDeviceName: PAnsiChar;
7770
      const lpD3DDeviceDesc: TD3DDeviceDesc7; lpContext: Pointer) : HResult; stdcall;
7778
      const lpD3DDeviceDesc: TD3DDeviceDesc7; lpContext: Pointer) : HResult; stdcall;
7771
  TD3DEnumDevicesCallback7 = TD3DEnumDevicesCallback7A;
7779
  TD3DEnumDevicesCallback7 = TD3DEnumDevicesCallback7A;
7772
 
7780
 
7773
(* TD3DDeviceDesc dwFlags indicating valid fields *)
7781
(* TD3DDeviceDesc dwFlags indicating valid fields *)
7774
 
7782
 
7775
const
7783
const
7776
  D3DDD_COLORMODEL            = $00000001; (* dcmColorModel is valid *)
7784
  D3DDD_COLORMODEL            = $00000001; (* dcmColorModel is valid *)
7777
  D3DDD_DEVCAPS               = $00000002; (* dwDevCaps is valid *)
7785
  D3DDD_DEVCAPS               = $00000002; (* dwDevCaps is valid *)
7778
  D3DDD_TRANSFORMCAPS         = $00000004; (* dtcTransformCaps is valid *)
7786
  D3DDD_TRANSFORMCAPS         = $00000004; (* dtcTransformCaps is valid *)
7779
  D3DDD_LIGHTINGCAPS          = $00000008; (* dlcLightingCaps is valid *)
7787
  D3DDD_LIGHTINGCAPS          = $00000008; (* dlcLightingCaps is valid *)
7780
  D3DDD_BCLIPPING             = $00000010; (* bClipping is valid *)
7788
  D3DDD_BCLIPPING             = $00000010; (* bClipping is valid *)
7781
  D3DDD_LINECAPS              = $00000020; (* dpcLineCaps is valid *)
7789
  D3DDD_LINECAPS              = $00000020; (* dpcLineCaps is valid *)
7782
  D3DDD_TRICAPS               = $00000040; (* dpcTriCaps is valid *)
7790
  D3DDD_TRICAPS               = $00000040; (* dpcTriCaps is valid *)
7783
  D3DDD_DEVICERENDERBITDEPTH  = $00000080; (* dwDeviceRenderBitDepth is valid *)
7791
  D3DDD_DEVICERENDERBITDEPTH  = $00000080; (* dwDeviceRenderBitDepth is valid *)
7784
  D3DDD_DEVICEZBUFFERBITDEPTH = $00000100; (* dwDeviceZBufferBitDepth is valid *)
7792
  D3DDD_DEVICEZBUFFERBITDEPTH = $00000100; (* dwDeviceZBufferBitDepth is valid *)
7785
  D3DDD_MAXBUFFERSIZE         = $00000200; (* dwMaxBufferSize is valid *)
7793
  D3DDD_MAXBUFFERSIZE         = $00000200; (* dwMaxBufferSize is valid *)
7786
  D3DDD_MAXVERTEXCOUNT        = $00000400; (* dwMaxVertexCount is valid *)
7794
  D3DDD_MAXVERTEXCOUNT        = $00000400; (* dwMaxVertexCount is valid *)
7787
 
7795
 
7788
(* TD3DDeviceDesc dwDevCaps flags *)
7796
(* TD3DDeviceDesc dwDevCaps flags *)
7789
 
7797
 
7790
  D3DDEVCAPS_FLOATTLVERTEX        = $00000001; (* Device accepts floating point *)
7798
  D3DDEVCAPS_FLOATTLVERTEX        = $00000001; (* Device accepts floating point *)
7791
                                                    (* for post-transform vertex data *)
7799
                                                    (* for post-transform vertex data *)
7792
  D3DDEVCAPS_SORTINCREASINGZ      = $00000002; (* Device needs data sorted for increasing Z*)
7800
  D3DDEVCAPS_SORTINCREASINGZ      = $00000002; (* Device needs data sorted for increasing Z*)
7793
  D3DDEVCAPS_SORTDECREASINGZ      = $00000004; (* Device needs data sorted for decreasing Z*)
7801
  D3DDEVCAPS_SORTDECREASINGZ      = $00000004; (* Device needs data sorted for decreasing Z*)
7794
  D3DDEVCAPS_SORTEXACT            = $00000008; (* Device needs data sorted exactly *)
7802
  D3DDEVCAPS_SORTEXACT            = $00000008; (* Device needs data sorted exactly *)
7795
 
7803
 
7796
  D3DDEVCAPS_EXECUTESYSTEMMEMORY  = $00000010; (* Device can use execute buffers from system memory *)
7804
  D3DDEVCAPS_EXECUTESYSTEMMEMORY  = $00000010; (* Device can use execute buffers from system memory *)
7797
  D3DDEVCAPS_EXECUTEVIDEOMEMORY   = $00000020; (* Device can use execute buffers from video memory *)
7805
  D3DDEVCAPS_EXECUTEVIDEOMEMORY   = $00000020; (* Device can use execute buffers from video memory *)
7798
  D3DDEVCAPS_TLVERTEXSYSTEMMEMORY = $00000040; (* Device can use TL buffers from system memory *)
7806
  D3DDEVCAPS_TLVERTEXSYSTEMMEMORY = $00000040; (* Device can use TL buffers from system memory *)
7799
  D3DDEVCAPS_TLVERTEXVIDEOMEMORY  = $00000080; (* Device can use TL buffers from video memory *)
7807
  D3DDEVCAPS_TLVERTEXVIDEOMEMORY  = $00000080; (* Device can use TL buffers from video memory *)
7800
  D3DDEVCAPS_TEXTURESYSTEMMEMORY  = $00000100; (* Device can texture from system memory *)
7808
  D3DDEVCAPS_TEXTURESYSTEMMEMORY  = $00000100; (* Device can texture from system memory *)
7801
  D3DDEVCAPS_TEXTUREVIDEOMEMORY   = $00000200; (* Device can texture from device memory *)
7809
  D3DDEVCAPS_TEXTUREVIDEOMEMORY   = $00000200; (* Device can texture from device memory *)
7802
  D3DDEVCAPS_DRAWPRIMTLVERTEX     = $00000400; (* Device can draw TLVERTEX primitives *)
7810
  D3DDEVCAPS_DRAWPRIMTLVERTEX     = $00000400; (* Device can draw TLVERTEX primitives *)
7803
  D3DDEVCAPS_CANRENDERAFTERFLIP   = $00000800; (* Device can render without waiting for flip to complete *)
7811
  D3DDEVCAPS_CANRENDERAFTERFLIP   = $00000800; (* Device can render without waiting for flip to complete *)
7804
  D3DDEVCAPS_TEXTURENONLOCALVIDMEM   = $00001000; (* Device can texture from nonlocal video memory *)
7812
  D3DDEVCAPS_TEXTURENONLOCALVIDMEM   = $00001000; (* Device can texture from nonlocal video memory *)
7805
  D3DDEVCAPS_DRAWPRIMITIVES2         = $00002000; (* Device can support DrawPrimitives2 *)
7813
  D3DDEVCAPS_DRAWPRIMITIVES2         = $00002000; (* Device can support DrawPrimitives2 *)
7806
  D3DDEVCAPS_SEPARATETEXTUREMEMORIES = $00004000; (* Device is texturing from separate memory pools *)
7814
  D3DDEVCAPS_SEPARATETEXTUREMEMORIES = $00004000; (* Device is texturing from separate memory pools *)
7807
  D3DDEVCAPS_DRAWPRIMITIVES2EX       = $00008000; (* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*)
7815
  D3DDEVCAPS_DRAWPRIMITIVES2EX       = $00008000; (* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*)
7808
  D3DDEVCAPS_HWTRANSFORMANDLIGHT     = $00010000; (* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also *)
7816
  D3DDEVCAPS_HWTRANSFORMANDLIGHT     = $00010000; (* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also *)
7809
  D3DDEVCAPS_CANBLTSYSTONONLOCAL     = $00020000; (* Device supports a Tex Blt from system memory to non-local vidmem *)
7817
  D3DDEVCAPS_CANBLTSYSTONONLOCAL     = $00020000; (* Device supports a Tex Blt from system memory to non-local vidmem *)
7810
  D3DDEVCAPS_HWRASTERIZATION         = $00080000; (* Device has HW acceleration for rasterization *)
7818
  D3DDEVCAPS_HWRASTERIZATION         = $00080000; (* Device has HW acceleration for rasterization *)
7811
 
7819
 
7812
(*
7820
(*
7813
 * These are the flags in the D3DDEVICEDESC7.dwVertexProcessingCaps field
7821
 * These are the flags in the D3DDEVICEDESC7.dwVertexProcessingCaps field
7814
 *)
7822
 *)
7815
 
7823
 
7816
(* device can do texgen *)
7824
(* device can do texgen *)
7817
  D3DVTXPCAPS_TEXGEN              = $00000001;
7825
  D3DVTXPCAPS_TEXGEN              = $00000001;
7818
(* device can do IDirect3DDevice7 colormaterialsource ops *)
7826
(* device can do IDirect3DDevice7 colormaterialsource ops *)
7819
  D3DVTXPCAPS_MATERIALSOURCE7     = $00000002;
7827
  D3DVTXPCAPS_MATERIALSOURCE7     = $00000002;
7820
(* device can do vertex fog *)
7828
(* device can do vertex fog *)
7821
  D3DVTXPCAPS_VERTEXFOG           = $00000004;
7829
  D3DVTXPCAPS_VERTEXFOG           = $00000004;
7822
(* device can do directional lights *)
7830
(* device can do directional lights *)
7823
  D3DVTXPCAPS_DIRECTIONALLIGHTS   = $00000008;
7831
  D3DVTXPCAPS_DIRECTIONALLIGHTS   = $00000008;
7824
(* device can do positional lights (includes point and spot) *)
7832
(* device can do positional lights (includes point and spot) *)
7825
  D3DVTXPCAPS_POSITIONALLIGHTS    = $00000010;
7833
  D3DVTXPCAPS_POSITIONALLIGHTS    = $00000010;
7826
(* device can do local viewer *)
7834
(* device can do local viewer *)
7827
  D3DVTXPCAPS_LOCALVIEWER         = $00000020;
7835
  D3DVTXPCAPS_LOCALVIEWER         = $00000020;
7828
 
7836
 
7829
  D3DFDS_COLORMODEL        = $00000001; (* Match color model *)
7837
  D3DFDS_COLORMODEL        = $00000001; (* Match color model *)
7830
  D3DFDS_GUID              = $00000002; (* Match guid *)
7838
  D3DFDS_GUID              = $00000002; (* Match guid *)
7831
  D3DFDS_HARDWARE          = $00000004; (* Match hardware/software *)
7839
  D3DFDS_HARDWARE          = $00000004; (* Match hardware/software *)
7832
  D3DFDS_TRIANGLES         = $00000008; (* Match in triCaps *)
7840
  D3DFDS_TRIANGLES         = $00000008; (* Match in triCaps *)
7833
  D3DFDS_LINES             = $00000010; (* Match in lineCaps  *)
7841
  D3DFDS_LINES             = $00000010; (* Match in lineCaps  *)
7834
  D3DFDS_MISCCAPS          = $00000020; (* Match primCaps.dwMiscCaps *)
7842
  D3DFDS_MISCCAPS          = $00000020; (* Match primCaps.dwMiscCaps *)
7835
  D3DFDS_RASTERCAPS        = $00000040; (* Match primCaps.dwRasterCaps *)
7843
  D3DFDS_RASTERCAPS        = $00000040; (* Match primCaps.dwRasterCaps *)
7836
  D3DFDS_ZCMPCAPS          = $00000080; (* Match primCaps.dwZCmpCaps *)
7844
  D3DFDS_ZCMPCAPS          = $00000080; (* Match primCaps.dwZCmpCaps *)
7837
  D3DFDS_ALPHACMPCAPS      = $00000100; (* Match primCaps.dwAlphaCmpCaps *)
7845
  D3DFDS_ALPHACMPCAPS      = $00000100; (* Match primCaps.dwAlphaCmpCaps *)
7838
  D3DFDS_SRCBLENDCAPS      = $00000200; (* Match primCaps.dwSourceBlendCaps *)
7846
  D3DFDS_SRCBLENDCAPS      = $00000200; (* Match primCaps.dwSourceBlendCaps *)
7839
  D3DFDS_DSTBLENDCAPS      = $00000400; (* Match primCaps.dwDestBlendCaps *)
7847
  D3DFDS_DSTBLENDCAPS      = $00000400; (* Match primCaps.dwDestBlendCaps *)
7840
  D3DFDS_SHADECAPS         = $00000800; (* Match primCaps.dwShadeCaps *)
7848
  D3DFDS_SHADECAPS         = $00000800; (* Match primCaps.dwShadeCaps *)
7841
  D3DFDS_TEXTURECAPS       = $00001000; (* Match primCaps.dwTextureCaps *)
7849
  D3DFDS_TEXTURECAPS       = $00001000; (* Match primCaps.dwTextureCaps *)
7842
  D3DFDS_TEXTUREFILTERCAPS = $00002000; (* Match primCaps.dwTextureFilterCaps *)
7850
  D3DFDS_TEXTUREFILTERCAPS = $00002000; (* Match primCaps.dwTextureFilterCaps *)
7843
  D3DFDS_TEXTUREBLENDCAPS  = $00004000; (* Match primCaps.dwTextureBlendCaps *)
7851
  D3DFDS_TEXTUREBLENDCAPS  = $00004000; (* Match primCaps.dwTextureBlendCaps *)
7844
  D3DFDS_TEXTUREADDRESSCAPS  = $00008000; (* Match primCaps.dwTextureBlendCaps *)
7852
  D3DFDS_TEXTUREADDRESSCAPS  = $00008000; (* Match primCaps.dwTextureBlendCaps *)
7845
 
7853
 
7846
(*
7854
(*
7847
 * FindDevice arguments
7855
 * FindDevice arguments
7848
 *)
7856
 *)
7849
type
7857
type
7850
  PD3DFindDeviceSearch = ^TD3DFindDeviceSearch;
7858
  PD3DFindDeviceSearch = ^TD3DFindDeviceSearch;
7851
  TD3DFindDeviceSearch = packed record
7859
  TD3DFindDeviceSearch = packed record
7852
    dwSize: DWORD;
7860
    dwSize: DWORD;
7853
    dwFlags: DWORD;
7861
    dwFlags: DWORD;
7854
    bHardware: BOOL;
7862
    bHardware: BOOL;
7855
    dcmColorModel: TD3DColorModel;
7863
    dcmColorModel: TD3DColorModel;
7856
    guid: TGUID;
7864
    guid: TGUID;
7857
    dwCaps: DWORD;
7865
    dwCaps: DWORD;
7858
    dpcPrimCaps: TD3DPrimCaps;
7866
    dpcPrimCaps: TD3DPrimCaps;
7859
  end;
7867
  end;
7860
 
7868
 
7861
  PD3DFindDeviceResult = ^TD3DFindDeviceResult;
7869
  PD3DFindDeviceResult = ^TD3DFindDeviceResult;
7862
  TD3DFindDeviceResult = packed record
7870
  TD3DFindDeviceResult = packed record
7863
    dwSize: DWORD;
7871
    dwSize: DWORD;
7864
    guid: TGUID;               (* guid which matched *)
7872
    guid: TGUID;               (* guid which matched *)
7865
    ddHwDesc: TD3DDeviceDesc;   (* hardware TD3DDeviceDesc *)
7873
    ddHwDesc: TD3DDeviceDesc;   (* hardware TD3DDeviceDesc *)
7866
    ddSwDesc: TD3DDeviceDesc;   (* software TD3DDeviceDesc *)
7874
    ddSwDesc: TD3DDeviceDesc;   (* software TD3DDeviceDesc *)
7867
  end;
7875
  end;
7868
 
7876
 
7869
(*
7877
(*
7870
 * Description of execute buffer.
7878
 * Description of execute buffer.
7871
 *)
7879
 *)
7872
  PD3DExecuteBufferDesc = ^TD3DExecuteBufferDesc;
7880
  PD3DExecuteBufferDesc = ^TD3DExecuteBufferDesc;
7873
  TD3DExecuteBufferDesc = packed record
7881
  TD3DExecuteBufferDesc = packed record
7874
    dwSize: DWORD;         (* size of this structure *)
7882
    dwSize: DWORD;         (* size of this structure *)
7875
    dwFlags: DWORD;        (* flags indicating which fields are valid *)
7883
    dwFlags: DWORD;        (* flags indicating which fields are valid *)
7876
    dwCaps: DWORD;         (* capabilities of execute buffer *)
7884
    dwCaps: DWORD;         (* capabilities of execute buffer *)
7877
    dwBufferSize: DWORD;   (* size of execute buffer data *)
7885
    dwBufferSize: DWORD;   (* size of execute buffer data *)
7878
    lpData: Pointer;       (* pointer to actual data *)
7886
    lpData: Pointer;       (* pointer to actual data *)
7879
  end;
7887
  end;
7880
 
7888
 
7881
(* D3DEXECUTEBUFFER dwFlags indicating valid fields *)
7889
(* D3DEXECUTEBUFFER dwFlags indicating valid fields *)
7882
 
7890
 
7883
const
7891
const
7884
  D3DDEB_BUFSIZE          = $00000001;     (* buffer size valid *)
7892
  D3DDEB_BUFSIZE          = $00000001;     (* buffer size valid *)
7885
  D3DDEB_CAPS             = $00000002;     (* caps valid *)
7893
  D3DDEB_CAPS             = $00000002;     (* caps valid *)
7886
  D3DDEB_LPDATA           = $00000004;     (* lpData valid *)
7894
  D3DDEB_LPDATA           = $00000004;     (* lpData valid *)
7887
 
7895
 
7888
(* D3DEXECUTEBUFFER dwCaps *)
7896
(* D3DEXECUTEBUFFER dwCaps *)
7889
 
7897
 
7890
  D3DDEBCAPS_SYSTEMMEMORY = $00000001;     (* buffer in system memory *)
7898
  D3DDEBCAPS_SYSTEMMEMORY = $00000001;     (* buffer in system memory *)
7891
  D3DDEBCAPS_VIDEOMEMORY  = $00000002;     (* buffer in device memory *)
7899
  D3DDEBCAPS_VIDEOMEMORY  = $00000002;     (* buffer in device memory *)
7892
  D3DDEBCAPS_MEM          = (D3DDEBCAPS_SYSTEMMEMORY or D3DDEBCAPS_VIDEOMEMORY);
7900
  D3DDEBCAPS_MEM          = (D3DDEBCAPS_SYSTEMMEMORY or D3DDEBCAPS_VIDEOMEMORY);
7893
 
7901
 
7894
type
7902
type
7895
  PD3DDevInfo_TextureManager = ^TD3DDevInfo_TextureManager;
7903
  PD3DDevInfo_TextureManager = ^TD3DDevInfo_TextureManager;
7896
  TD3DDevInfo_TextureManager = packed record
7904
  TD3DDevInfo_TextureManager = packed record
7897
    bThrashing:              BOOL;       (* indicates if thrashing *)
7905
    bThrashing:              BOOL;       (* indicates if thrashing *)
7898
    dwApproxBytesDownloaded: DWORD;      (* Approximate number of bytes downloaded by texture manager *)
7906
    dwApproxBytesDownloaded: DWORD;      (* Approximate number of bytes downloaded by texture manager *)
7899
    dwNumEvicts:             DWORD;      (* number of textures evicted *)
7907
    dwNumEvicts:             DWORD;      (* number of textures evicted *)
7900
    dwNumVidCreates:         DWORD;      (* number of textures created in video memory *)
7908
    dwNumVidCreates:         DWORD;      (* number of textures created in video memory *)
7901
    dwNumTexturesUsed:       DWORD;      (* number of textures used *)
7909
    dwNumTexturesUsed:       DWORD;      (* number of textures used *)
7902
    dwNumUsedTexInVid:       DWORD;      (* number of used textures present in video memory *)
7910
    dwNumUsedTexInVid:       DWORD;      (* number of used textures present in video memory *)
7903
    dwWorkingSet:            DWORD;      (* number of textures in video memory *)
7911
    dwWorkingSet:            DWORD;      (* number of textures in video memory *)
7904
    dwWorkingSetBytes:       DWORD;      (* number of bytes in video memory *)
7912
    dwWorkingSetBytes:       DWORD;      (* number of bytes in video memory *)
7905
    dwTotalManaged:          DWORD;      (* total number of managed textures *)
7913
    dwTotalManaged:          DWORD;      (* total number of managed textures *)
7906
    dwTotalBytes:            DWORD;      (* total number of bytes of managed textures *)
7914
    dwTotalBytes:            DWORD;      (* total number of bytes of managed textures *)
7907
    dwLastPri:               DWORD;      (* priority of last texture evicted *)
7915
    dwLastPri:               DWORD;      (* priority of last texture evicted *)
7908
  end;
7916
  end;
7909
 
7917
 
7910
  PD3DDevInfo_Texturing = ^TD3DDevInfo_Texturing;
7918
  PD3DDevInfo_Texturing = ^TD3DDevInfo_Texturing;
7911
  TD3DDevInfo_Texturing = packed record
7919
  TD3DDevInfo_Texturing = packed record
7912
    dwNumLoads:          DWORD;          (* counts Load() API calls *)
7920
    dwNumLoads:          DWORD;          (* counts Load() API calls *)
7913
    dwApproxBytesLoaded: DWORD;          (* Approximate number bytes loaded via Load() *)
7921
    dwApproxBytesLoaded: DWORD;          (* Approximate number bytes loaded via Load() *)
7914
    dwNumPreLoads:       DWORD;          (* counts PreLoad() API calls *)
7922
    dwNumPreLoads:       DWORD;          (* counts PreLoad() API calls *)
7915
    dwNumSet:            DWORD;          (* counts SetTexture() API calls *)
7923
    dwNumSet:            DWORD;          (* counts SetTexture() API calls *)
7916
    dwNumCreates:        DWORD;          (* counts texture creates *)
7924
    dwNumCreates:        DWORD;          (* counts texture creates *)
7917
    dwNumDestroys:       DWORD;          (* counts texture destroys *)
7925
    dwNumDestroys:       DWORD;          (* counts texture destroys *)
7918
    dwNumSetPriorities:  DWORD;          (* counts SetPriority() API calls *)
7926
    dwNumSetPriorities:  DWORD;          (* counts SetPriority() API calls *)
7919
    dwNumSetLODs:        DWORD;          (* counts SetLOD() API calls *)
7927
    dwNumSetLODs:        DWORD;          (* counts SetLOD() API calls *)
7920
    dwNumLocks:          DWORD;          (* counts number of texture locks *)
7928
    dwNumLocks:          DWORD;          (* counts number of texture locks *)
7921
    dwNumGetDCs:         DWORD;          (* counts number of GetDCs to textures *)
7929
    dwNumGetDCs:         DWORD;          (* counts number of GetDCs to textures *)
7922
  end;
7930
  end;
7923
 
7931
 
7924
(*==========================================================================;
7932
(*==========================================================================;
7925
 *
7933
 *
7926
 *
7934
 *
7927
 *  File:   d3d.h
7935
 *  File:   d3d.h
7928
 *  Content:    Direct3D include file
7936
 *  Content:    Direct3D include file
7929
 *
7937
 *
7930
 ****************************************************************************)
7938
 ****************************************************************************)
7931
 
7939
 
7932
function D3DErrorString(Value: HResult) : string;
7940
function D3DErrorString(Value: HResult) : string;
7933
 
7941
 
7934
(*
7942
(*
7935
 * Interface IID's
7943
 * Interface IID's
7936
 *)
7944
 *)
7937
 
7945
 
7938
const
7946
const
7939
(*
7947
(*
7940
 * Internal Guid to distinguish requested MMX from MMX being used as an RGB rasterizer
7948
 * Internal Guid to distinguish requested MMX from MMX being used as an RGB rasterizer
7941
 *)
7949
 *)
7942
  IID_IDirect3DRampDevice: TGUID =
7950
  IID_IDirect3DRampDevice: TGUID =
7943
      (D1:$F2086B20;D2:$259F;D3:$11CF;D4:($A3,$1A,$00,$AA,$00,$B9,$33,$56));
7951
      (D1:$F2086B20;D2:$259F;D3:$11CF;D4:($A3,$1A,$00,$AA,$00,$B9,$33,$56));
7944
  IID_IDirect3DRGBDevice: TGUID =
7952
  IID_IDirect3DRGBDevice: TGUID =
7945
      (D1:$A4665C60;D2:$2673;D3:$11CF;D4:($A3,$1A,$00,$AA,$00,$B9,$33,$56));
7953
      (D1:$A4665C60;D2:$2673;D3:$11CF;D4:($A3,$1A,$00,$AA,$00,$B9,$33,$56));
7946
  IID_IDirect3DHALDevice: TGUID =
7954
  IID_IDirect3DHALDevice: TGUID =
7947
      (D1:$84E63dE0;D2:$46AA;D3:$11CF;D4:($81,$6F,$00,$00,$C0,$20,$15,$6E));
7955
      (D1:$84E63dE0;D2:$46AA;D3:$11CF;D4:($81,$6F,$00,$00,$C0,$20,$15,$6E));
7948
  IID_IDirect3DMMXDevice: TGUID =
7956
  IID_IDirect3DMMXDevice: TGUID =
7949
      (D1:$881949a1;D2:$d6f3;D3:$11d0;D4:($89,$ab,$00,$a0,$c9,$05,$41,$29));
7957
      (D1:$881949a1;D2:$d6f3;D3:$11d0;D4:($89,$ab,$00,$a0,$c9,$05,$41,$29));
7950
 
7958
 
7951
  IID_IDirect3DRefDevice: TGUID =
7959
  IID_IDirect3DRefDevice: TGUID =
7952
      (D1:$50936643;D2:$13e9;D3:$11d1;D4:($89,$aa,$00,$a0,$c9,$05,$41,$29));
7960
      (D1:$50936643;D2:$13e9;D3:$11d1;D4:($89,$aa,$00,$a0,$c9,$05,$41,$29));
7953
  IID_IDirect3DNullDevice: TGUID =
7961
  IID_IDirect3DNullDevice: TGUID =
7954
      (D1:$8767df22;D2:$bacc;D3:$11d1;D4:($89,$69,$00,$a0,$c9,$06,$29,$a8));
7962
      (D1:$8767df22;D2:$bacc;D3:$11d1;D4:($89,$69,$00,$a0,$c9,$06,$29,$a8));
7955
 
7963
 
7956
  IID_IDirect3DTnLHalDevice: TGUID = '{f5049e78-4861-11d2-a407-00a0c90629a8}';
7964
  IID_IDirect3DTnLHalDevice: TGUID = '{f5049e78-4861-11d2-a407-00a0c90629a8}';
7957
 
7965
 
7958
type
7966
type
7959
  IDirect3D = interface;
7967
  IDirect3D = interface;
7960
  IDirect3D2 = interface;
7968
  IDirect3D2 = interface;
7961
  IDirect3D3 = interface;
7969
  IDirect3D3 = interface;
7962
  IDirect3D7 = interface;
7970
  IDirect3D7 = interface;
7963
  IDirect3DDevice = interface;
7971
  IDirect3DDevice = interface;
7964
  IDirect3DDevice2 = interface;
7972
  IDirect3DDevice2 = interface;
7965
  IDirect3DDevice3 = interface;
7973
  IDirect3DDevice3 = interface;
7966
  IDirect3DDevice7 = interface;
7974
  IDirect3DDevice7 = interface;
7967
  IDirect3DExecuteBuffer = interface;
7975
  IDirect3DExecuteBuffer = interface;
7968
  IDirect3DLight = interface;
7976
  IDirect3DLight = interface;
7969
  IDirect3DMaterial = interface;
7977
  IDirect3DMaterial = interface;
7970
  IDirect3DMaterial2 = interface;
7978
  IDirect3DMaterial2 = interface;
7971
  IDirect3DMaterial3 = interface;
7979
  IDirect3DMaterial3 = interface;
7972
  IDirect3DTexture = interface;
7980
  IDirect3DTexture = interface;
7973
  IDirect3DTexture2 = interface;
7981
  IDirect3DTexture2 = interface;
7974
  IDirect3DViewport = interface;
7982
  IDirect3DViewport = interface;
7975
  IDirect3DViewport2 = interface;
7983
  IDirect3DViewport2 = interface;
7976
  IDirect3DViewport3 = interface;
7984
  IDirect3DViewport3 = interface;
7977
  IDirect3DVertexBuffer = interface;
7985
  IDirect3DVertexBuffer = interface;
7978
  IDirect3DVertexBuffer7 = interface;
7986
  IDirect3DVertexBuffer7 = interface;
7979
 
7987
 
7980
(*
7988
(*
7981
 * Direct3D interfaces
7989
 * Direct3D interfaces
7982
 *)
7990
 *)
7983
 
7991
 
7984
  IDirect3D = interface (IUnknown)
7992
  IDirect3D = interface (IUnknown)
7985
    ['{3BBA0080-2421-11CF-A31A-00AA00B93356}']
7993
    ['{3BBA0080-2421-11CF-A31A-00AA00B93356}']
7986
    (*** IDirect3D methods ***)
7994
    (*** IDirect3D methods ***)
7987
    function Initialize (lpREFIID: {REFIID} PGUID) : HResult; stdcall;
7995
    function Initialize (lpREFIID: {REFIID} PGUID) : HResult; stdcall;
7988
    function EnumDevices (lpEnumDevicesCallback: TD3DEnumDevicesCallback;
7996
    function EnumDevices (lpEnumDevicesCallback: TD3DEnumDevicesCallback;
7989
        lpUserArg: Pointer) : HResult; stdcall;
7997
        lpUserArg: Pointer) : HResult; stdcall;
7990
    function CreateLight (var lplpDirect3Dlight: IDirect3DLight;
7998
    function CreateLight (var lplpDirect3Dlight: IDirect3DLight;
7991
        pUnkOuter: IUnknown) : HResult; stdcall;
7999
        pUnkOuter: IUnknown) : HResult; stdcall;
7992
    function CreateMaterial (var lplpDirect3DMaterial: IDirect3DMaterial;
8000
    function CreateMaterial (var lplpDirect3DMaterial: IDirect3DMaterial;
7993
        pUnkOuter: IUnknown) : HResult; stdcall;
8001
        pUnkOuter: IUnknown) : HResult; stdcall;
7994
    function CreateViewport (var lplpD3DViewport: IDirect3DViewport;
8002
    function CreateViewport (var lplpD3DViewport: IDirect3DViewport;
7995
        pUnkOuter: IUnknown) : HResult; stdcall;
8003
        pUnkOuter: IUnknown) : HResult; stdcall;
7996
    function FindDevice (var lpD3DFDS: TD3DFindDeviceSearch;
8004
    function FindDevice (var lpD3DFDS: TD3DFindDeviceSearch;
7997
        var lpD3DFDR: TD3DFindDeviceResult) : HResult; stdcall;
8005
        var lpD3DFDR: TD3DFindDeviceResult) : HResult; stdcall;
7998
  end;
8006
  end;
7999
 
8007
 
8000
  IDirect3D2 = interface (IUnknown)
8008
  IDirect3D2 = interface (IUnknown)
8001
    ['{6aae1ec1-662a-11d0-889d-00aa00bbb76a}']
8009
    ['{6aae1ec1-662a-11d0-889d-00aa00bbb76a}']
8002
    (*** IDirect3D2 methods ***)
8010
    (*** IDirect3D2 methods ***)
8003
    function EnumDevices(lpEnumDevicesCallback: TD3DEnumDevicesCallback;
8011
    function EnumDevices(lpEnumDevicesCallback: TD3DEnumDevicesCallback;
8004
        lpUserArg: pointer) : HResult; stdcall;
8012
        lpUserArg: pointer) : HResult; stdcall;
8005
    function CreateLight (var lplpDirect3Dlight: IDirect3DLight;
8013
    function CreateLight (var lplpDirect3Dlight: IDirect3DLight;
8006
        pUnkOuter: IUnknown) : HResult; stdcall;
8014
        pUnkOuter: IUnknown) : HResult; stdcall;
8007
    function CreateMaterial (var lplpDirect3DMaterial2: IDirect3DMaterial2;
8015
    function CreateMaterial (var lplpDirect3DMaterial2: IDirect3DMaterial2;
8008
        pUnkOuter: IUnknown) : HResult; stdcall;
8016
        pUnkOuter: IUnknown) : HResult; stdcall;
8009
    function CreateViewport (var lplpD3DViewport2: IDirect3DViewport2;
8017
    function CreateViewport (var lplpD3DViewport2: IDirect3DViewport2;
8010
        pUnkOuter: IUnknown) : HResult; stdcall;
8018
        pUnkOuter: IUnknown) : HResult; stdcall;
8011
    function FindDevice (var lpD3DFDS: TD3DFindDeviceSearch;
8019
    function FindDevice (var lpD3DFDS: TD3DFindDeviceSearch;
8012
        var lpD3DFDR: TD3DFindDeviceResult) : HResult; stdcall;
8020
        var lpD3DFDR: TD3DFindDeviceResult) : HResult; stdcall;
8013
    function CreateDevice (const rclsid: TRefClsID; lpDDS: IDirectDrawSurface;
8021
    function CreateDevice (const rclsid: TRefClsID; lpDDS: IDirectDrawSurface;
8014
        out lplpD3DDevice2: IDirect3DDevice2) : HResult; stdcall;
8022
        out lplpD3DDevice2: IDirect3DDevice2) : HResult; stdcall;
8015
  end;
8023
  end;
8016
 
8024
 
8017
  IDirect3D3 = interface (IUnknown)
8025
  IDirect3D3 = interface (IUnknown)
8018
    ['{bb223240-e72b-11d0-a9b4-00aa00c0993e}']
8026
    ['{bb223240-e72b-11d0-a9b4-00aa00c0993e}']
8019
    (*** IDirect3D3 methods ***)
8027
    (*** IDirect3D3 methods ***)
8020
    function EnumDevices(lpEnumDevicesCallback: TD3DEnumDevicesCallback;
8028
    function EnumDevices(lpEnumDevicesCallback: TD3DEnumDevicesCallback;
8021
        lpUserArg: pointer) : HResult; stdcall;
8029
        lpUserArg: pointer) : HResult; stdcall;
8022
    function CreateLight (var lplpDirect3Dlight: IDirect3DLight;
8030
    function CreateLight (var lplpDirect3Dlight: IDirect3DLight;
8023
        pUnkOuter: IUnknown) : HResult; stdcall;
8031
        pUnkOuter: IUnknown) : HResult; stdcall;
8024
    function CreateMaterial (var lplpDirect3DMaterial3: IDirect3DMaterial3;
8032
    function CreateMaterial (var lplpDirect3DMaterial3: IDirect3DMaterial3;
8025
        pUnkOuter: IUnknown) : HResult; stdcall;
8033
        pUnkOuter: IUnknown) : HResult; stdcall;
8026
    function CreateViewport (var lplpD3DViewport3: IDirect3DViewport3;
8034
    function CreateViewport (var lplpD3DViewport3: IDirect3DViewport3;
8027
        pUnkOuter: IUnknown) : HResult; stdcall;
8035
        pUnkOuter: IUnknown) : HResult; stdcall;
8028
    function FindDevice (var lpD3DFDS: TD3DFindDeviceSearch;
8036
    function FindDevice (var lpD3DFDS: TD3DFindDeviceSearch;
8029
        var lpD3DFDR: TD3DFindDeviceResult) : HResult; stdcall;
8037
        var lpD3DFDR: TD3DFindDeviceResult) : HResult; stdcall;
8030
    function CreateDevice (const rclsid: TRefClsID; lpDDS: IDirectDrawSurface4;
8038
    function CreateDevice (const rclsid: TRefClsID; lpDDS: IDirectDrawSurface4;
8031
        out lplpD3DDevice: IDirect3DDevice3; pUnkOuter: IUnknown) : HResult; stdcall;
8039
        out lplpD3DDevice: IDirect3DDevice3; pUnkOuter: IUnknown) : HResult; stdcall;
8032
    function CreateVertexBuffer (var lpVBDesc: TD3DVertexBufferDesc;
8040
    function CreateVertexBuffer (var lpVBDesc: TD3DVertexBufferDesc;
8033
        var lpD3DVertexBuffer: IDirect3DVertexBuffer;
8041
        var lpD3DVertexBuffer: IDirect3DVertexBuffer;
8034
        dwFlags: DWORD; pUnkOuter: IUnknown) : HResult; stdcall;
8042
        dwFlags: DWORD; pUnkOuter: IUnknown) : HResult; stdcall;
8035
    function EnumZBufferFormats (const riidDevice: TRefClsID; lpEnumCallback:
8043
    function EnumZBufferFormats (const riidDevice: TRefClsID; lpEnumCallback:
8036
        TD3DEnumPixelFormatsCallback; lpContext: pointer) : HResult; stdcall;
8044
        TD3DEnumPixelFormatsCallback; lpContext: pointer) : HResult; stdcall;
8037
    function EvictManagedTextures : HResult; stdcall;
8045
    function EvictManagedTextures : HResult; stdcall;
8038
  end;
8046
  end;
8039
 
8047
 
8040
  IDirect3D7 = interface (IUnknown)
8048
  IDirect3D7 = interface (IUnknown)
8041
    ['{f5049e77-4861-11d2-a407-00a0c90629a8}']
8049
    ['{f5049e77-4861-11d2-a407-00a0c90629a8}']
8042
    (*** IDirect3D7 methods ***)
8050
    (*** IDirect3D7 methods ***)
8043
    function EnumDevices(lpEnumDevicesCallback: TD3DEnumDevicesCallback7;
8051
    function EnumDevices(lpEnumDevicesCallback: TD3DEnumDevicesCallback7;
8044
        lpUserArg: pointer) : HResult; stdcall;
8052
        lpUserArg: pointer) : HResult; stdcall;
8045
    function CreateDevice (const rclsid: TGUID; lpDDS: IDirectDrawSurface7;
8053
    function CreateDevice (const rclsid: TGUID; lpDDS: IDirectDrawSurface7;
8046
        out lplpD3DDevice: IDirect3DDevice7) : HResult; stdcall;
8054
        out lplpD3DDevice: IDirect3DDevice7) : HResult; stdcall;
8047
    function CreateVertexBuffer (const lpVBDesc: TD3DVertexBufferDesc;
8055
    function CreateVertexBuffer (const lpVBDesc: TD3DVertexBufferDesc;
8048
        out lplpD3DVertexBuffer: IDirect3DVertexBuffer7;
8056
        out lplpD3DVertexBuffer: IDirect3DVertexBuffer7;
8049
        dwFlags: DWORD) : HResult; stdcall;
8057
        dwFlags: DWORD) : HResult; stdcall;
8050
    function EnumZBufferFormats (const riidDevice: TGUID; lpEnumCallback:
8058
    function EnumZBufferFormats (const riidDevice: TGUID; lpEnumCallback:
8051
        TD3DEnumPixelFormatsCallback; lpContext: pointer) : HResult; stdcall;
8059
        TD3DEnumPixelFormatsCallback; lpContext: pointer) : HResult; stdcall;
8052
    function EvictManagedTextures : HResult; stdcall;
8060
    function EvictManagedTextures : HResult; stdcall;
8053
  end;
8061
  end;
8054
 
8062
 
8055
(*
8063
(*
8056
 * Direct3D Device interfaces
8064
 * Direct3D Device interfaces
8057
 *)
8065
 *)
8058
 
8066
 
8059
  IDirect3DDevice = interface (IUnknown)
8067
  IDirect3DDevice = interface (IUnknown)
8060
    ['{64108800-957d-11d0-89ab-00a0c9054129}']
8068
    ['{64108800-957d-11d0-89ab-00a0c9054129}']
8061
    (*** IDirect3DDevice methods ***)
8069
    (*** IDirect3DDevice methods ***)
8062
    function Initialize (lpd3d: IDirect3D; lpGUID: PGUID;
8070
    function Initialize (lpd3d: IDirect3D; lpGUID: PGUID;
8063
        var lpd3ddvdesc: TD3DDeviceDesc) : HResult; stdcall;
8071
        var lpd3ddvdesc: TD3DDeviceDesc) : HResult; stdcall;
8064
    function GetCaps (var lpD3DHWDevDesc: TD3DDeviceDesc;
8072
    function GetCaps (var lpD3DHWDevDesc: TD3DDeviceDesc;
8065
        var lpD3DHELDevDesc: TD3DDeviceDesc) : HResult; stdcall;
8073
        var lpD3DHELDevDesc: TD3DDeviceDesc) : HResult; stdcall;
8066
    function SwapTextureHandles (lpD3DTex1: IDirect3DTexture;
8074
    function SwapTextureHandles (lpD3DTex1: IDirect3DTexture;
8067
        lpD3DTex2: IDirect3DTexture) : HResult; stdcall;
8075
        lpD3DTex2: IDirect3DTexture) : HResult; stdcall;
8068
    function CreateExecuteBuffer (var lpDesc: TD3DExecuteBufferDesc ;
8076
    function CreateExecuteBuffer (var lpDesc: TD3DExecuteBufferDesc ;
8069
        var lplpDirect3DExecuteBuffer: IDirect3DExecuteBuffer;
8077
        var lplpDirect3DExecuteBuffer: IDirect3DExecuteBuffer;
8070
        pUnkOuter: IUnknown) : HResult; stdcall;
8078
        pUnkOuter: IUnknown) : HResult; stdcall;
8071
    function GetStats (var lpD3DStats: TD3DStats) : HResult; stdcall;
8079
    function GetStats (var lpD3DStats: TD3DStats) : HResult; stdcall;
8072
    function Execute (lpDirect3DExecuteBuffer: IDirect3DExecuteBuffer;
8080
    function Execute (lpDirect3DExecuteBuffer: IDirect3DExecuteBuffer;
8073
        lpDirect3DViewport: IDirect3DViewport; dwFlags: DWORD) : HResult; stdcall;
8081
        lpDirect3DViewport: IDirect3DViewport; dwFlags: DWORD) : HResult; stdcall;
8074
    function AddViewport (lpDirect3DViewport: IDirect3DViewport) : HResult; stdcall;
8082
    function AddViewport (lpDirect3DViewport: IDirect3DViewport) : HResult; stdcall;
8075
    function DeleteViewport (lpDirect3DViewport: IDirect3DViewport) : HResult; stdcall;
8083
    function DeleteViewport (lpDirect3DViewport: IDirect3DViewport) : HResult; stdcall;
8076
    function NextViewport (lpDirect3DViewport: IDirect3DViewport;
8084
    function NextViewport (lpDirect3DViewport: IDirect3DViewport;
8077
        var lplpDirect3DViewport: IDirect3DViewport; dwFlags: DWORD) : HResult; stdcall;
8085
        var lplpDirect3DViewport: IDirect3DViewport; dwFlags: DWORD) : HResult; stdcall;
8078
    function Pick (lpDirect3DExecuteBuffer: IDirect3DExecuteBuffer;
8086
    function Pick (lpDirect3DExecuteBuffer: IDirect3DExecuteBuffer;
8079
        lpDirect3DViewport: IDirect3DViewport; dwFlags: DWORD;
8087
        lpDirect3DViewport: IDirect3DViewport; dwFlags: DWORD;
8080
        var lpRect: TD3DRect) : HResult; stdcall;
8088
        var lpRect: TD3DRect) : HResult; stdcall;
8081
    function GetPickRecords (var lpCount: DWORD;
8089
    function GetPickRecords (var lpCount: DWORD;
8082
        var lpD3DPickRec: TD3DPickRecord) : HResult; stdcall;
8090
        var lpD3DPickRec: TD3DPickRecord) : HResult; stdcall;
8083
    function EnumTextureFormats (lpd3dEnumTextureProc:
8091
    function EnumTextureFormats (lpd3dEnumTextureProc:
8084
        TD3DEnumTextureFormatsCallback; lpArg: Pointer) :
8092
        TD3DEnumTextureFormatsCallback; lpArg: Pointer) :
8085
        HResult; stdcall;
8093
        HResult; stdcall;
8086
    function CreateMatrix (var lpD3DMatHandle: TD3DMatrixHandle) : HResult; stdcall;
8094
    function CreateMatrix (var lpD3DMatHandle: TD3DMatrixHandle) : HResult; stdcall;
8087
    function SetMatrix (d3dMatHandle: TD3DMatrixHandle;
8095
    function SetMatrix (d3dMatHandle: TD3DMatrixHandle;
8088
        var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
8096
        var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
8089
    function GetMatrix (var lpD3DMatHandle: TD3DMatrixHandle;
8097
    function GetMatrix (var lpD3DMatHandle: TD3DMatrixHandle;
8090
        var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
8098
        var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
8091
    function DeleteMatrix (d3dMatHandle: TD3DMatrixHandle) : HResult; stdcall;
8099
    function DeleteMatrix (d3dMatHandle: TD3DMatrixHandle) : HResult; stdcall;
8092
    function BeginScene: HResult; stdcall;
8100
    function BeginScene: HResult; stdcall;
8093
    function EndScene: HResult; stdcall;
8101
    function EndScene: HResult; stdcall;
8094
    function GetDirect3D (var lpD3D: IDirect3D) : HResult; stdcall;
8102
    function GetDirect3D (var lpD3D: IDirect3D) : HResult; stdcall;
8095
  end;
8103
  end;
8096
 
8104
 
8097
  IDirect3DDevice2 = interface (IUnknown)
8105
  IDirect3DDevice2 = interface (IUnknown)
8098
    ['{93281501-8cf8-11d0-89ab-00a0c9054129}']
8106
    ['{93281501-8cf8-11d0-89ab-00a0c9054129}']
8099
    (*** IDirect3DDevice2 methods ***)
8107
    (*** IDirect3DDevice2 methods ***)
8100
    function GetCaps (var lpD3DHWDevDesc: TD3DDeviceDesc;
8108
    function GetCaps (var lpD3DHWDevDesc: TD3DDeviceDesc;
8101
        var lpD3DHELDevDesc: TD3DDeviceDesc) : HResult; stdcall;
8109
        var lpD3DHELDevDesc: TD3DDeviceDesc) : HResult; stdcall;
8102
    function SwapTextureHandles (lpD3DTex1: IDirect3DTexture2;
8110
    function SwapTextureHandles (lpD3DTex1: IDirect3DTexture2;
8103
        lpD3DTex2: IDirect3DTexture2) : HResult; stdcall;
8111
        lpD3DTex2: IDirect3DTexture2) : HResult; stdcall;
8104
    function GetStats (var lpD3DStats: TD3DStats) : HResult; stdcall;
8112
    function GetStats (var lpD3DStats: TD3DStats) : HResult; stdcall;
8105
    function AddViewport (lpDirect3DViewport2: IDirect3DViewport2) : HResult; stdcall;
8113
    function AddViewport (lpDirect3DViewport2: IDirect3DViewport2) : HResult; stdcall;
8106
    function DeleteViewport (lpDirect3DViewport: IDirect3DViewport2) : HResult; stdcall;
8114
    function DeleteViewport (lpDirect3DViewport: IDirect3DViewport2) : HResult; stdcall;
8107
    function NextViewport (lpDirect3DViewport: IDirect3DViewport2;
8115
    function NextViewport (lpDirect3DViewport: IDirect3DViewport2;
8108
        var lplpDirect3DViewport: IDirect3DViewport2; dwFlags: DWORD) :
8116
        var lplpDirect3DViewport: IDirect3DViewport2; dwFlags: DWORD) :
8109
        HResult; stdcall;
8117
        HResult; stdcall;
8110
    function EnumTextureFormats (
8118
    function EnumTextureFormats (
8111
        lpd3dEnumTextureProc: TD3DEnumTextureFormatsCallback; lpArg: Pointer) :
8119
        lpd3dEnumTextureProc: TD3DEnumTextureFormatsCallback; lpArg: Pointer) :
8112
        HResult; stdcall;
8120
        HResult; stdcall;
8113
    function BeginScene: HResult; stdcall;
8121
    function BeginScene: HResult; stdcall;
8114
    function EndScene: HResult; stdcall;
8122
    function EndScene: HResult; stdcall;
8115
    function GetDirect3D (var lpD3D: IDirect3D2) : HResult; stdcall;
8123
    function GetDirect3D (var lpD3D: IDirect3D2) : HResult; stdcall;
8116
 
8124
 
8117
    (*** DrawPrimitive API ***)
8125
    (*** DrawPrimitive API ***)
8118
    function SetCurrentViewport (lpd3dViewport2: IDirect3DViewport2)
8126
    function SetCurrentViewport (lpd3dViewport2: IDirect3DViewport2)
8119
        : HResult; stdcall;
8127
        : HResult; stdcall;
8120
    function GetCurrentViewport (var lplpd3dViewport2: IDirect3DViewport2)
8128
    function GetCurrentViewport (var lplpd3dViewport2: IDirect3DViewport2)
8121
        : HResult; stdcall;
8129
        : HResult; stdcall;
8122
 
8130
 
8123
    function SetRenderTarget (lpNewRenderTarget: IDirectDrawSurface)
8131
    function SetRenderTarget (lpNewRenderTarget: IDirectDrawSurface)
8124
        : HResult; stdcall;
8132
        : HResult; stdcall;
8125
    function GetRenderTarget (var lplpNewRenderTarget: IDirectDrawSurface)
8133
    function GetRenderTarget (var lplpNewRenderTarget: IDirectDrawSurface)
8126
        : HResult; stdcall;
8134
        : HResult; stdcall;
8127
 
8135
 
8128
    function Begin_ (d3dpt: TD3DPrimitiveType; d3dvt: TD3DVertexType;
8136
    function Begin_ (d3dpt: TD3DPrimitiveType; d3dvt: TD3DVertexType;
8129
        dwFlags: DWORD) : HResult; stdcall;
8137
        dwFlags: DWORD) : HResult; stdcall;
8130
    function BeginIndexed (dptPrimitiveType: TD3DPrimitiveType; dvtVertexType:
8138
    function BeginIndexed (dptPrimitiveType: TD3DPrimitiveType; dvtVertexType:
8131
        TD3DVertexType; lpvVertices: pointer; dwNumVertices: DWORD;
8139
        TD3DVertexType; lpvVertices: pointer; dwNumVertices: DWORD;
8132
        dwFlags: DWORD) : HResult; stdcall;
8140
        dwFlags: DWORD) : HResult; stdcall;
8133
    function Vertex (lpVertexType: pointer) : HResult;  stdcall;
8141
    function Vertex (lpVertexType: pointer) : HResult;  stdcall;
8134
    function Index (wVertexIndex: WORD) : HResult;  stdcall;
8142
    function Index (wVertexIndex: WORD) : HResult;  stdcall;
8135
    function End_ (dwFlags: DWORD) : HResult; stdcall;
8143
    function End_ (dwFlags: DWORD) : HResult; stdcall;
8136
 
8144
 
8137
    function GetRenderState (dwRenderStateType: TD3DRenderStateType;
8145
    function GetRenderState (dwRenderStateType: TD3DRenderStateType;
8138
        var lpdwRenderState) : HResult; stdcall;
8146
        var lpdwRenderState) : HResult; stdcall;
8139
    function SetRenderState (dwRenderStateType: TD3DRenderStateType;
8147
    function SetRenderState (dwRenderStateType: TD3DRenderStateType;
8140
        dwRenderState: DWORD) : HResult; stdcall;
8148
        dwRenderState: DWORD) : HResult; stdcall;
8141
    function GetLightState (dwLightStateType: TD3DLightStateType;
8149
    function GetLightState (dwLightStateType: TD3DLightStateType;
8142
        var lpdwLightState) : HResult; stdcall;
8150
        var lpdwLightState) : HResult; stdcall;
8143
    function SetLightState (dwLightStateType: TD3DLightStateType;
8151
    function SetLightState (dwLightStateType: TD3DLightStateType;
8144
        dwLightState: DWORD) : HResult; stdcall;
8152
        dwLightState: DWORD) : HResult; stdcall;
8145
    function SetTransform (dtstTransformStateType: TD3DTransformStateType;
8153
    function SetTransform (dtstTransformStateType: TD3DTransformStateType;
8146
        var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
8154
        var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
8147
    function GetTransform (dtstTransformStateType: TD3DTransformStateType;
8155
    function GetTransform (dtstTransformStateType: TD3DTransformStateType;
8148
        var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
8156
        var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
8149
    function MultiplyTransform (dtstTransformStateType: TD3DTransformStateType;
8157
    function MultiplyTransform (dtstTransformStateType: TD3DTransformStateType;
8150
        var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
8158
        var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
8151
 
8159
 
8152
    function DrawPrimitive (dptPrimitiveType: TD3DPrimitiveType;
8160
    function DrawPrimitive (dptPrimitiveType: TD3DPrimitiveType;
8153
        dvtVertexType: TD3DVertexType; var lpvVertices; dwVertexCount,
8161
        dvtVertexType: TD3DVertexType; var lpvVertices; dwVertexCount,
8154
        dwFlags: DWORD) : HResult; stdcall;
8162
        dwFlags: DWORD) : HResult; stdcall;
8155
    function DrawIndexedPrimitive (dptPrimitiveType: TD3DPrimitiveType;
8163
    function DrawIndexedPrimitive (dptPrimitiveType: TD3DPrimitiveType;
8156
        dwVertexTypeDesc: DWORD; lpvVertices: pointer; dwVertexCount: DWORD;
8164
        dwVertexTypeDesc: DWORD; lpvVertices: pointer; dwVertexCount: DWORD;
8157
        var lpwIndices: WORD; dwIndexCount, dwFlags: DWORD) : HResult; stdcall;
8165
        var lpwIndices: WORD; dwIndexCount, dwFlags: DWORD) : HResult; stdcall;
8158
    function SetClipStatus (var lpD3DClipStatus: TD3DClipStatus) : HResult; stdcall;
8166
    function SetClipStatus (var lpD3DClipStatus: TD3DClipStatus) : HResult; stdcall;
8159
    function GetClipStatus (var lpD3DClipStatus: TD3DClipStatus) : HResult; stdcall;
8167
    function GetClipStatus (var lpD3DClipStatus: TD3DClipStatus) : HResult; stdcall;
8160
  end;
8168
  end;
8161
 
8169
 
8162
  IDirect3DDevice3 = interface (IUnknown)
8170
  IDirect3DDevice3 = interface (IUnknown)
8163
    ['{b0ab3b60-33d7-11d1-a981-00c04fd7b174}']
8171
    ['{b0ab3b60-33d7-11d1-a981-00c04fd7b174}']
8164
    (*** IDirect3DDevice2 methods ***)
8172
    (*** IDirect3DDevice2 methods ***)
8165
    function GetCaps (var lpD3DHWDevDesc: TD3DDeviceDesc;
8173
    function GetCaps (var lpD3DHWDevDesc: TD3DDeviceDesc;
8166
        var lpD3DHELDevDesc: TD3DDeviceDesc) : HResult; stdcall;
8174
        var lpD3DHELDevDesc: TD3DDeviceDesc) : HResult; stdcall;
8167
    function GetStats (var lpD3DStats: TD3DStats) : HResult; stdcall;
8175
    function GetStats (var lpD3DStats: TD3DStats) : HResult; stdcall;
8168
    function AddViewport (lpDirect3DViewport: IDirect3DViewport3) : HResult; stdcall;
8176
    function AddViewport (lpDirect3DViewport: IDirect3DViewport3) : HResult; stdcall;
8169
    function DeleteViewport (lpDirect3DViewport: IDirect3DViewport3) : HResult; stdcall;
8177
    function DeleteViewport (lpDirect3DViewport: IDirect3DViewport3) : HResult; stdcall;
8170
    function NextViewport (lpDirect3DViewport: IDirect3DViewport3;
8178
    function NextViewport (lpDirect3DViewport: IDirect3DViewport3;
8171
        var lplpAnotherViewport: IDirect3DViewport3; dwFlags: DWORD) : HResult; stdcall;
8179
        var lplpAnotherViewport: IDirect3DViewport3; dwFlags: DWORD) : HResult; stdcall;
8172
    function EnumTextureFormats (
8180
    function EnumTextureFormats (
8173
        lpd3dEnumPixelProc: TD3DEnumPixelFormatsCallback; lpArg: Pointer) :
8181
        lpd3dEnumPixelProc: TD3DEnumPixelFormatsCallback; lpArg: Pointer) :
8174
        HResult; stdcall;
8182
        HResult; stdcall;
8175
    function BeginScene: HResult; stdcall;
8183
    function BeginScene: HResult; stdcall;
8176
    function EndScene: HResult; stdcall;
8184
    function EndScene: HResult; stdcall;
8177
    function GetDirect3D (var lpD3D: IDirect3D3) : HResult; stdcall;
8185
    function GetDirect3D (var lpD3D: IDirect3D3) : HResult; stdcall;
8178
    function SetCurrentViewport (lpd3dViewport: IDirect3DViewport3)
8186
    function SetCurrentViewport (lpd3dViewport: IDirect3DViewport3)
8179
        : HResult; stdcall;
8187
        : HResult; stdcall;
8180
    function GetCurrentViewport (var lplpd3dViewport: IDirect3DViewport3)
8188
    function GetCurrentViewport (var lplpd3dViewport: IDirect3DViewport3)
8181
        : HResult; stdcall;
8189
        : HResult; stdcall;
8182
    function SetRenderTarget (lpNewRenderTarget: IDirectDrawSurface4)
8190
    function SetRenderTarget (lpNewRenderTarget: IDirectDrawSurface4)
8183
        : HResult; stdcall;
8191
        : HResult; stdcall;
8184
    function GetRenderTarget (var lplpNewRenderTarget: IDirectDrawSurface4)
8192
    function GetRenderTarget (var lplpNewRenderTarget: IDirectDrawSurface4)
8185
        : HResult; stdcall;
8193
        : HResult; stdcall;
8186
    function Begin_ (d3dpt: TD3DPrimitiveType; dwVertexTypeDesc: DWORD;
8194
    function Begin_ (d3dpt: TD3DPrimitiveType; dwVertexTypeDesc: DWORD;
8187
        dwFlags: DWORD) : HResult; stdcall;
8195
        dwFlags: DWORD) : HResult; stdcall;
8188
    function BeginIndexed (dptPrimitiveType: TD3DPrimitiveType;
8196
    function BeginIndexed (dptPrimitiveType: TD3DPrimitiveType;
8189
        dwVertexTypeDesc: DWORD; lpvVertices: pointer; dwNumVertices: DWORD;
8197
        dwVertexTypeDesc: DWORD; lpvVertices: pointer; dwNumVertices: DWORD;
8190
        dwFlags: DWORD) : HResult; stdcall;
8198
        dwFlags: DWORD) : HResult; stdcall;
8191
    function Vertex (lpVertex: pointer) : HResult;  stdcall;
8199
    function Vertex (lpVertex: pointer) : HResult;  stdcall;
8192
    function Index (wVertexIndex: WORD) : HResult;  stdcall;
8200
    function Index (wVertexIndex: WORD) : HResult;  stdcall;
8193
    function End_ (dwFlags: DWORD) : HResult; stdcall;
8201
    function End_ (dwFlags: DWORD) : HResult; stdcall;
8194
    function GetRenderState (dwRenderStateType: TD3DRenderStateType;
8202
    function GetRenderState (dwRenderStateType: TD3DRenderStateType;
8195
        var lpdwRenderState) : HResult; stdcall;
8203
        var lpdwRenderState) : HResult; stdcall;
8196
    function SetRenderState (dwRenderStateType: TD3DRenderStateType;
8204
    function SetRenderState (dwRenderStateType: TD3DRenderStateType;
8197
        dwRenderState: DWORD) : HResult; stdcall;
8205
        dwRenderState: DWORD) : HResult; stdcall;
8198
    function GetLightState (dwLightStateType: TD3DLightStateType;
8206
    function GetLightState (dwLightStateType: TD3DLightStateType;
8199
        var lpdwLightState) : HResult; stdcall;
8207
        var lpdwLightState) : HResult; stdcall;
8200
    function SetLightState (dwLightStateType: TD3DLightStateType;
8208
    function SetLightState (dwLightStateType: TD3DLightStateType;
8201
        dwLightState: DWORD) : HResult; stdcall;
8209
        dwLightState: DWORD) : HResult; stdcall;
8202
    function SetTransform (dtstTransformStateType: TD3DTransformStateType;
8210
    function SetTransform (dtstTransformStateType: TD3DTransformStateType;
8203
        var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
8211
        var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
8204
    function GetTransform (dtstTransformStateType: TD3DTransformStateType;
8212
    function GetTransform (dtstTransformStateType: TD3DTransformStateType;
8205
        var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
8213
        var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
8206
    function MultiplyTransform (dtstTransformStateType: TD3DTransformStateType;
8214
    function MultiplyTransform (dtstTransformStateType: TD3DTransformStateType;
8207
        var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
8215
        var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
8208
    function DrawPrimitive (dptPrimitiveType: TD3DPrimitiveType;
8216
    function DrawPrimitive (dptPrimitiveType: TD3DPrimitiveType;
8209
        dwVertexTypeDesc: DWORD; const lpvVertices;
8217
        dwVertexTypeDesc: DWORD; const lpvVertices;
8210
        dwVertexCount, dwFlags: DWORD) : HResult; stdcall;
8218
        dwVertexCount, dwFlags: DWORD) : HResult; stdcall;
8211
    function DrawIndexedPrimitive (dptPrimitiveType: TD3DPrimitiveType;
8219
    function DrawIndexedPrimitive (dptPrimitiveType: TD3DPrimitiveType;
8212
        dwVertexTypeDesc: DWORD; const lpvVertices; dwVertexCount: DWORD;
8220
        dwVertexTypeDesc: DWORD; const lpvVertices; dwVertexCount: DWORD;
8213
        var lpwIndices: WORD; dwIndexCount, dwFlags: DWORD) : HResult; stdcall;
8221
        var lpwIndices: WORD; dwIndexCount, dwFlags: DWORD) : HResult; stdcall;
8214
    function SetClipStatus (var lpD3DClipStatus: TD3DClipStatus) : HResult; stdcall;
8222
    function SetClipStatus (var lpD3DClipStatus: TD3DClipStatus) : HResult; stdcall;
8215
    function GetClipStatus (var lpD3DClipStatus: TD3DClipStatus) : HResult; stdcall;
8223
    function GetClipStatus (var lpD3DClipStatus: TD3DClipStatus) : HResult; stdcall;
8216
    function DrawPrimitiveStrided (dptPrimitiveType: TD3DPrimitiveType;
8224
    function DrawPrimitiveStrided (dptPrimitiveType: TD3DPrimitiveType;
8217
        dwVertexTypeDesc : DWORD;
8225
        dwVertexTypeDesc : DWORD;
8218
        var lpVertexArray: TD3DDrawPrimitiveStridedData;
8226
        var lpVertexArray: TD3DDrawPrimitiveStridedData;
8219
        dwVertexCount, dwFlags: DWORD) : HResult; stdcall;
8227
        dwVertexCount, dwFlags: DWORD) : HResult; stdcall;
8220
    function DrawIndexedPrimitiveStrided (dptPrimitiveType: TD3DPrimitiveType;
8228
    function DrawIndexedPrimitiveStrided (dptPrimitiveType: TD3DPrimitiveType;
8221
        dwVertexTypeDesc : DWORD;
8229
        dwVertexTypeDesc : DWORD;
8222
        var lpVertexArray: TD3DDrawPrimitiveStridedData; dwVertexCount: DWORD;
8230
        var lpVertexArray: TD3DDrawPrimitiveStridedData; dwVertexCount: DWORD;
8223
        var lpwIndices: WORD; dwIndexCount, dwFlags: DWORD) : HResult; stdcall;
8231
        var lpwIndices: WORD; dwIndexCount, dwFlags: DWORD) : HResult; stdcall;
8224
    function DrawPrimitiveVB (dptPrimitiveType: TD3DPrimitiveType;
8232
    function DrawPrimitiveVB (dptPrimitiveType: TD3DPrimitiveType;
8225
        lpd3dVertexBuffer: IDirect3DVertexBuffer;
8233
        lpd3dVertexBuffer: IDirect3DVertexBuffer;
8226
        dwStartVertex, dwNumVertices, dwFlags: DWORD) : HResult; stdcall;
8234
        dwStartVertex, dwNumVertices, dwFlags: DWORD) : HResult; stdcall;
8227
    function DrawIndexedPrimitiveVB (dptPrimitiveType: TD3DPrimitiveType;
8235
    function DrawIndexedPrimitiveVB (dptPrimitiveType: TD3DPrimitiveType;
8228
        lpd3dVertexBuffer: IDirect3DVertexBuffer; var lpwIndices: WORD;
8236
        lpd3dVertexBuffer: IDirect3DVertexBuffer; var lpwIndices: WORD;
8229
        dwIndexCount, dwFlags: DWORD) : HResult; stdcall;
8237
        dwIndexCount, dwFlags: DWORD) : HResult; stdcall;
8230
    function ComputeSphereVisibility (var lpCenters: TD3DVector;
8238
    function ComputeSphereVisibility (var lpCenters: TD3DVector;
8231
        var lpRadii: TD3DValue; dwNumSpheres, dwFlags: DWORD;
8239
        var lpRadii: TD3DValue; dwNumSpheres, dwFlags: DWORD;
8232
        var lpdwReturnValues: DWORD) : HResult; stdcall;
8240
        var lpdwReturnValues: DWORD) : HResult; stdcall;
8233
    function GetTexture (dwStage: DWORD; var lplpTexture: IDirect3DTexture2)
8241
    function GetTexture (dwStage: DWORD; var lplpTexture: IDirect3DTexture2)
8234
        : HResult; stdcall;
8242
        : HResult; stdcall;
8235
    function SetTexture (dwStage: DWORD; lplpTexture: IDirect3DTexture2)
8243
    function SetTexture (dwStage: DWORD; lplpTexture: IDirect3DTexture2)
8236
        : HResult; stdcall;
8244
        : HResult; stdcall;
8237
    function GetTextureStageState (dwStage: DWORD;
8245
    function GetTextureStageState (dwStage: DWORD;
8238
        dwState: TD3DTextureStageStateType; var lpdwValue: DWORD) : HResult; stdcall;
8246
        dwState: TD3DTextureStageStateType; var lpdwValue: DWORD) : HResult; stdcall;
8239
    function SetTextureStageState (dwStage: DWORD;
8247
    function SetTextureStageState (dwStage: DWORD;
8240
        dwState: TD3DTextureStageStateType; lpdwValue: DWORD) : HResult; stdcall;
8248
        dwState: TD3DTextureStageStateType; lpdwValue: DWORD) : HResult; stdcall;
8241
    function ValidateDevice (var lpdwExtraPasses: DWORD) : HResult; stdcall;
8249
    function ValidateDevice (var lpdwExtraPasses: DWORD) : HResult; stdcall;
8242
  end;
8250
  end;
8243
 
8251
 
8244
  IDirect3DDevice7 = interface (IUnknown)
8252
  IDirect3DDevice7 = interface (IUnknown)
8245
    ['{f5049e79-4861-11d2-a407-00a0c90629a8}']
8253
    ['{f5049e79-4861-11d2-a407-00a0c90629a8}']
8246
    (*** IDirect3DDevice7 methods ***)
8254
    (*** IDirect3DDevice7 methods ***)
8247
    function GetCaps(out lpD3DDevDesc: TD3DDeviceDesc7) : HResult; stdcall;
8255
    function GetCaps(out lpD3DDevDesc: TD3DDeviceDesc7) : HResult; stdcall;
8248
    function EnumTextureFormats(lpd3dEnumPixelProc: TD3DEnumPixelFormatsCallback; lpArg: Pointer) : HResult; stdcall;
8256
    function EnumTextureFormats(lpd3dEnumPixelProc: TD3DEnumPixelFormatsCallback; lpArg: Pointer) : HResult; stdcall;
8249
    function BeginScene: HResult; stdcall;
8257
    function BeginScene: HResult; stdcall;
8250
    function EndScene: HResult; stdcall;
8258
    function EndScene: HResult; stdcall;
8251
    function GetDirect3D(out lpD3D: IDirect3D7) : HResult; stdcall;
8259
    function GetDirect3D(out lpD3D: IDirect3D7) : HResult; stdcall;
8252
    function SetRenderTarget(lpNewRenderTarget: IDirectDrawSurface7; dwFlags: DWORD) : HResult; stdcall;
8260
    function SetRenderTarget(lpNewRenderTarget: IDirectDrawSurface7; dwFlags: DWORD) : HResult; stdcall;
8253
    function GetRenderTarget(out lplpRenderTarget: IDirectDrawSurface7) : HResult; stdcall;
8261
    function GetRenderTarget(out lplpRenderTarget: IDirectDrawSurface7) : HResult; stdcall;
8254
    function Clear(dwCount: DWORD; lpRects: PD3DRect; dwFlags, dwColor: DWORD; dvZ: TD3DValue; dwStencil: DWORD) : HResult; stdcall;
8262
    function Clear(dwCount: DWORD; lpRects: PD3DRect; dwFlags, dwColor: DWORD; dvZ: TD3DValue; dwStencil: DWORD) : HResult; stdcall;
8255
    function SetTransform(dtstTransformStateType: TD3DTransformStateType;
8263
    function SetTransform(dtstTransformStateType: TD3DTransformStateType;
8256
        const lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
8264
        const lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
8257
    function GetTransform(dtstTransformStateType: TD3DTransformStateType;
8265
    function GetTransform(dtstTransformStateType: TD3DTransformStateType;
8258
        out lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
8266
        out lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
8259
    function SetViewport(const lpViewport: TD3DViewport7) : HResult; stdcall;
8267
    function SetViewport(const lpViewport: TD3DViewport7) : HResult; stdcall;
8260
    function MultiplyTransform(dtstTransformStateType: TD3DTransformStateType;
8268
    function MultiplyTransform(dtstTransformStateType: TD3DTransformStateType;
8261
        const lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
8269
        const lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
8262
    function GetViewport(out lpViewport: TD3DViewport7) : HResult; stdcall;
8270
    function GetViewport(out lpViewport: TD3DViewport7) : HResult; stdcall;
8263
    function SetMaterial(const lpMaterial: TD3DMaterial7) : HResult; stdcall;
8271
    function SetMaterial(const lpMaterial: TD3DMaterial7) : HResult; stdcall;
8264
    function GetMaterial(out lpMaterial: TD3DMaterial7) : HResult; stdcall;
8272
    function GetMaterial(out lpMaterial: TD3DMaterial7) : HResult; stdcall;
8265
    function SetLight(dwLightIndex: DWORD; const lpLight: TD3DLight7) : HResult; stdcall;
8273
    function SetLight(dwLightIndex: DWORD; const lpLight: TD3DLight7) : HResult; stdcall;
8266
    function GetLight(dwLightIndex: DWORD; out lpLight: TD3DLight7) : HResult; stdcall;
8274
    function GetLight(dwLightIndex: DWORD; out lpLight: TD3DLight7) : HResult; stdcall;
8267
    function SetRenderState(dwRenderStateType: TD3DRenderStateType; dwRenderState: DWORD) : HResult; stdcall;
8275
    function SetRenderState(dwRenderStateType: TD3DRenderStateType; dwRenderState: DWORD) : HResult; stdcall;
8268
    function GetRenderState(dwRenderStateType: TD3DRenderStateType; out dwRenderState: DWORD) : HResult; stdcall;
8276
    function GetRenderState(dwRenderStateType: TD3DRenderStateType; out dwRenderState: DWORD) : HResult; stdcall;
8269
    function BeginStateBlock : HResult; stdcall;
8277
    function BeginStateBlock : HResult; stdcall;
8270
    function EndStateBlock(out lpdwBlockHandle: DWORD) : HResult; stdcall;
8278
    function EndStateBlock(out lpdwBlockHandle: DWORD) : HResult; stdcall;
8271
    function PreLoad(lpddsTexture: IDirectDrawSurface7) : HResult; stdcall;
8279
    function PreLoad(lpddsTexture: IDirectDrawSurface7) : HResult; stdcall;
8272
    function DrawPrimitive(dptPrimitiveType: TD3DPrimitiveType;
8280
    function DrawPrimitive(dptPrimitiveType: TD3DPrimitiveType;
8273
        dwVertexTypeDesc: DWORD; const lpvVertices;
8281
        dwVertexTypeDesc: DWORD; const lpvVertices;
8274
        dwVertexCount, dwFlags: DWORD) : HResult; stdcall;
8282
        dwVertexCount, dwFlags: DWORD) : HResult; stdcall;
8275
    function DrawIndexedPrimitive(dptPrimitiveType: TD3DPrimitiveType;
8283
    function DrawIndexedPrimitive(dptPrimitiveType: TD3DPrimitiveType;
8276
        dwVertexTypeDesc: DWORD; const lpvVertices; dwVertexCount: DWORD;
8284
        dwVertexTypeDesc: DWORD; const lpvVertices; dwVertexCount: DWORD;
8277
        const lpwIndices; dwIndexCount, dwFlags: DWORD) : HResult; stdcall;
8285
        const lpwIndices; dwIndexCount, dwFlags: DWORD) : HResult; stdcall;
8278
    function SetClipStatus(const lpD3DClipStatus: TD3DClipStatus) : HResult; stdcall;
8286
    function SetClipStatus(const lpD3DClipStatus: TD3DClipStatus) : HResult; stdcall;
8279
    function GetClipStatus(out lpD3DClipStatus: TD3DClipStatus) : HResult; stdcall;
8287
    function GetClipStatus(out lpD3DClipStatus: TD3DClipStatus) : HResult; stdcall;
8280
    function DrawPrimitiveStrided(dptPrimitiveType: TD3DPrimitiveType;
8288
    function DrawPrimitiveStrided(dptPrimitiveType: TD3DPrimitiveType;
8281
        dwVertexTypeDesc : DWORD;
8289
        dwVertexTypeDesc : DWORD;
8282
        const lpVertexArray: TD3DDrawPrimitiveStridedData;
8290
        const lpVertexArray: TD3DDrawPrimitiveStridedData;
8283
        dwVertexCount, dwFlags: DWORD) : HResult; stdcall;
8291
        dwVertexCount, dwFlags: DWORD) : HResult; stdcall;
8284
    function DrawIndexedPrimitiveStrided(dptPrimitiveType: TD3DPrimitiveType;
8292
    function DrawIndexedPrimitiveStrided(dptPrimitiveType: TD3DPrimitiveType;
8285
        dwVertexTypeDesc : DWORD;
8293
        dwVertexTypeDesc : DWORD;
8286
        const lpVertexArray: TD3DDrawPrimitiveStridedData; dwVertexCount: DWORD;
8294
        const lpVertexArray: TD3DDrawPrimitiveStridedData; dwVertexCount: DWORD;
8287
        var lpwIndices: WORD; dwIndexCount, dwFlags: DWORD) : HResult; stdcall;
8295
        var lpwIndices: WORD; dwIndexCount, dwFlags: DWORD) : HResult; stdcall;
8288
    function DrawPrimitiveVB(dptPrimitiveType: TD3DPrimitiveType;
8296
    function DrawPrimitiveVB(dptPrimitiveType: TD3DPrimitiveType;
8289
        lpd3dVertexBuffer: IDirect3DVertexBuffer7;
8297
        lpd3dVertexBuffer: IDirect3DVertexBuffer7;
8290
        dwStartVertex, dwNumVertices, dwFlags: DWORD) : HResult; stdcall;
8298
        dwStartVertex, dwNumVertices, dwFlags: DWORD) : HResult; stdcall;
8291
    function DrawIndexedPrimitiveVB(dptPrimitiveType: TD3DPrimitiveType;
8299
    function DrawIndexedPrimitiveVB(dptPrimitiveType: TD3DPrimitiveType;
8292
        lpd3dVertexBuffer: IDirect3DVertexBuffer7; dwStartVertex, dwNumVertices: DWORD;
8300
        lpd3dVertexBuffer: IDirect3DVertexBuffer7; dwStartVertex, dwNumVertices: DWORD;
8293
        var lpwIndices: WORD; dwIndexCount, dwFlags: DWORD) : HResult; stdcall;
8301
        var lpwIndices: WORD; dwIndexCount, dwFlags: DWORD) : HResult; stdcall;
8294
    function ComputeSphereVisibility(const lpCenters: TD3DVector;
8302
    function ComputeSphereVisibility(const lpCenters: TD3DVector;
8295
        var lpRadii: TD3DValue; dwNumSpheres, dwFlags: DWORD;
8303
        var lpRadii: TD3DValue; dwNumSpheres, dwFlags: DWORD;
8296
        var lpdwReturnValues: DWORD) : HResult; stdcall;
8304
        var lpdwReturnValues: DWORD) : HResult; stdcall;
8297
    function GetTexture(dwStage: DWORD; out lplpTexture: IDirectDrawSurface7) : HResult; stdcall;
8305
    function GetTexture(dwStage: DWORD; out lplpTexture: IDirectDrawSurface7) : HResult; stdcall;
8298
    function SetTexture(dwStage: DWORD; lpTexture: IDirectDrawSurface7) : HResult; stdcall;
8306
    function SetTexture(dwStage: DWORD; lpTexture: IDirectDrawSurface7) : HResult; stdcall;
8299
    function GetTextureStageState(dwStage: DWORD;
8307
    function GetTextureStageState(dwStage: DWORD;
8300
        dwState: TD3DTextureStageStateType; out lpdwValue: DWORD) : HResult; stdcall;
8308
        dwState: TD3DTextureStageStateType; out lpdwValue: DWORD) : HResult; stdcall;
8301
    function SetTextureStageState(dwStage: DWORD;
8309
    function SetTextureStageState(dwStage: DWORD;
8302
        dwState: TD3DTextureStageStateType; lpdwValue: DWORD) : HResult; stdcall;
8310
        dwState: TD3DTextureStageStateType; lpdwValue: DWORD) : HResult; stdcall;
8303
    function ValidateDevice(out lpdwExtraPasses: DWORD) : HResult; stdcall;
8311
    function ValidateDevice(out lpdwExtraPasses: DWORD) : HResult; stdcall;
8304
    function ApplyStateBlock(dwBlockHandle: DWORD) : HResult; stdcall;
8312
    function ApplyStateBlock(dwBlockHandle: DWORD) : HResult; stdcall;
8305
    function CaptureStateBlock(dwBlockHandle: DWORD) : HResult; stdcall;
8313
    function CaptureStateBlock(dwBlockHandle: DWORD) : HResult; stdcall;
8306
    function DeleteStateBlock(dwBlockHandle: DWORD) : HResult; stdcall;
8314
    function DeleteStateBlock(dwBlockHandle: DWORD) : HResult; stdcall;
8307
    function CreateStateBlock(d3dsbType: TD3DStateBlockType; out lpdwBlockHandle: DWORD) : HResult; stdcall;
8315
    function CreateStateBlock(d3dsbType: TD3DStateBlockType; out lpdwBlockHandle: DWORD) : HResult; stdcall;
8308
    function Load(lpDestTex: IDirectDrawSurface7; lpDestPoint: PPoint;
8316
    function Load(lpDestTex: IDirectDrawSurface7; lpDestPoint: PPoint;
8309
        lpSrcTex: IDirectDrawSurface7; lprcSrcRect: PRect; dwFlags: DWORD) : HResult; stdcall;
8317
        lpSrcTex: IDirectDrawSurface7; lprcSrcRect: PRect; dwFlags: DWORD) : HResult; stdcall;
8310
    function LightEnable(dwLightIndex: DWORD; bEnable: BOOL) : HResult; stdcall;
8318
    function LightEnable(dwLightIndex: DWORD; bEnable: BOOL) : HResult; stdcall;
8311
    function GetLightEnable(dwLightIndex: DWORD; out bEnable: BOOL) : HResult; stdcall;
8319
    function GetLightEnable(dwLightIndex: DWORD; out bEnable: BOOL) : HResult; stdcall;
8312
    function SetClipPlane(dwIndex: DWORD; var pPlaneEquation: TD3DValue) : HResult; stdcall;
8320
    function SetClipPlane(dwIndex: DWORD; var pPlaneEquation: TD3DValue) : HResult; stdcall;
8313
    function GetClipPlane(dwIndex: DWORD; out pPlaneEquation: TD3DValue) : HResult; stdcall;
8321
    function GetClipPlane(dwIndex: DWORD; out pPlaneEquation: TD3DValue) : HResult; stdcall;
8314
    function GetInfo(dwDevInfoID: DWORD; pDevInfoStruct: Pointer; dwSize: DWORD) : HResult; stdcall;
8322
    function GetInfo(dwDevInfoID: DWORD; pDevInfoStruct: Pointer; dwSize: DWORD) : HResult; stdcall;
8315
  end;
8323
  end;
8316
 
8324
 
8317
(*
8325
(*
8318
 * Execute Buffer interface
8326
 * Execute Buffer interface
8319
 *)
8327
 *)
8320
 
8328
 
8321
  IDirect3DExecuteBuffer = interface (IUnknown)
8329
  IDirect3DExecuteBuffer = interface (IUnknown)
8322
    ['{4417C145-33AD-11CF-816F-0000C020156E}']
8330
    ['{4417C145-33AD-11CF-816F-0000C020156E}']
8323
    (*** IDirect3DExecuteBuffer methods ***)
8331
    (*** IDirect3DExecuteBuffer methods ***)
8324
    function Initialize (lpDirect3DDevice: IDirect3DDevice;
8332
    function Initialize (lpDirect3DDevice: IDirect3DDevice;
8325
        var lpDesc: TD3DExecuteBufferDesc) : HResult; stdcall;
8333
        var lpDesc: TD3DExecuteBufferDesc) : HResult; stdcall;
8326
    function Lock (var lpDesc: TD3DExecuteBufferDesc) : HResult; stdcall;
8334
    function Lock (var lpDesc: TD3DExecuteBufferDesc) : HResult; stdcall;
8327
    function Unlock: HResult; stdcall;
8335
    function Unlock: HResult; stdcall;
8328
    function SetExecuteData (var lpData: TD3DExecuteData) : HResult; stdcall;
8336
    function SetExecuteData (var lpData: TD3DExecuteData) : HResult; stdcall;
8329
    function GetExecuteData (var lpData: TD3DExecuteData) : HResult; stdcall;
8337
    function GetExecuteData (var lpData: TD3DExecuteData) : HResult; stdcall;
8330
    function Validate (var lpdwOffset: DWORD; lpFunc: TD3DValidateCallback;
8338
    function Validate (var lpdwOffset: DWORD; lpFunc: TD3DValidateCallback;
8331
        lpUserArg: Pointer; dwReserved: DWORD) : HResult; stdcall;
8339
        lpUserArg: Pointer; dwReserved: DWORD) : HResult; stdcall;
8332
    (*** Warning!  Optimize is defined differently in the header files
8340
    (*** Warning!  Optimize is defined differently in the header files
8333
         and the online documentation ***)
8341
         and the online documentation ***)
8334
    function Optimize (dwFlags: DWORD) : HResult; stdcall;
8342
    function Optimize (dwFlags: DWORD) : HResult; stdcall;
8335
  end;
8343
  end;
8336
 
8344
 
8337
(*
8345
(*
8338
 * Light interfaces
8346
 * Light interfaces
8339
 *)
8347
 *)
8340
 
8348
 
8341
  IDirect3DLight = interface (IUnknown)
8349
  IDirect3DLight = interface (IUnknown)
8342
    ['{4417C142-33AD-11CF-816F-0000C020156E}']
8350
    ['{4417C142-33AD-11CF-816F-0000C020156E}']
8343
    (*** IDirect3DLight methods ***)
8351
    (*** IDirect3DLight methods ***)
8344
    function Initialize (lpDirect3D: IDirect3D) : HResult; stdcall;
8352
    function Initialize (lpDirect3D: IDirect3D) : HResult; stdcall;
8345
    function SetLight (var lpLight: TD3DLight2) : HResult; stdcall;
8353
    function SetLight (var lpLight: TD3DLight2) : HResult; stdcall;
8346
    function GetLight (var lpLight: TD3DLight2) : HResult; stdcall;
8354
    function GetLight (var lpLight: TD3DLight2) : HResult; stdcall;
8347
  end;
8355
  end;
8348
 
8356
 
8349
(*
8357
(*
8350
 * Material interfaces
8358
 * Material interfaces
8351
 *)
8359
 *)
8352
 
8360
 
8353
  IDirect3DMaterial = interface (IUnknown)
8361
  IDirect3DMaterial = interface (IUnknown)
8354
    ['{4417C144-33AD-11CF-816F-0000C020156E}']
8362
    ['{4417C144-33AD-11CF-816F-0000C020156E}']
8355
    (*** IDirect3DMaterial methods ***)
8363
    (*** IDirect3DMaterial methods ***)
8356
    function Initialize (lpDirect3D: IDirect3D) : HResult; stdcall;
8364
    function Initialize (lpDirect3D: IDirect3D) : HResult; stdcall;
8357
    function SetMaterial (var lpMat: TD3DMaterial) : HResult; stdcall;
8365
    function SetMaterial (var lpMat: TD3DMaterial) : HResult; stdcall;
8358
    function GetMaterial (var lpMat: TD3DMaterial) : HResult; stdcall;
8366
    function GetMaterial (var lpMat: TD3DMaterial) : HResult; stdcall;
8359
    function GetHandle (lpDirect3DDevice: IDirect3DDevice;
8367
    function GetHandle (lpDirect3DDevice: IDirect3DDevice;
8360
        var lpHandle: TD3DMaterialHandle) : HResult; stdcall;
8368
        var lpHandle: TD3DMaterialHandle) : HResult; stdcall;
8361
    function Reserve: HResult; stdcall;
8369
    function Reserve: HResult; stdcall;
8362
    function Unreserve: HResult; stdcall;
8370
    function Unreserve: HResult; stdcall;
8363
  end;
8371
  end;
8364
 
8372
 
8365
  IDirect3DMaterial2 = interface (IUnknown)
8373
  IDirect3DMaterial2 = interface (IUnknown)
8366
    ['{93281503-8cf8-11d0-89ab-00a0c9054129}']
8374
    ['{93281503-8cf8-11d0-89ab-00a0c9054129}']
8367
    (*** IDirect3DMaterial2 methods ***)
8375
    (*** IDirect3DMaterial2 methods ***)
8368
    function SetMaterial (var lpMat: TD3DMaterial) : HResult; stdcall;
8376
    function SetMaterial (var lpMat: TD3DMaterial) : HResult; stdcall;
8369
    function GetMaterial (var lpMat: TD3DMaterial) : HResult; stdcall;
8377
    function GetMaterial (var lpMat: TD3DMaterial) : HResult; stdcall;
8370
    function GetHandle (lpDirect3DDevice: IDirect3DDevice2;
8378
    function GetHandle (lpDirect3DDevice: IDirect3DDevice2;
8371
        var lpHandle: TD3DMaterialHandle) : HResult; stdcall;
8379
        var lpHandle: TD3DMaterialHandle) : HResult; stdcall;
8372
  end;
8380
  end;
8373
 
8381
 
8374
  IDirect3DMaterial3 = interface (IUnknown)
8382
  IDirect3DMaterial3 = interface (IUnknown)
8375
    ['{ca9c46f4-d3c5-11d1-b75a-00600852b312}']
8383
    ['{ca9c46f4-d3c5-11d1-b75a-00600852b312}']
8376
    (*** IDirect3DMaterial2 methods ***)
8384
    (*** IDirect3DMaterial2 methods ***)
8377
    function SetMaterial (var lpMat: TD3DMaterial) : HResult; stdcall;
8385
    function SetMaterial (var lpMat: TD3DMaterial) : HResult; stdcall;
8378
    function GetMaterial (var lpMat: TD3DMaterial) : HResult; stdcall;
8386
    function GetMaterial (var lpMat: TD3DMaterial) : HResult; stdcall;
8379
    function GetHandle (lpDirect3DDevice: IDirect3DDevice3;
8387
    function GetHandle (lpDirect3DDevice: IDirect3DDevice3;
8380
        var lpHandle: TD3DMaterialHandle) : HResult; stdcall;
8388
        var lpHandle: TD3DMaterialHandle) : HResult; stdcall;
8381
  end;
8389
  end;
8382
 
8390
 
8383
(*
8391
(*
8384
 * Texture interfaces
8392
 * Texture interfaces
8385
 *)
8393
 *)
8386
 
8394
 
8387
  IDirect3DTexture = interface (IUnknown)
8395
  IDirect3DTexture = interface (IUnknown)
8388
    ['{2CDCD9E0-25A0-11CF-A31A-00AA00B93356}']
8396
    ['{2CDCD9E0-25A0-11CF-A31A-00AA00B93356}']
8389
    (*** IDirect3DTexture methods ***)
8397
    (*** IDirect3DTexture methods ***)
8390
    function Initialize (lpD3DDevice: IDirect3DDevice;
8398
    function Initialize (lpD3DDevice: IDirect3DDevice;
8391
        lpDDSurface: IDirectDrawSurface) : HResult; stdcall;
8399
        lpDDSurface: IDirectDrawSurface) : HResult; stdcall;
8392
    function GetHandle (lpDirect3DDevice: IDirect3DDevice;
8400
    function GetHandle (lpDirect3DDevice: IDirect3DDevice;
8393
        var lpHandle: TD3DTextureHandle) : HResult; stdcall;
8401
        var lpHandle: TD3DTextureHandle) : HResult; stdcall;
8394
    function PaletteChanged (dwStart: DWORD; dwCount: DWORD) : HResult; stdcall;
8402
    function PaletteChanged (dwStart: DWORD; dwCount: DWORD) : HResult; stdcall;
8395
    function Load (lpD3DTexture: IDirect3DTexture) : HResult; stdcall;
8403
    function Load (lpD3DTexture: IDirect3DTexture) : HResult; stdcall;
8396
    function Unload: HResult; stdcall;
8404
    function Unload: HResult; stdcall;
8397
  end;
8405
  end;
8398
 
8406
 
8399
  IDirect3DTexture2 = interface (IUnknown)
8407
  IDirect3DTexture2 = interface (IUnknown)
8400
    ['{93281502-8cf8-11d0-89ab-00a0c9054129}']
8408
    ['{93281502-8cf8-11d0-89ab-00a0c9054129}']
8401
    (*** IDirect3DTexture2 methods ***)
8409
    (*** IDirect3DTexture2 methods ***)
8402
    function GetHandle (lpDirect3DDevice: IDirect3DDevice2;
8410
    function GetHandle (lpDirect3DDevice: IDirect3DDevice2;
8403
        var lpHandle: TD3DTextureHandle) : HResult; stdcall;
8411
        var lpHandle: TD3DTextureHandle) : HResult; stdcall;
8404
    function PaletteChanged (dwStart: DWORD; dwCount: DWORD) : HResult; stdcall;
8412
    function PaletteChanged (dwStart: DWORD; dwCount: DWORD) : HResult; stdcall;
8405
    function Load (lpD3DTexture: IDirect3DTexture2) : HResult; stdcall;
8413
    function Load (lpD3DTexture: IDirect3DTexture2) : HResult; stdcall;
8406
  end;
8414
  end;
8407
 
8415
 
8408
(*
8416
(*
8409
 * Viewport interfaces
8417
 * Viewport interfaces
8410
 *)
8418
 *)
8411
 
8419
 
8412
  IDirect3DViewport = interface (IUnknown)
8420
  IDirect3DViewport = interface (IUnknown)
8413
    ['{4417C146-33AD-11CF-816F-0000C020156E}']
8421
    ['{4417C146-33AD-11CF-816F-0000C020156E}']
8414
    (*** IDirect3DViewport methods ***)
8422
    (*** IDirect3DViewport methods ***)
8415
    function Initialize (lpDirect3D: IDirect3D) : HResult; stdcall;
8423
    function Initialize (lpDirect3D: IDirect3D) : HResult; stdcall;
8416
    function GetViewport (out lpData: TD3DViewport) : HResult; stdcall;
8424
    function GetViewport (out lpData: TD3DViewport) : HResult; stdcall;
8417
    function SetViewport (const lpData: TD3DViewport) : HResult; stdcall;
8425
    function SetViewport (const lpData: TD3DViewport) : HResult; stdcall;
8418
    function TransformVertices (dwVertexCount: DWORD;
8426
    function TransformVertices (dwVertexCount: DWORD;
8419
        const lpData: TD3DTransformData; dwFlags: DWORD;
8427
        const lpData: TD3DTransformData; dwFlags: DWORD;
8420
        out lpOffscreen: DWORD) : HResult; stdcall;
8428
        out lpOffscreen: DWORD) : HResult; stdcall;
8421
    function LightElements (dwElementCount: DWORD;
8429
    function LightElements (dwElementCount: DWORD;
8422
        var lpData: TD3DLightData) : HResult; stdcall;
8430
        var lpData: TD3DLightData) : HResult; stdcall;
8423
    function SetBackground (hMat: TD3DMaterialHandle) : HResult; stdcall;
8431
    function SetBackground (hMat: TD3DMaterialHandle) : HResult; stdcall;
8424
    function GetBackground (out hMat: TD3DMaterialHandle) : HResult; stdcall;
8432
    function GetBackground (out hMat: TD3DMaterialHandle) : HResult; stdcall;
8425
    function SetBackgroundDepth (lpDDSurface: IDirectDrawSurface) :
8433
    function SetBackgroundDepth (lpDDSurface: IDirectDrawSurface) :
8426
        HResult; stdcall;
8434
        HResult; stdcall;
8427
    function GetBackgroundDepth (out lplpDDSurface: IDirectDrawSurface;
8435
    function GetBackgroundDepth (out lplpDDSurface: IDirectDrawSurface;
8428
        out lpValid: BOOL) : HResult; stdcall;
8436
        out lpValid: BOOL) : HResult; stdcall;
8429
    function Clear (dwCount: DWORD; const lpRects: TD3DRect; dwFlags: DWORD) :
8437
    function Clear (dwCount: DWORD; const lpRects: TD3DRect; dwFlags: DWORD) :
8430
        HResult; stdcall;
8438
        HResult; stdcall;
8431
    function AddLight (lpDirect3DLight: IDirect3DLight) : HResult; stdcall;
8439
    function AddLight (lpDirect3DLight: IDirect3DLight) : HResult; stdcall;
8432
    function DeleteLight (lpDirect3DLight: IDirect3DLight) : HResult; stdcall;
8440
    function DeleteLight (lpDirect3DLight: IDirect3DLight) : HResult; stdcall;
8433
     function NextLight (lpDirect3DLight: IDirect3DLight;
8441
     function NextLight (lpDirect3DLight: IDirect3DLight;
8434
        out lplpDirect3DLight: IDirect3DLight; dwFlags: DWORD) : HResult; stdcall;
8442
        out lplpDirect3DLight: IDirect3DLight; dwFlags: DWORD) : HResult; stdcall;
8435
  end;
8443
  end;
8436
 
8444
 
8437
  IDirect3DViewport2 = interface (IUnknown)
8445
  IDirect3DViewport2 = interface (IUnknown)
8438
    ['{93281500-8cf8-11d0-89ab-00a0c9054129}']
8446
    ['{93281500-8cf8-11d0-89ab-00a0c9054129}']
8439
    (*** IDirect3DViewport2 methods ***)
8447
    (*** IDirect3DViewport2 methods ***)
8440
    function Initialize (lpDirect3D: IDirect3D) : HResult; stdcall;
8448
    function Initialize (lpDirect3D: IDirect3D) : HResult; stdcall;
8441
    function GetViewport (out lpData: TD3DViewport) : HResult; stdcall;
8449
    function GetViewport (out lpData: TD3DViewport) : HResult; stdcall;
8442
    function SetViewport (const lpData: TD3DViewport) : HResult; stdcall;
8450
    function SetViewport (const lpData: TD3DViewport) : HResult; stdcall;
8443
    function TransformVertices (dwVertexCount: DWORD;
8451
    function TransformVertices (dwVertexCount: DWORD;
8444
        const lpData: TD3DTransformData; dwFlags: DWORD;
8452
        const lpData: TD3DTransformData; dwFlags: DWORD;
8445
        out lpOffscreen: DWORD) : HResult; stdcall;
8453
        out lpOffscreen: DWORD) : HResult; stdcall;
8446
    function LightElements (dwElementCount: DWORD;
8454
    function LightElements (dwElementCount: DWORD;
8447
        var lpData: TD3DLightData) : HResult; stdcall;
8455
        var lpData: TD3DLightData) : HResult; stdcall;
8448
    function SetBackground (hMat: TD3DMaterialHandle) : HResult; stdcall;
8456
    function SetBackground (hMat: TD3DMaterialHandle) : HResult; stdcall;
8449
    function GetBackground (out hMat: TD3DMaterialHandle) : HResult; stdcall;
8457
    function GetBackground (out hMat: TD3DMaterialHandle) : HResult; stdcall;
8450
    function SetBackgroundDepth (lpDDSurface: IDirectDrawSurface) :
8458
    function SetBackgroundDepth (lpDDSurface: IDirectDrawSurface) :
8451
        HResult; stdcall;
8459
        HResult; stdcall;
8452
    function GetBackgroundDepth (out lplpDDSurface: IDirectDrawSurface;
8460
    function GetBackgroundDepth (out lplpDDSurface: IDirectDrawSurface;
8453
        out lpValid: BOOL) : HResult; stdcall;
8461
        out lpValid: BOOL) : HResult; stdcall;
8454
    function Clear (dwCount: DWORD; const lpRects: TD3DRect; dwFlags: DWORD) :
8462
    function Clear (dwCount: DWORD; const lpRects: TD3DRect; dwFlags: DWORD) :
8455
        HResult; stdcall;
8463
        HResult; stdcall;
8456
    function AddLight (lpDirect3DLight: IDirect3DLight) : HResult; stdcall;
8464
    function AddLight (lpDirect3DLight: IDirect3DLight) : HResult; stdcall;
8457
    function DeleteLight (lpDirect3DLight: IDirect3DLight) : HResult; stdcall;
8465
    function DeleteLight (lpDirect3DLight: IDirect3DLight) : HResult; stdcall;
8458
    function NextLight (lpDirect3DLight: IDirect3DLight;
8466
    function NextLight (lpDirect3DLight: IDirect3DLight;
8459
        out lplpDirect3DLight: IDirect3DLight; dwFlags: DWORD) : HResult; stdcall;
8467
        out lplpDirect3DLight: IDirect3DLight; dwFlags: DWORD) : HResult; stdcall;
8460
    (*** IDirect3DViewport2 methods ***)
8468
    (*** IDirect3DViewport2 methods ***)
8461
    function GetViewport2 (out lpData: TD3DViewport2) : HResult; stdcall;
8469
    function GetViewport2 (out lpData: TD3DViewport2) : HResult; stdcall;
8462
    function SetViewport2 (const lpData: TD3DViewport2) : HResult; stdcall;
8470
    function SetViewport2 (const lpData: TD3DViewport2) : HResult; stdcall;
8463
  end;
8471
  end;
8464
 
8472
 
8465
  IDirect3DViewport3 = interface (IUnknown)
8473
  IDirect3DViewport3 = interface (IUnknown)
8466
    ['{b0ab3b61-33d7-11d1-a981-00c04fd7b174}']
8474
    ['{b0ab3b61-33d7-11d1-a981-00c04fd7b174}']
8467
    (*** IDirect3DViewport3 methods ***)
8475
    (*** IDirect3DViewport3 methods ***)
8468
    function Initialize (lpDirect3D: IDirect3D) : HResult; stdcall;
8476
    function Initialize (lpDirect3D: IDirect3D) : HResult; stdcall;
8469
    function GetViewport (out lpData: TD3DViewport) : HResult; stdcall;
8477
    function GetViewport (out lpData: TD3DViewport) : HResult; stdcall;
8470
    function SetViewport (const lpData: TD3DViewport) : HResult; stdcall;
8478
    function SetViewport (const lpData: TD3DViewport) : HResult; stdcall;
8471
    function TransformVertices (dwVertexCount: DWORD;
8479
    function TransformVertices (dwVertexCount: DWORD;
8472
        const lpData: TD3DTransformData; dwFlags: DWORD;
8480
        const lpData: TD3DTransformData; dwFlags: DWORD;
8473
        out lpOffscreen: DWORD) : HResult; stdcall;
8481
        out lpOffscreen: DWORD) : HResult; stdcall;
8474
    function LightElements (dwElementCount: DWORD;
8482
    function LightElements (dwElementCount: DWORD;
8475
        var lpData: TD3DLightData) : HResult; stdcall;
8483
        var lpData: TD3DLightData) : HResult; stdcall;
8476
    function SetBackground (hMat: TD3DMaterialHandle) : HResult; stdcall;
8484
    function SetBackground (hMat: TD3DMaterialHandle) : HResult; stdcall;
8477
    function GetBackground (var hMat: TD3DMaterialHandle) : HResult; stdcall;
8485
    function GetBackground (var hMat: TD3DMaterialHandle) : HResult; stdcall;
8478
    function SetBackgroundDepth (
8486
    function SetBackgroundDepth (
8479
        lpDDSurface: IDirectDrawSurface) : HResult; stdcall;
8487
        lpDDSurface: IDirectDrawSurface) : HResult; stdcall;
8480
    function GetBackgroundDepth (out lplpDDSurface: IDirectDrawSurface;
8488
    function GetBackgroundDepth (out lplpDDSurface: IDirectDrawSurface;
8481
        out lpValid: BOOL) : HResult; stdcall;
8489
        out lpValid: BOOL) : HResult; stdcall;
8482
    function Clear (dwCount: DWORD; const lpRects: TD3DRect; dwFlags: DWORD) :
8490
    function Clear (dwCount: DWORD; const lpRects: TD3DRect; dwFlags: DWORD) :
8483
        HResult; stdcall;
8491
        HResult; stdcall;
8484
    function AddLight (lpDirect3DLight: IDirect3DLight) : HResult; stdcall;
8492
    function AddLight (lpDirect3DLight: IDirect3DLight) : HResult; stdcall;
8485
    function DeleteLight (lpDirect3DLight: IDirect3DLight) : HResult; stdcall;
8493
    function DeleteLight (lpDirect3DLight: IDirect3DLight) : HResult; stdcall;
8486
    function NextLight (lpDirect3DLight: IDirect3DLight;
8494
    function NextLight (lpDirect3DLight: IDirect3DLight;
8487
        out lplpDirect3DLight: IDirect3DLight; dwFlags: DWORD) : HResult; stdcall;
8495
        out lplpDirect3DLight: IDirect3DLight; dwFlags: DWORD) : HResult; stdcall;
8488
    function GetViewport2 (out lpData: TD3DViewport2) : HResult; stdcall;
8496
    function GetViewport2 (out lpData: TD3DViewport2) : HResult; stdcall;
8489
    function SetViewport2 (const lpData: TD3DViewport2) : HResult; stdcall;
8497
    function SetViewport2 (const lpData: TD3DViewport2) : HResult; stdcall;
8490
    function SetBackgroundDepth2 (
8498
    function SetBackgroundDepth2 (
8491
        lpDDSurface: IDirectDrawSurface4) : HResult; stdcall;
8499
        lpDDSurface: IDirectDrawSurface4) : HResult; stdcall;
8492
    function GetBackgroundDepth2 (out lplpDDSurface: IDirectDrawSurface4;
8500
    function GetBackgroundDepth2 (out lplpDDSurface: IDirectDrawSurface4;
8493
        out lpValid: BOOL) : HResult; stdcall;
8501
        out lpValid: BOOL) : HResult; stdcall;
8494
    function Clear2 (dwCount: DWORD; const lpRects: TD3DRect; dwFlags: DWORD;
8502
    function Clear2 (dwCount: DWORD; const lpRects: TD3DRect; dwFlags: DWORD;
8495
        dwColor: DWORD; dvZ: TD3DValue; dwStencil: DWORD) : HResult; stdcall;
8503
        dwColor: DWORD; dvZ: TD3DValue; dwStencil: DWORD) : HResult; stdcall;
8496
  end;
8504
  end;
8497
 
8505
 
8498
  IDirect3DVertexBuffer = interface (IUnknown)
8506
  IDirect3DVertexBuffer = interface (IUnknown)
8499
    ['{7a503555-4a83-11d1-a5db-00a0c90367f8}']
8507
    ['{7a503555-4a83-11d1-a5db-00a0c90367f8}']
8500
    (*** IDirect3DVertexBuffer methods ***)
8508
    (*** IDirect3DVertexBuffer methods ***)
8501
    function Lock (dwFlags: DWORD; var lplpData: pointer; var lpdwSize: DWORD)
8509
    function Lock (dwFlags: DWORD; var lplpData: pointer; var lpdwSize: DWORD)
8502
        : HResult; stdcall;
8510
        : HResult; stdcall;
8503
    function Unlock : HResult; stdcall;
8511
    function Unlock : HResult; stdcall;
8504
    function ProcessVertices (dwVertexOp, dwDestIndex, dwCount: DWORD;
8512
    function ProcessVertices (dwVertexOp, dwDestIndex, dwCount: DWORD;
8505
        lpSrcBuffer: IDirect3DVertexBuffer; dwSrcIndex: DWORD;
8513
        lpSrcBuffer: IDirect3DVertexBuffer; dwSrcIndex: DWORD;
8506
        lpD3DDevice: IDirect3DDevice3; dwFlags: DWORD) : HResult; stdcall;
8514
        lpD3DDevice: IDirect3DDevice3; dwFlags: DWORD) : HResult; stdcall;
8507
    function GetVertexBufferDesc (var lpVBDesc: TD3DVertexBufferDesc) : HResult; stdcall;
8515
    function GetVertexBufferDesc (var lpVBDesc: TD3DVertexBufferDesc) : HResult; stdcall;
8508
    function Optimize(lpD3DDevice: IDirect3DDevice3; dwFlags: DWORD) : HResult; stdcall;
8516
    function Optimize(lpD3DDevice: IDirect3DDevice3; dwFlags: DWORD) : HResult; stdcall;
8509
  end;
8517
  end;
8510
 
8518
 
8511
  IDirect3DVertexBuffer7 = interface (IUnknown)
8519
  IDirect3DVertexBuffer7 = interface (IUnknown)
8512
    ['{f5049e7d-4861-11d2-a407-00a0c90629a8}']
8520
    ['{f5049e7d-4861-11d2-a407-00a0c90629a8}']
8513
    (*** IDirect3DVertexBuffer methods ***)
8521
    (*** IDirect3DVertexBuffer methods ***)
8514
    function Lock (dwFlags: DWORD; out lplpData: Pointer; out lpdwSize: DWORD) : HResult; stdcall;
8522
    function Lock (dwFlags: DWORD; out lplpData: Pointer; out lpdwSize: DWORD) : HResult; stdcall;
8515
    function Unlock : HResult; stdcall;
8523
    function Unlock : HResult; stdcall;
8516
    function ProcessVertices (dwVertexOp, dwDestIndex, dwCount: DWORD;
8524
    function ProcessVertices (dwVertexOp, dwDestIndex, dwCount: DWORD;
8517
        lpSrcBuffer: IDirect3DVertexBuffer7; dwSrcIndex: DWORD;
8525
        lpSrcBuffer: IDirect3DVertexBuffer7; dwSrcIndex: DWORD;
8518
        lpD3DDevice: IDirect3DDevice7; dwFlags: DWORD) : HResult; stdcall;
8526
        lpD3DDevice: IDirect3DDevice7; dwFlags: DWORD) : HResult; stdcall;
8519
    function GetVertexBufferDesc (out lpVBDesc: TD3DVertexBufferDesc) : HResult; stdcall;
8527
    function GetVertexBufferDesc (out lpVBDesc: TD3DVertexBufferDesc) : HResult; stdcall;
8520
    function Optimize(lpD3DDevice: IDirect3DDevice7; dwFlags: DWORD) : HResult; stdcall;
8528
    function Optimize(lpD3DDevice: IDirect3DDevice7; dwFlags: DWORD) : HResult; stdcall;
8521
    function ProcessVerticesStrided(dwVertexOp, dwDestIndex, dwCount: DWORD;
8529
    function ProcessVerticesStrided(dwVertexOp, dwDestIndex, dwCount: DWORD;
8522
      lpVertexArray: TD3DDrawPrimitiveStridedData; dwVertexTypeDesc: DWORD;
8530
      lpVertexArray: TD3DDrawPrimitiveStridedData; dwVertexTypeDesc: DWORD;
8523
      lpD3DDevice: IDirect3DDevice7; dwFlags: DWORD) : HResult; stdcall;
8531
      lpD3DDevice: IDirect3DDevice7; dwFlags: DWORD) : HResult; stdcall;
8524
  end;
8532
  end;
8525
 
8533
 
8526
type
8534
type
8527
  IID_IDirect3D = IDirect3D;
8535
  IID_IDirect3D = IDirect3D;
8528
  IID_IDirect3D2 = IDirect3D2;
8536
  IID_IDirect3D2 = IDirect3D2;
8529
  IID_IDirect3D3 = IDirect3D3;
8537
  IID_IDirect3D3 = IDirect3D3;
8530
  IID_IDirect3D7 = IDirect3D7;
8538
  IID_IDirect3D7 = IDirect3D7;
8531
 
8539
 
8532
  IID_IDirect3DDevice = IDirect3DDevice;
8540
  IID_IDirect3DDevice = IDirect3DDevice;
8533
  IID_IDirect3DDevice2 = IDirect3DDevice2;
8541
  IID_IDirect3DDevice2 = IDirect3DDevice2;
8534
  IID_IDirect3DDevice3 = IDirect3DDevice3;
8542
  IID_IDirect3DDevice3 = IDirect3DDevice3;
8535
  IID_IDirect3DDevice7 = IDirect3DDevice7;
8543
  IID_IDirect3DDevice7 = IDirect3DDevice7;
8536
 
8544
 
8537
  IID_IDirect3DTexture = IDirect3DTexture;
8545
  IID_IDirect3DTexture = IDirect3DTexture;
8538
  IID_IDirect3DTexture2 = IDirect3DTexture2;
8546
  IID_IDirect3DTexture2 = IDirect3DTexture2;
8539
  IID_IDirect3DLight = IDirect3DLight;
8547
  IID_IDirect3DLight = IDirect3DLight;
8540
  IID_IDirect3DMaterial = IDirect3DMaterial;
8548
  IID_IDirect3DMaterial = IDirect3DMaterial;
8541
  IID_IDirect3DMaterial2 = IDirect3DMaterial2;
8549
  IID_IDirect3DMaterial2 = IDirect3DMaterial2;
8542
  IID_IDirect3DMaterial3 = IDirect3DMaterial3;
8550
  IID_IDirect3DMaterial3 = IDirect3DMaterial3;
8543
  IID_IDirect3DExecuteBuffer = IDirect3DExecuteBuffer;
8551
  IID_IDirect3DExecuteBuffer = IDirect3DExecuteBuffer;
8544
  IID_IDirect3DViewport = IDirect3DViewport;
8552
  IID_IDirect3DViewport = IDirect3DViewport;
8545
  IID_IDirect3DViewport2 = IDirect3DViewport2;
8553
  IID_IDirect3DViewport2 = IDirect3DViewport2;
8546
  IID_IDirect3DViewport3 = IDirect3DViewport3;
8554
  IID_IDirect3DViewport3 = IDirect3DViewport3;
8547
  IID_IDirect3DVertexBuffer = IDirect3DVertexBuffer;
8555
  IID_IDirect3DVertexBuffer = IDirect3DVertexBuffer;
8548
  IID_IDirect3DVertexBuffer7 = IDirect3DVertexBuffer7;
8556
  IID_IDirect3DVertexBuffer7 = IDirect3DVertexBuffer7;
8549
 
8557
 
8550
 
8558
 
8551
const
8559
const
8552
(****************************************************************************
8560
(****************************************************************************
8553
 *
8561
 *
8554
 * Flags for IDirect3DDevice::NextViewport
8562
 * Flags for IDirect3DDevice::NextViewport
8555
 *
8563
 *
8556
 ****************************************************************************)
8564
 ****************************************************************************)
8557
 
8565
 
8558
(*
8566
(*
8559
 * Return the next viewport
8567
 * Return the next viewport
8560
 *)
8568
 *)
8561
  D3DNEXT_NEXT =        $00000001;
8569
  D3DNEXT_NEXT =        $00000001;
8562
 
8570
 
8563
(*
8571
(*
8564
 * Return the first viewport
8572
 * Return the first viewport
8565
 *)
8573
 *)
8566
  D3DNEXT_HEAD =        $00000002;
8574
  D3DNEXT_HEAD =        $00000002;
8567
 
8575
 
8568
(*
8576
(*
8569
 * Return the last viewport
8577
 * Return the last viewport
8570
 *)
8578
 *)
8571
  D3DNEXT_TAIL =        $00000004;
8579
  D3DNEXT_TAIL =        $00000004;
8572
 
8580
 
8573
 
8581
 
8574
(****************************************************************************
8582
(****************************************************************************
8575
 *
8583
 *
8576
 * Flags for DrawPrimitive/DrawIndexedPrimitive
8584
 * Flags for DrawPrimitive/DrawIndexedPrimitive
8577
 *   Also valid for Begin/BeginIndexed
8585
 *   Also valid for Begin/BeginIndexed
8578
 *   Also valid for VertexBuffer::CreateVertexBuffer
8586
 *   Also valid for VertexBuffer::CreateVertexBuffer
8579
 ****************************************************************************)
8587
 ****************************************************************************)
8580
 
8588
 
8581
(*
8589
(*
8582
 * Wait until the device is ready to draw the primitive
8590
 * Wait until the device is ready to draw the primitive
8583
 * This will cause DP to not return DDERR_WASSTILLDRAWING
8591
 * This will cause DP to not return DDERR_WASSTILLDRAWING
8584
 *)
8592
 *)
8585
  D3DDP_WAIT =                                  $00000001;
8593
  D3DDP_WAIT =                                  $00000001;
8586
 
8594
 
8587
(*
8595
(*
8588
 * Hint that it is acceptable to render the primitive out of order.
8596
 * Hint that it is acceptable to render the primitive out of order.
8589
 *)
8597
 *)
8590
  D3DDP_OUTOFORDER            = $00000002;
8598
  D3DDP_OUTOFORDER            = $00000002;
8591
 
8599
 
8592
(*
8600
(*
8593
 * Hint that the primitives have been clipped by the application.
8601
 * Hint that the primitives have been clipped by the application.
8594
 *)
8602
 *)
8595
  D3DDP_DONOTCLIP =                             $00000004;
8603
  D3DDP_DONOTCLIP =                             $00000004;
8596
 
8604
 
8597
(*
8605
(*
8598
 * Hint that the extents need not be updated.
8606
 * Hint that the extents need not be updated.
8599
 *)
8607
 *)
8600
  D3DDP_DONOTUPDATEEXTENTS =    $00000008;
8608
  D3DDP_DONOTUPDATEEXTENTS =    $00000008;
8601
 
8609
 
8602
(*
8610
(*
8603
 * Hint that the lighting should not be applied on vertices.
8611
 * Hint that the lighting should not be applied on vertices.
8604
 *)
8612
 *)
8605
 
8613
 
8606
  D3DDP_DONOTLIGHT            = $00000010;
8614
  D3DDP_DONOTLIGHT            = $00000010;
8607
 
8615
 
8608
 
8616
 
8609
(*
8617
(*
8610
 * Direct3D Errors
8618
 * Direct3D Errors
8611
 * DirectDraw error codes are used when errors not specified here.
8619
 * DirectDraw error codes are used when errors not specified here.
8612
 *)
8620
 *)
8613
 
8621
 
8614
const
8622
const
8615
  MAKE_D3DHRESULT = HResult($88760000);
8623
  MAKE_D3DHRESULT = HResult($88760000);
8616
 
8624
 
8617
  D3D_OK                          = DD_OK;
8625
  D3D_OK                          = DD_OK;
8618
  D3DERR_BADMAJORVERSION          = MAKE_D3DHRESULT + 700;
8626
  D3DERR_BADMAJORVERSION          = MAKE_D3DHRESULT + 700;
8619
  D3DERR_BADMINORVERSION          = MAKE_D3DHRESULT + 701;
8627
  D3DERR_BADMINORVERSION          = MAKE_D3DHRESULT + 701;
8620
 
8628
 
8621
(*
8629
(*
8622
 * An invalid device was requested by the application.
8630
 * An invalid device was requested by the application.
8623
 *)
8631
 *)
8624
  D3DERR_INVALID_DEVICE   = MAKE_D3DHRESULT + 705;
8632
  D3DERR_INVALID_DEVICE   = MAKE_D3DHRESULT + 705;
8625
  D3DERR_INITFAILED       = MAKE_D3DHRESULT + 706;
8633
  D3DERR_INITFAILED       = MAKE_D3DHRESULT + 706;
8626
 
8634
 
8627
(*
8635
(*
8628
 * SetRenderTarget attempted on a device that was
8636
 * SetRenderTarget attempted on a device that was
8629
 * QI'd off the render target.
8637
 * QI'd off the render target.
8630
 *)
8638
 *)
8631
  D3DERR_DEVICEAGGREGATED = MAKE_D3DHRESULT + 707;
8639
  D3DERR_DEVICEAGGREGATED = MAKE_D3DHRESULT + 707;
8632
 
8640
 
8633
  D3DERR_EXECUTE_CREATE_FAILED    = MAKE_D3DHRESULT + 710;
8641
  D3DERR_EXECUTE_CREATE_FAILED    = MAKE_D3DHRESULT + 710;
8634
  D3DERR_EXECUTE_DESTROY_FAILED   = MAKE_D3DHRESULT + 711;
8642
  D3DERR_EXECUTE_DESTROY_FAILED   = MAKE_D3DHRESULT + 711;
8635
  D3DERR_EXECUTE_LOCK_FAILED      = MAKE_D3DHRESULT + 712;
8643
  D3DERR_EXECUTE_LOCK_FAILED      = MAKE_D3DHRESULT + 712;
8636
  D3DERR_EXECUTE_UNLOCK_FAILED    = MAKE_D3DHRESULT + 713;
8644
  D3DERR_EXECUTE_UNLOCK_FAILED    = MAKE_D3DHRESULT + 713;
8637
  D3DERR_EXECUTE_LOCKED           = MAKE_D3DHRESULT + 714;
8645
  D3DERR_EXECUTE_LOCKED           = MAKE_D3DHRESULT + 714;
8638
  D3DERR_EXECUTE_NOT_LOCKED       = MAKE_D3DHRESULT + 715;
8646
  D3DERR_EXECUTE_NOT_LOCKED       = MAKE_D3DHRESULT + 715;
8639
 
8647
 
8640
  D3DERR_EXECUTE_FAILED           = MAKE_D3DHRESULT + 716;
8648
  D3DERR_EXECUTE_FAILED           = MAKE_D3DHRESULT + 716;
8641
  D3DERR_EXECUTE_CLIPPED_FAILED   = MAKE_D3DHRESULT + 717;
8649
  D3DERR_EXECUTE_CLIPPED_FAILED   = MAKE_D3DHRESULT + 717;
8642
 
8650
 
8643
  D3DERR_TEXTURE_NO_SUPPORT       = MAKE_D3DHRESULT + 720;
8651
  D3DERR_TEXTURE_NO_SUPPORT       = MAKE_D3DHRESULT + 720;
8644
  D3DERR_TEXTURE_CREATE_FAILED    = MAKE_D3DHRESULT + 721;
8652
  D3DERR_TEXTURE_CREATE_FAILED    = MAKE_D3DHRESULT + 721;
8645
  D3DERR_TEXTURE_DESTROY_FAILED   = MAKE_D3DHRESULT + 722;
8653
  D3DERR_TEXTURE_DESTROY_FAILED   = MAKE_D3DHRESULT + 722;
8646
  D3DERR_TEXTURE_LOCK_FAILED      = MAKE_D3DHRESULT + 723;
8654
  D3DERR_TEXTURE_LOCK_FAILED      = MAKE_D3DHRESULT + 723;
8647
  D3DERR_TEXTURE_UNLOCK_FAILED    = MAKE_D3DHRESULT + 724;
8655
  D3DERR_TEXTURE_UNLOCK_FAILED    = MAKE_D3DHRESULT + 724;
8648
  D3DERR_TEXTURE_LOAD_FAILED      = MAKE_D3DHRESULT + 725;
8656
  D3DERR_TEXTURE_LOAD_FAILED      = MAKE_D3DHRESULT + 725;
8649
  D3DERR_TEXTURE_SWAP_FAILED      = MAKE_D3DHRESULT + 726;
8657
  D3DERR_TEXTURE_SWAP_FAILED      = MAKE_D3DHRESULT + 726;
8650
  D3DERR_TEXTURE_LOCKED           = MAKE_D3DHRESULT + 727;
8658
  D3DERR_TEXTURE_LOCKED           = MAKE_D3DHRESULT + 727;
8651
  D3DERR_TEXTURE_NOT_LOCKED       = MAKE_D3DHRESULT + 728;
8659
  D3DERR_TEXTURE_NOT_LOCKED       = MAKE_D3DHRESULT + 728;
8652
  D3DERR_TEXTURE_GETSURF_FAILED   = MAKE_D3DHRESULT + 729;
8660
  D3DERR_TEXTURE_GETSURF_FAILED   = MAKE_D3DHRESULT + 729;
8653
 
8661
 
8654
  D3DERR_MATRIX_CREATE_FAILED     = MAKE_D3DHRESULT + 730;
8662
  D3DERR_MATRIX_CREATE_FAILED     = MAKE_D3DHRESULT + 730;
8655
  D3DERR_MATRIX_DESTROY_FAILED    = MAKE_D3DHRESULT + 731;
8663
  D3DERR_MATRIX_DESTROY_FAILED    = MAKE_D3DHRESULT + 731;
8656
  D3DERR_MATRIX_SETDATA_FAILED    = MAKE_D3DHRESULT + 732;
8664
  D3DERR_MATRIX_SETDATA_FAILED    = MAKE_D3DHRESULT + 732;
8657
  D3DERR_MATRIX_GETDATA_FAILED    = MAKE_D3DHRESULT + 733;
8665
  D3DERR_MATRIX_GETDATA_FAILED    = MAKE_D3DHRESULT + 733;
8658
  D3DERR_SETVIEWPORTDATA_FAILED   = MAKE_D3DHRESULT + 734;
8666
  D3DERR_SETVIEWPORTDATA_FAILED   = MAKE_D3DHRESULT + 734;
8659
 
8667
 
8660
  D3DERR_INVALIDCURRENTVIEWPORT   = MAKE_D3DHRESULT + 735;
8668
  D3DERR_INVALIDCURRENTVIEWPORT   = MAKE_D3DHRESULT + 735;
8661
  D3DERR_INVALIDPRIMITIVETYPE     = MAKE_D3DHRESULT + 736;
8669
  D3DERR_INVALIDPRIMITIVETYPE     = MAKE_D3DHRESULT + 736;
8662
  D3DERR_INVALIDVERTEXTYPE        = MAKE_D3DHRESULT + 737;
8670
  D3DERR_INVALIDVERTEXTYPE        = MAKE_D3DHRESULT + 737;
8663
  D3DERR_TEXTURE_BADSIZE          = MAKE_D3DHRESULT + 738;
8671
  D3DERR_TEXTURE_BADSIZE          = MAKE_D3DHRESULT + 738;
8664
  D3DERR_INVALIDRAMPTEXTURE       = MAKE_D3DHRESULT + 739;
8672
  D3DERR_INVALIDRAMPTEXTURE       = MAKE_D3DHRESULT + 739;
8665
 
8673
 
8666
  D3DERR_MATERIAL_CREATE_FAILED   = MAKE_D3DHRESULT + 740;
8674
  D3DERR_MATERIAL_CREATE_FAILED   = MAKE_D3DHRESULT + 740;
8667
  D3DERR_MATERIAL_DESTROY_FAILED  = MAKE_D3DHRESULT + 741;
8675
  D3DERR_MATERIAL_DESTROY_FAILED  = MAKE_D3DHRESULT + 741;
8668
  D3DERR_MATERIAL_SETDATA_FAILED  = MAKE_D3DHRESULT + 742;
8676
  D3DERR_MATERIAL_SETDATA_FAILED  = MAKE_D3DHRESULT + 742;
8669
  D3DERR_MATERIAL_GETDATA_FAILED  = MAKE_D3DHRESULT + 743;
8677
  D3DERR_MATERIAL_GETDATA_FAILED  = MAKE_D3DHRESULT + 743;
8670
 
8678
 
8671
  D3DERR_INVALIDPALETTE           = MAKE_D3DHRESULT + 744;
8679
  D3DERR_INVALIDPALETTE           = MAKE_D3DHRESULT + 744;
8672
 
8680
 
8673
  D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY = MAKE_D3DHRESULT + 745;
8681
  D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY = MAKE_D3DHRESULT + 745;
8674
  D3DERR_ZBUFF_NEEDS_VIDEOMEMORY  = MAKE_D3DHRESULT + 746;
8682
  D3DERR_ZBUFF_NEEDS_VIDEOMEMORY  = MAKE_D3DHRESULT + 746;
8675
  D3DERR_SURFACENOTINVIDMEM       = MAKE_D3DHRESULT + 747;
8683
  D3DERR_SURFACENOTINVIDMEM       = MAKE_D3DHRESULT + 747;
8676
 
8684
 
8677
  D3DERR_LIGHT_SET_FAILED         = MAKE_D3DHRESULT + 750;
8685
  D3DERR_LIGHT_SET_FAILED         = MAKE_D3DHRESULT + 750;
8678
  D3DERR_LIGHTHASVIEWPORT         = MAKE_D3DHRESULT + 751;
8686
  D3DERR_LIGHTHASVIEWPORT         = MAKE_D3DHRESULT + 751;
8679
  D3DERR_LIGHTNOTINTHISVIEWPORT   = MAKE_D3DHRESULT + 752;
8687
  D3DERR_LIGHTNOTINTHISVIEWPORT   = MAKE_D3DHRESULT + 752;
8680
 
8688
 
8681
  D3DERR_SCENE_IN_SCENE           = MAKE_D3DHRESULT + 760;
8689
  D3DERR_SCENE_IN_SCENE           = MAKE_D3DHRESULT + 760;
8682
  D3DERR_SCENE_NOT_IN_SCENE       = MAKE_D3DHRESULT + 761;
8690
  D3DERR_SCENE_NOT_IN_SCENE       = MAKE_D3DHRESULT + 761;
8683
  D3DERR_SCENE_BEGIN_FAILED       = MAKE_D3DHRESULT + 762;
8691
  D3DERR_SCENE_BEGIN_FAILED       = MAKE_D3DHRESULT + 762;
8684
  D3DERR_SCENE_END_FAILED         = MAKE_D3DHRESULT + 763;
8692
  D3DERR_SCENE_END_FAILED         = MAKE_D3DHRESULT + 763;
8685
 
8693
 
8686
  D3DERR_INBEGIN                  = MAKE_D3DHRESULT + 770;
8694
  D3DERR_INBEGIN                  = MAKE_D3DHRESULT + 770;
8687
  D3DERR_NOTINBEGIN               = MAKE_D3DHRESULT + 771;
8695
  D3DERR_NOTINBEGIN               = MAKE_D3DHRESULT + 771;
8688
  D3DERR_NOVIEWPORTS              = MAKE_D3DHRESULT + 772;
8696
  D3DERR_NOVIEWPORTS              = MAKE_D3DHRESULT + 772;
8689
  D3DERR_VIEWPORTDATANOTSET       = MAKE_D3DHRESULT + 773;
8697
  D3DERR_VIEWPORTDATANOTSET       = MAKE_D3DHRESULT + 773;
8690
  D3DERR_VIEWPORTHASNODEVICE      = MAKE_D3DHRESULT + 774;
8698
  D3DERR_VIEWPORTHASNODEVICE      = MAKE_D3DHRESULT + 774;
8691
  D3DERR_NOCURRENTVIEWPORT        = MAKE_D3DHRESULT + 775;
8699
  D3DERR_NOCURRENTVIEWPORT        = MAKE_D3DHRESULT + 775;
8692
 
8700
 
8693
  D3DERR_INVALIDVERTEXFORMAT      = MAKE_D3DHRESULT + 2048;
8701
  D3DERR_INVALIDVERTEXFORMAT      = MAKE_D3DHRESULT + 2048;
8694
 
8702
 
8695
(*
8703
(*
8696
 * Attempted to CreateTexture on a surface that had a color key
8704
 * Attempted to CreateTexture on a surface that had a color key
8697
 *)
8705
 *)
8698
  D3DERR_COLORKEYATTACHED                 = MAKE_D3DHRESULT + 2050;
8706
  D3DERR_COLORKEYATTACHED                 = MAKE_D3DHRESULT + 2050;
8699
 
8707
 
8700
  D3DERR_VERTEXBUFFEROPTIMIZED            = MAKE_D3DHRESULT + 2060;
8708
  D3DERR_VERTEXBUFFEROPTIMIZED            = MAKE_D3DHRESULT + 2060;
8701
  D3DERR_VBUF_CREATE_FAILED               = MAKE_D3DHRESULT + 2061;
8709
  D3DERR_VBUF_CREATE_FAILED               = MAKE_D3DHRESULT + 2061;
8702
  D3DERR_VERTEXBUFFERLOCKED               = MAKE_D3DHRESULT + 2062;
8710
  D3DERR_VERTEXBUFFERLOCKED               = MAKE_D3DHRESULT + 2062;
8703
 
8711
 
8704
  D3DERR_ZBUFFER_NOTPRESENT               = MAKE_D3DHRESULT + 2070;
8712
  D3DERR_ZBUFFER_NOTPRESENT               = MAKE_D3DHRESULT + 2070;
8705
  D3DERR_STENCILBUFFER_NOTPRESENT         = MAKE_D3DHRESULT + 2071;
8713
  D3DERR_STENCILBUFFER_NOTPRESENT         = MAKE_D3DHRESULT + 2071;
8706
 
8714
 
8707
  D3DERR_WRONGTEXTUREFORMAT               = MAKE_D3DHRESULT + 2072;
8715
  D3DERR_WRONGTEXTUREFORMAT               = MAKE_D3DHRESULT + 2072;
8708
  D3DERR_UNSUPPORTEDCOLOROPERATION        = MAKE_D3DHRESULT + 2073;
8716
  D3DERR_UNSUPPORTEDCOLOROPERATION        = MAKE_D3DHRESULT + 2073;
8709
  D3DERR_UNSUPPORTEDCOLORARG              = MAKE_D3DHRESULT + 2074;
8717
  D3DERR_UNSUPPORTEDCOLORARG              = MAKE_D3DHRESULT + 2074;
8710
  D3DERR_UNSUPPORTEDALPHAOPERATION        = MAKE_D3DHRESULT + 2075;
8718
  D3DERR_UNSUPPORTEDALPHAOPERATION        = MAKE_D3DHRESULT + 2075;
8711
  D3DERR_UNSUPPORTEDALPHAARG              = MAKE_D3DHRESULT + 2076;
8719
  D3DERR_UNSUPPORTEDALPHAARG              = MAKE_D3DHRESULT + 2076;
8712
  D3DERR_TOOMANYOPERATIONS                = MAKE_D3DHRESULT + 2077;
8720
  D3DERR_TOOMANYOPERATIONS                = MAKE_D3DHRESULT + 2077;
8713
  D3DERR_CONFLICTINGTEXTUREFILTER         = MAKE_D3DHRESULT + 2078;
8721
  D3DERR_CONFLICTINGTEXTUREFILTER         = MAKE_D3DHRESULT + 2078;
8714
  D3DERR_UNSUPPORTEDFACTORVALUE           = MAKE_D3DHRESULT + 2079;
8722
  D3DERR_UNSUPPORTEDFACTORVALUE           = MAKE_D3DHRESULT + 2079;
8715
  D3DERR_CONFLICTINGRENDERSTATE           = MAKE_D3DHRESULT + 2081;
8723
  D3DERR_CONFLICTINGRENDERSTATE           = MAKE_D3DHRESULT + 2081;
8716
  D3DERR_UNSUPPORTEDTEXTUREFILTER         = MAKE_D3DHRESULT + 2082;
8724
  D3DERR_UNSUPPORTEDTEXTUREFILTER         = MAKE_D3DHRESULT + 2082;
8717
  D3DERR_TOOMANYPRIMITIVES                = MAKE_D3DHRESULT + 2083;
8725
  D3DERR_TOOMANYPRIMITIVES                = MAKE_D3DHRESULT + 2083;
8718
  D3DERR_INVALIDMATRIX                    = MAKE_D3DHRESULT + 2084;
8726
  D3DERR_INVALIDMATRIX                    = MAKE_D3DHRESULT + 2084;
8719
  D3DERR_TOOMANYVERTICES                  = MAKE_D3DHRESULT + 2085;
8727
  D3DERR_TOOMANYVERTICES                  = MAKE_D3DHRESULT + 2085;
8720
  D3DERR_CONFLICTINGTEXTUREPALETTE        = MAKE_D3DHRESULT + 2086;
8728
  D3DERR_CONFLICTINGTEXTUREPALETTE        = MAKE_D3DHRESULT + 2086;
8721
 
8729
 
8722
  D3DERR_INVALIDSTATEBLOCK        = MAKE_D3DHRESULT + 2100;
8730
  D3DERR_INVALIDSTATEBLOCK        = MAKE_D3DHRESULT + 2100;
8723
  D3DERR_INBEGINSTATEBLOCK        = MAKE_D3DHRESULT + 2101;
8731
  D3DERR_INBEGINSTATEBLOCK        = MAKE_D3DHRESULT + 2101;
8724
  D3DERR_NOTINBEGINSTATEBLOCK     = MAKE_D3DHRESULT + 2102;
8732
  D3DERR_NOTINBEGINSTATEBLOCK     = MAKE_D3DHRESULT + 2102;
8725
 
8733
 
8726
procedure DisableFPUExceptions;
8734
procedure DisableFPUExceptions;
8727
procedure EnableFPUExceptions;
8735
procedure EnableFPUExceptions;
8728
 
8736
 
8729
(***************************************************************************
8737
(***************************************************************************
8730
 *
8738
 *
8731
 *  Copyright (C) 1998-1999 Microsoft Corporation.  All Rights Reserved.
8739
 *  Copyright (C) 1998-1999 Microsoft Corporation.  All Rights Reserved.
8732
 *
8740
 *
8733
 *  File:       dxfile.h
8741
 *  File:       dxfile.h
8734
 *
8742
 *
8735
 *  Content:    DirectX File public header file
8743
 *  Content:    DirectX File public header file
8736
 *
8744
 *
8737
 ***************************************************************************)
8745
 ***************************************************************************)
8738
 
8746
 
8739
var
8747
var
8740
  DXFileDLL : HMODULE;
8748
  DXFileDLL : HMODULE;
8741
 
8749
 
8742
function DXFileErrorString(Value: HResult) : string;
8750
function DXFileErrorString(Value: HResult) : string;
8743
 
8751
 
8744
type
8752
type
8745
  TDXFileFormat = (
8753
  TDXFileFormat = (
8746
    DXFILEFORMAT_BINARY,
8754
    DXFILEFORMAT_BINARY,
8747
    DXFILEFORMAT_TEXT,
8755
    DXFILEFORMAT_TEXT,
8748
    DXFILEFORMAT_COMPRESSED
8756
    DXFILEFORMAT_COMPRESSED
8749
  );
8757
  );
8750
 
8758
 
8751
  TDXFileLoadOptions = (
8759
  TDXFileLoadOptions = (
8752
    DXFILELOAD_FROMFILE,
8760
    DXFILELOAD_FROMFILE,
8753
    DXFILELOAD_FROMRESOURCE,
8761
    DXFILELOAD_FROMRESOURCE,
8754
    DXFILELOAD_FROMMEMORY,
8762
    DXFILELOAD_FROMMEMORY,
8755
    DXFILELOAD_INVALID_3,
8763
    DXFILELOAD_INVALID_3,
8756
    DXFILELOAD_FROMSTREAM,
8764
    DXFILELOAD_FROMSTREAM,
8757
    DXFILELOAD_INVALID_5,
8765
    DXFILELOAD_INVALID_5,
8758
    DXFILELOAD_INVALID_6,
8766
    DXFILELOAD_INVALID_6,
8759
    DXFILELOAD_INVALID_7,
8767
    DXFILELOAD_INVALID_7,
8760
    DXFILELOAD_FROMURL
8768
    DXFILELOAD_FROMURL
8761
  );
8769
  );
8762
 
8770
 
8763
  PDXFileLoadResource = ^TDXFileLoadResource;
8771
  PDXFileLoadResource = ^TDXFileLoadResource;
8764
  TDXFileLoadResource = packed record
8772
  TDXFileLoadResource = packed record
8765
    hModule: HModule;
8773
    hModule: HModule;
8766
    lpName: PAnsiChar;
8774
    lpName: PAnsiChar;
8767
    lpType: PAnsiChar;
8775
    lpType: PAnsiChar;
8768
  end;
8776
  end;
8769
 
8777
 
8770
  PDXFileLoadMemory = ^TDXFileLoadMemory;
8778
  PDXFileLoadMemory = ^TDXFileLoadMemory;
8771
  TDXFileLoadMemory = packed record
8779
  TDXFileLoadMemory = packed record
8772
    lpMemory: Pointer;
8780
    lpMemory: Pointer;
8773
    dSize: DWORD;
8781
    dSize: DWORD;
8774
  end;
8782
  end;
8775
 
8783
 
8776
(*
8784
(*
8777
 * DirectX File object types.
8785
 * DirectX File object types.
8778
 *)
8786
 *)
8779
 
8787
 
8780
  IDirectXFile = interface;
8788
  IDirectXFile = interface;
8781
  IDirectXFileEnumObject = interface;
8789
  IDirectXFileEnumObject = interface;
8782
  IDirectXFileSaveObject = interface;
8790
  IDirectXFileSaveObject = interface;
8783
  IDirectXFileObject = interface;
8791
  IDirectXFileObject = interface;
8784
  IDirectXFileData = interface;
8792
  IDirectXFileData = interface;
8785
  IDirectXFileDataReference = interface;
8793
  IDirectXFileDataReference = interface;
8786
  IDirectXFileBinary = interface;
8794
  IDirectXFileBinary = interface;
8787
 
8795
 
8788
(*
8796
(*
8789
 * DirectX File interfaces.
8797
 * DirectX File interfaces.
8790
 *)
8798
 *)
8791
 
8799
 
8792
  IDirectXFile = interface (IUnknown)
8800
  IDirectXFile = interface (IUnknown)
8793
    ['{3d82ab40-62da-11cf-ab39-0020af71e433}']
8801
    ['{3d82ab40-62da-11cf-ab39-0020af71e433}']
8794
    function CreateEnumObject (pvSource: Pointer;
8802
    function CreateEnumObject (pvSource: Pointer;
8795
        dwLoadOptions: TDXFileLoadOptions;
8803
        dwLoadOptions: TDXFileLoadOptions;
8796
        var ppEnumObj: IDirectXFileEnumObject) : HResult; stdcall;
8804
        var ppEnumObj: IDirectXFileEnumObject) : HResult; stdcall;
8797
    function CreateSaveObject (szFileName: PChar; dwFileFormat: TDXFileFormat;
8805
    function CreateSaveObject (szFileName: PChar; dwFileFormat: TDXFileFormat;
8798
        var ppSaveObj: IDirectXFileSaveObject) : HResult; stdcall;
8806
        var ppSaveObj: IDirectXFileSaveObject) : HResult; stdcall;
8799
    function RegisterTemplates (pvData: Pointer; cbSize: DWORD) : HResult; stdcall;
8807
    function RegisterTemplates (pvData: Pointer; cbSize: DWORD) : HResult; stdcall;
8800
  end;
8808
  end;
8801
 
8809
 
8802
  IDirectXFileEnumObject = interface (IUnknown)
8810
  IDirectXFileEnumObject = interface (IUnknown)
8803
    ['{3d82ab41-62da-11cf-ab39-0020af71e433}']
8811
    ['{3d82ab41-62da-11cf-ab39-0020af71e433}']
8804
    function GetNextDataObject (var ppDataObj: IDirectXFileData) : HResult; stdcall;
8812
    function GetNextDataObject (var ppDataObj: IDirectXFileData) : HResult; stdcall;
8805
    function GetDataObjectById
8813
    function GetDataObjectById
8806
        (const rguid: TGUID; var ppDataObj: IDirectXFileData) : HResult; stdcall;
8814
        (const rguid: TGUID; var ppDataObj: IDirectXFileData) : HResult; stdcall;
8807
    function GetDataObjectByName
8815
    function GetDataObjectByName
8808
        (szName: PChar; var ppDataObj: IDirectXFileData) : HResult; stdcall;
8816
        (szName: PChar; var ppDataObj: IDirectXFileData) : HResult; stdcall;
8809
  end;
8817
  end;
8810
 
8818
 
8811
  IDirectXFileSaveObject = interface (IUnknown)
8819
  IDirectXFileSaveObject = interface (IUnknown)
8812
    ['{3d82ab42-62da-11cf-ab39-0020af71e433}']
8820
    ['{3d82ab42-62da-11cf-ab39-0020af71e433}']
8813
    function SaveTemplates
8821
    function SaveTemplates
8814
        (cTemplates: DWORD; var ppguidTemplates: PGUID) : HResult; stdcall;
8822
        (cTemplates: DWORD; var ppguidTemplates: PGUID) : HResult; stdcall;
8815
    function CreateDataObject (const rguidTemplate: TGUID; szName: PChar;
8823
    function CreateDataObject (const rguidTemplate: TGUID; szName: PChar;
8816
        pguid: PGUID; cbSize: DWORD; pvData: Pointer;
8824
        pguid: PGUID; cbSize: DWORD; pvData: Pointer;
8817
        var ppDataObj: IDirectXFileData) : HResult; stdcall;
8825
        var ppDataObj: IDirectXFileData) : HResult; stdcall;
8818
    function SaveData (pDataObj: IDirectXFileData) : HResult; stdcall;
8826
    function SaveData (pDataObj: IDirectXFileData) : HResult; stdcall;
8819
  end;
8827
  end;
8820
 
8828
 
8821
  IDirectXFileObject = interface (IUnknown)
8829
  IDirectXFileObject = interface (IUnknown)
8822
    ['{3d82ab43-62da-11cf-ab39-0020af71e433}']
8830
    ['{3d82ab43-62da-11cf-ab39-0020af71e433}']
8823
    function GetName (pstrNameBuf: PChar; var dwBufLen: DWORD) : HResult; stdcall;
8831
    function GetName (pstrNameBuf: PChar; var dwBufLen: DWORD) : HResult; stdcall;
8824
    function GetId (var pGuidBuf: TGUID) : HResult; stdcall;
8832
    function GetId (var pGuidBuf: TGUID) : HResult; stdcall;
8825
  end;
8833
  end;
8826
 
8834
 
8827
  IDirectXFileData = interface (IDirectXFileObject)
8835
  IDirectXFileData = interface (IDirectXFileObject)
8828
    ['{3d82ab44-62da-11cf-ab39-0020af71e433}']
8836
    ['{3d82ab44-62da-11cf-ab39-0020af71e433}']
8829
    function GetData
8837
    function GetData
8830
        (szMember: PChar; var pcbSize: DWORD; var ppvData: Pointer) : HResult; stdcall;
8838
        (szMember: PChar; var pcbSize: DWORD; var ppvData: Pointer) : HResult; stdcall;
8831
    function GetType (var ppguid: PGUID) : HResult; stdcall;
8839
    function GetType (var ppguid: PGUID) : HResult; stdcall;
8832
    function GetNextObject (var ppChildObj: IDirectXFileObject) : HResult; stdcall;
8840
    function GetNextObject (var ppChildObj: IDirectXFileObject) : HResult; stdcall;
8833
    function AddDataObject (pDataObj: IDirectXFileData) : HResult; stdcall;
8841
    function AddDataObject (pDataObj: IDirectXFileData) : HResult; stdcall;
8834
    function AddDataReference (szRef: PChar; pguidRef: PGUID) : HResult; stdcall;
8842
    function AddDataReference (szRef: PChar; pguidRef: PGUID) : HResult; stdcall;
8835
    function AddBinaryObject (szName: PChar; pguid: PGUID; szMimeType: PChar;
8843
    function AddBinaryObject (szName: PChar; pguid: PGUID; szMimeType: PChar;
8836
        pvData: Pointer; cbSize: DWORD) : HResult; stdcall;
8844
        pvData: Pointer; cbSize: DWORD) : HResult; stdcall;
8837
  end;
8845
  end;
8838
 
8846
 
8839
  IDirectXFileDataReference = interface (IDirectXFileObject)
8847
  IDirectXFileDataReference = interface (IDirectXFileObject)
8840
    ['{3d82ab45-62da-11cf-ab39-0020af71e433}']
8848
    ['{3d82ab45-62da-11cf-ab39-0020af71e433}']
8841
    function Resolve (var ppDataObj: IDirectXFileData) : HResult; stdcall;
8849
    function Resolve (var ppDataObj: IDirectXFileData) : HResult; stdcall;
8842
  end;
8850
  end;
8843
 
8851
 
8844
  IDirectXFileBinary = interface (IDirectXFileObject)
8852
  IDirectXFileBinary = interface (IDirectXFileObject)
8845
    ['{3d82ab46-62da-11cf-ab39-0020af71e433}']
8853
    ['{3d82ab46-62da-11cf-ab39-0020af71e433}']
8846
    function GetSize (var pcbSize: DWORD) : HResult; stdcall;
8854
    function GetSize (var pcbSize: DWORD) : HResult; stdcall;
8847
    function GetMimeType (var pszMimeType: PChar) : HResult; stdcall;
8855
    function GetMimeType (var pszMimeType: PChar) : HResult; stdcall;
8848
    function Read(pvData: Pointer; cbSize: DWORD; pcbRead: PDWORD{?}) : HResult; stdcall;
8856
    function Read(pvData: Pointer; cbSize: DWORD; pcbRead: PDWORD{?}) : HResult; stdcall;
8849
  end;
8857
  end;
8850
 
8858
 
8851
const
8859
const
8852
 
8860
 
8853
(*
8861
(*
8854
 * DirectXFile Object Class Id (for CoCreateInstance())
8862
 * DirectXFile Object Class Id (for CoCreateInstance())
8855
 *)
8863
 *)
8856
 
8864
 
8857
   CLSID_CDirectXFile: TGUID =
8865
   CLSID_CDirectXFile: TGUID =
8858
       (D1:$4516ec43;D2:$8f20;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
8866
       (D1:$4516ec43;D2:$8f20;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
8859
 
8867
 
8860
(*
8868
(*
8861
 * DirectX File Interface GUIDs.
8869
 * DirectX File Interface GUIDs.
8862
 *)
8870
 *)
8863
 
8871
 
8864
type
8872
type
8865
  IID_IDirectXFile = IDirectXFile;
8873
  IID_IDirectXFile = IDirectXFile;
8866
  IID_IDirectXFileEnumObject = IDirectXFileEnumObject;
8874
  IID_IDirectXFileEnumObject = IDirectXFileEnumObject;
8867
  IID_IDirectXFileSaveObject = IDirectXFileSaveObject;
8875
  IID_IDirectXFileSaveObject = IDirectXFileSaveObject;
8868
  IID_IDirectXFileObject = IDirectXFileObject;
8876
  IID_IDirectXFileObject = IDirectXFileObject;
8869
  IID_IDirectXFileData = IDirectXFileData;
8877
  IID_IDirectXFileData = IDirectXFileData;
8870
  IID_IDirectXFileDataReference = IDirectXFileDataReference;
8878
  IID_IDirectXFileDataReference = IDirectXFileDataReference;
8871
  IID_IDirectXFileBinary = IDirectXFileBinary;
8879
  IID_IDirectXFileBinary = IDirectXFileBinary;
8872
 
8880
 
8873
(*
8881
(*
8874
 * DirectX File Header template's GUID.
8882
 * DirectX File Header template's GUID.
8875
 *)
8883
 *)
8876
const
8884
const
8877
  TID_DXFILEHeader: TGUID =
8885
  TID_DXFILEHeader: TGUID =
8878
      (D1:$3d82ab43;D2:$62da;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
8886
      (D1:$3d82ab43;D2:$62da;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
8879
 
8887
 
8880
(*
8888
(*
8881
 * DirectX File errors.
8889
 * DirectX File errors.
8882
 *)
8890
 *)
8883
 
8891
 
8884
const
8892
const
8885
  DXFILE_OK = 0;
8893
  DXFILE_OK = 0;
8886
 
8894
 
8887
  DXFILEERR_BADOBJECT                 = MAKE_D3DHRESULT or 850;
8895
  DXFILEERR_BADOBJECT                 = MAKE_D3DHRESULT or 850;
8888
  DXFILEERR_BADVALUE                  = MAKE_D3DHRESULT or 851;
8896
  DXFILEERR_BADVALUE                  = MAKE_D3DHRESULT or 851;
8889
  DXFILEERR_BADTYPE                   = MAKE_D3DHRESULT or 852;
8897
  DXFILEERR_BADTYPE                   = MAKE_D3DHRESULT or 852;
8890
  DXFILEERR_BADSTREAMHANDLE           = MAKE_D3DHRESULT or 853;
8898
  DXFILEERR_BADSTREAMHANDLE           = MAKE_D3DHRESULT or 853;
8891
  DXFILEERR_BADALLOC                  = MAKE_D3DHRESULT or 854;
8899
  DXFILEERR_BADALLOC                  = MAKE_D3DHRESULT or 854;
8892
  DXFILEERR_NOTFOUND                  = MAKE_D3DHRESULT or 855;
8900
  DXFILEERR_NOTFOUND                  = MAKE_D3DHRESULT or 855;
8893
  DXFILEERR_NOTDONEYET                = MAKE_D3DHRESULT or 856;
8901
  DXFILEERR_NOTDONEYET                = MAKE_D3DHRESULT or 856;
8894
  DXFILEERR_FILENOTFOUND              = MAKE_D3DHRESULT or 857;
8902
  DXFILEERR_FILENOTFOUND              = MAKE_D3DHRESULT or 857;
8895
  DXFILEERR_RESOURCENOTFOUND          = MAKE_D3DHRESULT or 858;
8903
  DXFILEERR_RESOURCENOTFOUND          = MAKE_D3DHRESULT or 858;
8896
  DXFILEERR_URLNOTFOUND               = MAKE_D3DHRESULT or 859;
8904
  DXFILEERR_URLNOTFOUND               = MAKE_D3DHRESULT or 859;
8897
  DXFILEERR_BADRESOURCE               = MAKE_D3DHRESULT or 860;
8905
  DXFILEERR_BADRESOURCE               = MAKE_D3DHRESULT or 860;
8898
  DXFILEERR_BADFILETYPE               = MAKE_D3DHRESULT or 861;
8906
  DXFILEERR_BADFILETYPE               = MAKE_D3DHRESULT or 861;
8899
  DXFILEERR_BADFILEVERSION            = MAKE_D3DHRESULT or 862;
8907
  DXFILEERR_BADFILEVERSION            = MAKE_D3DHRESULT or 862;
8900
  DXFILEERR_BADFILEFLOATSIZE          = MAKE_D3DHRESULT or 863;
8908
  DXFILEERR_BADFILEFLOATSIZE          = MAKE_D3DHRESULT or 863;
8901
  DXFILEERR_BADFILECOMPRESSIONTYPE    = MAKE_D3DHRESULT or 864;
8909
  DXFILEERR_BADFILECOMPRESSIONTYPE    = MAKE_D3DHRESULT or 864;
8902
  DXFILEERR_BADFILE                   = MAKE_D3DHRESULT or 865;
8910
  DXFILEERR_BADFILE                   = MAKE_D3DHRESULT or 865;
8903
  DXFILEERR_PARSEERROR                = MAKE_D3DHRESULT or 866;
8911
  DXFILEERR_PARSEERROR                = MAKE_D3DHRESULT or 866;
8904
  DXFILEERR_NOTEMPLATE                = MAKE_D3DHRESULT or 867;
8912
  DXFILEERR_NOTEMPLATE                = MAKE_D3DHRESULT or 867;
8905
  DXFILEERR_BADARRAYSIZE              = MAKE_D3DHRESULT or 868;
8913
  DXFILEERR_BADARRAYSIZE              = MAKE_D3DHRESULT or 868;
8906
  DXFILEERR_BADDATAREFERENCE          = MAKE_D3DHRESULT or 869;
8914
  DXFILEERR_BADDATAREFERENCE          = MAKE_D3DHRESULT or 869;
8907
  DXFILEERR_INTERNALERROR             = MAKE_D3DHRESULT or 870;
8915
  DXFILEERR_INTERNALERROR             = MAKE_D3DHRESULT or 870;
8908
  DXFILEERR_NOMOREOBJECTS             = MAKE_D3DHRESULT or 871;
8916
  DXFILEERR_NOMOREOBJECTS             = MAKE_D3DHRESULT or 871;
8909
  DXFILEERR_BADINTRINSICS             = MAKE_D3DHRESULT or 872;
8917
  DXFILEERR_BADINTRINSICS             = MAKE_D3DHRESULT or 872;
8910
  DXFILEERR_NOMORESTREAMHANDLES       = MAKE_D3DHRESULT or 873;
8918
  DXFILEERR_NOMORESTREAMHANDLES       = MAKE_D3DHRESULT or 873;
8911
  DXFILEERR_NOMOREDATA                = MAKE_D3DHRESULT or 874;
8919
  DXFILEERR_NOMOREDATA                = MAKE_D3DHRESULT or 874;
8912
  DXFILEERR_BADCACHEFILE              = MAKE_D3DHRESULT or 875;
8920
  DXFILEERR_BADCACHEFILE              = MAKE_D3DHRESULT or 875;
8913
  DXFILEERR_NOINTERNET                = MAKE_D3DHRESULT or 876;
8921
  DXFILEERR_NOINTERNET                = MAKE_D3DHRESULT or 876;
8914
 
8922
 
8915
{$IFDEF D3DRM}
8923
{$IFDEF D3DRM}
8916
(*
8924
(*
8917
 * API for creating IDirectXFile interface.
8925
 * API for creating IDirectXFile interface.
8918
 *)
8926
 *)
8919
 
8927
 
8920
var
8928
var
8921
  DirectXFileCreate : function
8929
  DirectXFileCreate : function
8922
    (out lplpDirectXFile: IDirectXFile) : HResult; stdcall;
8930
    (out lplpDirectXFile: IDirectXFile) : HResult; stdcall;
8923
 
8931
 
8924
(* D3DRM XFile templates in binary form *)
8932
(* D3DRM XFile templates in binary form *)
8925
const
8933
const
8926
  D3DRM_XTEMPLATE_BYTES = 3215;
8934
  D3DRM_XTEMPLATE_BYTES = 3215;
8927
  D3DRM_XTEMPLATES: array [0..D3DRM_XTEMPLATE_BYTES-1] of byte = (
8935
  D3DRM_XTEMPLATES: array [0..D3DRM_XTEMPLATE_BYTES-1] of byte = (
8928
        $78, $6f, $66, $20, $30, $33, $30, $32, $62,
8936
        $78, $6f, $66, $20, $30, $33, $30, $32, $62,
8929
        $69, $6e, $20, $30, $30, $36, $34, $1f, 0, $1,
8937
        $69, $6e, $20, $30, $30, $36, $34, $1f, 0, $1,
8930
        0, $6, 0, 0, 0, $48, $65, $61, $64, $65,
8938
        0, $6, 0, 0, 0, $48, $65, $61, $64, $65,
8931
        $72, $a, 0, $5, 0, $43, $ab, $82, $3d, $da,
8939
        $72, $a, 0, $5, 0, $43, $ab, $82, $3d, $da,
8932
        $62, $cf, $11, $ab, $39, 0, $20, $af, $71, $e4,
8940
        $62, $cf, $11, $ab, $39, 0, $20, $af, $71, $e4,
8933
        $33, $28, 0, $1, 0, $5, 0, 0, 0, $6d,
8941
        $33, $28, 0, $1, 0, $5, 0, 0, 0, $6d,
8934
        $61, $6a, $6f, $72, $14, 0, $28, 0, $1, 0,
8942
        $61, $6a, $6f, $72, $14, 0, $28, 0, $1, 0,
8935
        $5, 0, 0, 0, $6d, $69, $6e, $6f, $72, $14,
8943
        $5, 0, 0, 0, $6d, $69, $6e, $6f, $72, $14,
8936
        0, $29, 0, $1, 0, $5, 0, 0, 0, $66,
8944
        0, $29, 0, $1, 0, $5, 0, 0, 0, $66,
8937
        $6c, $61, $67, $73, $14, 0, $b, 0, $1f, 0,
8945
        $6c, $61, $67, $73, $14, 0, $b, 0, $1f, 0,
8938
        $1, 0, $6, 0, 0, 0, $56, $65, $63, $74,
8946
        $1, 0, $6, 0, 0, 0, $56, $65, $63, $74,
8939
        $6f, $72, $a, 0, $5, 0, $5e, $ab, $82, $3d,
8947
        $6f, $72, $a, 0, $5, 0, $5e, $ab, $82, $3d,
8940
        $da, $62, $cf, $11, $ab, $39, 0, $20, $af, $71,
8948
        $da, $62, $cf, $11, $ab, $39, 0, $20, $af, $71,
8941
        $e4, $33, $2a, 0, $1, 0, $1, 0, 0, 0,
8949
        $e4, $33, $2a, 0, $1, 0, $1, 0, 0, 0,
8942
        $78, $14, 0, $2a, 0, $1, 0, $1, 0, 0,
8950
        $78, $14, 0, $2a, 0, $1, 0, $1, 0, 0,
8943
        0, $79, $14, 0, $2a, 0, $1, 0, $1, 0,
8951
        0, $79, $14, 0, $2a, 0, $1, 0, $1, 0,
8944
        0, 0, $7a, $14, 0, $b, 0, $1f, 0, $1,
8952
        0, 0, $7a, $14, 0, $b, 0, $1f, 0, $1,
8945
        0, $8, 0, 0, 0, $43, $6f, $6f, $72, $64,
8953
        0, $8, 0, 0, 0, $43, $6f, $6f, $72, $64,
8946
        $73, $32, $64, $a, 0, $5, 0, $44, $3f, $f2,
8954
        $73, $32, $64, $a, 0, $5, 0, $44, $3f, $f2,
8947
        $f6, $86, $76, $cf, $11, $8f, $52, 0, $40, $33,
8955
        $f6, $86, $76, $cf, $11, $8f, $52, 0, $40, $33,
8948
        $35, $94, $a3, $2a, 0, $1, 0, $1, 0, 0,
8956
        $35, $94, $a3, $2a, 0, $1, 0, $1, 0, 0,
8949
        0, $75, $14, 0, $2a, 0, $1, 0, $1, 0,
8957
        0, $75, $14, 0, $2a, 0, $1, 0, $1, 0,
8950
        0, 0, $76, $14, 0, $b, 0, $1f, 0, $1,
8958
        0, 0, $76, $14, 0, $b, 0, $1f, 0, $1,
8951
        0, $9, 0, 0, 0, $4d, $61, $74, $72, $69,
8959
        0, $9, 0, 0, 0, $4d, $61, $74, $72, $69,
8952
        $78, $34, $78, $34, $a, 0, $5, 0, $45, $3f,
8960
        $78, $34, $78, $34, $a, 0, $5, 0, $45, $3f,
8953
        $f2, $f6, $86, $76, $cf, $11, $8f, $52, 0, $40,
8961
        $f2, $f6, $86, $76, $cf, $11, $8f, $52, 0, $40,
8954
        $33, $35, $94, $a3, $34, 0, $2a, 0, $1, 0,
8962
        $33, $35, $94, $a3, $34, 0, $2a, 0, $1, 0,
8955
        $6, 0, 0, 0, $6d, $61, $74, $72, $69, $78,
8963
        $6, 0, 0, 0, $6d, $61, $74, $72, $69, $78,
8956
        $e, 0, $3, 0, $10, 0, 0, 0, $f, 0,
8964
        $e, 0, $3, 0, $10, 0, 0, 0, $f, 0,
8957
        $14, 0, $b, 0, $1f, 0, $1, 0, $9, 0,
8965
        $14, 0, $b, 0, $1f, 0, $1, 0, $9, 0,
8958
        0, 0, $43, $6f, $6c, $6f, $72, $52, $47, $42,
8966
        0, 0, $43, $6f, $6c, $6f, $72, $52, $47, $42,
8959
        $41, $a, 0, $5, 0, $e0, $44, $ff, $35, $7c,
8967
        $41, $a, 0, $5, 0, $e0, $44, $ff, $35, $7c,
8960
        $6c, $cf, $11, $8f, $52, 0, $40, $33, $35, $94,
8968
        $6c, $cf, $11, $8f, $52, 0, $40, $33, $35, $94,
8961
        $a3, $2a, 0, $1, 0, $3, 0, 0, 0, $72,
8969
        $a3, $2a, 0, $1, 0, $3, 0, 0, 0, $72,
8962
        $65, $64, $14, 0, $2a, 0, $1, 0, $5, 0,
8970
        $65, $64, $14, 0, $2a, 0, $1, 0, $5, 0,
8963
        0, 0, $67, $72, $65, $65, $6e, $14, 0, $2a,
8971
        0, 0, $67, $72, $65, $65, $6e, $14, 0, $2a,
8964
        0, $1, 0, $4, 0, 0, 0, $62, $6c, $75,
8972
        0, $1, 0, $4, 0, 0, 0, $62, $6c, $75,
8965
        $65, $14, 0, $2a, 0, $1, 0, $5, 0, 0,
8973
        $65, $14, 0, $2a, 0, $1, 0, $5, 0, 0,
8966
        0, $61, $6c, $70, $68, $61, $14, 0, $b, 0,
8974
        0, $61, $6c, $70, $68, $61, $14, 0, $b, 0,
8967
        $1f, 0, $1, 0, $8, 0, 0, 0, $43, $6f,
8975
        $1f, 0, $1, 0, $8, 0, 0, 0, $43, $6f,
8968
        $6c, $6f, $72, $52, $47, $42, $a, 0, $5, 0,
8976
        $6c, $6f, $72, $52, $47, $42, $a, 0, $5, 0,
8969
        $81, $6e, $e1, $d3, $35, $78, $cf, $11, $8f, $52,
8977
        $81, $6e, $e1, $d3, $35, $78, $cf, $11, $8f, $52,
8970
        0, $40, $33, $35, $94, $a3, $2a, 0, $1, 0,
8978
        0, $40, $33, $35, $94, $a3, $2a, 0, $1, 0,
8971
        $3, 0, 0, 0, $72, $65, $64, $14, 0, $2a,
8979
        $3, 0, 0, 0, $72, $65, $64, $14, 0, $2a,
8972
        0, $1, 0, $5, 0, 0, 0, $67, $72, $65,
8980
        0, $1, 0, $5, 0, 0, 0, $67, $72, $65,
8973
        $65, $6e, $14, 0, $2a, 0, $1, 0, $4, 0,
8981
        $65, $6e, $14, 0, $2a, 0, $1, 0, $4, 0,
8974
        0, 0, $62, $6c, $75, $65, $14, 0, $b, 0,
8982
        0, 0, $62, $6c, $75, $65, $14, 0, $b, 0,
8975
        $1f, 0, $1, 0, $c, 0, 0, 0, $49, $6e,
8983
        $1f, 0, $1, 0, $c, 0, 0, 0, $49, $6e,
8976
        $64, $65, $78, $65, $64, $43, $6f, $6c, $6f, $72,
8984
        $64, $65, $78, $65, $64, $43, $6f, $6c, $6f, $72,
8977
        $a, 0, $5, 0, $20, $b8, $30, $16, $42, $78,
8985
        $a, 0, $5, 0, $20, $b8, $30, $16, $42, $78,
8978
        $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3,
8986
        $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3,
8979
        $29, 0, $1, 0, $5, 0, 0, 0, $69, $6e,
8987
        $29, 0, $1, 0, $5, 0, 0, 0, $69, $6e,
8980
        $64, $65, $78, $14, 0, $1, 0, $9, 0, 0,
8988
        $64, $65, $78, $14, 0, $1, 0, $9, 0, 0,
8981
        0, $43, $6f, $6c, $6f, $72, $52, $47, $42, $41,
8989
        0, $43, $6f, $6c, $6f, $72, $52, $47, $42, $41,
8982
        $1, 0, $a, 0, 0, 0, $69, $6e, $64, $65,
8990
        $1, 0, $a, 0, 0, 0, $69, $6e, $64, $65,
8983
        $78, $43, $6f, $6c, $6f, $72, $14, 0, $b, 0,
8991
        $78, $43, $6f, $6c, $6f, $72, $14, 0, $b, 0,
8984
        $1f, 0, $1, 0, $7, 0, 0, 0, $42, $6f,
8992
        $1f, 0, $1, 0, $7, 0, 0, 0, $42, $6f,
8985
        $6f, $6c, $65, $61, $6e, $a, 0, $5, 0, $a0,
8993
        $6f, $6c, $65, $61, $6e, $a, 0, $5, 0, $a0,
8986
        $a6, $7d, $53, $37, $ca, $d0, $11, $94, $1c, 0,
8994
        $a6, $7d, $53, $37, $ca, $d0, $11, $94, $1c, 0,
8987
        $80, $c8, $c, $fa, $7b, $29, 0, $1, 0, $9,
8995
        $80, $c8, $c, $fa, $7b, $29, 0, $1, 0, $9,
8988
        0, 0, 0, $74, $72, $75, $65, $66, $61, $6c,
8996
        0, 0, 0, $74, $72, $75, $65, $66, $61, $6c,
8989
        $73, $65, $14, 0, $b, 0, $1f, 0, $1, 0,
8997
        $73, $65, $14, 0, $b, 0, $1f, 0, $1, 0,
8990
        $9, 0, 0, 0, $42, $6f, $6f, $6c, $65, $61,
8998
        $9, 0, 0, 0, $42, $6f, $6f, $6c, $65, $61,
8991
        $6e, $32, $64, $a, 0, $5, 0, $63, $ae, $85,
8999
        $6e, $32, $64, $a, 0, $5, 0, $63, $ae, $85,
8992
        $48, $e8, $78, $cf, $11, $8f, $52, 0, $40, $33,
9000
        $48, $e8, $78, $cf, $11, $8f, $52, 0, $40, $33,
8993
        $35, $94, $a3, $1, 0, $7, 0, 0, 0, $42,
9001
        $35, $94, $a3, $1, 0, $7, 0, 0, 0, $42,
8994
        $6f, $6f, $6c, $65, $61, $6e, $1, 0, $1, 0,
9002
        $6f, $6f, $6c, $65, $61, $6e, $1, 0, $1, 0,
8995
        0, 0, $75, $14, 0, $1, 0, $7, 0, 0,
9003
        0, 0, $75, $14, 0, $1, 0, $7, 0, 0,
8996
        0, $42, $6f, $6f, $6c, $65, $61, $6e, $1, 0,
9004
        0, $42, $6f, $6f, $6c, $65, $61, $6e, $1, 0,
8997
        $1, 0, 0, 0, $76, $14, 0, $b, 0, $1f,
9005
        $1, 0, 0, 0, $76, $14, 0, $b, 0, $1f,
8998
        0, $1, 0, $c, 0, 0, 0, $4d, $61, $74,
9006
        0, $1, 0, $c, 0, 0, 0, $4d, $61, $74,
8999
        $65, $72, $69, $61, $6c, $57, $72, $61, $70, $a,
9007
        $65, $72, $69, $61, $6c, $57, $72, $61, $70, $a,
9000
        0, $5, 0, $60, $ae, $85, $48, $e8, $78, $cf,
9008
        0, $5, 0, $60, $ae, $85, $48, $e8, $78, $cf,
9001
        $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $1,
9009
        $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $1,
9002
        0, $7, 0, 0, 0, $42, $6f, $6f, $6c, $65,
9010
        0, $7, 0, 0, 0, $42, $6f, $6f, $6c, $65,
9003
        $61, $6e, $1, 0, $1, 0, 0, 0, $75, $14,
9011
        $61, $6e, $1, 0, $1, 0, 0, 0, $75, $14,
9004
        0, $1, 0, $7, 0, 0, 0, $42, $6f, $6f,
9012
        0, $1, 0, $7, 0, 0, 0, $42, $6f, $6f,
9005
        $6c, $65, $61, $6e, $1, 0, $1, 0, 0, 0,
9013
        $6c, $65, $61, $6e, $1, 0, $1, 0, 0, 0,
9006
        $76, $14, 0, $b, 0, $1f, 0, $1, 0, $f,
9014
        $76, $14, 0, $b, 0, $1f, 0, $1, 0, $f,
9007
        0, 0, 0, $54, $65, $78, $74, $75, $72, $65,
9015
        0, 0, 0, $54, $65, $78, $74, $75, $72, $65,
9008
        $46, $69, $6c, $65, $6e, $61, $6d, $65, $a, 0,
9016
        $46, $69, $6c, $65, $6e, $61, $6d, $65, $a, 0,
9009
        $5, 0, $e1, $90, $27, $a4, $10, $78, $cf, $11,
9017
        $5, 0, $e1, $90, $27, $a4, $10, $78, $cf, $11,
9010
        $8f, $52, 0, $40, $33, $35, $94, $a3, $31, 0,
9018
        $8f, $52, 0, $40, $33, $35, $94, $a3, $31, 0,
9011
        $1, 0, $8, 0, 0, 0, $66, $69, $6c, $65,
9019
        $1, 0, $8, 0, 0, 0, $66, $69, $6c, $65,
9012
        $6e, $61, $6d, $65, $14, 0, $b, 0, $1f, 0,
9020
        $6e, $61, $6d, $65, $14, 0, $b, 0, $1f, 0,
9013
        $1, 0, $8, 0, 0, 0, $4d, $61, $74, $65,
9021
        $1, 0, $8, 0, 0, 0, $4d, $61, $74, $65,
9014
        $72, $69, $61, $6c, $a, 0, $5, 0, $4d, $ab,
9022
        $72, $69, $61, $6c, $a, 0, $5, 0, $4d, $ab,
9015
        $82, $3d, $da, $62, $cf, $11, $ab, $39, 0, $20,
9023
        $82, $3d, $da, $62, $cf, $11, $ab, $39, 0, $20,
9016
        $af, $71, $e4, $33, $1, 0, $9, 0, 0, 0,
9024
        $af, $71, $e4, $33, $1, 0, $9, 0, 0, 0,
9017
        $43, $6f, $6c, $6f, $72, $52, $47, $42, $41, $1,
9025
        $43, $6f, $6c, $6f, $72, $52, $47, $42, $41, $1,
9018
        0, $9, 0, 0, 0, $66, $61, $63, $65, $43,
9026
        0, $9, 0, 0, 0, $66, $61, $63, $65, $43,
9019
        $6f, $6c, $6f, $72, $14, 0, $2a, 0, $1, 0,
9027
        $6f, $6c, $6f, $72, $14, 0, $2a, 0, $1, 0,
9020
        $5, 0, 0, 0, $70, $6f, $77, $65, $72, $14,
9028
        $5, 0, 0, 0, $70, $6f, $77, $65, $72, $14,
9021
        0, $1, 0, $8, 0, 0, 0, $43, $6f, $6c,
9029
        0, $1, 0, $8, 0, 0, 0, $43, $6f, $6c,
9022
        $6f, $72, $52, $47, $42, $1, 0, $d, 0, 0,
9030
        $6f, $72, $52, $47, $42, $1, 0, $d, 0, 0,
9023
        0, $73, $70, $65, $63, $75, $6c, $61, $72, $43,
9031
        0, $73, $70, $65, $63, $75, $6c, $61, $72, $43,
9024
        $6f, $6c, $6f, $72, $14, 0, $1, 0, $8, 0,
9032
        $6f, $6c, $6f, $72, $14, 0, $1, 0, $8, 0,
9025
        0, 0, $43, $6f, $6c, $6f, $72, $52, $47, $42,
9033
        0, 0, $43, $6f, $6c, $6f, $72, $52, $47, $42,
9026
        $1, 0, $d, 0, 0, 0, $65, $6d, $69, $73,
9034
        $1, 0, $d, 0, 0, 0, $65, $6d, $69, $73,
9027
        $73, $69, $76, $65, $43, $6f, $6c, $6f, $72, $14,
9035
        $73, $69, $76, $65, $43, $6f, $6c, $6f, $72, $14,
9028
        0, $e, 0, $12, 0, $12, 0, $12, 0, $f,
9036
        0, $e, 0, $12, 0, $12, 0, $12, 0, $f,
9029
        0, $b, 0, $1f, 0, $1, 0, $8, 0, 0,
9037
        0, $b, 0, $1f, 0, $1, 0, $8, 0, 0,
9030
        0, $4d, $65, $73, $68, $46, $61, $63, $65, $a,
9038
        0, $4d, $65, $73, $68, $46, $61, $63, $65, $a,
9031
        0, $5, 0, $5f, $ab, $82, $3d, $da, $62, $cf,
9039
        0, $5, 0, $5f, $ab, $82, $3d, $da, $62, $cf,
9032
        $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $29,
9040
        $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $29,
9033
        0, $1, 0, $12, 0, 0, 0, $6e, $46, $61,
9041
        0, $1, 0, $12, 0, 0, 0, $6e, $46, $61,
9034
        $63, $65, $56, $65, $72, $74, $65, $78, $49, $6e,
9042
        $63, $65, $56, $65, $72, $74, $65, $78, $49, $6e,
9035
        $64, $69, $63, $65, $73, $14, 0, $34, 0, $29,
9043
        $64, $69, $63, $65, $73, $14, 0, $34, 0, $29,
9036
        0, $1, 0, $11, 0, 0, 0, $66, $61, $63,
9044
        0, $1, 0, $11, 0, 0, 0, $66, $61, $63,
9037
        $65, $56, $65, $72, $74, $65, $78, $49, $6e, $64,
9045
        $65, $56, $65, $72, $74, $65, $78, $49, $6e, $64,
9038
        $69, $63, $65, $73, $e, 0, $1, 0, $12, 0,
9046
        $69, $63, $65, $73, $e, 0, $1, 0, $12, 0,
9039
        0, 0, $6e, $46, $61, $63, $65, $56, $65, $72,
9047
        0, 0, $6e, $46, $61, $63, $65, $56, $65, $72,
9040
        $74, $65, $78, $49, $6e, $64, $69, $63, $65, $73,
9048
        $74, $65, $78, $49, $6e, $64, $69, $63, $65, $73,
9041
        $f, 0, $14, 0, $b, 0, $1f, 0, $1, 0,
9049
        $f, 0, $14, 0, $b, 0, $1f, 0, $1, 0,
9042
        $d, 0, 0, 0, $4d, $65, $73, $68, $46, $61,
9050
        $d, 0, 0, 0, $4d, $65, $73, $68, $46, $61,
9043
        $63, $65, $57, $72, $61, $70, $73, $a, 0, $5,
9051
        $63, $65, $57, $72, $61, $70, $73, $a, 0, $5,
9044
        0, $c0, $c5, $1e, $ed, $a8, $c0, $d0, $11, $94,
9052
        0, $c0, $c5, $1e, $ed, $a8, $c0, $d0, $11, $94,
9045
        $1c, 0, $80, $c8, $c, $fa, $7b, $29, 0, $1,
9053
        $1c, 0, $80, $c8, $c, $fa, $7b, $29, 0, $1,
9046
        0, $f, 0, 0, 0, $6e, $46, $61, $63, $65,
9054
        0, $f, 0, 0, 0, $6e, $46, $61, $63, $65,
9047
        $57, $72, $61, $70, $56, $61, $6c, $75, $65, $73,
9055
        $57, $72, $61, $70, $56, $61, $6c, $75, $65, $73,
9048
        $14, 0, $34, 0, $1, 0, $9, 0, 0, 0,
9056
        $14, 0, $34, 0, $1, 0, $9, 0, 0, 0,
9049
        $42, $6f, $6f, $6c, $65, $61, $6e, $32, $64, $1,
9057
        $42, $6f, $6f, $6c, $65, $61, $6e, $32, $64, $1,
9050
        0, $e, 0, 0, 0, $66, $61, $63, $65, $57,
9058
        0, $e, 0, 0, 0, $66, $61, $63, $65, $57,
9051
        $72, $61, $70, $56, $61, $6c, $75, $65, $73, $e,
9059
        $72, $61, $70, $56, $61, $6c, $75, $65, $73, $e,
9052
        0, $1, 0, $f, 0, 0, 0, $6e, $46, $61,
9060
        0, $1, 0, $f, 0, 0, 0, $6e, $46, $61,
9053
        $63, $65, $57, $72, $61, $70, $56, $61, $6c, $75,
9061
        $63, $65, $57, $72, $61, $70, $56, $61, $6c, $75,
9054
        $65, $73, $f, 0, $14, 0, $b, 0, $1f, 0,
9062
        $65, $73, $f, 0, $14, 0, $b, 0, $1f, 0,
9055
        $1, 0, $11, 0, 0, 0, $4d, $65, $73, $68,
9063
        $1, 0, $11, 0, 0, 0, $4d, $65, $73, $68,
9056
        $54, $65, $78, $74, $75, $72, $65, $43, $6f, $6f,
9064
        $54, $65, $78, $74, $75, $72, $65, $43, $6f, $6f,
9057
        $72, $64, $73, $a, 0, $5, 0, $40, $3f, $f2,
9065
        $72, $64, $73, $a, 0, $5, 0, $40, $3f, $f2,
9058
        $f6, $86, $76, $cf, $11, $8f, $52, 0, $40, $33,
9066
        $f6, $86, $76, $cf, $11, $8f, $52, 0, $40, $33,
9059
        $35, $94, $a3, $29, 0, $1, 0, $e, 0, 0,
9067
        $35, $94, $a3, $29, 0, $1, 0, $e, 0, 0,
9060
        0, $6e, $54, $65, $78, $74, $75, $72, $65, $43,
9068
        0, $6e, $54, $65, $78, $74, $75, $72, $65, $43,
9061
        $6f, $6f, $72, $64, $73, $14, 0, $34, 0, $1,
9069
        $6f, $6f, $72, $64, $73, $14, 0, $34, 0, $1,
9062
        0, $8, 0, 0, 0, $43, $6f, $6f, $72, $64,
9070
        0, $8, 0, 0, 0, $43, $6f, $6f, $72, $64,
9063
        $73, $32, $64, $1, 0, $d, 0, 0, 0, $74,
9071
        $73, $32, $64, $1, 0, $d, 0, 0, 0, $74,
9064
        $65, $78, $74, $75, $72, $65, $43, $6f, $6f, $72,
9072
        $65, $78, $74, $75, $72, $65, $43, $6f, $6f, $72,
9065
        $64, $73, $e, 0, $1, 0, $e, 0, 0, 0,
9073
        $64, $73, $e, 0, $1, 0, $e, 0, 0, 0,
9066
        $6e, $54, $65, $78, $74, $75, $72, $65, $43, $6f,
9074
        $6e, $54, $65, $78, $74, $75, $72, $65, $43, $6f,
9067
        $6f, $72, $64, $73, $f, 0, $14, 0, $b, 0,
9075
        $6f, $72, $64, $73, $f, 0, $14, 0, $b, 0,
9068
        $1f, 0, $1, 0, $10, 0, 0, 0, $4d, $65,
9076
        $1f, 0, $1, 0, $10, 0, 0, 0, $4d, $65,
9069
        $73, $68, $4d, $61, $74, $65, $72, $69, $61, $6c,
9077
        $73, $68, $4d, $61, $74, $65, $72, $69, $61, $6c,
9070
        $4c, $69, $73, $74, $a, 0, $5, 0, $42, $3f,
9078
        $4c, $69, $73, $74, $a, 0, $5, 0, $42, $3f,
9071
        $f2, $f6, $86, $76, $cf, $11, $8f, $52, 0, $40,
9079
        $f2, $f6, $86, $76, $cf, $11, $8f, $52, 0, $40,
9072
        $33, $35, $94, $a3, $29, 0, $1, 0, $a, 0,
9080
        $33, $35, $94, $a3, $29, 0, $1, 0, $a, 0,
9073
        0, 0, $6e, $4d, $61, $74, $65, $72, $69, $61,
9081
        0, 0, $6e, $4d, $61, $74, $65, $72, $69, $61,
9074
        $6c, $73, $14, 0, $29, 0, $1, 0, $c, 0,
9082
        $6c, $73, $14, 0, $29, 0, $1, 0, $c, 0,
9075
        0, 0, $6e, $46, $61, $63, $65, $49, $6e, $64,
9083
        0, 0, $6e, $46, $61, $63, $65, $49, $6e, $64,
9076
        $65, $78, $65, $73, $14, 0, $34, 0, $29, 0,
9084
        $65, $78, $65, $73, $14, 0, $34, 0, $29, 0,
9077
        $1, 0, $b, 0, 0, 0, $66, $61, $63, $65,
9085
        $1, 0, $b, 0, 0, 0, $66, $61, $63, $65,
9078
        $49, $6e, $64, $65, $78, $65, $73, $e, 0, $1,
9086
        $49, $6e, $64, $65, $78, $65, $73, $e, 0, $1,
9079
        0, $c, 0, 0, 0, $6e, $46, $61, $63, $65,
9087
        0, $c, 0, 0, 0, $6e, $46, $61, $63, $65,
9080
        $49, $6e, $64, $65, $78, $65, $73, $f, 0, $14,
9088
        $49, $6e, $64, $65, $78, $65, $73, $f, 0, $14,
9081
        0, $e, 0, $1, 0, $8, 0, 0, 0, $4d,
9089
        0, $e, 0, $1, 0, $8, 0, 0, 0, $4d,
9082
        $61, $74, $65, $72, $69, $61, $6c, $f, 0, $b,
9090
        $61, $74, $65, $72, $69, $61, $6c, $f, 0, $b,
9083
        0, $1f, 0, $1, 0, $b, 0, 0, 0, $4d,
9091
        0, $1f, 0, $1, 0, $b, 0, 0, 0, $4d,
9084
        $65, $73, $68, $4e, $6f, $72, $6d, $61, $6c, $73,
9092
        $65, $73, $68, $4e, $6f, $72, $6d, $61, $6c, $73,
9085
        $a, 0, $5, 0, $43, $3f, $f2, $f6, $86, $76,
9093
        $a, 0, $5, 0, $43, $3f, $f2, $f6, $86, $76,
9086
        $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3,
9094
        $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3,
9087
        $29, 0, $1, 0, $8, 0, 0, 0, $6e, $4e,
9095
        $29, 0, $1, 0, $8, 0, 0, 0, $6e, $4e,
9088
        $6f, $72, $6d, $61, $6c, $73, $14, 0, $34, 0,
9096
        $6f, $72, $6d, $61, $6c, $73, $14, 0, $34, 0,
9089
        $1, 0, $6, 0, 0, 0, $56, $65, $63, $74,
9097
        $1, 0, $6, 0, 0, 0, $56, $65, $63, $74,
9090
        $6f, $72, $1, 0, $7, 0, 0, 0, $6e, $6f,
9098
        $6f, $72, $1, 0, $7, 0, 0, 0, $6e, $6f,
9091
        $72, $6d, $61, $6c, $73, $e, 0, $1, 0, $8,
9099
        $72, $6d, $61, $6c, $73, $e, 0, $1, 0, $8,
9092
        0, 0, 0, $6e, $4e, $6f, $72, $6d, $61, $6c,
9100
        0, 0, 0, $6e, $4e, $6f, $72, $6d, $61, $6c,
9093
        $73, $f, 0, $14, 0, $29, 0, $1, 0, $c,
9101
        $73, $f, 0, $14, 0, $29, 0, $1, 0, $c,
9094
        0, 0, 0, $6e, $46, $61, $63, $65, $4e, $6f,
9102
        0, 0, 0, $6e, $46, $61, $63, $65, $4e, $6f,
9095
        $72, $6d, $61, $6c, $73, $14, 0, $34, 0, $1,
9103
        $72, $6d, $61, $6c, $73, $14, 0, $34, 0, $1,
9096
        0, $8, 0, 0, 0, $4d, $65, $73, $68, $46,
9104
        0, $8, 0, 0, 0, $4d, $65, $73, $68, $46,
9097
        $61, $63, $65, $1, 0, $b, 0, 0, 0, $66,
9105
        $61, $63, $65, $1, 0, $b, 0, 0, 0, $66,
9098
        $61, $63, $65, $4e, $6f, $72, $6d, $61, $6c, $73,
9106
        $61, $63, $65, $4e, $6f, $72, $6d, $61, $6c, $73,
9099
        $e, 0, $1, 0, $c, 0, 0, 0, $6e, $46,
9107
        $e, 0, $1, 0, $c, 0, 0, 0, $6e, $46,
9100
        $61, $63, $65, $4e, $6f, $72, $6d, $61, $6c, $73,
9108
        $61, $63, $65, $4e, $6f, $72, $6d, $61, $6c, $73,
9101
        $f, 0, $14, 0, $b, 0, $1f, 0, $1, 0,
9109
        $f, 0, $14, 0, $b, 0, $1f, 0, $1, 0,
9102
        $10, 0, 0, 0, $4d, $65, $73, $68, $56, $65,
9110
        $10, 0, 0, 0, $4d, $65, $73, $68, $56, $65,
9103
        $72, $74, $65, $78, $43, $6f, $6c, $6f, $72, $73,
9111
        $72, $74, $65, $78, $43, $6f, $6c, $6f, $72, $73,
9104
        $a, 0, $5, 0, $21, $b8, $30, $16, $42, $78,
9112
        $a, 0, $5, 0, $21, $b8, $30, $16, $42, $78,
9105
        $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3,
9113
        $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3,
9106
        $29, 0, $1, 0, $d, 0, 0, 0, $6e, $56,
9114
        $29, 0, $1, 0, $d, 0, 0, 0, $6e, $56,
9107
        $65, $72, $74, $65, $78, $43, $6f, $6c, $6f, $72,
9115
        $65, $72, $74, $65, $78, $43, $6f, $6c, $6f, $72,
9108
        $73, $14, 0, $34, 0, $1, 0, $c, 0, 0,
9116
        $73, $14, 0, $34, 0, $1, 0, $c, 0, 0,
9109
        0, $49, $6e, $64, $65, $78, $65, $64, $43, $6f,
9117
        0, $49, $6e, $64, $65, $78, $65, $64, $43, $6f,
9110
        $6c, $6f, $72, $1, 0, $c, 0, 0, 0, $76,
9118
        $6c, $6f, $72, $1, 0, $c, 0, 0, 0, $76,
9111
        $65, $72, $74, $65, $78, $43, $6f, $6c, $6f, $72,
9119
        $65, $72, $74, $65, $78, $43, $6f, $6c, $6f, $72,
9112
        $73, $e, 0, $1, 0, $d, 0, 0, 0, $6e,
9120
        $73, $e, 0, $1, 0, $d, 0, 0, 0, $6e,
9113
        $56, $65, $72, $74, $65, $78, $43, $6f, $6c, $6f,
9121
        $56, $65, $72, $74, $65, $78, $43, $6f, $6c, $6f,
9114
        $72, $73, $f, 0, $14, 0, $b, 0, $1f, 0,
9122
        $72, $73, $f, 0, $14, 0, $b, 0, $1f, 0,
9115
        $1, 0, $4, 0, 0, 0, $4d, $65, $73, $68,
9123
        $1, 0, $4, 0, 0, 0, $4d, $65, $73, $68,
9116
        $a, 0, $5, 0, $44, $ab, $82, $3d, $da, $62,
9124
        $a, 0, $5, 0, $44, $ab, $82, $3d, $da, $62,
9117
        $cf, $11, $ab, $39, 0, $20, $af, $71, $e4, $33,
9125
        $cf, $11, $ab, $39, 0, $20, $af, $71, $e4, $33,
9118
        $29, 0, $1, 0, $9, 0, 0, 0, $6e, $56,
9126
        $29, 0, $1, 0, $9, 0, 0, 0, $6e, $56,
9119
        $65, $72, $74, $69, $63, $65, $73, $14, 0, $34,
9127
        $65, $72, $74, $69, $63, $65, $73, $14, 0, $34,
9120
        0, $1, 0, $6, 0, 0, 0, $56, $65, $63,
9128
        0, $1, 0, $6, 0, 0, 0, $56, $65, $63,
9121
        $74, $6f, $72, $1, 0, $8, 0, 0, 0, $76,
9129
        $74, $6f, $72, $1, 0, $8, 0, 0, 0, $76,
9122
        $65, $72, $74, $69, $63, $65, $73, $e, 0, $1,
9130
        $65, $72, $74, $69, $63, $65, $73, $e, 0, $1,
9123
        0, $9, 0, 0, 0, $6e, $56, $65, $72, $74,
9131
        0, $9, 0, 0, 0, $6e, $56, $65, $72, $74,
9124
        $69, $63, $65, $73, $f, 0, $14, 0, $29, 0,
9132
        $69, $63, $65, $73, $f, 0, $14, 0, $29, 0,
9125
        $1, 0, $6, 0, 0, 0, $6e, $46, $61, $63,
9133
        $1, 0, $6, 0, 0, 0, $6e, $46, $61, $63,
9126
        $65, $73, $14, 0, $34, 0, $1, 0, $8, 0,
9134
        $65, $73, $14, 0, $34, 0, $1, 0, $8, 0,
9127
        0, 0, $4d, $65, $73, $68, $46, $61, $63, $65,
9135
        0, 0, $4d, $65, $73, $68, $46, $61, $63, $65,
9128
        $1, 0, $5, 0, 0, 0, $66, $61, $63, $65,
9136
        $1, 0, $5, 0, 0, 0, $66, $61, $63, $65,
9129
        $73, $e, 0, $1, 0, $6, 0, 0, 0, $6e,
9137
        $73, $e, 0, $1, 0, $6, 0, 0, 0, $6e,
9130
        $46, $61, $63, $65, $73, $f, 0, $14, 0, $e,
9138
        $46, $61, $63, $65, $73, $f, 0, $14, 0, $e,
9131
        0, $12, 0, $12, 0, $12, 0, $f, 0, $b,
9139
        0, $12, 0, $12, 0, $12, 0, $f, 0, $b,
9132
        0, $1f, 0, $1, 0, $14, 0, 0, 0, $46,
9140
        0, $1f, 0, $1, 0, $14, 0, 0, 0, $46,
9133
        $72, $61, $6d, $65, $54, $72, $61, $6e, $73, $66,
9141
        $72, $61, $6d, $65, $54, $72, $61, $6e, $73, $66,
9134
        $6f, $72, $6d, $4d, $61, $74, $72, $69, $78, $a,
9142
        $6f, $72, $6d, $4d, $61, $74, $72, $69, $78, $a,
9135
        0, $5, 0, $41, $3f, $f2, $f6, $86, $76, $cf,
9143
        0, $5, 0, $41, $3f, $f2, $f6, $86, $76, $cf,
9136
        $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $1,
9144
        $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $1,
9137
        0, $9, 0, 0, 0, $4d, $61, $74, $72, $69,
9145
        0, $9, 0, 0, 0, $4d, $61, $74, $72, $69,
9138
        $78, $34, $78, $34, $1, 0, $b, 0, 0, 0,
9146
        $78, $34, $78, $34, $1, 0, $b, 0, 0, 0,
9139
        $66, $72, $61, $6d, $65, $4d, $61, $74, $72, $69,
9147
        $66, $72, $61, $6d, $65, $4d, $61, $74, $72, $69,
9140
        $78, $14, 0, $b, 0, $1f, 0, $1, 0, $5,
9148
        $78, $14, 0, $b, 0, $1f, 0, $1, 0, $5,
9141
        0, 0, 0, $46, $72, $61, $6d, $65, $a, 0,
9149
        0, 0, 0, $46, $72, $61, $6d, $65, $a, 0,
9142
        $5, 0, $46, $ab, $82, $3d, $da, $62, $cf, $11,
9150
        $5, 0, $46, $ab, $82, $3d, $da, $62, $cf, $11,
9143
        $ab, $39, 0, $20, $af, $71, $e4, $33, $e, 0,
9151
        $ab, $39, 0, $20, $af, $71, $e4, $33, $e, 0,
9144
        $12, 0, $12, 0, $12, 0, $f, 0, $b, 0,
9152
        $12, 0, $12, 0, $12, 0, $f, 0, $b, 0,
9145
        $1f, 0, $1, 0, $9, 0, 0, 0, $46, $6c,
9153
        $1f, 0, $1, 0, $9, 0, 0, 0, $46, $6c,
9146
        $6f, $61, $74, $4b, $65, $79, $73, $a, 0, $5,
9154
        $6f, $61, $74, $4b, $65, $79, $73, $a, 0, $5,
9147
        0, $a9, $46, $dd, $10, $5b, $77, $cf, $11, $8f,
9155
        0, $a9, $46, $dd, $10, $5b, $77, $cf, $11, $8f,
9148
        $52, 0, $40, $33, $35, $94, $a3, $29, 0, $1,
9156
        $52, 0, $40, $33, $35, $94, $a3, $29, 0, $1,
9149
        0, $7, 0, 0, 0, $6e, $56, $61, $6c, $75,
9157
        0, $7, 0, 0, 0, $6e, $56, $61, $6c, $75,
9150
        $65, $73, $14, 0, $34, 0, $2a, 0, $1, 0,
9158
        $65, $73, $14, 0, $34, 0, $2a, 0, $1, 0,
9151
        $6, 0, 0, 0, $76, $61, $6c, $75, $65, $73,
9159
        $6, 0, 0, 0, $76, $61, $6c, $75, $65, $73,
9152
        $e, 0, $1, 0, $7, 0, 0, 0, $6e, $56,
9160
        $e, 0, $1, 0, $7, 0, 0, 0, $6e, $56,
9153
        $61, $6c, $75, $65, $73, $f, 0, $14, 0, $b,
9161
        $61, $6c, $75, $65, $73, $f, 0, $14, 0, $b,
9154
        0, $1f, 0, $1, 0, $e, 0, 0, 0, $54,
9162
        0, $1f, 0, $1, 0, $e, 0, 0, 0, $54,
9155
        $69, $6d, $65, $64, $46, $6c, $6f, $61, $74, $4b,
9163
        $69, $6d, $65, $64, $46, $6c, $6f, $61, $74, $4b,
9156
        $65, $79, $73, $a, 0, $5, 0, $80, $b1, $6,
9164
        $65, $79, $73, $a, 0, $5, 0, $80, $b1, $6,
9157
        $f4, $3b, $7b, $cf, $11, $8f, $52, 0, $40, $33,
9165
        $f4, $3b, $7b, $cf, $11, $8f, $52, 0, $40, $33,
9158
        $35, $94, $a3, $29, 0, $1, 0, $4, 0, 0,
9166
        $35, $94, $a3, $29, 0, $1, 0, $4, 0, 0,
9159
        0, $74, $69, $6d, $65, $14, 0, $1, 0, $9,
9167
        0, $74, $69, $6d, $65, $14, 0, $1, 0, $9,
9160
        0, 0, 0, $46, $6c, $6f, $61, $74, $4b, $65,
9168
        0, 0, 0, $46, $6c, $6f, $61, $74, $4b, $65,
9161
        $79, $73, $1, 0, $6, 0, 0, 0, $74, $66,
9169
        $79, $73, $1, 0, $6, 0, 0, 0, $74, $66,
9162
        $6b, $65, $79, $73, $14, 0, $b, 0, $1f, 0,
9170
        $6b, $65, $79, $73, $14, 0, $b, 0, $1f, 0,
9163
        $1, 0, $c, 0, 0, 0, $41, $6e, $69, $6d,
9171
        $1, 0, $c, 0, 0, 0, $41, $6e, $69, $6d,
9164
        $61, $74, $69, $6f, $6e, $4b, $65, $79, $a, 0,
9172
        $61, $74, $69, $6f, $6e, $4b, $65, $79, $a, 0,
9165
        $5, 0, $a8, $46, $dd, $10, $5b, $77, $cf, $11,
9173
        $5, 0, $a8, $46, $dd, $10, $5b, $77, $cf, $11,
9166
        $8f, $52, 0, $40, $33, $35, $94, $a3, $29, 0,
9174
        $8f, $52, 0, $40, $33, $35, $94, $a3, $29, 0,
9167
        $1, 0, $7, 0, 0, 0, $6b, $65, $79, $54,
9175
        $1, 0, $7, 0, 0, 0, $6b, $65, $79, $54,
9168
        $79, $70, $65, $14, 0, $29, 0, $1, 0, $5,
9176
        $79, $70, $65, $14, 0, $29, 0, $1, 0, $5,
9169
        0, 0, 0, $6e, $4b, $65, $79, $73, $14, 0,
9177
        0, 0, 0, $6e, $4b, $65, $79, $73, $14, 0,
9170
        $34, 0, $1, 0, $e, 0, 0, 0, $54, $69,
9178
        $34, 0, $1, 0, $e, 0, 0, 0, $54, $69,
9171
        $6d, $65, $64, $46, $6c, $6f, $61, $74, $4b, $65,
9179
        $6d, $65, $64, $46, $6c, $6f, $61, $74, $4b, $65,
9172
        $79, $73, $1, 0, $4, 0, 0, 0, $6b, $65,
9180
        $79, $73, $1, 0, $4, 0, 0, 0, $6b, $65,
9173
        $79, $73, $e, 0, $1, 0, $5, 0, 0, 0,
9181
        $79, $73, $e, 0, $1, 0, $5, 0, 0, 0,
9174
        $6e, $4b, $65, $79, $73, $f, 0, $14, 0, $b,
9182
        $6e, $4b, $65, $79, $73, $f, 0, $14, 0, $b,
9175
        0, $1f, 0, $1, 0, $10, 0, 0, 0, $41,
9183
        0, $1f, 0, $1, 0, $10, 0, 0, 0, $41,
9176
        $6e, $69, $6d, $61, $74, $69, $6f, $6e, $4f, $70,
9184
        $6e, $69, $6d, $61, $74, $69, $6f, $6e, $4f, $70,
9177
        $74, $69, $6f, $6e, $73, $a, 0, $5, 0, $c0,
9185
        $74, $69, $6f, $6e, $73, $a, 0, $5, 0, $c0,
9178
        $56, $bf, $e2, $f, $84, $cf, $11, $8f, $52, 0,
9186
        $56, $bf, $e2, $f, $84, $cf, $11, $8f, $52, 0,
9179
        $40, $33, $35, $94, $a3, $29, 0, $1, 0, $a,
9187
        $40, $33, $35, $94, $a3, $29, 0, $1, 0, $a,
9180
        0, 0, 0, $6f, $70, $65, $6e, $63, $6c, $6f,
9188
        0, 0, 0, $6f, $70, $65, $6e, $63, $6c, $6f,
9181
        $73, $65, $64, $14, 0, $29, 0, $1, 0, $f,
9189
        $73, $65, $64, $14, 0, $29, 0, $1, 0, $f,
9182
        0, 0, 0, $70, $6f, $73, $69, $74, $69, $6f,
9190
        0, 0, 0, $70, $6f, $73, $69, $74, $69, $6f,
9183
        $6e, $71, $75, $61, $6c, $69, $74, $79, $14, 0,
9191
        $6e, $71, $75, $61, $6c, $69, $74, $79, $14, 0,
9184
        $b, 0, $1f, 0, $1, 0, $9, 0, 0, 0,
9192
        $b, 0, $1f, 0, $1, 0, $9, 0, 0, 0,
9185
        $41, $6e, $69, $6d, $61, $74, $69, $6f, $6e, $a,
9193
        $41, $6e, $69, $6d, $61, $74, $69, $6f, $6e, $a,
9186
        0, $5, 0, $4f, $ab, $82, $3d, $da, $62, $cf,
9194
        0, $5, 0, $4f, $ab, $82, $3d, $da, $62, $cf,
9187
        $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $e,
9195
        $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $e,
9188
        0, $12, 0, $12, 0, $12, 0, $f, 0, $b,
9196
        0, $12, 0, $12, 0, $12, 0, $f, 0, $b,
9189
        0, $1f, 0, $1, 0, $c, 0, 0, 0, $41,
9197
        0, $1f, 0, $1, 0, $c, 0, 0, 0, $41,
9190
        $6e, $69, $6d, $61, $74, $69, $6f, $6e, $53, $65,
9198
        $6e, $69, $6d, $61, $74, $69, $6f, $6e, $53, $65,
9191
        $74, $a, 0, $5, 0, $50, $ab, $82, $3d, $da,
9199
        $74, $a, 0, $5, 0, $50, $ab, $82, $3d, $da,
9192
        $62, $cf, $11, $ab, $39, 0, $20, $af, $71, $e4,
9200
        $62, $cf, $11, $ab, $39, 0, $20, $af, $71, $e4,
9193
        $33, $e, 0, $1, 0, $9, 0, 0, 0, $41,
9201
        $33, $e, 0, $1, 0, $9, 0, 0, 0, $41,
9194
        $6e, $69, $6d, $61, $74, $69, $6f, $6e, $f, 0,
9202
        $6e, $69, $6d, $61, $74, $69, $6f, $6e, $f, 0,
9195
        $b, 0, $1f, 0, $1, 0, $a, 0, 0, 0,
9203
        $b, 0, $1f, 0, $1, 0, $a, 0, 0, 0,
9196
        $49, $6e, $6c, $69, $6e, $65, $44, $61, $74, $61,
9204
        $49, $6e, $6c, $69, $6e, $65, $44, $61, $74, $61,
9197
        $a, 0, $5, 0, $a0, $ee, $23, $3a, $b1, $94,
9205
        $a, 0, $5, 0, $a0, $ee, $23, $3a, $b1, $94,
9198
        $d0, $11, $ab, $39, 0, $20, $af, $71, $e4, $33,
9206
        $d0, $11, $ab, $39, 0, $20, $af, $71, $e4, $33,
9199
        $e, 0, $1, 0, $6, 0, 0, 0, $42, $49,
9207
        $e, 0, $1, 0, $6, 0, 0, 0, $42, $49,
9200
        $4e, $41, $52, $59, $f, 0, $b, 0, $1f, 0,
9208
        $4e, $41, $52, $59, $f, 0, $b, 0, $1f, 0,
9201
        $1, 0, $3, 0, 0, 0, $55, $72, $6c, $a,
9209
        $1, 0, $3, 0, 0, 0, $55, $72, $6c, $a,
9202
        0, $5, 0, $a1, $ee, $23, $3a, $b1, $94, $d0,
9210
        0, $5, 0, $a1, $ee, $23, $3a, $b1, $94, $d0,
9203
        $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $29,
9211
        $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $29,
9204
        0, $1, 0, $5, 0, 0, 0, $6e, $55, $72,
9212
        0, $1, 0, $5, 0, 0, 0, $6e, $55, $72,
9205
        $6c, $73, $14, 0, $34, 0, $31, 0, $1, 0,
9213
        $6c, $73, $14, 0, $34, 0, $31, 0, $1, 0,
9206
        $4, 0, 0, 0, $75, $72, $6c, $73, $e, 0,
9214
        $4, 0, 0, 0, $75, $72, $6c, $73, $e, 0,
9207
        $1, 0, $5, 0, 0, 0, $6e, $55, $72, $6c,
9215
        $1, 0, $5, 0, 0, 0, $6e, $55, $72, $6c,
9208
        $73, $f, 0, $14, 0, $b, 0, $1f, 0, $1,
9216
        $73, $f, 0, $14, 0, $b, 0, $1f, 0, $1,
9209
        0, $f, 0, 0, 0, $50, $72, $6f, $67, $72,
9217
        0, $f, 0, 0, 0, $50, $72, $6f, $67, $72,
9210
        $65, $73, $73, $69, $76, $65, $4d, $65, $73, $68,
9218
        $65, $73, $73, $69, $76, $65, $4d, $65, $73, $68,
9211
        $a, 0, $5, 0, $60, $c3, $63, $8a, $7d, $99,
9219
        $a, 0, $5, 0, $60, $c3, $63, $8a, $7d, $99,
9212
        $d0, $11, $94, $1c, 0, $80, $c8, $c, $fa, $7b,
9220
        $d0, $11, $94, $1c, 0, $80, $c8, $c, $fa, $7b,
9213
        $e, 0, $1, 0, $3, 0, 0, 0, $55, $72,
9221
        $e, 0, $1, 0, $3, 0, 0, 0, $55, $72,
9214
        $6c, $13, 0, $1, 0, $a, 0, 0, 0, $49,
9222
        $6c, $13, 0, $1, 0, $a, 0, 0, 0, $49,
9215
        $6e, $6c, $69, $6e, $65, $44, $61, $74, $61, $f,
9223
        $6e, $6c, $69, $6e, $65, $44, $61, $74, $61, $f,
9216
        0, $b, 0, $1f, 0, $1, 0, $4, 0, 0,
9224
        0, $b, 0, $1f, 0, $1, 0, $4, 0, 0,
9217
        0, $47, $75, $69, $64, $a, 0, $5, 0, $e0,
9225
        0, $47, $75, $69, $64, $a, 0, $5, 0, $e0,
9218
        $90, $27, $a4, $10, $78, $cf, $11, $8f, $52, 0,
9226
        $90, $27, $a4, $10, $78, $cf, $11, $8f, $52, 0,
9219
        $40, $33, $35, $94, $a3, $29, 0, $1, 0, $5,
9227
        $40, $33, $35, $94, $a3, $29, 0, $1, 0, $5,
9220
        0, 0, 0, $64, $61, $74, $61, $31, $14, 0,
9228
        0, 0, 0, $64, $61, $74, $61, $31, $14, 0,
9221
        $28, 0, $1, 0, $5, 0, 0, 0, $64, $61,
9229
        $28, 0, $1, 0, $5, 0, 0, 0, $64, $61,
9222
        $74, $61, $32, $14, 0, $28, 0, $1, 0, $5,
9230
        $74, $61, $32, $14, 0, $28, 0, $1, 0, $5,
9223
        0, 0, 0, $64, $61, $74, $61, $33, $14, 0,
9231
        0, 0, 0, $64, $61, $74, $61, $33, $14, 0,
9224
        $34, 0, $2d, 0, $1, 0, $5, 0, 0, 0,
9232
        $34, 0, $2d, 0, $1, 0, $5, 0, 0, 0,
9225
        $64, $61, $74, $61, $34, $e, 0, $3, 0, $8,
9233
        $64, $61, $74, $61, $34, $e, 0, $3, 0, $8,
9226
        0, 0, 0, $f, 0, $14, 0, $b, 0, $1f,
9234
        0, 0, 0, $f, 0, $14, 0, $b, 0, $1f,
9227
        0, $1, 0, $e, 0, 0, 0, $53, $74, $72,
9235
        0, $1, 0, $e, 0, 0, 0, $53, $74, $72,
9228
        $69, $6e, $67, $50, $72, $6f, $70, $65, $72, $74,
9236
        $69, $6e, $67, $50, $72, $6f, $70, $65, $72, $74,
9229
        $79, $a, 0, $5, 0, $e0, $21, $f, $7f, $e1,
9237
        $79, $a, 0, $5, 0, $e0, $21, $f, $7f, $e1,
9230
        $bf, $d1, $11, $82, $c0, 0, $a0, $c9, $69, $72,
9238
        $bf, $d1, $11, $82, $c0, 0, $a0, $c9, $69, $72,
9231
        $71, $31, 0, $1, 0, $3, 0, 0, 0, $6b,
9239
        $71, $31, 0, $1, 0, $3, 0, 0, 0, $6b,
9232
        $65, $79, $14, 0, $31, 0, $1, 0, $5, 0,
9240
        $65, $79, $14, 0, $31, 0, $1, 0, $5, 0,
9233
        0, 0, $76, $61, $6c, $75, $65, $14, 0, $b,
9241
        0, 0, $76, $61, $6c, $75, $65, $14, 0, $b,
9234
        0, $1f, 0, $1, 0, $b, 0, 0, 0, $50,
9242
        0, $1f, 0, $1, 0, $b, 0, 0, 0, $50,
9235
        $72, $6f, $70, $65, $72, $74, $79, $42, $61, $67,
9243
        $72, $6f, $70, $65, $72, $74, $79, $42, $61, $67,
9236
        $a, 0, $5, 0, $e1, $21, $f, $7f, $e1, $bf,
9244
        $a, 0, $5, 0, $e1, $21, $f, $7f, $e1, $bf,
9237
        $d1, $11, $82, $c0, 0, $a0, $c9, $69, $72, $71,
9245
        $d1, $11, $82, $c0, 0, $a0, $c9, $69, $72, $71,
9238
        $e, 0, $1, 0, $e, 0, 0, 0, $53, $74,
9246
        $e, 0, $1, 0, $e, 0, 0, 0, $53, $74,
9239
        $72, $69, $6e, $67, $50, $72, $6f, $70, $65, $72,
9247
        $72, $69, $6e, $67, $50, $72, $6f, $70, $65, $72,
9240
        $74, $79, $f, 0, $b, 0, $1f, 0, $1, 0,
9248
        $74, $79, $f, 0, $b, 0, $1f, 0, $1, 0,
9241
        $e, 0, 0, 0, $45, $78, $74, $65, $72, $6e,
9249
        $e, 0, 0, 0, $45, $78, $74, $65, $72, $6e,
9242
        $61, $6c, $56, $69, $73, $75, $61, $6c, $a, 0,
9250
        $61, $6c, $56, $69, $73, $75, $61, $6c, $a, 0,
9243
        $5, 0, $a0, $6a, $11, $98, $ba, $bd, $d1, $11,
9251
        $5, 0, $a0, $6a, $11, $98, $ba, $bd, $d1, $11,
9244
        $82, $c0, 0, $a0, $c9, $69, $72, $71, $1, 0,
9252
        $82, $c0, 0, $a0, $c9, $69, $72, $71, $1, 0,
9245
        $4, 0, 0, 0, $47, $75, $69, $64, $1, 0,
9253
        $4, 0, 0, 0, $47, $75, $69, $64, $1, 0,
9246
        $12, 0, 0, 0, $67, $75, $69, $64, $45, $78,
9254
        $12, 0, 0, 0, $67, $75, $69, $64, $45, $78,
9247
        $74, $65, $72, $6e, $61, $6c, $56, $69, $73, $75,
9255
        $74, $65, $72, $6e, $61, $6c, $56, $69, $73, $75,
9248
        $61, $6c, $14, 0, $e, 0, $12, 0, $12, 0,
9256
        $61, $6c, $14, 0, $e, 0, $12, 0, $12, 0,
9249
        $12, 0, $f, 0, $b, 0);
9257
        $12, 0, $f, 0, $b, 0);
9250
 
9258
 
9251
//---------------
9259
//---------------
9252
 
9260
 
9253
//Direct3DRM file
9261
//Direct3DRM file
9254
(*==========================================================================;
9262
(*==========================================================================;
9255
 *
9263
 *
9256
 *  Copyright (C) 1994-1997 Microsoft Corporation.  All Rights Reserved.
9264
 *  Copyright (C) 1994-1997 Microsoft Corporation.  All Rights Reserved.
9257
 *
9265
 *
9258
 *  Files:      D3DRMDef.h D3DRMObj.h D3DRM.h D3DRMWin.h RMXFGUID.h RMXFTmpl.h
9266
 *  Files:      D3DRMDef.h D3DRMObj.h D3DRM.h D3DRMWin.h RMXFGUID.h RMXFTmpl.h
9259
 *  Content:    Direct3D Retained Mode include files
9267
 *  Content:    Direct3D Retained Mode include files
9260
 *
9268
 *
9261
 *  DirectX 7.0 Delphi adaptation by Erik Unger
9269
 *  DirectX 7.0 Delphi adaptation by Erik Unger
9262
 *
9270
 *
9263
 *  Modified: 10-Sep-2000
9271
 *  Modified: 10-Sep-2000
9264
 *
9272
 *
9265
 *  Download: http://www.delphi-jedi.org/DelphiGraphics/
9273
 *  Download: http://www.delphi-jedi.org/DelphiGraphics/
9266
 *  E-Mail: DelphiDirectX@next-reality.com
9274
 *  E-Mail: DelphiDirectX@next-reality.com
9267
 *
9275
 *
9268
 *
9276
 *
9269
 ***************************************************************************)
9277
 ***************************************************************************)
9270
 
9278
 
9271
var
9279
var
9272
  D3DRMDLL : HMODULE = 0;
9280
  D3DRMDLL : HMODULE = 0;
9273
 
9281
 
9274
(*==========================================================================;
9282
(*==========================================================================;
9275
 *
9283
 *
9276
 *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
9284
 *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
9277
 *
9285
 *
9278
 *  File:       d3drmdef.h
9286
 *  File:       d3drmdef.h
9279
 *  Content:    Direct3DRM include file
9287
 *  Content:    Direct3DRM include file
9280
 *
9288
 *
9281
 ***************************************************************************)
9289
 ***************************************************************************)
9282
 
9290
 
9283
type
9291
type
9284
  PD3DRMVector4D = ^TD3DRMVector4D;
9292
  PD3DRMVector4D = ^TD3DRMVector4D;
9285
  TD3DRMVector4D = packed record
9293
  TD3DRMVector4D = packed record
9286
    x, y, z, w: TD3DValue;
9294
    x, y, z, w: TD3DValue;
9287
  end;
9295
  end;
9288
 
9296
 
9289
  PD3DRMMatrix4D = ^TD3DRMMatrix4D;
9297
  PD3DRMMatrix4D = ^TD3DRMMatrix4D;
9290
  TD3DRMMatrix4D = array [0..3, 0..3] of TD3DValue;
9298
  TD3DRMMatrix4D = array [0..3, 0..3] of TD3DValue;
9291
 
9299
 
9292
  PD3DRMQuaternion = ^TD3DRMQuaternion;
9300
  PD3DRMQuaternion = ^TD3DRMQuaternion;
9293
  TD3DRMQuaternion = packed record
9301
  TD3DRMQuaternion = packed record
9294
    s: TD3DValue;
9302
    s: TD3DValue;
9295
    v: TD3DVector;
9303
    v: TD3DVector;
9296
  end;
9304
  end;
9297
 
9305
 
9298
  PD3DRMRay = ^TD3DRMRay;
9306
  PD3DRMRay = ^TD3DRMRay;
9299
  TD3DRMRay = packed record
9307
  TD3DRMRay = packed record
9300
    dvDir: TD3DVector;
9308
    dvDir: TD3DVector;
9301
    dvPos: TD3DVector;
9309
    dvPos: TD3DVector;
9302
  end;
9310
  end;
9303
 
9311
 
9304
  PD3DRMBox = ^TD3DRMBox;
9312
  PD3DRMBox = ^TD3DRMBox;
9305
  TD3DRMBox = packed record
9313
  TD3DRMBox = packed record
9306
    min, max: TD3DVector;
9314
    min, max: TD3DVector;
9307
  end;
9315
  end;
9308
 
9316
 
9309
  TD3DRMWrapCallback = procedure (var lpD3DVector: TD3DVector;
9317
  TD3DRMWrapCallback = procedure (var lpD3DVector: TD3DVector;
9310
      var lpU, lpV: Integer; var lpD3DRMVA, lpD3DRMVB: TD3DVector; lpArg:
9318
      var lpU, lpV: Integer; var lpD3DRMVA, lpD3DRMVB: TD3DVector; lpArg:
9311
      Pointer); stdcall; // unused ?
9319
      Pointer); stdcall; // unused ?
9312
 
9320
 
9313
  PD3DRMLightType = ^TD3DRMLightType; // is it 16 or 32 bit ?
9321
  PD3DRMLightType = ^TD3DRMLightType; // is it 16 or 32 bit ?
9314
  TD3DRMLightType = (
9322
  TD3DRMLightType = (
9315
    D3DRMLIGHT_AMBIENT,
9323
    D3DRMLIGHT_AMBIENT,
9316
    D3DRMLIGHT_POINT,
9324
    D3DRMLIGHT_POINT,
9317
    D3DRMLIGHT_SPOT,
9325
    D3DRMLIGHT_SPOT,
9318
    D3DRMLIGHT_DIRECTIONAL,
9326
    D3DRMLIGHT_DIRECTIONAL,
9319
    D3DRMLIGHT_PARALLELPOINT
9327
    D3DRMLIGHT_PARALLELPOINT
9320
  );
9328
  );
9321
 
9329
 
9322
  PD3DRMShadeMode = ^TD3DRMShadeMode;
9330
  PD3DRMShadeMode = ^TD3DRMShadeMode;
9323
  TD3DRMShadeMode = WORD;
9331
  TD3DRMShadeMode = WORD;
9324
 
9332
 
9325
const
9333
const
9326
  D3DRMSHADE_FLAT = 0;
9334
  D3DRMSHADE_FLAT = 0;
9327
  D3DRMSHADE_GOURAUD = 1;
9335
  D3DRMSHADE_GOURAUD = 1;
9328
  D3DRMSHADE_PHONG = 2;
9336
  D3DRMSHADE_PHONG = 2;
9329
  D3DRMSHADE_MASK = 7;
9337
  D3DRMSHADE_MASK = 7;
9330
  D3DRMSHADE_MAX = 8;
9338
  D3DRMSHADE_MAX = 8;
9331
 
9339
 
9332
type
9340
type
9333
  PD3DRMLightMode = ^TD3DRMLightMode;
9341
  PD3DRMLightMode = ^TD3DRMLightMode;
9334
  TD3DRMLightMode = WORD;
9342
  TD3DRMLightMode = WORD;
9335
 
9343
 
9336
const
9344
const
9337
  D3DRMLIGHT_OFF  = 0 * D3DRMSHADE_MAX;
9345
  D3DRMLIGHT_OFF  = 0 * D3DRMSHADE_MAX;
9338
  D3DRMLIGHT_ON   = 1 * D3DRMSHADE_MAX;
9346
  D3DRMLIGHT_ON   = 1 * D3DRMSHADE_MAX;
9339
  D3DRMLIGHT_MASK = 7 * D3DRMSHADE_MAX;
9347
  D3DRMLIGHT_MASK = 7 * D3DRMSHADE_MAX;
9340
  D3DRMLIGHT_MAX  = 8 * D3DRMSHADE_MAX;
9348
  D3DRMLIGHT_MAX  = 8 * D3DRMSHADE_MAX;
9341
 
9349
 
9342
type
9350
type
9343
  PD3DRMFillMode = ^TD3DRMFillMode;
9351
  PD3DRMFillMode = ^TD3DRMFillMode;
9344
  TD3DRMFillMode = WORD;
9352
  TD3DRMFillMode = WORD;
9345
 
9353
 
9346
const
9354
const
9347
  D3DRMFILL_POINTS    = 0 * D3DRMLIGHT_MAX;
9355
  D3DRMFILL_POINTS    = 0 * D3DRMLIGHT_MAX;
9348
  D3DRMFILL_WIREFRAME = 1 * D3DRMLIGHT_MAX;
9356
  D3DRMFILL_WIREFRAME = 1 * D3DRMLIGHT_MAX;
9349
  D3DRMFILL_SOLID     = 2 * D3DRMLIGHT_MAX;
9357
  D3DRMFILL_SOLID     = 2 * D3DRMLIGHT_MAX;
9350
  D3DRMFILL_MASK      = 7 * D3DRMLIGHT_MAX;
9358
  D3DRMFILL_MASK      = 7 * D3DRMLIGHT_MAX;
9351
  D3DRMFILL_MAX       = 8 * D3DRMLIGHT_MAX;
9359
  D3DRMFILL_MAX       = 8 * D3DRMLIGHT_MAX;
9352
 
9360
 
9353
type
9361
type
9354
  PD3DRMRenderQuality = ^TD3DRMRenderQuality;
9362
  PD3DRMRenderQuality = ^TD3DRMRenderQuality;
9355
  TD3DRMRenderQuality = DWORD;
9363
  TD3DRMRenderQuality = DWORD;
9356
 
9364
 
9357
const
9365
const
9358
  D3DRMRENDER_WIREFRAME   =
9366
  D3DRMRENDER_WIREFRAME   =
9359
      (D3DRMSHADE_FLAT + D3DRMLIGHT_OFF + D3DRMFILL_WIREFRAME);
9367
      (D3DRMSHADE_FLAT + D3DRMLIGHT_OFF + D3DRMFILL_WIREFRAME);
9360
  D3DRMRENDER_UNLITFLAT   =
9368
  D3DRMRENDER_UNLITFLAT   =
9361
      (D3DRMSHADE_FLAT + D3DRMLIGHT_OFF + D3DRMFILL_SOLID);
9369
      (D3DRMSHADE_FLAT + D3DRMLIGHT_OFF + D3DRMFILL_SOLID);
9362
  D3DRMRENDER_FLAT        =
9370
  D3DRMRENDER_FLAT        =
9363
      (D3DRMSHADE_FLAT + D3DRMLIGHT_ON + D3DRMFILL_SOLID);
9371
      (D3DRMSHADE_FLAT + D3DRMLIGHT_ON + D3DRMFILL_SOLID);
9364
  D3DRMRENDER_GOURAUD     =
9372
  D3DRMRENDER_GOURAUD     =
9365
      (D3DRMSHADE_GOURAUD + D3DRMLIGHT_ON + D3DRMFILL_SOLID);
9373
      (D3DRMSHADE_GOURAUD + D3DRMLIGHT_ON + D3DRMFILL_SOLID);
9366
  D3DRMRENDER_PHONG       =
9374
  D3DRMRENDER_PHONG       =
9367
      (D3DRMSHADE_PHONG + D3DRMLIGHT_ON + D3DRMFILL_SOLID);
9375
      (D3DRMSHADE_PHONG + D3DRMLIGHT_ON + D3DRMFILL_SOLID);
9368
 
9376
 
9369
  D3DRMRENDERMODE_BLENDEDTRANSPARENCY   =  1;
9377
  D3DRMRENDERMODE_BLENDEDTRANSPARENCY   =  1;
9370
  D3DRMRENDERMODE_SORTEDTRANSPARENCY    =  2;
9378
  D3DRMRENDERMODE_SORTEDTRANSPARENCY    =  2;
9371
  D3DRMRENDERMODE_LIGHTINMODELSPACE     =  8;
9379
  D3DRMRENDERMODE_LIGHTINMODELSPACE     =  8;
9372
  D3DRMRENDERMODE_VIEWDEPENDENTSPECULAR = 16;
9380
  D3DRMRENDERMODE_VIEWDEPENDENTSPECULAR = 16;
9373
 
9381
 
9374
type
9382
type
9375
  PD3DRMTextureQuality = ^TD3DRMTextureQuality;
9383
  PD3DRMTextureQuality = ^TD3DRMTextureQuality;
9376
  TD3DRMTextureQuality = (
9384
  TD3DRMTextureQuality = (
9377
    D3DRMTEXTURE_NEAREST,               (* choose nearest texel *)
9385
    D3DRMTEXTURE_NEAREST,               (* choose nearest texel *)
9378
    D3DRMTEXTURE_LINEAR,                (* interpolate 4 texels *)
9386
    D3DRMTEXTURE_LINEAR,                (* interpolate 4 texels *)
9379
    D3DRMTEXTURE_MIPNEAREST,            (* nearest texel in nearest mipmap  *)
9387
    D3DRMTEXTURE_MIPNEAREST,            (* nearest texel in nearest mipmap  *)
9380
    D3DRMTEXTURE_MIPLINEAR,             (* interpolate 2 texels from 2 mipmaps *)
9388
    D3DRMTEXTURE_MIPLINEAR,             (* interpolate 2 texels from 2 mipmaps *)
9381
    D3DRMTEXTURE_LINEARMIPNEAREST,      (* interpolate 4 texels in nearest mipmap *)
9389
    D3DRMTEXTURE_LINEARMIPNEAREST,      (* interpolate 4 texels in nearest mipmap *)
9382
    D3DRMTEXTURE_LINEARMIPLINEAR        (* interpolate 8 texels from 2 mipmaps *)
9390
    D3DRMTEXTURE_LINEARMIPLINEAR        (* interpolate 8 texels from 2 mipmaps *)
9383
  );
9391
  );
9384
 
9392
 
9385
const
9393
const
9386
(*
9394
(*
9387
 * Texture flags
9395
 * Texture flags
9388
 *)
9396
 *)
9389
  D3DRMTEXTURE_FORCERESIDENT          = $00000001; (* texture should be kept in video memory *)
9397
  D3DRMTEXTURE_FORCERESIDENT          = $00000001; (* texture should be kept in video memory *)
9390
  D3DRMTEXTURE_STATIC                 = $00000002; (* texture will not change *)
9398
  D3DRMTEXTURE_STATIC                 = $00000002; (* texture will not change *)
9391
  D3DRMTEXTURE_DOWNSAMPLEPOINT        = $00000004; (* point filtering should be used when downsampling *)
9399
  D3DRMTEXTURE_DOWNSAMPLEPOINT        = $00000004; (* point filtering should be used when downsampling *)
9392
  D3DRMTEXTURE_DOWNSAMPLEBILINEAR     = $00000008; (* bilinear filtering should be used when downsampling *)
9400
  D3DRMTEXTURE_DOWNSAMPLEBILINEAR     = $00000008; (* bilinear filtering should be used when downsampling *)
9393
  D3DRMTEXTURE_DOWNSAMPLEREDUCEDEPTH  = $00000010; (* reduce bit depth when downsampling *)
9401
  D3DRMTEXTURE_DOWNSAMPLEREDUCEDEPTH  = $00000010; (* reduce bit depth when downsampling *)
9394
  D3DRMTEXTURE_DOWNSAMPLENONE         = $00000020; (* texture should never be downsampled *)
9402
  D3DRMTEXTURE_DOWNSAMPLENONE         = $00000020; (* texture should never be downsampled *)
9395
  D3DRMTEXTURE_CHANGEDPIXELS          = $00000040; (* pixels have changed *)
9403
  D3DRMTEXTURE_CHANGEDPIXELS          = $00000040; (* pixels have changed *)
9396
  D3DRMTEXTURE_CHANGEDPALETTE         = $00000080; (* palette has changed *)
9404
  D3DRMTEXTURE_CHANGEDPALETTE         = $00000080; (* palette has changed *)
9397
  D3DRMTEXTURE_INVALIDATEONLY         = $00000100; (* dirty regions are invalid *)
9405
  D3DRMTEXTURE_INVALIDATEONLY         = $00000100; (* dirty regions are invalid *)
9398
 
9406
 
9399
(*
9407
(*
9400
 * Shadow flags
9408
 * Shadow flags
9401
 *)
9409
 *)
9402
   D3DRMSHADOW_TRUEALPHA               = $00000001; (* shadow should render without artifacts when true alpha is on *)
9410
   D3DRMSHADOW_TRUEALPHA               = $00000001; (* shadow should render without artifacts when true alpha is on *)
9403
 
9411
 
9404
type
9412
type
9405
  PD3DRMCombineType = ^TD3DRMCombineType;
9413
  PD3DRMCombineType = ^TD3DRMCombineType;
9406
  TD3DRMCombineType = (
9414
  TD3DRMCombineType = (
9407
    D3DRMCOMBINE_REPLACE,
9415
    D3DRMCOMBINE_REPLACE,
9408
    D3DRMCOMBINE_BEFORE,
9416
    D3DRMCOMBINE_BEFORE,
9409
    D3DRMCOMBINE_AFTER
9417
    D3DRMCOMBINE_AFTER
9410
  );
9418
  );
9411
 
9419
 
9412
  PD3DRMColorModel = ^TD3DRMColorModel;
9420
  PD3DRMColorModel = ^TD3DRMColorModel;
9413
  TD3DRMColorModel = TD3DColorModel;
9421
  TD3DRMColorModel = TD3DColorModel;
9414
 
9422
 
9415
  PD3DRMPaletteFlags = ^TD3DRMPaletteFlags;
9423
  PD3DRMPaletteFlags = ^TD3DRMPaletteFlags;
9416
  TD3DRMPaletteFlags = (
9424
  TD3DRMPaletteFlags = (
9417
    D3DRMPALETTE_FREE,                  (* renderer may use this entry freely *)
9425
    D3DRMPALETTE_FREE,                  (* renderer may use this entry freely *)
9418
    D3DRMPALETTE_READONLY,              (* fixed but may be used by renderer *)
9426
    D3DRMPALETTE_READONLY,              (* fixed but may be used by renderer *)
9419
    D3DRMPALETTE_RESERVED               (* may not be used by renderer *)
9427
    D3DRMPALETTE_RESERVED               (* may not be used by renderer *)
9420
  );
9428
  );
9421
 
9429
 
9422
  PD3DRMPaletteEntry = ^TD3DRMPaletteEntry;
9430
  PD3DRMPaletteEntry = ^TD3DRMPaletteEntry;
9423
  TD3DRMPaletteEntry = packed record
9431
  TD3DRMPaletteEntry = packed record
9424
    red: Byte;          (* 0 .. 255 *)
9432
    red: Byte;          (* 0 .. 255 *)
9425
    green: Byte;        (* 0 .. 255 *)
9433
    green: Byte;        (* 0 .. 255 *)
9426
    blue: Byte;         (* 0 .. 255 *)
9434
    blue: Byte;         (* 0 .. 255 *)
9427
    flags: Byte;        (* one of D3DRMPALETTEFLAGS *)
9435
    flags: Byte;        (* one of D3DRMPALETTEFLAGS *)
9428
  end;
9436
  end;
9429
 
9437
 
9430
  PD3DRMImage = ^TD3DRMImage;
9438
  PD3DRMImage = ^TD3DRMImage;
9431
  TD3DRMImage = packed record
9439
  TD3DRMImage = packed record
9432
    width, height: Integer;    (* width and height in pixels *)
9440
    width, height: Integer;    (* width and height in pixels *)
9433
    aspectx, aspecty: Integer; (* aspect ratio for non-square pixels *)
9441
    aspectx, aspecty: Integer; (* aspect ratio for non-square pixels *)
9434
    depth: Integer;            (* bits per pixel *)
9442
    depth: Integer;            (* bits per pixel *)
9435
    rgb: Integer;              (* if false, pixels are indices into a
9443
    rgb: Integer;              (* if false, pixels are indices into a
9436
                                   palette otherwise, pixels encode
9444
                                   palette otherwise, pixels encode
9437
                                   RGB values. *)
9445
                                   RGB values. *)
9438
    bytes_per_line: Integer;   (* number of bytes of memory for a
9446
    bytes_per_line: Integer;   (* number of bytes of memory for a
9439
                                   scanline. This must be a multiple
9447
                                   scanline. This must be a multiple
9440
                                   of 4. *)
9448
                                   of 4. *)
9441
    buffer1: Pointer;          (* memory to render into (first buffer). *)
9449
    buffer1: Pointer;          (* memory to render into (first buffer). *)
9442
    buffer2: Pointer;          (* second rendering buffer for double
9450
    buffer2: Pointer;          (* second rendering buffer for double
9443
                                   buffering, set to NULL for single
9451
                                   buffering, set to NULL for single
9444
                                   buffering. *)
9452
                                   buffering. *)
9445
    red_mask: DWORD;
9453
    red_mask: DWORD;
9446
    green_mask: DWORD;
9454
    green_mask: DWORD;
9447
    blue_mask: DWORD;
9455
    blue_mask: DWORD;
9448
    alpha_mask: DWORD;        (* if rgb is true, these are masks for
9456
    alpha_mask: DWORD;        (* if rgb is true, these are masks for
9449
                                   the red, green and blue parts of a
9457
                                   the red, green and blue parts of a
9450
                                   pixel.  Otherwise, these are masks
9458
                                   pixel.  Otherwise, these are masks
9451
                                   for the significant bits of the
9459
                                   for the significant bits of the
9452
                                   red, green and blue elements in the
9460
                                   red, green and blue elements in the
9453
                                   palette.  For instance, most SVGA
9461
                                   palette.  For instance, most SVGA
9454
                                   displays use 64 intensities of red,
9462
                                   displays use 64 intensities of red,
9455
                                   green and blue, so the masks should
9463
                                   green and blue, so the masks should
9456
                                   all be set to = $fc. *)
9464
                                   all be set to = $fc. *)
9457
    palette_size: Integer;     (* number of entries in palette *)
9465
    palette_size: Integer;     (* number of entries in palette *)
9458
    palette: PD3DRMPaletteEntry; (* description of the palette (only if
9466
    palette: PD3DRMPaletteEntry; (* description of the palette (only if
9459
                                   rgb is false).  Must be (1<<depth)
9467
                                   rgb is false).  Must be (1<<depth)
9460
                                   elements. *)
9468
                                   elements. *)
9461
  end;
9469
  end;
9462
 
9470
 
9463
  PD3DRMWrapType = ^TD3DRMWrapType;
9471
  PD3DRMWrapType = ^TD3DRMWrapType;
9464
  TD3DRMWrapType = (
9472
  TD3DRMWrapType = (
9465
    D3DRMWRAP_FLAT,
9473
    D3DRMWRAP_FLAT,
9466
    D3DRMWRAP_CYLINDER,
9474
    D3DRMWRAP_CYLINDER,
9467
    D3DRMWRAP_SPHERE,
9475
    D3DRMWRAP_SPHERE,
9468
    D3DRMWRAP_CHROME,
9476
    D3DRMWRAP_CHROME,
9469
    D3DRMWRAP_SHEET,
9477
    D3DRMWRAP_SHEET,
9470
    D3DRMWRAP_BOX
9478
    D3DRMWRAP_BOX
9471
  );
9479
  );
9472
 
9480
 
9473
const
9481
const
9474
  D3DRMWIREFRAME_CULL             = 1; (* cull backfaces *)
9482
  D3DRMWIREFRAME_CULL             = 1; (* cull backfaces *)
9475
  D3DRMWIREFRAME_HIDDENLINE       = 2; (* lines are obscured by closer objects *)
9483
  D3DRMWIREFRAME_HIDDENLINE       = 2; (* lines are obscured by closer objects *)
9476
 
9484
 
9477
type
9485
type
9478
(*
9486
(*
9479
 * Do not use righthanded perspective in Viewport2::SetProjection().
9487
 * Do not use righthanded perspective in Viewport2::SetProjection().
9480
 * Set up righthanded mode by using IDirect3DRM3::SetOptions().
9488
 * Set up righthanded mode by using IDirect3DRM3::SetOptions().
9481
 *)
9489
 *)
9482
  PD3DRMProjectionType = ^TD3DRMProjectionType;
9490
  PD3DRMProjectionType = ^TD3DRMProjectionType;
9483
  TD3DRMProjectionType = (
9491
  TD3DRMProjectionType = (
9484
    D3DRMPROJECT_PERSPECTIVE,
9492
    D3DRMPROJECT_PERSPECTIVE,
9485
    D3DRMPROJECT_ORTHOGRAPHIC,
9493
    D3DRMPROJECT_ORTHOGRAPHIC,
9486
    D3DRMPROJECT_RIGHTHANDPERSPECTIVE, (* Only valid pre-DX6 *)
9494
    D3DRMPROJECT_RIGHTHANDPERSPECTIVE, (* Only valid pre-DX6 *)
9487
    D3DRMPROJECT_RIGHTHANDORTHOGRAPHIC (* Only valid pre-DX6 *)
9495
    D3DRMPROJECT_RIGHTHANDORTHOGRAPHIC (* Only valid pre-DX6 *)
9488
  );
9496
  );
9489
 
9497
 
9490
const
9498
const
9491
  D3DRMOPTIONS_LEFTHANDED  = 00000001; (* Default *)
9499
  D3DRMOPTIONS_LEFTHANDED  = 00000001; (* Default *)
9492
  D3DRMOPTIONS_RIGHTHANDED = 00000002;
9500
  D3DRMOPTIONS_RIGHTHANDED = 00000002;
9493
 
9501
 
9494
type
9502
type
9495
  PD3DRMXOFFormat = ^TD3DRMXOFFormat;
9503
  PD3DRMXOFFormat = ^TD3DRMXOFFormat;
9496
  TD3DRMXOFFormat = (
9504
  TD3DRMXOFFormat = (
9497
    D3DRMXOF_BINARY,
9505
    D3DRMXOF_BINARY,
9498
    D3DRMXOF_COMPRESSED,
9506
    D3DRMXOF_COMPRESSED,
9499
    D3DRMXOF_TEXT
9507
    D3DRMXOF_TEXT
9500
  );
9508
  );
9501
 
9509
 
9502
  TD3DRMSaveOptions = DWORD;
9510
  TD3DRMSaveOptions = DWORD;
9503
const
9511
const
9504
  D3DRMXOFSAVE_NORMALS = 1;
9512
  D3DRMXOFSAVE_NORMALS = 1;
9505
  D3DRMXOFSAVE_TEXTURECOORDINATES = 2;
9513
  D3DRMXOFSAVE_TEXTURECOORDINATES = 2;
9506
  D3DRMXOFSAVE_MATERIALS = 4;
9514
  D3DRMXOFSAVE_MATERIALS = 4;
9507
  D3DRMXOFSAVE_TEXTURENAMES = 8;
9515
  D3DRMXOFSAVE_TEXTURENAMES = 8;
9508
  D3DRMXOFSAVE_ALL = 15;
9516
  D3DRMXOFSAVE_ALL = 15;
9509
  D3DRMXOFSAVE_TEMPLATES = 16;
9517
  D3DRMXOFSAVE_TEMPLATES = 16;
9510
  D3DRMXOFSAVE_TEXTURETOPOLOGY = 32;
9518
  D3DRMXOFSAVE_TEXTURETOPOLOGY = 32;
9511
 
9519
 
9512
type
9520
type
9513
  PD3DRMColorSource = ^TD3DRMColorSource;
9521
  PD3DRMColorSource = ^TD3DRMColorSource;
9514
  TD3DRMColorSource = (
9522
  TD3DRMColorSource = (
9515
    D3DRMCOLOR_FROMFACE,
9523
    D3DRMCOLOR_FROMFACE,
9516
    D3DRMCOLOR_FROMVERTEX
9524
    D3DRMCOLOR_FROMVERTEX
9517
  );
9525
  );
9518
 
9526
 
9519
  PD3DRMFrameConstraint = ^TD3DRMFrameConstraint;
9527
  PD3DRMFrameConstraint = ^TD3DRMFrameConstraint;
9520
  TD3DRMFrameConstraint = (
9528
  TD3DRMFrameConstraint = (
9521
    D3DRMCONSTRAIN_Z,           (* use only X and Y rotations *)
9529
    D3DRMCONSTRAIN_Z,           (* use only X and Y rotations *)
9522
    D3DRMCONSTRAIN_Y,           (* use only X and Z rotations *)
9530
    D3DRMCONSTRAIN_Y,           (* use only X and Z rotations *)
9523
    D3DRMCONSTRAIN_X            (* use only Y and Z rotations *)
9531
    D3DRMCONSTRAIN_X            (* use only Y and Z rotations *)
9524
  );
9532
  );
9525
 
9533
 
9526
  PD3DRMMaterialMode = ^TD3DRMMaterialMode;
9534
  PD3DRMMaterialMode = ^TD3DRMMaterialMode;
9527
  TD3DRMMaterialMode = (
9535
  TD3DRMMaterialMode = (
9528
    D3DRMMATERIAL_FROMMESH,
9536
    D3DRMMATERIAL_FROMMESH,
9529
    D3DRMMATERIAL_FROMPARENT,
9537
    D3DRMMATERIAL_FROMPARENT,
9530
    D3DRMMATERIAL_FROMFRAME
9538
    D3DRMMATERIAL_FROMFRAME
9531
  );
9539
  );
9532
 
9540
 
9533
  PD3DRMFogMode = ^TD3DRMFogMode;
9541
  PD3DRMFogMode = ^TD3DRMFogMode;
9534
  TD3DRMFogMode = (
9542
  TD3DRMFogMode = (
9535
    D3DRMFOG_LINEAR,            (* linear between start and end *)
9543
    D3DRMFOG_LINEAR,            (* linear between start and end *)
9536
    D3DRMFOG_EXPONENTIAL,       (* density * exp(-distance) *)
9544
    D3DRMFOG_EXPONENTIAL,       (* density * exp(-distance) *)
9537
    D3DRMFOG_EXPONENTIALSQUARED (* density * exp(-distance*distance) *)
9545
    D3DRMFOG_EXPONENTIALSQUARED (* density * exp(-distance*distance) *)
9538
  );
9546
  );
9539
 
9547
 
9540
  PD3DRMZBufferMode = ^TD3DRMZBufferMode;
9548
  PD3DRMZBufferMode = ^TD3DRMZBufferMode;
9541
  TD3DRMZBufferMode = (
9549
  TD3DRMZBufferMode = (
9542
    D3DRMZBUFFER_FROMPARENT,    (* default *)
9550
    D3DRMZBUFFER_FROMPARENT,    (* default *)
9543
    D3DRMZBUFFER_ENABLE,        (* enable zbuffering *)
9551
    D3DRMZBUFFER_ENABLE,        (* enable zbuffering *)
9544
    D3DRMZBUFFER_DISABLE        (* disable zbuffering *)
9552
    D3DRMZBUFFER_DISABLE        (* disable zbuffering *)
9545
  );
9553
  );
9546
 
9554
 
9547
  PD3DRMSortMode = ^TD3DRMSortMode;
9555
  PD3DRMSortMode = ^TD3DRMSortMode;
9548
  TD3DRMSortMode = (
9556
  TD3DRMSortMode = (
9549
    D3DRMSORT_FROMPARENT,       (* default *)
9557
    D3DRMSORT_FROMPARENT,       (* default *)
9550
    D3DRMSORT_NONE,             (* don't sort child frames *)
9558
    D3DRMSORT_NONE,             (* don't sort child frames *)
9551
    D3DRMSORT_FRONTTOBACK,      (* sort child frames front-to-back *)
9559
    D3DRMSORT_FRONTTOBACK,      (* sort child frames front-to-back *)
9552
    D3DRMSORT_BACKTOFRONT       (* sort child frames back-to-front *)
9560
    D3DRMSORT_BACKTOFRONT       (* sort child frames back-to-front *)
9553
  );
9561
  );
9554
 
9562
 
9555
  TD3DRMMaterialOverride = packed record
9563
  TD3DRMMaterialOverride = packed record
9556
    dwSize : DWORD;       (* Size of this structure *)
9564
    dwSize : DWORD;       (* Size of this structure *)
9557
    dwFlags : DWORD;      (* Indicate which fields are valid *)
9565
    dwFlags : DWORD;      (* Indicate which fields are valid *)
9558
    dcDiffuse : TD3DColorValue;    (* RGBA *)
9566
    dcDiffuse : TD3DColorValue;    (* RGBA *)
9559
    dcAmbient : TD3DColorValue;    (* RGB *)
9567
    dcAmbient : TD3DColorValue;    (* RGB *)
9560
    dcEmissive : TD3DColorValue;   (* RGB *)
9568
    dcEmissive : TD3DColorValue;   (* RGB *)
9561
    dcSpecular : TD3DColorValue;   (* RGB *)
9569
    dcSpecular : TD3DColorValue;   (* RGB *)
9562
    dvPower : TD3DValue;
9570
    dvPower : TD3DValue;
9563
    lpD3DRMTex : IUnknown;
9571
    lpD3DRMTex : IUnknown;
9564
  end;
9572
  end;
9565
 
9573
 
9566
const
9574
const
9567
  D3DRMMATERIALOVERRIDE_DIFFUSE_ALPHAONLY     = $00000001;
9575
  D3DRMMATERIALOVERRIDE_DIFFUSE_ALPHAONLY     = $00000001;
9568
  D3DRMMATERIALOVERRIDE_DIFFUSE_RGBONLY       = $00000002;
9576
  D3DRMMATERIALOVERRIDE_DIFFUSE_RGBONLY       = $00000002;
9569
  D3DRMMATERIALOVERRIDE_DIFFUSE               = $00000003;
9577
  D3DRMMATERIALOVERRIDE_DIFFUSE               = $00000003;
9570
  D3DRMMATERIALOVERRIDE_AMBIENT               = $00000004;
9578
  D3DRMMATERIALOVERRIDE_AMBIENT               = $00000004;
9571
  D3DRMMATERIALOVERRIDE_EMISSIVE              = $00000008;
9579
  D3DRMMATERIALOVERRIDE_EMISSIVE              = $00000008;
9572
  D3DRMMATERIALOVERRIDE_SPECULAR              = $00000010;
9580
  D3DRMMATERIALOVERRIDE_SPECULAR              = $00000010;
9573
  D3DRMMATERIALOVERRIDE_POWER                 = $00000020;
9581
  D3DRMMATERIALOVERRIDE_POWER                 = $00000020;
9574
  D3DRMMATERIALOVERRIDE_TEXTURE               = $00000040;
9582
  D3DRMMATERIALOVERRIDE_TEXTURE               = $00000040;
9575
  D3DRMMATERIALOVERRIDE_DIFFUSE_ALPHAMULTIPLY = $00000080;
9583
  D3DRMMATERIALOVERRIDE_DIFFUSE_ALPHAMULTIPLY = $00000080;
9576
  D3DRMMATERIALOVERRIDE_ALL                   = $000000FF;
9584
  D3DRMMATERIALOVERRIDE_ALL                   = $000000FF;
9577
 
9585
 
9578
  D3DRMFPTF_ALPHA                           = $00000001;
9586
  D3DRMFPTF_ALPHA                           = $00000001;
9579
  D3DRMFPTF_NOALPHA                         = $00000002;
9587
  D3DRMFPTF_NOALPHA                         = $00000002;
9580
  D3DRMFPTF_PALETTIZED                      = $00000004;
9588
  D3DRMFPTF_PALETTIZED                      = $00000004;
9581
  D3DRMFPTF_NOTPALETTIZED                   = $00000008;
9589
  D3DRMFPTF_NOTPALETTIZED                   = $00000008;
9582
 
9590
 
9583
  D3DRMSTATECHANGE_UPDATEONLY               = $000000001;
9591
  D3DRMSTATECHANGE_UPDATEONLY               = $000000001;
9584
  D3DRMSTATECHANGE_VOLATILE                 = $000000002;
9592
  D3DRMSTATECHANGE_VOLATILE                 = $000000002;
9585
  D3DRMSTATECHANGE_NONVOLATILE              = $000000004;
9593
  D3DRMSTATECHANGE_NONVOLATILE              = $000000004;
9586
  D3DRMSTATECHANGE_RENDER                   = $000000020;
9594
  D3DRMSTATECHANGE_RENDER                   = $000000020;
9587
  D3DRMSTATECHANGE_LIGHT                    = $000000040;
9595
  D3DRMSTATECHANGE_LIGHT                    = $000000040;
9588
 
9596
 
9589
(*
9597
(*
9590
 * Values for flags in RM3::CreateDeviceFromSurface
9598
 * Values for flags in RM3::CreateDeviceFromSurface
9591
 *)
9599
 *)
9592
  D3DRMDEVICE_NOZBUFFER           = $00000001;
9600
  D3DRMDEVICE_NOZBUFFER           = $00000001;
9593
 
9601
 
9594
(*
9602
(*
9595
 * Values for flags in Object2::SetClientData
9603
 * Values for flags in Object2::SetClientData
9596
 *)
9604
 *)
9597
  D3DRMCLIENTDATA_NONE            = $00000001;
9605
  D3DRMCLIENTDATA_NONE            = $00000001;
9598
  D3DRMCLIENTDATA_LOCALFREE       = $00000002;
9606
  D3DRMCLIENTDATA_LOCALFREE       = $00000002;
9599
  D3DRMCLIENTDATA_IUNKNOWN        = $00000004;
9607
  D3DRMCLIENTDATA_IUNKNOWN        = $00000004;
9600
 
9608
 
9601
(*
9609
(*
9602
 * Values for flags in Frame2::AddMoveCallback.
9610
 * Values for flags in Frame2::AddMoveCallback.
9603
 *)
9611
 *)
9604
  D3DRMCALLBACK_PREORDER                = 0;
9612
  D3DRMCALLBACK_PREORDER                = 0;
9605
  D3DRMCALLBACK_POSTORDER               = 1;
9613
  D3DRMCALLBACK_POSTORDER               = 1;
9606
 
9614
 
9607
(*
9615
(*
9608
 * Values for flags in MeshBuilder2::RayPick.
9616
 * Values for flags in MeshBuilder2::RayPick.
9609
 *)
9617
 *)
9610
  D3DRMRAYPICK_ONLYBOUNDINGBOXES        = 1;
9618
  D3DRMRAYPICK_ONLYBOUNDINGBOXES        = 1;
9611
  D3DRMRAYPICK_IGNOREFURTHERPRIMITIVES  = 2;
9619
  D3DRMRAYPICK_IGNOREFURTHERPRIMITIVES  = 2;
9612
  D3DRMRAYPICK_INTERPOLATEUV            = 4;
9620
  D3DRMRAYPICK_INTERPOLATEUV            = 4;
9613
  D3DRMRAYPICK_INTERPOLATECOLOR         = 8;
9621
  D3DRMRAYPICK_INTERPOLATECOLOR         = 8;
9614
  D3DRMRAYPICK_INTERPOLATENORMAL        = $10;
9622
  D3DRMRAYPICK_INTERPOLATENORMAL        = $10;
9615
 
9623
 
9616
(*
9624
(*
9617
 * Values for flags in MeshBuilder3::AddFacesIndexed.
9625
 * Values for flags in MeshBuilder3::AddFacesIndexed.
9618
 *)
9626
 *)
9619
  D3DRMADDFACES_VERTICESONLY             = 1;
9627
  D3DRMADDFACES_VERTICESONLY             = 1;
9620
 
9628
 
9621
(*
9629
(*
9622
 * Values for flags in MeshBuilder2::GenerateNormals.
9630
 * Values for flags in MeshBuilder2::GenerateNormals.
9623
 *)
9631
 *)
9624
  D3DRMGENERATENORMALS_PRECOMPACT       = 1;
9632
  D3DRMGENERATENORMALS_PRECOMPACT       = 1;
9625
  D3DRMGENERATENORMALS_USECREASEANGLE   = 2;
9633
  D3DRMGENERATENORMALS_USECREASEANGLE   = 2;
9626
 
9634
 
9627
(*
9635
(*
9628
 * Values for MeshBuilder3::GetParentMesh
9636
 * Values for MeshBuilder3::GetParentMesh
9629
 *)
9637
 *)
9630
  D3DRMMESHBUILDER_DIRECTPARENT          = 1;
9638
  D3DRMMESHBUILDER_DIRECTPARENT          = 1;
9631
  D3DRMMESHBUILDER_ROOTMESH              = 2;
9639
  D3DRMMESHBUILDER_ROOTMESH              = 2;
9632
 
9640
 
9633
(*
9641
(*
9634
 * Flags for MeshBuilder3::Enable
9642
 * Flags for MeshBuilder3::Enable
9635
 *)
9643
 *)
9636
  D3DRMMESHBUILDER_RENDERENABLE   = $00000001;
9644
  D3DRMMESHBUILDER_RENDERENABLE   = $00000001;
9637
  D3DRMMESHBUILDER_PICKENABLE     = $00000002;
9645
  D3DRMMESHBUILDER_PICKENABLE     = $00000002;
9638
 
9646
 
9639
(*
9647
(*
9640
 * Flags for Object2::GetAge when used with MeshBuilders
9648
 * Flags for Object2::GetAge when used with MeshBuilders
9641
 *)
9649
 *)
9642
  D3DRMMESHBUILDERAGE_GEOMETRY    = $00000001;
9650
  D3DRMMESHBUILDERAGE_GEOMETRY    = $00000001;
9643
  D3DRMMESHBUILDERAGE_MATERIALS   = $00000002;
9651
  D3DRMMESHBUILDERAGE_MATERIALS   = $00000002;
9644
  D3DRMMESHBUILDERAGE_TEXTURES    = $00000004;
9652
  D3DRMMESHBUILDERAGE_TEXTURES    = $00000004;
9645
 
9653
 
9646
(*
9654
(*
9647
 * Format flags for MeshBuilder3::AddTriangles.
9655
 * Format flags for MeshBuilder3::AddTriangles.
9648
 *)
9656
 *)
9649
  D3DRMFVF_TYPE                   = $00000001;
9657
  D3DRMFVF_TYPE                   = $00000001;
9650
  D3DRMFVF_NORMAL                 = $00000002;
9658
  D3DRMFVF_NORMAL                 = $00000002;
9651
  D3DRMFVF_COLOR                  = $00000004;
9659
  D3DRMFVF_COLOR                  = $00000004;
9652
  D3DRMFVF_TEXTURECOORDS          = $00000008;
9660
  D3DRMFVF_TEXTURECOORDS          = $00000008;
9653
 
9661
 
9654
  D3DRMVERTEX_STRIP               = $00000001;
9662
  D3DRMVERTEX_STRIP               = $00000001;
9655
  D3DRMVERTEX_FAN                 = $00000002;
9663
  D3DRMVERTEX_FAN                 = $00000002;
9656
  D3DRMVERTEX_LIST                = $00000004;
9664
  D3DRMVERTEX_LIST                = $00000004;
9657
 
9665
 
9658
(*
9666
(*
9659
 * Values for flags in Viewport2::Clear2
9667
 * Values for flags in Viewport2::Clear2
9660
 *)
9668
 *)
9661
  D3DRMCLEAR_TARGET               = $00000001;
9669
  D3DRMCLEAR_TARGET               = $00000001;
9662
  D3DRMCLEAR_ZBUFFER              = $00000002;
9670
  D3DRMCLEAR_ZBUFFER              = $00000002;
9663
  D3DRMCLEAR_DIRTYRECTS           = $00000004;
9671
  D3DRMCLEAR_DIRTYRECTS           = $00000004;
9664
  D3DRMCLEAR_ALL                  = (D3DRMCLEAR_TARGET or
9672
  D3DRMCLEAR_ALL                  = (D3DRMCLEAR_TARGET or
9665
                                         D3DRMCLEAR_ZBUFFER or
9673
                                         D3DRMCLEAR_ZBUFFER or
9666
                                         D3DRMCLEAR_DIRTYRECTS);
9674
                                         D3DRMCLEAR_DIRTYRECTS);
9667
 
9675
 
9668
(*
9676
(*
9669
 * Values for flags in Frame3::SetSceneFogMethod
9677
 * Values for flags in Frame3::SetSceneFogMethod
9670
 *)
9678
 *)
9671
  D3DRMFOGMETHOD_VERTEX          = $00000001;
9679
  D3DRMFOGMETHOD_VERTEX          = $00000001;
9672
  D3DRMFOGMETHOD_TABLE           = $00000002;
9680
  D3DRMFOGMETHOD_TABLE           = $00000002;
9673
  D3DRMFOGMETHOD_ANY             = $00000004;
9681
  D3DRMFOGMETHOD_ANY             = $00000004;
9674
 
9682
 
9675
(*
9683
(*
9676
 * Values for flags in Frame3::SetTraversalOptions
9684
 * Values for flags in Frame3::SetTraversalOptions
9677
 *)
9685
 *)
9678
  D3DRMFRAME_RENDERENABLE        = $00000001;
9686
  D3DRMFRAME_RENDERENABLE        = $00000001;
9679
  D3DRMFRAME_PICKENABLE          = $00000002;
9687
  D3DRMFRAME_PICKENABLE          = $00000002;
9680
 
9688
 
9681
type
9689
type
9682
  TD3DRMAnimationOptions = DWORD;
9690
  TD3DRMAnimationOptions = DWORD;
9683
 
9691
 
9684
const
9692
const
9685
  D3DRMANIMATION_OPEN = $01;
9693
  D3DRMANIMATION_OPEN = $01;
9686
  D3DRMANIMATION_CLOSED = $02;
9694
  D3DRMANIMATION_CLOSED = $02;
9687
  D3DRMANIMATION_LINEARPOSITION = $04;
9695
  D3DRMANIMATION_LINEARPOSITION = $04;
9688
  D3DRMANIMATION_SPLINEPOSITION = $08;
9696
  D3DRMANIMATION_SPLINEPOSITION = $08;
9689
  D3DRMANIMATION_SCALEANDROTATION = $00000010;
9697
  D3DRMANIMATION_SCALEANDROTATION = $00000010;
9690
  D3DRMANIMATION_POSITION = $00000020;
9698
  D3DRMANIMATION_POSITION = $00000020;
9691
 
9699
 
9692
type
9700
type
9693
  TD3DRMInterpolationOptions = DWORD;
9701
  TD3DRMInterpolationOptions = DWORD;
9694
const
9702
const
9695
  D3DRMINTERPOLATION_OPEN = $01;
9703
  D3DRMINTERPOLATION_OPEN = $01;
9696
  D3DRMINTERPOLATION_CLOSED = $02;
9704
  D3DRMINTERPOLATION_CLOSED = $02;
9697
  D3DRMINTERPOLATION_NEAREST = $0100;
9705
  D3DRMINTERPOLATION_NEAREST = $0100;
9698
  D3DRMINTERPOLATION_LINEAR = $04;
9706
  D3DRMINTERPOLATION_LINEAR = $04;
9699
  D3DRMINTERPOLATION_SPLINE = $08;
9707
  D3DRMINTERPOLATION_SPLINE = $08;
9700
  D3DRMINTERPOLATION_VERTEXCOLOR = $40;
9708
  D3DRMINTERPOLATION_VERTEXCOLOR = $40;
9701
  D3DRMINTERPOLATION_SLERPNORMALS = $80;
9709
  D3DRMINTERPOLATION_SLERPNORMALS = $80;
9702
 
9710
 
9703
type
9711
type
9704
  TD3DRMLoadOptions = DWORD;
9712
  TD3DRMLoadOptions = DWORD;
9705
 
9713
 
9706
const
9714
const
9707
  D3DRMLOAD_FROMFILE  = $00;
9715
  D3DRMLOAD_FROMFILE  = $00;
9708
  D3DRMLOAD_FROMRESOURCE = $01;
9716
  D3DRMLOAD_FROMRESOURCE = $01;
9709
  D3DRMLOAD_FROMMEMORY = $02;
9717
  D3DRMLOAD_FROMMEMORY = $02;
9710
  D3DRMLOAD_FROMSTREAM = $04;
9718
  D3DRMLOAD_FROMSTREAM = $04;
9711
  D3DRMLOAD_FROMURL = $08;
9719
  D3DRMLOAD_FROMURL = $08;
9712
 
9720
 
9713
  D3DRMLOAD_BYNAME = $10;
9721
  D3DRMLOAD_BYNAME = $10;
9714
  D3DRMLOAD_BYPOSITION = $20;
9722
  D3DRMLOAD_BYPOSITION = $20;
9715
  D3DRMLOAD_BYGUID = $40;
9723
  D3DRMLOAD_BYGUID = $40;
9716
  D3DRMLOAD_FIRST = $80;
9724
  D3DRMLOAD_FIRST = $80;
9717
 
9725
 
9718
  D3DRMLOAD_INSTANCEBYREFERENCE = $100;
9726
  D3DRMLOAD_INSTANCEBYREFERENCE = $100;
9719
  D3DRMLOAD_INSTANCEBYCOPYING = $200;
9727
  D3DRMLOAD_INSTANCEBYCOPYING = $200;
9720
 
9728
 
9721
  D3DRMLOAD_ASYNCHRONOUS = $400;
9729
  D3DRMLOAD_ASYNCHRONOUS = $400;
9722
 
9730
 
9723
type
9731
type
9724
  PD3DRMLoadResource = ^TD3DRMLoadResource;
9732
  PD3DRMLoadResource = ^TD3DRMLoadResource;
9725
  TD3DRMLoadResource = packed record
9733
  TD3DRMLoadResource = packed record
9726
    hModule: HMODULE;
9734
    hModule: HMODULE;
9727
    lpName: PAnsiChar;
9735
    lpName: PAnsiChar;
9728
    lpType: PAnsiChar;
9736
    lpType: PAnsiChar;
9729
  end;
9737
  end;
9730
 
9738
 
9731
  PD3DRMLoadMemory = ^TD3DRMLoadMemory;
9739
  PD3DRMLoadMemory = ^TD3DRMLoadMemory;
9732
  TD3DRMLoadMemory = packed record
9740
  TD3DRMLoadMemory = packed record
9733
    lpMemory: Pointer;
9741
    lpMemory: Pointer;
9734
    dwSize: DWORD;
9742
    dwSize: DWORD;
9735
  end;
9743
  end;
9736
 
9744
 
9737
const
9745
const
9738
  D3DRMPMESHSTATUS_VALID = $01;
9746
  D3DRMPMESHSTATUS_VALID = $01;
9739
  D3DRMPMESHSTATUS_INTERRUPTED = $02;
9747
  D3DRMPMESHSTATUS_INTERRUPTED = $02;
9740
  D3DRMPMESHSTATUS_BASEMESHCOMPLETE = $04;
9748
  D3DRMPMESHSTATUS_BASEMESHCOMPLETE = $04;
9741
  D3DRMPMESHSTATUS_COMPLETE = $08;
9749
  D3DRMPMESHSTATUS_COMPLETE = $08;
9742
  D3DRMPMESHSTATUS_RENDERABLE = $10;
9750
  D3DRMPMESHSTATUS_RENDERABLE = $10;
9743
 
9751
 
9744
  D3DRMPMESHEVENT_BASEMESH = $01;
9752
  D3DRMPMESHEVENT_BASEMESH = $01;
9745
  D3DRMPMESHEVENT_COMPLETE = $02;
9753
  D3DRMPMESHEVENT_COMPLETE = $02;
9746
 
9754
 
9747
type
9755
type
9748
  PD3DRMPMeshLoadStatus = ^TD3DRMPMeshLoadStatus;
9756
  PD3DRMPMeshLoadStatus = ^TD3DRMPMeshLoadStatus;
9749
  TD3DRMPMeshLoadStatus = packed record
9757
  TD3DRMPMeshLoadStatus = packed record
9750
    dwSize,            // Size of this structure
9758
    dwSize,            // Size of this structure
9751
    dwPMeshSize,       // Total Size (bytes)
9759
    dwPMeshSize,       // Total Size (bytes)
9752
    dwBaseMeshSize,    // Total Size of the Base Mesh
9760
    dwBaseMeshSize,    // Total Size of the Base Mesh
9753
    dwBytesLoaded,     // Total bytes loaded
9761
    dwBytesLoaded,     // Total bytes loaded
9754
    dwVerticesLoaded,  // Number of vertices loaded
9762
    dwVerticesLoaded,  // Number of vertices loaded
9755
    dwFacesLoaded : DWORD;     // Number of faces loaded
9763
    dwFacesLoaded : DWORD;     // Number of faces loaded
9756
    dwLoadResult : HResult;    // Result of the load operation
9764
    dwLoadResult : HResult;    // Result of the load operation
9757
    dwFlags : DWORD;
9765
    dwFlags : DWORD;
9758
  end;
9766
  end;
9759
 
9767
 
9760
  PD3DRMUserVisualReason = ^TD3DRMUserVisualReason;
9768
  PD3DRMUserVisualReason = ^TD3DRMUserVisualReason;
9761
  TD3DRMUserVisualReason = (
9769
  TD3DRMUserVisualReason = (
9762
    D3DRMUSERVISUAL_CANSEE,
9770
    D3DRMUSERVISUAL_CANSEE,
9763
    D3DRMUSERVISUAL_RENDER
9771
    D3DRMUSERVISUAL_RENDER
9764
  );
9772
  );
9765
 
9773
 
9766
  PD3DRMAnimationKey = ^TD3DRMAnimationKey;
9774
  PD3DRMAnimationKey = ^TD3DRMAnimationKey;
9767
  TD3DRMAnimationKey = packed record
9775
  TD3DRMAnimationKey = packed record
9768
    dwSize : DWORD;
9776
    dwSize : DWORD;
9769
    dwKeyType : DWORD;
9777
    dwKeyType : DWORD;
9770
    dvTime : TD3DValue;
9778
    dvTime : TD3DValue;
9771
    dwID : DWORD;
9779
    dwID : DWORD;
9772
    case integer of
9780
    case integer of
9773
      0 : (dqRotateKey : TD3DRMQuaternion);
9781
      0 : (dqRotateKey : TD3DRMQuaternion);
9774
      1 : (dvScaleKey : TD3DVector);
9782
      1 : (dvScaleKey : TD3DVector);
9775
      2 : (dvPositionKey : TD3DVector);
9783
      2 : (dvPositionKey : TD3DVector);
9776
      3 : (dvK : array [0..3] of TD3DValue);
9784
      3 : (dvK : array [0..3] of TD3DValue);
9777
    end;
9785
    end;
9778
 
9786
 
9779
procedure D3DRMAnimationGetRotateKey
9787
procedure D3DRMAnimationGetRotateKey
9780
    (var rmKey: TD3DRMAnimationKey; var rmQuat: TD3DRMQuaternion);
9788
    (var rmKey: TD3DRMAnimationKey; var rmQuat: TD3DRMQuaternion);
9781
 
9789
 
9782
procedure D3DRMAnimationGetScaleKey
9790
procedure D3DRMAnimationGetScaleKey
9783
    (var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
9791
    (var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
9784
 
9792
 
9785
procedure D3DRMAnimationGetPositionKey
9793
procedure D3DRMAnimationGetPositionKey
9786
    (var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
9794
    (var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
9787
 
9795
 
9788
procedure D3DRMAnimatioSetRotateKey
9796
procedure D3DRMAnimatioSetRotateKey
9789
    (var rmKey: TD3DRMAnimationKey; var rmQuat: TD3DRMQuaternion);
9797
    (var rmKey: TD3DRMAnimationKey; var rmQuat: TD3DRMQuaternion);
9790
 
9798
 
9791
procedure D3DRMAnimationSetScaleKey
9799
procedure D3DRMAnimationSetScaleKey
9792
    (var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
9800
    (var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
9793
 
9801
 
9794
procedure D3DRMAnimationSetPositionKey
9802
procedure D3DRMAnimationSetPositionKey
9795
    (var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
9803
    (var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
9796
 
9804
 
9797
const
9805
const
9798
  D3DRMANIMATION_ROTATEKEY = 01;
9806
  D3DRMANIMATION_ROTATEKEY = 01;
9799
  D3DRMANIMATION_SCALEKEY = 02;
9807
  D3DRMANIMATION_SCALEKEY = 02;
9800
  D3DRMANIMATION_POSITIONKEY = 03;
9808
  D3DRMANIMATION_POSITIONKEY = 03;
9801
 
9809
 
9802
type
9810
type
9803
  TD3DRMMapping = DWORD;
9811
  TD3DRMMapping = DWORD;
9804
  PD3DRMMappingFlag = ^TD3DRMMappingFlag;
9812
  PD3DRMMappingFlag = ^TD3DRMMappingFlag;
9805
  TD3DRMMappingFlag = DWORD;
9813
  TD3DRMMappingFlag = DWORD;
9806
 
9814
 
9807
const
9815
const
9808
  D3DRMMAP_WRAPU = 1;
9816
  D3DRMMAP_WRAPU = 1;
9809
  D3DRMMAP_WRAPV = 2;
9817
  D3DRMMAP_WRAPV = 2;
9810
  D3DRMMAP_PERSPCORRECT = 4;
9818
  D3DRMMAP_PERSPCORRECT = 4;
9811
 
9819
 
9812
type
9820
type
9813
  PD3DRMVertex = ^TD3DRMVertex;
9821
  PD3DRMVertex = ^TD3DRMVertex;
9814
  TD3DRMVertex = packed record
9822
  TD3DRMVertex = packed record
9815
    position: TD3DVector;
9823
    position: TD3DVector;
9816
    normal: TD3DVector;
9824
    normal: TD3DVector;
9817
    tu, tv: TD3DValue;
9825
    tu, tv: TD3DValue;
9818
    color: TD3DColor;
9826
    color: TD3DColor;
9819
  end;
9827
  end;
9820
 
9828
 
9821
  TD3DRMGroupIndex = LongInt; (* group indexes begin a 0 *)
9829
  TD3DRMGroupIndex = LongInt; (* group indexes begin a 0 *)
9822
 
9830
 
9823
const
9831
const
9824
  D3DRMGROUP_ALLGROUPS = -1;
9832
  D3DRMGROUP_ALLGROUPS = -1;
9825
 
9833
 
9826
var
9834
var
9827
(*
9835
(*
9828
 * Create a color from three components in the range 0-1 inclusive.
9836
 * Create a color from three components in the range 0-1 inclusive.
9829
 *)
9837
 *)
9830
  D3DRMCreateColorRGB : function (red, green, blue: TD3DValue) : TD3DColor;
9838
  D3DRMCreateColorRGB : function (red, green, blue: TD3DValue) : TD3DColor;
9831
      stdcall;
9839
      stdcall;
9832
 
9840
 
9833
(*
9841
(*
9834
 * Create a color from four components in the range 0-1 inclusive.
9842
 * Create a color from four components in the range 0-1 inclusive.
9835
 *)
9843
 *)
9836
  D3DRMCreateColorRGBA : function (red, green, blue, alpha: TD3DValue)
9844
  D3DRMCreateColorRGBA : function (red, green, blue, alpha: TD3DValue)
9837
      : TD3DColor; stdcall;
9845
      : TD3DColor; stdcall;
9838
 
9846
 
9839
(*
9847
(*
9840
 * Get the red component of a color.
9848
 * Get the red component of a color.
9841
 *)
9849
 *)
9842
  D3DRMColorGetRed : function (d3drmc: TD3DColor) : TD3DValue; stdcall;
9850
  D3DRMColorGetRed : function (d3drmc: TD3DColor) : TD3DValue; stdcall;
9843
 
9851
 
9844
(*
9852
(*
9845
 * Get the green component of a color.
9853
 * Get the green component of a color.
9846
 *)
9854
 *)
9847
  D3DRMColorGetGreen : function (d3drmc: TD3DColor) : TD3DValue; stdcall;
9855
  D3DRMColorGetGreen : function (d3drmc: TD3DColor) : TD3DValue; stdcall;
9848
 
9856
 
9849
(*
9857
(*
9850
 * Get the blue component of a color.
9858
 * Get the blue component of a color.
9851
 *)
9859
 *)
9852
  D3DRMColorGetBlue : function (d3drmc: TD3DColor) : TD3DValue; stdcall;
9860
  D3DRMColorGetBlue : function (d3drmc: TD3DColor) : TD3DValue; stdcall;
9853
 
9861
 
9854
(*
9862
(*
9855
 * Get the alpha component of a color.
9863
 * Get the alpha component of a color.
9856
 *)
9864
 *)
9857
  D3DRMColorGetAlpha : function (d3drmc: TD3DColor) : TD3DValue; stdcall;
9865
  D3DRMColorGetAlpha : function (d3drmc: TD3DColor) : TD3DValue; stdcall;
9858
 
9866
 
9859
(*
9867
(*
9860
 * Add two vectors.  Returns its first argument.
9868
 * Add two vectors.  Returns its first argument.
9861
 *)
9869
 *)
9862
  D3DRMVectorAdd : function (var d, s1, s2: TD3DVector) : PD3DVector; stdcall;
9870
  D3DRMVectorAdd : function (var d, s1, s2: TD3DVector) : PD3DVector; stdcall;
9863
 
9871
 
9864
(*
9872
(*
9865
 * Subtract two vectors.  Returns its first argument.
9873
 * Subtract two vectors.  Returns its first argument.
9866
 *)
9874
 *)
9867
  D3DRMVectorSubtract : function (var d, s1, s2: TD3DVector) : PD3DVector;
9875
  D3DRMVectorSubtract : function (var d, s1, s2: TD3DVector) : PD3DVector;
9868
      stdcall;
9876
      stdcall;
9869
 
9877
 
9870
(*
9878
(*
9871
 * Reflect a ray about a given normal.  Returns its first argument.
9879
 * Reflect a ray about a given normal.  Returns its first argument.
9872
 *)
9880
 *)
9873
  D3DRMVectorReflect : function (var d, ray, norm: TD3DVector) : PD3DVector;
9881
  D3DRMVectorReflect : function (var d, ray, norm: TD3DVector) : PD3DVector;
9874
      stdcall;
9882
      stdcall;
9875
 
9883
 
9876
(*
9884
(*
9877
 * Calculate the vector cross product.  Returns its first argument.
9885
 * Calculate the vector cross product.  Returns its first argument.
9878
 *)
9886
 *)
9879
  D3DRMVectorCrossProduct : function (var d, s1, s2: TD3DVector) : PD3DVector;
9887
  D3DRMVectorCrossProduct : function (var d, s1, s2: TD3DVector) : PD3DVector;
9880
      stdcall;
9888
      stdcall;
9881
 
9889
 
9882
(*
9890
(*
9883
 * Return the vector dot product.
9891
 * Return the vector dot product.
9884
 *)
9892
 *)
9885
  D3DRMVectorDotProduct : function (var s1, s2: TD3DVector) : TD3DValue;
9893
  D3DRMVectorDotProduct : function (var s1, s2: TD3DVector) : TD3DValue;
9886
      stdcall;
9894
      stdcall;
9887
 
9895
 
9888
(*
9896
(*
9889
 * Scale a vector so that its modulus is 1.  Returns its argument or
9897
 * Scale a vector so that its modulus is 1.  Returns its argument or
9890
 * NULL if there was an error (e.g. a zero vector was passed).
9898
 * NULL if there was an error (e.g. a zero vector was passed).
9891
 *)
9899
 *)
9892
  D3DRMVectorNormalize : function (var lpv: TD3DVector) : PD3DVector; stdcall;
9900
  D3DRMVectorNormalize : function (var lpv: TD3DVector) : PD3DVector; stdcall;
9893
 
9901
 
9894
(*
9902
(*
9895
 * Return the length of a vector (e.g. sqrt(x*x + y*y + z*z)).
9903
 * Return the length of a vector (e.g. sqrt(x*x + y*y + z*z)).
9896
 *)
9904
 *)
9897
  D3DRMVectorModulus : function (var v: TD3DVector) : TD3DValue; stdcall;
9905
  D3DRMVectorModulus : function (var v: TD3DVector) : TD3DValue; stdcall;
9898
 
9906
 
9899
(*
9907
(*
9900
 * Set the rotation part of a matrix to be a rotation of theta radians
9908
 * Set the rotation part of a matrix to be a rotation of theta radians
9901
 * around the given axis.
9909
 * around the given axis.
9902
 *)
9910
 *)
9903
  D3DRMVectorRotate : function (var r, v, axis: TD3DVector; theta: TD3DValue) :
9911
  D3DRMVectorRotate : function (var r, v, axis: TD3DVector; theta: TD3DValue) :
9904
      PD3DVector; stdcall;
9912
      PD3DVector; stdcall;
9905
 
9913
 
9906
(*
9914
(*
9907
 * Scale a vector uniformly in all three axes
9915
 * Scale a vector uniformly in all three axes
9908
 *)
9916
 *)
9909
  D3DRMVectorScale : function (var d, s: TD3DVector; factor: TD3DValue) :
9917
  D3DRMVectorScale : function (var d, s: TD3DVector; factor: TD3DValue) :
9910
      PD3DVector; stdcall;
9918
      PD3DVector; stdcall;
9911
 
9919
 
9912
(*
9920
(*
9913
 * Return a random unit vector
9921
 * Return a random unit vector
9914
 *)
9922
 *)
9915
  D3DRMVectorRandom : function (var d: TD3DVector) : PD3DVector; stdcall;
9923
  D3DRMVectorRandom : function (var d: TD3DVector) : PD3DVector; stdcall;
9916
 
9924
 
9917
(*
9925
(*
9918
 * Returns a unit quaternion that represents a rotation of theta radians
9926
 * Returns a unit quaternion that represents a rotation of theta radians
9919
 * around the given axis.
9927
 * around the given axis.
9920
 *)
9928
 *)
9921
 
9929
 
9922
  D3DRMQuaternionFromRotation : function (var quat: TD3DRMQuaternion;
9930
  D3DRMQuaternionFromRotation : function (var quat: TD3DRMQuaternion;
9923
      var v: TD3DVector; theta: TD3DValue) : PD3DRMQuaternion; stdcall;
9931
      var v: TD3DVector; theta: TD3DValue) : PD3DRMQuaternion; stdcall;
9924
 
9932
 
9925
(*
9933
(*
9926
 * Calculate the product of two quaternions
9934
 * Calculate the product of two quaternions
9927
 *)
9935
 *)
9928
  D3DRMQuaternionMultiply : function (var q, a, b: TD3DRMQuaternion) :
9936
  D3DRMQuaternionMultiply : function (var q, a, b: TD3DRMQuaternion) :
9929
      PD3DRMQuaternion; stdcall;
9937
      PD3DRMQuaternion; stdcall;
9930
 
9938
 
9931
(*
9939
(*
9932
 * Interpolate between two quaternions
9940
 * Interpolate between two quaternions
9933
 *)
9941
 *)
9934
  D3DRMQuaternionSlerp : function (var q, a, b: TD3DRMQuaternion;
9942
  D3DRMQuaternionSlerp : function (var q, a, b: TD3DRMQuaternion;
9935
      alpha: TD3DValue) : PD3DRMQuaternion; stdcall;
9943
      alpha: TD3DValue) : PD3DRMQuaternion; stdcall;
9936
 
9944
 
9937
(*
9945
(*
9938
 * Calculate the matrix for the rotation that a unit quaternion represents
9946
 * Calculate the matrix for the rotation that a unit quaternion represents
9939
 *)
9947
 *)
9940
  D3DRMMatrixFromQuaternion : procedure (dmMat: TD3DRMMatrix4D; var lpDqQuat:
9948
  D3DRMMatrixFromQuaternion : procedure (dmMat: TD3DRMMatrix4D; var lpDqQuat:
9941
      TD3DRMQuaternion); stdcall;
9949
      TD3DRMQuaternion); stdcall;
9942
 
9950
 
9943
(*
9951
(*
9944
 * Calculate the quaternion that corresponds to a rotation matrix
9952
 * Calculate the quaternion that corresponds to a rotation matrix
9945
 *)
9953
 *)
9946
  D3DRMQuaternionFromMatrix : function (var lpQuat: TD3DRMQuaternion;
9954
  D3DRMQuaternionFromMatrix : function (var lpQuat: TD3DRMQuaternion;
9947
      Mat: TD3DRMMatrix4D) : PD3DRMQuaternion; stdcall;
9955
      Mat: TD3DRMMatrix4D) : PD3DRMQuaternion; stdcall;
9948
 
9956
 
9949
(*==========================================================================;
9957
(*==========================================================================;
9950
 *
9958
 *
9951
 *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
9959
 *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
9952
 *
9960
 *
9953
 *  File:       d3drmobj.h
9961
 *  File:       d3drmobj.h
9954
 *  Content:    Direct3DRM include file
9962
 *  Content:    Direct3DRM include file
9955
 *
9963
 *
9956
 ***************************************************************************)
9964
 ***************************************************************************)
9957
 
9965
 
9958
(*
9966
(*
9959
 * Direct3DRM Object classes
9967
 * Direct3DRM Object classes
9960
 *)
9968
 *)
9961
 
9969
 
9962
const
9970
const
9963
  CLSID_CDirect3DRMDevice: TGUID =
9971
  CLSID_CDirect3DRMDevice: TGUID =
9964
      (D1:$4fa3568e;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9972
      (D1:$4fa3568e;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9965
  CLSID_CDirect3DRMViewport: TGUID =
9973
  CLSID_CDirect3DRMViewport: TGUID =
9966
      (D1:$4fa3568f;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9974
      (D1:$4fa3568f;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9967
  CLSID_CDirect3DRMFrame: TGUID =
9975
  CLSID_CDirect3DRMFrame: TGUID =
9968
      (D1:$4fa35690;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9976
      (D1:$4fa35690;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9969
  CLSID_CDirect3DRMMesh: TGUID =
9977
  CLSID_CDirect3DRMMesh: TGUID =
9970
      (D1:$4fa35691;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9978
      (D1:$4fa35691;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9971
  CLSID_CDirect3DRMMeshBuilder: TGUID =
9979
  CLSID_CDirect3DRMMeshBuilder: TGUID =
9972
      (D1:$4fa35692;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9980
      (D1:$4fa35692;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9973
  CLSID_CDirect3DRMFace: TGUID =
9981
  CLSID_CDirect3DRMFace: TGUID =
9974
      (D1:$4fa35693;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9982
      (D1:$4fa35693;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9975
  CLSID_CDirect3DRMLight: TGUID =
9983
  CLSID_CDirect3DRMLight: TGUID =
9976
      (D1:$4fa35694;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9984
      (D1:$4fa35694;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9977
  CLSID_CDirect3DRMTexture: TGUID =
9985
  CLSID_CDirect3DRMTexture: TGUID =
9978
      (D1:$4fa35695;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9986
      (D1:$4fa35695;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9979
  CLSID_CDirect3DRMWrap: TGUID =
9987
  CLSID_CDirect3DRMWrap: TGUID =
9980
      (D1:$4fa35696;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9988
      (D1:$4fa35696;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9981
  CLSID_CDirect3DRMMaterial: TGUID =
9989
  CLSID_CDirect3DRMMaterial: TGUID =
9982
      (D1:$4fa35697;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9990
      (D1:$4fa35697;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9983
  CLSID_CDirect3DRMAnimation: TGUID =
9991
  CLSID_CDirect3DRMAnimation: TGUID =
9984
      (D1:$4fa35698;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9992
      (D1:$4fa35698;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9985
  CLSID_CDirect3DRMAnimationSet: TGUID =
9993
  CLSID_CDirect3DRMAnimationSet: TGUID =
9986
      (D1:$4fa35699;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9994
      (D1:$4fa35699;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9987
  CLSID_CDirect3DRMUserVisual: TGUID =
9995
  CLSID_CDirect3DRMUserVisual: TGUID =
9988
      (D1:$4fa3569a;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9996
      (D1:$4fa3569a;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9989
  CLSID_CDirect3DRMShadow: TGUID =
9997
  CLSID_CDirect3DRMShadow: TGUID =
9990
      (D1:$4fa3569b;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9998
      (D1:$4fa3569b;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
9991
  CLSID_CDirect3DRMViewportInterpolator: TGUID =
9999
  CLSID_CDirect3DRMViewportInterpolator: TGUID =
9992
      (D1:$0de9eaa1;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
10000
      (D1:$0de9eaa1;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
9993
  CLSID_CDirect3DRMFrameInterpolator: TGUID =
10001
  CLSID_CDirect3DRMFrameInterpolator: TGUID =
9994
      (D1:$0de9eaa2;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
10002
      (D1:$0de9eaa2;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
9995
  CLSID_CDirect3DRMMeshInterpolator: TGUID =
10003
  CLSID_CDirect3DRMMeshInterpolator: TGUID =
9996
      (D1:$0de9eaa3;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
10004
      (D1:$0de9eaa3;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
9997
  CLSID_CDirect3DRMLightInterpolator: TGUID =
10005
  CLSID_CDirect3DRMLightInterpolator: TGUID =
9998
      (D1:$0de9eaa6;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
10006
      (D1:$0de9eaa6;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
9999
  CLSID_CDirect3DRMMaterialInterpolator: TGUID =
10007
  CLSID_CDirect3DRMMaterialInterpolator: TGUID =
10000
      (D1:$0de9eaa7;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
10008
      (D1:$0de9eaa7;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
10001
  CLSID_CDirect3DRMTextureInterpolator: TGUID =
10009
  CLSID_CDirect3DRMTextureInterpolator: TGUID =
10002
      (D1:$0de9eaa8;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
10010
      (D1:$0de9eaa8;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
10003
  CLSID_CDirect3DRMProgressiveMesh: TGUID =
10011
  CLSID_CDirect3DRMProgressiveMesh: TGUID =
10004
      (D1:$4516ec40;D2:$8f20;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
10012
      (D1:$4516ec40;D2:$8f20;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
10005
  CLSID_CDirect3DRMClippedVisual: TGUID =
10013
  CLSID_CDirect3DRMClippedVisual: TGUID =
10006
      (D1:$5434e72d;D2:$6d66;D3:$11d1;D4:($bb,$0b,$00,$00,$f8,$75,$86,$5a));
10014
      (D1:$5434e72d;D2:$6d66;D3:$11d1;D4:($bb,$0b,$00,$00,$f8,$75,$86,$5a));
10007
 
10015
 
10008
 
10016
 
10009
 
10017
 
10010
type
10018
type
10011
  IDirect3DRMObject = interface;
10019
  IDirect3DRMObject = interface;
10012
  IDirect3DRMDevice = interface;
10020
  IDirect3DRMDevice = interface;
10013
  IDirect3DRMDevice2 = interface;
10021
  IDirect3DRMDevice2 = interface;
10014
  IDirect3DRMDevice3 = interface;
10022
  IDirect3DRMDevice3 = interface;
10015
  IDirect3DRMViewport = interface;
10023
  IDirect3DRMViewport = interface;
10016
  IDirect3DRMViewport2 = interface;
10024
  IDirect3DRMViewport2 = interface;
10017
  IDirect3DRMFrame = interface;
10025
  IDirect3DRMFrame = interface;
10018
  IDirect3DRMFrame2 = interface;
10026
  IDirect3DRMFrame2 = interface;
10019
  IDirect3DRMFrame3 = interface;
10027
  IDirect3DRMFrame3 = interface;
10020
  IDirect3DRMVisual = interface;
10028
  IDirect3DRMVisual = interface;
10021
  IDirect3DRMMesh = interface;
10029
  IDirect3DRMMesh = interface;
10022
  IDirect3DRMMeshBuilder = interface;
10030
  IDirect3DRMMeshBuilder = interface;
10023
  IDirect3DRMMeshBuilder2 = interface;
10031
  IDirect3DRMMeshBuilder2 = interface;
10024
  IDirect3DRMMeshBuilder3 = interface;
10032
  IDirect3DRMMeshBuilder3 = interface;
10025
  IDirect3DRMFace = interface;
10033
  IDirect3DRMFace = interface;
10026
  IDirect3DRMFace2 = interface;
10034
  IDirect3DRMFace2 = interface;
10027
  IDirect3DRMLight = interface;
10035
  IDirect3DRMLight = interface;
10028
  IDirect3DRMTexture = interface;
10036
  IDirect3DRMTexture = interface;
10029
  IDirect3DRMTexture2 = interface;
10037
  IDirect3DRMTexture2 = interface;
10030
  IDirect3DRMTexture3 = interface;
10038
  IDirect3DRMTexture3 = interface;
10031
  IDirect3DRMWrap = interface;
10039
  IDirect3DRMWrap = interface;
10032
  IDirect3DRMMaterial = interface;
10040
  IDirect3DRMMaterial = interface;
10033
  IDirect3DRMMaterial2 = interface;
10041
  IDirect3DRMMaterial2 = interface;
10034
  IDirect3DRMAnimation = interface;
10042
  IDirect3DRMAnimation = interface;
10035
  IDirect3DRMAnimation2 = interface;
10043
  IDirect3DRMAnimation2 = interface;
10036
  IDirect3DRMAnimationSet = interface;
10044
  IDirect3DRMAnimationSet = interface;
10037
  IDirect3DRMAnimationSet2 = interface;
10045
  IDirect3DRMAnimationSet2 = interface;
10038
  IDirect3DRMArray = interface;
10046
  IDirect3DRMArray = interface;
10039
  IDirect3DRMObjectArray = interface;
10047
  IDirect3DRMObjectArray = interface;
10040
  IDirect3DRMDeviceArray = interface;
10048
  IDirect3DRMDeviceArray = interface;
10041
  IDirect3DRMViewportArray = interface;
10049
  IDirect3DRMViewportArray = interface;
10042
  IDirect3DRMFrameArray = interface;
10050
  IDirect3DRMFrameArray = interface;
10043
  IDirect3DRMVisualArray = interface;
10051
  IDirect3DRMVisualArray = interface;
10044
  IDirect3DRMLightArray = interface;
10052
  IDirect3DRMLightArray = interface;
10045
  IDirect3DRMPickedArray = interface;
10053
  IDirect3DRMPickedArray = interface;
10046
  IDirect3DRMFaceArray = interface;
10054
  IDirect3DRMFaceArray = interface;
10047
  IDirect3DRMAnimationArray = interface;
10055
  IDirect3DRMAnimationArray = interface;
10048
  IDirect3DRMUserVisual = interface;
10056
  IDirect3DRMUserVisual = interface;
10049
  IDirect3DRMShadow = interface;
10057
  IDirect3DRMShadow = interface;
10050
  IDirect3DRMShadow2 = interface;
10058
  IDirect3DRMShadow2 = interface;
10051
  IDirect3DRMInterpolator = interface;
10059
  IDirect3DRMInterpolator = interface;
10052
  IDirect3DRMProgressiveMesh = interface;
10060
  IDirect3DRMProgressiveMesh = interface;
10053
  IDirect3DRMPicked2Array = interface;
10061
  IDirect3DRMPicked2Array = interface;
10054
  IDirect3DRMClippedVisual = interface;
10062
  IDirect3DRMClippedVisual = interface;
10055
 
10063
 
10056
(*
10064
(*
10057
 * Direct3DRM Object interfaces
10065
 * Direct3DRM Object interfaces
10058
 *)
10066
 *)
10059
  IID_IDirect3DRMObject =          IDirect3DRMObject;
10067
  IID_IDirect3DRMObject =          IDirect3DRMObject;
10060
  IID_IDirect3DRMDevice =          IDirect3DRMDevice;
10068
  IID_IDirect3DRMDevice =          IDirect3DRMDevice;
10061
  IID_IDirect3DRMDevice2 =         IDirect3DRMDevice2;
10069
  IID_IDirect3DRMDevice2 =         IDirect3DRMDevice2;
10062
  IID_IDirect3DRMDevice3 =         IDirect3DRMDevice3;
10070
  IID_IDirect3DRMDevice3 =         IDirect3DRMDevice3;
10063
  IID_IDirect3DRMViewport =        IDirect3DRMViewport;
10071
  IID_IDirect3DRMViewport =        IDirect3DRMViewport;
10064
  IID_IDirect3DRMViewport2 =       IDirect3DRMViewport2;
10072
  IID_IDirect3DRMViewport2 =       IDirect3DRMViewport2;
10065
  IID_IDirect3DRMFrame =           IDirect3DRMFrame;
10073
  IID_IDirect3DRMFrame =           IDirect3DRMFrame;
10066
  IID_IDirect3DRMFrame2 =          IDirect3DRMFrame2;
10074
  IID_IDirect3DRMFrame2 =          IDirect3DRMFrame2;
10067
  IID_IDirect3DRMFrame3 =          IDirect3DRMFrame3;
10075
  IID_IDirect3DRMFrame3 =          IDirect3DRMFrame3;
10068
  IID_IDirect3DRMVisual =          IDirect3DRMVisual;
10076
  IID_IDirect3DRMVisual =          IDirect3DRMVisual;
10069
  IID_IDirect3DRMMesh =            IDirect3DRMMesh;
10077
  IID_IDirect3DRMMesh =            IDirect3DRMMesh;
10070
  IID_IDirect3DRMMeshBuilder =     IDirect3DRMMeshBuilder;
10078
  IID_IDirect3DRMMeshBuilder =     IDirect3DRMMeshBuilder;
10071
  IID_IDirect3DRMMeshBuilder2 =    IDirect3DRMMeshBuilder2;
10079
  IID_IDirect3DRMMeshBuilder2 =    IDirect3DRMMeshBuilder2;
10072
  IID_IDirect3DRMMeshBuilder3 =    IDirect3DRMMeshBuilder3;
10080
  IID_IDirect3DRMMeshBuilder3 =    IDirect3DRMMeshBuilder3;
10073
  IID_IDirect3DRMFace =            IDirect3DRMFace;
10081
  IID_IDirect3DRMFace =            IDirect3DRMFace;
10074
  IID_IDirect3DRMFace2 =           IDirect3DRMFace2;
10082
  IID_IDirect3DRMFace2 =           IDirect3DRMFace2;
10075
  IID_IDirect3DRMLight =           IDirect3DRMLight;
10083
  IID_IDirect3DRMLight =           IDirect3DRMLight;
10076
  IID_IDirect3DRMTexture =         IDirect3DRMTexture;
10084
  IID_IDirect3DRMTexture =         IDirect3DRMTexture;
10077
  IID_IDirect3DRMTexture2 =        IDirect3DRMTexture2;
10085
  IID_IDirect3DRMTexture2 =        IDirect3DRMTexture2;
10078
  IID_IDirect3DRMTexture3 =        IDirect3DRMTexture3;
10086
  IID_IDirect3DRMTexture3 =        IDirect3DRMTexture3;
10079
  IID_IDirect3DRMWrap =            IDirect3DRMWrap;
10087
  IID_IDirect3DRMWrap =            IDirect3DRMWrap;
10080
  IID_IDirect3DRMMaterial =        IDirect3DRMMaterial;
10088
  IID_IDirect3DRMMaterial =        IDirect3DRMMaterial;
10081
  IID_IDirect3DRMMaterial2 =       IDirect3DRMMaterial2;
10089
  IID_IDirect3DRMMaterial2 =       IDirect3DRMMaterial2;
10082
  IID_IDirect3DRMAnimation =       IDirect3DRMAnimation;
10090
  IID_IDirect3DRMAnimation =       IDirect3DRMAnimation;
10083
  IID_IDirect3DRMAnimation2 =      IDirect3DRMAnimation2;
10091
  IID_IDirect3DRMAnimation2 =      IDirect3DRMAnimation2;
10084
  IID_IDirect3DRMAnimationSet =    IDirect3DRMAnimationSet;
10092
  IID_IDirect3DRMAnimationSet =    IDirect3DRMAnimationSet;
10085
  IID_IDirect3DRMAnimationSet2 =   IDirect3DRMAnimationSet2;
10093
  IID_IDirect3DRMAnimationSet2 =   IDirect3DRMAnimationSet2;
10086
  IID_IDirect3DRMObjectArray =     IDirect3DRMObjectArray;
10094
  IID_IDirect3DRMObjectArray =     IDirect3DRMObjectArray;
10087
  IID_IDirect3DRMDeviceArray =     IDirect3DRMDeviceArray;
10095
  IID_IDirect3DRMDeviceArray =     IDirect3DRMDeviceArray;
10088
  IID_IDirect3DRMViewportArray =   IDirect3DRMViewportArray;
10096
  IID_IDirect3DRMViewportArray =   IDirect3DRMViewportArray;
10089
  IID_IDirect3DRMFrameArray =      IDirect3DRMFrameArray;
10097
  IID_IDirect3DRMFrameArray =      IDirect3DRMFrameArray;
10090
  IID_IDirect3DRMVisualArray =     IDirect3DRMVisualArray;
10098
  IID_IDirect3DRMVisualArray =     IDirect3DRMVisualArray;
10091
  IID_IDirect3DRMLightArray =      IDirect3DRMLightArray;
10099
  IID_IDirect3DRMLightArray =      IDirect3DRMLightArray;
10092
  IID_IDirect3DRMPickedArray =     IDirect3DRMPickedArray;
10100
  IID_IDirect3DRMPickedArray =     IDirect3DRMPickedArray;
10093
  IID_IDirect3DRMFaceArray =       IDirect3DRMFaceArray;
10101
  IID_IDirect3DRMFaceArray =       IDirect3DRMFaceArray;
10094
  IID_IDirect3DRMAnimationArray =  IDirect3DRMAnimationArray;
10102
  IID_IDirect3DRMAnimationArray =  IDirect3DRMAnimationArray;
10095
  IID_IDirect3DRMUserVisual =      IDirect3DRMUserVisual;
10103
  IID_IDirect3DRMUserVisual =      IDirect3DRMUserVisual;
10096
  IID_IDirect3DRMShadow =          IDirect3DRMShadow;
10104
  IID_IDirect3DRMShadow =          IDirect3DRMShadow;
10097
  IID_IDirect3DRMShadow2 =         IDirect3DRMShadow2;
10105
  IID_IDirect3DRMShadow2 =         IDirect3DRMShadow2;
10098
  IID_IDirect3DRMInterpolator =    IDirect3DRMInterpolator;
10106
  IID_IDirect3DRMInterpolator =    IDirect3DRMInterpolator;
10099
  IID_IDirect3DRMProgressiveMesh = IDirect3DRMProgressiveMesh;
10107
  IID_IDirect3DRMProgressiveMesh = IDirect3DRMProgressiveMesh;
10100
  IID_IDirect3DRMPicked2Array =    IDirect3DRMPicked2Array;
10108
  IID_IDirect3DRMPicked2Array =    IDirect3DRMPicked2Array;
10101
  IID_IDirect3DRMClippedVisual =   IDirect3DRMClippedVisual;
10109
  IID_IDirect3DRMClippedVisual =   IDirect3DRMClippedVisual;
10102
 
10110
 
10103
 
10111
 
10104
 
10112
 
10105
 
10113
 
10106
 
10114
 
10107
  PIDirect3DRMFaceArray = ^IDirect3DRMFaceArray;
10115
  PIDirect3DRMFaceArray = ^IDirect3DRMFaceArray;
10108
 
10116
 
10109
  TD3DRMObjectCallback = procedure (lpD3DRMobj: IDirect3DRMObject;
10117
  TD3DRMObjectCallback = procedure (lpD3DRMobj: IDirect3DRMObject;
10110
      lpArg: Pointer); cdecl;
10118
      lpArg: Pointer); cdecl;
10111
  TD3DRMFrameMoveCallback = procedure (lpD3DRMFrame: IDirect3DRMFrame;
10119
  TD3DRMFrameMoveCallback = procedure (lpD3DRMFrame: IDirect3DRMFrame;
10112
      lpArg: Pointer; delta: TD3DValue); cdecl;
10120
      lpArg: Pointer; delta: TD3DValue); cdecl;
10113
  TD3DRMFrame3MoveCallback = procedure (lpD3DRMFrame: IDirect3DRMFrame3;
10121
  TD3DRMFrame3MoveCallback = procedure (lpD3DRMFrame: IDirect3DRMFrame3;
10114
      lpArg: Pointer; delta: TD3DValue); cdecl;
10122
      lpArg: Pointer; delta: TD3DValue); cdecl;
10115
  TD3DRMUpdateCallback = procedure (lpobj: IDirect3DRMDevice; lpArg: Pointer;
10123
  TD3DRMUpdateCallback = procedure (lpobj: IDirect3DRMDevice; lpArg: Pointer;
10116
      iRectCount: Integer; const d3dRectUpdate: TD3DRect); cdecl;
10124
      iRectCount: Integer; const d3dRectUpdate: TD3DRect); cdecl;
10117
  TD3DRMDevice3UpdateCallback = procedure (lpobj: IDirect3DRMDevice3;
10125
  TD3DRMDevice3UpdateCallback = procedure (lpobj: IDirect3DRMDevice3;
10118
      lpArg: Pointer; iRectCount: Integer; const d3dRectUpdate: TD3DRect);cdecl;
10126
      lpArg: Pointer; iRectCount: Integer; const d3dRectUpdate: TD3DRect);cdecl;
10119
  TD3DRMUserVisualCallback = function (lpD3DRMUV: IDirect3DRMUserVisual;
10127
  TD3DRMUserVisualCallback = function (lpD3DRMUV: IDirect3DRMUserVisual;
10120
      lpArg: Pointer; lpD3DRMUVreason: TD3DRMUserVisualReason;
10128
      lpArg: Pointer; lpD3DRMUVreason: TD3DRMUserVisualReason;
10121
      lpD3DRMDev: IDirect3DRMDevice;
10129
      lpD3DRMDev: IDirect3DRMDevice;
10122
      lpD3DRMview: IDirect3DRMViewport) : Integer; cdecl;
10130
      lpD3DRMview: IDirect3DRMViewport) : Integer; cdecl;
10123
  TD3DRMLoadTextureCallback = function (tex_name: PAnsiChar; lpArg: Pointer;
10131
  TD3DRMLoadTextureCallback = function (tex_name: PAnsiChar; lpArg: Pointer;
10124
      out lpD3DRMTex: IDirect3DRMTexture) : HResult; cdecl;
10132
      out lpD3DRMTex: IDirect3DRMTexture) : HResult; cdecl;
10125
  TD3DRMLoadTexture3Callback = function (tex_name: PAnsiChar; lpArg: Pointer;
10133
  TD3DRMLoadTexture3Callback = function (tex_name: PAnsiChar; lpArg: Pointer;
10126
      out lpD3DRMTex: IDirect3DRMTexture3) : HResult; cdecl;
10134
      out lpD3DRMTex: IDirect3DRMTexture3) : HResult; cdecl;
10127
  TD3DRMLoadCallback = procedure (lpObject: IDirect3DRMObject;
10135
  TD3DRMLoadCallback = procedure (lpObject: IDirect3DRMObject;
10128
      const ObjectGuid: TGUID; lpArg: Pointer); cdecl;
10136
      const ObjectGuid: TGUID; lpArg: Pointer); cdecl;
10129
  TD3DRMDownSampleCallback = function (lpDirect3DRMTexture: IDirect3DRMTexture3;
10137
  TD3DRMDownSampleCallback = function (lpDirect3DRMTexture: IDirect3DRMTexture3;
10130
      pArg: pointer; pDDSSrc, pDDSDst: IDirectDrawSurface) : HResult; cdecl;
10138
      pArg: pointer; pDDSSrc, pDDSDst: IDirectDrawSurface) : HResult; cdecl;
10131
  TD3DRMValidationCallback = function (lpDirect3DRMTexture: IDirect3DRMTexture3;
10139
  TD3DRMValidationCallback = function (lpDirect3DRMTexture: IDirect3DRMTexture3;
10132
      pArg: pointer; dwFlags, DWcRects: DWORD; const pRects: TRect) : HResult; cdecl;
10140
      pArg: pointer; dwFlags, DWcRects: DWORD; const pRects: TRect) : HResult; cdecl;
10133
 
10141
 
10134
  PD3DRMPickDesc = ^TD3DRMPickDesc;
10142
  PD3DRMPickDesc = ^TD3DRMPickDesc;
10135
  TD3DRMPickDesc = packed record
10143
  TD3DRMPickDesc = packed record
10136
    ulFaceIdx: DWORD;
10144
    ulFaceIdx: DWORD;
10137
    lGroupIdx: LongInt;
10145
    lGroupIdx: LongInt;
10138
    vPosition: TD3DVector;
10146
    vPosition: TD3DVector;
10139
  end;
10147
  end;
10140
 
10148
 
10141
  PD3DRMPickDesc2 = ^TD3DRMPickDesc2;
10149
  PD3DRMPickDesc2 = ^TD3DRMPickDesc2;
10142
  TD3DRMPickDesc2 = packed record
10150
  TD3DRMPickDesc2 = packed record
10143
    ulFaceIdx: DWORD;
10151
    ulFaceIdx: DWORD;
10144
    lGroupIdx: LongInt;
10152
    lGroupIdx: LongInt;
10145
    dvPosition: TD3DVector;
10153
    dvPosition: TD3DVector;
10146
    tu, tv: TD3DValue;
10154
    tu, tv: TD3DValue;
10147
    dvNormal: TD3DVector;
10155
    dvNormal: TD3DVector;
10148
    dcColor: TD3DColor;
10156
    dcColor: TD3DColor;
10149
  end;
10157
  end;
10150
 
10158
 
10151
(*
10159
(*
10152
 * Base class
10160
 * Base class
10153
 *)
10161
 *)
10154
{$IFDEF D2COM}
10162
{$IFDEF D2COM}
10155
  IDirect3DRMObject = class (IUnknown)
10163
  IDirect3DRMObject = class (IUnknown)
10156
{$ELSE}
10164
{$ELSE}
10157
  IDirect3DRMObject = interface (IUnknown)
10165
  IDirect3DRMObject = interface (IUnknown)
10158
    ['{eb16cb00-d271-11ce-ac48-0000c03825a1}']
10166
    ['{eb16cb00-d271-11ce-ac48-0000c03825a1}']
10159
{$ENDIF}
10167
{$ENDIF}
10160
    (*
10168
    (*
10161
     * The methods for IDirect3DRMObject
10169
     * The methods for IDirect3DRMObject
10162
     *)
10170
     *)
10163
    function Clone (pUnkOuter: IUnknown; riid: TGUID;
10171
    function Clone (pUnkOuter: IUnknown; riid: TGUID;
10164
        var ppvObj: Pointer) : HResult; stdcall;
10172
        var ppvObj: Pointer) : HResult; stdcall;
10165
    function AddDestroyCallback (lpCallback: TD3DRMObjectCallback;
10173
    function AddDestroyCallback (lpCallback: TD3DRMObjectCallback;
10166
        lpArg: Pointer) : HResult; stdcall;
10174
        lpArg: Pointer) : HResult; stdcall;
10167
    function DeleteDestroyCallback (d3drmObjProc: TD3DRMObjectCallback;
10175
    function DeleteDestroyCallback (d3drmObjProc: TD3DRMObjectCallback;
10168
        lpArg: Pointer) : HResult; stdcall;
10176
        lpArg: Pointer) : HResult; stdcall;
10169
    function SetAppData (ulData: DWORD) : HResult; stdcall;
10177
    function SetAppData (ulData: DWORD) : HResult; stdcall;
10170
    function GetAppData: DWORD; stdcall;
10178
    function GetAppData: DWORD; stdcall;
10171
    function SetName (lpName: PAnsiChar) : HResult; stdcall;
10179
    function SetName (lpName: PAnsiChar) : HResult; stdcall;
10172
    function GetName (var lpdwSize: DWORD; lpName: PAnsiChar) : HResult; stdcall;
10180
    function GetName (var lpdwSize: DWORD; lpName: PAnsiChar) : HResult; stdcall;
10173
    function GetClassName (var lpdwSize: DWORD; lpName: PAnsiChar) : HResult; stdcall;
10181
    function GetClassName (var lpdwSize: DWORD; lpName: PAnsiChar) : HResult; stdcall;
10174
  end;
10182
  end;
10175
 
10183
 
10176
  IDirect3DRMVisual = interface (IDirect3DRMObject)
10184
  IDirect3DRMVisual = interface (IDirect3DRMObject)
10177
  end;
10185
  end;
10178
 
10186
 
10179
  IDirect3DRMDevice = interface (IDirect3DRMObject)
10187
  IDirect3DRMDevice = interface (IDirect3DRMObject)
10180
    ['{e9e19280-6e05-11cf-ac4a-0000c03825a1}']
10188
    ['{e9e19280-6e05-11cf-ac4a-0000c03825a1}']
10181
    (*
10189
    (*
10182
     * IDirect3DRMDevice methods
10190
     * IDirect3DRMDevice methods
10183
     *)
10191
     *)
10184
    function Init (width: LongInt; height: LongInt) : HResult; stdcall;
10192
    function Init (width: LongInt; height: LongInt) : HResult; stdcall;
10185
    function InitFromD3D (lpD3D: IDirect3D; lpD3DIMDev: IDirect3DDevice) : HResult; stdcall;
10193
    function InitFromD3D (lpD3D: IDirect3D; lpD3DIMDev: IDirect3DDevice) : HResult; stdcall;
10186
    function InitFromClipper (lpDDClipper: IDirectDrawClipper; lpGUID: PGUID;
10194
    function InitFromClipper (lpDDClipper: IDirectDrawClipper; lpGUID: PGUID;
10187
        width: Integer; height: Integer) : HResult; stdcall;
10195
        width: Integer; height: Integer) : HResult; stdcall;
10188
    function Update: HResult; stdcall;
10196
    function Update: HResult; stdcall;
10189
    function AddUpdateCallback (d3drmUpdateProc: TD3DRMUpdateCallback;
10197
    function AddUpdateCallback (d3drmUpdateProc: TD3DRMUpdateCallback;
10190
        arg: Pointer) : HResult; stdcall;
10198
        arg: Pointer) : HResult; stdcall;
10191
    function DeleteUpdateCallback (d3drmUpdateProc: TD3DRMUpdateCallback;
10199
    function DeleteUpdateCallback (d3drmUpdateProc: TD3DRMUpdateCallback;
10192
        arg: Pointer) : HResult; stdcall;
10200
        arg: Pointer) : HResult; stdcall;
10193
    function SetBufferCount (dwCount: DWORD) : HResult; stdcall;
10201
    function SetBufferCount (dwCount: DWORD) : HResult; stdcall;
10194
    function GetBufferCount: DWORD; stdcall;
10202
    function GetBufferCount: DWORD; stdcall;
10195
    function SetDither (bDither: BOOL) : HResult; stdcall;
10203
    function SetDither (bDither: BOOL) : HResult; stdcall;
10196
    function SetShades (ulShades: DWORD) : HResult; stdcall;
10204
    function SetShades (ulShades: DWORD) : HResult; stdcall;
10197
    function SetQuality (rqQuality: TD3DRMRenderQuality) : HResult; stdcall;
10205
    function SetQuality (rqQuality: TD3DRMRenderQuality) : HResult; stdcall;
10198
    function SetTextureQuality (tqTextureQuality: TD3DRMTextureQuality) : HResult; stdcall;
10206
    function SetTextureQuality (tqTextureQuality: TD3DRMTextureQuality) : HResult; stdcall;
10199
    function GetViewports (out lplpViewports: IDirect3DRMViewportArray) : HResult; stdcall;
10207
    function GetViewports (out lplpViewports: IDirect3DRMViewportArray) : HResult; stdcall;
10200
    function GetDither: BOOL; stdcall;
10208
    function GetDither: BOOL; stdcall;
10201
    function GetShades: DWORD; stdcall;
10209
    function GetShades: DWORD; stdcall;
10202
    function GetHeight: DWORD; stdcall;
10210
    function GetHeight: DWORD; stdcall;
10203
    function GetWidth: DWORD; stdcall;
10211
    function GetWidth: DWORD; stdcall;
10204
    function GetTrianglesDrawn: DWORD; stdcall;
10212
    function GetTrianglesDrawn: DWORD; stdcall;
10205
    function GetWireframeOptions: DWORD; stdcall;
10213
    function GetWireframeOptions: DWORD; stdcall;
10206
    function GetQuality: TD3DRMRenderQuality; stdcall;
10214
    function GetQuality: TD3DRMRenderQuality; stdcall;
10207
    function GetColorModel: TD3DColorModel; stdcall;
10215
    function GetColorModel: TD3DColorModel; stdcall;
10208
    function GetTextureQuality: TD3DRMTextureQuality; stdcall;
10216
    function GetTextureQuality: TD3DRMTextureQuality; stdcall;
10209
    function GetDirect3DDevice (out lplpD3DDevice: IDirect3DDevice) : HResult; stdcall;
10217
    function GetDirect3DDevice (out lplpD3DDevice: IDirect3DDevice) : HResult; stdcall;
10210
  end;
10218
  end;
10211
 
10219
 
10212
  IDirect3DRMDevice2 = interface (IDirect3DRMDevice)
10220
  IDirect3DRMDevice2 = interface (IDirect3DRMDevice)
10213
    ['{4516ec78-8f20-11d0-9b6d-0000c0781bc3}']
10221
    ['{4516ec78-8f20-11d0-9b6d-0000c0781bc3}']
10214
    (*
10222
    (*
10215
     * IDirect3DRMDevice2 methods
10223
     * IDirect3DRMDevice2 methods
10216
     *)
10224
     *)
10217
    function InitFromD3D2(lpD3D: IDirect3D2; lpD3DIMDev: IDirect3DDevice2) : HResult; stdcall;
10225
    function InitFromD3D2(lpD3D: IDirect3D2; lpD3DIMDev: IDirect3DDevice2) : HResult; stdcall;
10218
    function InitFromSurface(const lpGUID: TGUID; lpDD: IDirectDraw; lpDDSBack: IDirectDrawSurface) : HResult; stdcall;
10226
    function InitFromSurface(const lpGUID: TGUID; lpDD: IDirectDraw; lpDDSBack: IDirectDrawSurface) : HResult; stdcall;
10219
    function SetRenderMode(dwFlags: DWORD ) : HResult; stdcall;
10227
    function SetRenderMode(dwFlags: DWORD ) : HResult; stdcall;
10220
    function GetRenderMode : DWORD; stdcall;
10228
    function GetRenderMode : DWORD; stdcall;
10221
    function GetDirect3DDevice2(out lplpD3DDevice: IDirect3DDevice2) : HResult; stdcall;
10229
    function GetDirect3DDevice2(out lplpD3DDevice: IDirect3DDevice2) : HResult; stdcall;
10222
  end;
10230
  end;
10223
 
10231
 
10224
  IDirect3DRMDevice3 = interface (IDirect3DRMObject)
10232
  IDirect3DRMDevice3 = interface (IDirect3DRMObject)
10225
    ['{549f498b-bfeb-11d1-8ed8-00a0c967a482}']
10233
    ['{549f498b-bfeb-11d1-8ed8-00a0c967a482}']
10226
    (*
10234
    (*
10227
     * IDirect3DRMDevice methods
10235
     * IDirect3DRMDevice methods
10228
     *)
10236
     *)
10229
    function Init (width: LongInt; height: LongInt) : HResult; stdcall;
10237
    function Init (width: LongInt; height: LongInt) : HResult; stdcall;
10230
    function InitFromD3D (lpD3D: IDirect3D2; lpD3DIMDev: IDirect3DDevice2) : HResult; stdcall;
10238
    function InitFromD3D (lpD3D: IDirect3D2; lpD3DIMDev: IDirect3DDevice2) : HResult; stdcall;
10231
    function InitFromClipper (lpDDClipper: IDirectDrawClipper; lpGUID: PGUID;
10239
    function InitFromClipper (lpDDClipper: IDirectDrawClipper; lpGUID: PGUID;
10232
        width: Integer; height: Integer) : HResult; stdcall;
10240
        width: Integer; height: Integer) : HResult; stdcall;
10233
    function Update: HResult; stdcall;
10241
    function Update: HResult; stdcall;
10234
    function AddUpdateCallback (d3drmUpdateProc: TD3DRMDevice3UpdateCallback;
10242
    function AddUpdateCallback (d3drmUpdateProc: TD3DRMDevice3UpdateCallback;
10235
        arg: Pointer) : HResult; stdcall;
10243
        arg: Pointer) : HResult; stdcall;
10236
    function DeleteUpdateCallback (d3drmUpdateProc: TD3DRMDevice3UpdateCallback;
10244
    function DeleteUpdateCallback (d3drmUpdateProc: TD3DRMDevice3UpdateCallback;
10237
        arg: Pointer) : HResult; stdcall;
10245
        arg: Pointer) : HResult; stdcall;
10238
    function SetBufferCount (dwCount: DWORD) : HResult; stdcall;
10246
    function SetBufferCount (dwCount: DWORD) : HResult; stdcall;
10239
    function GetBufferCount: DWORD; stdcall;
10247
    function GetBufferCount: DWORD; stdcall;
10240
    function SetDither (bDither: BOOL) : HResult; stdcall;
10248
    function SetDither (bDither: BOOL) : HResult; stdcall;
10241
    function SetShades (ulShades: DWORD) : HResult; stdcall;
10249
    function SetShades (ulShades: DWORD) : HResult; stdcall;
10242
    function SetQuality (rqQuality: TD3DRMRenderQuality) : HResult; stdcall;
10250
    function SetQuality (rqQuality: TD3DRMRenderQuality) : HResult; stdcall;
10243
    function SetTextureQuality (tqTextureQuality: TD3DRMTextureQuality) : HResult; stdcall;
10251
    function SetTextureQuality (tqTextureQuality: TD3DRMTextureQuality) : HResult; stdcall;
10244
    function GetViewports (out lplpViewports: IDirect3DRMViewportArray) : HResult; stdcall;
10252
    function GetViewports (out lplpViewports: IDirect3DRMViewportArray) : HResult; stdcall;
10245
    function GetDither: BOOL; stdcall;
10253
    function GetDither: BOOL; stdcall;
10246
    function GetShades: DWORD; stdcall;
10254
    function GetShades: DWORD; stdcall;
10247
    function GetHeight: DWORD; stdcall;
10255
    function GetHeight: DWORD; stdcall;
10248
    function GetWidth: DWORD; stdcall;
10256
    function GetWidth: DWORD; stdcall;
10249
    function GetTrianglesDrawn: DWORD; stdcall;
10257
    function GetTrianglesDrawn: DWORD; stdcall;
10250
    function GetWireframeOptions: DWORD; stdcall;
10258
    function GetWireframeOptions: DWORD; stdcall;
10251
    function GetQuality: TD3DRMRenderQuality; stdcall;
10259
    function GetQuality: TD3DRMRenderQuality; stdcall;
10252
    function GetColorModel: TD3DColorModel; stdcall;
10260
    function GetColorModel: TD3DColorModel; stdcall;
10253
    function GetTextureQuality: TD3DRMTextureQuality; stdcall;
10261
    function GetTextureQuality: TD3DRMTextureQuality; stdcall;
10254
    function GetDirect3DDevice (out lplpD3DDevice: IDirect3DDevice) : HResult; stdcall;
10262
    function GetDirect3DDevice (out lplpD3DDevice: IDirect3DDevice) : HResult; stdcall;
10255
    (*
10263
    (*
10256
     * IDirect3DRMDevice2 methods
10264
     * IDirect3DRMDevice2 methods
10257
     *)
10265
     *)
10258
    function InitFromD3D2(lpD3D: IDirect3D2; lpD3DIMDev: IDirect3DDevice2) : HResult; stdcall;
10266
    function InitFromD3D2(lpD3D: IDirect3D2; lpD3DIMDev: IDirect3DDevice2) : HResult; stdcall;
10259
    function InitFromSurface(const lpGUID: TGUID; lpDD: IDirectDraw;
10267
    function InitFromSurface(const lpGUID: TGUID; lpDD: IDirectDraw;
10260
            lpDDSBack: IDirectDrawSurface) : HResult; stdcall;
10268
            lpDDSBack: IDirectDrawSurface) : HResult; stdcall;
10261
    function SetRenderMode(dwFlags: DWORD ) : HResult; stdcall;
10269
    function SetRenderMode(dwFlags: DWORD ) : HResult; stdcall;
10262
    function GetRenderMode : DWORD; stdcall;
10270
    function GetRenderMode : DWORD; stdcall;
10263
    function GetDirect3DDevice2(out lplpD3DDevice: IDirect3DDevice2) : HResult; stdcall;
10271
    function GetDirect3DDevice2(out lplpD3DDevice: IDirect3DDevice2) : HResult; stdcall;
10264
    (*
10272
    (*
10265
     * IDirect3DRMDevice3 methods
10273
     * IDirect3DRMDevice3 methods
10266
     *)
10274
     *)
10267
    function FindPreferredTextureFormat (dwBitDepths, dwFlags: DWORD;
10275
    function FindPreferredTextureFormat (dwBitDepths, dwFlags: DWORD;
10268
        out lpDDPF: TDDPixelFormat) : HResult; stdcall;
10276
        out lpDDPF: TDDPixelFormat) : HResult; stdcall;
10269
    function RenderStateChange (dwStateNum, dwVal, dwFlags: DWORD) : HResult; stdcall;
10277
    function RenderStateChange (dwStateNum, dwVal, dwFlags: DWORD) : HResult; stdcall;
10270
 
10278
 
10271
    function LightStateChange (drsType: TD3DLightStateType; // defined different in header and help
10279
    function LightStateChange (drsType: TD3DLightStateType; // defined different in header and help
10272
        dwVal, dwFlags: DWORD) : HResult; stdcall;
10280
        dwVal, dwFlags: DWORD) : HResult; stdcall;
10273
    function GetStateChangeOptions (dwStateClass, dwStateNum: DWORD;
10281
    function GetStateChangeOptions (dwStateClass, dwStateNum: DWORD;
10274
        var pdwFlags: DWORD) : HResult; stdcall;
10282
        var pdwFlags: DWORD) : HResult; stdcall;
10275
    function SetStateChangeOptions ( dwStateClass, dwStateNum, dwFlags: DWORD) : HResult; stdcall;
10283
    function SetStateChangeOptions ( dwStateClass, dwStateNum, dwFlags: DWORD) : HResult; stdcall;
10276
  end;
10284
  end;
10277
 
10285
 
10278
  IDirect3DRMViewport = interface (IDirect3DRMObject)
10286
  IDirect3DRMViewport = interface (IDirect3DRMObject)
10279
    ['{eb16cb02-d271-11ce-ac48-0000c03825a1}']
10287
    ['{eb16cb02-d271-11ce-ac48-0000c03825a1}']
10280
    (*
10288
    (*
10281
     * IDirect3DRMViewport methods
10289
     * IDirect3DRMViewport methods
10282
     *)
10290
     *)
10283
    function Init (lpD3DRMDevice: IDirect3DRMDevice;
10291
    function Init (lpD3DRMDevice: IDirect3DRMDevice;
10284
        lpD3DRMFrameCamera: IDirect3DRMFrame; xpos, ypos,
10292
        lpD3DRMFrameCamera: IDirect3DRMFrame; xpos, ypos,
10285
        width, height: DWORD) : HResult; stdcall;
10293
        width, height: DWORD) : HResult; stdcall;
10286
    function Clear: HResult; stdcall;
10294
    function Clear: HResult; stdcall;
10287
    function Render (lpD3DRMFrame: IDirect3DRMFrame) : HResult; stdcall;
10295
    function Render (lpD3DRMFrame: IDirect3DRMFrame) : HResult; stdcall;
10288
    function SetFront (rvFront: TD3DValue) : HResult; stdcall;
10296
    function SetFront (rvFront: TD3DValue) : HResult; stdcall;
10289
    function SetBack (rvBack: TD3DValue) : HResult; stdcall;
10297
    function SetBack (rvBack: TD3DValue) : HResult; stdcall;
10290
    function SetField (rvField: TD3DValue) : HResult; stdcall;
10298
    function SetField (rvField: TD3DValue) : HResult; stdcall;
10291
    function SetUniformScaling (bScale: BOOL) : HResult; stdcall;
10299
    function SetUniformScaling (bScale: BOOL) : HResult; stdcall;
10292
    function SetCamera (lpCamera: IDirect3DRMFrame) : HResult; stdcall;
10300
    function SetCamera (lpCamera: IDirect3DRMFrame) : HResult; stdcall;
10293
    function SetProjection (rptType: TD3DRMProjectionType) : HResult; stdcall;
10301
    function SetProjection (rptType: TD3DRMProjectionType) : HResult; stdcall;
10294
    function Transform (out lprvDst: TD3DRMVector4D; const lprvSrc: TD3DVector) : HResult; stdcall;
10302
    function Transform (out lprvDst: TD3DRMVector4D; const lprvSrc: TD3DVector) : HResult; stdcall;
10295
    function InverseTransform (out lprvDst: TD3DVector;
10303
    function InverseTransform (out lprvDst: TD3DVector;
10296
        const lprvSrc: TD3DRMVector4D) : HResult; stdcall;
10304
        const lprvSrc: TD3DRMVector4D) : HResult; stdcall;
10297
    function Configure (lX, lY: LongInt; dwWidth, dwHeight: DWORD) : HResult; stdcall;
10305
    function Configure (lX, lY: LongInt; dwWidth, dwHeight: DWORD) : HResult; stdcall;
10298
    function ForceUpdate (dwX1, dwY1, dwX2, dwY2: DWORD) : HResult; stdcall;
10306
    function ForceUpdate (dwX1, dwY1, dwX2, dwY2: DWORD) : HResult; stdcall;
10299
    function SetPlane (rvLeft, rvRight, rvBottom, rvTop: TD3DValue) : HResult; stdcall;
10307
    function SetPlane (rvLeft, rvRight, rvBottom, rvTop: TD3DValue) : HResult; stdcall;
10300
    function GetCamera (out lpCamera: IDirect3DRMFrame) : HResult; stdcall;
10308
    function GetCamera (out lpCamera: IDirect3DRMFrame) : HResult; stdcall;
10301
    function GetDevice (out lpD3DRMDevice: IDirect3DRMDevice) : HResult; stdcall;
10309
    function GetDevice (out lpD3DRMDevice: IDirect3DRMDevice) : HResult; stdcall;
10302
    function GetPlane (out lpd3dvLeft, lpd3dvRight, lpd3dvBottom, lpd3dvTop:
10310
    function GetPlane (out lpd3dvLeft, lpd3dvRight, lpd3dvBottom, lpd3dvTop:
10303
        TD3DValue) : HResult; stdcall;
10311
        TD3DValue) : HResult; stdcall;
10304
    function Pick (lX, lY: LongInt; var lplpVisuals: IDirect3DRMPickedArray) : HResult; stdcall;
10312
    function Pick (lX, lY: LongInt; var lplpVisuals: IDirect3DRMPickedArray) : HResult; stdcall;
10305
    function GetUniformScaling: BOOL;  stdcall;
10313
    function GetUniformScaling: BOOL;  stdcall;
10306
    function GetX: LongInt; stdcall;
10314
    function GetX: LongInt; stdcall;
10307
    function GetY: LongInt; stdcall;
10315
    function GetY: LongInt; stdcall;
10308
    function GetWidth: DWORD; stdcall;
10316
    function GetWidth: DWORD; stdcall;
10309
    function GetHeight: DWORD; stdcall;
10317
    function GetHeight: DWORD; stdcall;
10310
    function GetField: TD3DValue; stdcall;
10318
    function GetField: TD3DValue; stdcall;
10311
    function GetBack: TD3DValue; stdcall;
10319
    function GetBack: TD3DValue; stdcall;
10312
    function GetFront: TD3DValue; stdcall;
10320
    function GetFront: TD3DValue; stdcall;
10313
    function GetProjection: TD3DRMProjectionType; stdcall;
10321
    function GetProjection: TD3DRMProjectionType; stdcall;
10314
    function GetDirect3DViewport (out lplpD3DViewport: IDirect3DViewport) : HResult; stdcall;
10322
    function GetDirect3DViewport (out lplpD3DViewport: IDirect3DViewport) : HResult; stdcall;
10315
  end;
10323
  end;
10316
 
10324
 
10317
  IDirect3DRMViewport2 = interface (IDirect3DRMObject)
10325
  IDirect3DRMViewport2 = interface (IDirect3DRMObject)
10318
    ['{4a1b1be6-bfed-11d1-8ed8-00a0c967a482}']
10326
    ['{4a1b1be6-bfed-11d1-8ed8-00a0c967a482}']
10319
    (*
10327
    (*
10320
     * IDirect3DRMViewport2 methods
10328
     * IDirect3DRMViewport2 methods
10321
     *)
10329
     *)
10322
    function Init (lpD3DRMDevice: IDirect3DRMDevice3;
10330
    function Init (lpD3DRMDevice: IDirect3DRMDevice3;
10323
        lpD3DRMFrameCamera: IDirect3DRMFrame3; xpos, ypos,
10331
        lpD3DRMFrameCamera: IDirect3DRMFrame3; xpos, ypos,
10324
        width, height: DWORD) : HResult; stdcall;
10332
        width, height: DWORD) : HResult; stdcall;
10325
    function Clear (dwFlags: DWORD): HResult; stdcall;
10333
    function Clear (dwFlags: DWORD): HResult; stdcall;
10326
    function Render (lpD3DRMFrame: IDirect3DRMFrame3) : HResult; stdcall;
10334
    function Render (lpD3DRMFrame: IDirect3DRMFrame3) : HResult; stdcall;
10327
    function SetFront (rvFront: TD3DValue) : HResult; stdcall;
10335
    function SetFront (rvFront: TD3DValue) : HResult; stdcall;
10328
    function SetBack (rvBack: TD3DValue) : HResult; stdcall;
10336
    function SetBack (rvBack: TD3DValue) : HResult; stdcall;
10329
    function SetField (rvField: TD3DValue) : HResult; stdcall;
10337
    function SetField (rvField: TD3DValue) : HResult; stdcall;
10330
    function SetUniformScaling (bScale: BOOL) : HResult; stdcall;
10338
    function SetUniformScaling (bScale: BOOL) : HResult; stdcall;
10331
    function SetCamera (lpCamera: IDirect3DRMFrame3) : HResult; stdcall;
10339
    function SetCamera (lpCamera: IDirect3DRMFrame3) : HResult; stdcall;
10332
    function SetProjection (rptType: TD3DRMProjectionType) : HResult; stdcall;
10340
    function SetProjection (rptType: TD3DRMProjectionType) : HResult; stdcall;
10333
    function Transform (out lprvDst: TD3DRMVector4D; const lprvSrc: TD3DVector) : HResult; stdcall;
10341
    function Transform (out lprvDst: TD3DRMVector4D; const lprvSrc: TD3DVector) : HResult; stdcall;
10334
    function InverseTransform (out lprvDst: TD3DVector;
10342
    function InverseTransform (out lprvDst: TD3DVector;
10335
        const lprvSrc: TD3DRMVector4D) : HResult; stdcall;
10343
        const lprvSrc: TD3DRMVector4D) : HResult; stdcall;
10336
    function Configure (lX, lY: LongInt; dwWidth, dwHeight: DWORD) : HResult; stdcall;
10344
    function Configure (lX, lY: LongInt; dwWidth, dwHeight: DWORD) : HResult; stdcall;
10337
    function ForceUpdate (dwX1, dwY1, dwX2, dwY2: DWORD) : HResult; stdcall;
10345
    function ForceUpdate (dwX1, dwY1, dwX2, dwY2: DWORD) : HResult; stdcall;
10338
    function SetPlane (rvLeft, rvRight, rvBottom, rvTop: TD3DValue) : HResult; stdcall;
10346
    function SetPlane (rvLeft, rvRight, rvBottom, rvTop: TD3DValue) : HResult; stdcall;
10339
    function GetCamera (out lpCamera: IDirect3DRMFrame3) : HResult; stdcall;
10347
    function GetCamera (out lpCamera: IDirect3DRMFrame3) : HResult; stdcall;
10340
    function GetDevice (out lpD3DRMDevice: IDirect3DRMDevice3) : HResult; stdcall;
10348
    function GetDevice (out lpD3DRMDevice: IDirect3DRMDevice3) : HResult; stdcall;
10341
    function GetPlane (out lpd3dvLeft, lpd3dvRight, lpd3dvBottom, lpd3dvTop:
10349
    function GetPlane (out lpd3dvLeft, lpd3dvRight, lpd3dvBottom, lpd3dvTop:
10342
        TD3DValue) : HResult; stdcall;
10350
        TD3DValue) : HResult; stdcall;
10343
    function Pick (lX, lY: LongInt; var lplpVisuals: IDirect3DRMPickedArray) : HResult; stdcall;
10351
    function Pick (lX, lY: LongInt; var lplpVisuals: IDirect3DRMPickedArray) : HResult; stdcall;
10344
    function GetUniformScaling: BOOL; stdcall;
10352
    function GetUniformScaling: BOOL; stdcall;
10345
    function GetX: LongInt; stdcall;
10353
    function GetX: LongInt; stdcall;
10346
    function GetY: LongInt; stdcall;
10354
    function GetY: LongInt; stdcall;
10347
    function GetWidth: DWORD; stdcall;
10355
    function GetWidth: DWORD; stdcall;
10348
    function GetHeight: DWORD; stdcall;
10356
    function GetHeight: DWORD; stdcall;
10349
    function GetField: TD3DValue; stdcall;
10357
    function GetField: TD3DValue; stdcall;
10350
    function GetBack: TD3DValue; stdcall;
10358
    function GetBack: TD3DValue; stdcall;
10351
    function GetFront: TD3DValue; stdcall;
10359
    function GetFront: TD3DValue; stdcall;
10352
    function GetProjection: TD3DRMProjectionType; stdcall;
10360
    function GetProjection: TD3DRMProjectionType; stdcall;
10353
    function GetDirect3DViewport (var lplpD3DViewport: IDirect3DViewport) : HResult; stdcall;
10361
    function GetDirect3DViewport (var lplpD3DViewport: IDirect3DViewport) : HResult; stdcall;
10354
    function TransformVectors (dwNumVectors: DWORD; out lpDstVectors:
10362
    function TransformVectors (dwNumVectors: DWORD; out lpDstVectors:
10355
        TD3DRMVector4D; const lpSrcVectors: TD3DVector) : HResult; stdcall;
10363
        TD3DRMVector4D; const lpSrcVectors: TD3DVector) : HResult; stdcall;
10356
    function InverseTransformVectors (dwNumVectors: DWORD; out lpDstVectors:
10364
    function InverseTransformVectors (dwNumVectors: DWORD; out lpDstVectors:
10357
        TD3DRMVector4D; const lpSrcVectors: TD3DVector) : HResult; stdcall;
10365
        TD3DRMVector4D; const lpSrcVectors: TD3DVector) : HResult; stdcall;
10358
  end;
10366
  end;
10359
 
10367
 
10360
  IDirect3DRMFrame = interface (IDirect3DRMVisual)
10368
  IDirect3DRMFrame = interface (IDirect3DRMVisual)
10361
    ['{eb16cb03-d271-11ce-ac48-0000c03825a1}']
10369
    ['{eb16cb03-d271-11ce-ac48-0000c03825a1}']
10362
    (*
10370
    (*
10363
     * IDirect3DRMFrame methods
10371
     * IDirect3DRMFrame methods
10364
     *)
10372
     *)
10365
    function AddChild (lpD3DRMFrameChild: IDirect3DRMFrame) : HResult; stdcall;
10373
    function AddChild (lpD3DRMFrameChild: IDirect3DRMFrame) : HResult; stdcall;
10366
    function AddLight (lpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
10374
    function AddLight (lpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
10367
    function AddMoveCallback (d3drmFMC: TD3DRMFrameMoveCallback;
10375
    function AddMoveCallback (d3drmFMC: TD3DRMFrameMoveCallback;
10368
        lpArg: Pointer) : HResult; stdcall;
10376
        lpArg: Pointer) : HResult; stdcall;
10369
    function AddTransform (rctCombine: TD3DRMCombineType;
10377
    function AddTransform (rctCombine: TD3DRMCombineType;
10370
        rmMatrix: TD3DRMMatrix4D) : HResult; stdcall;
10378
        rmMatrix: TD3DRMMatrix4D) : HResult; stdcall;
10371
    function AddTranslation (rctCombine: TD3DRMCombineType; rvX, rvY, rvZ:
10379
    function AddTranslation (rctCombine: TD3DRMCombineType; rvX, rvY, rvZ:
10372
        TD3DValue) : HResult; stdcall;
10380
        TD3DValue) : HResult; stdcall;
10373
    function AddScale (rctCombine: TD3DRMCombineType; rvX, rvY, rvZ: TD3DValue) : HResult; stdcall;
10381
    function AddScale (rctCombine: TD3DRMCombineType; rvX, rvY, rvZ: TD3DValue) : HResult; stdcall;
10374
    function AddRotation (rctCombine: TD3DRMCombineType; rvX, rvY, rvZ,
10382
    function AddRotation (rctCombine: TD3DRMCombineType; rvX, rvY, rvZ,
10375
        rvTheta: TD3DValue) : HResult; stdcall;
10383
        rvTheta: TD3DValue) : HResult; stdcall;
10376
    function AddVisual (lpD3DRMVisual: IDirect3DRMVisual) : HResult; stdcall;
10384
    function AddVisual (lpD3DRMVisual: IDirect3DRMVisual) : HResult; stdcall;
10377
    function GetChildren (out lplpChildren: IDirect3DRMFrameArray) : HResult; stdcall;
10385
    function GetChildren (out lplpChildren: IDirect3DRMFrameArray) : HResult; stdcall;
10378
    function GetColor: TD3DColor; stdcall;
10386
    function GetColor: TD3DColor; stdcall;
10379
    function GetLights (out lplpLights: IDirect3DRMLightArray) : HResult; stdcall;
10387
    function GetLights (out lplpLights: IDirect3DRMLightArray) : HResult; stdcall;
10380
    function GetMaterialMode: TD3DRMMaterialMode; stdcall;
10388
    function GetMaterialMode: TD3DRMMaterialMode; stdcall;
10381
    function GetParent (out lplpParent: IDirect3DRMFrame) : HResult; stdcall;
10389
    function GetParent (out lplpParent: IDirect3DRMFrame) : HResult; stdcall;
10382
    function GetPosition (lpRef: IDirect3DRMFrame; out lprvPos: TD3DVector) : HResult; stdcall;
10390
    function GetPosition (lpRef: IDirect3DRMFrame; out lprvPos: TD3DVector) : HResult; stdcall;
10383
    function GetRotation (lpRef: IDirect3DRMFrame; out lprvAxis: TD3DVector;
10391
    function GetRotation (lpRef: IDirect3DRMFrame; out lprvAxis: TD3DVector;
10384
        out lprvTheta: TD3DValue) : HResult; stdcall;
10392
        out lprvTheta: TD3DValue) : HResult; stdcall;
10385
    function GetScene (out lplpRoot: IDirect3DRMFrame) : HResult; stdcall;
10393
    function GetScene (out lplpRoot: IDirect3DRMFrame) : HResult; stdcall;
10386
    function GetSortMode: TD3DRMSortMode; stdcall;
10394
    function GetSortMode: TD3DRMSortMode; stdcall;
10387
    function GetTexture (out lplpTexture: IDirect3DRMTexture) : HResult; stdcall;
10395
    function GetTexture (out lplpTexture: IDirect3DRMTexture) : HResult; stdcall;
10388
    function GetTransform (out rmMatrix: TD3DRMMatrix4D) : HResult; stdcall;
10396
    function GetTransform (out rmMatrix: TD3DRMMatrix4D) : HResult; stdcall;
10389
    function GetVelocity (lpRef: IDirect3DRMFrame; var lprvVel: TD3DVector;
10397
    function GetVelocity (lpRef: IDirect3DRMFrame; var lprvVel: TD3DVector;
10390
        fRotVel: BOOL) : HResult; stdcall;
10398
        fRotVel: BOOL) : HResult; stdcall;
10391
    function GetOrientation (lpRef: IDirect3DRMFrame; var lprvDir: TD3DVector;
10399
    function GetOrientation (lpRef: IDirect3DRMFrame; var lprvDir: TD3DVector;
10392
        var lprvUp: TD3DVector) : HResult; stdcall;
10400
        var lprvUp: TD3DVector) : HResult; stdcall;
10393
    function GetVisuals (out lplpVisuals: IDirect3DRMVisualArray) : HResult; stdcall;
10401
    function GetVisuals (out lplpVisuals: IDirect3DRMVisualArray) : HResult; stdcall;
10394
    function GetTextureTopology (out lpU, lpV: BOOL) : HResult; stdcall;
10402
    function GetTextureTopology (out lpU, lpV: BOOL) : HResult; stdcall;
10395
    function InverseTransform (out lprvDst: TD3DVector; const lprvSrc: TD3DVector) : HResult; stdcall;
10403
    function InverseTransform (out lprvDst: TD3DVector; const lprvSrc: TD3DVector) : HResult; stdcall;
10396
    function Load (lpvObjSource: Pointer; lpvObjID: Pointer;
10404
    function Load (lpvObjSource: Pointer; lpvObjID: Pointer;
10397
        d3drmLOFlags: TD3DRMLoadOptions; d3drmLoadTextureProc:
10405
        d3drmLOFlags: TD3DRMLoadOptions; d3drmLoadTextureProc:
10398
        TD3DRMLoadTextureCallback; lpArgLTP: Pointer) : HResult; stdcall;
10406
        TD3DRMLoadTextureCallback; lpArgLTP: Pointer) : HResult; stdcall;
10399
    function LookAt (lpTarget, lpRef: IDirect3DRMFrame;
10407
    function LookAt (lpTarget, lpRef: IDirect3DRMFrame;
10400
        rfcConstraint: TD3DRMFrameConstraint ) : HResult; stdcall;
10408
        rfcConstraint: TD3DRMFrameConstraint ) : HResult; stdcall;
10401
    function Move (delta: TD3DValue) : HResult; stdcall;
10409
    function Move (delta: TD3DValue) : HResult; stdcall;
10402
    function DeleteChild (lpChild: IDirect3DRMFrame) : HResult; stdcall;
10410
    function DeleteChild (lpChild: IDirect3DRMFrame) : HResult; stdcall;
10403
    function DeleteLight (lpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
10411
    function DeleteLight (lpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
10404
    function DeleteMoveCallback (d3drmFMC: TD3DRMFrameMoveCallback;
10412
    function DeleteMoveCallback (d3drmFMC: TD3DRMFrameMoveCallback;
10405
        lpArg: Pointer) : HResult; stdcall;
10413
        lpArg: Pointer) : HResult; stdcall;
10406
    function DeleteVisual (lpD3DRMVisual: IDirect3DRMVisual) : HResult; stdcall;
10414
    function DeleteVisual (lpD3DRMVisual: IDirect3DRMVisual) : HResult; stdcall;
10407
    function GetSceneBackground: TD3DColor; stdcall;
10415
    function GetSceneBackground: TD3DColor; stdcall;
10408
    function GetSceneBackgroundDepth (out lplpDDSurface: IDirectDrawSurface) : HResult; stdcall;
10416
    function GetSceneBackgroundDepth (out lplpDDSurface: IDirectDrawSurface) : HResult; stdcall;
10409
    function GetSceneFogColor: TD3DColor; stdcall;
10417
    function GetSceneFogColor: TD3DColor; stdcall;
10410
    function GetSceneFogEnable: BOOL; stdcall;
10418
    function GetSceneFogEnable: BOOL; stdcall;
10411
    function GetSceneFogMode: TD3DRMFogMode; stdcall;
10419
    function GetSceneFogMode: TD3DRMFogMode; stdcall;
10412
    function GetSceneFogParams (out lprvStart, lprvEnd, lprvDensity: TD3DValue) : HResult; stdcall;
10420
    function GetSceneFogParams (out lprvStart, lprvEnd, lprvDensity: TD3DValue) : HResult; stdcall;
10413
    function SetSceneBackground (rcColor: TD3DColor) : HResult; stdcall;
10421
    function SetSceneBackground (rcColor: TD3DColor) : HResult; stdcall;
10414
    function SetSceneBackgroundRGB (rvRed, rvGreen, rvBlue: TD3DValue) : HResult; stdcall;
10422
    function SetSceneBackgroundRGB (rvRed, rvGreen, rvBlue: TD3DValue) : HResult; stdcall;
10415
    function SetSceneBackgroundDepth (lpImage: IDirectDrawSurface) : HResult; stdcall;
10423
    function SetSceneBackgroundDepth (lpImage: IDirectDrawSurface) : HResult; stdcall;
10416
    function SetSceneBackgroundImage (lpTexture: IDirect3DRMTexture) : HResult; stdcall;
10424
    function SetSceneBackgroundImage (lpTexture: IDirect3DRMTexture) : HResult; stdcall;
10417
    function SetSceneFogEnable (bEnable: BOOL) : HResult; stdcall;
10425
    function SetSceneFogEnable (bEnable: BOOL) : HResult; stdcall;
10418
    function SetSceneFogColor (rcColor: TD3DColor) : HResult; stdcall;
10426
    function SetSceneFogColor (rcColor: TD3DColor) : HResult; stdcall;
10419
    function SetSceneFogMode (rfMode: TD3DRMFogMode) : HResult; stdcall;
10427
    function SetSceneFogMode (rfMode: TD3DRMFogMode) : HResult; stdcall;
10420
    function SetSceneFogParams (rvStart, rvEnd, rvDensity: TD3DValue) : HResult; stdcall;
10428
    function SetSceneFogParams (rvStart, rvEnd, rvDensity: TD3DValue) : HResult; stdcall;
10421
    function SetColor (rcColor: TD3DColor) : HResult; stdcall;
10429
    function SetColor (rcColor: TD3DColor) : HResult; stdcall;
10422
    function SetColorRGB (rvRed, rvGreen, rvBlue: TD3DValue) : HResult; stdcall;
10430
    function SetColorRGB (rvRed, rvGreen, rvBlue: TD3DValue) : HResult; stdcall;
10423
    function GetZbufferMode: TD3DRMZBufferMode; stdcall;
10431
    function GetZbufferMode: TD3DRMZBufferMode; stdcall;
10424
    function SetMaterialMode (rmmMode: TD3DRMMaterialMode) : HResult; stdcall;
10432
    function SetMaterialMode (rmmMode: TD3DRMMaterialMode) : HResult; stdcall;
10425
    function SetOrientation (lpRef: IDirect3DRMFrame; rvDx, rvDy, rvDz, rvUx,
10433
    function SetOrientation (lpRef: IDirect3DRMFrame; rvDx, rvDy, rvDz, rvUx,
10426
        rvUy, rvUz: TD3DValue) : HResult; stdcall;
10434
        rvUy, rvUz: TD3DValue) : HResult; stdcall;
10427
    function SetPosition (lpRef: IDirect3DRMFrame; rvX, rvY, rvZ: TD3DValue) : HResult; stdcall;
10435
    function SetPosition (lpRef: IDirect3DRMFrame; rvX, rvY, rvZ: TD3DValue) : HResult; stdcall;
10428
    function SetRotation (lpRef: IDirect3DRMFrame; rvX, rvY, rvZ,
10436
    function SetRotation (lpRef: IDirect3DRMFrame; rvX, rvY, rvZ,
10429
        rvTheta: TD3DValue) : HResult; stdcall;
10437
        rvTheta: TD3DValue) : HResult; stdcall;
10430
    function SetSortMode (d3drmSM: TD3DRMSortMode) : HResult; stdcall;
10438
    function SetSortMode (d3drmSM: TD3DRMSortMode) : HResult; stdcall;
10431
    function SetTexture (lpD3DRMTexture: IDirect3DRMTexture) : HResult; stdcall;
10439
    function SetTexture (lpD3DRMTexture: IDirect3DRMTexture) : HResult; stdcall;
10432
    function SetTextureTopology (cylU, cylV: BOOL) : HResult; stdcall;
10440
    function SetTextureTopology (cylU, cylV: BOOL) : HResult; stdcall;
10433
    function SetVelocity (lpRef: IDirect3DRMFrame; rvX, rvY, rvZ: TD3DValue;
10441
    function SetVelocity (lpRef: IDirect3DRMFrame; rvX, rvY, rvZ: TD3DValue;
10434
        fRotVel: BOOL) : HResult; stdcall;
10442
        fRotVel: BOOL) : HResult; stdcall;
10435
    function SetZbufferMode (d3drmZBM: TD3DRMZBufferMode) : HResult; stdcall;
10443
    function SetZbufferMode (d3drmZBM: TD3DRMZBufferMode) : HResult; stdcall;
10436
    function Transform (out lpd3dVDst: TD3DVector; const lpd3dVSrc: TD3DVector) : HResult; stdcall;
10444
    function Transform (out lpd3dVDst: TD3DVector; const lpd3dVSrc: TD3DVector) : HResult; stdcall;
10437
  end;
10445
  end;
10438
 
10446
 
10439
  IDirect3DRMFrame2 = interface (IDirect3DRMFrame)
10447
  IDirect3DRMFrame2 = interface (IDirect3DRMFrame)
10440
    ['{c3dfbd60-3988-11d0-9ec2-0000c0291ac3}']
10448
    ['{c3dfbd60-3988-11d0-9ec2-0000c0291ac3}']
10441
    (*
10449
    (*
10442
     * IDirect3DRMFrame2 methods
10450
     * IDirect3DRMFrame2 methods
10443
     *)
10451
     *)
10444
    function AddMoveCallback2 (d3drmFMC: TD3DRMFrameMoveCallback; lpArg:
10452
    function AddMoveCallback2 (d3drmFMC: TD3DRMFrameMoveCallback; lpArg:
10445
        Pointer; dwFlags: DWORD) : HResult; stdcall;
10453
        Pointer; dwFlags: DWORD) : HResult; stdcall;
10446
    function GetBox (out lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
10454
    function GetBox (out lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
10447
    function GetBoxEnable : boolean; stdcall;
10455
    function GetBoxEnable : boolean; stdcall;
10448
    function GetAxes (out dir, up: TD3DVector) : HResult; stdcall;
10456
    function GetAxes (out dir, up: TD3DVector) : HResult; stdcall;
10449
    function GetMaterial (out lplpMaterial: IDirect3DRMMaterial) : HResult; stdcall;
10457
    function GetMaterial (out lplpMaterial: IDirect3DRMMaterial) : HResult; stdcall;
10450
    function GetInheritAxes : boolean; stdcall;
10458
    function GetInheritAxes : boolean; stdcall;
10451
    function GetHierarchyBox (out lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
10459
    function GetHierarchyBox (out lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
10452
    function SetBox (const lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
10460
    function SetBox (const lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
10453
    function SetBoxEnable (bEnableFlag: BOOL) : HResult; stdcall;
10461
    function SetBoxEnable (bEnableFlag: BOOL) : HResult; stdcall;
10454
    function SetAxes (dx, dy, dz, ux, uy, uz: TD3DValue) : HResult; stdcall;
10462
    function SetAxes (dx, dy, dz, ux, uy, uz: TD3DValue) : HResult; stdcall;
10455
    function SetInheritAxes (inherit_from_parent: BOOL) : HResult; stdcall;
10463
    function SetInheritAxes (inherit_from_parent: BOOL) : HResult; stdcall;
10456
    function SetMaterial (var lplpMaterial: IDirect3DRMMaterial) : HResult; stdcall;
10464
    function SetMaterial (var lplpMaterial: IDirect3DRMMaterial) : HResult; stdcall;
10457
    function SetQuaternion (lpRef: IDirect3DRMFrame;
10465
    function SetQuaternion (lpRef: IDirect3DRMFrame;
10458
        const quat: TD3DRMQuaternion) : HResult; stdcall;
10466
        const quat: TD3DRMQuaternion) : HResult; stdcall;
10459
    function RayPick (lpRefFrame: IDirect3DRMFrame; var ray: TD3DRMRay;
10467
    function RayPick (lpRefFrame: IDirect3DRMFrame; var ray: TD3DRMRay;
10460
        dwFlags: DWORD; out lplpPicked2Array: IDirect3DRMPicked2Array) :
10468
        dwFlags: DWORD; out lplpPicked2Array: IDirect3DRMPicked2Array) :
10461
        HResult; stdcall;
10469
        HResult; stdcall;
10462
    function Save (lpFilename: PAnsiChar; d3dFormat: TD3DRMXOFFormat;
10470
    function Save (lpFilename: PAnsiChar; d3dFormat: TD3DRMXOFFormat;
10463
        d3dSaveFlags: TD3DRMSaveOptions) : HResult; stdcall;
10471
        d3dSaveFlags: TD3DRMSaveOptions) : HResult; stdcall;
10464
  end;
10472
  end;
10465
 
10473
 
10466
  IDirect3DRMFrame3 = interface (IDirect3DRMVisual)
10474
  IDirect3DRMFrame3 = interface (IDirect3DRMVisual)
10467
    ['{ff6b7f70-a40e-11d1-91f9-0000f8758e66}']
10475
    ['{ff6b7f70-a40e-11d1-91f9-0000f8758e66}']
10468
    (*
10476
    (*
10469
     * IDirect3DRMFrame3 methods
10477
     * IDirect3DRMFrame3 methods
10470
     *)
10478
     *)
10471
    function AddChild (lpD3DRMFrameChild: IDirect3DRMFrame3) : HResult; stdcall;
10479
    function AddChild (lpD3DRMFrameChild: IDirect3DRMFrame3) : HResult; stdcall;
10472
    function AddLight (lpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
10480
    function AddLight (lpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
10473
    function AddMoveCallback (d3drmFMC: TD3DRMFrame3MoveCallback;
10481
    function AddMoveCallback (d3drmFMC: TD3DRMFrame3MoveCallback;
10474
        lpArg: Pointer; dwFlags: DWORD) : HResult; stdcall;
10482
        lpArg: Pointer; dwFlags: DWORD) : HResult; stdcall;
10475
    function AddTransform (rctCombine: TD3DRMCombineType;
10483
    function AddTransform (rctCombine: TD3DRMCombineType;
10476
        rmMatrix: TD3DRMMatrix4D) : HResult; stdcall;
10484
        rmMatrix: TD3DRMMatrix4D) : HResult; stdcall;
10477
    function AddTranslation (rctCombine: TD3DRMCombineType; rvX, rvY, rvZ:
10485
    function AddTranslation (rctCombine: TD3DRMCombineType; rvX, rvY, rvZ:
10478
        TD3DValue) : HResult; stdcall;
10486
        TD3DValue) : HResult; stdcall;
10479
    function AddScale (rctCombine: TD3DRMCombineType; rvX, rvY, rvZ: TD3DValue) : HResult; stdcall;
10487
    function AddScale (rctCombine: TD3DRMCombineType; rvX, rvY, rvZ: TD3DValue) : HResult; stdcall;
10480
    function AddRotation (rctCombine: TD3DRMCombineType; rvX, rvY, rvZ,
10488
    function AddRotation (rctCombine: TD3DRMCombineType; rvX, rvY, rvZ,
10481
        rvTheta: TD3DValue) : HResult; stdcall;
10489
        rvTheta: TD3DValue) : HResult; stdcall;
10482
    function AddVisual (lpD3DRMVisual: IDirect3DRMVisual) : HResult; stdcall;
10490
    function AddVisual (lpD3DRMVisual: IDirect3DRMVisual) : HResult; stdcall;
10483
    function GetChildren (out lplpChildren: IDirect3DRMFrameArray) : HResult; stdcall;
10491
    function GetChildren (out lplpChildren: IDirect3DRMFrameArray) : HResult; stdcall;
10484
    function GetColor: TD3DColor; stdcall;
10492
    function GetColor: TD3DColor; stdcall;
10485
    function GetLights (out lplpLights: IDirect3DRMLightArray) : HResult; stdcall;
10493
    function GetLights (out lplpLights: IDirect3DRMLightArray) : HResult; stdcall;
10486
    function GetMaterialMode: TD3DRMMaterialMode; stdcall;
10494
    function GetMaterialMode: TD3DRMMaterialMode; stdcall;
10487
    function GetParent (out lplpParent: IDirect3DRMFrame3) : HResult; stdcall;
10495
    function GetParent (out lplpParent: IDirect3DRMFrame3) : HResult; stdcall;
10488
    function GetPosition (lpRef: IDirect3DRMFrame3; out lprvPos: TD3DVector) : HResult; stdcall;
10496
    function GetPosition (lpRef: IDirect3DRMFrame3; out lprvPos: TD3DVector) : HResult; stdcall;
10489
    function GetRotation (lpRef: IDirect3DRMFrame3; out lprvAxis: TD3DVector;
10497
    function GetRotation (lpRef: IDirect3DRMFrame3; out lprvAxis: TD3DVector;
10490
        out lprvTheta: TD3DValue) : HResult; stdcall;
10498
        out lprvTheta: TD3DValue) : HResult; stdcall;
10491
    function GetScene (out lplpRoot: IDirect3DRMFrame3) : HResult; stdcall;
10499
    function GetScene (out lplpRoot: IDirect3DRMFrame3) : HResult; stdcall;
10492
    function GetSortMode: TD3DRMSortMode; stdcall;
10500
    function GetSortMode: TD3DRMSortMode; stdcall;
10493
    function GetTexture (out lplpTexture: IDirect3DRMTexture3) : HResult; stdcall;
10501
    function GetTexture (out lplpTexture: IDirect3DRMTexture3) : HResult; stdcall;
10494
    function GetTransform (lpRefFrame: IDirect3DRMFrame3;
10502
    function GetTransform (lpRefFrame: IDirect3DRMFrame3;
10495
        var rmMatrix: TD3DRMMatrix4D) : HResult; stdcall;
10503
        var rmMatrix: TD3DRMMatrix4D) : HResult; stdcall;
10496
    function GetVelocity (lpRef: IDirect3DRMFrame3; out lprvVel: TD3DVector;
10504
    function GetVelocity (lpRef: IDirect3DRMFrame3; out lprvVel: TD3DVector;
10497
        fRotVel: BOOL) : HResult; stdcall;
10505
        fRotVel: BOOL) : HResult; stdcall;
10498
    function GetOrientation (lpRef: IDirect3DRMFrame3; out lprvDir: TD3DVector;
10506
    function GetOrientation (lpRef: IDirect3DRMFrame3; out lprvDir: TD3DVector;
10499
        out lprvUp: TD3DVector) : HResult; stdcall;
10507
        out lprvUp: TD3DVector) : HResult; stdcall;
10500
    function GetVisuals (out lplpVisuals: IDirect3DRMVisualArray) : HResult; stdcall;
10508
    function GetVisuals (out lplpVisuals: IDirect3DRMVisualArray) : HResult; stdcall;
10501
    function InverseTransform (out lprvDst: TD3DVector; const lprvSrc: TD3DVector) : HResult; stdcall;
10509
    function InverseTransform (out lprvDst: TD3DVector; const lprvSrc: TD3DVector) : HResult; stdcall;
10502
    function Load (lpvObjSource: Pointer; lpvObjID: Pointer;
10510
    function Load (lpvObjSource: Pointer; lpvObjID: Pointer;
10503
        d3drmLOFlags: TD3DRMLoadOptions; d3drmLoadTextureProc:
10511
        d3drmLOFlags: TD3DRMLoadOptions; d3drmLoadTextureProc:
10504
        TD3DRMLoadTexture3Callback; lpArgLTP: Pointer) : HResult; stdcall;
10512
        TD3DRMLoadTexture3Callback; lpArgLTP: Pointer) : HResult; stdcall;
10505
    function LookAt (lpTarget, lpRef: IDirect3DRMFrame3;
10513
    function LookAt (lpTarget, lpRef: IDirect3DRMFrame3;
10506
        rfcConstraint: TD3DRMFrameConstraint ) : HResult; stdcall;
10514
        rfcConstraint: TD3DRMFrameConstraint ) : HResult; stdcall;
10507
    function Move (delta: TD3DValue) : HResult; stdcall;
10515
    function Move (delta: TD3DValue) : HResult; stdcall;
10508
    function DeleteChild (lpChild: IDirect3DRMFrame3) : HResult; stdcall;
10516
    function DeleteChild (lpChild: IDirect3DRMFrame3) : HResult; stdcall;
10509
    function DeleteLight (lpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
10517
    function DeleteLight (lpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
10510
    function DeleteMoveCallback (d3drmFMC: TD3DRMFrame3MoveCallback; lpArg: Pointer) : HResult; stdcall;
10518
    function DeleteMoveCallback (d3drmFMC: TD3DRMFrame3MoveCallback; lpArg: Pointer) : HResult; stdcall;
10511
    function DeleteVisual (lpD3DRMVisual: IDirect3DRMVisual) : HResult; stdcall;
10519
    function DeleteVisual (lpD3DRMVisual: IDirect3DRMVisual) : HResult; stdcall;
10512
    function GetSceneBackground: TD3DColor; stdcall;
10520
    function GetSceneBackground: TD3DColor; stdcall;
10513
    function GetSceneBackgroundDepth (out lplpDDSurface: IDirectDrawSurface) : HResult; stdcall;
10521
    function GetSceneBackgroundDepth (out lplpDDSurface: IDirectDrawSurface) : HResult; stdcall;
10514
    function GetSceneFogColor: TD3DColor; stdcall;
10522
    function GetSceneFogColor: TD3DColor; stdcall;
10515
    function GetSceneFogEnable: BOOL; stdcall;
10523
    function GetSceneFogEnable: BOOL; stdcall;
10516
    function GetSceneFogMode: TD3DRMFogMode; stdcall;
10524
    function GetSceneFogMode: TD3DRMFogMode; stdcall;
10517
    function GetSceneFogParams (out lprvStart, lprvEnd, lprvDensity: TD3DValue) : HResult; stdcall;
10525
    function GetSceneFogParams (out lprvStart, lprvEnd, lprvDensity: TD3DValue) : HResult; stdcall;
10518
    function SetSceneBackground (rcColor: TD3DColor) : HResult; stdcall;
10526
    function SetSceneBackground (rcColor: TD3DColor) : HResult; stdcall;
10519
    function SetSceneBackgroundRGB (rvRed, rvGreen, rvBlue: TD3DValue) : HResult; stdcall;
10527
    function SetSceneBackgroundRGB (rvRed, rvGreen, rvBlue: TD3DValue) : HResult; stdcall;
10520
    function SetSceneBackgroundDepth (lpImage: IDirectDrawSurface) : HResult; stdcall;
10528
    function SetSceneBackgroundDepth (lpImage: IDirectDrawSurface) : HResult; stdcall;
10521
    function SetSceneBackgroundImage (lpTexture: IDirect3DRMTexture3) : HResult; stdcall;
10529
    function SetSceneBackgroundImage (lpTexture: IDirect3DRMTexture3) : HResult; stdcall;
10522
    function SetSceneFogEnable (bEnable: BOOL) : HResult; stdcall;
10530
    function SetSceneFogEnable (bEnable: BOOL) : HResult; stdcall;
10523
    function SetSceneFogColor (rcColor: TD3DColor) : HResult; stdcall;
10531
    function SetSceneFogColor (rcColor: TD3DColor) : HResult; stdcall;
10524
    function SetSceneFogMode (rfMode: TD3DRMFogMode) : HResult; stdcall;
10532
    function SetSceneFogMode (rfMode: TD3DRMFogMode) : HResult; stdcall;
10525
    function SetSceneFogParams (rvStart, rvEnd, rvDensity: TD3DValue) : HResult; stdcall;
10533
    function SetSceneFogParams (rvStart, rvEnd, rvDensity: TD3DValue) : HResult; stdcall;
10526
    function SetColor (rcColor: TD3DColor) : HResult; stdcall;
10534
    function SetColor (rcColor: TD3DColor) : HResult; stdcall;
10527
    function SetColorRGB (rvRed, rvGreen, rvBlue: TD3DValue) : HResult; stdcall;
10535
    function SetColorRGB (rvRed, rvGreen, rvBlue: TD3DValue) : HResult; stdcall;
10528
    function GetZbufferMode: TD3DRMZBufferMode; stdcall;
10536
    function GetZbufferMode: TD3DRMZBufferMode; stdcall;
10529
    function SetMaterialMode (rmmMode: TD3DRMMaterialMode) : HResult; stdcall;
10537
    function SetMaterialMode (rmmMode: TD3DRMMaterialMode) : HResult; stdcall;
10530
    function SetOrientation (lpRef: IDirect3DRMFrame3; rvDx, rvDy, rvDz, rvUx,
10538
    function SetOrientation (lpRef: IDirect3DRMFrame3; rvDx, rvDy, rvDz, rvUx,
10531
        rvUy, rvUz: TD3DValue) : HResult; stdcall;
10539
        rvUy, rvUz: TD3DValue) : HResult; stdcall;
10532
    function SetPosition (lpRef: IDirect3DRMFrame3; rvX, rvY, rvZ: TD3DValue) :
10540
    function SetPosition (lpRef: IDirect3DRMFrame3; rvX, rvY, rvZ: TD3DValue) :
10533
        HResult; stdcall;
10541
        HResult; stdcall;
10534
    function SetRotation (lpRef: IDirect3DRMFrame3; rvX, rvY, rvZ,
10542
    function SetRotation (lpRef: IDirect3DRMFrame3; rvX, rvY, rvZ,
10535
        rvTheta: TD3DValue) : HResult; stdcall;
10543
        rvTheta: TD3DValue) : HResult; stdcall;
10536
    function SetSortMode (d3drmSM: TD3DRMSortMode) : HResult; stdcall;
10544
    function SetSortMode (d3drmSM: TD3DRMSortMode) : HResult; stdcall;
10537
    function SetTexture (lpD3DRMTexture: IDirect3DRMTexture3) : HResult; stdcall;
10545
    function SetTexture (lpD3DRMTexture: IDirect3DRMTexture3) : HResult; stdcall;
10538
    function SetVelocity (lpRef: IDirect3DRMFrame3; rvX, rvY, rvZ: TD3DValue;
10546
    function SetVelocity (lpRef: IDirect3DRMFrame3; rvX, rvY, rvZ: TD3DValue;
10539
        fRotVel: BOOL) : HResult; stdcall;
10547
        fRotVel: BOOL) : HResult; stdcall;
10540
    function SetZbufferMode (d3drmZBM: TD3DRMZBufferMode) : HResult; stdcall;
10548
    function SetZbufferMode (d3drmZBM: TD3DRMZBufferMode) : HResult; stdcall;
10541
    function Transform (out lpd3dVDst: TD3DVector; const lpd3dVSrc: TD3DVector) : HResult; stdcall;
10549
    function Transform (out lpd3dVDst: TD3DVector; const lpd3dVSrc: TD3DVector) : HResult; stdcall;
10542
 
10550
 
10543
    function GetBox (out lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
10551
    function GetBox (out lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
10544
    function GetBoxEnable : boolean; stdcall;
10552
    function GetBoxEnable : boolean; stdcall;
10545
    function GetAxes (out dir, up: TD3DVector) : HResult; stdcall;
10553
    function GetAxes (out dir, up: TD3DVector) : HResult; stdcall;
10546
    function GetMaterial (out lplpMaterial: IDirect3DRMMaterial2) : HResult; stdcall;
10554
    function GetMaterial (out lplpMaterial: IDirect3DRMMaterial2) : HResult; stdcall;
10547
    function GetInheritAxes : boolean; stdcall;
10555
    function GetInheritAxes : boolean; stdcall;
10548
    function GetHierarchyBox (out lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
10556
    function GetHierarchyBox (out lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
10549
    function SetBox (const lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
10557
    function SetBox (const lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
10550
    function SetBoxEnable (bEnableFlag: BOOL) : HResult; stdcall;
10558
    function SetBoxEnable (bEnableFlag: BOOL) : HResult; stdcall;
10551
    function SetAxes (dx, dy, dz, ux, uy, uz: TD3DValue) : HResult; stdcall;
10559
    function SetAxes (dx, dy, dz, ux, uy, uz: TD3DValue) : HResult; stdcall;
10552
    function SetInheritAxes (inherit_from_parent: BOOL) : HResult; stdcall;
10560
    function SetInheritAxes (inherit_from_parent: BOOL) : HResult; stdcall;
10553
    function SetMaterial (var lplpMaterial: IDirect3DRMMaterial2) : HResult; stdcall;
10561
    function SetMaterial (var lplpMaterial: IDirect3DRMMaterial2) : HResult; stdcall;
10554
    function SetQuaternion (lpRef: IDirect3DRMFrame3;
10562
    function SetQuaternion (lpRef: IDirect3DRMFrame3;
10555
        const quat: TD3DRMQuaternion) : HResult; stdcall;
10563
        const quat: TD3DRMQuaternion) : HResult; stdcall;
10556
    function RayPick (lpRefFrame: IDirect3DRMFrame3; var ray: TD3DRMRay;
10564
    function RayPick (lpRefFrame: IDirect3DRMFrame3; var ray: TD3DRMRay;
10557
        dwFlags: DWORD; out lplpPicked2Array: IDirect3DRMPicked2Array) : HResult; stdcall;
10565
        dwFlags: DWORD; out lplpPicked2Array: IDirect3DRMPicked2Array) : HResult; stdcall;
10558
    function Save (lpFilename: PAnsiChar; d3dFormat: TD3DRMXOFFormat;
10566
    function Save (lpFilename: PAnsiChar; d3dFormat: TD3DRMXOFFormat;
10559
        d3dSaveFlags: TD3DRMSaveOptions) : HResult; stdcall;
10567
        d3dSaveFlags: TD3DRMSaveOptions) : HResult; stdcall;
10560
    function TransformVectors (lpRefFrame: IDirect3DRMFrame3;
10568
    function TransformVectors (lpRefFrame: IDirect3DRMFrame3;
10561
        dwNumVectors: DWORD; out lpDstVectors: TD3DVector;
10569
        dwNumVectors: DWORD; out lpDstVectors: TD3DVector;
10562
        const lpSrcVectors: TD3DVector) : HResult; stdcall;
10570
        const lpSrcVectors: TD3DVector) : HResult; stdcall;
10563
    function InverseTransformVectors (lpRefFrame: IDirect3DRMFrame3;
10571
    function InverseTransformVectors (lpRefFrame: IDirect3DRMFrame3;
10564
        dwNumVectors: DWORD; out lpDstVectors: TD3DVector;
10572
        dwNumVectors: DWORD; out lpDstVectors: TD3DVector;
10565
        const lpSrcVectors: TD3DVector) : HResult; stdcall;
10573
        const lpSrcVectors: TD3DVector) : HResult; stdcall;
10566
    function SetTraversalOptions (dwFlags: DWORD) : HResult; stdcall;
10574
    function SetTraversalOptions (dwFlags: DWORD) : HResult; stdcall;
10567
    function GetTraversalOptions (out lpdwFlags: DWORD) : HResult; stdcall;
10575
    function GetTraversalOptions (out lpdwFlags: DWORD) : HResult; stdcall;
10568
    function SetSceneFogMethod (dwFlags: DWORD) : HResult; stdcall;
10576
    function SetSceneFogMethod (dwFlags: DWORD) : HResult; stdcall;
10569
    function GetSceneFogMethod (out lpdwFlags: DWORD) : HResult; stdcall;
10577
    function GetSceneFogMethod (out lpdwFlags: DWORD) : HResult; stdcall;
10570
    function SetMaterialOverride (
10578
    function SetMaterialOverride (
10571
        const lpdmOverride: TD3DRMMaterialOverride) : HResult; stdcall;
10579
        const lpdmOverride: TD3DRMMaterialOverride) : HResult; stdcall;
10572
    function GetMaterialOverride (
10580
    function GetMaterialOverride (
10573
        const lpdmOverride: TD3DRMMaterialOverride) : HResult; stdcall;
10581
        const lpdmOverride: TD3DRMMaterialOverride) : HResult; stdcall;
10574
  end;
10582
  end;
10575
 
10583
 
10576
 
10584
 
10577
  IDirect3DRMMesh = interface (IDirect3DRMVisual)
10585
  IDirect3DRMMesh = interface (IDirect3DRMVisual)
10578
    ['{a3a80d01-6e12-11cf-ac4a-0000c03825a1}']
10586
    ['{a3a80d01-6e12-11cf-ac4a-0000c03825a1}']
10579
    (*
10587
    (*
10580
     * IDirect3DRMMesh methods
10588
     * IDirect3DRMMesh methods
10581
     *)
10589
     *)
10582
    function Scale (sx, sy, sz: TD3DValue) : HResult; stdcall;
10590
    function Scale (sx, sy, sz: TD3DValue) : HResult; stdcall;
10583
    function Translate (tx, ty, tz: TD3DValue) : HResult; stdcall;
10591
    function Translate (tx, ty, tz: TD3DValue) : HResult; stdcall;
10584
    function GetBox (out lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
10592
    function GetBox (out lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
10585
    function AddGroup (vCount, fCount, vPerFace: DWORD; var fData: DWORD;
10593
    function AddGroup (vCount, fCount, vPerFace: DWORD; var fData: DWORD;
10586
        var returnId: TD3DRMGroupIndex) : HResult; stdcall;
10594
        var returnId: TD3DRMGroupIndex) : HResult; stdcall;
10587
    function SetVertices (id: TD3DRMGroupIndex; index, count: DWORD;
10595
    function SetVertices (id: TD3DRMGroupIndex; index, count: DWORD;
10588
        var values: TD3DRMVertex) : HResult; stdcall;
10596
        var values: TD3DRMVertex) : HResult; stdcall;
10589
    function SetGroupColor (id: TD3DRMGroupIndex; value: TD3DColor) : HResult; stdcall;
10597
    function SetGroupColor (id: TD3DRMGroupIndex; value: TD3DColor) : HResult; stdcall;
10590
    function SetGroupColorRGB (id: TD3DRMGroupIndex; red, green,
10598
    function SetGroupColorRGB (id: TD3DRMGroupIndex; red, green,
10591
        blue: TD3DValue) : HResult; stdcall;
10599
        blue: TD3DValue) : HResult; stdcall;
10592
    function SetGroupMapping (id: TD3DRMGroupIndex;
10600
    function SetGroupMapping (id: TD3DRMGroupIndex;
10593
        value: TD3DRMMapping) : HResult; stdcall;
10601
        value: TD3DRMMapping) : HResult; stdcall;
10594
    function SetGroupQuality (id: TD3DRMGroupIndex;
10602
    function SetGroupQuality (id: TD3DRMGroupIndex;
10595
        value: TD3DRMRenderQuality) : HResult; stdcall;
10603
        value: TD3DRMRenderQuality) : HResult; stdcall;
10596
    function SetGroupMaterial (id: TD3DRMGroupIndex; value:
10604
    function SetGroupMaterial (id: TD3DRMGroupIndex; value:
10597
        IDirect3DRMMaterial) : HResult; stdcall;
10605
        IDirect3DRMMaterial) : HResult; stdcall;
10598
    function SetGroupTexture (id: TD3DRMGroupIndex; value: IDirect3DRMTexture) : HResult; stdcall;
10606
    function SetGroupTexture (id: TD3DRMGroupIndex; value: IDirect3DRMTexture) : HResult; stdcall;
10599
    function GetGroupCount: DWORD; stdcall;
10607
    function GetGroupCount: DWORD; stdcall;
10600
    function GetGroup (id: TD3DRMGroupIndex; vCount, fCount, vPerFace : PDWORD;
10608
    function GetGroup (id: TD3DRMGroupIndex; vCount, fCount, vPerFace : PDWORD;
10601
        var fDataSize: DWORD; fData: PDWORD) : HResult; stdcall;
10609
        var fDataSize: DWORD; fData: PDWORD) : HResult; stdcall;
10602
    function GetVertices (id: TD3DRMGroupIndex; index, count : DWORD;
10610
    function GetVertices (id: TD3DRMGroupIndex; index, count : DWORD;
10603
        out returnPtr : TD3DRMVertex) : HResult; stdcall;
10611
        out returnPtr : TD3DRMVertex) : HResult; stdcall;
10604
    function GetGroupColor (id: TD3DRMGroupIndex) : TD3DColor; stdcall;
10612
    function GetGroupColor (id: TD3DRMGroupIndex) : TD3DColor; stdcall;
10605
    function GetGroupMapping (id: TD3DRMGroupIndex) : TD3DRMMapping; stdcall;
10613
    function GetGroupMapping (id: TD3DRMGroupIndex) : TD3DRMMapping; stdcall;
10606
    function GetGroupQuality (id: TD3DRMGroupIndex) : TD3DRMRenderQuality; stdcall;
10614
    function GetGroupQuality (id: TD3DRMGroupIndex) : TD3DRMRenderQuality; stdcall;
10607
    function GetGroupMaterial (id: TD3DRMGroupIndex;
10615
    function GetGroupMaterial (id: TD3DRMGroupIndex;
10608
        out returnPtr: IDirect3DRMMaterial) : HResult; stdcall;
10616
        out returnPtr: IDirect3DRMMaterial) : HResult; stdcall;
10609
    function GetGroupTexture (id: TD3DRMGroupIndex;
10617
    function GetGroupTexture (id: TD3DRMGroupIndex;
10610
        out returnPtr: IDirect3DRMTexture) : HResult; stdcall;
10618
        out returnPtr: IDirect3DRMTexture) : HResult; stdcall;
10611
  end;
10619
  end;
10612
 
10620
 
10613
  IDirect3DRMProgressiveMesh = interface (IDirect3DRMVisual)
10621
  IDirect3DRMProgressiveMesh = interface (IDirect3DRMVisual)
10614
    ['{4516ec79-8f20-11d0-9b6d-0000c0781bc3}']
10622
    ['{4516ec79-8f20-11d0-9b6d-0000c0781bc3}']
10615
    (*
10623
    (*
10616
     * IDirect3DRMProgressiveMesh methods
10624
     * IDirect3DRMProgressiveMesh methods
10617
     *)
10625
     *)
10618
    function Load (lpSource, lpObjID: pointer; dloLoadflags : TD3DRMLoadOptions;
10626
    function Load (lpSource, lpObjID: pointer; dloLoadflags : TD3DRMLoadOptions;
10619
        lpCallback: TD3DRMLoadTextureCallback; lpArg: pointer) : HResult; stdcall;
10627
        lpCallback: TD3DRMLoadTextureCallback; lpArg: pointer) : HResult; stdcall;
10620
    function GetLoadStatus (out lpStatus: TD3DRMPMeshLoadStatus) : HResult; stdcall;
10628
    function GetLoadStatus (out lpStatus: TD3DRMPMeshLoadStatus) : HResult; stdcall;
10621
    function SetMinRenderDetail (d3dVal: TD3DValue) : HResult; stdcall;
10629
    function SetMinRenderDetail (d3dVal: TD3DValue) : HResult; stdcall;
10622
    function Abort (dwFlags: DWORD) : HResult; stdcall;
10630
    function Abort (dwFlags: DWORD) : HResult; stdcall;
10623
    function GetFaceDetail (out lpdwCount: DWORD) : HResult; stdcall;
10631
    function GetFaceDetail (out lpdwCount: DWORD) : HResult; stdcall;
10624
    function GetVertexDetail (out lpdwCount: DWORD) : HResult; stdcall;
10632
    function GetVertexDetail (out lpdwCount: DWORD) : HResult; stdcall;
10625
    function SetFaceDetail (dwCount: DWORD) : HResult; stdcall;
10633
    function SetFaceDetail (dwCount: DWORD) : HResult; stdcall;
10626
    function SetVertexDetail (dwCount: DWORD) : HResult; stdcall;
10634
    function SetVertexDetail (dwCount: DWORD) : HResult; stdcall;
10627
    function GetFaceDetailRange (out lpdwMin, lpdwMax: DWORD) : HResult; stdcall;
10635
    function GetFaceDetailRange (out lpdwMin, lpdwMax: DWORD) : HResult; stdcall;
10628
    function GetVertexDetailRange (out lpdwMin, lpdwMax: DWORD) : HResult; stdcall;
10636
    function GetVertexDetailRange (out lpdwMin, lpdwMax: DWORD) : HResult; stdcall;
10629
    function GetDetail (out lpdvVal: TD3DValue) : HResult; stdcall;
10637
    function GetDetail (out lpdvVal: TD3DValue) : HResult; stdcall;
10630
    function SetDetail (lpdvVal: TD3DValue) : HResult; stdcall;
10638
    function SetDetail (lpdvVal: TD3DValue) : HResult; stdcall;
10631
    function RegisterEvents (hEvent: THANDLE; dwFlags, dwReserved: DWORD) : HResult; stdcall;
10639
    function RegisterEvents (hEvent: THANDLE; dwFlags, dwReserved: DWORD) : HResult; stdcall;
10632
    function CreateMesh (out lplpD3DRMMesh: IDirect3DRMMesh) : HResult; stdcall;
10640
    function CreateMesh (out lplpD3DRMMesh: IDirect3DRMMesh) : HResult; stdcall;
10633
    function Duplicate (out lplpD3DRMPMesh: IDirect3DRMProgressiveMesh) : HResult; stdcall;
10641
    function Duplicate (out lplpD3DRMPMesh: IDirect3DRMProgressiveMesh) : HResult; stdcall;
10634
    function GetBox (out lpBBox: TD3DRMBox) : HResult; stdcall;
10642
    function GetBox (out lpBBox: TD3DRMBox) : HResult; stdcall;
10635
    function SetQuality (quality: TD3DRMRenderQuality) : HResult; stdcall;
10643
    function SetQuality (quality: TD3DRMRenderQuality) : HResult; stdcall;
10636
    function GetQuality (out lpdwquality: TD3DRMRenderQuality) : HResult; stdcall;
10644
    function GetQuality (out lpdwquality: TD3DRMRenderQuality) : HResult; stdcall;
10637
  end;
10645
  end;
10638
 
10646
 
10639
  IDirect3DRMShadow = interface (IDirect3DRMVisual)
10647
  IDirect3DRMShadow = interface (IDirect3DRMVisual)
10640
    ['{af359780-6ba3-11cf-ac4a-0000c03825a1}']
10648
    ['{af359780-6ba3-11cf-ac4a-0000c03825a1}']
10641
    (*
10649
    (*
10642
     * IDirect3DRMShadow methods
10650
     * IDirect3DRMShadow methods
10643
     *)
10651
     *)
10644
    function Init (lpD3DRMVisual: IDirect3DRMVisual;
10652
    function Init (lpD3DRMVisual: IDirect3DRMVisual;
10645
        lpD3DRMLight: IDirect3DRMLight;
10653
        lpD3DRMLight: IDirect3DRMLight;
10646
        px, py, pz, nx, ny, nz: TD3DValue) : HResult; stdcall;
10654
        px, py, pz, nx, ny, nz: TD3DValue) : HResult; stdcall;
10647
  end;
10655
  end;
10648
 
10656
 
10649
  IDirect3DRMShadow2 = interface (IDirect3DRMShadow)
10657
  IDirect3DRMShadow2 = interface (IDirect3DRMShadow)
10650
    ['{86b44e25-9c82-11d1-bb0b-00a0c981a0a6}']
10658
    ['{86b44e25-9c82-11d1-bb0b-00a0c981a0a6}']
10651
    (*
10659
    (*
10652
     * IDirect3DRMShadow2 methods
10660
     * IDirect3DRMShadow2 methods
10653
     *)
10661
     *)
10654
    function GetVisual (out lplpDirect3DRMVisual: IDirect3DRMVisual) : HResult; stdcall;
10662
    function GetVisual (out lplpDirect3DRMVisual: IDirect3DRMVisual) : HResult; stdcall;
10655
    function SetVisual (lpDirect3DRMVisual: IDirect3DRMVisual;
10663
    function SetVisual (lpDirect3DRMVisual: IDirect3DRMVisual;
10656
        dwFlags: DWORD) : HResult; stdcall;
10664
        dwFlags: DWORD) : HResult; stdcall;
10657
    function GetLight (out lplpDirect3DRMLight: IDirect3DRMLight) : HResult; stdcall;
10665
    function GetLight (out lplpDirect3DRMLight: IDirect3DRMLight) : HResult; stdcall;
10658
    function SetLight (lplpDirect3DRMLight: IDirect3DRMLight;
10666
    function SetLight (lplpDirect3DRMLight: IDirect3DRMLight;
10659
        dwFlags: DWORD) : HResult; stdcall;
10667
        dwFlags: DWORD) : HResult; stdcall;
10660
    function GetPlane (
10668
    function GetPlane (
10661
        var pdvPX, pdvPY, pdvPZ, pdvNX, pdvNY, pdvNZ: TD3DValue) : HResult; stdcall;
10669
        var pdvPX, pdvPY, pdvPZ, pdvNX, pdvNY, pdvNZ: TD3DValue) : HResult; stdcall;
10662
    function SetPlane (px, py, pz, nx, ny, nz: TD3DValue;
10670
    function SetPlane (px, py, pz, nx, ny, nz: TD3DValue;
10663
        dwFlags: DWORD) : HResult; stdcall;
10671
        dwFlags: DWORD) : HResult; stdcall;
10664
    function GetOptions (out pdwOptions: DWORD) : HResult; stdcall;
10672
    function GetOptions (out pdwOptions: DWORD) : HResult; stdcall;
10665
    function SetOptions (dwOptions: DWORD) : HResult; stdcall;
10673
    function SetOptions (dwOptions: DWORD) : HResult; stdcall;
10666
 
10674
 
10667
  end;
10675
  end;
10668
 
10676
 
10669
  IDirect3DRMFace = interface (IDirect3DRMObject)
10677
  IDirect3DRMFace = interface (IDirect3DRMObject)
10670
    ['{eb16cb07-d271-11ce-ac48-0000c03825a1}']
10678
    ['{eb16cb07-d271-11ce-ac48-0000c03825a1}']
10671
    (*
10679
    (*
10672
     * IDirect3DRMFace methods
10680
     * IDirect3DRMFace methods
10673
     *)
10681
     *)
10674
    function AddVertex (x, y, z: TD3DValue) : HResult; stdcall;
10682
    function AddVertex (x, y, z: TD3DValue) : HResult; stdcall;
10675
    function AddVertexAndNormalIndexed (vertex: DWORD; normal: DWORD) : HResult; stdcall;
10683
    function AddVertexAndNormalIndexed (vertex: DWORD; normal: DWORD) : HResult; stdcall;
10676
    function SetColorRGB (red, green, blue: TD3DValue) : HResult; stdcall;
10684
    function SetColorRGB (red, green, blue: TD3DValue) : HResult; stdcall;
10677
    function SetColor (color: TD3DColor) : HResult; stdcall;
10685
    function SetColor (color: TD3DColor) : HResult; stdcall;
10678
    function SetTexture (lpD3DRMTexture: IDirect3DRMTexture) : HResult; stdcall;
10686
    function SetTexture (lpD3DRMTexture: IDirect3DRMTexture) : HResult; stdcall;
10679
    function SetTextureCoordinates (vertex: DWORD; u, v: TD3DValue) : HResult; stdcall;
10687
    function SetTextureCoordinates (vertex: DWORD; u, v: TD3DValue) : HResult; stdcall;
10680
    function SetMaterial (lpMat: IDirect3DRMMaterial) : HResult; stdcall;
10688
    function SetMaterial (lpMat: IDirect3DRMMaterial) : HResult; stdcall;
10681
    function SetTextureTopology (cylU, cylV: BOOL) : HResult; stdcall;
10689
    function SetTextureTopology (cylU, cylV: BOOL) : HResult; stdcall;
10682
    function GetVertex (index: DWORD; out lpPosition: TD3DVector;
10690
    function GetVertex (index: DWORD; out lpPosition: TD3DVector;
10683
        out lpNormal: TD3DVector) : HResult; stdcall;
10691
        out lpNormal: TD3DVector) : HResult; stdcall;
10684
    function GetVertices (var lpdwVertexCount: DWORD;
10692
    function GetVertices (var lpdwVertexCount: DWORD;
10685
        out lpPosition, lpNormal: TD3DVector) : HResult; stdcall;
10693
        out lpPosition, lpNormal: TD3DVector) : HResult; stdcall;
10686
    function GetTextureCoordinates (index: DWORD; out lpU, lpV: TD3DValue) : HResult; stdcall;
10694
    function GetTextureCoordinates (index: DWORD; out lpU, lpV: TD3DValue) : HResult; stdcall;
10687
    function GetTextureTopology (out lpU, lpV: BOOL) : HResult; stdcall;
10695
    function GetTextureTopology (out lpU, lpV: BOOL) : HResult; stdcall;
10688
    function GetNormal (out lpNormal: TD3DVector) : HResult; stdcall;
10696
    function GetNormal (out lpNormal: TD3DVector) : HResult; stdcall;
10689
    function GetTexture (out lplpTexture: IDirect3DRMTexture) : HResult; stdcall;
10697
    function GetTexture (out lplpTexture: IDirect3DRMTexture) : HResult; stdcall;
10690
    function GetMaterial (out lpMat: IDirect3DRMMaterial) : HResult; stdcall;
10698
    function GetMaterial (out lpMat: IDirect3DRMMaterial) : HResult; stdcall;
10691
    function GetVertexCount: Integer; stdcall;
10699
    function GetVertexCount: Integer; stdcall;
10692
    function GetVertexIndex (dwIndex: DWORD) : Integer; stdcall;
10700
    function GetVertexIndex (dwIndex: DWORD) : Integer; stdcall;
10693
    function GetTextureCoordinateIndex (dwIndex: DWORD) : Integer; stdcall;
10701
    function GetTextureCoordinateIndex (dwIndex: DWORD) : Integer; stdcall;
10694
    function GetColor: TD3DColor; stdcall;
10702
    function GetColor: TD3DColor; stdcall;
10695
  end;
10703
  end;
10696
 
10704
 
10697
  IDirect3DRMFace2 = interface (IDirect3DRMObject)
10705
  IDirect3DRMFace2 = interface (IDirect3DRMObject)
10698
    ['{4516ec81-8f20-11d0-9b6d-0000c0781bc3}']
10706
    ['{4516ec81-8f20-11d0-9b6d-0000c0781bc3}']
10699
    (*
10707
    (*
10700
     * IDirect3DRMFace2 methods
10708
     * IDirect3DRMFace2 methods
10701
     *)
10709
     *)
10702
    function AddVertex (x, y, z: TD3DValue) : HResult; stdcall;
10710
    function AddVertex (x, y, z: TD3DValue) : HResult; stdcall;
10703
    function AddVertexAndNormalIndexed (vertex: DWORD; normal: DWORD) : HResult; stdcall;
10711
    function AddVertexAndNormalIndexed (vertex: DWORD; normal: DWORD) : HResult; stdcall;
10704
    function SetColorRGB (red, green, blue: TD3DValue) : HResult; stdcall;
10712
    function SetColorRGB (red, green, blue: TD3DValue) : HResult; stdcall;
10705
    function SetColor (color: TD3DColor) : HResult; stdcall;
10713
    function SetColor (color: TD3DColor) : HResult; stdcall;
10706
    function SetTexture (lpD3DRMTexture: IDirect3DRMTexture3) : HResult; stdcall;
10714
    function SetTexture (lpD3DRMTexture: IDirect3DRMTexture3) : HResult; stdcall;
10707
    function SetTextureCoordinates (vertex: DWORD; u, v: TD3DValue) : HResult; stdcall;
10715
    function SetTextureCoordinates (vertex: DWORD; u, v: TD3DValue) : HResult; stdcall;
10708
    function SetMaterial (lpMat: IDirect3DRMMaterial2) : HResult; stdcall;
10716
    function SetMaterial (lpMat: IDirect3DRMMaterial2) : HResult; stdcall;
10709
    function SetTextureTopology (cylU, cylV: BOOL) : HResult; stdcall;
10717
    function SetTextureTopology (cylU, cylV: BOOL) : HResult; stdcall;
10710
    function GetVertex (index: DWORD; out lpPosition: TD3DVector;
10718
    function GetVertex (index: DWORD; out lpPosition: TD3DVector;
10711
        out lpNormal: TD3DVector) : HResult; stdcall;
10719
        out lpNormal: TD3DVector) : HResult; stdcall;
10712
    function GetVertices (var lpdwVertexCount: DWORD;
10720
    function GetVertices (var lpdwVertexCount: DWORD;
10713
        out lpPosition, lpNormal: TD3DVector) : HResult; stdcall;
10721
        out lpPosition, lpNormal: TD3DVector) : HResult; stdcall;
10714
    function GetTextureCoordinates (index: DWORD; out lpU, lpV: TD3DValue) : HResult; stdcall;
10722
    function GetTextureCoordinates (index: DWORD; out lpU, lpV: TD3DValue) : HResult; stdcall;
10715
    function GetTextureTopology (out lpU, lpV: BOOL) : HResult; stdcall;
10723
    function GetTextureTopology (out lpU, lpV: BOOL) : HResult; stdcall;
10716
    function GetNormal (out lpNormal: TD3DVector) : HResult; stdcall;
10724
    function GetNormal (out lpNormal: TD3DVector) : HResult; stdcall;
10717
    function GetTexture (out lplpTexture: IDirect3DRMTexture3) : HResult; stdcall;
10725
    function GetTexture (out lplpTexture: IDirect3DRMTexture3) : HResult; stdcall;
10718
    function GetMaterial (out lpMat: IDirect3DRMMaterial2) : HResult; stdcall;
10726
    function GetMaterial (out lpMat: IDirect3DRMMaterial2) : HResult; stdcall;
10719
    function GetVertexCount: Integer; stdcall;
10727
    function GetVertexCount: Integer; stdcall;
10720
    function GetVertexIndex (dwIndex: DWORD) : Integer; stdcall;
10728
    function GetVertexIndex (dwIndex: DWORD) : Integer; stdcall;
10721
    function GetTextureCoordinateIndex (dwIndex: DWORD) : Integer; stdcall;
10729
    function GetTextureCoordinateIndex (dwIndex: DWORD) : Integer; stdcall;
10722
    function GetColor: TD3DColor; stdcall;
10730
    function GetColor: TD3DColor; stdcall;
10723
  end;
10731
  end;
10724
 
10732
 
10725
  IDirect3DRMMeshBuilder = interface (IDirect3DRMVisual)
10733
  IDirect3DRMMeshBuilder = interface (IDirect3DRMVisual)
10726
    ['{a3a80d02-6e12-11cf-ac4a-0000c03825a1}']
10734
    ['{a3a80d02-6e12-11cf-ac4a-0000c03825a1}']
10727
    (*
10735
    (*
10728
     * IDirect3DRMMeshBuilder methods
10736
     * IDirect3DRMMeshBuilder methods
10729
     *)
10737
     *)
10730
    function Load (lpvObjSource, lpvObjID: Pointer; d3drmLOFlags:
10738
    function Load (lpvObjSource, lpvObjID: Pointer; d3drmLOFlags:
10731
        TD3DRMLoadOptions; d3drmLoadTextureProc: TD3DRMLoadTextureCallback;
10739
        TD3DRMLoadOptions; d3drmLoadTextureProc: TD3DRMLoadTextureCallback;
10732
        lpvArg: Pointer) : HResult; stdcall;
10740
        lpvArg: Pointer) : HResult; stdcall;
10733
    function Save (lpFilename: PChar; TD3DRMXOFFormat: TD3DRMXOFFormat;
10741
    function Save (lpFilename: PChar; TD3DRMXOFFormat: TD3DRMXOFFormat;
10734
        d3drmSOContents: TD3DRMSaveOptions) : HResult; stdcall;
10742
        d3drmSOContents: TD3DRMSaveOptions) : HResult; stdcall;
10735
    function Scale (sx, sy, sz: TD3DValue) : HResult; stdcall;
10743
    function Scale (sx, sy, sz: TD3DValue) : HResult; stdcall;
10736
    function Translate (tx, ty, tz: TD3DValue) : HResult; stdcall;
10744
    function Translate (tx, ty, tz: TD3DValue) : HResult; stdcall;
10737
    function SetColorSource (source: TD3DRMColorSource) : HResult; stdcall;
10745
    function SetColorSource (source: TD3DRMColorSource) : HResult; stdcall;
10738
    function GetBox (out lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
10746
    function GetBox (out lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
10739
    function GenerateNormals : HResult; stdcall;
10747
    function GenerateNormals : HResult; stdcall;
10740
    function GetColorSource: TD3DRMColorSource; stdcall;
10748
    function GetColorSource: TD3DRMColorSource; stdcall;
10741
    function AddMesh (lpD3DRMMesh: IDirect3DRMMesh) : HResult; stdcall;
10749
    function AddMesh (lpD3DRMMesh: IDirect3DRMMesh) : HResult; stdcall;
10742
    function AddMeshBuilder (lpD3DRMMeshBuild: IDirect3DRMMeshBuilder) : HResult; stdcall;
10750
    function AddMeshBuilder (lpD3DRMMeshBuild: IDirect3DRMMeshBuilder) : HResult; stdcall;
10743
    function AddFrame (lpD3DRMFrame: IDirect3DRMFrame) : HResult; stdcall;
10751
    function AddFrame (lpD3DRMFrame: IDirect3DRMFrame) : HResult; stdcall;
10744
    function AddFace (lpD3DRMFace: IDirect3DRMFace) : HResult; stdcall;
10752
    function AddFace (lpD3DRMFace: IDirect3DRMFace) : HResult; stdcall;
10745
    function AddFaces (dwVertexCount: DWORD; const lpD3DVertices: TD3DVector;
10753
    function AddFaces (dwVertexCount: DWORD; const lpD3DVertices: TD3DVector;
10746
        normalCount: DWORD; lpNormals: PD3DVector; var lpFaceData: DWORD;
10754
        normalCount: DWORD; lpNormals: PD3DVector; var lpFaceData: DWORD;
10747
        lplpD3DRMFaceArray: PIDirect3DRMFaceArray) : HResult; stdcall;
10755
        lplpD3DRMFaceArray: PIDirect3DRMFaceArray) : HResult; stdcall;
10748
    function ReserveSpace (vertexCount, normalCount, faceCount: DWORD) : HResult; stdcall;
10756
    function ReserveSpace (vertexCount, normalCount, faceCount: DWORD) : HResult; stdcall;
10749
    function SetColorRGB (red, green, blue: TD3DValue) : HResult; stdcall;
10757
    function SetColorRGB (red, green, blue: TD3DValue) : HResult; stdcall;
10750
    function SetColor (color: TD3DColor) : HResult; stdcall;
10758
    function SetColor (color: TD3DColor) : HResult; stdcall;
10751
    function SetTexture (lpD3DRMTexture: IDirect3DRMTexture) : HResult; stdcall;
10759
    function SetTexture (lpD3DRMTexture: IDirect3DRMTexture) : HResult; stdcall;
10752
    function SetMaterial (lpIDirect3DRMmaterial: IDirect3DRMMaterial) : HResult; stdcall;
10760
    function SetMaterial (lpIDirect3DRMmaterial: IDirect3DRMMaterial) : HResult; stdcall;
10753
    function SetTextureTopology (cylU, cylV: BOOL) : HResult; stdcall;
10761
    function SetTextureTopology (cylU, cylV: BOOL) : HResult; stdcall;
10754
    function SetQuality (quality: TD3DRMRenderQuality) : HResult; stdcall;
10762
    function SetQuality (quality: TD3DRMRenderQuality) : HResult; stdcall;
10755
    function SetPerspective (perspective: BOOL) : HResult; stdcall;
10763
    function SetPerspective (perspective: BOOL) : HResult; stdcall;
10756
    function SetVertex (index: DWORD; x, y, z: TD3DValue) : HResult; stdcall;
10764
    function SetVertex (index: DWORD; x, y, z: TD3DValue) : HResult; stdcall;
10757
    function SetNormal (index: DWORD; x, y, z: TD3DValue) : HResult; stdcall;
10765
    function SetNormal (index: DWORD; x, y, z: TD3DValue) : HResult; stdcall;
10758
    function SetTextureCoordinates (index: DWORD; u, v: TD3DValue) : HResult; stdcall;
10766
    function SetTextureCoordinates (index: DWORD; u, v: TD3DValue) : HResult; stdcall;
10759
    function SetVertexColor (index: DWORD; color: TD3DColor) : HResult; stdcall;
10767
    function SetVertexColor (index: DWORD; color: TD3DColor) : HResult; stdcall;
10760
    function SetVertexColorRGB (index: DWORD; red, green, blue: TD3DValue) : HResult; stdcall;
10768
    function SetVertexColorRGB (index: DWORD; red, green, blue: TD3DValue) : HResult; stdcall;
10761
    function GetFaces (out lplpD3DRMFaceArray: IDirect3DRMFaceArray) : HResult; stdcall;
10769
    function GetFaces (out lplpD3DRMFaceArray: IDirect3DRMFaceArray) : HResult; stdcall;
10762
    function GetVertices (var vcount: DWORD; var vertices : TD3DVector;
10770
    function GetVertices (var vcount: DWORD; var vertices : TD3DVector;
10763
        var ncount : DWORD;
10771
        var ncount : DWORD;
10764
        var normals : TD3DVector;
10772
        var normals : TD3DVector;
10765
        var face_data_size, face_data : DWORD) : HResult; stdcall;
10773
        var face_data_size, face_data : DWORD) : HResult; stdcall;
10766
    function GetTextureCoordinates(index : DWORD; out u, v : TD3DValue) : HResult; stdcall;
10774
    function GetTextureCoordinates(index : DWORD; out u, v : TD3DValue) : HResult; stdcall;
10767
    function AddVertex (x, y, z: TD3DValue) : Integer; stdcall;
10775
    function AddVertex (x, y, z: TD3DValue) : Integer; stdcall;
10768
    function AddNormal (x, y, z: TD3DValue) : Integer; stdcall;
10776
    function AddNormal (x, y, z: TD3DValue) : Integer; stdcall;
10769
    function CreateFace (out lplpd3drmFace: IDirect3DRMFace) : HResult; stdcall;
10777
    function CreateFace (out lplpd3drmFace: IDirect3DRMFace) : HResult; stdcall;
10770
    function GetQuality: TD3DRMRenderQuality; stdcall;
10778
    function GetQuality: TD3DRMRenderQuality; stdcall;
10771
    function GetPerspective: BOOL; stdcall;
10779
    function GetPerspective: BOOL; stdcall;
10772
    function GetFaceCount: Integer; stdcall;
10780
    function GetFaceCount: Integer; stdcall;
10773
    function GetVertexCount: Integer; stdcall;
10781
    function GetVertexCount: Integer; stdcall;
10774
    function GetVertexColor (index: DWORD) : TD3DColor; stdcall;
10782
    function GetVertexColor (index: DWORD) : TD3DColor; stdcall;
10775
    function CreateMesh (out lplpD3DRMMesh: IDirect3DRMMesh) : HResult; stdcall;
10783
    function CreateMesh (out lplpD3DRMMesh: IDirect3DRMMesh) : HResult; stdcall;
10776
  end;
10784
  end;
10777
 
10785
 
10778
  IDirect3DRMMeshBuilder2 = interface (IDirect3DRMMeshBuilder)
10786
  IDirect3DRMMeshBuilder2 = interface (IDirect3DRMMeshBuilder)
10779
    ['{4516ec77-8f20-11d0-9b6d-0000c0781bc3}']
10787
    ['{4516ec77-8f20-11d0-9b6d-0000c0781bc3}']
10780
    (*
10788
    (*
10781
     * IDirect3DRMMeshBuilder2 methods
10789
     * IDirect3DRMMeshBuilder2 methods
10782
     *)
10790
     *)
10783
    function GenerateNormals2 (
10791
    function GenerateNormals2 (
10784
        dvCreaseAngle: TD3DValue; dwFlags: DWORD) : HResult; stdcall;
10792
        dvCreaseAngle: TD3DValue; dwFlags: DWORD) : HResult; stdcall;
10785
    function GetFace (dwIndex: DWORD; lplpD3DRMFace: IDirect3DRMFace) : HResult; stdcall;
10793
    function GetFace (dwIndex: DWORD; lplpD3DRMFace: IDirect3DRMFace) : HResult; stdcall;
10786
  end;
10794
  end;
10787
 
10795
 
10788
  IDirect3DRMMeshBuilder3 = interface (IDirect3DRMVisual)
10796
  IDirect3DRMMeshBuilder3 = interface (IDirect3DRMVisual)
10789
    ['{ff6b7f71-a40e-11d1-91f9-0000f8758e66}']
10797
    ['{ff6b7f71-a40e-11d1-91f9-0000f8758e66}']
10790
    (*
10798
    (*
10791
     * IDirect3DRMMeshBuilder3 methods
10799
     * IDirect3DRMMeshBuilder3 methods
10792
     *)
10800
     *)
10793
    function Load (lpvObjSource, lpvObjID: Pointer;
10801
    function Load (lpvObjSource, lpvObjID: Pointer;
10794
        d3drmLOFlags: TD3DRMLoadOptions;
10802
        d3drmLOFlags: TD3DRMLoadOptions;
10795
        d3drmLoadTextureProc: TD3DRMLoadTexture3Callback;
10803
        d3drmLoadTextureProc: TD3DRMLoadTexture3Callback;
10796
        lpvArg: Pointer) : HResult; stdcall;
10804
        lpvArg: Pointer) : HResult; stdcall;
10797
    function Save (lpFilename: PAnsiChar; TD3DRMXOFFormat: TD3DRMXOFFormat;
10805
    function Save (lpFilename: PAnsiChar; TD3DRMXOFFormat: TD3DRMXOFFormat;
10798
        d3drmSOContents: TD3DRMSaveOptions) : HResult; stdcall;
10806
        d3drmSOContents: TD3DRMSaveOptions) : HResult; stdcall;
10799
    function Scale (sx, sy, sz: TD3DValue) : HResult; stdcall;
10807
    function Scale (sx, sy, sz: TD3DValue) : HResult; stdcall;
10800
    function Translate (tx, ty, tz: TD3DValue) : HResult; stdcall;
10808
    function Translate (tx, ty, tz: TD3DValue) : HResult; stdcall;
10801
    function SetColorSource (source: TD3DRMColorSource) : HResult; stdcall;
10809
    function SetColorSource (source: TD3DRMColorSource) : HResult; stdcall;
10802
    function GetBox (out lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
10810
    function GetBox (out lpTD3DRMBox: TD3DRMBox) : HResult; stdcall;
10803
    function GenerateNormals (
10811
    function GenerateNormals (
10804
        dvCreaseAngle: TD3DValue; dwFlags: DWORD): HResult; stdcall;
10812
        dvCreaseAngle: TD3DValue; dwFlags: DWORD): HResult; stdcall;
10805
    function GetColorSource: TD3DRMColorSource; stdcall;
10813
    function GetColorSource: TD3DRMColorSource; stdcall;
10806
    function AddMesh (lpD3DRMMesh: IDirect3DRMMesh) : HResult; stdcall;
10814
    function AddMesh (lpD3DRMMesh: IDirect3DRMMesh) : HResult; stdcall;
10807
    function AddMeshBuilder (
10815
    function AddMeshBuilder (
10808
        lpD3DRMMeshBuild: IDirect3DRMMeshBuilder3) : HResult; stdcall;
10816
        lpD3DRMMeshBuild: IDirect3DRMMeshBuilder3) : HResult; stdcall;
10809
    function AddFrame (lpD3DRMFrame: IDirect3DRMFrame3) : HResult; stdcall;
10817
    function AddFrame (lpD3DRMFrame: IDirect3DRMFrame3) : HResult; stdcall;
10810
    function AddFace (lpD3DRMFace: IDirect3DRMFace2) : HResult; stdcall;
10818
    function AddFace (lpD3DRMFace: IDirect3DRMFace2) : HResult; stdcall;
10811
    function AddFaces (dwVertexCount: DWORD; const lpD3DVertices: TD3DVector;
10819
    function AddFaces (dwVertexCount: DWORD; const lpD3DVertices: TD3DVector;
10812
        normalCount: DWORD; lpNormals: PD3DVector; var lpFaceData: DWORD;
10820
        normalCount: DWORD; lpNormals: PD3DVector; var lpFaceData: DWORD;
10813
        lplpD3DRMFaceArray: PIDirect3DRMFaceArray) : HResult; stdcall;
10821
        lplpD3DRMFaceArray: PIDirect3DRMFaceArray) : HResult; stdcall;
10814
    function ReserveSpace (vertexCount, normalCount, faceCount: DWORD) : HResult; stdcall;
10822
    function ReserveSpace (vertexCount, normalCount, faceCount: DWORD) : HResult; stdcall;
10815
    function SetColorRGB (red, green, blue: TD3DValue) : HResult; stdcall;
10823
    function SetColorRGB (red, green, blue: TD3DValue) : HResult; stdcall;
10816
    function SetColor (color: TD3DColor) : HResult; stdcall;
10824
    function SetColor (color: TD3DColor) : HResult; stdcall;
10817
    function SetTexture (lpD3DRMTexture: IDirect3DRMTexture3) : HResult; stdcall;
10825
    function SetTexture (lpD3DRMTexture: IDirect3DRMTexture3) : HResult; stdcall;
10818
    function SetMaterial (lpIDirect3DRMmaterial: IDirect3DRMMaterial2) : HResult; stdcall;
10826
    function SetMaterial (lpIDirect3DRMmaterial: IDirect3DRMMaterial2) : HResult; stdcall;
10819
    function SetTextureTopology (cylU, cylV: BOOL) : HResult; stdcall;
10827
    function SetTextureTopology (cylU, cylV: BOOL) : HResult; stdcall;
10820
    function SetQuality (quality: TD3DRMRenderQuality) : HResult; stdcall;
10828
    function SetQuality (quality: TD3DRMRenderQuality) : HResult; stdcall;
10821
    function SetPerspective (perspective: BOOL) : HResult; stdcall;
10829
    function SetPerspective (perspective: BOOL) : HResult; stdcall;
10822
    function SetVertex (index: DWORD; x, y, z: TD3DValue) : HResult; stdcall;
10830
    function SetVertex (index: DWORD; x, y, z: TD3DValue) : HResult; stdcall;
10823
    function SetNormal (index: DWORD; x, y, z: TD3DValue) : HResult; stdcall;
10831
    function SetNormal (index: DWORD; x, y, z: TD3DValue) : HResult; stdcall;
10824
    function SetTextureCoordinates (index: DWORD; u, v: TD3DValue) : HResult; stdcall;
10832
    function SetTextureCoordinates (index: DWORD; u, v: TD3DValue) : HResult; stdcall;
10825
    function SetVertexColor (index: DWORD; color: TD3DColor) : HResult; stdcall;
10833
    function SetVertexColor (index: DWORD; color: TD3DColor) : HResult; stdcall;
10826
    function SetVertexColorRGB (index: DWORD; red, green, blue: TD3DValue) : HResult; stdcall;
10834
    function SetVertexColorRGB (index: DWORD; red, green, blue: TD3DValue) : HResult; stdcall;
10827
    function GetFaces (out lplpD3DRMFaceArray: IDirect3DRMFaceArray) : HResult; stdcall;
10835
    function GetFaces (out lplpD3DRMFaceArray: IDirect3DRMFaceArray) : HResult; stdcall;
10828
    function GetGeometry (var vcount: DWORD; var vertices : TD3DVector;
10836
    function GetGeometry (var vcount: DWORD; var vertices : TD3DVector;
10829
        var ncount : DWORD; var normals : TD3DVector;
10837
        var ncount : DWORD; var normals : TD3DVector;
10830
        var face_data_size, face_data : DWORD) : HResult; stdcall;
10838
        var face_data_size, face_data : DWORD) : HResult; stdcall;
10831
    function GetTextureCoordinates(index : DWORD; out u, v : TD3DValue) : HResult; stdcall;
10839
    function GetTextureCoordinates(index : DWORD; out u, v : TD3DValue) : HResult; stdcall;
10832
    function AddVertex (x, y, z: TD3DValue) : Integer; stdcall;
10840
    function AddVertex (x, y, z: TD3DValue) : Integer; stdcall;
10833
    function AddNormal (x, y, z: TD3DValue) : Integer; stdcall;
10841
    function AddNormal (x, y, z: TD3DValue) : Integer; stdcall;
10834
    function CreateFace (out lplpd3drmFace: IDirect3DRMFace2) : HResult; stdcall;
10842
    function CreateFace (out lplpd3drmFace: IDirect3DRMFace2) : HResult; stdcall;
10835
    function GetQuality: TD3DRMRenderQuality; stdcall;
10843
    function GetQuality: TD3DRMRenderQuality; stdcall;
10836
    function GetPerspective: BOOL; stdcall;
10844
    function GetPerspective: BOOL; stdcall;
10837
    function GetFaceCount: Integer; stdcall;
10845
    function GetFaceCount: Integer; stdcall;
10838
    function GetVertexCount: Integer; stdcall;
10846
    function GetVertexCount: Integer; stdcall;
10839
    function GetVertexColor (index: DWORD) : TD3DColor; stdcall;
10847
    function GetVertexColor (index: DWORD) : TD3DColor; stdcall;
10840
    function CreateMesh (out lplpD3DRMMesh: IDirect3DRMMesh) : HResult; stdcall;
10848
    function CreateMesh (out lplpD3DRMMesh: IDirect3DRMMesh) : HResult; stdcall;
10841
    function GetFace
10849
    function GetFace
10842
        (dwIndex: DWORD; lplpD3DRMFace: IDirect3DRMFace) : HResult; stdcall;
10850
        (dwIndex: DWORD; lplpD3DRMFace: IDirect3DRMFace) : HResult; stdcall;
10843
    function GetVertex (dwIndex: DWORD; out lpVector: TD3DVector) : HResult; stdcall;
10851
    function GetVertex (dwIndex: DWORD; out lpVector: TD3DVector) : HResult; stdcall;
10844
    function GetNormal (dwIndex: DWORD; out lpVector: TD3DVector) : HResult; stdcall;
10852
    function GetNormal (dwIndex: DWORD; out lpVector: TD3DVector) : HResult; stdcall;
10845
    function DeleteVertices (dwFirstIndex, dwCount: DWORD) : HResult; stdcall;
10853
    function DeleteVertices (dwFirstIndex, dwCount: DWORD) : HResult; stdcall;
10846
    function DeleteNormals (dwFirstIndex, dwCount: DWORD) : HResult; stdcall;
10854
    function DeleteNormals (dwFirstIndex, dwCount: DWORD) : HResult; stdcall;
10847
    function DeleteFace (lpFace: IDirect3DRMFace2) : HResult; stdcall;
10855
    function DeleteFace (lpFace: IDirect3DRMFace2) : HResult; stdcall;
10848
    function Empty (dwFlags: DWORD) : HResult; stdcall;
10856
    function Empty (dwFlags: DWORD) : HResult; stdcall;
10849
    function Optimize (dwFlags: DWORD) : HResult; stdcall;
10857
    function Optimize (dwFlags: DWORD) : HResult; stdcall;
10850
    function AddFacesIndexed (dwFlags: DWORD; var lpdwvIndices: DWORD;
10858
    function AddFacesIndexed (dwFlags: DWORD; var lpdwvIndices: DWORD;
10851
        lpdwIndexFirst, lpdwCount: PDWORD) : HResult; stdcall;
10859
        lpdwIndexFirst, lpdwCount: PDWORD) : HResult; stdcall;
10852
    function CreateSubMesh (out lplpUnk: IUnknown) : HResult; stdcall;
10860
    function CreateSubMesh (out lplpUnk: IUnknown) : HResult; stdcall;
10853
    function GetParentMesh (dwFlags: DWORD; out lplpUnk: IUnknown) : HResult; stdcall;
10861
    function GetParentMesh (dwFlags: DWORD; out lplpUnk: IUnknown) : HResult; stdcall;
10854
    function GetSubMeshes (lpdwCount: PDWORD; lpUnk: IUnknown) : HResult; stdcall;
10862
    function GetSubMeshes (lpdwCount: PDWORD; lpUnk: IUnknown) : HResult; stdcall;
10855
    function DeleteSubMesh (lplpUnk: IUnknown) : HResult; stdcall;
10863
    function DeleteSubMesh (lplpUnk: IUnknown) : HResult; stdcall;
10856
    function Enable (dwFlags: DWORD) : HResult; stdcall;
10864
    function Enable (dwFlags: DWORD) : HResult; stdcall;
10857
    function GetEnable (out lpdwFlags: DWORD) : HResult; stdcall;
10865
    function GetEnable (out lpdwFlags: DWORD) : HResult; stdcall;
10858
    function AddTriangles (dwFlags, dwFormat, dwVertexCount:  DWORD;
10866
    function AddTriangles (dwFlags, dwFormat, dwVertexCount:  DWORD;
10859
        lpData: pointer) : HResult; stdcall;
10867
        lpData: pointer) : HResult; stdcall;
10860
    function SetVertices
10868
    function SetVertices
10861
        (dwFirst, dwCount: DWORD; const lpdvVector: TD3DVector) : HResult; stdcall;
10869
        (dwFirst, dwCount: DWORD; const lpdvVector: TD3DVector) : HResult; stdcall;
10862
    function GetVertices(dwFirst: DWORD; var lpdwCount: DWORD;
10870
    function GetVertices(dwFirst: DWORD; var lpdwCount: DWORD;
10863
        lpdvVector: PD3DVector) : HResult; stdcall;
10871
        lpdvVector: PD3DVector) : HResult; stdcall;
10864
    function SetNormals(dwFirst, dwCount: DWORD; const lpdvVector: TD3DVector) : HResult; stdcall;
10872
    function SetNormals(dwFirst, dwCount: DWORD; const lpdvVector: TD3DVector) : HResult; stdcall;
10865
    function GetNormals (dwFirst: DWORD; lpdwCount: PDWORD;
10873
    function GetNormals (dwFirst: DWORD; lpdwCount: PDWORD;
10866
        var lpdvVector: TD3DVector) : HResult; stdcall;
10874
        var lpdvVector: TD3DVector) : HResult; stdcall;
10867
    function GetNormalCount : integer; stdcall;
10875
    function GetNormalCount : integer; stdcall;
10868
  end;
10876
  end;
10869
 
10877
 
10870
  IDirect3DRMLight = interface (IDirect3DRMObject)
10878
  IDirect3DRMLight = interface (IDirect3DRMObject)
10871
    ['{eb16cb08-d271-11ce-ac48-0000c03825a1}']
10879
    ['{eb16cb08-d271-11ce-ac48-0000c03825a1}']
10872
    (*
10880
    (*
10873
     * IDirect3DRMLight methods
10881
     * IDirect3DRMLight methods
10874
     *)
10882
     *)
10875
    function SetType (d3drmtType: TD3DRMLightType) : HResult; stdcall;
10883
    function SetType (d3drmtType: TD3DRMLightType) : HResult; stdcall;
10876
    function SetColor (rcColor: TD3DColor) : HResult; stdcall;
10884
    function SetColor (rcColor: TD3DColor) : HResult; stdcall;
10877
    function SetColorRGB (rvRed, rvGreen, rvBlue: TD3DValue) : HResult; stdcall;
10885
    function SetColorRGB (rvRed, rvGreen, rvBlue: TD3DValue) : HResult; stdcall;
10878
    function SetRange (rvRange: TD3DValue) : HResult; stdcall;
10886
    function SetRange (rvRange: TD3DValue) : HResult; stdcall;
10879
    function SetUmbra (rvAngle: TD3DValue) : HResult; stdcall;
10887
    function SetUmbra (rvAngle: TD3DValue) : HResult; stdcall;
10880
    function SetPenumbra (rvAngle: TD3DValue) : HResult; stdcall;
10888
    function SetPenumbra (rvAngle: TD3DValue) : HResult; stdcall;
10881
    function SetConstantAttenuation (rvAtt: TD3DValue) : HResult; stdcall;
10889
    function SetConstantAttenuation (rvAtt: TD3DValue) : HResult; stdcall;
10882
    function SetLinearAttenuation (rvAtt: TD3DValue) : HResult; stdcall;
10890
    function SetLinearAttenuation (rvAtt: TD3DValue) : HResult; stdcall;
10883
    function SetQuadraticAttenuation (rvAtt: TD3DValue) : HResult; stdcall;
10891
    function SetQuadraticAttenuation (rvAtt: TD3DValue) : HResult; stdcall;
10884
    function GetRange: TD3DValue; stdcall;
10892
    function GetRange: TD3DValue; stdcall;
10885
    function GetUmbra: TD3DValue; stdcall;
10893
    function GetUmbra: TD3DValue; stdcall;
10886
    function GetPenumbra: TD3DValue; stdcall;
10894
    function GetPenumbra: TD3DValue; stdcall;
10887
    function GetConstantAttenuation: TD3DValue; stdcall;
10895
    function GetConstantAttenuation: TD3DValue; stdcall;
10888
    function GetLinearAttenuation: TD3DValue; stdcall;
10896
    function GetLinearAttenuation: TD3DValue; stdcall;
10889
    function GetQuadraticAttenuation: TD3DValue; stdcall;
10897
    function GetQuadraticAttenuation: TD3DValue; stdcall;
10890
    function GetColor: TD3DColor; stdcall;
10898
    function GetColor: TD3DColor; stdcall;
10891
    function GetType: TD3DRMLightType; stdcall;
10899
    function GetType: TD3DRMLightType; stdcall;
10892
    function SetEnableFrame (lpEnableFrame: IDirect3DRMFrame) : HResult; stdcall;
10900
    function SetEnableFrame (lpEnableFrame: IDirect3DRMFrame) : HResult; stdcall;
10893
    function GetEnableFrame (out lplpEnableFrame: IDirect3DRMFrame) : HResult; stdcall;
10901
    function GetEnableFrame (out lplpEnableFrame: IDirect3DRMFrame) : HResult; stdcall;
10894
  end;
10902
  end;
10895
 
10903
 
10896
  IDirect3DRMTexture = interface (IDirect3DRMVisual)
10904
  IDirect3DRMTexture = interface (IDirect3DRMVisual)
10897
    ['{eb16cb09-d271-11ce-ac48-0000c03825a1}']
10905
    ['{eb16cb09-d271-11ce-ac48-0000c03825a1}']
10898
    (*
10906
    (*
10899
     * IDirect3DRMTexture methods
10907
     * IDirect3DRMTexture methods
10900
     *)
10908
     *)
10901
    function InitFromFile (filename: PAnsiChar) : HResult; stdcall;
10909
    function InitFromFile (filename: PAnsiChar) : HResult; stdcall;
10902
    function InitFromSurface (lpDDS: IDirectDrawSurface) : HResult; stdcall;
10910
    function InitFromSurface (lpDDS: IDirectDrawSurface) : HResult; stdcall;
10903
    function InitFromResource (rs: HRSRC) : HResult; stdcall;
10911
    function InitFromResource (rs: HRSRC) : HResult; stdcall;
10904
    function Changed (bPixels, bPalette: BOOL) : HResult; stdcall;
10912
    function Changed (bPixels, bPalette: BOOL) : HResult; stdcall;
10905
    function SetColors (ulColors: DWORD) : HResult; stdcall;
10913
    function SetColors (ulColors: DWORD) : HResult; stdcall;
10906
    function SetShades (ulShades: DWORD) : HResult; stdcall;
10914
    function SetShades (ulShades: DWORD) : HResult; stdcall;
10907
    function SetDecalSize (rvWidth, rvHeight: TD3DValue) : HResult; stdcall;
10915
    function SetDecalSize (rvWidth, rvHeight: TD3DValue) : HResult; stdcall;
10908
    function SetDecalOrigin (lX, lY: LongInt) : HResult; stdcall;
10916
    function SetDecalOrigin (lX, lY: LongInt) : HResult; stdcall;
10909
    function SetDecalScale (dwScale: DWORD) : HResult; stdcall;
10917
    function SetDecalScale (dwScale: DWORD) : HResult; stdcall;
10910
    function SetDecalTransparency (bTransp: BOOL) : HResult; stdcall;
10918
    function SetDecalTransparency (bTransp: BOOL) : HResult; stdcall;
10911
    function SetDecalTransparentColor (rcTransp: TD3DColor) : HResult; stdcall;
10919
    function SetDecalTransparentColor (rcTransp: TD3DColor) : HResult; stdcall;
10912
    function GetDecalSize (out lprvWidth, lprvHeight: TD3DValue) : HResult; stdcall;
10920
    function GetDecalSize (out lprvWidth, lprvHeight: TD3DValue) : HResult; stdcall;
10913
    function GetDecalOrigin (out lplX, lplY: LongInt) : HResult; stdcall;
10921
    function GetDecalOrigin (out lplX, lplY: LongInt) : HResult; stdcall;
10914
    function GetImage: PD3DRMImage; stdcall;
10922
    function GetImage: PD3DRMImage; stdcall;
10915
    function GetShades: DWORD; stdcall;
10923
    function GetShades: DWORD; stdcall;
10916
    function GetColors: DWORD; stdcall;
10924
    function GetColors: DWORD; stdcall;
10917
    function GetDecalScale: DWORD; stdcall;
10925
    function GetDecalScale: DWORD; stdcall;
10918
    function GetDecalTransparency: BOOL; stdcall;
10926
    function GetDecalTransparency: BOOL; stdcall;
10919
    function GetDecalTransparentColor: TD3DColor; stdcall;
10927
    function GetDecalTransparentColor: TD3DColor; stdcall;
10920
  end;
10928
  end;
10921
 
10929
 
10922
  IDirect3DRMTexture2 = interface (IDirect3DRMTexture)
10930
  IDirect3DRMTexture2 = interface (IDirect3DRMTexture)
10923
    ['{120f30c0-1629-11d0-941c-0080c80cfa7b}']
10931
    ['{120f30c0-1629-11d0-941c-0080c80cfa7b}']
10924
    (*
10932
    (*
10925
     * IDirect3DRMTexture2 methods
10933
     * IDirect3DRMTexture2 methods
10926
     *)
10934
     *)
10927
    function InitFromImage (const lpImage: TD3DRMImage) : HResult; stdcall;
10935
    function InitFromImage (const lpImage: TD3DRMImage) : HResult; stdcall;
10928
    function InitFromResource2 (hModule: HModule;
10936
    function InitFromResource2 (hModule: HModule;
10929
        strName, strType: PAnsiChar) : HResult; stdcall;
10937
        strName, strType: PAnsiChar) : HResult; stdcall;
10930
    function GenerateMIPMap (dwFlags: DWORD) : HResult; stdcall;
10938
    function GenerateMIPMap (dwFlags: DWORD) : HResult; stdcall;
10931
  end;
10939
  end;
10932
 
10940
 
10933
  IDirect3DRMTexture3 = interface (IDirect3DRMTexture2)
10941
  IDirect3DRMTexture3 = interface (IDirect3DRMTexture2)
10934
    ['{ff6b7f73-a40e-11d1-91f9-0000f8758e66}']
10942
    ['{ff6b7f73-a40e-11d1-91f9-0000f8758e66}']
10935
    (*
10943
    (*
10936
     * IDirect3DRMTexture3 methods
10944
     * IDirect3DRMTexture3 methods
10937
     *)
10945
     *)
10938
    function GetSurface
10946
    function GetSurface
10939
        (dwFlags: DWORD; out lplpDDS: IDirectDrawSurface) : HResult; stdcall;
10947
        (dwFlags: DWORD; out lplpDDS: IDirectDrawSurface) : HResult; stdcall;
10940
    function SetCacheOptions (lImportance: integer; dwFlags: DWORD) : HResult; stdcall;
10948
    function SetCacheOptions (lImportance: integer; dwFlags: DWORD) : HResult; stdcall;
10941
    function GetCacheOptions (var lplImportance: integer; var lpdwFlags: DWORD) : HResult; stdcall;
10949
    function GetCacheOptions (var lplImportance: integer; var lpdwFlags: DWORD) : HResult; stdcall;
10942
    function SetDownsampleCallback (
10950
    function SetDownsampleCallback (
10943
        pCallback: TD3DRMDownSampleCallback; pArg: pointer) : HResult; stdcall;
10951
        pCallback: TD3DRMDownSampleCallback; pArg: pointer) : HResult; stdcall;
10944
    function SetValidationCallback (
10952
    function SetValidationCallback (
10945
        pCallback: TD3DRMValidationCallback; pArg: pointer) : HResult; stdcall;
10953
        pCallback: TD3DRMValidationCallback; pArg: pointer) : HResult; stdcall;
10946
  end;
10954
  end;
10947
 
10955
 
10948
  IDirect3DRMWrap = interface (IDirect3DRMObject)
10956
  IDirect3DRMWrap = interface (IDirect3DRMObject)
10949
    ['{eb16cb0a-d271-11ce-ac48-0000c03825a1}']
10957
    ['{eb16cb0a-d271-11ce-ac48-0000c03825a1}']
10950
    (*
10958
    (*
10951
     * IDirect3DRMWrap methods
10959
     * IDirect3DRMWrap methods
10952
     *)
10960
     *)
10953
    function Init (d3drmwt: TD3DRMWrapType; lpd3drmfRef: IDirect3DRMFrame;
10961
    function Init (d3drmwt: TD3DRMWrapType; lpd3drmfRef: IDirect3DRMFrame;
10954
        ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv: TD3DValue)
10962
        ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv: TD3DValue)
10955
        : HResult; stdcall;
10963
        : HResult; stdcall;
10956
    function Apply (lpObject: IDirect3DRMObject) : HResult; stdcall;
10964
    function Apply (lpObject: IDirect3DRMObject) : HResult; stdcall;
10957
    function ApplyRelative(frame: IDirect3DRMFrame; mesh: IDirect3DRMObject) : HResult; stdcall;
10965
    function ApplyRelative(frame: IDirect3DRMFrame; mesh: IDirect3DRMObject) : HResult; stdcall;
10958
  end;
10966
  end;
10959
 
10967
 
10960
  IDirect3DRMMaterial = interface (IDirect3DRMObject)
10968
  IDirect3DRMMaterial = interface (IDirect3DRMObject)
10961
    ['{eb16cb0b-d271-11ce-ac48-0000c03825a1}']
10969
    ['{eb16cb0b-d271-11ce-ac48-0000c03825a1}']
10962
    (*
10970
    (*
10963
     * IDirect3DRMMaterial methods
10971
     * IDirect3DRMMaterial methods
10964
     *)
10972
     *)
10965
    function SetPower (rvPower: TD3DValue) : HResult; stdcall;
10973
    function SetPower (rvPower: TD3DValue) : HResult; stdcall;
10966
    function SetSpecular (r, g, b: TD3DValue) : HResult; stdcall;
10974
    function SetSpecular (r, g, b: TD3DValue) : HResult; stdcall;
10967
    function SetEmissive (r, g, b: TD3DValue) : HResult; stdcall;
10975
    function SetEmissive (r, g, b: TD3DValue) : HResult; stdcall;
10968
    function GetPower: TD3DValue; stdcall;
10976
    function GetPower: TD3DValue; stdcall;
10969
    function GetSpecular (out lpr, lpg, lpb: TD3DValue) : HResult; stdcall;
10977
    function GetSpecular (out lpr, lpg, lpb: TD3DValue) : HResult; stdcall;
10970
    function GetEmissive (out lpr, lpg, lpb: TD3DValue) : HResult; stdcall;
10978
    function GetEmissive (out lpr, lpg, lpb: TD3DValue) : HResult; stdcall;
10971
  end;
10979
  end;
10972
 
10980
 
10973
  IDirect3DRMMaterial2 = interface (IDirect3DRMMaterial)
10981
  IDirect3DRMMaterial2 = interface (IDirect3DRMMaterial)
10974
    ['{ff6b7f75-a40e-11d1-91f9-0000f8758e66}']
10982
    ['{ff6b7f75-a40e-11d1-91f9-0000f8758e66}']
10975
    (*
10983
    (*
10976
     * IDirect3DRMMaterial2 methods
10984
     * IDirect3DRMMaterial2 methods
10977
     *)
10985
     *)
10978
    function GetAmbient(out r,g,b: TD3DValue) : HResult; stdcall;
10986
    function GetAmbient(out r,g,b: TD3DValue) : HResult; stdcall;
10979
    function SetAmbient(r,g,b: TD3DValue) : HResult; stdcall;
10987
    function SetAmbient(r,g,b: TD3DValue) : HResult; stdcall;
10980
  end;
10988
  end;
10981
 
10989
 
10982
  IDirect3DRMAnimation = interface (IDirect3DRMObject)
10990
  IDirect3DRMAnimation = interface (IDirect3DRMObject)
10983
    ['{eb16cb0d-d271-11ce-ac48-0000c03825a1}']
10991
    ['{eb16cb0d-d271-11ce-ac48-0000c03825a1}']
10984
    (*
10992
    (*
10985
     * IDirect3DRMAnimation methods
10993
     * IDirect3DRMAnimation methods
10986
     *)
10994
     *)
10987
    function SetOptions (d3drmanimFlags: TD3DRMAnimationOptions) : HResult; stdcall;
10995
    function SetOptions (d3drmanimFlags: TD3DRMAnimationOptions) : HResult; stdcall;
10988
    function AddRotateKey (rvTime: TD3DValue; const rqQuat: TD3DRMQuaternion) : HResult; stdcall;
10996
    function AddRotateKey (rvTime: TD3DValue; const rqQuat: TD3DRMQuaternion) : HResult; stdcall;
10989
    function AddPositionKey (rvTime, rvX, rvY, rvZ: TD3DValue) : HResult; stdcall;
10997
    function AddPositionKey (rvTime, rvX, rvY, rvZ: TD3DValue) : HResult; stdcall;
10990
    function AddScaleKey (time, x, y, z: TD3DValue) : HResult; stdcall;
10998
    function AddScaleKey (time, x, y, z: TD3DValue) : HResult; stdcall;
10991
    function DeleteKey (time: TD3DValue) : HResult; stdcall;
10999
    function DeleteKey (time: TD3DValue) : HResult; stdcall;
10992
    function SetFrame (lpD3DRMFrame: IDirect3DRMFrame) : HResult; stdcall;
11000
    function SetFrame (lpD3DRMFrame: IDirect3DRMFrame) : HResult; stdcall;
10993
    function SetTime (rvTime: TD3DValue) : HResult; stdcall;
11001
    function SetTime (rvTime: TD3DValue) : HResult; stdcall;
10994
    function GetOptions: TD3DRMAnimationOptions; stdcall;
11002
    function GetOptions: TD3DRMAnimationOptions; stdcall;
10995
  end;
11003
  end;
10996
 
11004
 
10997
  IDirect3DRMAnimation2 = interface (IDirect3DRMAnimation)
11005
  IDirect3DRMAnimation2 = interface (IDirect3DRMAnimation)
10998
    ['{ff6b7f77-a40e-11d1-91f9-0000f8758e66}']
11006
    ['{ff6b7f77-a40e-11d1-91f9-0000f8758e66}']
10999
    (*
11007
    (*
11000
     * IDirect3DRMAnimation methods
11008
     * IDirect3DRMAnimation methods
11001
     *)
11009
     *)
11002
    function GetFrame (out lpD3DFrame: IDirect3DRMFrame3) : HResult; stdcall;
11010
    function GetFrame (out lpD3DFrame: IDirect3DRMFrame3) : HResult; stdcall;
11003
    function DeleteKeyByID (dwID: DWORD) : HResult; stdcall;
11011
    function DeleteKeyByID (dwID: DWORD) : HResult; stdcall;
11004
    function AddKey (const lpKey: TD3DRMAnimationKey) : HResult; stdcall;
11012
    function AddKey (const lpKey: TD3DRMAnimationKey) : HResult; stdcall;
11005
    function ModifyKey (const lpKey: TD3DRMAnimationKey) : HResult; stdcall;
11013
    function ModifyKey (const lpKey: TD3DRMAnimationKey) : HResult; stdcall;
11006
    function GetKeys (dvTimeMin, dvTimeMax: TD3DValue; var lpdwNumKeys: DWORD;
11014
    function GetKeys (dvTimeMin, dvTimeMax: TD3DValue; var lpdwNumKeys: DWORD;
11007
        lpKey: PD3DRMAnimationKey) : HResult; stdcall;
11015
        lpKey: PD3DRMAnimationKey) : HResult; stdcall;
11008
  end;
11016
  end;
11009
 
11017
 
11010
  IDirect3DRMAnimationSet = interface (IDirect3DRMObject)
11018
  IDirect3DRMAnimationSet = interface (IDirect3DRMObject)
11011
    ['{eb16cb0e-d271-11ce-ac48-0000c03825a1}']
11019
    ['{eb16cb0e-d271-11ce-ac48-0000c03825a1}']
11012
    (*
11020
    (*
11013
     * IDirect3DRMAnimationSet methods
11021
     * IDirect3DRMAnimationSet methods
11014
     *)
11022
     *)
11015
    function AddAnimation (lpD3DRMAnimation: IDirect3DRMAnimation) : HResult; stdcall;
11023
    function AddAnimation (lpD3DRMAnimation: IDirect3DRMAnimation) : HResult; stdcall;
11016
    function Load (lpvObjSource, lpvObjID: Pointer;
11024
    function Load (lpvObjSource, lpvObjID: Pointer;
11017
        d3drmLOFlags: TD3DRMLoadOptions;
11025
        d3drmLOFlags: TD3DRMLoadOptions;
11018
        d3drmLoadTextureProc: TD3DRMLoadTextureCallback; lpArgLTP: Pointer;
11026
        d3drmLoadTextureProc: TD3DRMLoadTextureCallback; lpArgLTP: Pointer;
11019
        lpParentFrame: IDirect3DRMFrame) : HResult; stdcall;
11027
        lpParentFrame: IDirect3DRMFrame) : HResult; stdcall;
11020
    function DeleteAnimation (lpD3DRMAnimation: IDirect3DRMAnimation) : HResult; stdcall;
11028
    function DeleteAnimation (lpD3DRMAnimation: IDirect3DRMAnimation) : HResult; stdcall;
11021
    function SetTime (rvTime: TD3DValue) : HResult; stdcall;
11029
    function SetTime (rvTime: TD3DValue) : HResult; stdcall;
11022
  end;
11030
  end;
11023
 
11031
 
11024
  IDirect3DRMAnimationSet2 = interface (IDirect3DRMObject)
11032
  IDirect3DRMAnimationSet2 = interface (IDirect3DRMObject)
11025
    ['{ff6b7f79-a40e-11d1-91f9-0000f8758e66}']
11033
    ['{ff6b7f79-a40e-11d1-91f9-0000f8758e66}']
11026
    (*
11034
    (*
11027
     * IDirect3DRMAnimationSet methods
11035
     * IDirect3DRMAnimationSet methods
11028
     *)
11036
     *)
11029
    function AddAnimation (lpD3DRMAnimation: IDirect3DRMAnimation2) : HResult; stdcall;
11037
    function AddAnimation (lpD3DRMAnimation: IDirect3DRMAnimation2) : HResult; stdcall;
11030
    function Load (lpvObjSource, lpvObjID: Pointer;
11038
    function Load (lpvObjSource, lpvObjID: Pointer;
11031
        d3drmLOFlags: TD3DRMLoadOptions;
11039
        d3drmLOFlags: TD3DRMLoadOptions;
11032
        d3drmLoadTextureProc: TD3DRMLoadTexture3Callback; lpArgLTP: Pointer;
11040
        d3drmLoadTextureProc: TD3DRMLoadTexture3Callback; lpArgLTP: Pointer;
11033
        lpParentFrame: IDirect3DRMFrame3) : HResult; stdcall;
11041
        lpParentFrame: IDirect3DRMFrame3) : HResult; stdcall;
11034
    function DeleteAnimation (lpD3DRMAnimation: IDirect3DRMAnimation2) : HResult; stdcall;
11042
    function DeleteAnimation (lpD3DRMAnimation: IDirect3DRMAnimation2) : HResult; stdcall;
11035
    function SetTime (rvTime: TD3DValue) : HResult; stdcall;
11043
    function SetTime (rvTime: TD3DValue) : HResult; stdcall;
11036
    function GetAnimations(out lplpArray: IDirect3DRMAnimationArray) : HResult; stdcall;
11044
    function GetAnimations(out lplpArray: IDirect3DRMAnimationArray) : HResult; stdcall;
11037
  end;
11045
  end;
11038
 
11046
 
11039
  IDirect3DRMUserVisual = interface (IDirect3DRMVisual)
11047
  IDirect3DRMUserVisual = interface (IDirect3DRMVisual)
11040
    ['{59163de0-6d43-11cf-ac4a-0000c03825a1}']
11048
    ['{59163de0-6d43-11cf-ac4a-0000c03825a1}']
11041
    (*
11049
    (*
11042
     * IDirect3DRMUserVisual methods
11050
     * IDirect3DRMUserVisual methods
11043
     *)
11051
     *)
11044
    function Init (d3drmUVProc: TD3DRMUserVisualCallback;
11052
    function Init (d3drmUVProc: TD3DRMUserVisualCallback;
11045
        lpArg: Pointer) : HResult; stdcall;
11053
        lpArg: Pointer) : HResult; stdcall;
11046
  end;
11054
  end;
11047
 
11055
 
11048
  IDirect3DRMArray = interface (IUnknown)
11056
  IDirect3DRMArray = interface (IUnknown)
11049
    function GetSize: DWORD; stdcall;
11057
    function GetSize: DWORD; stdcall;
11050
    (* No GetElement method as it would get overloaded
11058
    (* No GetElement method as it would get overloaded
11051
     * in derived classes, and overloading is
11059
     * in derived classes, and overloading is
11052
     * a no-no in COM
11060
     * a no-no in COM
11053
     *)
11061
     *)
11054
  end;
11062
  end;
11055
 
11063
 
11056
  IDirect3DRMObjectArray = interface (IDirect3DRMArray)
11064
  IDirect3DRMObjectArray = interface (IDirect3DRMArray)
11057
        ['{242f6bc2-3849-11d0-9b6d-0000c0781bc3}']
11065
        ['{242f6bc2-3849-11d0-9b6d-0000c0781bc3}']
11058
    function GetElement (index: DWORD; out lplpD3DRMObject:
11066
    function GetElement (index: DWORD; out lplpD3DRMObject:
11059
        IDirect3DRMObject) : HResult; stdcall;
11067
        IDirect3DRMObject) : HResult; stdcall;
11060
  end;
11068
  end;
11061
 
11069
 
11062
  IDirect3DRMDeviceArray = interface (IDirect3DRMArray)
11070
  IDirect3DRMDeviceArray = interface (IDirect3DRMArray)
11063
    ['{eb16cb0e-d271-11ce-ac48-0000c03825a1}']
11071
    ['{eb16cb0e-d271-11ce-ac48-0000c03825a1}']
11064
    function GetElement (index: DWORD; out lplpD3DRMDevice:
11072
    function GetElement (index: DWORD; out lplpD3DRMDevice:
11065
        IDirect3DRMDevice) : HResult; stdcall;
11073
        IDirect3DRMDevice) : HResult; stdcall;
11066
  end;
11074
  end;
11067
 
11075
 
11068
  IDirect3DRMFrameArray = interface (IDirect3DRMArray)
11076
  IDirect3DRMFrameArray = interface (IDirect3DRMArray)
11069
    ['{eb16cb12-d271-11ce-ac48-0000c03825a1}']
11077
    ['{eb16cb12-d271-11ce-ac48-0000c03825a1}']
11070
    function GetElement (index: DWORD; out lplpD3DRMFrame: IDirect3DRMFrame) : HResult; stdcall;
11078
    function GetElement (index: DWORD; out lplpD3DRMFrame: IDirect3DRMFrame) : HResult; stdcall;
11071
  end;
11079
  end;
11072
 
11080
 
11073
  IDirect3DRMViewportArray = interface (IDirect3DRMArray)
11081
  IDirect3DRMViewportArray = interface (IDirect3DRMArray)
11074
    ['{eb16cb11-d271-11ce-ac48-0000c03825a1}']
11082
    ['{eb16cb11-d271-11ce-ac48-0000c03825a1}']
11075
    function GetElement (index: DWORD; out lplpD3DRMViewport:
11083
    function GetElement (index: DWORD; out lplpD3DRMViewport:
11076
        IDirect3DRMViewport) : HResult; stdcall;
11084
        IDirect3DRMViewport) : HResult; stdcall;
11077
  end;
11085
  end;
11078
 
11086
 
11079
  IDirect3DRMVisualArray = interface (IDirect3DRMArray)
11087
  IDirect3DRMVisualArray = interface (IDirect3DRMArray)
11080
    ['{eb16cb13-d271-11ce-ac48-0000c03825a1}']
11088
    ['{eb16cb13-d271-11ce-ac48-0000c03825a1}']
11081
    function GetElement (index: DWORD; out lplpD3DRMVisual:
11089
    function GetElement (index: DWORD; out lplpD3DRMVisual:
11082
        IDirect3DRMVisual) : HResult; stdcall;
11090
        IDirect3DRMVisual) : HResult; stdcall;
11083
  end;
11091
  end;
11084
 
11092
 
11085
  IDirect3DRMAnimationArray = interface (IDirect3DRMArray)
11093
  IDirect3DRMAnimationArray = interface (IDirect3DRMArray)
11086
    ['{d5f1cae0-4bd7-11d1-b974-0060083e45f3}']
11094
    ['{d5f1cae0-4bd7-11d1-b974-0060083e45f3}']
11087
    function GetElement (index: DWORD; out lplpD3DRMAnimation2:
11095
    function GetElement (index: DWORD; out lplpD3DRMAnimation2:
11088
        IDirect3DRMAnimation2) : HResult; stdcall;
11096
        IDirect3DRMAnimation2) : HResult; stdcall;
11089
  end;
11097
  end;
11090
 
11098
 
11091
  IDirect3DRMPickedArray = interface (IDirect3DRMArray)
11099
  IDirect3DRMPickedArray = interface (IDirect3DRMArray)
11092
    ['{eb16cb16-d271-11ce-ac48-0000c03825a1}']
11100
    ['{eb16cb16-d271-11ce-ac48-0000c03825a1}']
11093
    function GetPick (index: DWORD; out lplpVisual: IDirect3DRMVisual;
11101
    function GetPick (index: DWORD; out lplpVisual: IDirect3DRMVisual;
11094
        out lplpFrameArray: IDirect3DRMFrameArray;
11102
        out lplpFrameArray: IDirect3DRMFrameArray;
11095
        const lpD3DRMPickDesc: TD3DRMPickDesc) : HResult; stdcall;
11103
        const lpD3DRMPickDesc: TD3DRMPickDesc) : HResult; stdcall;
11096
 
11104
 
11097
  end;
11105
  end;
11098
 
11106
 
11099
  IDirect3DRMLightArray = interface (IDirect3DRMArray)
11107
  IDirect3DRMLightArray = interface (IDirect3DRMArray)
11100
    ['{eb16cb14-d271-11ce-ac48-0000c03825a1}']
11108
    ['{eb16cb14-d271-11ce-ac48-0000c03825a1}']
11101
    function GetElement (index: DWORD; out lplpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
11109
    function GetElement (index: DWORD; out lplpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
11102
  end;
11110
  end;
11103
 
11111
 
11104
 
11112
 
11105
  IDirect3DRMFaceArray = interface (IDirect3DRMArray)
11113
  IDirect3DRMFaceArray = interface (IDirect3DRMArray)
11106
    ['{eb16cb17-d271-11ce-ac48-0000c03825a1}']
11114
    ['{eb16cb17-d271-11ce-ac48-0000c03825a1}']
11107
    function GetElement (index: DWORD; out lplpD3DRMFace: IDirect3DRMFace) : HResult; stdcall;
11115
    function GetElement (index: DWORD; out lplpD3DRMFace: IDirect3DRMFace) : HResult; stdcall;
11108
  end;
11116
  end;
11109
 
11117
 
11110
  IDirect3DRMPicked2Array = interface (IDirect3DRMArray)
11118
  IDirect3DRMPicked2Array = interface (IDirect3DRMArray)
11111
    ['{4516ec7b-8f20-11d0-9b6d-0000c0781bc3}']
11119
    ['{4516ec7b-8f20-11d0-9b6d-0000c0781bc3}']
11112
    function GetPick (index: DWORD; out lplpVisual: IDirect3DRMVisual;
11120
    function GetPick (index: DWORD; out lplpVisual: IDirect3DRMVisual;
11113
        out lplpFrameArray: IDirect3DRMFrameArray; const lpD3DRMPickDesc2:
11121
        out lplpFrameArray: IDirect3DRMFrameArray; const lpD3DRMPickDesc2:
11114
        TD3DRMPickDesc2) : HResult; stdcall;
11122
        TD3DRMPickDesc2) : HResult; stdcall;
11115
  end;
11123
  end;
11116
 
11124
 
11117
  IDirect3DRMInterpolator = interface (IDirect3DRMObject)
11125
  IDirect3DRMInterpolator = interface (IDirect3DRMObject)
11118
    ['{242f6bc1-3849-11d0-9b6d-0000c0781bc3}']
11126
    ['{242f6bc1-3849-11d0-9b6d-0000c0781bc3}']
11119
    (*
11127
    (*
11120
     * IDirect3DRMInterpolator methods
11128
     * IDirect3DRMInterpolator methods
11121
     *)
11129
     *)
11122
    function AttachObject (lpD3DRMObject: IDirect3DRMObject) : HResult; stdcall;
11130
    function AttachObject (lpD3DRMObject: IDirect3DRMObject) : HResult; stdcall;
11123
    function GetAttachedObjects
11131
    function GetAttachedObjects
11124
        (lpD3DRMObjectArray: IDirect3DRMObjectArray) : HResult; stdcall;
11132
        (lpD3DRMObjectArray: IDirect3DRMObjectArray) : HResult; stdcall;
11125
    function DetachObject (lpD3DRMObject: IDirect3DRMObject) : HResult; stdcall;
11133
    function DetachObject (lpD3DRMObject: IDirect3DRMObject) : HResult; stdcall;
11126
    function SetIndex (d3dVal: TD3DValue) : HResult; stdcall;
11134
    function SetIndex (d3dVal: TD3DValue) : HResult; stdcall;
11127
    function GetIndex : TD3DValue; stdcall;
11135
    function GetIndex : TD3DValue; stdcall;
11128
    function Interpolate (d3dVal: TD3DValue; lpD3DRMObject: IDirect3DRMObject;
11136
    function Interpolate (d3dVal: TD3DValue; lpD3DRMObject: IDirect3DRMObject;
11129
        d3drmInterpFlags: TD3DRMInterpolationOptions) : HResult; stdcall;
11137
        d3drmInterpFlags: TD3DRMInterpolationOptions) : HResult; stdcall;
11130
  end;
11138
  end;
11131
 
11139
 
11132
  IDirect3DRMClippedVisual = interface (IDirect3DRMObject)
11140
  IDirect3DRMClippedVisual = interface (IDirect3DRMObject)
11133
    ['{5434e733-6d66-11d1-bb0b-0000f875865a}']
11141
    ['{5434e733-6d66-11d1-bb0b-0000f875865a}']
11134
    (*
11142
    (*
11135
     * IDirect3DRMClippedVisual methods
11143
     * IDirect3DRMClippedVisual methods
11136
     *)
11144
     *)
11137
    function Init (lpD3DRMVisual: IDirect3DRMVisual) : HResult; stdcall;
11145
    function Init (lpD3DRMVisual: IDirect3DRMVisual) : HResult; stdcall;
11138
    function AddPlane (lpRef: IDirect3DRMFrame3;
11146
    function AddPlane (lpRef: IDirect3DRMFrame3;
11139
        const lpdvPoint, lpdvNormal: TD3DVector;
11147
        const lpdvPoint, lpdvNormal: TD3DVector;
11140
        dwFlags: DWORD; out lpdwReturnID: DWORD) : HResult; stdcall;
11148
        dwFlags: DWORD; out lpdwReturnID: DWORD) : HResult; stdcall;
11141
    function DeletePlane (dwID, dwFlags: DWORD) : HResult; stdcall;
11149
    function DeletePlane (dwID, dwFlags: DWORD) : HResult; stdcall;
11142
    function GetPlaneIDs (var lpdwCount: DWORD; out lpdwID: DWORD; dwFlags: DWORD) : HResult; stdcall;
11150
    function GetPlaneIDs (var lpdwCount: DWORD; out lpdwID: DWORD; dwFlags: DWORD) : HResult; stdcall;
11143
    function GetPlane (dwID: DWORD; lpRef: IDirect3DRMFrame3;
11151
    function GetPlane (dwID: DWORD; lpRef: IDirect3DRMFrame3;
11144
        out lpdvPoint, lpdvNormal: TD3DVector; dwFlags: DWORD) : HResult; stdcall;
11152
        out lpdvPoint, lpdvNormal: TD3DVector; dwFlags: DWORD) : HResult; stdcall;
11145
    function SetPlane (dwID: DWORD; lpRef: IDirect3DRMFrame3;
11153
    function SetPlane (dwID: DWORD; lpRef: IDirect3DRMFrame3;
11146
        const lpdvPoint, lpdvNormal: TD3DVector; dwFlags: DWORD) : HResult; stdcall;
11154
        const lpdvPoint, lpdvNormal: TD3DVector; dwFlags: DWORD) : HResult; stdcall;
11147
  end;
11155
  end;
11148
 
11156
 
11149
(*==========================================================================;
11157
(*==========================================================================;
11150
 *
11158
 *
11151
 *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
11159
 *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
11152
 *
11160
 *
11153
 *  File:       d3drm.h
11161
 *  File:       d3drm.h
11154
 *  Content:    Direct3DRM include file
11162
 *  Content:    Direct3DRM include file
11155
 *
11163
 *
11156
 ***************************************************************************)
11164
 ***************************************************************************)
11157
 
11165
 
11158
function D3DRMErrorString(Value: HResult) : string;
11166
function D3DRMErrorString(Value: HResult) : string;
11159
 
11167
 
11160
//type
11168
//type
11161
  //TRefClsID = TGUID;
11169
  //TRefClsID = TGUID;
11162
 
11170
 
11163
type
11171
type
11164
  TD3DRMDevicePaletteCallback = procedure (lpDirect3DRMDev: IDirect3DRMDevice;
11172
  TD3DRMDevicePaletteCallback = procedure (lpDirect3DRMDev: IDirect3DRMDevice;
11165
      lpArg: Pointer; dwIndex: DWORD; red, green, blue: LongInt); cdecl;
11173
      lpArg: Pointer; dwIndex: DWORD; red, green, blue: LongInt); cdecl;
11166
 
11174
 
11167
(*
11175
(*
11168
 * Direct3DRM Object Class (for CoCreateInstance())
11176
 * Direct3DRM Object Class (for CoCreateInstance())
11169
 *)
11177
 *)
11170
const
11178
const
11171
  CLSID_CDirect3DRM: TGUID =
11179
  CLSID_CDirect3DRM: TGUID =
11172
      (D1:$4516ec41;D2:$8f20;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
11180
      (D1:$4516ec41;D2:$8f20;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
11173
 
11181
 
11174
type
11182
type
11175
  IDirect3DRM = interface (IUnknown)
11183
  IDirect3DRM = interface (IUnknown)
11176
    ['{2bc49361-8327-11cf-ac4a-0000c03825a1}']
11184
    ['{2bc49361-8327-11cf-ac4a-0000c03825a1}']
11177
    function CreateObject (const rclsid: TRefClsID; pUnkOuter: IUnknown;
11185
    function CreateObject (const rclsid: TRefClsID; pUnkOuter: IUnknown;
11178
        const riid: TGUID; out ppv) : HResult; stdcall;
11186
        const riid: TGUID; out ppv) : HResult; stdcall;
11179
    function CreateFrame (lpD3DRMFrame: IDirect3DRMFrame;
11187
    function CreateFrame (lpD3DRMFrame: IDirect3DRMFrame;
11180
        var lplpD3DRMFrame: IDirect3DRMFrame) : HResult; stdcall;
11188
        var lplpD3DRMFrame: IDirect3DRMFrame) : HResult; stdcall;
11181
    function CreateMesh (var lplpD3DRMMesh: IDirect3DRMMesh) : HResult; stdcall;
11189
    function CreateMesh (var lplpD3DRMMesh: IDirect3DRMMesh) : HResult; stdcall;
11182
    function CreateMeshBuilder (var lplpD3DRMMeshBuilder:
11190
    function CreateMeshBuilder (var lplpD3DRMMeshBuilder:
11183
        IDirect3DRMMeshBuilder) : HResult; stdcall;
11191
        IDirect3DRMMeshBuilder) : HResult; stdcall;
11184
    function CreateFace (var lplpd3drmFace: IDirect3DRMFace) : HResult; stdcall;
11192
    function CreateFace (var lplpd3drmFace: IDirect3DRMFace) : HResult; stdcall;
11185
    function CreateAnimation (var lplpD3DRMAnimation: IDirect3DRMAnimation) : HResult; stdcall;
11193
    function CreateAnimation (var lplpD3DRMAnimation: IDirect3DRMAnimation) : HResult; stdcall;
11186
    function CreateAnimationSet (var lplpD3DRMAnimationSet:
11194
    function CreateAnimationSet (var lplpD3DRMAnimationSet:
11187
        IDirect3DRMAnimationSet) : HResult; stdcall;
11195
        IDirect3DRMAnimationSet) : HResult; stdcall;
11188
    function CreateTexture (var lpImage: TD3DRMImage;
11196
    function CreateTexture (var lpImage: TD3DRMImage;
11189
        var lplpD3DRMTexture: IDirect3DRMTexture) : HResult; stdcall;
11197
        var lplpD3DRMTexture: IDirect3DRMTexture) : HResult; stdcall;
11190
    function CreateLight (d3drmltLightType: TD3DRMLightType;
11198
    function CreateLight (d3drmltLightType: TD3DRMLightType;
11191
        cColor: TD3DColor; var lplpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
11199
        cColor: TD3DColor; var lplpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
11192
    function CreateLightRGB (ltLightType: TD3DRMLightType; vRed,
11200
    function CreateLightRGB (ltLightType: TD3DRMLightType; vRed,
11193
        vGreen, vBlue: TD3DValue; var lplpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
11201
        vGreen, vBlue: TD3DValue; var lplpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
11194
    function CreateMaterial (vPower: TD3DValue; var lplpD3DRMMaterial:
11202
    function CreateMaterial (vPower: TD3DValue; var lplpD3DRMMaterial:
11195
        IDirect3DRMMaterial) : HResult; stdcall;
11203
        IDirect3DRMMaterial) : HResult; stdcall;
11196
    function CreateDevice (dwWidth, dwHeight: DWORD; var lplpD3DRMDevice:
11204
    function CreateDevice (dwWidth, dwHeight: DWORD; var lplpD3DRMDevice:
11197
        IDirect3DRMDevice) : HResult; stdcall;
11205
        IDirect3DRMDevice) : HResult; stdcall;
11198
 
11206
 
11199
    (* Create a Windows Device using DirectDraw surfaces *)
11207
    (* Create a Windows Device using DirectDraw surfaces *)
11200
    function CreateDeviceFromSurface (lpGUID: PGUID; lpDD: IDirectDraw;
11208
    function CreateDeviceFromSurface (lpGUID: PGUID; lpDD: IDirectDraw;
11201
        lpDDSBack: IDirectDrawSurface; var lplpD3DRMDevice: IDirect3DRMDevice) :
11209
        lpDDSBack: IDirectDrawSurface; var lplpD3DRMDevice: IDirect3DRMDevice) :
11202
        HResult; stdcall;
11210
        HResult; stdcall;
11203
 
11211
 
11204
      (* Create a Windows Device using D3D objects *)
11212
      (* Create a Windows Device using D3D objects *)
11205
    function CreateDeviceFromD3D (lpD3D: IDirect3D; lpD3DDev: IDirect3DDevice;
11213
    function CreateDeviceFromD3D (lpD3D: IDirect3D; lpD3DDev: IDirect3DDevice;
11206
        var lplpD3DRMDevice: IDirect3DRMDevice) : HResult; stdcall;
11214
        var lplpD3DRMDevice: IDirect3DRMDevice) : HResult; stdcall;
11207
 
11215
 
11208
    function CreateDeviceFromClipper (lpDDClipper: IDirectDrawClipper;
11216
    function CreateDeviceFromClipper (lpDDClipper: IDirectDrawClipper;
11209
        lpGUID: PGUID; width, height: Integer; var lplpD3DRMDevice:
11217
        lpGUID: PGUID; width, height: Integer; var lplpD3DRMDevice:
11210
        IDirect3DRMDevice) : HResult; stdcall;
11218
        IDirect3DRMDevice) : HResult; stdcall;
11211
 
11219
 
11212
    function CreateTextureFromSurface ( lpDDS: IDirectDrawSurface;
11220
    function CreateTextureFromSurface ( lpDDS: IDirectDrawSurface;
11213
        var lplpD3DRMTexture: IDirect3DRMTexture) : HResult; stdcall;
11221
        var lplpD3DRMTexture: IDirect3DRMTexture) : HResult; stdcall;
11214
 
11222
 
11215
    function CreateShadow (lpVisual: IDirect3DRMVisual;
11223
    function CreateShadow (lpVisual: IDirect3DRMVisual;
11216
        lpLight: IDirect3DRMLight; px, py, pz, nx, ny, nz: TD3DValue;
11224
        lpLight: IDirect3DRMLight; px, py, pz, nx, ny, nz: TD3DValue;
11217
        var lplpShadow: IDirect3DRMVisual) : HResult; stdcall;
11225
        var lplpShadow: IDirect3DRMVisual) : HResult; stdcall;
11218
    function CreateViewport (lpDev: IDirect3DRMDevice;
11226
    function CreateViewport (lpDev: IDirect3DRMDevice;
11219
        lpCamera: IDirect3DRMFrame; dwXPos, dwYPos, dwWidth, dwHeight: DWORD;
11227
        lpCamera: IDirect3DRMFrame; dwXPos, dwYPos, dwWidth, dwHeight: DWORD;
11220
        var lplpD3DRMViewport: IDirect3DRMViewport) : HResult; stdcall;
11228
        var lplpD3DRMViewport: IDirect3DRMViewport) : HResult; stdcall;
11221
    function CreateWrap (wraptype: TD3DRMWrapType; lpRef: IDirect3DRMFrame;
11229
    function CreateWrap (wraptype: TD3DRMWrapType; lpRef: IDirect3DRMFrame;
11222
        ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv: TD3DValue;
11230
        ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv: TD3DValue;
11223
        var lplpD3DRMWrap: IDirect3DRMWrap) : HResult; stdcall;
11231
        var lplpD3DRMWrap: IDirect3DRMWrap) : HResult; stdcall;
11224
    function CreateUserVisual (fn: TD3DRMUserVisualCallback; lpArg: Pointer;
11232
    function CreateUserVisual (fn: TD3DRMUserVisualCallback; lpArg: Pointer;
11225
        var lplpD3DRMUV: IDirect3DRMUserVisual) : HResult; stdcall;
11233
        var lplpD3DRMUV: IDirect3DRMUserVisual) : HResult; stdcall;
11226
    function LoadTexture (lpFileName: PAnsiChar; var lplpD3DRMTexture:
11234
    function LoadTexture (lpFileName: PAnsiChar; var lplpD3DRMTexture:
11227
        IDirect3DRMTexture) : HResult; stdcall;
11235
        IDirect3DRMTexture) : HResult; stdcall;
11228
    function LoadTextureFromResource (rs: HRSRC; var lplpD3DRMTexture:
11236
    function LoadTextureFromResource (rs: HRSRC; var lplpD3DRMTexture:
11229
        IDirect3DRMTexture) : HResult; stdcall;
11237
        IDirect3DRMTexture) : HResult; stdcall;
11230
 
11238
 
11231
    function SetSearchPath (lpPath: PAnsiChar) : HResult; stdcall;
11239
    function SetSearchPath (lpPath: PAnsiChar) : HResult; stdcall;
11232
    function AddSearchPath (lpPath: PAnsiChar) : HResult; stdcall;
11240
    function AddSearchPath (lpPath: PAnsiChar) : HResult; stdcall;
11233
    function GetSearchPath (var lpdwSize: DWORD; lpszPath: PAnsiChar) : HResult; stdcall;
11241
    function GetSearchPath (var lpdwSize: DWORD; lpszPath: PAnsiChar) : HResult; stdcall;
11234
    function SetDefaultTextureColors (dwColors: DWORD) : HResult; stdcall;
11242
    function SetDefaultTextureColors (dwColors: DWORD) : HResult; stdcall;
11235
    function SetDefaultTextureShades (dwShades: DWORD) : HResult; stdcall;
11243
    function SetDefaultTextureShades (dwShades: DWORD) : HResult; stdcall;
11236
 
11244
 
11237
    function GetDevices (var lplpDevArray: IDirect3DRMDeviceArray) : HResult; stdcall;
11245
    function GetDevices (var lplpDevArray: IDirect3DRMDeviceArray) : HResult; stdcall;
11238
    function GetNamedObject (lpName: PAnsiChar; var lplpD3DRMObject: IDirect3DRMObject) : HResult; stdcall;
11246
    function GetNamedObject (lpName: PAnsiChar; var lplpD3DRMObject: IDirect3DRMObject) : HResult; stdcall;
11239
 
11247
 
11240
    function EnumerateObjects (func: TD3DRMObjectCallback; lpArg: Pointer) : HResult; stdcall;
11248
    function EnumerateObjects (func: TD3DRMObjectCallback; lpArg: Pointer) : HResult; stdcall;
11241
 
11249
 
11242
    function Load (lpvObjSource, lpvObjID: Pointer; var lplpGUIDs: PGUID;
11250
    function Load (lpvObjSource, lpvObjID: Pointer; var lplpGUIDs: PGUID;
11243
        dwcGUIDs: DWORD; d3drmLOFlags: TD3DRMLoadOptions; d3drmLoadProc:
11251
        dwcGUIDs: DWORD; d3drmLOFlags: TD3DRMLoadOptions; d3drmLoadProc:
11244
        TD3DRMLoadCallback; lpArgLP: Pointer; d3drmLoadTextureProc:
11252
        TD3DRMLoadCallback; lpArgLP: Pointer; d3drmLoadTextureProc:
11245
        TD3DRMLoadTextureCallback; lpArgLTP: Pointer; lpParentFrame:
11253
        TD3DRMLoadTextureCallback; lpArgLTP: Pointer; lpParentFrame:
11246
        IDirect3DRMFrame) : HResult; stdcall;
11254
        IDirect3DRMFrame) : HResult; stdcall;
11247
    function Tick (d3dvalTick: TD3DValue) : HResult; stdcall;
11255
    function Tick (d3dvalTick: TD3DValue) : HResult; stdcall;
11248
  end;
11256
  end;
11249
 
11257
 
11250
// Moved from D3DRMObj, to avoid circular unit reference:
11258
// Moved from D3DRMObj, to avoid circular unit reference:
11251
 
11259
 
11252
  IDirect3DRMObject2 = interface (IUnknown)
11260
  IDirect3DRMObject2 = interface (IUnknown)
11253
    ['{4516ec7c-8f20-11d0-9b6d-0000c0781bc3}']
11261
    ['{4516ec7c-8f20-11d0-9b6d-0000c0781bc3}']
11254
    (*
11262
    (*
11255
     * IDirect3DRMObject2 methods
11263
     * IDirect3DRMObject2 methods
11256
     *)
11264
     *)
11257
    function AddDestroyCallback (lpCallback: TD3DRMObjectCallback;
11265
    function AddDestroyCallback (lpCallback: TD3DRMObjectCallback;
11258
        lpArg: Pointer) : HResult; stdcall;
11266
        lpArg: Pointer) : HResult; stdcall;
11259
    function Clone (pUnkOuter: IUnknown; const riid: TGUID;
11267
    function Clone (pUnkOuter: IUnknown; const riid: TGUID;
11260
        out ppvObj) : HResult; stdcall;
11268
        out ppvObj) : HResult; stdcall;
11261
    function DeleteDestroyCallback (d3drmObjProc: TD3DRMObjectCallback;
11269
    function DeleteDestroyCallback (d3drmObjProc: TD3DRMObjectCallback;
11262
        lpArg: Pointer) : HResult; stdcall;
11270
        lpArg: Pointer) : HResult; stdcall;
11263
    function GetClientData (dwID: DWORD; out lplpvData: Pointer) : HResult; stdcall;
11271
    function GetClientData (dwID: DWORD; out lplpvData: Pointer) : HResult; stdcall;
11264
    function GetDirect3DRM (out lplpDirect3DRM: IDirect3DRM) : HResult; stdcall;
11272
    function GetDirect3DRM (out lplpDirect3DRM: IDirect3DRM) : HResult; stdcall;
11265
    function GetName (var lpdwSize: DWORD; lpName: PAnsiChar) : HResult; stdcall;
11273
    function GetName (var lpdwSize: DWORD; lpName: PAnsiChar) : HResult; stdcall;
11266
    function SetClientData (dwID: DWORD; lpvData: pointer; dwFlags: DWORD) : HResult; stdcall;
11274
    function SetClientData (dwID: DWORD; lpvData: pointer; dwFlags: DWORD) : HResult; stdcall;
11267
    function SetName (lpName: PAnsiChar) : HResult; stdcall;
11275
    function SetName (lpName: PAnsiChar) : HResult; stdcall;
11268
    function GetAge (dwFlags: DWORD; out pdwAge: DWORD) : HResult; stdcall;
11276
    function GetAge (dwFlags: DWORD; out pdwAge: DWORD) : HResult; stdcall;
11269
  end;
11277
  end;
11270
 
11278
 
11271
  IID_IDirect3DRMObject2 = IDirect3DRMObject2;
11279
  IID_IDirect3DRMObject2 = IDirect3DRMObject2;
11272
 
11280
 
11273
  IDirect3DRM2 = interface (IUnknown)
11281
  IDirect3DRM2 = interface (IUnknown)
11274
    ['{4516ecc8-8f20-11d0-9b6d-0000c0781bc3}']
11282
    ['{4516ecc8-8f20-11d0-9b6d-0000c0781bc3}']
11275
    function CreateObject (const rclsid: TRefClsID; pUnkOuter: IUnknown;
11283
    function CreateObject (const rclsid: TRefClsID; pUnkOuter: IUnknown;
11276
        const riid: TGUID; out ppv) : HResult; stdcall;
11284
        const riid: TGUID; out ppv) : HResult; stdcall;
11277
    function CreateFrame (lpD3DRMFrame: IDirect3DRMFrame2;
11285
    function CreateFrame (lpD3DRMFrame: IDirect3DRMFrame2;
11278
        var lplpD3DRMFrame: IDirect3DRMFrame2) : HResult; stdcall;
11286
        var lplpD3DRMFrame: IDirect3DRMFrame2) : HResult; stdcall;
11279
    function CreateMesh (var lplpD3DRMMesh: IDirect3DRMMesh) : HResult; stdcall;
11287
    function CreateMesh (var lplpD3DRMMesh: IDirect3DRMMesh) : HResult; stdcall;
11280
    function CreateMeshBuilder (var lplpD3DRMMeshBuilder:
11288
    function CreateMeshBuilder (var lplpD3DRMMeshBuilder:
11281
        IDirect3DRMMeshBuilder2) : HResult; stdcall;
11289
        IDirect3DRMMeshBuilder2) : HResult; stdcall;
11282
    function CreateFace (var lplpd3drmFace: IDirect3DRMFace) : HResult; stdcall;
11290
    function CreateFace (var lplpd3drmFace: IDirect3DRMFace) : HResult; stdcall;
11283
    function CreateAnimation (var lplpD3DRMAnimation: IDirect3DRMAnimation) : HResult; stdcall;
11291
    function CreateAnimation (var lplpD3DRMAnimation: IDirect3DRMAnimation) : HResult; stdcall;
11284
    function CreateAnimationSet (var lplpD3DRMAnimationSet:
11292
    function CreateAnimationSet (var lplpD3DRMAnimationSet:
11285
        IDirect3DRMAnimationSet) : HResult; stdcall;
11293
        IDirect3DRMAnimationSet) : HResult; stdcall;
11286
    function CreateTexture (var lpImage: TD3DRMImage;
11294
    function CreateTexture (var lpImage: TD3DRMImage;
11287
        var lplpD3DRMTexture: IDirect3DRMTexture2) : HResult; stdcall;
11295
        var lplpD3DRMTexture: IDirect3DRMTexture2) : HResult; stdcall;
11288
    function CreateLight (d3drmltLightType: TD3DRMLightType;
11296
    function CreateLight (d3drmltLightType: TD3DRMLightType;
11289
        cColor: TD3DColor; var lplpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
11297
        cColor: TD3DColor; var lplpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
11290
    function CreateLightRGB (ltLightType: TD3DRMLightType; vRed,
11298
    function CreateLightRGB (ltLightType: TD3DRMLightType; vRed,
11291
        vGreen, vBlue: TD3DValue; var lplpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
11299
        vGreen, vBlue: TD3DValue; var lplpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
11292
    function CreateMaterial (vPower: TD3DValue; var lplpD3DRMMaterial:
11300
    function CreateMaterial (vPower: TD3DValue; var lplpD3DRMMaterial:
11293
        IDirect3DRMMaterial) : HResult; stdcall;
11301
        IDirect3DRMMaterial) : HResult; stdcall;
11294
    function CreateDevice (dwWidth, dwHeight: DWORD; var lplpD3DRMDevice:
11302
    function CreateDevice (dwWidth, dwHeight: DWORD; var lplpD3DRMDevice:
11295
        IDirect3DRMDevice2) : HResult; stdcall;
11303
        IDirect3DRMDevice2) : HResult; stdcall;
11296
 
11304
 
11297
    (* Create a Windows Device using DirectDraw surfaces *)
11305
    (* Create a Windows Device using DirectDraw surfaces *)
11298
    function CreateDeviceFromSurface (lpGUID: PGUID; lpDD: IDirectDraw;
11306
    function CreateDeviceFromSurface (lpGUID: PGUID; lpDD: IDirectDraw;
11299
        lpDDSBack: IDirectDrawSurface; var lplpD3DRMDevice: IDirect3DRMDevice2) :
11307
        lpDDSBack: IDirectDrawSurface; var lplpD3DRMDevice: IDirect3DRMDevice2) :
11300
        HResult; stdcall;
11308
        HResult; stdcall;
11301
 
11309
 
11302
      (* Create a Windows Device using D3D objects *)
11310
      (* Create a Windows Device using D3D objects *)
11303
    function CreateDeviceFromD3D (lpD3D: IDirect3D2; lpD3DDev: IDirect3DDevice2;
11311
    function CreateDeviceFromD3D (lpD3D: IDirect3D2; lpD3DDev: IDirect3DDevice2;
11304
        var lplpD3DRMDevice: IDirect3DRMDevice2) : HResult; stdcall;
11312
        var lplpD3DRMDevice: IDirect3DRMDevice2) : HResult; stdcall;
11305
 
11313
 
11306
    function CreateDeviceFromClipper (lpDDClipper: IDirectDrawClipper;
11314
    function CreateDeviceFromClipper (lpDDClipper: IDirectDrawClipper;
11307
        lpGUID: PGUID; width, height: Integer; var lplpD3DRMDevice:
11315
        lpGUID: PGUID; width, height: Integer; var lplpD3DRMDevice:
11308
        IDirect3DRMDevice2) : HResult; stdcall;
11316
        IDirect3DRMDevice2) : HResult; stdcall;
11309
 
11317
 
11310
    function CreateTextureFromSurface ( lpDDS: IDirectDrawSurface;
11318
    function CreateTextureFromSurface ( lpDDS: IDirectDrawSurface;
11311
        var lplpD3DRMTexture: IDirect3DRMTexture2) : HResult; stdcall;
11319
        var lplpD3DRMTexture: IDirect3DRMTexture2) : HResult; stdcall;
11312
 
11320
 
11313
    function CreateShadow (lpVisual: IDirect3DRMVisual;
11321
    function CreateShadow (lpVisual: IDirect3DRMVisual;
11314
        lpLight: IDirect3DRMLight; px, py, pz, nx, ny, nz: TD3DValue;
11322
        lpLight: IDirect3DRMLight; px, py, pz, nx, ny, nz: TD3DValue;
11315
        var lplpShadow: IDirect3DRMVisual) : HResult; stdcall;
11323
        var lplpShadow: IDirect3DRMVisual) : HResult; stdcall;
11316
    function CreateViewport (lpDev: IDirect3DRMDevice;
11324
    function CreateViewport (lpDev: IDirect3DRMDevice;
11317
        lpCamera: IDirect3DRMFrame; dwXPos, dwYPos, dwWidth, dwHeight: DWORD;
11325
        lpCamera: IDirect3DRMFrame; dwXPos, dwYPos, dwWidth, dwHeight: DWORD;
11318
        var lplpD3DRMViewport: IDirect3DRMViewport) : HResult; stdcall;
11326
        var lplpD3DRMViewport: IDirect3DRMViewport) : HResult; stdcall;
11319
    function CreateWrap (wraptype: TD3DRMWrapType; lpRef: IDirect3DRMFrame;
11327
    function CreateWrap (wraptype: TD3DRMWrapType; lpRef: IDirect3DRMFrame;
11320
        ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv: TD3DValue;
11328
        ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv: TD3DValue;
11321
        var lplpD3DRMWrap: IDirect3DRMWrap) : HResult; stdcall;
11329
        var lplpD3DRMWrap: IDirect3DRMWrap) : HResult; stdcall;
11322
    function CreateUserVisual (fn: TD3DRMUserVisualCallback; lpArg: Pointer;
11330
    function CreateUserVisual (fn: TD3DRMUserVisualCallback; lpArg: Pointer;
11323
        var lplpD3DRMUV: IDirect3DRMUserVisual) : HResult; stdcall;
11331
        var lplpD3DRMUV: IDirect3DRMUserVisual) : HResult; stdcall;
11324
    function LoadTexture (lpFileName: PAnsiChar; var lplpD3DRMTexture:
11332
    function LoadTexture (lpFileName: PAnsiChar; var lplpD3DRMTexture:
11325
        IDirect3DRMTexture2) : HResult; stdcall;
11333
        IDirect3DRMTexture2) : HResult; stdcall;
11326
    function LoadTextureFromResource (rs: HRSRC; var lplpD3DRMTexture:
11334
    function LoadTextureFromResource (rs: HRSRC; var lplpD3DRMTexture:
11327
        IDirect3DRMTexture2) : HResult; stdcall;
11335
        IDirect3DRMTexture2) : HResult; stdcall;
11328
 
11336
 
11329
    function SetSearchPath (lpPath: PAnsiChar) : HResult; stdcall;
11337
    function SetSearchPath (lpPath: PAnsiChar) : HResult; stdcall;
11330
    function AddSearchPath (lpPath: PAnsiChar) : HResult; stdcall;
11338
    function AddSearchPath (lpPath: PAnsiChar) : HResult; stdcall;
11331
    function GetSearchPath (var lpdwSize: DWORD; lpszPath: PAnsiChar) : HResult; stdcall;
11339
    function GetSearchPath (var lpdwSize: DWORD; lpszPath: PAnsiChar) : HResult; stdcall;
11332
    function SetDefaultTextureColors (dwColors: DWORD) : HResult; stdcall;
11340
    function SetDefaultTextureColors (dwColors: DWORD) : HResult; stdcall;
11333
    function SetDefaultTextureShades (dwShades: DWORD) : HResult; stdcall;
11341
    function SetDefaultTextureShades (dwShades: DWORD) : HResult; stdcall;
11334
 
11342
 
11335
    function GetDevices (var lplpDevArray: IDirect3DRMDeviceArray) : HResult; stdcall;
11343
    function GetDevices (var lplpDevArray: IDirect3DRMDeviceArray) : HResult; stdcall;
11336
    function GetNamedObject (lpName: PAnsiChar; var lplpD3DRMObject:
11344
    function GetNamedObject (lpName: PAnsiChar; var lplpD3DRMObject:
11337
        IDirect3DRMObject) : HResult; stdcall;
11345
        IDirect3DRMObject) : HResult; stdcall;
11338
 
11346
 
11339
    function EnumerateObjects (func: TD3DRMObjectCallback; lpArg: Pointer) : HResult; stdcall;
11347
    function EnumerateObjects (func: TD3DRMObjectCallback; lpArg: Pointer) : HResult; stdcall;
11340
 
11348
 
11341
    function Load (lpvObjSource, lpvObjID: Pointer; var lplpGUIDs: PGUID;
11349
    function Load (lpvObjSource, lpvObjID: Pointer; var lplpGUIDs: PGUID;
11342
        dwcGUIDs: DWORD; d3drmLOFlags: TD3DRMLoadOptions; d3drmLoadProc:
11350
        dwcGUIDs: DWORD; d3drmLOFlags: TD3DRMLoadOptions; d3drmLoadProc:
11343
        TD3DRMLoadCallback; lpArgLP: Pointer; d3drmLoadTextureProc:
11351
        TD3DRMLoadCallback; lpArgLP: Pointer; d3drmLoadTextureProc:
11344
        TD3DRMLoadTextureCallback; lpArgLTP: Pointer; lpParentFrame:
11352
        TD3DRMLoadTextureCallback; lpArgLTP: Pointer; lpParentFrame:
11345
        IDirect3DRMFrame) : HResult; stdcall;
11353
        IDirect3DRMFrame) : HResult; stdcall;
11346
    function Tick (d3dvalTick: TD3DValue) : HResult; stdcall;
11354
    function Tick (d3dvalTick: TD3DValue) : HResult; stdcall;
11347
    function CreateProgressiveMesh (var lplpD3DRMProgressiveMesh:
11355
    function CreateProgressiveMesh (var lplpD3DRMProgressiveMesh:
11348
        IDirect3DRMProgressiveMesh) : HResult; stdcall;
11356
        IDirect3DRMProgressiveMesh) : HResult; stdcall;
11349
  end;
11357
  end;
11350
 
11358
 
11351
  IDirect3DRM3 = interface (IUnknown)
11359
  IDirect3DRM3 = interface (IUnknown)
11352
    ['{4516ec83-8f20-11d0-9b6d-0000c0781bc3}']
11360
    ['{4516ec83-8f20-11d0-9b6d-0000c0781bc3}']
11353
    function CreateObject (const rclsid: TRefClsID; pUnkOuter: IUnknown;
11361
    function CreateObject (const rclsid: TRefClsID; pUnkOuter: IUnknown;
11354
        const riid: TGUID; out ppv) : HResult; stdcall;
11362
        const riid: TGUID; out ppv) : HResult; stdcall;
11355
    function CreateFrame (lpD3DRMFrame: IDirect3DRMFrame3;
11363
    function CreateFrame (lpD3DRMFrame: IDirect3DRMFrame3;
11356
        out lplpD3DRMFrame: IDirect3DRMFrame3) : HResult; stdcall;
11364
        out lplpD3DRMFrame: IDirect3DRMFrame3) : HResult; stdcall;
11357
    function CreateMesh (out lplpD3DRMMesh: IDirect3DRMMesh) : HResult; stdcall;
11365
    function CreateMesh (out lplpD3DRMMesh: IDirect3DRMMesh) : HResult; stdcall;
11358
    function CreateMeshBuilder (out lplpD3DRMMeshBuilder:
11366
    function CreateMeshBuilder (out lplpD3DRMMeshBuilder:
11359
        IDirect3DRMMeshBuilder3) : HResult; stdcall;
11367
        IDirect3DRMMeshBuilder3) : HResult; stdcall;
11360
    function CreateFace (out lplpd3drmFace: IDirect3DRMFace2) : HResult; stdcall;
11368
    function CreateFace (out lplpd3drmFace: IDirect3DRMFace2) : HResult; stdcall;
11361
    function CreateAnimation (out lplpD3DRMAnimation: IDirect3DRMAnimation2) : HResult; stdcall;
11369
    function CreateAnimation (out lplpD3DRMAnimation: IDirect3DRMAnimation2) : HResult; stdcall;
11362
    function CreateAnimationSet (out lplpD3DRMAnimationSet:
11370
    function CreateAnimationSet (out lplpD3DRMAnimationSet:
11363
        IDirect3DRMAnimationSet2) : HResult; stdcall;
11371
        IDirect3DRMAnimationSet2) : HResult; stdcall;
11364
    function CreateTexture (const lpImage: TD3DRMImage;
11372
    function CreateTexture (const lpImage: TD3DRMImage;
11365
        out lplpD3DRMTexture: IDirect3DRMTexture3) : HResult; stdcall;
11373
        out lplpD3DRMTexture: IDirect3DRMTexture3) : HResult; stdcall;
11366
    function CreateLight (d3drmltLightType: TD3DRMLightType;
11374
    function CreateLight (d3drmltLightType: TD3DRMLightType;
11367
        cColor: TD3DColor; out lplpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
11375
        cColor: TD3DColor; out lplpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
11368
    function CreateLightRGB (ltLightType: TD3DRMLightType; vRed,
11376
    function CreateLightRGB (ltLightType: TD3DRMLightType; vRed,
11369
        vGreen, vBlue: TD3DValue; out lplpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
11377
        vGreen, vBlue: TD3DValue; out lplpD3DRMLight: IDirect3DRMLight) : HResult; stdcall;
11370
    function CreateMaterial (vPower: TD3DValue; out lplpD3DRMMaterial:
11378
    function CreateMaterial (vPower: TD3DValue; out lplpD3DRMMaterial:
11371
        IDirect3DRMMaterial2) : HResult; stdcall;
11379
        IDirect3DRMMaterial2) : HResult; stdcall;
11372
    function CreateDevice (dwWidth, dwHeight: DWORD; out lplpD3DRMDevice:
11380
    function CreateDevice (dwWidth, dwHeight: DWORD; out lplpD3DRMDevice:
11373
        IDirect3DRMDevice3) : HResult; stdcall;
11381
        IDirect3DRMDevice3) : HResult; stdcall;
11374
 
11382
 
11375
    (* Create a Windows Device using DirectDraw surfaces *)
11383
    (* Create a Windows Device using DirectDraw surfaces *)
11376
    function CreateDeviceFromSurface (lpGUID: PGUID; lpDD: IDirectDraw;
11384
    function CreateDeviceFromSurface (lpGUID: PGUID; lpDD: IDirectDraw;
11377
        lpDDSBack: IDirectDrawSurface; dwFlags: DWORD;
11385
        lpDDSBack: IDirectDrawSurface; dwFlags: DWORD;
11378
        out lplpD3DRMDevice: IDirect3DRMDevice3) : HResult; stdcall;
11386
        out lplpD3DRMDevice: IDirect3DRMDevice3) : HResult; stdcall;
11379
 
11387
 
11380
      (* Create a Windows Device using D3D objects *)
11388
      (* Create a Windows Device using D3D objects *)
11381
    function CreateDeviceFromD3D (lpD3D: IDirect3D2; lpD3DDev: IDirect3DDevice2;
11389
    function CreateDeviceFromD3D (lpD3D: IDirect3D2; lpD3DDev: IDirect3DDevice2;
11382
        out lplpD3DRMDevice: IDirect3DRMDevice3) : HResult; stdcall;
11390
        out lplpD3DRMDevice: IDirect3DRMDevice3) : HResult; stdcall;
11383
 
11391
 
11384
    function CreateDeviceFromClipper (lpDDClipper: IDirectDrawClipper;
11392
    function CreateDeviceFromClipper (lpDDClipper: IDirectDrawClipper;
11385
        lpGUID: PGUID; width, height: Integer;
11393
        lpGUID: PGUID; width, height: Integer;
11386
        out lplpD3DRMDevice: IDirect3DRMDevice3) : HResult; stdcall;
11394
        out lplpD3DRMDevice: IDirect3DRMDevice3) : HResult; stdcall;
11387
 
11395
 
11388
    function CreateTextureFromSurface ( lpDDS: IDirectDrawSurface;
11396
    function CreateTextureFromSurface ( lpDDS: IDirectDrawSurface;
11389
        out lplpD3DRMTexture: IDirect3DRMTexture3) : HResult; stdcall;
11397
        out lplpD3DRMTexture: IDirect3DRMTexture3) : HResult; stdcall;
11390
 
11398
 
11391
    function CreateShadow (pUnk: IUnknown; lpLight: IDirect3DRMLight;
11399
    function CreateShadow (pUnk: IUnknown; lpLight: IDirect3DRMLight;
11392
        px, py, pz, nx, ny, nz: TD3DValue;
11400
        px, py, pz, nx, ny, nz: TD3DValue;
11393
        out lplpShadow: IDirect3DRMShadow2) : HResult; stdcall;
11401
        out lplpShadow: IDirect3DRMShadow2) : HResult; stdcall;
11394
    function CreateViewport (lpDev: IDirect3DRMDevice3;
11402
    function CreateViewport (lpDev: IDirect3DRMDevice3;
11395
        lpCamera: IDirect3DRMFrame3; dwXPos, dwYPos, dwWidth, dwHeight: DWORD;
11403
        lpCamera: IDirect3DRMFrame3; dwXPos, dwYPos, dwWidth, dwHeight: DWORD;
11396
        out lplpD3DRMViewport: IDirect3DRMViewport2) : HResult; stdcall;
11404
        out lplpD3DRMViewport: IDirect3DRMViewport2) : HResult; stdcall;
11397
    function CreateWrap (wraptype: TD3DRMWrapType; lpRef: IDirect3DRMFrame3;
11405
    function CreateWrap (wraptype: TD3DRMWrapType; lpRef: IDirect3DRMFrame3;
11398
        ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv: TD3DValue;
11406
        ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv: TD3DValue;
11399
        out lplpD3DRMWrap: IDirect3DRMWrap) : HResult; stdcall;
11407
        out lplpD3DRMWrap: IDirect3DRMWrap) : HResult; stdcall;
11400
    function CreateUserVisual (fn: TD3DRMUserVisualCallback; lpArg: Pointer;
11408
    function CreateUserVisual (fn: TD3DRMUserVisualCallback; lpArg: Pointer;
11401
        out lplpD3DRMUV: IDirect3DRMUserVisual) : HResult; stdcall;
11409
        out lplpD3DRMUV: IDirect3DRMUserVisual) : HResult; stdcall;
11402
    function LoadTexture (lpFileName: PAnsiChar; out lplpD3DRMTexture:
11410
    function LoadTexture (lpFileName: PAnsiChar; out lplpD3DRMTexture:
11403
        IDirect3DRMTexture3) : HResult; stdcall;
11411
        IDirect3DRMTexture3) : HResult; stdcall;
11404
    function LoadTextureFromResource (hModule: HMODULE;
11412
    function LoadTextureFromResource (hModule: HMODULE;
11405
        strName, strType: PAnsiChar;
11413
        strName, strType: PAnsiChar;
11406
        out lplpD3DRMTexture: IDirect3DRMTexture3) : HResult; stdcall;
11414
        out lplpD3DRMTexture: IDirect3DRMTexture3) : HResult; stdcall;
11407
 
11415
 
11408
    function SetSearchPath (lpPath: PAnsiChar) : HResult; stdcall;
11416
    function SetSearchPath (lpPath: PAnsiChar) : HResult; stdcall;
11409
    function AddSearchPath (lpPath: PAnsiChar) : HResult; stdcall;
11417
    function AddSearchPath (lpPath: PAnsiChar) : HResult; stdcall;
11410
    function GetSearchPath (var lpdwSize: DWORD; lpszPath: PAnsiChar) : HResult; stdcall;
11418
    function GetSearchPath (var lpdwSize: DWORD; lpszPath: PAnsiChar) : HResult; stdcall;
11411
    function SetDefaultTextureColors (dwColors: DWORD) : HResult; stdcall;
11419
    function SetDefaultTextureColors (dwColors: DWORD) : HResult; stdcall;
11412
    function SetDefaultTextureShades (dwShades: DWORD) : HResult; stdcall;
11420
    function SetDefaultTextureShades (dwShades: DWORD) : HResult; stdcall;
11413
 
11421
 
11414
    function GetDevices (out lplpDevArray: IDirect3DRMDeviceArray) : HResult; stdcall;
11422
    function GetDevices (out lplpDevArray: IDirect3DRMDeviceArray) : HResult; stdcall;
11415
    function GetNamedObject (lpName: PAnsiChar; out lplpD3DRMObject: IDirect3DRMObject) : HResult; stdcall;
11423
    function GetNamedObject (lpName: PAnsiChar; out lplpD3DRMObject: IDirect3DRMObject) : HResult; stdcall;
11416
 
11424
 
11417
    function EnumerateObjects (func: TD3DRMObjectCallback; lpArg: Pointer) : HResult; stdcall;
11425
    function EnumerateObjects (func: TD3DRMObjectCallback; lpArg: Pointer) : HResult; stdcall;
11418
 
11426
 
11419
    function Load (lpvObjSource, lpvObjID: Pointer; var lplpGUIDs: PGUID;
11427
    function Load (lpvObjSource, lpvObjID: Pointer; var lplpGUIDs: PGUID;
11420
        dwcGUIDs: DWORD; d3drmLOFlags: TD3DRMLoadOptions; d3drmLoadProc:
11428
        dwcGUIDs: DWORD; d3drmLOFlags: TD3DRMLoadOptions; d3drmLoadProc:
11421
        TD3DRMLoadCallback; lpArgLP: Pointer; d3drmLoadTextureProc:
11429
        TD3DRMLoadCallback; lpArgLP: Pointer; d3drmLoadTextureProc:
11422
        TD3DRMLoadTexture3Callback; lpArgLTP: Pointer; lpParentFrame:
11430
        TD3DRMLoadTexture3Callback; lpArgLTP: Pointer; lpParentFrame:
11423
        IDirect3DRMFrame3) : HResult; stdcall;
11431
        IDirect3DRMFrame3) : HResult; stdcall;
11424
    function Tick (d3dvalTick: TD3DValue) : HResult; stdcall;
11432
    function Tick (d3dvalTick: TD3DValue) : HResult; stdcall;
11425
    function CreateProgressiveMesh (out lplpD3DRMProgressiveMesh:
11433
    function CreateProgressiveMesh (out lplpD3DRMProgressiveMesh:
11426
        IDirect3DRMProgressiveMesh) : HResult; stdcall;
11434
        IDirect3DRMProgressiveMesh) : HResult; stdcall;
11427
 
11435
 
11428
    (* Used with IDirect3DRMObject2 *)
11436
    (* Used with IDirect3DRMObject2 *)
11429
    function RegisterClient (const rguid: TGUID; out lpdwID: DWORD) : HResult; stdcall;
11437
    function RegisterClient (const rguid: TGUID; out lpdwID: DWORD) : HResult; stdcall;
11430
    function UnregisterClient (const rguid: TGUID) : HResult; stdcall;
11438
    function UnregisterClient (const rguid: TGUID) : HResult; stdcall;
11431
 
11439
 
11432
    function CreateClippedVisual (lpVisual: IDirect3DRMVisual;
11440
    function CreateClippedVisual (lpVisual: IDirect3DRMVisual;
11433
        lpClippedVisual: IDirect3DRMClippedVisual) : HResult; stdcall;
11441
        lpClippedVisual: IDirect3DRMClippedVisual) : HResult; stdcall;
11434
    function SetOptions (dwOptions: DWORD) : HResult; stdcall;
11442
    function SetOptions (dwOptions: DWORD) : HResult; stdcall;
11435
    function GetOptions (out lpdwOptions: DWORD) : HResult; stdcall;
11443
    function GetOptions (out lpdwOptions: DWORD) : HResult; stdcall;
11436
  end;
11444
  end;
11437
 
11445
 
11438
  IID_IDirect3DRM =  IDirect3DRM;
11446
  IID_IDirect3DRM =  IDirect3DRM;
11439
  IID_IDirect3DRM2 = IDirect3DRM2;
11447
  IID_IDirect3DRM2 = IDirect3DRM2;
11440
  IID_IDirect3DRM3 = IDirect3DRM3;
11448
  IID_IDirect3DRM3 = IDirect3DRM3;
11441
 
11449
 
11442
const
11450
const
11443
  MAKE_D3RMDHRESULT = HResult($88760000);
11451
  MAKE_D3RMDHRESULT = HResult($88760000);
11444
 
11452
 
11445
  D3DRM_OK                        = DD_OK;
11453
  D3DRM_OK                        = DD_OK;
11446
  D3DRMERR_BADOBJECT              = MAKE_D3RMDHRESULT + 781;
11454
  D3DRMERR_BADOBJECT              = MAKE_D3RMDHRESULT + 781;
11447
  D3DRMERR_BADTYPE                = MAKE_D3RMDHRESULT + 782;
11455
  D3DRMERR_BADTYPE                = MAKE_D3RMDHRESULT + 782;
11448
  D3DRMERR_BADALLOC               = MAKE_D3RMDHRESULT + 783;
11456
  D3DRMERR_BADALLOC               = MAKE_D3RMDHRESULT + 783;
11449
  D3DRMERR_FACEUSED               = MAKE_D3RMDHRESULT + 784;
11457
  D3DRMERR_FACEUSED               = MAKE_D3RMDHRESULT + 784;
11450
  D3DRMERR_NOTFOUND               = MAKE_D3RMDHRESULT + 785;
11458
  D3DRMERR_NOTFOUND               = MAKE_D3RMDHRESULT + 785;
11451
  D3DRMERR_NOTDONEYET             = MAKE_D3RMDHRESULT + 786;
11459
  D3DRMERR_NOTDONEYET             = MAKE_D3RMDHRESULT + 786;
11452
  D3DRMERR_FILENOTFOUND           = MAKE_D3RMDHRESULT + 787;
11460
  D3DRMERR_FILENOTFOUND           = MAKE_D3RMDHRESULT + 787;
11453
  D3DRMERR_BADFILE                = MAKE_D3RMDHRESULT + 788;
11461
  D3DRMERR_BADFILE                = MAKE_D3RMDHRESULT + 788;
11454
  D3DRMERR_BADDEVICE              = MAKE_D3RMDHRESULT + 789;
11462
  D3DRMERR_BADDEVICE              = MAKE_D3RMDHRESULT + 789;
11455
  D3DRMERR_BADVALUE               = MAKE_D3RMDHRESULT + 790;
11463
  D3DRMERR_BADVALUE               = MAKE_D3RMDHRESULT + 790;
11456
  D3DRMERR_BADMAJORVERSION        = MAKE_D3RMDHRESULT + 791;
11464
  D3DRMERR_BADMAJORVERSION        = MAKE_D3RMDHRESULT + 791;
11457
  D3DRMERR_BADMINORVERSION        = MAKE_D3RMDHRESULT + 792;
11465
  D3DRMERR_BADMINORVERSION        = MAKE_D3RMDHRESULT + 792;
11458
  D3DRMERR_UNABLETOEXECUTE        = MAKE_D3RMDHRESULT + 793;
11466
  D3DRMERR_UNABLETOEXECUTE        = MAKE_D3RMDHRESULT + 793;
11459
  D3DRMERR_LIBRARYNOTFOUND        = MAKE_D3RMDHRESULT + 794;
11467
  D3DRMERR_LIBRARYNOTFOUND        = MAKE_D3RMDHRESULT + 794;
11460
  D3DRMERR_INVALIDLIBRARY         = MAKE_D3RMDHRESULT + 795;
11468
  D3DRMERR_INVALIDLIBRARY         = MAKE_D3RMDHRESULT + 795;
11461
  D3DRMERR_PENDING                = MAKE_D3RMDHRESULT + 796;
11469
  D3DRMERR_PENDING                = MAKE_D3RMDHRESULT + 796;
11462
  D3DRMERR_NOTENOUGHDATA          = MAKE_D3RMDHRESULT + 797;
11470
  D3DRMERR_NOTENOUGHDATA          = MAKE_D3RMDHRESULT + 797;
11463
  D3DRMERR_REQUESTTOOLARGE        = MAKE_D3RMDHRESULT + 798;
11471
  D3DRMERR_REQUESTTOOLARGE        = MAKE_D3RMDHRESULT + 798;
11464
  D3DRMERR_REQUESTTOOSMALL        = MAKE_D3RMDHRESULT + 799;
11472
  D3DRMERR_REQUESTTOOSMALL        = MAKE_D3RMDHRESULT + 799;
11465
  D3DRMERR_CONNECTIONLOST         = MAKE_D3RMDHRESULT + 800;
11473
  D3DRMERR_CONNECTIONLOST         = MAKE_D3RMDHRESULT + 800;
11466
  D3DRMERR_LOADABORTED            = MAKE_D3RMDHRESULT + 801;
11474
  D3DRMERR_LOADABORTED            = MAKE_D3RMDHRESULT + 801;
11467
  D3DRMERR_NOINTERNET             = MAKE_D3RMDHRESULT + 802;
11475
  D3DRMERR_NOINTERNET             = MAKE_D3RMDHRESULT + 802;
11468
  D3DRMERR_BADCACHEFILE           = MAKE_D3RMDHRESULT + 803;
11476
  D3DRMERR_BADCACHEFILE           = MAKE_D3RMDHRESULT + 803;
11469
  D3DRMERR_BOXNOTSET              = MAKE_D3RMDHRESULT + 804;
11477
  D3DRMERR_BOXNOTSET              = MAKE_D3RMDHRESULT + 804;
11470
  D3DRMERR_BADPMDATA              = MAKE_D3RMDHRESULT + 805;
11478
  D3DRMERR_BADPMDATA              = MAKE_D3RMDHRESULT + 805;
11471
  D3DRMERR_CLIENTNOTREGISTERED    = MAKE_D3RMDHRESULT + 806;
11479
  D3DRMERR_CLIENTNOTREGISTERED    = MAKE_D3RMDHRESULT + 806;
11472
  D3DRMERR_NOTCREATEDFROMDDS      = MAKE_D3RMDHRESULT + 807;
11480
  D3DRMERR_NOTCREATEDFROMDDS      = MAKE_D3RMDHRESULT + 807;
11473
  D3DRMERR_NOSUCHKEY              = MAKE_D3RMDHRESULT + 808;
11481
  D3DRMERR_NOSUCHKEY              = MAKE_D3RMDHRESULT + 808;
11474
  D3DRMERR_INCOMPATABLEKEY        = MAKE_D3RMDHRESULT + 809;
11482
  D3DRMERR_INCOMPATABLEKEY        = MAKE_D3RMDHRESULT + 809;
11475
  D3DRMERR_ELEMENTINUSE           = MAKE_D3RMDHRESULT + 810;
11483
  D3DRMERR_ELEMENTINUSE           = MAKE_D3RMDHRESULT + 810;
11476
  D3DRMERR_TEXTUREFORMATNOTFOUND  = MAKE_D3RMDHRESULT + 811;
11484
  D3DRMERR_TEXTUREFORMATNOTFOUND  = MAKE_D3RMDHRESULT + 811;
11477
 
11485
 
11478
(* Create a Direct3DRM API *)
11486
(* Create a Direct3DRM API *)
11479
var
11487
var
11480
  Direct3DRMCreate : function (out lplpDirect3DRM: IDirect3DRM) : HResult; stdcall;
11488
  Direct3DRMCreate : function (out lplpDirect3DRM: IDirect3DRM) : HResult; stdcall;
11481
 
11489
 
11482
(*==========================================================================;
11490
(*==========================================================================;
11483
 *
11491
 *
11484
 *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
11492
 *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
11485
 *
11493
 *
11486
 *  File:       d3drmwin.h
11494
 *  File:       d3drmwin.h
11487
 *  Content:    Direct3DRM include file
11495
 *  Content:    Direct3DRM include file
11488
 *
11496
 *
11489
 ***************************************************************************)
11497
 ***************************************************************************)
11490
 
11498
 
11491
type
11499
type
11492
  IDirect3DRMWinDevice = interface (IDirect3DRMObject)
11500
  IDirect3DRMWinDevice = interface (IDirect3DRMObject)
11493
    ['{c5016cc0-d273-11ce-ac48-0000c03825a1}']
11501
    ['{c5016cc0-d273-11ce-ac48-0000c03825a1}']
11494
    (*
11502
    (*
11495
     * IDirect3DRMWinDevice methods
11503
     * IDirect3DRMWinDevice methods
11496
     *)
11504
     *)
11497
 
11505
 
11498
    (* Repaint the window with the last frame which was rendered. *)
11506
    (* Repaint the window with the last frame which was rendered. *)
11499
    function HandlePaint (hDC: HDC) : HResult; stdcall;
11507
    function HandlePaint (hDC: HDC) : HResult; stdcall;
11500
 
11508
 
11501
    (* Respond to a WM_ACTIVATE message. *)
11509
    (* Respond to a WM_ACTIVATE message. *)
11502
    function HandleActivate (wparam: WORD) : HResult; stdcall;
11510
    function HandleActivate (wparam: WORD) : HResult; stdcall;
11503
  end;
11511
  end;
11504
 
11512
 
11505
(*
11513
(*
11506
 * GUIDS used by Direct3DRM Windows interface
11514
 * GUIDS used by Direct3DRM Windows interface
11507
 *)
11515
 *)
11508
  IID_IDirect3DRMWinDevice = IDirect3DRMWinDevice;
11516
  IID_IDirect3DRMWinDevice = IDirect3DRMWinDevice;
11509
 
11517
 
11510
(***************************************************************************
11518
(***************************************************************************
11511
 *
11519
 *
11512
 *  Copyright (C) 1998-1999 Microsoft Corporation.  All Rights Reserved.
11520
 *  Copyright (C) 1998-1999 Microsoft Corporation.  All Rights Reserved.
11513
 *
11521
 *
11514
 *  File:       rmxfguid.h
11522
 *  File:       rmxfguid.h
11515
 *
11523
 *
11516
 *  Content:    Defines GUIDs of D3DRM's templates.
11524
 *  Content:    Defines GUIDs of D3DRM's templates.
11517
 *
11525
 *
11518
 ***************************************************************************)
11526
 ***************************************************************************)
11519
 
11527
 
11520
const
11528
const
11521
(* {2B957100-9E9A-11cf-AB39-0020AF71E433} *)
11529
(* {2B957100-9E9A-11cf-AB39-0020AF71E433} *)
11522
  TID_D3DRMInfo: TGUID =
11530
  TID_D3DRMInfo: TGUID =
11523
      (D1:$2b957100;D2:$9e9a;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11531
      (D1:$2b957100;D2:$9e9a;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11524
 
11532
 
11525
(* {3D82AB44-62DA-11cf-AB39-0020AF71E433} *)
11533
(* {3D82AB44-62DA-11cf-AB39-0020AF71E433} *)
11526
  TID_D3DRMMesh: TGUID =
11534
  TID_D3DRMMesh: TGUID =
11527
      (D1:$3d82ab44;D2:$62da;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11535
      (D1:$3d82ab44;D2:$62da;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11528
 
11536
 
11529
(* {3D82AB5E-62DA-11cf-AB39-0020AF71E433} *)
11537
(* {3D82AB5E-62DA-11cf-AB39-0020AF71E433} *)
11530
  TID_D3DRMVector: TGUID =
11538
  TID_D3DRMVector: TGUID =
11531
      (D1:$3d82ab5e;D2:$62da;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11539
      (D1:$3d82ab5e;D2:$62da;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11532
 
11540
 
11533
(* {3D82AB5F-62DA-11cf-AB39-0020AF71E433} *)
11541
(* {3D82AB5F-62DA-11cf-AB39-0020AF71E433} *)
11534
  TID_D3DRMMeshFace: TGUID =
11542
  TID_D3DRMMeshFace: TGUID =
11535
      (D1:$3d82ab5f;D2:$62da;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11543
      (D1:$3d82ab5f;D2:$62da;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11536
 
11544
 
11537
(* {3D82AB4D-62DA-11cf-AB39-0020AF71E433} *)
11545
(* {3D82AB4D-62DA-11cf-AB39-0020AF71E433} *)
11538
  TID_D3DRMMaterial: TGUID =
11546
  TID_D3DRMMaterial: TGUID =
11539
      (D1:$3d82ab4d;D2:$62da;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11547
      (D1:$3d82ab4d;D2:$62da;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11540
 
11548
 
11541
(* {35FF44E1-6C7C-11cf-8F52-0040333594A3} *)
11549
(* {35FF44E1-6C7C-11cf-8F52-0040333594A3} *)
11542
  TID_D3DRMMaterialArray: TGUID =
11550
  TID_D3DRMMaterialArray: TGUID =
11543
      (D1:$35ff44e1;D2:$6c7c;D3:$11cf;D4:($8F,$52,$00,$40,$33,$35,$94,$a3));
11551
      (D1:$35ff44e1;D2:$6c7c;D3:$11cf;D4:($8F,$52,$00,$40,$33,$35,$94,$a3));
11544
 
11552
 
11545
(* {3D82AB46-62DA-11cf-AB39-0020AF71E433} *)
11553
(* {3D82AB46-62DA-11cf-AB39-0020AF71E433} *)
11546
  TID_D3DRMFrame: TGUID =
11554
  TID_D3DRMFrame: TGUID =
11547
      (D1:$3d82ab46;D2:$62da;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11555
      (D1:$3d82ab46;D2:$62da;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11548
 
11556
 
11549
(* {F6F23F41-7686-11cf-8F52-0040333594A3} *)
11557
(* {F6F23F41-7686-11cf-8F52-0040333594A3} *)
11550
  TID_D3DRMFrameTransformMatrix: TGUID =
11558
  TID_D3DRMFrameTransformMatrix: TGUID =
11551
      (D1:$f6f23f41;D2:$7686;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11559
      (D1:$f6f23f41;D2:$7686;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11552
 
11560
 
11553
(* {F6F23F42-7686-11cf-8F52-0040333594A3} *)
11561
(* {F6F23F42-7686-11cf-8F52-0040333594A3} *)
11554
  TID_D3DRMMeshMaterialList: TGUID =
11562
  TID_D3DRMMeshMaterialList: TGUID =
11555
      (D1:$f6f23f42;D2:$7686;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11563
      (D1:$f6f23f42;D2:$7686;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11556
 
11564
 
11557
(* {F6F23F40-7686-11cf-8F52-0040333594A3} *)
11565
(* {F6F23F40-7686-11cf-8F52-0040333594A3} *)
11558
  TID_D3DRMMeshTextureCoords: TGUID =
11566
  TID_D3DRMMeshTextureCoords: TGUID =
11559
      (D1:$f6f23f40;D2:$7686;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11567
      (D1:$f6f23f40;D2:$7686;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11560
 
11568
 
11561
(* {F6F23F43-7686-11cf-8F52-0040333594A3} *)
11569
(* {F6F23F43-7686-11cf-8F52-0040333594A3} *)
11562
  TID_D3DRMMeshNormals: TGUID =
11570
  TID_D3DRMMeshNormals: TGUID =
11563
      (D1:$f6f23f43;D2:$7686;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11571
      (D1:$f6f23f43;D2:$7686;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11564
 
11572
 
11565
(* {F6F23F44-7686-11cf-8F52-0040333594A3} *)
11573
(* {F6F23F44-7686-11cf-8F52-0040333594A3} *)
11566
  TID_D3DRMCoords2d: TGUID =
11574
  TID_D3DRMCoords2d: TGUID =
11567
      (D1:$f6f23f44;D2:$7686;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11575
      (D1:$f6f23f44;D2:$7686;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11568
 
11576
 
11569
(* {F6F23F45-7686-11cf-8F52-0040333594A3} *)
11577
(* {F6F23F45-7686-11cf-8F52-0040333594A3} *)
11570
  TID_D3DRMMatrix4x4: TGUID =
11578
  TID_D3DRMMatrix4x4: TGUID =
11571
      (D1:$f6f23f45;D2:$7686;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11579
      (D1:$f6f23f45;D2:$7686;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11572
 
11580
 
11573
(* {3D82AB4F-62DA-11cf-AB39-0020AF71E433} *)
11581
(* {3D82AB4F-62DA-11cf-AB39-0020AF71E433} *)
11574
  TID_D3DRMAnimation: TGUID =
11582
  TID_D3DRMAnimation: TGUID =
11575
      (D1:$3d82ab4f;D2:$62da;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11583
      (D1:$3d82ab4f;D2:$62da;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11576
 
11584
 
11577
(* {3D82AB50-62DA-11cf-AB39-0020AF71E433} *)
11585
(* {3D82AB50-62DA-11cf-AB39-0020AF71E433} *)
11578
  TID_D3DRMAnimationSet: TGUID =
11586
  TID_D3DRMAnimationSet: TGUID =
11579
      (D1:$3d82ab50;D2:$62da;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11587
      (D1:$3d82ab50;D2:$62da;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11580
 
11588
 
11581
(* {10DD46A8-775B-11cf-8F52-0040333594A3} *)
11589
(* {10DD46A8-775B-11cf-8F52-0040333594A3} *)
11582
  TID_D3DRMAnimationKey: TGUID =
11590
  TID_D3DRMAnimationKey: TGUID =
11583
      (D1:$10dd46a8;D2:$775b;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$A3));
11591
      (D1:$10dd46a8;D2:$775b;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$A3));
11584
 
11592
 
11585
(* {10DD46A9-775B-11cf-8F52-0040333594A3} *)
11593
(* {10DD46A9-775B-11cf-8F52-0040333594A3} *)
11586
  TID_D3DRMFloatKeys: TGUID =
11594
  TID_D3DRMFloatKeys: TGUID =
11587
      (D1:$10dd46a9;D2:$775b;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$A3));
11595
      (D1:$10dd46a9;D2:$775b;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$A3));
11588
 
11596
 
11589
(* {01411840-7786-11cf-8F52-0040333594A3} *)
11597
(* {01411840-7786-11cf-8F52-0040333594A3} *)
11590
  TID_D3DRMMaterialAmbientColor: TGUID =
11598
  TID_D3DRMMaterialAmbientColor: TGUID =
11591
      (D1:$01411840;D2:$7786;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$A3));
11599
      (D1:$01411840;D2:$7786;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$A3));
11592
 
11600
 
11593
(* {01411841-7786-11cf-8F52-0040333594A3} *)
11601
(* {01411841-7786-11cf-8F52-0040333594A3} *)
11594
  TID_D3DRMMaterialDiffuseColor: TGUID =
11602
  TID_D3DRMMaterialDiffuseColor: TGUID =
11595
      (D1:$01411841;D2:$7786;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$A3));
11603
      (D1:$01411841;D2:$7786;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$A3));
11596
 
11604
 
11597
(* {01411842-7786-11cf-8F52-0040333594A3} *)
11605
(* {01411842-7786-11cf-8F52-0040333594A3} *)
11598
  TID_D3DRMMaterialSpecularColor: TGUID =
11606
  TID_D3DRMMaterialSpecularColor: TGUID =
11599
      (D1:$01411842;D2:$7786;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$A3));
11607
      (D1:$01411842;D2:$7786;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$A3));
11600
 
11608
 
11601
(* {D3E16E80-7835-11cf-8F52-0040333594A3} *)
11609
(* {D3E16E80-7835-11cf-8F52-0040333594A3} *)
11602
  TID_D3DRMMaterialEmissiveColor: TGUID =
11610
  TID_D3DRMMaterialEmissiveColor: TGUID =
11603
      (D1:$d3e16e80;D2:$7835;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11611
      (D1:$d3e16e80;D2:$7835;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11604
 
11612
 
11605
(* {01411843-7786-11cf-8F52-0040333594A3} *)
11613
(* {01411843-7786-11cf-8F52-0040333594A3} *)
11606
  TID_D3DRMMaterialPower: TGUID =
11614
  TID_D3DRMMaterialPower: TGUID =
11607
      (D1:$01411843;D2:$7786;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$A3));
11615
      (D1:$01411843;D2:$7786;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$A3));
11608
 
11616
 
11609
(* {35FF44E0-6C7C-11cf-8F52-0040333594A3} *)
11617
(* {35FF44E0-6C7C-11cf-8F52-0040333594A3} *)
11610
  TID_D3DRMColorRGBA: TGUID =
11618
  TID_D3DRMColorRGBA: TGUID =
11611
      (D1:$35ff44e0;D2:$6c7c;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$A3));
11619
      (D1:$35ff44e0;D2:$6c7c;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$A3));
11612
 
11620
 
11613
(* {D3E16E81-7835-11cf-8F52-0040333594A3} *)
11621
(* {D3E16E81-7835-11cf-8F52-0040333594A3} *)
11614
  TID_D3DRMColorRGB: TGUID =
11622
  TID_D3DRMColorRGB: TGUID =
11615
      (D1:$d3e16e81;D2:$7835;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11623
      (D1:$d3e16e81;D2:$7835;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11616
 
11624
 
11617
(* {A42790E0-7810-11cf-8F52-0040333594A3} *)
11625
(* {A42790E0-7810-11cf-8F52-0040333594A3} *)
11618
  TID_D3DRMGuid: TGUID =
11626
  TID_D3DRMGuid: TGUID =
11619
      (D1:$a42790e0;D2:$7810;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11627
      (D1:$a42790e0;D2:$7810;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11620
 
11628
 
11621
(* {A42790E1-7810-11cf-8F52-0040333594A3} *)
11629
(* {A42790E1-7810-11cf-8F52-0040333594A3} *)
11622
  TID_D3DRMTextureFilename: TGUID =
11630
  TID_D3DRMTextureFilename: TGUID =
11623
      (D1:$a42790e1;D2:$7810;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11631
      (D1:$a42790e1;D2:$7810;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11624
 
11632
 
11625
(* {A42790E2-7810-11cf-8F52-0040333594A3} *)
11633
(* {A42790E2-7810-11cf-8F52-0040333594A3} *)
11626
  TID_D3DRMTextureReference: TGUID =
11634
  TID_D3DRMTextureReference: TGUID =
11627
      (D1:$a42790e2;D2:$7810;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11635
      (D1:$a42790e2;D2:$7810;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11628
 
11636
 
11629
(* {1630B820-7842-11cf-8F52-0040333594A3} *)
11637
(* {1630B820-7842-11cf-8F52-0040333594A3} *)
11630
  TID_D3DRMIndexedColor: TGUID =
11638
  TID_D3DRMIndexedColor: TGUID =
11631
      (D1:$1630b820;D2:$7842;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11639
      (D1:$1630b820;D2:$7842;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11632
 
11640
 
11633
(* {1630B821-7842-11cf-8F52-0040333594A3} *)
11641
(* {1630B821-7842-11cf-8F52-0040333594A3} *)
11634
  TID_D3DRMMeshVertexColors: TGUID =
11642
  TID_D3DRMMeshVertexColors: TGUID =
11635
      (D1:$1630b821;D2:$7842;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11643
      (D1:$1630b821;D2:$7842;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11636
 
11644
 
11637
(* {4885AE60-78E8-11cf-8F52-0040333594A3} *)
11645
(* {4885AE60-78E8-11cf-8F52-0040333594A3} *)
11638
  TID_D3DRMMaterialWrap: TGUID =
11646
  TID_D3DRMMaterialWrap: TGUID =
11639
      (D1:$4885ae60;D2:$78e8;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11647
      (D1:$4885ae60;D2:$78e8;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11640
 
11648
 
11641
(* {537DA6A0-CA37-11d0-941C-0080C80CFA7B} *)
11649
(* {537DA6A0-CA37-11d0-941C-0080C80CFA7B} *)
11642
  TID_D3DRMBoolean: TGUID =
11650
  TID_D3DRMBoolean: TGUID =
11643
      (D1:$537da6a0;D2:$ca37;D3:$11d0;D4:($94,$1c,$00,$80,$c8,$0c,$fa,$7b));
11651
      (D1:$537da6a0;D2:$ca37;D3:$11d0;D4:($94,$1c,$00,$80,$c8,$0c,$fa,$7b));
11644
 
11652
 
11645
(* {ED1EC5C0-C0A8-11d0-941C-0080C80CFA7B} *)
11653
(* {ED1EC5C0-C0A8-11d0-941C-0080C80CFA7B} *)
11646
  TID_D3DRMMeshFaceWraps: TGUID =
11654
  TID_D3DRMMeshFaceWraps: TGUID =
11647
      (D1:$ed1ec5c0;D2:$c0a8;D3:$11d0;D4:($94,$1c,$00,$80,$c8,$0c,$fa,$7b));
11655
      (D1:$ed1ec5c0;D2:$c0a8;D3:$11d0;D4:($94,$1c,$00,$80,$c8,$0c,$fa,$7b));
11648
 
11656
 
11649
(* {4885AE63-78E8-11cf-8F52-0040333594A3} *)
11657
(* {4885AE63-78E8-11cf-8F52-0040333594A3} *)
11650
  TID_D3DRMBoolean2d: TGUID =
11658
  TID_D3DRMBoolean2d: TGUID =
11651
      (D1:$4885ae63;D2:$78e8;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11659
      (D1:$4885ae63;D2:$78e8;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11652
 
11660
 
11653
(* {F406B180-7B3B-11cf-8F52-0040333594A3} *)
11661
(* {F406B180-7B3B-11cf-8F52-0040333594A3} *)
11654
  TID_D3DRMTimedFloatKeys: TGUID =
11662
  TID_D3DRMTimedFloatKeys: TGUID =
11655
      (D1:$f406b180;D2:$7b3b;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11663
      (D1:$f406b180;D2:$7b3b;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11656
 
11664
 
11657
(* {E2BF56C0-840F-11cf-8F52-0040333594A3} *)
11665
(* {E2BF56C0-840F-11cf-8F52-0040333594A3} *)
11658
  TID_D3DRMAnimationOptions: TGUID =
11666
  TID_D3DRMAnimationOptions: TGUID =
11659
      (D1:$e2bf56c0;D2:$840f;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11667
      (D1:$e2bf56c0;D2:$840f;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11660
 
11668
 
11661
(* {E2BF56C1-840F-11cf-8F52-0040333594A3} *)
11669
(* {E2BF56C1-840F-11cf-8F52-0040333594A3} *)
11662
  TID_D3DRMFramePosition: TGUID =
11670
  TID_D3DRMFramePosition: TGUID =
11663
      (D1:$e2bf56c1;D2:$840f;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11671
      (D1:$e2bf56c1;D2:$840f;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11664
 
11672
 
11665
(* {E2BF56C2-840F-11cf-8F52-0040333594A3} *)
11673
(* {E2BF56C2-840F-11cf-8F52-0040333594A3} *)
11666
  TID_D3DRMFrameVelocity: TGUID =
11674
  TID_D3DRMFrameVelocity: TGUID =
11667
      (D1:$e2bf56c2;D2:$840f;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11675
      (D1:$e2bf56c2;D2:$840f;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11668
 
11676
 
11669
(* {E2BF56C3-840F-11cf-8F52-0040333594A3} *)
11677
(* {E2BF56C3-840F-11cf-8F52-0040333594A3} *)
11670
  TID_D3DRMFrameRotation: TGUID =
11678
  TID_D3DRMFrameRotation: TGUID =
11671
      (D1:$e2bf56c3;D2:$840f;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11679
      (D1:$e2bf56c3;D2:$840f;D3:$11cf;D4:($8f,$52,$00,$40,$33,$35,$94,$a3));
11672
 
11680
 
11673
(* {3D82AB4A-62DA-11cf-AB39-0020AF71E433} *)
11681
(* {3D82AB4A-62DA-11cf-AB39-0020AF71E433} *)
11674
  TID_D3DRMLight: TGUID =
11682
  TID_D3DRMLight: TGUID =
11675
      (D1:$3d82ab4a;D2:$62da;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11683
      (D1:$3d82ab4a;D2:$62da;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11676
 
11684
 
11677
(* {3D82AB51-62DA-11cf-AB39-0020AF71E433} *)
11685
(* {3D82AB51-62DA-11cf-AB39-0020AF71E433} *)
11678
  TID_D3DRMCamera: TGUID =
11686
  TID_D3DRMCamera: TGUID =
11679
      (D1:$3d82ab51;D2:$62da;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11687
      (D1:$3d82ab51;D2:$62da;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11680
 
11688
 
11681
(* {E5745280-B24F-11cf-9DD5-00AA00A71A2F} *)
11689
(* {E5745280-B24F-11cf-9DD5-00AA00A71A2F} *)
11682
  TID_D3DRMAppData: TGUID =
11690
  TID_D3DRMAppData: TGUID =
11683
      (D1:$e5745280;D2:$b24f;D3:$11cf;D4:($9d,$d5,$00,$aa,$00,$a7,$1a,$2f));
11691
      (D1:$e5745280;D2:$b24f;D3:$11cf;D4:($9d,$d5,$00,$aa,$00,$a7,$1a,$2f));
11684
 
11692
 
11685
(* {AED22740-B31F-11cf-9DD5-00AA00A71A2F} *)
11693
(* {AED22740-B31F-11cf-9DD5-00AA00A71A2F} *)
11686
  TID_D3DRMLightUmbra: TGUID =
11694
  TID_D3DRMLightUmbra: TGUID =
11687
      (D1:$aed22740;D2:$b31f;D3:$11cf;D4:($9d,$d5,$00,$aa,$00,$a7,$1a,$2f));
11695
      (D1:$aed22740;D2:$b31f;D3:$11cf;D4:($9d,$d5,$00,$aa,$00,$a7,$1a,$2f));
11688
 
11696
 
11689
(* {AED22742-B31F-11cf-9DD5-00AA00A71A2F} *)
11697
(* {AED22742-B31F-11cf-9DD5-00AA00A71A2F} *)
11690
  TID_D3DRMLightRange: TGUID =
11698
  TID_D3DRMLightRange: TGUID =
11691
      (D1:$aed22742;D2:$b31f;D3:$11cf;D4:($9d,$d5,$00,$aa,$00,$a7,$1a,$2f));
11699
      (D1:$aed22742;D2:$b31f;D3:$11cf;D4:($9d,$d5,$00,$aa,$00,$a7,$1a,$2f));
11692
 
11700
 
11693
(* {AED22741-B31F-11cf-9DD5-00AA00A71A2F} *)
11701
(* {AED22741-B31F-11cf-9DD5-00AA00A71A2F} *)
11694
  TID_D3DRMLightPenumbra: TGUID =
11702
  TID_D3DRMLightPenumbra: TGUID =
11695
      (D1:$aed22741;D2:$b31f;D3:$11cf;D4:($9d,$d5,$00,$aa,$00,$a7,$1a,$2f));
11703
      (D1:$aed22741;D2:$b31f;D3:$11cf;D4:($9d,$d5,$00,$aa,$00,$a7,$1a,$2f));
11696
 
11704
 
11697
(* {A8A98BA0-C5E5-11cf-B941-0080C80CFA7B} *)
11705
(* {A8A98BA0-C5E5-11cf-B941-0080C80CFA7B} *)
11698
  TID_D3DRMLightAttenuation: TGUID =
11706
  TID_D3DRMLightAttenuation: TGUID =
11699
      (D1:$a8a98ba0;D2:$c5e5;D3:$11cf;D4:($b9,$41,$00,$80,$c8,$0c,$fa,$7b));
11707
      (D1:$a8a98ba0;D2:$c5e5;D3:$11cf;D4:($b9,$41,$00,$80,$c8,$0c,$fa,$7b));
11700
 
11708
 
11701
(* {3A23EEA0-94B1-11d0-AB39-0020AF71E433} *)
11709
(* {3A23EEA0-94B1-11d0-AB39-0020AF71E433} *)
11702
  TID_D3DRMInlineData: TGUID =
11710
  TID_D3DRMInlineData: TGUID =
11703
      (D1:$3a23eea0;D2:$94b1;D3:$11d0;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11711
      (D1:$3a23eea0;D2:$94b1;D3:$11d0;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11704
 
11712
 
11705
(* {3A23EEA1-94B1-11d0-AB39-0020AF71E433} *)
11713
(* {3A23EEA1-94B1-11d0-AB39-0020AF71E433} *)
11706
  TID_D3DRMUrl: TGUID =
11714
  TID_D3DRMUrl: TGUID =
11707
      (D1:$3a23eea1;D2:$94b1;D3:$11d0;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11715
      (D1:$3a23eea1;D2:$94b1;D3:$11d0;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
11708
 
11716
 
11709
(* {8A63C360-997D-11d0-941C-0080C80CFA7B} *)
11717
(* {8A63C360-997D-11d0-941C-0080C80CFA7B} *)
11710
  TID_D3DRMProgressiveMesh: TGUID =
11718
  TID_D3DRMProgressiveMesh: TGUID =
11711
      (D1:$8A63C360;D2:$997D;D3:$11d0;D4:($94,$1C,$00,$80,$C8,$0C,$FA,$7B));
11719
      (D1:$8A63C360;D2:$997D;D3:$11d0;D4:($94,$1C,$00,$80,$C8,$0C,$FA,$7B));
11712
 
11720
 
11713
(* {98116AA0-BDBA-11d1-82C0-00A0C9697271} *)
11721
(* {98116AA0-BDBA-11d1-82C0-00A0C9697271} *)
11714
  TID_D3DRMExternalVisual: TGUID =
11722
  TID_D3DRMExternalVisual: TGUID =
11715
      (D1:$98116AA0;D2:$BDBA;D3:$11d1;D4:($82,$C0,$00,$A0,$C9,$69,$72,$71));
11723
      (D1:$98116AA0;D2:$BDBA;D3:$11d1;D4:($82,$C0,$00,$A0,$C9,$69,$72,$71));
11716
 
11724
 
11717
(* {7F0F21E0-BFE1-11d1-82C0-00A0C9697271} *)
11725
(* {7F0F21E0-BFE1-11d1-82C0-00A0C9697271} *)
11718
  TID_D3DRMStringProperty: TGUID =
11726
  TID_D3DRMStringProperty: TGUID =
11719
      (D1:$7f0f21e0;D2:$bfe1;D3:$11d1;D4:($82,$c0,$00,$a0,$c9,$69,$72,$71));
11727
      (D1:$7f0f21e0;D2:$bfe1;D3:$11d1;D4:($82,$c0,$00,$a0,$c9,$69,$72,$71));
11720
 
11728
 
11721
(* {7F0F21E1-BFE1-11d1-82C0-00A0C9697271} *)
11729
(* {7F0F21E1-BFE1-11d1-82C0-00A0C9697271} *)
11722
  TID_D3DRMPropertyBag: TGUID =
11730
  TID_D3DRMPropertyBag: TGUID =
11723
      (D1:$7f0f21e1;D2:$bfe1;D3:$11d1;D4:($82,$c0,$00,$a0,$c9,$69,$72,$71));
11731
      (D1:$7f0f21e1;D2:$bfe1;D3:$11d1;D4:($82,$c0,$00,$a0,$c9,$69,$72,$71));
11724
 
11732
 
11725
// {7F5D5EA0-D53A-11d1-82C0-00A0C9697271}
11733
// {7F5D5EA0-D53A-11d1-82C0-00A0C9697271}
11726
  TID_D3DRMRightHanded: TGUID =
11734
  TID_D3DRMRightHanded: TGUID =
11727
      (D1:$7f5d5ea0;D2:$d53a;D3:$11d1;D4:($82,$c0,$00,$a0,$c9,$69,$72,$71));
11735
      (D1:$7f5d5ea0;D2:$d53a;D3:$11d1;D4:($82,$c0,$00,$a0,$c9,$69,$72,$71));
11728
 
11736
 
11729
(*==========================================================================;
11737
(*==========================================================================;
11730
 *
11738
 *
11731
 *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
11739
 *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
11732
 *
11740
 *
11733
 *  File:       rmxftmpl.h
11741
 *  File:       rmxftmpl.h
11734
 *  Content:    D3DRM XFile templates in binary form
11742
 *  Content:    D3DRM XFile templates in binary form
11735
 *
11743
 *
11736
 ***************************************************************************)
11744
 ***************************************************************************)
11737
 
11745
 
11738
const
11746
const
11739
  D3DRM_XTEMPLATE_BYTES_2  = 3278;
11747
  D3DRM_XTEMPLATE_BYTES_2  = 3278;
11740
 
11748
 
11741
  D3DRM_XTEMPLATES_2: array [0..D3DRM_XTEMPLATE_BYTES_2-1] of byte = (
11749
  D3DRM_XTEMPLATES_2: array [0..D3DRM_XTEMPLATE_BYTES_2-1] of byte = (
11742
        $78, $6f, $66, $20, $30, $33, $30, $32, $62, $69, $6e, $20, $30, $30, $36, $34, $1f, 0, $1,
11750
        $78, $6f, $66, $20, $30, $33, $30, $32, $62, $69, $6e, $20, $30, $30, $36, $34, $1f, 0, $1,
11743
        0, $6, 0, 0, 0, $48, $65, $61, $64, $65, $72, $a, 0, $5, 0, $43, $ab, $82, $3d, $da,
11751
        0, $6, 0, 0, 0, $48, $65, $61, $64, $65, $72, $a, 0, $5, 0, $43, $ab, $82, $3d, $da,
11744
        $62, $cf, $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $28, 0, $1, 0, $5, 0, 0, 0, $6d,
11752
        $62, $cf, $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $28, 0, $1, 0, $5, 0, 0, 0, $6d,
11745
        $61, $6a, $6f, $72, $14, 0, $28, 0, $1, 0, $5, 0, 0, 0, $6d, $69, $6e, $6f, $72, $14,
11753
        $61, $6a, $6f, $72, $14, 0, $28, 0, $1, 0, $5, 0, 0, 0, $6d, $69, $6e, $6f, $72, $14,
11746
        0, $29, 0, $1, 0, $5, 0, 0, 0, $66, $6c, $61, $67, $73, $14, 0, $b, 0, $1f, 0,
11754
        0, $29, 0, $1, 0, $5, 0, 0, 0, $66, $6c, $61, $67, $73, $14, 0, $b, 0, $1f, 0,
11747
        $1, 0, $6, 0, 0, 0, $56, $65, $63, $74, $6f, $72, $a, 0, $5, 0, $5e, $ab, $82, $3d,
11755
        $1, 0, $6, 0, 0, 0, $56, $65, $63, $74, $6f, $72, $a, 0, $5, 0, $5e, $ab, $82, $3d,
11748
        $da, $62, $cf, $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $2a, 0, $1, 0, $1, 0, 0, 0,
11756
        $da, $62, $cf, $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $2a, 0, $1, 0, $1, 0, 0, 0,
11749
        $78, $14, 0, $2a, 0, $1, 0, $1, 0, 0, 0, $79, $14, 0, $2a, 0, $1, 0, $1, 0,
11757
        $78, $14, 0, $2a, 0, $1, 0, $1, 0, 0, 0, $79, $14, 0, $2a, 0, $1, 0, $1, 0,
11750
        0, 0, $7a, $14, 0, $b, 0, $1f, 0, $1, 0, $8, 0, 0, 0, $43, $6f, $6f, $72, $64,
11758
        0, 0, $7a, $14, 0, $b, 0, $1f, 0, $1, 0, $8, 0, 0, 0, $43, $6f, $6f, $72, $64,
11751
        $73, $32, $64, $a, 0, $5, 0, $44, $3f, $f2, $f6, $86, $76, $cf, $11, $8f, $52, 0, $40, $33,
11759
        $73, $32, $64, $a, 0, $5, 0, $44, $3f, $f2, $f6, $86, $76, $cf, $11, $8f, $52, 0, $40, $33,
11752
        $35, $94, $a3, $2a, 0, $1, 0, $1, 0, 0, 0, $75, $14, 0, $2a, 0, $1, 0, $1, 0,
11760
        $35, $94, $a3, $2a, 0, $1, 0, $1, 0, 0, 0, $75, $14, 0, $2a, 0, $1, 0, $1, 0,
11753
        0, 0, $76, $14, 0, $b, 0, $1f, 0, $1, 0, $9, 0, 0, 0, $4d, $61, $74, $72, $69,
11761
        0, 0, $76, $14, 0, $b, 0, $1f, 0, $1, 0, $9, 0, 0, 0, $4d, $61, $74, $72, $69,
11754
        $78, $34, $78, $34, $a, 0, $5, 0, $45, $3f, $f2, $f6, $86, $76, $cf, $11, $8f, $52, 0, $40,
11762
        $78, $34, $78, $34, $a, 0, $5, 0, $45, $3f, $f2, $f6, $86, $76, $cf, $11, $8f, $52, 0, $40,
11755
        $33, $35, $94, $a3, $34, 0, $2a, 0, $1, 0, $6, 0, 0, 0, $6d, $61, $74, $72, $69, $78,
11763
        $33, $35, $94, $a3, $34, 0, $2a, 0, $1, 0, $6, 0, 0, 0, $6d, $61, $74, $72, $69, $78,
11756
        $e, 0, $3, 0, $10, 0, 0, 0, $f, 0, $14, 0, $b, 0, $1f, 0, $1, 0, $9, 0,
11764
        $e, 0, $3, 0, $10, 0, 0, 0, $f, 0, $14, 0, $b, 0, $1f, 0, $1, 0, $9, 0,
11757
        0, 0, $43, $6f, $6c, $6f, $72, $52, $47, $42, $41, $a, 0, $5, 0, $e0, $44, $ff, $35, $7c,
11765
        0, 0, $43, $6f, $6c, $6f, $72, $52, $47, $42, $41, $a, 0, $5, 0, $e0, $44, $ff, $35, $7c,
11758
        $6c, $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $2a, 0, $1, 0, $3, 0, 0, 0, $72,
11766
        $6c, $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $2a, 0, $1, 0, $3, 0, 0, 0, $72,
11759
        $65, $64, $14, 0, $2a, 0, $1, 0, $5, 0, 0, 0, $67, $72, $65, $65, $6e, $14, 0, $2a,
11767
        $65, $64, $14, 0, $2a, 0, $1, 0, $5, 0, 0, 0, $67, $72, $65, $65, $6e, $14, 0, $2a,
11760
        0, $1, 0, $4, 0, 0, 0, $62, $6c, $75, $65, $14, 0, $2a, 0, $1, 0, $5, 0, 0,
11768
        0, $1, 0, $4, 0, 0, 0, $62, $6c, $75, $65, $14, 0, $2a, 0, $1, 0, $5, 0, 0,
11761
        0, $61, $6c, $70, $68, $61, $14, 0, $b, 0, $1f, 0, $1, 0, $8, 0, 0, 0, $43, $6f,
11769
        0, $61, $6c, $70, $68, $61, $14, 0, $b, 0, $1f, 0, $1, 0, $8, 0, 0, 0, $43, $6f,
11762
        $6c, $6f, $72, $52, $47, $42, $a, 0, $5, 0, $81, $6e, $e1, $d3, $35, $78, $cf, $11, $8f, $52,
11770
        $6c, $6f, $72, $52, $47, $42, $a, 0, $5, 0, $81, $6e, $e1, $d3, $35, $78, $cf, $11, $8f, $52,
11763
        0, $40, $33, $35, $94, $a3, $2a, 0, $1, 0, $3, 0, 0, 0, $72, $65, $64, $14, 0, $2a,
11771
        0, $40, $33, $35, $94, $a3, $2a, 0, $1, 0, $3, 0, 0, 0, $72, $65, $64, $14, 0, $2a,
11764
        0, $1, 0, $5, 0, 0, 0, $67, $72, $65, $65, $6e, $14, 0, $2a, 0, $1, 0, $4, 0,
11772
        0, $1, 0, $5, 0, 0, 0, $67, $72, $65, $65, $6e, $14, 0, $2a, 0, $1, 0, $4, 0,
11765
        0, 0, $62, $6c, $75, $65, $14, 0, $b, 0, $1f, 0, $1, 0, $c, 0, 0, 0, $49, $6e,
11773
        0, 0, $62, $6c, $75, $65, $14, 0, $b, 0, $1f, 0, $1, 0, $c, 0, 0, 0, $49, $6e,
11766
        $64, $65, $78, $65, $64, $43, $6f, $6c, $6f, $72, $a, 0, $5, 0, $20, $b8, $30, $16, $42, $78,
11774
        $64, $65, $78, $65, $64, $43, $6f, $6c, $6f, $72, $a, 0, $5, 0, $20, $b8, $30, $16, $42, $78,
11767
        $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $29, 0, $1, 0, $5, 0, 0, 0, $69, $6e,
11775
        $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $29, 0, $1, 0, $5, 0, 0, 0, $69, $6e,
11768
        $64, $65, $78, $14, 0, $1, 0, $9, 0, 0, 0, $43, $6f, $6c, $6f, $72, $52, $47, $42, $41,
11776
        $64, $65, $78, $14, 0, $1, 0, $9, 0, 0, 0, $43, $6f, $6c, $6f, $72, $52, $47, $42, $41,
11769
        $1, 0, $a, 0, 0, 0, $69, $6e, $64, $65, $78, $43, $6f, $6c, $6f, $72, $14, 0, $b, 0,
11777
        $1, 0, $a, 0, 0, 0, $69, $6e, $64, $65, $78, $43, $6f, $6c, $6f, $72, $14, 0, $b, 0,
11770
        $1f, 0, $1, 0, $7, 0, 0, 0, $42, $6f, $6f, $6c, $65, $61, $6e, $a, 0, $5, 0, $a0,
11778
        $1f, 0, $1, 0, $7, 0, 0, 0, $42, $6f, $6f, $6c, $65, $61, $6e, $a, 0, $5, 0, $a0,
11771
        $a6, $7d, $53, $37, $ca, $d0, $11, $94, $1c, 0, $80, $c8, $c, $fa, $7b, $29, 0, $1, 0, $9,
11779
        $a6, $7d, $53, $37, $ca, $d0, $11, $94, $1c, 0, $80, $c8, $c, $fa, $7b, $29, 0, $1, 0, $9,
11772
        0, 0, 0, $74, $72, $75, $65, $66, $61, $6c, $73, $65, $14, 0, $b, 0, $1f, 0, $1, 0,
11780
        0, 0, 0, $74, $72, $75, $65, $66, $61, $6c, $73, $65, $14, 0, $b, 0, $1f, 0, $1, 0,
11773
        $9, 0, 0, 0, $42, $6f, $6f, $6c, $65, $61, $6e, $32, $64, $a, 0, $5, 0, $63, $ae, $85,
11781
        $9, 0, 0, 0, $42, $6f, $6f, $6c, $65, $61, $6e, $32, $64, $a, 0, $5, 0, $63, $ae, $85,
11774
        $48, $e8, $78, $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $1, 0, $7, 0, 0, 0, $42,
11782
        $48, $e8, $78, $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $1, 0, $7, 0, 0, 0, $42,
11775
        $6f, $6f, $6c, $65, $61, $6e, $1, 0, $1, 0, 0, 0, $75, $14, 0, $1, 0, $7, 0, 0,
11783
        $6f, $6f, $6c, $65, $61, $6e, $1, 0, $1, 0, 0, 0, $75, $14, 0, $1, 0, $7, 0, 0,
11776
        0, $42, $6f, $6f, $6c, $65, $61, $6e, $1, 0, $1, 0, 0, 0, $76, $14, 0, $b, 0, $1f,
11784
        0, $42, $6f, $6f, $6c, $65, $61, $6e, $1, 0, $1, 0, 0, 0, $76, $14, 0, $b, 0, $1f,
11777
        0, $1, 0, $c, 0, 0, 0, $4d, $61, $74, $65, $72, $69, $61, $6c, $57, $72, $61, $70, $a,
11785
        0, $1, 0, $c, 0, 0, 0, $4d, $61, $74, $65, $72, $69, $61, $6c, $57, $72, $61, $70, $a,
11778
        0, $5, 0, $60, $ae, $85, $48, $e8, $78, $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $1,
11786
        0, $5, 0, $60, $ae, $85, $48, $e8, $78, $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $1,
11779
        0, $7, 0, 0, 0, $42, $6f, $6f, $6c, $65, $61, $6e, $1, 0, $1, 0, 0, 0, $75, $14,
11787
        0, $7, 0, 0, 0, $42, $6f, $6f, $6c, $65, $61, $6e, $1, 0, $1, 0, 0, 0, $75, $14,
11780
        0, $1, 0, $7, 0, 0, 0, $42, $6f, $6f, $6c, $65, $61, $6e, $1, 0, $1, 0, 0, 0,
11788
        0, $1, 0, $7, 0, 0, 0, $42, $6f, $6f, $6c, $65, $61, $6e, $1, 0, $1, 0, 0, 0,
11781
        $76, $14, 0, $b, 0, $1f, 0, $1, 0, $f, 0, 0, 0, $54, $65, $78, $74, $75, $72, $65,
11789
        $76, $14, 0, $b, 0, $1f, 0, $1, 0, $f, 0, 0, 0, $54, $65, $78, $74, $75, $72, $65,
11782
        $46, $69, $6c, $65, $6e, $61, $6d, $65, $a, 0, $5, 0, $e1, $90, $27, $a4, $10, $78, $cf, $11,
11790
        $46, $69, $6c, $65, $6e, $61, $6d, $65, $a, 0, $5, 0, $e1, $90, $27, $a4, $10, $78, $cf, $11,
11783
        $8f, $52, 0, $40, $33, $35, $94, $a3, $31, 0, $1, 0, $8, 0, 0, 0, $66, $69, $6c, $65,
11791
        $8f, $52, 0, $40, $33, $35, $94, $a3, $31, 0, $1, 0, $8, 0, 0, 0, $66, $69, $6c, $65,
11784
        $6e, $61, $6d, $65, $14, 0, $b, 0, $1f, 0, $1, 0, $8, 0, 0, 0, $4d, $61, $74, $65,
11792
        $6e, $61, $6d, $65, $14, 0, $b, 0, $1f, 0, $1, 0, $8, 0, 0, 0, $4d, $61, $74, $65,
11785
        $72, $69, $61, $6c, $a, 0, $5, 0, $4d, $ab, $82, $3d, $da, $62, $cf, $11, $ab, $39, 0, $20,
11793
        $72, $69, $61, $6c, $a, 0, $5, 0, $4d, $ab, $82, $3d, $da, $62, $cf, $11, $ab, $39, 0, $20,
11786
        $af, $71, $e4, $33, $1, 0, $9, 0, 0, 0, $43, $6f, $6c, $6f, $72, $52, $47, $42, $41, $1,
11794
        $af, $71, $e4, $33, $1, 0, $9, 0, 0, 0, $43, $6f, $6c, $6f, $72, $52, $47, $42, $41, $1,
11787
        0, $9, 0, 0, 0, $66, $61, $63, $65, $43, $6f, $6c, $6f, $72, $14, 0, $2a, 0, $1, 0,
11795
        0, $9, 0, 0, 0, $66, $61, $63, $65, $43, $6f, $6c, $6f, $72, $14, 0, $2a, 0, $1, 0,
11788
        $5, 0, 0, 0, $70, $6f, $77, $65, $72, $14, 0, $1, 0, $8, 0, 0, 0, $43, $6f, $6c,
11796
        $5, 0, 0, 0, $70, $6f, $77, $65, $72, $14, 0, $1, 0, $8, 0, 0, 0, $43, $6f, $6c,
11789
        $6f, $72, $52, $47, $42, $1, 0, $d, 0, 0, 0, $73, $70, $65, $63, $75, $6c, $61, $72, $43,
11797
        $6f, $72, $52, $47, $42, $1, 0, $d, 0, 0, 0, $73, $70, $65, $63, $75, $6c, $61, $72, $43,
11790
        $6f, $6c, $6f, $72, $14, 0, $1, 0, $8, 0, 0, 0, $43, $6f, $6c, $6f, $72, $52, $47, $42,
11798
        $6f, $6c, $6f, $72, $14, 0, $1, 0, $8, 0, 0, 0, $43, $6f, $6c, $6f, $72, $52, $47, $42,
11791
        $1, 0, $d, 0, 0, 0, $65, $6d, $69, $73, $73, $69, $76, $65, $43, $6f, $6c, $6f, $72, $14,
11799
        $1, 0, $d, 0, 0, 0, $65, $6d, $69, $73, $73, $69, $76, $65, $43, $6f, $6c, $6f, $72, $14,
11792
        0, $e, 0, $12, 0, $12, 0, $12, 0, $f, 0, $b, 0, $1f, 0, $1, 0, $8, 0, 0,
11800
        0, $e, 0, $12, 0, $12, 0, $12, 0, $f, 0, $b, 0, $1f, 0, $1, 0, $8, 0, 0,
11793
        0, $4d, $65, $73, $68, $46, $61, $63, $65, $a, 0, $5, 0, $5f, $ab, $82, $3d, $da, $62, $cf,
11801
        0, $4d, $65, $73, $68, $46, $61, $63, $65, $a, 0, $5, 0, $5f, $ab, $82, $3d, $da, $62, $cf,
11794
        $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $29, 0, $1, 0, $12, 0, 0, 0, $6e, $46, $61,
11802
        $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $29, 0, $1, 0, $12, 0, 0, 0, $6e, $46, $61,
11795
        $63, $65, $56, $65, $72, $74, $65, $78, $49, $6e, $64, $69, $63, $65, $73, $14, 0, $34, 0, $29,
11803
        $63, $65, $56, $65, $72, $74, $65, $78, $49, $6e, $64, $69, $63, $65, $73, $14, 0, $34, 0, $29,
11796
        0, $1, 0, $11, 0, 0, 0, $66, $61, $63, $65, $56, $65, $72, $74, $65, $78, $49, $6e, $64,
11804
        0, $1, 0, $11, 0, 0, 0, $66, $61, $63, $65, $56, $65, $72, $74, $65, $78, $49, $6e, $64,
11797
        $69, $63, $65, $73, $e, 0, $1, 0, $12, 0, 0, 0, $6e, $46, $61, $63, $65, $56, $65, $72,
11805
        $69, $63, $65, $73, $e, 0, $1, 0, $12, 0, 0, 0, $6e, $46, $61, $63, $65, $56, $65, $72,
11798
        $74, $65, $78, $49, $6e, $64, $69, $63, $65, $73, $f, 0, $14, 0, $b, 0, $1f, 0, $1, 0,
11806
        $74, $65, $78, $49, $6e, $64, $69, $63, $65, $73, $f, 0, $14, 0, $b, 0, $1f, 0, $1, 0,
11799
        $d, 0, 0, 0, $4d, $65, $73, $68, $46, $61, $63, $65, $57, $72, $61, $70, $73, $a, 0, $5,
11807
        $d, 0, 0, 0, $4d, $65, $73, $68, $46, $61, $63, $65, $57, $72, $61, $70, $73, $a, 0, $5,
11800
        0, $c0, $c5, $1e, $ed, $a8, $c0, $d0, $11, $94, $1c, 0, $80, $c8, $c, $fa, $7b, $29, 0, $1,
11808
        0, $c0, $c5, $1e, $ed, $a8, $c0, $d0, $11, $94, $1c, 0, $80, $c8, $c, $fa, $7b, $29, 0, $1,
11801
        0, $f, 0, 0, 0, $6e, $46, $61, $63, $65, $57, $72, $61, $70, $56, $61, $6c, $75, $65, $73,
11809
        0, $f, 0, 0, 0, $6e, $46, $61, $63, $65, $57, $72, $61, $70, $56, $61, $6c, $75, $65, $73,
11802
        $14, 0, $34, 0, $1, 0, $9, 0, 0, 0, $42, $6f, $6f, $6c, $65, $61, $6e, $32, $64, $1,
11810
        $14, 0, $34, 0, $1, 0, $9, 0, 0, 0, $42, $6f, $6f, $6c, $65, $61, $6e, $32, $64, $1,
11803
        0, $e, 0, 0, 0, $66, $61, $63, $65, $57, $72, $61, $70, $56, $61, $6c, $75, $65, $73, $e,
11811
        0, $e, 0, 0, 0, $66, $61, $63, $65, $57, $72, $61, $70, $56, $61, $6c, $75, $65, $73, $e,
11804
        0, $1, 0, $f, 0, 0, 0, $6e, $46, $61, $63, $65, $57, $72, $61, $70, $56, $61, $6c, $75,
11812
        0, $1, 0, $f, 0, 0, 0, $6e, $46, $61, $63, $65, $57, $72, $61, $70, $56, $61, $6c, $75,
11805
        $65, $73, $f, 0, $14, 0, $b, 0, $1f, 0, $1, 0, $11, 0, 0, 0, $4d, $65, $73, $68,
11813
        $65, $73, $f, 0, $14, 0, $b, 0, $1f, 0, $1, 0, $11, 0, 0, 0, $4d, $65, $73, $68,
11806
        $54, $65, $78, $74, $75, $72, $65, $43, $6f, $6f, $72, $64, $73, $a, 0, $5, 0, $40, $3f, $f2,
11814
        $54, $65, $78, $74, $75, $72, $65, $43, $6f, $6f, $72, $64, $73, $a, 0, $5, 0, $40, $3f, $f2,
11807
        $f6, $86, $76, $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $29, 0, $1, 0, $e, 0, 0,
11815
        $f6, $86, $76, $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $29, 0, $1, 0, $e, 0, 0,
11808
        0, $6e, $54, $65, $78, $74, $75, $72, $65, $43, $6f, $6f, $72, $64, $73, $14, 0, $34, 0, $1,
11816
        0, $6e, $54, $65, $78, $74, $75, $72, $65, $43, $6f, $6f, $72, $64, $73, $14, 0, $34, 0, $1,
11809
        0, $8, 0, 0, 0, $43, $6f, $6f, $72, $64, $73, $32, $64, $1, 0, $d, 0, 0, 0, $74,
11817
        0, $8, 0, 0, 0, $43, $6f, $6f, $72, $64, $73, $32, $64, $1, 0, $d, 0, 0, 0, $74,
11810
        $65, $78, $74, $75, $72, $65, $43, $6f, $6f, $72, $64, $73, $e, 0, $1, 0, $e, 0, 0, 0,
11818
        $65, $78, $74, $75, $72, $65, $43, $6f, $6f, $72, $64, $73, $e, 0, $1, 0, $e, 0, 0, 0,
11811
        $6e, $54, $65, $78, $74, $75, $72, $65, $43, $6f, $6f, $72, $64, $73, $f, 0, $14, 0, $b, 0,
11819
        $6e, $54, $65, $78, $74, $75, $72, $65, $43, $6f, $6f, $72, $64, $73, $f, 0, $14, 0, $b, 0,
11812
        $1f, 0, $1, 0, $10, 0, 0, 0, $4d, $65, $73, $68, $4d, $61, $74, $65, $72, $69, $61, $6c,
11820
        $1f, 0, $1, 0, $10, 0, 0, 0, $4d, $65, $73, $68, $4d, $61, $74, $65, $72, $69, $61, $6c,
11813
        $4c, $69, $73, $74, $a, 0, $5, 0, $42, $3f, $f2, $f6, $86, $76, $cf, $11, $8f, $52, 0, $40,
11821
        $4c, $69, $73, $74, $a, 0, $5, 0, $42, $3f, $f2, $f6, $86, $76, $cf, $11, $8f, $52, 0, $40,
11814
        $33, $35, $94, $a3, $29, 0, $1, 0, $a, 0, 0, 0, $6e, $4d, $61, $74, $65, $72, $69, $61,
11822
        $33, $35, $94, $a3, $29, 0, $1, 0, $a, 0, 0, 0, $6e, $4d, $61, $74, $65, $72, $69, $61,
11815
        $6c, $73, $14, 0, $29, 0, $1, 0, $c, 0, 0, 0, $6e, $46, $61, $63, $65, $49, $6e, $64,
11823
        $6c, $73, $14, 0, $29, 0, $1, 0, $c, 0, 0, 0, $6e, $46, $61, $63, $65, $49, $6e, $64,
11816
        $65, $78, $65, $73, $14, 0, $34, 0, $29, 0, $1, 0, $b, 0, 0, 0, $66, $61, $63, $65,
11824
        $65, $78, $65, $73, $14, 0, $34, 0, $29, 0, $1, 0, $b, 0, 0, 0, $66, $61, $63, $65,
11817
        $49, $6e, $64, $65, $78, $65, $73, $e, 0, $1, 0, $c, 0, 0, 0, $6e, $46, $61, $63, $65,
11825
        $49, $6e, $64, $65, $78, $65, $73, $e, 0, $1, 0, $c, 0, 0, 0, $6e, $46, $61, $63, $65,
11818
        $49, $6e, $64, $65, $78, $65, $73, $f, 0, $14, 0, $e, 0, $1, 0, $8, 0, 0, 0, $4d,
11826
        $49, $6e, $64, $65, $78, $65, $73, $f, 0, $14, 0, $e, 0, $1, 0, $8, 0, 0, 0, $4d,
11819
        $61, $74, $65, $72, $69, $61, $6c, $f, 0, $b, 0, $1f, 0, $1, 0, $b, 0, 0, 0, $4d,
11827
        $61, $74, $65, $72, $69, $61, $6c, $f, 0, $b, 0, $1f, 0, $1, 0, $b, 0, 0, 0, $4d,
11820
        $65, $73, $68, $4e, $6f, $72, $6d, $61, $6c, $73, $a, 0, $5, 0, $43, $3f, $f2, $f6, $86, $76,
11828
        $65, $73, $68, $4e, $6f, $72, $6d, $61, $6c, $73, $a, 0, $5, 0, $43, $3f, $f2, $f6, $86, $76,
11821
        $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $29, 0, $1, 0, $8, 0, 0, 0, $6e, $4e,
11829
        $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $29, 0, $1, 0, $8, 0, 0, 0, $6e, $4e,
11822
        $6f, $72, $6d, $61, $6c, $73, $14, 0, $34, 0, $1, 0, $6, 0, 0, 0, $56, $65, $63, $74,
11830
        $6f, $72, $6d, $61, $6c, $73, $14, 0, $34, 0, $1, 0, $6, 0, 0, 0, $56, $65, $63, $74,
11823
        $6f, $72, $1, 0, $7, 0, 0, 0, $6e, $6f, $72, $6d, $61, $6c, $73, $e, 0, $1, 0, $8,
11831
        $6f, $72, $1, 0, $7, 0, 0, 0, $6e, $6f, $72, $6d, $61, $6c, $73, $e, 0, $1, 0, $8,
11824
        0, 0, 0, $6e, $4e, $6f, $72, $6d, $61, $6c, $73, $f, 0, $14, 0, $29, 0, $1, 0, $c,
11832
        0, 0, 0, $6e, $4e, $6f, $72, $6d, $61, $6c, $73, $f, 0, $14, 0, $29, 0, $1, 0, $c,
11825
        0, 0, 0, $6e, $46, $61, $63, $65, $4e, $6f, $72, $6d, $61, $6c, $73, $14, 0, $34, 0, $1,
11833
        0, 0, 0, $6e, $46, $61, $63, $65, $4e, $6f, $72, $6d, $61, $6c, $73, $14, 0, $34, 0, $1,
11826
        0, $8, 0, 0, 0, $4d, $65, $73, $68, $46, $61, $63, $65, $1, 0, $b, 0, 0, 0, $66,
11834
        0, $8, 0, 0, 0, $4d, $65, $73, $68, $46, $61, $63, $65, $1, 0, $b, 0, 0, 0, $66,
11827
        $61, $63, $65, $4e, $6f, $72, $6d, $61, $6c, $73, $e, 0, $1, 0, $c, 0, 0, 0, $6e, $46,
11835
        $61, $63, $65, $4e, $6f, $72, $6d, $61, $6c, $73, $e, 0, $1, 0, $c, 0, 0, 0, $6e, $46,
11828
        $61, $63, $65, $4e, $6f, $72, $6d, $61, $6c, $73, $f, 0, $14, 0, $b, 0, $1f, 0, $1, 0,
11836
        $61, $63, $65, $4e, $6f, $72, $6d, $61, $6c, $73, $f, 0, $14, 0, $b, 0, $1f, 0, $1, 0,
11829
        $10, 0, 0, 0, $4d, $65, $73, $68, $56, $65, $72, $74, $65, $78, $43, $6f, $6c, $6f, $72, $73,
11837
        $10, 0, 0, 0, $4d, $65, $73, $68, $56, $65, $72, $74, $65, $78, $43, $6f, $6c, $6f, $72, $73,
11830
        $a, 0, $5, 0, $21, $b8, $30, $16, $42, $78, $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3,
11838
        $a, 0, $5, 0, $21, $b8, $30, $16, $42, $78, $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3,
11831
        $29, 0, $1, 0, $d, 0, 0, 0, $6e, $56, $65, $72, $74, $65, $78, $43, $6f, $6c, $6f, $72,
11839
        $29, 0, $1, 0, $d, 0, 0, 0, $6e, $56, $65, $72, $74, $65, $78, $43, $6f, $6c, $6f, $72,
11832
        $73, $14, 0, $34, 0, $1, 0, $c, 0, 0, 0, $49, $6e, $64, $65, $78, $65, $64, $43, $6f,
11840
        $73, $14, 0, $34, 0, $1, 0, $c, 0, 0, 0, $49, $6e, $64, $65, $78, $65, $64, $43, $6f,
11833
        $6c, $6f, $72, $1, 0, $c, 0, 0, 0, $76, $65, $72, $74, $65, $78, $43, $6f, $6c, $6f, $72,
11841
        $6c, $6f, $72, $1, 0, $c, 0, 0, 0, $76, $65, $72, $74, $65, $78, $43, $6f, $6c, $6f, $72,
11834
        $73, $e, 0, $1, 0, $d, 0, 0, 0, $6e, $56, $65, $72, $74, $65, $78, $43, $6f, $6c, $6f,
11842
        $73, $e, 0, $1, 0, $d, 0, 0, 0, $6e, $56, $65, $72, $74, $65, $78, $43, $6f, $6c, $6f,
11835
        $72, $73, $f, 0, $14, 0, $b, 0, $1f, 0, $1, 0, $4, 0, 0, 0, $4d, $65, $73, $68,
11843
        $72, $73, $f, 0, $14, 0, $b, 0, $1f, 0, $1, 0, $4, 0, 0, 0, $4d, $65, $73, $68,
11836
        $a, 0, $5, 0, $44, $ab, $82, $3d, $da, $62, $cf, $11, $ab, $39, 0, $20, $af, $71, $e4, $33,
11844
        $a, 0, $5, 0, $44, $ab, $82, $3d, $da, $62, $cf, $11, $ab, $39, 0, $20, $af, $71, $e4, $33,
11837
        $29, 0, $1, 0, $9, 0, 0, 0, $6e, $56, $65, $72, $74, $69, $63, $65, $73, $14, 0, $34,
11845
        $29, 0, $1, 0, $9, 0, 0, 0, $6e, $56, $65, $72, $74, $69, $63, $65, $73, $14, 0, $34,
11838
        0, $1, 0, $6, 0, 0, 0, $56, $65, $63, $74, $6f, $72, $1, 0, $8, 0, 0, 0, $76,
11846
        0, $1, 0, $6, 0, 0, 0, $56, $65, $63, $74, $6f, $72, $1, 0, $8, 0, 0, 0, $76,
11839
        $65, $72, $74, $69, $63, $65, $73, $e, 0, $1, 0, $9, 0, 0, 0, $6e, $56, $65, $72, $74,
11847
        $65, $72, $74, $69, $63, $65, $73, $e, 0, $1, 0, $9, 0, 0, 0, $6e, $56, $65, $72, $74,
11840
        $69, $63, $65, $73, $f, 0, $14, 0, $29, 0, $1, 0, $6, 0, 0, 0, $6e, $46, $61, $63,
11848
        $69, $63, $65, $73, $f, 0, $14, 0, $29, 0, $1, 0, $6, 0, 0, 0, $6e, $46, $61, $63,
11841
        $65, $73, $14, 0, $34, 0, $1, 0, $8, 0, 0, 0, $4d, $65, $73, $68, $46, $61, $63, $65,
11849
        $65, $73, $14, 0, $34, 0, $1, 0, $8, 0, 0, 0, $4d, $65, $73, $68, $46, $61, $63, $65,
11842
        $1, 0, $5, 0, 0, 0, $66, $61, $63, $65, $73, $e, 0, $1, 0, $6, 0, 0, 0, $6e,
11850
        $1, 0, $5, 0, 0, 0, $66, $61, $63, $65, $73, $e, 0, $1, 0, $6, 0, 0, 0, $6e,
11843
        $46, $61, $63, $65, $73, $f, 0, $14, 0, $e, 0, $12, 0, $12, 0, $12, 0, $f, 0, $b,
11851
        $46, $61, $63, $65, $73, $f, 0, $14, 0, $e, 0, $12, 0, $12, 0, $12, 0, $f, 0, $b,
11844
        0, $1f, 0, $1, 0, $14, 0, 0, 0, $46, $72, $61, $6d, $65, $54, $72, $61, $6e, $73, $66,
11852
        0, $1f, 0, $1, 0, $14, 0, 0, 0, $46, $72, $61, $6d, $65, $54, $72, $61, $6e, $73, $66,
11845
        $6f, $72, $6d, $4d, $61, $74, $72, $69, $78, $a, 0, $5, 0, $41, $3f, $f2, $f6, $86, $76, $cf,
11853
        $6f, $72, $6d, $4d, $61, $74, $72, $69, $78, $a, 0, $5, 0, $41, $3f, $f2, $f6, $86, $76, $cf,
11846
        $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $1, 0, $9, 0, 0, 0, $4d, $61, $74, $72, $69,
11854
        $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $1, 0, $9, 0, 0, 0, $4d, $61, $74, $72, $69,
11847
        $78, $34, $78, $34, $1, 0, $b, 0, 0, 0, $66, $72, $61, $6d, $65, $4d, $61, $74, $72, $69,
11855
        $78, $34, $78, $34, $1, 0, $b, 0, 0, 0, $66, $72, $61, $6d, $65, $4d, $61, $74, $72, $69,
11848
        $78, $14, 0, $b, 0, $1f, 0, $1, 0, $5, 0, 0, 0, $46, $72, $61, $6d, $65, $a, 0,
11856
        $78, $14, 0, $b, 0, $1f, 0, $1, 0, $5, 0, 0, 0, $46, $72, $61, $6d, $65, $a, 0,
11849
        $5, 0, $46, $ab, $82, $3d, $da, $62, $cf, $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $e, 0,
11857
        $5, 0, $46, $ab, $82, $3d, $da, $62, $cf, $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $e, 0,
11850
        $12, 0, $12, 0, $12, 0, $f, 0, $b, 0, $1f, 0, $1, 0, $9, 0, 0, 0, $46, $6c,
11858
        $12, 0, $12, 0, $12, 0, $f, 0, $b, 0, $1f, 0, $1, 0, $9, 0, 0, 0, $46, $6c,
11851
        $6f, $61, $74, $4b, $65, $79, $73, $a, 0, $5, 0, $a9, $46, $dd, $10, $5b, $77, $cf, $11, $8f,
11859
        $6f, $61, $74, $4b, $65, $79, $73, $a, 0, $5, 0, $a9, $46, $dd, $10, $5b, $77, $cf, $11, $8f,
11852
        $52, 0, $40, $33, $35, $94, $a3, $29, 0, $1, 0, $7, 0, 0, 0, $6e, $56, $61, $6c, $75,
11860
        $52, 0, $40, $33, $35, $94, $a3, $29, 0, $1, 0, $7, 0, 0, 0, $6e, $56, $61, $6c, $75,
11853
        $65, $73, $14, 0, $34, 0, $2a, 0, $1, 0, $6, 0, 0, 0, $76, $61, $6c, $75, $65, $73,
11861
        $65, $73, $14, 0, $34, 0, $2a, 0, $1, 0, $6, 0, 0, 0, $76, $61, $6c, $75, $65, $73,
11854
        $e, 0, $1, 0, $7, 0, 0, 0, $6e, $56, $61, $6c, $75, $65, $73, $f, 0, $14, 0, $b,
11862
        $e, 0, $1, 0, $7, 0, 0, 0, $6e, $56, $61, $6c, $75, $65, $73, $f, 0, $14, 0, $b,
11855
        0, $1f, 0, $1, 0, $e, 0, 0, 0, $54, $69, $6d, $65, $64, $46, $6c, $6f, $61, $74, $4b,
11863
        0, $1f, 0, $1, 0, $e, 0, 0, 0, $54, $69, $6d, $65, $64, $46, $6c, $6f, $61, $74, $4b,
11856
        $65, $79, $73, $a, 0, $5, 0, $80, $b1, $6, $f4, $3b, $7b, $cf, $11, $8f, $52, 0, $40, $33,
11864
        $65, $79, $73, $a, 0, $5, 0, $80, $b1, $6, $f4, $3b, $7b, $cf, $11, $8f, $52, 0, $40, $33,
11857
        $35, $94, $a3, $29, 0, $1, 0, $4, 0, 0, 0, $74, $69, $6d, $65, $14, 0, $1, 0, $9,
11865
        $35, $94, $a3, $29, 0, $1, 0, $4, 0, 0, 0, $74, $69, $6d, $65, $14, 0, $1, 0, $9,
11858
        0, 0, 0, $46, $6c, $6f, $61, $74, $4b, $65, $79, $73, $1, 0, $6, 0, 0, 0, $74, $66,
11866
        0, 0, 0, $46, $6c, $6f, $61, $74, $4b, $65, $79, $73, $1, 0, $6, 0, 0, 0, $74, $66,
11859
        $6b, $65, $79, $73, $14, 0, $b, 0, $1f, 0, $1, 0, $c, 0, 0, 0, $41, $6e, $69, $6d,
11867
        $6b, $65, $79, $73, $14, 0, $b, 0, $1f, 0, $1, 0, $c, 0, 0, 0, $41, $6e, $69, $6d,
11860
        $61, $74, $69, $6f, $6e, $4b, $65, $79, $a, 0, $5, 0, $a8, $46, $dd, $10, $5b, $77, $cf, $11,
11868
        $61, $74, $69, $6f, $6e, $4b, $65, $79, $a, 0, $5, 0, $a8, $46, $dd, $10, $5b, $77, $cf, $11,
11861
        $8f, $52, 0, $40, $33, $35, $94, $a3, $29, 0, $1, 0, $7, 0, 0, 0, $6b, $65, $79, $54,
11869
        $8f, $52, 0, $40, $33, $35, $94, $a3, $29, 0, $1, 0, $7, 0, 0, 0, $6b, $65, $79, $54,
11862
        $79, $70, $65, $14, 0, $29, 0, $1, 0, $5, 0, 0, 0, $6e, $4b, $65, $79, $73, $14, 0,
11870
        $79, $70, $65, $14, 0, $29, 0, $1, 0, $5, 0, 0, 0, $6e, $4b, $65, $79, $73, $14, 0,
11863
        $34, 0, $1, 0, $e, 0, 0, 0, $54, $69, $6d, $65, $64, $46, $6c, $6f, $61, $74, $4b, $65,
11871
        $34, 0, $1, 0, $e, 0, 0, 0, $54, $69, $6d, $65, $64, $46, $6c, $6f, $61, $74, $4b, $65,
11864
        $79, $73, $1, 0, $4, 0, 0, 0, $6b, $65, $79, $73, $e, 0, $1, 0, $5, 0, 0, 0,
11872
        $79, $73, $1, 0, $4, 0, 0, 0, $6b, $65, $79, $73, $e, 0, $1, 0, $5, 0, 0, 0,
11865
        $6e, $4b, $65, $79, $73, $f, 0, $14, 0, $b, 0, $1f, 0, $1, 0, $10, 0, 0, 0, $41,
11873
        $6e, $4b, $65, $79, $73, $f, 0, $14, 0, $b, 0, $1f, 0, $1, 0, $10, 0, 0, 0, $41,
11866
        $6e, $69, $6d, $61, $74, $69, $6f, $6e, $4f, $70, $74, $69, $6f, $6e, $73, $a, 0, $5, 0, $c0,
11874
        $6e, $69, $6d, $61, $74, $69, $6f, $6e, $4f, $70, $74, $69, $6f, $6e, $73, $a, 0, $5, 0, $c0,
11867
        $56, $bf, $e2, $f, $84, $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $29, 0, $1, 0, $a,
11875
        $56, $bf, $e2, $f, $84, $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $29, 0, $1, 0, $a,
11868
        0, 0, 0, $6f, $70, $65, $6e, $63, $6c, $6f, $73, $65, $64, $14, 0, $29, 0, $1, 0, $f,
11876
        0, 0, 0, $6f, $70, $65, $6e, $63, $6c, $6f, $73, $65, $64, $14, 0, $29, 0, $1, 0, $f,
11869
        0, 0, 0, $70, $6f, $73, $69, $74, $69, $6f, $6e, $71, $75, $61, $6c, $69, $74, $79, $14, 0,
11877
        0, 0, 0, $70, $6f, $73, $69, $74, $69, $6f, $6e, $71, $75, $61, $6c, $69, $74, $79, $14, 0,
11870
        $b, 0, $1f, 0, $1, 0, $9, 0, 0, 0, $41, $6e, $69, $6d, $61, $74, $69, $6f, $6e, $a,
11878
        $b, 0, $1f, 0, $1, 0, $9, 0, 0, 0, $41, $6e, $69, $6d, $61, $74, $69, $6f, $6e, $a,
11871
        0, $5, 0, $4f, $ab, $82, $3d, $da, $62, $cf, $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $e,
11879
        0, $5, 0, $4f, $ab, $82, $3d, $da, $62, $cf, $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $e,
11872
        0, $12, 0, $12, 0, $12, 0, $f, 0, $b, 0, $1f, 0, $1, 0, $c, 0, 0, 0, $41,
11880
        0, $12, 0, $12, 0, $12, 0, $f, 0, $b, 0, $1f, 0, $1, 0, $c, 0, 0, 0, $41,
11873
        $6e, $69, $6d, $61, $74, $69, $6f, $6e, $53, $65, $74, $a, 0, $5, 0, $50, $ab, $82, $3d, $da,
11881
        $6e, $69, $6d, $61, $74, $69, $6f, $6e, $53, $65, $74, $a, 0, $5, 0, $50, $ab, $82, $3d, $da,
11874
        $62, $cf, $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $e, 0, $1, 0, $9, 0, 0, 0, $41,
11882
        $62, $cf, $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $e, 0, $1, 0, $9, 0, 0, 0, $41,
11875
        $6e, $69, $6d, $61, $74, $69, $6f, $6e, $f, 0, $b, 0, $1f, 0, $1, 0, $a, 0, 0, 0,
11883
        $6e, $69, $6d, $61, $74, $69, $6f, $6e, $f, 0, $b, 0, $1f, 0, $1, 0, $a, 0, 0, 0,
11876
        $49, $6e, $6c, $69, $6e, $65, $44, $61, $74, $61, $a, 0, $5, 0, $a0, $ee, $23, $3a, $b1, $94,
11884
        $49, $6e, $6c, $69, $6e, $65, $44, $61, $74, $61, $a, 0, $5, 0, $a0, $ee, $23, $3a, $b1, $94,
11877
        $d0, $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $e, 0, $1, 0, $6, 0, 0, 0, $42, $49,
11885
        $d0, $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $e, 0, $1, 0, $6, 0, 0, 0, $42, $49,
11878
        $4e, $41, $52, $59, $f, 0, $b, 0, $1f, 0, $1, 0, $3, 0, 0, 0, $55, $72, $6c, $a,
11886
        $4e, $41, $52, $59, $f, 0, $b, 0, $1f, 0, $1, 0, $3, 0, 0, 0, $55, $72, $6c, $a,
11879
        0, $5, 0, $a1, $ee, $23, $3a, $b1, $94, $d0, $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $29,
11887
        0, $5, 0, $a1, $ee, $23, $3a, $b1, $94, $d0, $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $29,
11880
        0, $1, 0, $5, 0, 0, 0, $6e, $55, $72, $6c, $73, $14, 0, $34, 0, $31, 0, $1, 0,
11888
        0, $1, 0, $5, 0, 0, 0, $6e, $55, $72, $6c, $73, $14, 0, $34, 0, $31, 0, $1, 0,
11881
        $4, 0, 0, 0, $75, $72, $6c, $73, $e, 0, $1, 0, $5, 0, 0, 0, $6e, $55, $72, $6c,
11889
        $4, 0, 0, 0, $75, $72, $6c, $73, $e, 0, $1, 0, $5, 0, 0, 0, $6e, $55, $72, $6c,
11882
        $73, $f, 0, $14, 0, $b, 0, $1f, 0, $1, 0, $f, 0, 0, 0, $50, $72, $6f, $67, $72,
11890
        $73, $f, 0, $14, 0, $b, 0, $1f, 0, $1, 0, $f, 0, 0, 0, $50, $72, $6f, $67, $72,
11883
        $65, $73, $73, $69, $76, $65, $4d, $65, $73, $68, $a, 0, $5, 0, $60, $c3, $63, $8a, $7d, $99,
11891
        $65, $73, $73, $69, $76, $65, $4d, $65, $73, $68, $a, 0, $5, 0, $60, $c3, $63, $8a, $7d, $99,
11884
        $d0, $11, $94, $1c, 0, $80, $c8, $c, $fa, $7b, $e, 0, $1, 0, $3, 0, 0, 0, $55, $72,
11892
        $d0, $11, $94, $1c, 0, $80, $c8, $c, $fa, $7b, $e, 0, $1, 0, $3, 0, 0, 0, $55, $72,
11885
        $6c, $13, 0, $1, 0, $a, 0, 0, 0, $49, $6e, $6c, $69, $6e, $65, $44, $61, $74, $61, $f,
11893
        $6c, $13, 0, $1, 0, $a, 0, 0, 0, $49, $6e, $6c, $69, $6e, $65, $44, $61, $74, $61, $f,
11886
        0, $b, 0, $1f, 0, $1, 0, $4, 0, 0, 0, $47, $75, $69, $64, $a, 0, $5, 0, $e0,
11894
        0, $b, 0, $1f, 0, $1, 0, $4, 0, 0, 0, $47, $75, $69, $64, $a, 0, $5, 0, $e0,
11887
        $90, $27, $a4, $10, $78, $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $29, 0, $1, 0, $5,
11895
        $90, $27, $a4, $10, $78, $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $29, 0, $1, 0, $5,
11888
        0, 0, 0, $64, $61, $74, $61, $31, $14, 0, $28, 0, $1, 0, $5, 0, 0, 0, $64, $61,
11896
        0, 0, 0, $64, $61, $74, $61, $31, $14, 0, $28, 0, $1, 0, $5, 0, 0, 0, $64, $61,
11889
        $74, $61, $32, $14, 0, $28, 0, $1, 0, $5, 0, 0, 0, $64, $61, $74, $61, $33, $14, 0,
11897
        $74, $61, $32, $14, 0, $28, 0, $1, 0, $5, 0, 0, 0, $64, $61, $74, $61, $33, $14, 0,
11890
        $34, 0, $2d, 0, $1, 0, $5, 0, 0, 0, $64, $61, $74, $61, $34, $e, 0, $3, 0, $8,
11898
        $34, 0, $2d, 0, $1, 0, $5, 0, 0, 0, $64, $61, $74, $61, $34, $e, 0, $3, 0, $8,
11891
        0, 0, 0, $f, 0, $14, 0, $b, 0, $1f, 0, $1, 0, $e, 0, 0, 0, $53, $74, $72,
11899
        0, 0, 0, $f, 0, $14, 0, $b, 0, $1f, 0, $1, 0, $e, 0, 0, 0, $53, $74, $72,
11892
        $69, $6e, $67, $50, $72, $6f, $70, $65, $72, $74, $79, $a, 0, $5, 0, $e0, $21, $f, $7f, $e1,
11900
        $69, $6e, $67, $50, $72, $6f, $70, $65, $72, $74, $79, $a, 0, $5, 0, $e0, $21, $f, $7f, $e1,
11893
        $bf, $d1, $11, $82, $c0, 0, $a0, $c9, $69, $72, $71, $31, 0, $1, 0, $3, 0, 0, 0, $6b,
11901
        $bf, $d1, $11, $82, $c0, 0, $a0, $c9, $69, $72, $71, $31, 0, $1, 0, $3, 0, 0, 0, $6b,
11894
        $65, $79, $14, 0, $31, 0, $1, 0, $5, 0, 0, 0, $76, $61, $6c, $75, $65, $14, 0, $b,
11902
        $65, $79, $14, 0, $31, 0, $1, 0, $5, 0, 0, 0, $76, $61, $6c, $75, $65, $14, 0, $b,
11895
        0, $1f, 0, $1, 0, $b, 0, 0, 0, $50, $72, $6f, $70, $65, $72, $74, $79, $42, $61, $67,
11903
        0, $1f, 0, $1, 0, $b, 0, 0, 0, $50, $72, $6f, $70, $65, $72, $74, $79, $42, $61, $67,
11896
        $a, 0, $5, 0, $e1, $21, $f, $7f, $e1, $bf, $d1, $11, $82, $c0, 0, $a0, $c9, $69, $72, $71,
11904
        $a, 0, $5, 0, $e1, $21, $f, $7f, $e1, $bf, $d1, $11, $82, $c0, 0, $a0, $c9, $69, $72, $71,
11897
        $e, 0, $1, 0, $e, 0, 0, 0, $53, $74, $72, $69, $6e, $67, $50, $72, $6f, $70, $65, $72,
11905
        $e, 0, $1, 0, $e, 0, 0, 0, $53, $74, $72, $69, $6e, $67, $50, $72, $6f, $70, $65, $72,
11898
        $74, $79, $f, 0, $b, 0, $1f, 0, $1, 0, $e, 0, 0, 0, $45, $78, $74, $65, $72, $6e,
11906
        $74, $79, $f, 0, $b, 0, $1f, 0, $1, 0, $e, 0, 0, 0, $45, $78, $74, $65, $72, $6e,
11899
        $61, $6c, $56, $69, $73, $75, $61, $6c, $a, 0, $5, 0, $a0, $6a, $11, $98, $ba, $bd, $d1, $11,
11907
        $61, $6c, $56, $69, $73, $75, $61, $6c, $a, 0, $5, 0, $a0, $6a, $11, $98, $ba, $bd, $d1, $11,
11900
        $82, $c0, 0, $a0, $c9, $69, $72, $71, $1, 0, $4, 0, 0, 0, $47, $75, $69, $64, $1, 0,
11908
        $82, $c0, 0, $a0, $c9, $69, $72, $71, $1, 0, $4, 0, 0, 0, $47, $75, $69, $64, $1, 0,
11901
        $12, 0, 0, 0, $67, $75, $69, $64, $45, $78, $74, $65, $72, $6e, $61, $6c, $56, $69, $73, $75,
11909
        $12, 0, 0, 0, $67, $75, $69, $64, $45, $78, $74, $65, $72, $6e, $61, $6c, $56, $69, $73, $75,
11902
        $61, $6c, $14, 0, $e, 0, $12, 0, $12, 0, $12, 0, $f, 0, $b, 0, $1f, 0, $1, 0,
11910
        $61, $6c, $14, 0, $e, 0, $12, 0, $12, 0, $12, 0, $f, 0, $b, 0, $1f, 0, $1, 0,
11903
        $b, 0, 0, 0, $52, $69, $67, $68, $74, $48, $61, $6e, $64, $65, $64, $a, 0, $5, 0, $a0,
11911
        $b, 0, 0, 0, $52, $69, $67, $68, $74, $48, $61, $6e, $64, $65, $64, $a, 0, $5, 0, $a0,
11904
        $5e, $5d, $7f, $3a, $d5, $d1, $11, $82, $c0, 0, $a0, $c9, $69, $72, $71, $29, 0, $1, 0, $c,
11912
        $5e, $5d, $7f, $3a, $d5, $d1, $11, $82, $c0, 0, $a0, $c9, $69, $72, $71, $29, 0, $1, 0, $c,
11905
        0, 0, 0, $62, $52, $69, $67, $68, $74, $48, $61, $6e, $64, $65, $64, $14, 0, $b, 0);
11913
        0, 0, 0, $62, $52, $69, $67, $68, $74, $48, $61, $6e, $64, $65, $64, $14, 0, $b, 0);
11906
 
11914
 
11907
//---------------
11915
//---------------
11908
{$ENDIF}
11916
{$ENDIF}
11909
//DirectInput file
11917
//DirectInput file
11910
(*==========================================================================;
11918
(*==========================================================================;
11911
 *
11919
 *
11912
 *  Copyright (C) 1996-1999 Microsoft Corporation.  All Rights Reserved.
11920
 *  Copyright (C) 1996-1999 Microsoft Corporation.  All Rights Reserved.
11913
 *
11921
 *
11914
 *  File:       dinput.h
11922
 *  File:       dinput.h
11915
 *  Content:    DirectInput include file
11923
 *  Content:    DirectInput include file
11916
 *
11924
 *
11917
 *  DirectX 7.0 Delphi adaptation by Erik Unger, input format
11925
 *  DirectX 7.0 Delphi adaptation by Erik Unger, input format
11918
 *  variable structure & other fixups by Arne Schäpers (as)
11926
 *  variable structure & other fixups by Arne Schäpers (as)
11919
 *
11927
 *
11920
 *  Modified: 10-Sep-2000
11928
 *  Modified: 10-Sep-2000
11921
 *
11929
 *
11922
 *  Download: http://www.delphi-jedi.org/DelphiGraphics/
11930
 *  Download: http://www.delphi-jedi.org/DelphiGraphics/
11923
 *  E-Mail: DelphiDirectX@next-reality.com
11931
 *  E-Mail: DelphiDirectX@next-reality.com
11924
 *          a.schaepers@digitalpublishing.de            
11932
 *          a.schaepers@digitalpublishing.de            
11925
 *
11933
 *
11926
 ***************************************************************************)
11934
 ***************************************************************************)
11927
 
11935
 
11928
{ Some notes from as:
11936
{ Some notes from as:
11929
  1. DirectInput Enum callback functions which are documented with result
11937
  1. DirectInput Enum callback functions which are documented with result
11930
  type BOOL in the SDK had to be changed to result type integer because the debug
11938
  type BOOL in the SDK had to be changed to result type integer because the debug
11931
  version of DINPUT.DLL (which is the same for SDK versions 5.0, 5.2, 6.0, and 6.1)
11939
  version of DINPUT.DLL (which is the same for SDK versions 5.0, 5.2, 6.0, and 6.1)
11932
  explicitely checks for two possible return values:
11940
  explicitely checks for two possible return values:
11933
 
11941
 
11934
  0 - FALSE in C and in Delphi
11942
  0 - FALSE in C and in Delphi
11935
  1 - TRUE in C, defined as DIENUM_CONTINUE
11943
  1 - TRUE in C, defined as DIENUM_CONTINUE
11936
 
11944
 
11937
  In Delphi, TRUE means $FFFFFFFF (= -1) for the LongBool (= BOOL) data
11945
  In Delphi, TRUE means $FFFFFFFF (= -1) for the LongBool (= BOOL) data
11938
  type, and AL = 1 (upper three bytes undefined) for the Boolean data type.
11946
  type, and AL = 1 (upper three bytes undefined) for the Boolean data type.
11939
  The debug version of DINPUT.DLL will throw an external exception
11947
  The debug version of DINPUT.DLL will throw an external exception
11940
  ("invalid return value for callback") when fed with either value.
11948
  ("invalid return value for callback") when fed with either value.
11941
 
11949
 
11942
  This change affects the following methods:
11950
  This change affects the following methods:
11943
  EnumDevices, EnumObjects, EnumEffects, EnumCreatedEffectObjects
11951
  EnumDevices, EnumObjects, EnumEffects, EnumCreatedEffectObjects
11944
 
11952
 
11945
  2. Windows 98 and DX6 debug versions DInput and DSound
11953
  2. Windows 98 and DX6 debug versions DInput and DSound
11946
 
11954
 
11947
  Under Windows 98, the "debug" setup of the DirectX SDK 6.x skips DInput.DLL
11955
  Under Windows 98, the "debug" setup of the DirectX SDK 6.x skips DInput.DLL
11948
  and DSound.DLL, i.e. makes you end up with the retail version of these two
11956
  and DSound.DLL, i.e. makes you end up with the retail version of these two
11949
  files without any notice.
11957
  files without any notice.
11950
  The debug versions of DInput.DLL and DSound.DLL can be found in the
11958
  The debug versions of DInput.DLL and DSound.DLL can be found in the
11951
  \extras\Win98\Win98Dbg folder of the SDK CD; they need to be installed
11959
  \extras\Win98\Win98Dbg folder of the SDK CD; they need to be installed
11952
  "manually".
11960
  "manually".
11953
 
11961
 
11954
  This problem has been fixed with DX7 where the SDK installs the debug versions
11962
  This problem has been fixed with DX7 where the SDK installs the debug versions
11955
  of DInput and DSound without any "manual" help.
11963
  of DInput and DSound without any "manual" help.
11956
 
11964
 
11957
}
11965
}
11958
 
11966
 
11959
 
11967
 
11960
var
11968
var
11961
  DInputDLL : HMODULE;
11969
  DInputDLL : HMODULE;
11962
 
11970
 
11963
{$IFDEF DIRECTX3}
11971
{$IFDEF DIRECTX3}
11964
const DIRECTINPUT_VERSION = $0300;
11972
const DIRECTINPUT_VERSION = $0300;
11965
{$ELSE}
11973
{$ELSE}
11966
const DIRECTINPUT_VERSION = $0700;
11974
const DIRECTINPUT_VERSION = $0700;
11967
{$ENDIF}
11975
{$ENDIF}
11968
 
11976
 
11969
function DIErrorString(Value: HResult) : string;
11977
function DIErrorString(Value: HResult) : string;
11970
 
11978
 
11971
//type
11979
//type
11972
//  TRefGUID = packed record
11980
//  TRefGUID = packed record
11973
//    case integer of
11981
//    case integer of
11974
//    1: (guid : PGUID);
11982
//    1: (guid : PGUID);
11975
//    2: (dwFlags : DWORD);
11983
//    2: (dwFlags : DWORD);
11976
//  end;
11984
//  end;
11977
 
11985
 
11978
(****************************************************************************
11986
(****************************************************************************
11979
 *
11987
 *
11980
 *      Class IDs
11988
 *      Class IDs
11981
 *
11989
 *
11982
 ****************************************************************************)
11990
 ****************************************************************************)
11983
const
11991
const
11984
  CLSID_DirectInput: TGUID =
11992
  CLSID_DirectInput: TGUID =
11985
      (D1:$25E609E0;D2:$B259;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
11993
      (D1:$25E609E0;D2:$B259;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
11986
  CLSID_DirectInputDevice: TGUID =
11994
  CLSID_DirectInputDevice: TGUID =
11987
      (D1:$25E609E1;D2:$B259;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
11995
      (D1:$25E609E1;D2:$B259;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
11988
 
11996
 
11989
(****************************************************************************
11997
(****************************************************************************
11990
 *
11998
 *
11991
 *      Predefined object types
11999
 *      Predefined object types
11992
 *
12000
 *
11993
 ****************************************************************************)
12001
 ****************************************************************************)
11994
 
12002
 
11995
  GUID_XAxis: TGUID =
12003
  GUID_XAxis: TGUID =
11996
      (D1:$A36D02E0;D2:$C9F3;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12004
      (D1:$A36D02E0;D2:$C9F3;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
11997
  GUID_YAxis: TGUID =
12005
  GUID_YAxis: TGUID =
11998
      (D1:$A36D02E1;D2:$C9F3;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12006
      (D1:$A36D02E1;D2:$C9F3;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
11999
  GUID_ZAxis: TGUID =
12007
  GUID_ZAxis: TGUID =
12000
      (D1:$A36D02E2;D2:$C9F3;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12008
      (D1:$A36D02E2;D2:$C9F3;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12001
  GUID_RxAxis: TGUID =
12009
  GUID_RxAxis: TGUID =
12002
      (D1:$A36D02F4;D2:$C9F3;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12010
      (D1:$A36D02F4;D2:$C9F3;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12003
  GUID_RyAxis: TGUID =
12011
  GUID_RyAxis: TGUID =
12004
      (D1:$A36D02F5;D2:$C9F3;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12012
      (D1:$A36D02F5;D2:$C9F3;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12005
  GUID_RzAxis: TGUID =
12013
  GUID_RzAxis: TGUID =
12006
      (D1:$A36D02E3;D2:$C9F3;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12014
      (D1:$A36D02E3;D2:$C9F3;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12007
  GUID_Slider: TGUID =
12015
  GUID_Slider: TGUID =
12008
      (D1:$A36D02E4;D2:$C9F3;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12016
      (D1:$A36D02E4;D2:$C9F3;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12009
 
12017
 
12010
  GUID_Button: TGUID =
12018
  GUID_Button: TGUID =
12011
      (D1:$A36D02F0;D2:$C9F3;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12019
      (D1:$A36D02F0;D2:$C9F3;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12012
  GUID_Key: TGUID =
12020
  GUID_Key: TGUID =
12013
      (D1:$55728220;D2:$D33C;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12021
      (D1:$55728220;D2:$D33C;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12014
 
12022
 
12015
  GUID_POV: TGUID =
12023
  GUID_POV: TGUID =
12016
      (D1:$A36D02F2;D2:$C9F3;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12024
      (D1:$A36D02F2;D2:$C9F3;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12017
 
12025
 
12018
  GUID_Unknown: TGUID =
12026
  GUID_Unknown: TGUID =
12019
      (D1:$A36D02F3;D2:$C9F3;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12027
      (D1:$A36D02F3;D2:$C9F3;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12020
 
12028
 
12021
(****************************************************************************
12029
(****************************************************************************
12022
 *
12030
 *
12023
 *      Predefined product GUIDs
12031
 *      Predefined product GUIDs
12024
 *
12032
 *
12025
 ****************************************************************************)
12033
 ****************************************************************************)
12026
 
12034
 
12027
  GUID_SysMouse: TGUID =
12035
  GUID_SysMouse: TGUID =
12028
      (D1:$6F1D2B60;D2:$D5A0;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12036
      (D1:$6F1D2B60;D2:$D5A0;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12029
  GUID_SysKeyboard: TGUID =
12037
  GUID_SysKeyboard: TGUID =
12030
      (D1:$6F1D2B61;D2:$D5A0;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12038
      (D1:$6F1D2B61;D2:$D5A0;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12031
  GUID_Joystick: TGUID =
12039
  GUID_Joystick: TGUID =
12032
      (D1:$6F1D2B70;D2:$D5A0;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12040
      (D1:$6F1D2B70;D2:$D5A0;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
12033
  GUID_SysMouseEm: TGUID = '{6F1D2B80-D5A0-11CF-BFC7-444553540000}';
12041
  GUID_SysMouseEm: TGUID = '{6F1D2B80-D5A0-11CF-BFC7-444553540000}';
12034
  GUID_SysMouseEm2: TGUID = '{6F1D2B81-D5A0-11CF-BFC7-444553540000}';
12042
  GUID_SysMouseEm2: TGUID = '{6F1D2B81-D5A0-11CF-BFC7-444553540000}';
12035
  GUID_SysKeyboardEm: TGUID = '{6F1D2B82-D5A0-11CF-BFC7-444553540000}';
12043
  GUID_SysKeyboardEm: TGUID = '{6F1D2B82-D5A0-11CF-BFC7-444553540000}';
12036
  GUID_SysKeyboardEm2: TGUID = '{6F1D2B83-D5A0-11CF-BFC7-444553540000}';
12044
  GUID_SysKeyboardEm2: TGUID = '{6F1D2B83-D5A0-11CF-BFC7-444553540000}';
12037
 
12045
 
12038
(****************************************************************************
12046
(****************************************************************************
12039
 *
12047
 *
12040
 *      Predefined force feedback effects
12048
 *      Predefined force feedback effects
12041
 *
12049
 *
12042
 ****************************************************************************)
12050
 ****************************************************************************)
12043
 
12051
 
12044
  GUID_ConstantForce: TGUID =
12052
  GUID_ConstantForce: TGUID =
12045
      (D1:$13541C20;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12053
      (D1:$13541C20;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12046
  GUID_RampForce: TGUID =
12054
  GUID_RampForce: TGUID =
12047
      (D1:$13541C21;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12055
      (D1:$13541C21;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12048
  GUID_Square: TGUID =
12056
  GUID_Square: TGUID =
12049
      (D1:$13541C22;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12057
      (D1:$13541C22;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12050
  GUID_Sine: TGUID =
12058
  GUID_Sine: TGUID =
12051
      (D1:$13541C23;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12059
      (D1:$13541C23;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12052
  GUID_Triangle: TGUID =
12060
  GUID_Triangle: TGUID =
12053
      (D1:$13541C24;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12061
      (D1:$13541C24;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12054
  GUID_SawtoothUp: TGUID =
12062
  GUID_SawtoothUp: TGUID =
12055
      (D1:$13541C25;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12063
      (D1:$13541C25;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12056
  GUID_SawtoothDown: TGUID =
12064
  GUID_SawtoothDown: TGUID =
12057
      (D1:$13541C26;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12065
      (D1:$13541C26;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12058
  GUID_Spring: TGUID =
12066
  GUID_Spring: TGUID =
12059
      (D1:$13541C27;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12067
      (D1:$13541C27;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12060
  GUID_Damper: TGUID =
12068
  GUID_Damper: TGUID =
12061
      (D1:$13541C28;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12069
      (D1:$13541C28;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12062
  GUID_Inertia: TGUID =
12070
  GUID_Inertia: TGUID =
12063
      (D1:$13541C29;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12071
      (D1:$13541C29;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12064
  GUID_Friction: TGUID =
12072
  GUID_Friction: TGUID =
12065
      (D1:$13541C2A;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12073
      (D1:$13541C2A;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12066
  GUID_CustomForce: TGUID =
12074
  GUID_CustomForce: TGUID =
12067
      (D1:$13541C2B;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12075
      (D1:$13541C2B;D2:$8E33;D3:$11D0;D4:($9A,$D0,$00,$A0,$C9,$A0,$6E,$35));
12068
 
12076
 
12069
 
12077
 
12070
 
12078
 
12071
(****************************************************************************
12079
(****************************************************************************
12072
 *
12080
 *
12073
 *      Interfaces and Structures...
12081
 *      Interfaces and Structures...
12074
 *
12082
 *
12075
 ****************************************************************************)
12083
 ****************************************************************************)
12076
 
12084
 
12077
(****************************************************************************
12085
(****************************************************************************
12078
 *
12086
 *
12079
 *      IDirectInputEffect
12087
 *      IDirectInputEffect
12080
 *
12088
 *
12081
 ****************************************************************************)
12089
 ****************************************************************************)
12082
 
12090
 
12083
const
12091
const
12084
  DIEFT_ALL                   = $00000000;
12092
  DIEFT_ALL                   = $00000000;
12085
 
12093
 
12086
  DIEFT_CONSTANTFORCE         = $00000001;
12094
  DIEFT_CONSTANTFORCE         = $00000001;
12087
  DIEFT_RAMPFORCE             = $00000002;
12095
  DIEFT_RAMPFORCE             = $00000002;
12088
  DIEFT_PERIODIC              = $00000003;
12096
  DIEFT_PERIODIC              = $00000003;
12089
  DIEFT_CONDITION             = $00000004;
12097
  DIEFT_CONDITION             = $00000004;
12090
  DIEFT_CUSTOMFORCE           = $00000005;
12098
  DIEFT_CUSTOMFORCE           = $00000005;
12091
  DIEFT_HARDWARE              = $000000FF;
12099
  DIEFT_HARDWARE              = $000000FF;
12092
 
12100
 
12093
  DIEFT_FFATTACK              = $00000200;
12101
  DIEFT_FFATTACK              = $00000200;
12094
  DIEFT_FFFADE                = $00000400;
12102
  DIEFT_FFFADE                = $00000400;
12095
  DIEFT_SATURATION            = $00000800;
12103
  DIEFT_SATURATION            = $00000800;
12096
  DIEFT_POSNEGCOEFFICIENTS    = $00001000;
12104
  DIEFT_POSNEGCOEFFICIENTS    = $00001000;
12097
  DIEFT_POSNEGSATURATION      = $00002000;
12105
  DIEFT_POSNEGSATURATION      = $00002000;
12098
  DIEFT_DEADBAND              = $00004000;
12106
  DIEFT_DEADBAND              = $00004000;
12099
  DIEFT_STARTDELAY            = $00008000;
12107
  DIEFT_STARTDELAY            = $00008000;
12100
 
12108
 
12101
function DIEFT_GETTYPE(n: variant) : byte;
12109
function DIEFT_GETTYPE(n: variant) : byte;
12102
 
12110
 
12103
const
12111
const
12104
  DI_DEGREES                  =     100;
12112
  DI_DEGREES                  =     100;
12105
  DI_FFNOMINALMAX             =   10000;
12113
  DI_FFNOMINALMAX             =   10000;
12106
  DI_SECONDS                  = 1000000;
12114
  DI_SECONDS                  = 1000000;
12107
 
12115
 
12108
type
12116
type
12109
  PDIConstantForce = ^TDIConstantForce;
12117
  PDIConstantForce = ^TDIConstantForce;
12110
  TDIConstantForce = packed record
12118
  TDIConstantForce = packed record
12111
    lMagnitude : LongInt;
12119
    lMagnitude : LongInt;
12112
  end;
12120
  end;
12113
 
12121
 
12114
  PDIRampForce = ^TDIRampForce;
12122
  PDIRampForce = ^TDIRampForce;
12115
  TDIRampForce = packed record
12123
  TDIRampForce = packed record
12116
    lStart : LongInt;
12124
    lStart : LongInt;
12117
    lEnd : LongInt;
12125
    lEnd : LongInt;
12118
  end;
12126
  end;
12119
 
12127
 
12120
  PDIPeriodic = ^TDIPeriodic;
12128
  PDIPeriodic = ^TDIPeriodic;
12121
  TDIPeriodic = packed record
12129
  TDIPeriodic = packed record
12122
    dwMagnitude : DWORD;
12130
    dwMagnitude : DWORD;
12123
    lOffset : LongInt;
12131
    lOffset : LongInt;
12124
    dwPhase : DWORD;
12132
    dwPhase : DWORD;
12125
    dwPeriod : DWORD;
12133
    dwPeriod : DWORD;
12126
  end;
12134
  end;
12127
 
12135
 
12128
  PDICondition = ^TDICondition;
12136
  PDICondition = ^TDICondition;
12129
  TDICondition = packed record
12137
  TDICondition = packed record
12130
    lOffset : LongInt;
12138
    lOffset : LongInt;
12131
    lPositiveCoefficient : LongInt;
12139
    lPositiveCoefficient : LongInt;
12132
    lNegativeCoefficient : LongInt;
12140
    lNegativeCoefficient : LongInt;
12133
    dwPositiveSaturation : DWORD;
12141
    dwPositiveSaturation : DWORD;
12134
    dwNegativeSaturation : DWORD;
12142
    dwNegativeSaturation : DWORD;
12135
    lDeadBand : LongInt;
12143
    lDeadBand : LongInt;
12136
  end;
12144
  end;
12137
 
12145
 
12138
  PDICustomForce = ^TDICustomForce;
12146
  PDICustomForce = ^TDICustomForce;
12139
  TDICustomForce = packed record
12147
  TDICustomForce = packed record
12140
    cChannels : DWORD;
12148
    cChannels : DWORD;
12141
    dwSamplePeriod : DWORD;
12149
    dwSamplePeriod : DWORD;
12142
    cSamples : DWORD;
12150
    cSamples : DWORD;
12143
    rglForceData : PLongInt;
12151
    rglForceData : PLongInt;
12144
  end;
12152
  end;
12145
 
12153
 
12146
  PDIEnvelope = ^TDIEnvelope;
12154
  PDIEnvelope = ^TDIEnvelope;
12147
  TDIEnvelope = packed record
12155
  TDIEnvelope = packed record
12148
    dwSize : DWORD;                   (* sizeof(DIENVELOPE)   *)
12156
    dwSize : DWORD;                   (* sizeof(DIENVELOPE)   *)
12149
    dwAttackLevel : DWORD;
12157
    dwAttackLevel : DWORD;
12150
    dwAttackTime : DWORD;             (* Microseconds         *)
12158
    dwAttackTime : DWORD;             (* Microseconds         *)
12151
    dwFadeLevel : DWORD;
12159
    dwFadeLevel : DWORD;
12152
    dwFadeTime : DWORD;               (* Microseconds         *)
12160
    dwFadeTime : DWORD;               (* Microseconds         *)
12153
  end;
12161
  end;
12154
 
12162
 
12155
  PDIEffect_DX5 = ^TDIEffect_DX5;
12163
  PDIEffect_DX5 = ^TDIEffect_DX5;
12156
  TDIEffect_DX5 = packed record
12164
  TDIEffect_DX5 = packed record
12157
    dwSize : DWORD;                   (* sizeof(DIEFFECT)     *)
12165
    dwSize : DWORD;                   (* sizeof(DIEFFECT)     *)
12158
    dwFlags : DWORD;                  (* DIEFF_*              *)
12166
    dwFlags : DWORD;                  (* DIEFF_*              *)
12159
    dwDuration : DWORD;               (* Microseconds         *)
12167
    dwDuration : DWORD;               (* Microseconds         *)
12160
    dwSamplePeriod : DWORD;           (* Microseconds         *)
12168
    dwSamplePeriod : DWORD;           (* Microseconds         *)
12161
    dwGain : DWORD;
12169
    dwGain : DWORD;
12162
    dwTriggerButton : DWORD;          (* or DIEB_NOTRIGGER    *)
12170
    dwTriggerButton : DWORD;          (* or DIEB_NOTRIGGER    *)
12163
    dwTriggerRepeatInterval : DWORD;  (* Microseconds         *)
12171
    dwTriggerRepeatInterval : DWORD;  (* Microseconds         *)
12164
    cAxes : DWORD;                    (* Number of axes       *)
12172
    cAxes : DWORD;                    (* Number of axes       *)
12165
    rgdwAxes : PDWORD;                (* Array of axes        *)
12173
    rgdwAxes : PDWORD;                (* Array of axes        *)
12166
    rglDirection : PLongInt;          (* Array of directions  *)
12174
    rglDirection : PLongInt;          (* Array of directions  *)
12167
    lpEnvelope : PDIEnvelope;         (* Optional             *)
12175
    lpEnvelope : PDIEnvelope;         (* Optional             *)
12168
    cbTypeSpecificParams : DWORD;     (* Size of params       *)
12176
    cbTypeSpecificParams : DWORD;     (* Size of params       *)
12169
    lpvTypeSpecificParams : pointer;  (* Pointer to params    *)
12177
    lpvTypeSpecificParams : pointer;  (* Pointer to params    *)
12170
  end;
12178
  end;
12171
 
12179
 
12172
  PDIEffect_DX6 = ^TDIEffect_DX6;
12180
  PDIEffect_DX6 = ^TDIEffect_DX6;
12173
  TDIEffect_DX6 = packed record
12181
  TDIEffect_DX6 = packed record
12174
    dwSize : DWORD;                   (* sizeof(DIEFFECT)     *)
12182
    dwSize : DWORD;                   (* sizeof(DIEFFECT)     *)
12175
    dwFlags : DWORD;                  (* DIEFF_*              *)
12183
    dwFlags : DWORD;                  (* DIEFF_*              *)
12176
    dwDuration : DWORD;               (* Microseconds         *)
12184
    dwDuration : DWORD;               (* Microseconds         *)
12177
    dwSamplePeriod : DWORD;           (* Microseconds         *)
12185
    dwSamplePeriod : DWORD;           (* Microseconds         *)
12178
    dwGain : DWORD;
12186
    dwGain : DWORD;
12179
    dwTriggerButton : DWORD;          (* or DIEB_NOTRIGGER    *)
12187
    dwTriggerButton : DWORD;          (* or DIEB_NOTRIGGER    *)
12180
    dwTriggerRepeatInterval : DWORD;  (* Microseconds         *)
12188
    dwTriggerRepeatInterval : DWORD;  (* Microseconds         *)
12181
    cAxes : DWORD;                    (* Number of axes       *)
12189
    cAxes : DWORD;                    (* Number of axes       *)
12182
    rgdwAxes : PDWORD;                (* Array of axes        *)
12190
    rgdwAxes : PDWORD;                (* Array of axes        *)
12183
    rglDirection : PLongInt;          (* Array of directions  *)
12191
    rglDirection : PLongInt;          (* Array of directions  *)
12184
    lpEnvelope : PDIEnvelope;         (* Optional             *)
12192
    lpEnvelope : PDIEnvelope;         (* Optional             *)
12185
    cbTypeSpecificParams : DWORD;     (* Size of params       *)
12193
    cbTypeSpecificParams : DWORD;     (* Size of params       *)
12186
    lpvTypeSpecificParams : pointer;  (* Pointer to params    *)
12194
    lpvTypeSpecificParams : pointer;  (* Pointer to params    *)
12187
    dwStartDelay: DWORD;              (* Microseconds         *)
12195
    dwStartDelay: DWORD;              (* Microseconds         *)
12188
  end;
12196
  end;
12189
 
12197
 
12190
  PDIEffect = ^TDIEffect;
12198
  PDIEffect = ^TDIEffect;
12191
{$IFDEF DIRECTX5}
12199
{$IFDEF DIRECTX5}
12192
  TDIEffect = TDIEffect_DX5;
12200
  TDIEffect = TDIEffect_DX5;
12193
{$ELSE}
12201
{$ELSE}
12194
  TDIEffect = TDIEffect_DX6;
12202
  TDIEffect = TDIEffect_DX6;
12195
{$ENDIF}
12203
{$ENDIF}
12196
 
12204
 
12197
  PDIFileEffect = ^TDIFileEffect;
12205
  PDIFileEffect = ^TDIFileEffect;
12198
  TDIFileEffect = packed record
12206
  TDIFileEffect = packed record
12199
    dwSize : DWORD;
12207
    dwSize : DWORD;
12200
    GuidEffect: TGUID;
12208
    GuidEffect: TGUID;
12201
    lpDiEffect: PDIEffect;
12209
    lpDiEffect: PDIEffect;
12202
    szFriendlyName : array [0..MAX_PATH-1] of AnsiChar;
12210
    szFriendlyName : array [0..MAX_PATH-1] of AnsiChar;
12203
  end;
12211
  end;
12204
 
12212
 
12205
const
12213
const
12206
  DIEFF_OBJECTIDS             = $00000001;
12214
  DIEFF_OBJECTIDS             = $00000001;
12207
  DIEFF_OBJECTOFFSETS         = $00000002;
12215
  DIEFF_OBJECTOFFSETS         = $00000002;
12208
  DIEFF_CARTESIAN             = $00000010;
12216
  DIEFF_CARTESIAN             = $00000010;
12209
  DIEFF_POLAR                 = $00000020;
12217
  DIEFF_POLAR                 = $00000020;
12210
  DIEFF_SPHERICAL             = $00000040;
12218
  DIEFF_SPHERICAL             = $00000040;
12211
 
12219
 
12212
  DIEP_DURATION               = $00000001;
12220
  DIEP_DURATION               = $00000001;
12213
  DIEP_SAMPLEPERIOD           = $00000002;
12221
  DIEP_SAMPLEPERIOD           = $00000002;
12214
  DIEP_GAIN                   = $00000004;
12222
  DIEP_GAIN                   = $00000004;
12215
  DIEP_TRIGGERBUTTON          = $00000008;
12223
  DIEP_TRIGGERBUTTON          = $00000008;
12216
  DIEP_TRIGGERREPEATINTERVAL  = $00000010;
12224
  DIEP_TRIGGERREPEATINTERVAL  = $00000010;
12217
  DIEP_AXES                   = $00000020;
12225
  DIEP_AXES                   = $00000020;
12218
  DIEP_DIRECTION              = $00000040;
12226
  DIEP_DIRECTION              = $00000040;
12219
  DIEP_ENVELOPE               = $00000080;
12227
  DIEP_ENVELOPE               = $00000080;
12220
  DIEP_TYPESPECIFICPARAMS     = $00000100;
12228
  DIEP_TYPESPECIFICPARAMS     = $00000100;
12221
{$IFDEF DIRECTX5}
12229
{$IFDEF DIRECTX5}
12222
  DIEP_ALLPARAMS              = $000001FF;
12230
  DIEP_ALLPARAMS              = $000001FF;
12223
{$ELSE}
12231
{$ELSE}
12224
  DIEP_STARTDELAY             = $00000200;
12232
  DIEP_STARTDELAY             = $00000200;
12225
  DIEP_ALLPARAMS_DX5          = $000001FF;
12233
  DIEP_ALLPARAMS_DX5          = $000001FF;
12226
  DIEP_ALLPARAMS              = $000003FF;
12234
  DIEP_ALLPARAMS              = $000003FF;
12227
{$ENDIF}
12235
{$ENDIF}
12228
  DIEP_START                  = $20000000;
12236
  DIEP_START                  = $20000000;
12229
  DIEP_NORESTART              = $40000000;
12237
  DIEP_NORESTART              = $40000000;
12230
  DIEP_NODOWNLOAD             = $80000000;
12238
  DIEP_NODOWNLOAD             = $80000000;
12231
  DIEB_NOTRIGGER              = $FFFFFFFF;
12239
  DIEB_NOTRIGGER              = $FFFFFFFF;
12232
 
12240
 
12233
  DIES_SOLO                   = $00000001;
12241
  DIES_SOLO                   = $00000001;
12234
  DIES_NODOWNLOAD             = $80000000;
12242
  DIES_NODOWNLOAD             = $80000000;
12235
 
12243
 
12236
  DIEGES_PLAYING              = $00000001;
12244
  DIEGES_PLAYING              = $00000001;
12237
  DIEGES_EMULATED             = $00000002;
12245
  DIEGES_EMULATED             = $00000002;
12238
 
12246
 
12239
 
12247
 
12240
type
12248
type
12241
  PDIEffEscape = ^TDIEffEscape;
12249
  PDIEffEscape = ^TDIEffEscape;
12242
  TDIEffEscape = packed record
12250
  TDIEffEscape = packed record
12243
    dwSize : DWORD;
12251
    dwSize : DWORD;
12244
    dwCommand : DWORD;
12252
    dwCommand : DWORD;
12245
    lpvInBuffer : pointer;
12253
    lpvInBuffer : pointer;
12246
    cbInBuffer : DWORD;
12254
    cbInBuffer : DWORD;
12247
    lpvOutBuffer : pointer;
12255
    lpvOutBuffer : pointer;
12248
    cbOutBuffer : DWORD;
12256
    cbOutBuffer : DWORD;
12249
  end;
12257
  end;
12250
 
12258
 
12251
 
12259
 
12252
//
12260
//
12253
// IDirectSoundCapture  // as: ???
12261
// IDirectSoundCapture  // as: ???
12254
//
12262
//
12255
  IDirectInputEffect = interface (IUnknown)
12263
  IDirectInputEffect = interface (IUnknown)
12256
    ['{E7E1F7C0-88D2-11D0-9AD0-00A0C9A06E35}']
12264
    ['{E7E1F7C0-88D2-11D0-9AD0-00A0C9A06E35}']
12257
    (** IDirectInputEffect methods ***)
12265
    (** IDirectInputEffect methods ***)
12258
    function Initialize(hinst: THandle; dwVersion: DWORD;
12266
    function Initialize(hinst: THandle; dwVersion: DWORD;
12259
        const rguid: TGUID) : HResult;  stdcall;
12267
        const rguid: TGUID) : HResult;  stdcall;
12260
    function GetEffectGuid(var pguid: TGUID) : HResult;  stdcall;
12268
    function GetEffectGuid(var pguid: TGUID) : HResult;  stdcall;
12261
    function GetParameters(var peff: TDIEffect; dwFlags: DWORD) : HResult;  stdcall;
12269
    function GetParameters(var peff: TDIEffect; dwFlags: DWORD) : HResult;  stdcall;
12262
    function SetParameters(var peff: TDIEffect; dwFlags: DWORD) : HResult;  stdcall;
12270
    function SetParameters(var peff: TDIEffect; dwFlags: DWORD) : HResult;  stdcall;
12263
    function Start(dwIterations: DWORD; dwFlags: DWORD) : HResult;  stdcall;
12271
    function Start(dwIterations: DWORD; dwFlags: DWORD) : HResult;  stdcall;
12264
    function Stop : HResult;  stdcall;
12272
    function Stop : HResult;  stdcall;
12265
    function GetEffectStatus(var pdwFlags : DWORD) : HResult;  stdcall;
12273
    function GetEffectStatus(var pdwFlags : DWORD) : HResult;  stdcall;
12266
    function Download : HResult;  stdcall;
12274
    function Download : HResult;  stdcall;
12267
    function Unload : HResult;  stdcall;
12275
    function Unload : HResult;  stdcall;
12268
    function Escape(var pesc: TDIEffEscape) : HResult;  stdcall;
12276
    function Escape(var pesc: TDIEffEscape) : HResult;  stdcall;
12269
  end;
12277
  end;
12270
 
12278
 
12271
(****************************************************************************
12279
(****************************************************************************
12272
 *
12280
 *
12273
 *      IDirectInputDevice
12281
 *      IDirectInputDevice
12274
 *
12282
 *
12275
 ****************************************************************************)
12283
 ****************************************************************************)
12276
 
12284
 
12277
const
12285
const
12278
  DIDEVTYPE_DEVICE = 1;
12286
  DIDEVTYPE_DEVICE = 1;
12279
  DIDEVTYPE_MOUSE = 2;
12287
  DIDEVTYPE_MOUSE = 2;
12280
  DIDEVTYPE_KEYBOARD = 3;
12288
  DIDEVTYPE_KEYBOARD = 3;
12281
  DIDEVTYPE_JOYSTICK = 4;
12289
  DIDEVTYPE_JOYSTICK = 4;
12282
  DIDEVTYPE_HID = $00010000;
12290
  DIDEVTYPE_HID = $00010000;
12283
 
12291
 
12284
  DIDEVTYPEMOUSE_UNKNOWN = 1;
12292
  DIDEVTYPEMOUSE_UNKNOWN = 1;
12285
  DIDEVTYPEMOUSE_TRADITIONAL = 2;
12293
  DIDEVTYPEMOUSE_TRADITIONAL = 2;
12286
  DIDEVTYPEMOUSE_FINGERSTICK = 3;
12294
  DIDEVTYPEMOUSE_FINGERSTICK = 3;
12287
  DIDEVTYPEMOUSE_TOUCHPAD = 4;
12295
  DIDEVTYPEMOUSE_TOUCHPAD = 4;
12288
  DIDEVTYPEMOUSE_TRACKBALL = 5;
12296
  DIDEVTYPEMOUSE_TRACKBALL = 5;
12289
 
12297
 
12290
  DIDEVTYPEKEYBOARD_UNKNOWN = 0;
12298
  DIDEVTYPEKEYBOARD_UNKNOWN = 0;
12291
  DIDEVTYPEKEYBOARD_PCXT = 1;
12299
  DIDEVTYPEKEYBOARD_PCXT = 1;
12292
  DIDEVTYPEKEYBOARD_OLIVETTI = 2;
12300
  DIDEVTYPEKEYBOARD_OLIVETTI = 2;
12293
  DIDEVTYPEKEYBOARD_PCAT = 3;
12301
  DIDEVTYPEKEYBOARD_PCAT = 3;
12294
  DIDEVTYPEKEYBOARD_PCENH = 4;
12302
  DIDEVTYPEKEYBOARD_PCENH = 4;
12295
  DIDEVTYPEKEYBOARD_NOKIA1050 = 5;
12303
  DIDEVTYPEKEYBOARD_NOKIA1050 = 5;
12296
  DIDEVTYPEKEYBOARD_NOKIA9140 = 6;
12304
  DIDEVTYPEKEYBOARD_NOKIA9140 = 6;
12297
  DIDEVTYPEKEYBOARD_NEC98 = 7;
12305
  DIDEVTYPEKEYBOARD_NEC98 = 7;
12298
  DIDEVTYPEKEYBOARD_NEC98LAPTOP = 8;
12306
  DIDEVTYPEKEYBOARD_NEC98LAPTOP = 8;
12299
  DIDEVTYPEKEYBOARD_NEC98106 = 9;
12307
  DIDEVTYPEKEYBOARD_NEC98106 = 9;
12300
  DIDEVTYPEKEYBOARD_JAPAN106 = 10;
12308
  DIDEVTYPEKEYBOARD_JAPAN106 = 10;
12301
  DIDEVTYPEKEYBOARD_JAPANAX = 11;
12309
  DIDEVTYPEKEYBOARD_JAPANAX = 11;
12302
  DIDEVTYPEKEYBOARD_J3100 = 12;
12310
  DIDEVTYPEKEYBOARD_J3100 = 12;
12303
 
12311
 
12304
  DIDEVTYPEJOYSTICK_UNKNOWN = 1;
12312
  DIDEVTYPEJOYSTICK_UNKNOWN = 1;
12305
  DIDEVTYPEJOYSTICK_TRADITIONAL = 2;
12313
  DIDEVTYPEJOYSTICK_TRADITIONAL = 2;
12306
  DIDEVTYPEJOYSTICK_FLIGHTSTICK = 3;
12314
  DIDEVTYPEJOYSTICK_FLIGHTSTICK = 3;
12307
  DIDEVTYPEJOYSTICK_GAMEPAD = 4;
12315
  DIDEVTYPEJOYSTICK_GAMEPAD = 4;
12308
  DIDEVTYPEJOYSTICK_RUDDER = 5;
12316
  DIDEVTYPEJOYSTICK_RUDDER = 5;
12309
  DIDEVTYPEJOYSTICK_WHEEL = 6;
12317
  DIDEVTYPEJOYSTICK_WHEEL = 6;
12310
  DIDEVTYPEJOYSTICK_HEADTRACKER = 7;
12318
  DIDEVTYPEJOYSTICK_HEADTRACKER = 7;
12311
 
12319
 
12312
function GET_DIDEVICE_TYPE(dwDevType: variant) : byte;
12320
function GET_DIDEVICE_TYPE(dwDevType: variant) : byte;
12313
function GET_DIDEVICE_SUBTYPE(dwDevType: variant) : byte;
12321
function GET_DIDEVICE_SUBTYPE(dwDevType: variant) : byte;
12314
 
12322
 
12315
type
12323
type
12316
  PDIDevCaps_DX3 = ^TDIDevCaps_DX3;
12324
  PDIDevCaps_DX3 = ^TDIDevCaps_DX3;
12317
  TDIDevCaps_DX3 = packed record
12325
  TDIDevCaps_DX3 = packed record
12318
    dwSize: DWORD;
12326
    dwSize: DWORD;
12319
    dwFlags: DWORD;
12327
    dwFlags: DWORD;
12320
    dwDevType: DWORD;
12328
    dwDevType: DWORD;
12321
    dwAxes: DWORD;
12329
    dwAxes: DWORD;
12322
    dwButtons: DWORD;
12330
    dwButtons: DWORD;
12323
    dwPOVs: DWORD;
12331
    dwPOVs: DWORD;
12324
  end;
12332
  end;
12325
 
12333
 
12326
  PDIDevCaps_DX5 = ^TDIDevCaps_DX5;
12334
  PDIDevCaps_DX5 = ^TDIDevCaps_DX5;
12327
  TDIDevCaps_DX5 = packed record
12335
  TDIDevCaps_DX5 = packed record
12328
    dwSize: DWORD;
12336
    dwSize: DWORD;
12329
    dwFlags: DWORD;
12337
    dwFlags: DWORD;
12330
    dwDevType: DWORD;
12338
    dwDevType: DWORD;
12331
    dwAxes: DWORD;
12339
    dwAxes: DWORD;
12332
    dwButtons: DWORD;
12340
    dwButtons: DWORD;
12333
    dwPOVs: DWORD;
12341
    dwPOVs: DWORD;
12334
    dwFFSamplePeriod: DWORD;
12342
    dwFFSamplePeriod: DWORD;
12335
    dwFFMinTimeResolution: DWORD;
12343
    dwFFMinTimeResolution: DWORD;
12336
    dwFirmwareRevision: DWORD;
12344
    dwFirmwareRevision: DWORD;
12337
    dwHardwareRevision: DWORD;
12345
    dwHardwareRevision: DWORD;
12338
    dwFFDriverVersion: DWORD;
12346
    dwFFDriverVersion: DWORD;
12339
  end;
12347
  end;
12340
 
12348
 
12341
  PDIDevCaps = ^TDIDevCaps;
12349
  PDIDevCaps = ^TDIDevCaps;
12342
{$IFDEF DIRECTX3}
12350
{$IFDEF DIRECTX3}
12343
  TDIDevCaps = TDIDevCaps_DX3;
12351
  TDIDevCaps = TDIDevCaps_DX3;
12344
{$ELSE}
12352
{$ELSE}
12345
  TDIDevCaps = TDIDevCaps_DX5;
12353
  TDIDevCaps = TDIDevCaps_DX5;
12346
{$ENDIF}
12354
{$ENDIF}
12347
 
12355
 
12348
const
12356
const
12349
  DIDC_ATTACHED           = $00000001;
12357
  DIDC_ATTACHED           = $00000001;
12350
  DIDC_POLLEDDEVICE       = $00000002;
12358
  DIDC_POLLEDDEVICE       = $00000002;
12351
  DIDC_EMULATED           = $00000004;
12359
  DIDC_EMULATED           = $00000004;
12352
  DIDC_POLLEDDATAFORMAT   = $00000008;
12360
  DIDC_POLLEDDATAFORMAT   = $00000008;
12353
  DIDC_FORCEFEEDBACK      = $00000100;
12361
  DIDC_FORCEFEEDBACK      = $00000100;
12354
  DIDC_FFATTACK           = $00000200;
12362
  DIDC_FFATTACK           = $00000200;
12355
  DIDC_FFFADE             = $00000400;
12363
  DIDC_FFFADE             = $00000400;
12356
  DIDC_SATURATION         = $00000800;
12364
  DIDC_SATURATION         = $00000800;
12357
  DIDC_POSNEGCOEFFICIENTS = $00001000;
12365
  DIDC_POSNEGCOEFFICIENTS = $00001000;
12358
  DIDC_POSNEGSATURATION   = $00002000;
12366
  DIDC_POSNEGSATURATION   = $00002000;
12359
  DIDC_DEADBAND           = $00004000;
12367
  DIDC_DEADBAND           = $00004000;
12360
  DIDC_STARTDELAY         = $00008000;
12368
  DIDC_STARTDELAY         = $00008000;
12361
  DIDC_ALIAS              = $00010000;
12369
  DIDC_ALIAS              = $00010000;
12362
  DIDC_PHANTOM            = $00020000;
12370
  DIDC_PHANTOM            = $00020000;
12363
 
12371
 
12364
  DIDFT_ALL = $00000000;
12372
  DIDFT_ALL = $00000000;
12365
 
12373
 
12366
  DIDFT_RELAXIS = $00000001;
12374
  DIDFT_RELAXIS = $00000001;
12367
  DIDFT_ABSAXIS = $00000002;
12375
  DIDFT_ABSAXIS = $00000002;
12368
  DIDFT_AXIS    = $00000003;
12376
  DIDFT_AXIS    = $00000003;
12369
 
12377
 
12370
  DIDFT_PSHBUTTON = $00000004;
12378
  DIDFT_PSHBUTTON = $00000004;
12371
  DIDFT_TGLBUTTON = $00000008;
12379
  DIDFT_TGLBUTTON = $00000008;
12372
  DIDFT_BUTTON    = $0000000C;
12380
  DIDFT_BUTTON    = $0000000C;
12373
 
12381
 
12374
  DIDFT_POV        = $00000010;
12382
  DIDFT_POV        = $00000010;
12375
  DIDFT_COLLECTION = $00000040;
12383
  DIDFT_COLLECTION = $00000040;
12376
  DIDFT_NODATA     = $00000080;
12384
  DIDFT_NODATA     = $00000080;
12377
 
12385
 
12378
  DIDFT_ANYINSTANCE = $00FFFF00;
12386
  DIDFT_ANYINSTANCE = $00FFFF00;
12379
  DIDFT_INSTANCEMASK = DIDFT_ANYINSTANCE;
12387
  DIDFT_INSTANCEMASK = DIDFT_ANYINSTANCE;
12380
function DIDFT_MAKEINSTANCE(n: variant) : DWORD;
12388
function DIDFT_MAKEINSTANCE(n: variant) : DWORD;
12381
function DIDFT_GETTYPE(n: variant) : byte;
12389
function DIDFT_GETTYPE(n: variant) : byte;
12382
function DIDFT_GETINSTANCE(n: variant) : DWORD;
12390
function DIDFT_GETINSTANCE(n: variant) : DWORD;
12383
const
12391
const
12384
  DIDFT_FFACTUATOR        = $01000000;
12392
  DIDFT_FFACTUATOR        = $01000000;
12385
  DIDFT_FFEFFECTTRIGGER   = $02000000;
12393
  DIDFT_FFEFFECTTRIGGER   = $02000000;
12386
  DIDFT_OUTPUT            = $10000000;
12394
  DIDFT_OUTPUT            = $10000000;
12387
  DIDFT_VENDORDEFINED     = $04000000;
12395
  DIDFT_VENDORDEFINED     = $04000000;
12388
  DIDFT_ALIAS             = $08000000;
12396
  DIDFT_ALIAS             = $08000000;
12389
 
12397
 
12390
function DIDFT_ENUMCOLLECTION(n: variant) : DWORD;
12398
function DIDFT_ENUMCOLLECTION(n: variant) : DWORD;
12391
const
12399
const
12392
  DIDFT_NOCOLLECTION = $00FFFF00;
12400
  DIDFT_NOCOLLECTION = $00FFFF00;
12393
 
12401
 
12394
 
12402
 
12395
 
12403
 
12396
type
12404
type
12397
  PDIObjectDataFormat = ^TDIObjectDataFormat;
12405
  PDIObjectDataFormat = ^TDIObjectDataFormat;
12398
  TDIObjectDataFormat = packed record
12406
  TDIObjectDataFormat = packed record
12399
    pguid: PGUID;
12407
    pguid: PGUID;
12400
    dwOfs: DWORD;
12408
    dwOfs: DWORD;
12401
    dwType: DWORD;
12409
    dwType: DWORD;
12402
    dwFlags: DWORD;
12410
    dwFlags: DWORD;
12403
  end;
12411
  end;
12404
 
12412
 
12405
  PDIDataFormat = ^TDIDataFormat;
12413
  PDIDataFormat = ^TDIDataFormat;
12406
  TDIDataFormat = packed record
12414
  TDIDataFormat = packed record
12407
    dwSize: DWORD;  
12415
    dwSize: DWORD;  
12408
    dwObjSize: DWORD;
12416
    dwObjSize: DWORD;
12409
    dwFlags: DWORD;  
12417
    dwFlags: DWORD;  
12410
    dwDataSize: DWORD;  
12418
    dwDataSize: DWORD;  
12411
    dwNumObjs: DWORD;  
12419
    dwNumObjs: DWORD;  
12412
    rgodf: PDIObjectDataFormat;
12420
    rgodf: PDIObjectDataFormat;
12413
  end;
12421
  end;
12414
 
12422
 
12415
const
12423
const
12416
  DIDF_ABSAXIS = $00000001;
12424
  DIDF_ABSAXIS = $00000001;
12417
  DIDF_RELAXIS = $00000002;
12425
  DIDF_RELAXIS = $00000002;
12418
 
12426
 
12419
type
12427
type
12420
  PDIDeviceObjectInstance_DX3A = ^TDIDeviceObjectInstance_DX3A;
12428
  PDIDeviceObjectInstance_DX3A = ^TDIDeviceObjectInstance_DX3A;
12421
  TDIDeviceObjectInstance_DX3A = packed record
12429
  TDIDeviceObjectInstance_DX3A = packed record
12422
    dwSize: DWORD;
12430
    dwSize: DWORD;
12423
    guidType: TGUID;
12431
    guidType: TGUID;
12424
    dwOfs: DWORD;
12432
    dwOfs: DWORD;
12425
    dwType: DWORD;
12433
    dwType: DWORD;
12426
    dwFlags: DWORD;
12434
    dwFlags: DWORD;
12427
    tszName: Array [0..MAX_PATH-1] of CHAR;
12435
    tszName: Array [0..MAX_PATH-1] of CHAR;
12428
  end;
12436
  end;
12429
 
12437
 
12430
  PDIDeviceObjectInstance_DX3W = ^TDIDeviceObjectInstance_DX3W;
12438
  PDIDeviceObjectInstance_DX3W = ^TDIDeviceObjectInstance_DX3W;
12431
  TDIDeviceObjectInstance_DX3W = packed record
12439
  TDIDeviceObjectInstance_DX3W = packed record
12432
    dwSize: DWORD;
12440
    dwSize: DWORD;
12433
    guidType: TGUID;
12441
    guidType: TGUID;
12434
    dwOfs: DWORD;
12442
    dwOfs: DWORD;
12435
    dwType: DWORD;
12443
    dwType: DWORD;
12436
    dwFlags: DWORD;
12444
    dwFlags: DWORD;
12437
    tszName: Array [0..MAX_PATH-1] of WCHAR;
12445
    tszName: Array [0..MAX_PATH-1] of WCHAR;
12438
  end;
12446
  end;
12439
 
12447
 
12440
  PDIDeviceObjectInstance_DX3 = ^TDIDeviceObjectInstance_DX3;
12448
  PDIDeviceObjectInstance_DX3 = ^TDIDeviceObjectInstance_DX3;
12441
{$IFDEF UNICODE}
12449
{$IFDEF UNICODE}
12442
  TDIDeviceObjectInstance_DX3 = TDIDeviceObjectInstance_DX3W;
12450
  TDIDeviceObjectInstance_DX3 = TDIDeviceObjectInstance_DX3W;
12443
{$ELSE}
12451
{$ELSE}
12444
  TDIDeviceObjectInstance_DX3 = TDIDeviceObjectInstance_DX3A;
12452
  TDIDeviceObjectInstance_DX3 = TDIDeviceObjectInstance_DX3A;
12445
{$ENDIF}
12453
{$ENDIF}
12446
 
12454
 
12447
  PDIDeviceObjectInstance_DX5A = ^TDIDeviceObjectInstance_DX5A;
12455
  PDIDeviceObjectInstance_DX5A = ^TDIDeviceObjectInstance_DX5A;
12448
  TDIDeviceObjectInstance_DX5A = packed record
12456
  TDIDeviceObjectInstance_DX5A = packed record
12449
    dwSize: DWORD;
12457
    dwSize: DWORD;
12450
    guidType: TGUID;
12458
    guidType: TGUID;
12451
    dwOfs: DWORD;
12459
    dwOfs: DWORD;
12452
    dwType: DWORD;
12460
    dwType: DWORD;
12453
    dwFlags: DWORD;
12461
    dwFlags: DWORD;
12454
    tszName: Array [0..MAX_PATH-1] of CHAR;
12462
    tszName: Array [0..MAX_PATH-1] of CHAR;
12455
    dwFFMaxForce: DWORD;
12463
    dwFFMaxForce: DWORD;
12456
    dwFFForceResolution: DWORD;
12464
    dwFFForceResolution: DWORD;
12457
    wCollectionNumber: WORD;
12465
    wCollectionNumber: WORD;
12458
    wDesignatorIndex: WORD;
12466
    wDesignatorIndex: WORD;
12459
    wUsagePage: WORD;
12467
    wUsagePage: WORD;
12460
    wUsage: WORD;
12468
    wUsage: WORD;
12461
    dwDimension: DWORD;
12469
    dwDimension: DWORD;
12462
    wExponent: WORD;
12470
    wExponent: WORD;
12463
    wReserved: WORD;
12471
    wReserved: WORD;
12464
  end;
12472
  end;
12465
 
12473
 
12466
  PDIDeviceObjectInstance_DX5W = ^TDIDeviceObjectInstance_DX5W;
12474
  PDIDeviceObjectInstance_DX5W = ^TDIDeviceObjectInstance_DX5W;
12467
  TDIDeviceObjectInstance_DX5W = packed record
12475
  TDIDeviceObjectInstance_DX5W = packed record
12468
    dwSize: DWORD;
12476
    dwSize: DWORD;
12469
    guidType: TGUID;
12477
    guidType: TGUID;
12470
    dwOfs: DWORD;
12478
    dwOfs: DWORD;
12471
    dwType: DWORD;
12479
    dwType: DWORD;
12472
    dwFlags: DWORD;
12480
    dwFlags: DWORD;
12473
    tszName: Array [0..MAX_PATH-1] of WCHAR;
12481
    tszName: Array [0..MAX_PATH-1] of WCHAR;
12474
    dwFFMaxForce: DWORD;
12482
    dwFFMaxForce: DWORD;
12475
    dwFFForceResolution: DWORD;
12483
    dwFFForceResolution: DWORD;
12476
    wCollectionNumber: WORD;
12484
    wCollectionNumber: WORD;
12477
    wDesignatorIndex: WORD;
12485
    wDesignatorIndex: WORD;
12478
    wUsagePage: WORD;
12486
    wUsagePage: WORD;
12479
    wUsage: WORD;
12487
    wUsage: WORD;
12480
    dwDimension: DWORD;
12488
    dwDimension: DWORD;
12481
    wExponent: WORD;
12489
    wExponent: WORD;
12482
    wReserved: WORD;
12490
    wReserved: WORD;
12483
  end;
12491
  end;
12484
 
12492
 
12485
  PDIDeviceObjectInstance_DX5 = ^TDIDeviceObjectInstance_DX5;
12493
  PDIDeviceObjectInstance_DX5 = ^TDIDeviceObjectInstance_DX5;
12486
{$IFDEF UNICODE}
12494
{$IFDEF UNICODE}
12487
  TDIDeviceObjectInstance_DX5 = TDIDeviceObjectInstance_DX5W;
12495
  TDIDeviceObjectInstance_DX5 = TDIDeviceObjectInstance_DX5W;
12488
{$ELSE}
12496
{$ELSE}
12489
  TDIDeviceObjectInstance_DX5 = TDIDeviceObjectInstance_DX5A;
12497
  TDIDeviceObjectInstance_DX5 = TDIDeviceObjectInstance_DX5A;
12490
{$ENDIF}
12498
{$ENDIF}
12491
 
12499
 
12492
  PDIDeviceObjectInstanceA = ^TDIDeviceObjectInstanceA;
12500
  PDIDeviceObjectInstanceA = ^TDIDeviceObjectInstanceA;
12493
  PDIDeviceObjectInstanceW = ^TDIDeviceObjectInstanceA;
12501
  PDIDeviceObjectInstanceW = ^TDIDeviceObjectInstanceA;
12494
  PDIDeviceObjectInstance = ^TDIDeviceObjectInstance;
12502
  PDIDeviceObjectInstance = ^TDIDeviceObjectInstance;
12495
{$IFDEF DIRECTX3}
12503
{$IFDEF DIRECTX3}
12496
  TDIDeviceObjectInstanceA = TDIDeviceObjectInstance_DX3A;
12504
  TDIDeviceObjectInstanceA = TDIDeviceObjectInstance_DX3A;
12497
  TDIDeviceObjectInstanceW = TDIDeviceObjectInstance_DX3W;
12505
  TDIDeviceObjectInstanceW = TDIDeviceObjectInstance_DX3W;
12498
  TDIDeviceObjectInstance = TDIDeviceObjectInstance_DX3;
12506
  TDIDeviceObjectInstance = TDIDeviceObjectInstance_DX3;
12499
{$ELSE}
12507
{$ELSE}
12500
  TDIDeviceObjectInstanceA = TDIDeviceObjectInstance_DX5A;
12508
  TDIDeviceObjectInstanceA = TDIDeviceObjectInstance_DX5A;
12501
  TDIDeviceObjectInstanceW = TDIDeviceObjectInstance_DX5W;
12509
  TDIDeviceObjectInstanceW = TDIDeviceObjectInstance_DX5W;
12502
  TDIDeviceObjectInstance = TDIDeviceObjectInstance_DX5;
12510
  TDIDeviceObjectInstance = TDIDeviceObjectInstance_DX5;
12503
{$ENDIF}
12511
{$ENDIF}
12504
 
12512
 
12505
  // Bug fix (and deviation from the SDK). Callback *must* return
12513
  // Bug fix (and deviation from the SDK). Callback *must* return
12506
  // DIENUM_STOP (= 0) or DIENUM_CONTINUE (=1) in order to work
12514
  // DIENUM_STOP (= 0) or DIENUM_CONTINUE (=1) in order to work
12507
  // with the debug version of DINPUT.DLL
12515
  // with the debug version of DINPUT.DLL
12508
  TDIEnumDeviceObjectsCallbackA = function (
12516
  TDIEnumDeviceObjectsCallbackA = function (
12509
      var lpddoi: TDIDeviceObjectInstanceA; pvRef: Pointer): Integer; stdcall; // BOOL; stdcall;
12517
      var lpddoi: TDIDeviceObjectInstanceA; pvRef: Pointer): Integer; stdcall; // BOOL; stdcall;
12510
  TDIEnumDeviceObjectsCallbackW = function (
12518
  TDIEnumDeviceObjectsCallbackW = function (
12511
      var lpddoi: TDIDeviceObjectInstanceW; pvRef: Pointer): Integer; stdcall; // BOOL; stdcall;
12519
      var lpddoi: TDIDeviceObjectInstanceW; pvRef: Pointer): Integer; stdcall; // BOOL; stdcall;
12512
  TDIEnumDeviceObjectsCallback = function (
12520
  TDIEnumDeviceObjectsCallback = function (
12513
      var lpddoi: TDIDeviceObjectInstance; pvRef: Pointer): Integer; stdcall; // BOOL; stdcall;
12521
      var lpddoi: TDIDeviceObjectInstance; pvRef: Pointer): Integer; stdcall; // BOOL; stdcall;
12514
 
12522
 
12515
  TDIEnumDeviceObjectsProc = function (
12523
  TDIEnumDeviceObjectsProc = function (
12516
      var lpddoi: TDIDeviceObjectInstance; pvRef: Pointer): Integer; stdcall; // BOOL; stdcall;
12524
      var lpddoi: TDIDeviceObjectInstance; pvRef: Pointer): Integer; stdcall; // BOOL; stdcall;
12517
 
12525
 
12518
const
12526
const
12519
  DIDOI_FFACTUATOR        = $00000001;
12527
  DIDOI_FFACTUATOR        = $00000001;
12520
  DIDOI_FFEFFECTTRIGGER   = $00000002;
12528
  DIDOI_FFEFFECTTRIGGER   = $00000002;
12521
  DIDOI_POLLED            = $00008000;
12529
  DIDOI_POLLED            = $00008000;
12522
  DIDOI_ASPECTPOSITION    = $00000100;
12530
  DIDOI_ASPECTPOSITION    = $00000100;
12523
  DIDOI_ASPECTVELOCITY    = $00000200;
12531
  DIDOI_ASPECTVELOCITY    = $00000200;
12524
  DIDOI_ASPECTACCEL       = $00000300;
12532
  DIDOI_ASPECTACCEL       = $00000300;
12525
  DIDOI_ASPECTFORCE       = $00000400;
12533
  DIDOI_ASPECTFORCE       = $00000400;
12526
  DIDOI_ASPECTMASK        = $00000F00;
12534
  DIDOI_ASPECTMASK        = $00000F00;
12527
  DIDOI_GUIDISUSAGE       = $00010000;
12535
  DIDOI_GUIDISUSAGE       = $00010000;
12528
 
12536
 
12529
type
12537
type
12530
  PDIPropHeader = ^TDIPropHeader;
12538
  PDIPropHeader = ^TDIPropHeader;
12531
  TDIPropHeader = packed record
12539
  TDIPropHeader = packed record
12532
    dwSize: DWORD;
12540
    dwSize: DWORD;
12533
    dwHeaderSize: DWORD;
12541
    dwHeaderSize: DWORD;
12534
    dwObj: DWORD;
12542
    dwObj: DWORD;
12535
    dwHow: DWORD;
12543
    dwHow: DWORD;
12536
  end;
12544
  end;
12537
 
12545
 
12538
const
12546
const
12539
  DIPH_DEVICE = 0;
12547
  DIPH_DEVICE = 0;
12540
  DIPH_BYOFFSET = 1;
12548
  DIPH_BYOFFSET = 1;
12541
  DIPH_BYID = 2;
12549
  DIPH_BYID = 2;
12542
  DIPH_BYUSAGE = 3;
12550
  DIPH_BYUSAGE = 3;
12543
 
12551
 
12544
function DIMAKEUSAGEDWORD(UsagePage, Usage: WORD) : DWORD;
12552
function DIMAKEUSAGEDWORD(UsagePage, Usage: WORD) : DWORD;
12545
 
12553
 
12546
type
12554
type
12547
  PDIPropDWord = ^TDIPropDWord;
12555
  PDIPropDWord = ^TDIPropDWord;
12548
  TDIPropDWord = packed record
12556
  TDIPropDWord = packed record
12549
    diph: TDIPropHeader;
12557
    diph: TDIPropHeader;
12550
    dwData: DWORD;
12558
    dwData: DWORD;
12551
  end;
12559
  end;
12552
 
12560
 
12553
  PDIPropRange = ^TDIPropRange;
12561
  PDIPropRange = ^TDIPropRange;
12554
  TDIPropRange = packed record
12562
  TDIPropRange = packed record
12555
    diph: TDIPropHeader;
12563
    diph: TDIPropHeader;
12556
    lMin: Longint;
12564
    lMin: Longint;
12557
    lMax: Longint;
12565
    lMax: Longint;
12558
  end;
12566
  end;
12559
 
12567
 
12560
const
12568
const
12561
  DIPROPRANGE_NOMIN = $80000000;
12569
  DIPROPRANGE_NOMIN = $80000000;
12562
  DIPROPRANGE_NOMAX = $7FFFFFFF;
12570
  DIPROPRANGE_NOMAX = $7FFFFFFF;
12563
 
12571
 
12564
type
12572
type
12565
  PDIPropCal = ^TDIPropCal;
12573
  PDIPropCal = ^TDIPropCal;
12566
  TDIPropCal = packed record
12574
  TDIPropCal = packed record
12567
    diph: TDIPropHeader;
12575
    diph: TDIPropHeader;
12568
    lMin:    LongInt;
12576
    lMin:    LongInt;
12569
    lCenter: LongInt;
12577
    lCenter: LongInt;
12570
    lMax:    LongInt;
12578
    lMax:    LongInt;
12571
  end;
12579
  end;
12572
 
12580
 
12573
  PDIPropGUIDAndPath = ^TDIPropGUIDAndPath;
12581
  PDIPropGUIDAndPath = ^TDIPropGUIDAndPath;
12574
  TDIPropGUIDAndPath = packed record
12582
  TDIPropGUIDAndPath = packed record
12575
    diph: TDIPropHeader;
12583
    diph: TDIPropHeader;
12576
    guidClass: TGUID;
12584
    guidClass: TGUID;
12577
    wszPath: array [0..MAX_PATH-1] of WideChar;
12585
    wszPath: array [0..MAX_PATH-1] of WideChar;
12578
  end;
12586
  end;
12579
 
12587
 
12580
  PDIPropString = ^TDIPropString;
12588
  PDIPropString = ^TDIPropString;
12581
  TDIPropString = packed record
12589
  TDIPropString = packed record
12582
    diph: TDIPropHeader;
12590
    diph: TDIPropHeader;
12583
    wsz: array [0..MAX_PATH-1] of WideChar;
12591
    wsz: array [0..MAX_PATH-1] of WideChar;
12584
  end;
12592
  end;
12585
 
12593
 
12586
type
12594
type
12587
  MAKEDIPROP = PGUID;
12595
  MAKEDIPROP = PGUID;
12588
 
12596
 
12589
const
12597
const
12590
  DIPROP_BUFFERSIZE = MAKEDIPROP(1);
12598
  DIPROP_BUFFERSIZE = MAKEDIPROP(1);
12591
 
12599
 
12592
  DIPROP_AXISMODE = MAKEDIPROP(2);
12600
  DIPROP_AXISMODE = MAKEDIPROP(2);
12593
 
12601
 
12594
  DIPROPAXISMODE_ABS = 0;
12602
  DIPROPAXISMODE_ABS = 0;
12595
  DIPROPAXISMODE_REL = 1;
12603
  DIPROPAXISMODE_REL = 1;
12596
 
12604
 
12597
  DIPROP_GRANULARITY = MAKEDIPROP(3);
12605
  DIPROP_GRANULARITY = MAKEDIPROP(3);
12598
 
12606
 
12599
  DIPROP_RANGE = MAKEDIPROP(4);
12607
  DIPROP_RANGE = MAKEDIPROP(4);
12600
 
12608
 
12601
  DIPROP_DEADZONE = MAKEDIPROP(5);
12609
  DIPROP_DEADZONE = MAKEDIPROP(5);
12602
 
12610
 
12603
  DIPROP_SATURATION = MAKEDIPROP(6);
12611
  DIPROP_SATURATION = MAKEDIPROP(6);
12604
 
12612
 
12605
  DIPROP_FFGAIN = MAKEDIPROP(7);
12613
  DIPROP_FFGAIN = MAKEDIPROP(7);
12606
 
12614
 
12607
  DIPROP_FFLOAD = MAKEDIPROP(8);
12615
  DIPROP_FFLOAD = MAKEDIPROP(8);
12608
 
12616
 
12609
  DIPROP_AUTOCENTER = MAKEDIPROP(9);
12617
  DIPROP_AUTOCENTER = MAKEDIPROP(9);
12610
 
12618
 
12611
  DIPROPAUTOCENTER_OFF = 0;
12619
  DIPROPAUTOCENTER_OFF = 0;
12612
  DIPROPAUTOCENTER_ON = 1;
12620
  DIPROPAUTOCENTER_ON = 1;
12613
 
12621
 
12614
  DIPROP_CALIBRATIONMODE = MAKEDIPROP(10);
12622
  DIPROP_CALIBRATIONMODE = MAKEDIPROP(10);
12615
 
12623
 
12616
  DIPROPCALIBRATIONMODE_COOKED = 0;
12624
  DIPROPCALIBRATIONMODE_COOKED = 0;
12617
  DIPROPCALIBRATIONMODE_RAW = 1;
12625
  DIPROPCALIBRATIONMODE_RAW = 1;
12618
 
12626
 
12619
  DIPROP_CALIBRATION      = MAKEDIPROP(11);
12627
  DIPROP_CALIBRATION      = MAKEDIPROP(11);
12620
 
12628
 
12621
  DIPROP_GUIDANDPATH      = MAKEDIPROP(12);
12629
  DIPROP_GUIDANDPATH      = MAKEDIPROP(12);
12622
 
12630
 
12623
  DIPROP_INSTANCENAME     = MAKEDIPROP(13);
12631
  DIPROP_INSTANCENAME     = MAKEDIPROP(13);
12624
 
12632
 
12625
  DIPROP_PRODUCTNAME      = MAKEDIPROP(14);
12633
  DIPROP_PRODUCTNAME      = MAKEDIPROP(14);
12626
 
12634
 
12627
  DIPROP_JOYSTICKID       = MAKEDIPROP(15);
12635
  DIPROP_JOYSTICKID       = MAKEDIPROP(15);
12628
 
12636
 
12629
  DIPROP_GETPORTDISPLAYNAME       = MAKEDIPROP(16);
12637
  DIPROP_GETPORTDISPLAYNAME       = MAKEDIPROP(16);
12630
 
12638
 
12631
 
12639
 
12632
  DIPROP_ENABLEREPORTID       = MAKEDIPROP(17);
12640
  DIPROP_ENABLEREPORTID       = MAKEDIPROP(17);
12633
 
12641
 
12634
 
12642
 
12635
  DIPROP_GETPHYSICALRANGE            = MAKEDIPROP(18);
12643
  DIPROP_GETPHYSICALRANGE            = MAKEDIPROP(18);
12636
 
12644
 
12637
  DIPROP_GETLOGICALRANGE            = MAKEDIPROP(19);
12645
  DIPROP_GETLOGICALRANGE            = MAKEDIPROP(19);
12638
 
12646
 
12639
 
12647
 
12640
type
12648
type
12641
  PDIDeviceObjectData = ^TDIDeviceObjectData;
12649
  PDIDeviceObjectData = ^TDIDeviceObjectData;
12642
  TDIDeviceObjectData = packed record
12650
  TDIDeviceObjectData = packed record
12643
    dwOfs: DWORD;
12651
    dwOfs: DWORD;
12644
    dwData: DWORD;
12652
    dwData: DWORD;
12645
    dwTimeStamp: DWORD;
12653
    dwTimeStamp: DWORD;
12646
    dwSequence: DWORD;
12654
    dwSequence: DWORD;
12647
  end;
12655
  end;
12648
 
12656
 
12649
const
12657
const
12650
  DIGDD_PEEK = $00000001;
12658
  DIGDD_PEEK = $00000001;
12651
{
12659
{
12652
#define DISEQUENCE_COMPARE(dwSequence1, cmp, dwSequence2) \
12660
#define DISEQUENCE_COMPARE(dwSequence1, cmp, dwSequence2) \
12653
                         (int) ((dwSequence1) - (dwSequence2))  cmp 0
12661
                         (int) ((dwSequence1) - (dwSequence2))  cmp 0
12654
}
12662
}
12655
 
12663
 
12656
  DISCL_EXCLUSIVE  = $00000001;
12664
  DISCL_EXCLUSIVE  = $00000001;
12657
  DISCL_NONEXCLUSIVE = $00000002;
12665
  DISCL_NONEXCLUSIVE = $00000002;
12658
  DISCL_FOREGROUND = $00000004;
12666
  DISCL_FOREGROUND = $00000004;
12659
  DISCL_BACKGROUND = $00000008;
12667
  DISCL_BACKGROUND = $00000008;
12660
  DISCL_NOWINKEY   = $00000010;
12668
  DISCL_NOWINKEY   = $00000010;
12661
 
12669
 
12662
 
12670
 
12663
type
12671
type
12664
 
12672
 
12665
  PDIDeviceInstance_DX3A = ^TDIDeviceInstance_DX3A;
12673
  PDIDeviceInstance_DX3A = ^TDIDeviceInstance_DX3A;
12666
  TDIDeviceInstance_DX3A = packed record
12674
  TDIDeviceInstance_DX3A = packed record
12667
    dwSize: DWORD;
12675
    dwSize: DWORD;
12668
    guidInstance: TGUID;
12676
    guidInstance: TGUID;
12669
    guidProduct: TGUID;
12677
    guidProduct: TGUID;
12670
    dwDevType: DWORD;
12678
    dwDevType: DWORD;
12671
    tszInstanceName: Array [0..MAX_PATH-1] of AnsiChar;
12679
    tszInstanceName: Array [0..MAX_PATH-1] of AnsiChar;
12672
    tszProductName: Array [0..MAX_PATH-1] of AnsiChar;
12680
    tszProductName: Array [0..MAX_PATH-1] of AnsiChar;
12673
  end;
12681
  end;
12674
 
12682
 
12675
  PDIDeviceInstance_DX3W = ^TDIDeviceInstance_DX3W;
12683
  PDIDeviceInstance_DX3W = ^TDIDeviceInstance_DX3W;
12676
  TDIDeviceInstance_DX3W = packed record
12684
  TDIDeviceInstance_DX3W = packed record
12677
    dwSize: DWORD;
12685
    dwSize: DWORD;
12678
    guidInstance: TGUID;
12686
    guidInstance: TGUID;
12679
    guidProduct: TGUID;
12687
    guidProduct: TGUID;
12680
    dwDevType: DWORD;
12688
    dwDevType: DWORD;
12681
    tszInstanceName: Array [0..MAX_PATH-1] of WideChar;
12689
    tszInstanceName: Array [0..MAX_PATH-1] of WideChar;
12682
    tszProductName: Array [0..MAX_PATH-1] of WideChar;
12690
    tszProductName: Array [0..MAX_PATH-1] of WideChar;
12683
  end;
12691
  end;
12684
 
12692
 
12685
  PDIDeviceInstance_DX3 = ^TDIDeviceInstance_DX3;
12693
  PDIDeviceInstance_DX3 = ^TDIDeviceInstance_DX3;
12686
{$IFDEF UNICODE}
12694
{$IFDEF UNICODE}
12687
  TDIDeviceInstance_DX3 = TDIDeviceInstance_DX3W;
12695
  TDIDeviceInstance_DX3 = TDIDeviceInstance_DX3W;
12688
{$ELSE}
12696
{$ELSE}
12689
  TDIDeviceInstance_DX3 = TDIDeviceInstance_DX3A;
12697
  TDIDeviceInstance_DX3 = TDIDeviceInstance_DX3A;
12690
{$ENDIF}
12698
{$ENDIF}
12691
 
12699
 
12692
  PDIDeviceInstance_DX5A = ^TDIDeviceInstance_DX5A;
12700
  PDIDeviceInstance_DX5A = ^TDIDeviceInstance_DX5A;
12693
  TDIDeviceInstance_DX5A = packed record
12701
  TDIDeviceInstance_DX5A = packed record
12694
    dwSize: DWORD;
12702
    dwSize: DWORD;
12695
    guidInstance: TGUID;
12703
    guidInstance: TGUID;
12696
    guidProduct: TGUID;
12704
    guidProduct: TGUID;
12697
    dwDevType: DWORD;
12705
    dwDevType: DWORD;
12698
    tszInstanceName: Array [0..MAX_PATH-1] of AnsiChar;
12706
    tszInstanceName: Array [0..MAX_PATH-1] of AnsiChar;
12699
    tszProductName: Array [0..MAX_PATH-1] of AnsiChar;
12707
    tszProductName: Array [0..MAX_PATH-1] of AnsiChar;
12700
    guidFFDriver: TGUID;
12708
    guidFFDriver: TGUID;
12701
    wUsagePage: WORD;
12709
    wUsagePage: WORD;
12702
    wUsage: WORD;
12710
    wUsage: WORD;
12703
  end;
12711
  end;
12704
 
12712
 
12705
  PDIDeviceInstance_DX5W = ^TDIDeviceInstance_DX5W;
12713
  PDIDeviceInstance_DX5W = ^TDIDeviceInstance_DX5W;
12706
  TDIDeviceInstance_DX5W = packed record
12714
  TDIDeviceInstance_DX5W = packed record
12707
    dwSize: DWORD;
12715
    dwSize: DWORD;
12708
    guidInstance: TGUID;
12716
    guidInstance: TGUID;
12709
    guidProduct: TGUID;
12717
    guidProduct: TGUID;
12710
    dwDevType: DWORD;
12718
    dwDevType: DWORD;
12711
    tszInstanceName: Array [0..MAX_PATH-1] of WideChar;
12719
    tszInstanceName: Array [0..MAX_PATH-1] of WideChar;
12712
    tszProductName: Array [0..MAX_PATH-1] of WideChar;
12720
    tszProductName: Array [0..MAX_PATH-1] of WideChar;
12713
    guidFFDriver: TGUID;
12721
    guidFFDriver: TGUID;
12714
    wUsagePage: WORD;
12722
    wUsagePage: WORD;
12715
    wUsage: WORD;
12723
    wUsage: WORD;
12716
  end;
12724
  end;
12717
 
12725
 
12718
  PDIDeviceInstance_DX5 = ^TDIDeviceInstance_DX5;
12726
  PDIDeviceInstance_DX5 = ^TDIDeviceInstance_DX5;
12719
{$IFDEF UNICODE}
12727
{$IFDEF UNICODE}
12720
  TDIDeviceInstance_DX5 = TDIDeviceInstance_DX5W;
12728
  TDIDeviceInstance_DX5 = TDIDeviceInstance_DX5W;
12721
{$ELSE}
12729
{$ELSE}
12722
  TDIDeviceInstance_DX5 = TDIDeviceInstance_DX5A;
12730
  TDIDeviceInstance_DX5 = TDIDeviceInstance_DX5A;
12723
{$ENDIF}
12731
{$ENDIF}
12724
 
12732
 
12725
  PDIDeviceInstanceA = ^TDIDeviceInstanceA;
12733
  PDIDeviceInstanceA = ^TDIDeviceInstanceA;
12726
  PDIDeviceInstanceW = ^TDIDeviceInstanceW;
12734
  PDIDeviceInstanceW = ^TDIDeviceInstanceW;
12727
  PDIDeviceInstance = ^TDIDeviceInstance;
12735
  PDIDeviceInstance = ^TDIDeviceInstance;
12728
{$IFDEF DIRECTX3}
12736
{$IFDEF DIRECTX3}
12729
  TDIDeviceInstanceA = TDIDeviceInstance_DX3A;
12737
  TDIDeviceInstanceA = TDIDeviceInstance_DX3A;
12730
  TDIDeviceInstanceW = TDIDeviceInstance_DX3W;
12738
  TDIDeviceInstanceW = TDIDeviceInstance_DX3W;
12731
  TDIDeviceInstance = TDIDeviceInstance_DX3;
12739
  TDIDeviceInstance = TDIDeviceInstance_DX3;
12732
{$ELSE}
12740
{$ELSE}
12733
  TDIDeviceInstanceA = TDIDeviceInstance_DX5A;
12741
  TDIDeviceInstanceA = TDIDeviceInstance_DX5A;
12734
  TDIDeviceInstanceW = TDIDeviceInstance_DX5W;
12742
  TDIDeviceInstanceW = TDIDeviceInstance_DX5W;
12735
  TDIDeviceInstance = TDIDeviceInstance_DX5;
12743
  TDIDeviceInstance = TDIDeviceInstance_DX5;
12736
{$ENDIF}
12744
{$ENDIF}
12737
 
12745
 
12738
  IDirectInputDeviceA = interface (IUnknown)
12746
  IDirectInputDeviceA = interface (IUnknown)
12739
    ['{5944E680-C92E-11CF-BFC7-444553540000}']
12747
    ['{5944E680-C92E-11CF-BFC7-444553540000}']
12740
    (*** IDirectInputDeviceA methods ***)
12748
    (*** IDirectInputDeviceA methods ***)
12741
    function GetCapabilities(var lpDIDevCaps: TDIDevCaps) : HResult;  stdcall;
12749
    function GetCapabilities(var lpDIDevCaps: TDIDevCaps) : HResult;  stdcall;
12742
    function EnumObjects(lpCallback: TDIEnumDeviceObjectsCallbackA;
12750
    function EnumObjects(lpCallback: TDIEnumDeviceObjectsCallbackA;
12743
        pvRef: Pointer; dwFlags: DWORD) : HResult;  stdcall;
12751
        pvRef: Pointer; dwFlags: DWORD) : HResult;  stdcall;
12744
    function GetProperty(rguidProp: PGUID; var pdiph: TDIPropHeader) :
12752
    function GetProperty(rguidProp: PGUID; var pdiph: TDIPropHeader) :
12745
        HResult;  stdcall;
12753
        HResult;  stdcall;
12746
    function SetProperty(rguidProp: PGUID; const pdiph: TDIPropHeader) :
12754
    function SetProperty(rguidProp: PGUID; const pdiph: TDIPropHeader) :
12747
        HResult;  stdcall;
12755
        HResult;  stdcall;
12748
    function Acquire : HResult;  stdcall;
12756
    function Acquire : HResult;  stdcall;
12749
    function Unacquire : HResult;  stdcall;
12757
    function Unacquire : HResult;  stdcall;
12750
    function GetDeviceState(cbData: DWORD; lpvData: Pointer) : HResult;  stdcall;
12758
    function GetDeviceState(cbData: DWORD; lpvData: Pointer) : HResult;  stdcall;
12751
    function GetDeviceData(cbObjectData: DWORD; rgdod: PDIDeviceObjectData;
12759
    function GetDeviceData(cbObjectData: DWORD; rgdod: PDIDeviceObjectData;
12752
        var pdwInOut: DWORD; dwFlags: DWORD) : HResult;  stdcall;
12760
        var pdwInOut: DWORD; dwFlags: DWORD) : HResult;  stdcall;
12753
    function SetDataFormat(var lpdf: TDIDataFormat) : HResult;  stdcall;
12761
    function SetDataFormat(var lpdf: TDIDataFormat) : HResult;  stdcall;
12754
    function SetEventNotification(hEvent: THandle) : HResult;  stdcall;
12762
    function SetEventNotification(hEvent: THandle) : HResult;  stdcall;
12755
    function SetCooperativeLevel(hwnd: HWND; dwFlags: DWORD) : HResult;  stdcall;
12763
    function SetCooperativeLevel(hwnd: HWND; dwFlags: DWORD) : HResult;  stdcall;
12756
    function GetObjectInfo(var pdidoi: TDIDeviceObjectInstanceA; dwObj: DWORD;
12764
    function GetObjectInfo(var pdidoi: TDIDeviceObjectInstanceA; dwObj: DWORD;
12757
        dwHow: DWORD) : HResult;  stdcall;
12765
        dwHow: DWORD) : HResult;  stdcall;
12758
    function GetDeviceInfo(var pdidi: TDIDeviceInstanceA) : HResult;  stdcall;
12766
    function GetDeviceInfo(var pdidi: TDIDeviceInstanceA) : HResult;  stdcall;
12759
    function RunControlPanel(hwndOwner: HWND; dwFlags: DWORD) : HResult;  stdcall;
12767
    function RunControlPanel(hwndOwner: HWND; dwFlags: DWORD) : HResult;  stdcall;
12760
    function Initialize(hinst: THandle; dwVersion: DWORD; const rguid: TGUID) : HResult;  stdcall;
12768
    function Initialize(hinst: THandle; dwVersion: DWORD; const rguid: TGUID) : HResult;  stdcall;
12761
  end;
12769
  end;
12762
 
12770
 
12763
  IDirectInputDeviceW = interface (IUnknown)
12771
  IDirectInputDeviceW = interface (IUnknown)
12764
    ['{5944E681-C92E-11CF-BFC7-444553540000}']
12772
    ['{5944E681-C92E-11CF-BFC7-444553540000}']
12765
    (*** IDirectInputDeviceW methods ***)
12773
    (*** IDirectInputDeviceW methods ***)
12766
    function GetCapabilities(var lpDIDevCaps: TDIDevCaps) : HResult;  stdcall;
12774
    function GetCapabilities(var lpDIDevCaps: TDIDevCaps) : HResult;  stdcall;
12767
    function EnumObjects(lpCallback: TDIEnumDeviceObjectsCallbackW;
12775
    function EnumObjects(lpCallback: TDIEnumDeviceObjectsCallbackW;
12768
        pvRef: Pointer; dwFlags: DWORD) : HResult;  stdcall;
12776
        pvRef: Pointer; dwFlags: DWORD) : HResult;  stdcall;
12769
    function GetProperty(rguidProp: PGUID; var pdiph: TDIPropHeader) :
12777
    function GetProperty(rguidProp: PGUID; var pdiph: TDIPropHeader) :
12770
        HResult;  stdcall;
12778
        HResult;  stdcall;
12771
    function SetProperty(rguidProp: PGUID; var pdiph: TDIPropHeader) :
12779
    function SetProperty(rguidProp: PGUID; var pdiph: TDIPropHeader) :
12772
        HResult;  stdcall;
12780
        HResult;  stdcall;
12773
    function Acquire : HResult;  stdcall;
12781
    function Acquire : HResult;  stdcall;
12774
    function Unacquire : HResult;  stdcall;
12782
    function Unacquire : HResult;  stdcall;
12775
    function GetDeviceState(cbData: DWORD; lpvData: Pointer) : HResult;  stdcall;
12783
    function GetDeviceState(cbData: DWORD; lpvData: Pointer) : HResult;  stdcall;
12776
    function GetDeviceData(cbObjectData: DWORD; rgdod: PDIDeviceObjectData;
12784
    function GetDeviceData(cbObjectData: DWORD; rgdod: PDIDeviceObjectData;
12777
        var pdwInOut: DWORD; dwFlags: DWORD) : HResult;  stdcall;
12785
        var pdwInOut: DWORD; dwFlags: DWORD) : HResult;  stdcall;
12778
    function SetDataFormat(var lpdf: TDIDataFormat) : HResult;  stdcall;
12786
    function SetDataFormat(var lpdf: TDIDataFormat) : HResult;  stdcall;
12779
    function SetEventNotification(hEvent: THandle) : HResult;  stdcall;
12787
    function SetEventNotification(hEvent: THandle) : HResult;  stdcall;
12780
    function SetCooperativeLevel(hwnd: HWND; dwFlags: DWORD) : HResult;  stdcall;
12788
    function SetCooperativeLevel(hwnd: HWND; dwFlags: DWORD) : HResult;  stdcall;
12781
    function GetObjectInfo(var pdidoi: TDIDeviceObjectInstanceW; dwObj: DWORD;
12789
    function GetObjectInfo(var pdidoi: TDIDeviceObjectInstanceW; dwObj: DWORD;
12782
        dwHow: DWORD) : HResult;  stdcall;
12790
        dwHow: DWORD) : HResult;  stdcall;
12783
    function GetDeviceInfo(var pdidi: TDIDeviceInstanceW) : HResult;  stdcall;
12791
    function GetDeviceInfo(var pdidi: TDIDeviceInstanceW) : HResult;  stdcall;
12784
    function RunControlPanel(hwndOwner: HWND; dwFlags: DWORD) : HResult;  stdcall;
12792
    function RunControlPanel(hwndOwner: HWND; dwFlags: DWORD) : HResult;  stdcall;
12785
    function Initialize(hinst: THandle; dwVersion: DWORD; const rguid: TGUID) : HResult;  stdcall;
12793
    function Initialize(hinst: THandle; dwVersion: DWORD; const rguid: TGUID) : HResult;  stdcall;
12786
  end;
12794
  end;
12787
 
12795
 
12788
{$IFDEF UNICODE}
12796
{$IFDEF UNICODE}
12789
  IDirectInputDevice = IDirectInputDeviceW;
12797
  IDirectInputDevice = IDirectInputDeviceW;
12790
{$ELSE}
12798
{$ELSE}
12791
  IDirectInputDevice = IDirectInputDeviceA;
12799
  IDirectInputDevice = IDirectInputDeviceA;
12792
{$ENDIF}
12800
{$ENDIF}
12793
 
12801
 
12794
const
12802
const
12795
  DISFFC_RESET            = $00000001;
12803
  DISFFC_RESET            = $00000001;
12796
  DISFFC_STOPALL          = $00000002;
12804
  DISFFC_STOPALL          = $00000002;
12797
  DISFFC_PAUSE            = $00000004;
12805
  DISFFC_PAUSE            = $00000004;
12798
  DISFFC_CONTINUE         = $00000008;
12806
  DISFFC_CONTINUE         = $00000008;
12799
  DISFFC_SETACTUATORSON   = $00000010;
12807
  DISFFC_SETACTUATORSON   = $00000010;
12800
  DISFFC_SETACTUATORSOFF  = $00000020;
12808
  DISFFC_SETACTUATORSOFF  = $00000020;
12801
 
12809
 
12802
  DIGFFS_EMPTY            = $00000001;
12810
  DIGFFS_EMPTY            = $00000001;
12803
  DIGFFS_STOPPED          = $00000002;
12811
  DIGFFS_STOPPED          = $00000002;
12804
  DIGFFS_PAUSED           = $00000004;
12812
  DIGFFS_PAUSED           = $00000004;
12805
  DIGFFS_ACTUATORSON      = $00000010;
12813
  DIGFFS_ACTUATORSON      = $00000010;
12806
  DIGFFS_ACTUATORSOFF     = $00000020;
12814
  DIGFFS_ACTUATORSOFF     = $00000020;
12807
  DIGFFS_POWERON          = $00000040;
12815
  DIGFFS_POWERON          = $00000040;
12808
  DIGFFS_POWEROFF         = $00000080;
12816
  DIGFFS_POWEROFF         = $00000080;
12809
  DIGFFS_SAFETYSWITCHON   = $00000100;
12817
  DIGFFS_SAFETYSWITCHON   = $00000100;
12810
  DIGFFS_SAFETYSWITCHOFF  = $00000200;
12818
  DIGFFS_SAFETYSWITCHOFF  = $00000200;
12811
  DIGFFS_USERFFSWITCHON   = $00000400;
12819
  DIGFFS_USERFFSWITCHON   = $00000400;
12812
  DIGFFS_USERFFSWITCHOFF  = $00000800;
12820
  DIGFFS_USERFFSWITCHOFF  = $00000800;
12813
  DIGFFS_DEVICELOST       = $80000000;
12821
  DIGFFS_DEVICELOST       = $80000000;
12814
 
12822
 
12815
type
12823
type
12816
  PDIEffectInfoA = ^TDIEffectInfoA;
12824
  PDIEffectInfoA = ^TDIEffectInfoA;
12817
  TDIEffectInfoA = packed record
12825
  TDIEffectInfoA = packed record
12818
    dwSize : DWORD;
12826
    dwSize : DWORD;
12819
    guid : TGUID;
12827
    guid : TGUID;
12820
    dwEffType : DWORD;
12828
    dwEffType : DWORD;
12821
    dwStaticParams : DWORD;
12829
    dwStaticParams : DWORD;
12822
    dwDynamicParams : DWORD;
12830
    dwDynamicParams : DWORD;
12823
    tszName : array [0..MAX_PATH-1] of CHAR;
12831
    tszName : array [0..MAX_PATH-1] of CHAR;
12824
  end;
12832
  end;
12825
 
12833
 
12826
  PDIEffectInfoW = ^TDIEffectInfoW;
12834
  PDIEffectInfoW = ^TDIEffectInfoW;
12827
  TDIEffectInfoW = packed record
12835
  TDIEffectInfoW = packed record
12828
    dwSize : DWORD;
12836
    dwSize : DWORD;
12829
    guid : TGUID;
12837
    guid : TGUID;
12830
    dwEffType : DWORD;
12838
    dwEffType : DWORD;
12831
    dwStaticParams : DWORD;
12839
    dwStaticParams : DWORD;
12832
    dwDynamicParams : DWORD;
12840
    dwDynamicParams : DWORD;
12833
    tszName : array [0..MAX_PATH-1] of WCHAR;
12841
    tszName : array [0..MAX_PATH-1] of WCHAR;
12834
  end;
12842
  end;
12835
 
12843
 
12836
  PDIEffectInfo = ^TDIEffectInfo;
12844
  PDIEffectInfo = ^TDIEffectInfo;
12837
{$IFDEF UNICODE}
12845
{$IFDEF UNICODE}
12838
  TDIEffectInfo = TDIEffectInfoW;
12846
  TDIEffectInfo = TDIEffectInfoW;
12839
{$ELSE}
12847
{$ELSE}
12840
  TDIEffectInfo = TDIEffectInfoA;
12848
  TDIEffectInfo = TDIEffectInfoA;
12841
{$ENDIF}
12849
{$ENDIF}
12842
 
12850
 
12843
const
12851
const
12844
  DISDD_CONTINUE          = $00000001;
12852
  DISDD_CONTINUE          = $00000001;
12845
 
12853
 
12846
  // Bug fix & deviation from the SDK: Must return DIENUM_STOP or
12854
  // Bug fix & deviation from the SDK: Must return DIENUM_STOP or
12847
  // DIENUM_CONTINUE (=1) in order to work with the debug version of DINPUT.DLL
12855
  // DIENUM_CONTINUE (=1) in order to work with the debug version of DINPUT.DLL
12848
type
12856
type
12849
  TDIEnumEffectsCallbackA =
12857
  TDIEnumEffectsCallbackA =
12850
      function(var pdei: TDIEffectInfoA; pvRef: pointer): Integer; stdcall; // BOOL; stdcall;
12858
      function(var pdei: TDIEffectInfoA; pvRef: pointer): Integer; stdcall; // BOOL; stdcall;
12851
  TDIEnumEffectsCallbackW =
12859
  TDIEnumEffectsCallbackW =
12852
      function(var pdei: TDIEffectInfoW; pvRef: pointer): Integer; stdcall; // BOOL; stdcall;
12860
      function(var pdei: TDIEffectInfoW; pvRef: pointer): Integer; stdcall; // BOOL; stdcall;
12853
  TDIEnumEffectsCallback =
12861
  TDIEnumEffectsCallback =
12854
      function(var pdei: TDIEffectInfo; pvRef: pointer) : Integer; stdcall; // BOOL; stdcall;
12862
      function(var pdei: TDIEffectInfo; pvRef: pointer) : Integer; stdcall; // BOOL; stdcall;
12855
  TDIEnumEffectsProc = TDIEnumEffectsCallback;
12863
  TDIEnumEffectsProc = TDIEnumEffectsCallback;
12856
 
12864
 
12857
  TDIEnumCreatedEffectObjectsCallback =
12865
  TDIEnumCreatedEffectObjectsCallback =
12858
      function(peff: IDirectInputEffect; pvRev: pointer): Integer; stdcall; // BOOL; stdcall;
12866
      function(peff: IDirectInputEffect; pvRev: pointer): Integer; stdcall; // BOOL; stdcall;
12859
  TDIEnumCreatedEffectObjectsProc = TDIEnumCreatedEffectObjectsCallback;
12867
  TDIEnumCreatedEffectObjectsProc = TDIEnumCreatedEffectObjectsCallback;
12860
 
12868
 
12861
  IDirectInputDevice2A = interface (IDirectInputDeviceA)
12869
  IDirectInputDevice2A = interface (IDirectInputDeviceA)
12862
    ['{5944E682-C92E-11CF-BFC7-444553540000}']
12870
    ['{5944E682-C92E-11CF-BFC7-444553540000}']
12863
    (*** IDirectInputDevice2A methods ***)
12871
    (*** IDirectInputDevice2A methods ***)
12864
    function CreateEffect(const rguid: TGUID; lpeff: PDIEffect;
12872
    function CreateEffect(const rguid: TGUID; lpeff: PDIEffect;
12865
        var ppdeff: IDirectInputEffect; punkOuter: IUnknown) : HResult;  stdcall;
12873
        var ppdeff: IDirectInputEffect; punkOuter: IUnknown) : HResult;  stdcall;
12866
    function EnumEffects(lpCallback: TDIEnumEffectsCallbackA;
12874
    function EnumEffects(lpCallback: TDIEnumEffectsCallbackA;
12867
        pvRef: pointer; dwEffType: DWORD) : HResult;  stdcall;
12875
        pvRef: pointer; dwEffType: DWORD) : HResult;  stdcall;
12868
    function GetEffectInfo(pdei: TDIEffectInfoA; const rguid: TGUID) : HResult;  stdcall;
12876
    function GetEffectInfo(pdei: TDIEffectInfoA; const rguid: TGUID) : HResult;  stdcall;
12869
    function GetForceFeedbackState(var pdwOut: DWORD) : HResult;  stdcall;
12877
    function GetForceFeedbackState(var pdwOut: DWORD) : HResult;  stdcall;
12870
    function SendForceFeedbackCommand(dwFlags: DWORD) : HResult;  stdcall;
12878
    function SendForceFeedbackCommand(dwFlags: DWORD) : HResult;  stdcall;
12871
    function EnumCreatedEffectObjects(lpCallback:
12879
    function EnumCreatedEffectObjects(lpCallback:
12872
        TDIEnumCreatedEffectObjectsCallback;
12880
        TDIEnumCreatedEffectObjectsCallback;
12873
        pvRef: pointer; fl: DWORD) : HResult;  stdcall;
12881
        pvRef: pointer; fl: DWORD) : HResult;  stdcall;
12874
    function Escape(var pesc: TDIEffEscape) : HResult;  stdcall;
12882
    function Escape(var pesc: TDIEffEscape) : HResult;  stdcall;
12875
    function Poll : HResult;  stdcall;
12883
    function Poll : HResult;  stdcall;
12876
    function SendDeviceData
12884
    function SendDeviceData
12877
        (cbObjectData: DWORD; var rgdod: TDIDeviceObjectData;
12885
        (cbObjectData: DWORD; var rgdod: TDIDeviceObjectData;
12878
        var pdwInOut: DWORD; fl: DWORD) : HResult;  stdcall;
12886
        var pdwInOut: DWORD; fl: DWORD) : HResult;  stdcall;
12879
  end;
12887
  end;
12880
 
12888
 
12881
  IDirectInputDevice2W = interface (IDirectInputDeviceW)
12889
  IDirectInputDevice2W = interface (IDirectInputDeviceW)
12882
    ['{5944E683-C92E-11CF-BFC7-444553540000}']
12890
    ['{5944E683-C92E-11CF-BFC7-444553540000}']
12883
    (*** IDirectInputDevice2W methods ***)
12891
    (*** IDirectInputDevice2W methods ***)
12884
    function CreateEffect(const rguid: TGUID; lpeff: PDIEffect;
12892
    function CreateEffect(const rguid: TGUID; lpeff: PDIEffect;
12885
        var ppdeff: IDirectInputEffect; punkOuter: IUnknown) : HResult;  stdcall;
12893
        var ppdeff: IDirectInputEffect; punkOuter: IUnknown) : HResult;  stdcall;
12886
    function EnumEffects(lpCallback: TDIEnumEffectsCallbackW;
12894
    function EnumEffects(lpCallback: TDIEnumEffectsCallbackW;
12887
        pvRef: pointer; dwEffType: DWORD) : HResult;  stdcall;
12895
        pvRef: pointer; dwEffType: DWORD) : HResult;  stdcall;
12888
    function GetEffectInfo(pdei: TDIEffectInfoW; const rguid: TGUID) : HResult;  stdcall;
12896
    function GetEffectInfo(pdei: TDIEffectInfoW; const rguid: TGUID) : HResult;  stdcall;
12889
    function GetForceFeedbackState(var pdwOut: DWORD) : HResult;  stdcall;
12897
    function GetForceFeedbackState(var pdwOut: DWORD) : HResult;  stdcall;
12890
    function SendForceFeedbackCommand(dwFlags: DWORD) : HResult;  stdcall;
12898
    function SendForceFeedbackCommand(dwFlags: DWORD) : HResult;  stdcall;
12891
    function EnumCreatedEffectObjects(lpCallback:
12899
    function EnumCreatedEffectObjects(lpCallback:
12892
        TDIEnumCreatedEffectObjectsCallback;
12900
        TDIEnumCreatedEffectObjectsCallback;
12893
        pvRef: pointer; fl: DWORD) : HResult;  stdcall;
12901
        pvRef: pointer; fl: DWORD) : HResult;  stdcall;
12894
    function Escape(var pesc: TDIEffEscape) : HResult;  stdcall;
12902
    function Escape(var pesc: TDIEffEscape) : HResult;  stdcall;
12895
    function Poll : HResult;  stdcall;
12903
    function Poll : HResult;  stdcall;
12896
    function SendDeviceData
12904
    function SendDeviceData
12897
        (cbObjectData: DWORD; var rgdod: TDIDeviceObjectData;
12905
        (cbObjectData: DWORD; var rgdod: TDIDeviceObjectData;
12898
        var pdwInOut: DWORD; fl: DWORD) : HResult;  stdcall;
12906
        var pdwInOut: DWORD; fl: DWORD) : HResult;  stdcall;
12899
  end;
12907
  end;
12900
 
12908
 
12901
{$IFDEF UNICODE}
12909
{$IFDEF UNICODE}
12902
  IDirectInputDevice2 = IDirectInputDevice2W;
12910
  IDirectInputDevice2 = IDirectInputDevice2W;
12903
{$ELSE}
12911
{$ELSE}
12904
  IDirectInputDevice2 = IDirectInputDevice2A;
12912
  IDirectInputDevice2 = IDirectInputDevice2A;
12905
{$ENDIF}
12913
{$ENDIF}
12906
 
12914
 
12907
const
12915
const
12908
  DIFEF_DEFAULT               = $00000000;
12916
  DIFEF_DEFAULT               = $00000000;
12909
  DIFEF_INCLUDENONSTANDARD    = $00000001;
12917
  DIFEF_INCLUDENONSTANDARD    = $00000001;
12910
  DIFEF_MODIFYIFNEEDED          = $00000010;
12918
  DIFEF_MODIFYIFNEEDED          = $00000010;
12911
 
12919
 
12912
///Weitermachen:  (as: nur die Deklarationen eingefüllt, die ich zum Testen gebraucht habe)
12920
///Weitermachen:  (as: nur die Deklarationen eingefüllt, die ich zum Testen gebraucht habe)
12913
 
12921
 
12914
type
12922
type
12915
  TEnumEffectsInFileCallback = function(gaga, huhu: Integer): HResult;
12923
  TEnumEffectsInFileCallback = function(gaga, huhu: Integer): HResult;
12916
 
12924
 
12917
type
12925
type
12918
  IDirectInputDevice7W = interface (IDirectInputDevice2W)
12926
  IDirectInputDevice7W = interface (IDirectInputDevice2W)
12919
    ['{57D7C6BD-2356-11D3-8E9D-00C04F6844AE}']
12927
    ['{57D7C6BD-2356-11D3-8E9D-00C04F6844AE}']
12920
    (*** IDirectInputDevice7A methods ***)
12928
    (*** IDirectInputDevice7A methods ***)
12921
    function EnumEffectsInFile(const lpszFileName: PChar;
12929
    function EnumEffectsInFile(const lpszFileName: PChar;
12922
      pec: TEnumEffectsInFileCallback; pvRef: Pointer; dwFlags: DWord): HResult; stdcall;
12930
      pec: TEnumEffectsInFileCallback; pvRef: Pointer; dwFlags: DWord): HResult; stdcall;
12923
    function WriteEffectToFile(const lpszFileName: PChar;
12931
    function WriteEffectToFile(const lpszFileName: PChar;
12924
      dwEntries: DWord; const rgDIFileEft: PDIFileEffect; dwFlags: DWord): HResult; stdcall;
12932
      dwEntries: DWord; const rgDIFileEft: PDIFileEffect; dwFlags: DWord): HResult; stdcall;
12925
  end;
12933
  end;
12926
 
12934
 
12927
  IDirectInputDevice7A = interface (IDirectInputDevice2A)
12935
  IDirectInputDevice7A = interface (IDirectInputDevice2A)
12928
    ['{57D7C6BC-2356-11D3-8E9D-00C04F6844AE}']
12936
    ['{57D7C6BC-2356-11D3-8E9D-00C04F6844AE}']
12929
    function EnumEffectsInFile(const lpszFileName: PChar;
12937
    function EnumEffectsInFile(const lpszFileName: PChar;
12930
      pec: TEnumEffectsInFileCallback; pvRef: Pointer; dwFlags: DWord): HResult; stdcall;
12938
      pec: TEnumEffectsInFileCallback; pvRef: Pointer; dwFlags: DWord): HResult; stdcall;
12931
    function WriteEffectToFile(const lpszFileName: PChar;
12939
    function WriteEffectToFile(const lpszFileName: PChar;
12932
      dwEntries: DWord; const rgDIFileEft: PDIFileEffect; dwFlags: DWord): HResult; stdcall;
12940
      dwEntries: DWord; const rgDIFileEft: PDIFileEffect; dwFlags: DWord): HResult; stdcall;
12933
  end;
12941
  end;
12934
 
12942
 
12935
{$IFDEF UNICODE}
12943
{$IFDEF UNICODE}
12936
  IDirectInputDevice7 = IDirectInputDevice7W;
12944
  IDirectInputDevice7 = IDirectInputDevice7W;
12937
{$ELSE}
12945
{$ELSE}
12938
  IDirectInputDevice7 = IDirectInputDevice7A;
12946
  IDirectInputDevice7 = IDirectInputDevice7A;
12939
{$ENDIF}
12947
{$ENDIF}
12940
 
12948
 
12941
(****************************************************************************
12949
(****************************************************************************
12942
 *
12950
 *
12943
 *      Mouse
12951
 *      Mouse
12944
 *
12952
 *
12945
 ****************************************************************************)
12953
 ****************************************************************************)
12946
 
12954
 
12947
type
12955
type
12948
  PDIMouseState = ^TDIMouseState;
12956
  PDIMouseState = ^TDIMouseState;
12949
  TDIMouseState = packed record
12957
  TDIMouseState = packed record
12950
    lX: Longint;
12958
    lX: Longint;
12951
    lY: Longint;
12959
    lY: Longint;
12952
    lZ: Longint;
12960
    lZ: Longint;
12953
    rgbButtons: Array [0..3] of BYTE;  // up to 4 buttons
12961
    rgbButtons: Array [0..3] of BYTE;  // up to 4 buttons
12954
  end;
12962
  end;
12955
 
12963
 
12956
  PDIMouseState2 = ^TDIMouseState2;
12964
  PDIMouseState2 = ^TDIMouseState2;
12957
  TDIMouseState2 = packed record
12965
  TDIMouseState2 = packed record
12958
    lX: Longint;
12966
    lX: Longint;
12959
    lY: Longint;
12967
    lY: Longint;
12960
    lZ: Longint;
12968
    lZ: Longint;
12961
    rgbButtons: Array [0..7] of BYTE;  // up to 8 buttons
12969
    rgbButtons: Array [0..7] of BYTE;  // up to 8 buttons
12962
  end;
12970
  end;
12963
 
12971
 
12964
const
12972
const
12965
  DIMOFS_X       = 0;
12973
  DIMOFS_X       = 0;
12966
  DIMOFS_Y       = 4;
12974
  DIMOFS_Y       = 4;
12967
  DIMOFS_Z       = 8;
12975
  DIMOFS_Z       = 8;
12968
  DIMOFS_BUTTON0 = 12;
12976
  DIMOFS_BUTTON0 = 12;
12969
  DIMOFS_BUTTON1 = 13;
12977
  DIMOFS_BUTTON1 = 13;
12970
  DIMOFS_BUTTON2 = 14;
12978
  DIMOFS_BUTTON2 = 14;
12971
  DIMOFS_BUTTON3 = 15;
12979
  DIMOFS_BUTTON3 = 15;
12972
  // DX7 supports up to 8 mouse buttons
12980
  // DX7 supports up to 8 mouse buttons
12973
  DIMOFS_BUTTON4 = DIMOFS_BUTTON0+4;
12981
  DIMOFS_BUTTON4 = DIMOFS_BUTTON0+4;
12974
  DIMOFS_BUTTON5 = DIMOFS_BUTTON0+5;
12982
  DIMOFS_BUTTON5 = DIMOFS_BUTTON0+5;
12975
  DIMOFS_BUTTON6 = DIMOFS_BUTTON0+6;
12983
  DIMOFS_BUTTON6 = DIMOFS_BUTTON0+6;
12976
  DIMOFS_BUTTON7 = DIMOFS_BUTTON0+7;
12984
  DIMOFS_BUTTON7 = DIMOFS_BUTTON0+7;
12977
 
12985
 
12978
 
12986
 
12979
const
12987
const
12980
  _c_dfDIMouse_Objects: array[0..6] of TDIObjectDataFormat = (
12988
  _c_dfDIMouse_Objects: array[0..6] of TDIObjectDataFormat = (
12981
    (  pguid: @GUID_XAxis;
12989
    (  pguid: @GUID_XAxis;
12982
       dwOfs: DIMOFS_X;
12990
       dwOfs: DIMOFS_X;
12983
       dwType: DIDFT_AXIS or DIDFT_NOCOLLECTION;
12991
       dwType: DIDFT_AXIS or DIDFT_NOCOLLECTION;
12984
       dwFlags: 0),
12992
       dwFlags: 0),
12985
    (  pguid: @GUID_YAxis;
12993
    (  pguid: @GUID_YAxis;
12986
       dwOfs: DIMOFS_Y;
12994
       dwOfs: DIMOFS_Y;
12987
       dwType: DIDFT_AXIS or DIDFT_NOCOLLECTION;
12995
       dwType: DIDFT_AXIS or DIDFT_NOCOLLECTION;
12988
       dwFlags: 0),
12996
       dwFlags: 0),
12989
    (  pguid: @GUID_ZAxis;
12997
    (  pguid: @GUID_ZAxis;
12990
       dwOfs: DIMOFS_Z;
12998
       dwOfs: DIMOFS_Z;
12991
       dwType: $80000000 or DIDFT_AXIS or DIDFT_NOCOLLECTION;
12999
       dwType: $80000000 or DIDFT_AXIS or DIDFT_NOCOLLECTION;
12992
       dwFlags: 0),
13000
       dwFlags: 0),
12993
    (  pguid: nil;
13001
    (  pguid: nil;
12994
       dwOfs: DIMOFS_BUTTON0;
13002
       dwOfs: DIMOFS_BUTTON0;
12995
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13003
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
12996
       dwFlags: 0),
13004
       dwFlags: 0),
12997
    (  pguid: nil;
13005
    (  pguid: nil;
12998
       dwOfs: DIMOFS_BUTTON1;
13006
       dwOfs: DIMOFS_BUTTON1;
12999
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13007
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13000
       dwFlags: 0),
13008
       dwFlags: 0),
13001
    (  pguid: nil;
13009
    (  pguid: nil;
13002
       dwOfs: DIMOFS_BUTTON2;
13010
       dwOfs: DIMOFS_BUTTON2;
13003
       dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13011
       dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13004
       dwFlags: 0),
13012
       dwFlags: 0),
13005
    (  pguid: nil;
13013
    (  pguid: nil;
13006
       dwOfs: DIMOFS_BUTTON3;
13014
       dwOfs: DIMOFS_BUTTON3;
13007
       dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13015
       dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13008
       dwFlags: 0)
13016
       dwFlags: 0)
13009
    );
13017
    );
13010
 
13018
 
13011
  c_dfDIMouse: TDIDataFormat = (
13019
  c_dfDIMouse: TDIDataFormat = (
13012
    dwSize: Sizeof(c_dfDIMouse);              // $18
13020
    dwSize: Sizeof(c_dfDIMouse);              // $18
13013
    dwObjSize: Sizeof(TDIObjectDataFormat);   // $10
13021
    dwObjSize: Sizeof(TDIObjectDataFormat);   // $10
13014
    dwFlags: DIDF_RELAXIS;                    //
13022
    dwFlags: DIDF_RELAXIS;                    //
13015
    dwDataSize: Sizeof(TDIMouseState);        // $10
13023
    dwDataSize: Sizeof(TDIMouseState);        // $10
13016
    dwNumObjs: High(_c_dfDIMouse_Objects)+1;  // 7
13024
    dwNumObjs: High(_c_dfDIMouse_Objects)+1;  // 7
13017
    rgodf: @_c_dfDIMouse_Objects[Low(_c_dfDIMouse_Objects)]
13025
    rgodf: @_c_dfDIMouse_Objects[Low(_c_dfDIMouse_Objects)]
13018
  );
13026
  );
13019
 
13027
 
13020
 
13028
 
13021
  _c_dfDIMouse2_Objects: array[0..10] of TDIObjectDataFormat = (
13029
  _c_dfDIMouse2_Objects: array[0..10] of TDIObjectDataFormat = (
13022
    (  pguid: @GUID_XAxis;
13030
    (  pguid: @GUID_XAxis;
13023
       dwOfs: DIMOFS_X;
13031
       dwOfs: DIMOFS_X;
13024
       dwType: DIDFT_AXIS or DIDFT_NOCOLLECTION;
13032
       dwType: DIDFT_AXIS or DIDFT_NOCOLLECTION;
13025
       dwFlags: 0),
13033
       dwFlags: 0),
13026
    (  pguid: @GUID_YAxis;
13034
    (  pguid: @GUID_YAxis;
13027
       dwOfs: DIMOFS_Y;
13035
       dwOfs: DIMOFS_Y;
13028
       dwType: DIDFT_AXIS or DIDFT_NOCOLLECTION;
13036
       dwType: DIDFT_AXIS or DIDFT_NOCOLLECTION;
13029
       dwFlags: 0),
13037
       dwFlags: 0),
13030
    (  pguid: @GUID_ZAxis;
13038
    (  pguid: @GUID_ZAxis;
13031
       dwOfs: DIMOFS_Z;
13039
       dwOfs: DIMOFS_Z;
13032
       dwType: $80000000 or DIDFT_AXIS or DIDFT_NOCOLLECTION;
13040
       dwType: $80000000 or DIDFT_AXIS or DIDFT_NOCOLLECTION;
13033
       dwFlags: 0),
13041
       dwFlags: 0),
13034
    (  pguid: nil;
13042
    (  pguid: nil;
13035
       dwOfs: DIMOFS_BUTTON0;
13043
       dwOfs: DIMOFS_BUTTON0;
13036
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13044
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13037
       dwFlags: 0),
13045
       dwFlags: 0),
13038
    (  pguid: nil;
13046
    (  pguid: nil;
13039
       dwOfs: DIMOFS_BUTTON1;
13047
       dwOfs: DIMOFS_BUTTON1;
13040
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13048
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13041
       dwFlags: 0),
13049
       dwFlags: 0),
13042
    (  pguid: nil;
13050
    (  pguid: nil;
13043
       dwOfs: DIMOFS_BUTTON2;
13051
       dwOfs: DIMOFS_BUTTON2;
13044
       dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13052
       dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13045
       dwFlags: 0),
13053
       dwFlags: 0),
13046
    (  pguid: nil;
13054
    (  pguid: nil;
13047
       dwOfs: DIMOFS_BUTTON3;
13055
       dwOfs: DIMOFS_BUTTON3;
13048
       dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13056
       dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13049
       dwFlags: 0),
13057
       dwFlags: 0),
13050
    // fields introduced with IDirectInputDevice7.GetDeviceState       
13058
    // fields introduced with IDirectInputDevice7.GetDeviceState       
13051
    (  pguid: nil;
13059
    (  pguid: nil;
13052
       dwOfs: DIMOFS_BUTTON4;
13060
       dwOfs: DIMOFS_BUTTON4;
13053
       dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13061
       dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13054
       dwFlags: 0),
13062
       dwFlags: 0),
13055
    (  pguid: nil;
13063
    (  pguid: nil;
13056
       dwOfs: DIMOFS_BUTTON5;
13064
       dwOfs: DIMOFS_BUTTON5;
13057
       dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13065
       dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13058
       dwFlags: 0),
13066
       dwFlags: 0),
13059
    (  pguid: nil;
13067
    (  pguid: nil;
13060
       dwOfs: DIMOFS_BUTTON6;
13068
       dwOfs: DIMOFS_BUTTON6;
13061
       dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13069
       dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13062
       dwFlags: 0),
13070
       dwFlags: 0),
13063
    (  pguid: nil;
13071
    (  pguid: nil;
13064
       dwOfs: DIMOFS_BUTTON7;
13072
       dwOfs: DIMOFS_BUTTON7;
13065
       dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13073
       dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13066
       dwFlags: 0)
13074
       dwFlags: 0)
13067
    );
13075
    );
13068
 
13076
 
13069
  c_dfDIMouse2: TDIDataFormat = (
13077
  c_dfDIMouse2: TDIDataFormat = (
13070
    dwSize: Sizeof(c_dfDIMouse);              // $18
13078
    dwSize: Sizeof(c_dfDIMouse);              // $18
13071
    dwObjSize: Sizeof(TDIObjectDataFormat);   // $10
13079
    dwObjSize: Sizeof(TDIObjectDataFormat);   // $10
13072
    dwFlags: DIDF_RELAXIS;                    //
13080
    dwFlags: DIDF_RELAXIS;                    //
13073
    dwDataSize: Sizeof(TDIMouseState2);        // $14
13081
    dwDataSize: Sizeof(TDIMouseState2);        // $14
13074
    dwNumObjs: High(_c_dfDIMouse_Objects)+1;  // 11
13082
    dwNumObjs: High(_c_dfDIMouse_Objects)+1;  // 11
13075
    rgodf: @_c_dfDIMouse2_Objects[Low(_c_dfDIMouse2_Objects)]
13083
    rgodf: @_c_dfDIMouse2_Objects[Low(_c_dfDIMouse2_Objects)]
13076
  );
13084
  );
13077
 
13085
 
13078
 
13086
 
13079
(****************************************************************************
13087
(****************************************************************************
13080
 *
13088
 *
13081
 *      DirectInput keyboard scan codes
13089
 *      DirectInput keyboard scan codes
13082
 *
13090
 *
13083
 ****************************************************************************)
13091
 ****************************************************************************)
13084
 
13092
 
13085
const
13093
const
13086
  DIK_ESCAPE          = $01;
13094
  DIK_ESCAPE          = $01;
13087
  DIK_1               = $02;
13095
  DIK_1               = $02;
13088
  DIK_2               = $03;
13096
  DIK_2               = $03;
13089
  DIK_3               = $04;
13097
  DIK_3               = $04;
13090
  DIK_4               = $05;
13098
  DIK_4               = $05;
13091
  DIK_5               = $06;
13099
  DIK_5               = $06;
13092
  DIK_6               = $07;
13100
  DIK_6               = $07;
13093
  DIK_7               = $08;
13101
  DIK_7               = $08;
13094
  DIK_8               = $09;
13102
  DIK_8               = $09;
13095
  DIK_9               = $0A;
13103
  DIK_9               = $0A;
13096
  DIK_0               = $0B;
13104
  DIK_0               = $0B;
13097
  DIK_MINUS           = $0C;    (* - on main keyboard *)
13105
  DIK_MINUS           = $0C;    (* - on main keyboard *)
13098
  DIK_EQUALS          = $0D;
13106
  DIK_EQUALS          = $0D;
13099
  DIK_BACK            = $0E;    (* backspace *)
13107
  DIK_BACK            = $0E;    (* backspace *)
13100
  DIK_TAB             = $0F;
13108
  DIK_TAB             = $0F;
13101
  DIK_Q               = $10;
13109
  DIK_Q               = $10;
13102
  DIK_W               = $11;
13110
  DIK_W               = $11;
13103
  DIK_E               = $12;
13111
  DIK_E               = $12;
13104
  DIK_R               = $13;
13112
  DIK_R               = $13;
13105
  DIK_T               = $14;
13113
  DIK_T               = $14;
13106
  DIK_Y               = $15;
13114
  DIK_Y               = $15;
13107
  DIK_U               = $16;
13115
  DIK_U               = $16;
13108
  DIK_I               = $17;
13116
  DIK_I               = $17;
13109
  DIK_O               = $18;
13117
  DIK_O               = $18;
13110
  DIK_P               = $19;
13118
  DIK_P               = $19;
13111
  DIK_LBRACKET        = $1A;
13119
  DIK_LBRACKET        = $1A;
13112
  DIK_RBRACKET        = $1B;
13120
  DIK_RBRACKET        = $1B;
13113
  DIK_RETURN          = $1C;    (* Enter on main keyboard *)
13121
  DIK_RETURN          = $1C;    (* Enter on main keyboard *)
13114
  DIK_LCONTROL        = $1D;
13122
  DIK_LCONTROL        = $1D;
13115
  DIK_A               = $1E;
13123
  DIK_A               = $1E;
13116
  DIK_S               = $1F;
13124
  DIK_S               = $1F;
13117
  DIK_D               = $20;
13125
  DIK_D               = $20;
13118
  DIK_F               = $21;
13126
  DIK_F               = $21;
13119
  DIK_G               = $22;
13127
  DIK_G               = $22;
13120
  DIK_H               = $23;
13128
  DIK_H               = $23;
13121
  DIK_J               = $24;
13129
  DIK_J               = $24;
13122
  DIK_K               = $25;
13130
  DIK_K               = $25;
13123
  DIK_L               = $26;
13131
  DIK_L               = $26;
13124
  DIK_SEMICOLON       = $27;
13132
  DIK_SEMICOLON       = $27;
13125
  DIK_APOSTROPHE      = $28;
13133
  DIK_APOSTROPHE      = $28;
13126
  DIK_GRAVE           = $29;    (* accent grave *)
13134
  DIK_GRAVE           = $29;    (* accent grave *)
13127
  DIK_LSHIFT          = $2A;
13135
  DIK_LSHIFT          = $2A;
13128
  DIK_BACKSLASH       = $2B;
13136
  DIK_BACKSLASH       = $2B;
13129
  DIK_Z               = $2C;
13137
  DIK_Z               = $2C;
13130
  DIK_X               = $2D;
13138
  DIK_X               = $2D;
13131
  DIK_C               = $2E;
13139
  DIK_C               = $2E;
13132
  DIK_V               = $2F;
13140
  DIK_V               = $2F;
13133
  DIK_B               = $30;
13141
  DIK_B               = $30;
13134
  DIK_N               = $31;
13142
  DIK_N               = $31;
13135
  DIK_M               = $32;
13143
  DIK_M               = $32;
13136
  DIK_COMMA           = $33;
13144
  DIK_COMMA           = $33;
13137
  DIK_PERIOD          = $34;    (* . on main keyboard *)
13145
  DIK_PERIOD          = $34;    (* . on main keyboard *)
13138
  DIK_SLASH           = $35;    (* / on main keyboard *)
13146
  DIK_SLASH           = $35;    (* / on main keyboard *)
13139
  DIK_RSHIFT          = $36;
13147
  DIK_RSHIFT          = $36;
13140
  DIK_MULTIPLY        = $37;    (* * on numeric keypad *)
13148
  DIK_MULTIPLY        = $37;    (* * on numeric keypad *)
13141
  DIK_LMENU           = $38;    (* left Alt *)
13149
  DIK_LMENU           = $38;    (* left Alt *)
13142
  DIK_SPACE           = $39;
13150
  DIK_SPACE           = $39;
13143
  DIK_CAPITAL         = $3A;
13151
  DIK_CAPITAL         = $3A;
13144
  DIK_F1              = $3B;
13152
  DIK_F1              = $3B;
13145
  DIK_F2              = $3C;
13153
  DIK_F2              = $3C;
13146
  DIK_F3              = $3D;
13154
  DIK_F3              = $3D;
13147
  DIK_F4              = $3E;
13155
  DIK_F4              = $3E;
13148
  DIK_F5              = $3F;
13156
  DIK_F5              = $3F;
13149
  DIK_F6              = $40;
13157
  DIK_F6              = $40;
13150
  DIK_F7              = $41;
13158
  DIK_F7              = $41;
13151
  DIK_F8              = $42;
13159
  DIK_F8              = $42;
13152
  DIK_F9              = $43;
13160
  DIK_F9              = $43;
13153
  DIK_F10             = $44;
13161
  DIK_F10             = $44;
13154
  DIK_NUMLOCK         = $45;
13162
  DIK_NUMLOCK         = $45;
13155
  DIK_SCROLL          = $46;    (* Scroll Lock *)
13163
  DIK_SCROLL          = $46;    (* Scroll Lock *)
13156
  DIK_NUMPAD7         = $47;
13164
  DIK_NUMPAD7         = $47;
13157
  DIK_NUMPAD8         = $48;
13165
  DIK_NUMPAD8         = $48;
13158
  DIK_NUMPAD9         = $49;
13166
  DIK_NUMPAD9         = $49;
13159
  DIK_SUBTRACT        = $4A;    (* - on numeric keypad *)
13167
  DIK_SUBTRACT        = $4A;    (* - on numeric keypad *)
13160
  DIK_NUMPAD4         = $4B;
13168
  DIK_NUMPAD4         = $4B;
13161
  DIK_NUMPAD5         = $4C;
13169
  DIK_NUMPAD5         = $4C;
13162
  DIK_NUMPAD6         = $4D;
13170
  DIK_NUMPAD6         = $4D;
13163
  DIK_ADD             = $4E;    (* + on numeric keypad *)
13171
  DIK_ADD             = $4E;    (* + on numeric keypad *)
13164
  DIK_NUMPAD1         = $4F;
13172
  DIK_NUMPAD1         = $4F;
13165
  DIK_NUMPAD2         = $50;
13173
  DIK_NUMPAD2         = $50;
13166
  DIK_NUMPAD3         = $51;
13174
  DIK_NUMPAD3         = $51;
13167
  DIK_NUMPAD0         = $52;
13175
  DIK_NUMPAD0         = $52;
13168
  DIK_DECIMAL         = $53;    (* . on numeric keypad *)
13176
  DIK_DECIMAL         = $53;    (* . on numeric keypad *)
13169
  // $54 to $56 unassigned
13177
  // $54 to $56 unassigned
13170
  DIK_F11             = $57;
13178
  DIK_F11             = $57;
13171
  DIK_F12             = $58;
13179
  DIK_F12             = $58;
13172
  // $59 to $63 unassigned
13180
  // $59 to $63 unassigned
13173
  DIK_F13             = $64;    (*                     (NEC PC98) *)
13181
  DIK_F13             = $64;    (*                     (NEC PC98) *)
13174
  DIK_F14             = $65;    (*                     (NEC PC98) *)
13182
  DIK_F14             = $65;    (*                     (NEC PC98) *)
13175
  DIK_F15             = $66;    (*                     (NEC PC98) *)
13183
  DIK_F15             = $66;    (*                     (NEC PC98) *)
13176
  // $67 to $6F unassigned
13184
  // $67 to $6F unassigned
13177
  DIK_KANA            = $70;    (* (Japanese keyboard)            *)
13185
  DIK_KANA            = $70;    (* (Japanese keyboard)            *)
13178
  DIK_CONVERT         = $79;    (* (Japanese keyboard)            *)
13186
  DIK_CONVERT         = $79;    (* (Japanese keyboard)            *)
13179
  DIK_NOCONVERT       = $7B;    (* (Japanese keyboard)            *)
13187
  DIK_NOCONVERT       = $7B;    (* (Japanese keyboard)            *)
13180
  DIK_YEN             = $7D;    (* (Japanese keyboard)            *)
13188
  DIK_YEN             = $7D;    (* (Japanese keyboard)            *)
13181
  DIK_NUMPADEQUALS    = $8D;    (* = on numeric keypad (NEC PC98) *)
13189
  DIK_NUMPADEQUALS    = $8D;    (* = on numeric keypad (NEC PC98) *)
13182
  // $8E to $8F unassigned
13190
  // $8E to $8F unassigned
13183
  DIK_CIRCUMFLEX      = $90;    (* (Japanese keyboard)            *)
13191
  DIK_CIRCUMFLEX      = $90;    (* (Japanese keyboard)            *)
13184
  DIK_AT              = $91;    (*                     (NEC PC98) *)
13192
  DIK_AT              = $91;    (*                     (NEC PC98) *)
13185
  DIK_COLON           = $92;    (*                     (NEC PC98) *)
13193
  DIK_COLON           = $92;    (*                     (NEC PC98) *)
13186
  DIK_UNDERLINE       = $93;    (*                     (NEC PC98) *)
13194
  DIK_UNDERLINE       = $93;    (*                     (NEC PC98) *)
13187
  DIK_KANJI           = $94;    (* (Japanese keyboard)            *)
13195
  DIK_KANJI           = $94;    (* (Japanese keyboard)            *)
13188
  DIK_STOP            = $95;    (*                     (NEC PC98) *)
13196
  DIK_STOP            = $95;    (*                     (NEC PC98) *)
13189
  DIK_AX              = $96;    (*                     (Japan AX) *)
13197
  DIK_AX              = $96;    (*                     (Japan AX) *)
13190
  DIK_UNLABELED       = $97;    (*                        (J3100) *)
13198
  DIK_UNLABELED       = $97;    (*                        (J3100) *)
13191
  // $98 to $99 unassigned
13199
  // $98 to $99 unassigned
13192
  DIK_NUMPADENTER     = $9C;    (* Enter on numeric keypad *)
13200
  DIK_NUMPADENTER     = $9C;    (* Enter on numeric keypad *)
13193
  DIK_RCONTROL        = $9D;
13201
  DIK_RCONTROL        = $9D;
13194
  // $9E to $B2 unassigned
13202
  // $9E to $B2 unassigned
13195
  DIK_NUMPADCOMMA     = $B3;    (* , on numeric keypad (NEC PC98) *)
13203
  DIK_NUMPADCOMMA     = $B3;    (* , on numeric keypad (NEC PC98) *)
13196
  // $B4 unassigned
13204
  // $B4 unassigned
13197
  DIK_DIVIDE          = $B5;    (* / on numeric keypad *)
13205
  DIK_DIVIDE          = $B5;    (* / on numeric keypad *)
13198
  // $B6 unassigned
13206
  // $B6 unassigned
13199
  DIK_SYSRQ           = $B7;
13207
  DIK_SYSRQ           = $B7;
13200
  DIK_RMENU           = $B8;    (* right Alt *)
13208
  DIK_RMENU           = $B8;    (* right Alt *)
13201
  // $B9 to $C4 unassigned
13209
  // $B9 to $C4 unassigned
13202
  DIK_PAUSE           = $C5;    (* Pause (watch out - not realiable on some kbds) *)
13210
  DIK_PAUSE           = $C5;    (* Pause (watch out - not realiable on some kbds) *)
13203
  // $C6 unassigned
13211
  // $C6 unassigned
13204
  DIK_HOME            = $C7;    (* Home on arrow keypad *)
13212
  DIK_HOME            = $C7;    (* Home on arrow keypad *)
13205
  DIK_UP              = $C8;    (* UpArrow on arrow keypad *)
13213
  DIK_UP              = $C8;    (* UpArrow on arrow keypad *)
13206
  DIK_PRIOR           = $C9;    (* PgUp on arrow keypad *)
13214
  DIK_PRIOR           = $C9;    (* PgUp on arrow keypad *)
13207
  // $CA unassigned
13215
  // $CA unassigned
13208
  DIK_LEFT            = $CB;    (* LeftArrow on arrow keypad *)
13216
  DIK_LEFT            = $CB;    (* LeftArrow on arrow keypad *)
13209
  DIK_RIGHT           = $CD;    (* RightArrow on arrow keypad *)
13217
  DIK_RIGHT           = $CD;    (* RightArrow on arrow keypad *)
13210
  // $CF unassigned
13218
  // $CF unassigned
13211
  DIK_END             = $CF;    (* End on arrow keypad *)
13219
  DIK_END             = $CF;    (* End on arrow keypad *)
13212
  DIK_DOWN            = $D0;    (* DownArrow on arrow keypad *)
13220
  DIK_DOWN            = $D0;    (* DownArrow on arrow keypad *)
13213
  DIK_NEXT            = $D1;    (* PgDn on arrow keypad *)
13221
  DIK_NEXT            = $D1;    (* PgDn on arrow keypad *)
13214
  DIK_INSERT          = $D2;    (* Insert on arrow keypad *)
13222
  DIK_INSERT          = $D2;    (* Insert on arrow keypad *)
13215
  DIK_DELETE          = $D3;    (* Delete on arrow keypad *)
13223
  DIK_DELETE          = $D3;    (* Delete on arrow keypad *)
13216
  DIK_LWIN            = $DB;    (* Left Windows key *)
13224
  DIK_LWIN            = $DB;    (* Left Windows key *)
13217
  DIK_RWIN            = $DC;    (* Right Windows key *)
13225
  DIK_RWIN            = $DC;    (* Right Windows key *)
13218
  DIK_APPS            = $DD;    (* AppMenu key *)
13226
  DIK_APPS            = $DD;    (* AppMenu key *)
13219
  // New with DX 6.1 & Win98
13227
  // New with DX 6.1 & Win98
13220
  DIK_POWER           = $DE;
13228
  DIK_POWER           = $DE;
13221
  DIK_SLEEP           = $DF;
13229
  DIK_SLEEP           = $DF;
13222
  // $E0 to $E2 unassigned
13230
  // $E0 to $E2 unassigned
13223
  // $E3 = Wake up ("translated" in German DInput to "Kielwasser" (ship's wake) ;-)
13231
  // $E3 = Wake up ("translated" in German DInput to "Kielwasser" (ship's wake) ;-)
13224
 
13232
 
13225
(*
13233
(*
13226
 *  Alternate names for keys, to facilitate transition from DOS.
13234
 *  Alternate names for keys, to facilitate transition from DOS.
13227
 *)
13235
 *)
13228
  DIK_BACKSPACE      = DIK_BACK    ;        (* backspace *)
13236
  DIK_BACKSPACE      = DIK_BACK    ;        (* backspace *)
13229
  DIK_NUMPADSTAR     = DIK_MULTIPLY;        (* * on numeric keypad *)
13237
  DIK_NUMPADSTAR     = DIK_MULTIPLY;        (* * on numeric keypad *)
13230
  DIK_LALT           = DIK_LMENU   ;        (* left Alt *)
13238
  DIK_LALT           = DIK_LMENU   ;        (* left Alt *)
13231
  DIK_CAPSLOCK       = DIK_CAPITAL ;        (* CapsLock *)
13239
  DIK_CAPSLOCK       = DIK_CAPITAL ;        (* CapsLock *)
13232
  DIK_NUMPADMINUS    = DIK_SUBTRACT;        (* - on numeric keypad *)
13240
  DIK_NUMPADMINUS    = DIK_SUBTRACT;        (* - on numeric keypad *)
13233
  DIK_NUMPADPLUS     = DIK_ADD     ;        (* + on numeric keypad *)
13241
  DIK_NUMPADPLUS     = DIK_ADD     ;        (* + on numeric keypad *)
13234
  DIK_NUMPADPERIOD   = DIK_DECIMAL ;        (* . on numeric keypad *)
13242
  DIK_NUMPADPERIOD   = DIK_DECIMAL ;        (* . on numeric keypad *)
13235
  DIK_NUMPADSLASH    = DIK_DIVIDE  ;        (* / on numeric keypad *)
13243
  DIK_NUMPADSLASH    = DIK_DIVIDE  ;        (* / on numeric keypad *)
13236
  DIK_RALT           = DIK_RMENU   ;        (* right Alt *)
13244
  DIK_RALT           = DIK_RMENU   ;        (* right Alt *)
13237
  DIK_UPARROW        = DIK_UP      ;        (* UpArrow on arrow keypad *)
13245
  DIK_UPARROW        = DIK_UP      ;        (* UpArrow on arrow keypad *)
13238
  DIK_PGUP           = DIK_PRIOR   ;        (* PgUp on arrow keypad *)
13246
  DIK_PGUP           = DIK_PRIOR   ;        (* PgUp on arrow keypad *)
13239
  DIK_LEFTARROW      = DIK_LEFT    ;        (* LeftArrow on arrow keypad *)
13247
  DIK_LEFTARROW      = DIK_LEFT    ;        (* LeftArrow on arrow keypad *)
13240
  DIK_RIGHTARROW     = DIK_RIGHT   ;        (* RightArrow on arrow keypad *)
13248
  DIK_RIGHTARROW     = DIK_RIGHT   ;        (* RightArrow on arrow keypad *)
13241
  DIK_DOWNARROW      = DIK_DOWN    ;        (* DownArrow on arrow keypad *)
13249
  DIK_DOWNARROW      = DIK_DOWN    ;        (* DownArrow on arrow keypad *)
13242
  DIK_PGDN           = DIK_NEXT    ;        (* PgDn on arrow keypad *)
13250
  DIK_PGDN           = DIK_NEXT    ;        (* PgDn on arrow keypad *)
13243
 
13251
 
13244
(****************************************************************************
13252
(****************************************************************************
13245
 *
13253
 *
13246
 *      Keyboard
13254
 *      Keyboard
13247
 *
13255
 *
13248
 ****************************************************************************)
13256
 ****************************************************************************)
13249
 
13257
 
13250
 
13258
 
13251
type
13259
type
13252
  TDIKeyboardState = array[0..255] of Byte;
13260
  TDIKeyboardState = array[0..255] of Byte;
13253
(*
13261
(*
13254
const
13262
const
13255
  _c_dfDIKeyboard_Objects: array[0..255] of TDIObjectDataFormat = (
13263
  _c_dfDIKeyboard_Objects: array[0..255] of TDIObjectDataFormat = (
13256
    (  pguid: @GUID_Key;
13264
    (  pguid: @GUID_Key;
13257
       dwOfs: DIK_ESCAPE;
13265
       dwOfs: DIK_ESCAPE;
13258
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13266
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13259
       dwFlags: 0),
13267
       dwFlags: 0),
13260
    // -------- top row (except function keys) on main kbd ------------
13268
    // -------- top row (except function keys) on main kbd ------------
13261
    (  pguid: @GUID_Key;
13269
    (  pguid: @GUID_Key;
13262
       dwOfs: DIK_1;  // "1" on main kbd, Offset 2
13270
       dwOfs: DIK_1;  // "1" on main kbd, Offset 2
13263
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13271
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13264
       dwFlags: 0),
13272
       dwFlags: 0),
13265
    (  pguid: @GUID_Key;
13273
    (  pguid: @GUID_Key;
13266
       dwOfs: DIK_2;  // "2" on main kbd, Offset 3
13274
       dwOfs: DIK_2;  // "2" on main kbd, Offset 3
13267
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13275
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13268
       dwFlags: 0),
13276
       dwFlags: 0),
13269
    (  pguid: @GUID_Key;
13277
    (  pguid: @GUID_Key;
13270
       dwOfs: DIK_3;  // "3" on main kbd, etc.
13278
       dwOfs: DIK_3;  // "3" on main kbd, etc.
13271
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13279
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13272
       dwFlags: 0),
13280
       dwFlags: 0),
13273
    (  pguid: @GUID_Key;
13281
    (  pguid: @GUID_Key;
13274
       dwOfs: DIK_4;
13282
       dwOfs: DIK_4;
13275
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13283
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13276
       dwFlags: 0),
13284
       dwFlags: 0),
13277
    (  pguid: @GUID_Key;
13285
    (  pguid: @GUID_Key;
13278
       dwOfs: DIK_5;
13286
       dwOfs: DIK_5;
13279
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13287
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13280
       dwFlags: 0),
13288
       dwFlags: 0),
13281
    (  pguid: @GUID_Key;
13289
    (  pguid: @GUID_Key;
13282
       dwOfs: DIK_6;
13290
       dwOfs: DIK_6;
13283
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13291
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13284
       dwFlags: 0),
13292
       dwFlags: 0),
13285
    (  pguid: @GUID_Key;
13293
    (  pguid: @GUID_Key;
13286
       dwOfs: DIK_7;
13294
       dwOfs: DIK_7;
13287
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13295
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13288
       dwFlags: 0),
13296
       dwFlags: 0),
13289
    (  pguid: @GUID_Key;
13297
    (  pguid: @GUID_Key;
13290
       dwOfs: DIK_8;
13298
       dwOfs: DIK_8;
13291
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13299
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13292
       dwFlags: 0),
13300
       dwFlags: 0),
13293
    (  pguid: @GUID_Key;
13301
    (  pguid: @GUID_Key;
13294
       dwOfs: DIK_9;
13302
       dwOfs: DIK_9;
13295
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13303
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13296
       dwFlags: 0),
13304
       dwFlags: 0),
13297
    (  pguid: @GUID_Key;
13305
    (  pguid: @GUID_Key;
13298
       dwOfs: DIK_0;  // "0", main kbd
13306
       dwOfs: DIK_0;  // "0", main kbd
13299
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13307
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13300
       dwFlags: 0),
13308
       dwFlags: 0),
13301
    (  pguid: @GUID_Key;
13309
    (  pguid: @GUID_Key;
13302
       dwOfs: DIK_MINUS; // "-" on US kbds, "ß" on german kbds
13310
       dwOfs: DIK_MINUS; // "-" on US kbds, "ß" on german kbds
13303
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13311
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13304
       dwFlags: 0),
13312
       dwFlags: 0),
13305
    (  pguid: @GUID_Key;
13313
    (  pguid: @GUID_Key;
13306
       dwOfs: DIK_EQUALS;  // "=" for US, "´" for german
13314
       dwOfs: DIK_EQUALS;  // "=" for US, "´" for german
13307
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13315
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13308
       dwFlags: 0),
13316
       dwFlags: 0),
13309
    (  pguid: @GUID_Key;
13317
    (  pguid: @GUID_Key;
13310
       dwOfs: DIK_BACK;  // backspace
13318
       dwOfs: DIK_BACK;  // backspace
13311
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13319
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13312
       dwFlags: 0),
13320
       dwFlags: 0),
13313
    // ----------- 2nd row -----------------------
13321
    // ----------- 2nd row -----------------------
13314
    (  pguid: @GUID_Key;
13322
    (  pguid: @GUID_Key;
13315
       dwOfs: DIK_TAB;
13323
       dwOfs: DIK_TAB;
13316
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13324
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13317
       dwFlags: 0),
13325
       dwFlags: 0),
13318
    (  pguid: @GUID_Key;
13326
    (  pguid: @GUID_Key;
13319
       dwOfs: DIK_Q;
13327
       dwOfs: DIK_Q;
13320
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13328
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13321
       dwFlags: 0),
13329
       dwFlags: 0),
13322
    (  pguid: @GUID_Key;
13330
    (  pguid: @GUID_Key;
13323
       dwOfs: DIK_W;
13331
       dwOfs: DIK_W;
13324
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13332
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13325
       dwFlags: 0),
13333
       dwFlags: 0),
13326
    (  pguid: @GUID_Key;
13334
    (  pguid: @GUID_Key;
13327
       dwOfs: DIK_E;
13335
       dwOfs: DIK_E;
13328
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13336
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13329
       dwFlags: 0),
13337
       dwFlags: 0),
13330
    (  pguid: @GUID_Key;
13338
    (  pguid: @GUID_Key;
13331
       dwOfs: DIK_R;
13339
       dwOfs: DIK_R;
13332
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13340
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13333
       dwFlags: 0),
13341
       dwFlags: 0),
13334
    (  pguid: @GUID_Key;
13342
    (  pguid: @GUID_Key;
13335
       dwOfs: DIK_T;
13343
       dwOfs: DIK_T;
13336
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13344
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13337
       dwFlags: 0),
13345
       dwFlags: 0),
13338
    (  pguid: @GUID_Key;
13346
    (  pguid: @GUID_Key;
13339
       dwOfs: DIK_Y;  // "Z" on german & french keyboards
13347
       dwOfs: DIK_Y;  // "Z" on german & french keyboards
13340
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13348
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13341
       dwFlags: 0),
13349
       dwFlags: 0),
13342
    (  pguid: @GUID_Key;
13350
    (  pguid: @GUID_Key;
13343
       dwOfs: DIK_U;
13351
       dwOfs: DIK_U;
13344
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13352
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13345
       dwFlags: 0),
13353
       dwFlags: 0),
13346
    (  pguid: @GUID_Key;
13354
    (  pguid: @GUID_Key;
13347
       dwOfs: DIK_I;
13355
       dwOfs: DIK_I;
13348
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13356
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13349
       dwFlags: 0),
13357
       dwFlags: 0),
13350
    (  pguid: @GUID_Key;
13358
    (  pguid: @GUID_Key;
13351
       dwOfs: DIK_O;
13359
       dwOfs: DIK_O;
13352
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13360
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13353
       dwFlags: 0),
13361
       dwFlags: 0),
13354
    (  pguid: @GUID_Key;
13362
    (  pguid: @GUID_Key;
13355
       dwOfs: DIK_P;
13363
       dwOfs: DIK_P;
13356
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13364
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13357
       dwFlags: 0),
13365
       dwFlags: 0),
13358
    (  pguid: @GUID_Key;
13366
    (  pguid: @GUID_Key;
13359
       dwOfs: DIK_LBRACKET;  // "Ãœ" on german keyboards
13367
       dwOfs: DIK_LBRACKET;  // "Ãœ" on german keyboards
13360
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13368
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13361
       dwFlags: 0),
13369
       dwFlags: 0),
13362
    (  pguid: @GUID_Key;
13370
    (  pguid: @GUID_Key;
13363
       dwOfs: DIK_RBRACKET;  // "+" on german keyboards
13371
       dwOfs: DIK_RBRACKET;  // "+" on german keyboards
13364
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13372
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13365
       dwFlags: 0),
13373
       dwFlags: 0),
13366
    (  pguid: @GUID_Key;
13374
    (  pguid: @GUID_Key;
13367
       dwOfs: DIK_RETURN;   // Enter on main kbd
13375
       dwOfs: DIK_RETURN;   // Enter on main kbd
13368
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13376
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13369
       dwFlags: 0),
13377
       dwFlags: 0),
13370
    // next row should really start with caps lock but doesn't ;-)
13378
    // next row should really start with caps lock but doesn't ;-)
13371
    // (DIK_CAPITAL is Offset $3A, i.e. after 4th row)
13379
    // (DIK_CAPITAL is Offset $3A, i.e. after 4th row)
13372
    (  pguid: @GUID_Key;
13380
    (  pguid: @GUID_Key;
13373
       dwOfs: DIK_LCONTROL;  // Left Ctrl (german kbds: "Strg")
13381
       dwOfs: DIK_LCONTROL;  // Left Ctrl (german kbds: "Strg")
13374
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13382
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13375
       dwFlags: 0),
13383
       dwFlags: 0),
13376
    // ----------- 3rd row ------------------------------
13384
    // ----------- 3rd row ------------------------------
13377
    (  pguid: @GUID_Key;
13385
    (  pguid: @GUID_Key;
13378
       dwOfs: DIK_A;
13386
       dwOfs: DIK_A;
13379
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13387
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13380
       dwFlags: 0),
13388
       dwFlags: 0),
13381
    (  pguid: @GUID_Key;
13389
    (  pguid: @GUID_Key;
13382
       dwOfs: DIK_S;
13390
       dwOfs: DIK_S;
13383
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13391
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13384
       dwFlags: 0),
13392
       dwFlags: 0),
13385
    (  pguid: @GUID_Key;
13393
    (  pguid: @GUID_Key;
13386
       dwOfs: DIK_D;
13394
       dwOfs: DIK_D;
13387
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13395
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13388
       dwFlags: 0),
13396
       dwFlags: 0),
13389
    (  pguid: @GUID_Key;
13397
    (  pguid: @GUID_Key;
13390
       dwOfs: DIK_F;
13398
       dwOfs: DIK_F;
13391
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13399
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13392
       dwFlags: 0),
13400
       dwFlags: 0),
13393
    (  pguid: @GUID_Key;
13401
    (  pguid: @GUID_Key;
13394
       dwOfs: DIK_G;
13402
       dwOfs: DIK_G;
13395
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13403
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13396
       dwFlags: 0),
13404
       dwFlags: 0),
13397
    (  pguid: @GUID_Key;
13405
    (  pguid: @GUID_Key;
13398
       dwOfs: DIK_H;
13406
       dwOfs: DIK_H;
13399
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13407
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13400
       dwFlags: 0),
13408
       dwFlags: 0),
13401
    (  pguid: @GUID_Key;
13409
    (  pguid: @GUID_Key;
13402
       dwOfs: DIK_J;
13410
       dwOfs: DIK_J;
13403
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13411
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13404
       dwFlags: 0),
13412
       dwFlags: 0),
13405
    (  pguid: @GUID_Key;
13413
    (  pguid: @GUID_Key;
13406
       dwOfs: DIK_K;
13414
       dwOfs: DIK_K;
13407
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13415
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13408
       dwFlags: 0),
13416
       dwFlags: 0),
13409
    (  pguid: @GUID_Key;
13417
    (  pguid: @GUID_Key;
13410
       dwOfs: DIK_L;
13418
       dwOfs: DIK_L;
13411
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13419
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13412
       dwFlags: 0),
13420
       dwFlags: 0),
13413
    (  pguid: @GUID_Key;
13421
    (  pguid: @GUID_Key;
13414
       dwOfs: DIK_SEMICOLON;  // "Ö" on german kbds
13422
       dwOfs: DIK_SEMICOLON;  // "Ö" on german kbds
13415
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13423
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13416
       dwFlags: 0),
13424
       dwFlags: 0),
13417
    (  pguid: @GUID_Key;
13425
    (  pguid: @GUID_Key;
13418
       dwOfs: DIK_APOSTROPHE;  // "Ä" on german kbds
13426
       dwOfs: DIK_APOSTROPHE;  // "Ä" on german kbds
13419
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13427
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13420
       dwFlags: 0),
13428
       dwFlags: 0),
13421
    (  pguid: @GUID_Key;
13429
    (  pguid: @GUID_Key;
13422
       dwOfs: DIK_GRAVE; // accent grave, "'" on german kbds
13430
       dwOfs: DIK_GRAVE; // accent grave, "'" on german kbds
13423
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13431
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13424
       dwFlags: 0),
13432
       dwFlags: 0),
13425
    // ---------------- 4th row -----------------------
13433
    // ---------------- 4th row -----------------------
13426
    (  pguid: @GUID_Key;
13434
    (  pguid: @GUID_Key;
13427
       dwOfs: DIK_LSHIFT;  // left shift
13435
       dwOfs: DIK_LSHIFT;  // left shift
13428
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13436
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13429
       dwFlags: 0),
13437
       dwFlags: 0),
13430
    (  pguid: @GUID_Key;
13438
    (  pguid: @GUID_Key;
13431
       dwOfs: DIK_BACKSLASH;  // "<" on german kbds
13439
       dwOfs: DIK_BACKSLASH;  // "<" on german kbds
13432
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13440
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13433
       dwFlags: 0),
13441
       dwFlags: 0),
13434
    (  pguid: @GUID_Key;
13442
    (  pguid: @GUID_Key;
13435
       dwOfs: DIK_Z;     // "Y" on german kbds
13443
       dwOfs: DIK_Z;     // "Y" on german kbds
13436
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13444
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13437
       dwFlags: 0),
13445
       dwFlags: 0),
13438
    (  pguid: @GUID_Key;
13446
    (  pguid: @GUID_Key;
13439
       dwOfs: DIK_X;
13447
       dwOfs: DIK_X;
13440
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13448
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13441
       dwFlags: 0),
13449
       dwFlags: 0),
13442
    (  pguid: @GUID_Key;
13450
    (  pguid: @GUID_Key;
13443
       dwOfs: DIK_C;
13451
       dwOfs: DIK_C;
13444
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13452
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13445
       dwFlags: 0),
13453
       dwFlags: 0),
13446
    (  pguid: @GUID_Key;
13454
    (  pguid: @GUID_Key;
13447
       dwOfs: DIK_V;
13455
       dwOfs: DIK_V;
13448
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13456
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13449
       dwFlags: 0),
13457
       dwFlags: 0),
13450
    (  pguid: @GUID_Key;
13458
    (  pguid: @GUID_Key;
13451
       dwOfs: DIK_B;
13459
       dwOfs: DIK_B;
13452
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13460
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13453
       dwFlags: 0),
13461
       dwFlags: 0),
13454
    (  pguid: @GUID_Key;
13462
    (  pguid: @GUID_Key;
13455
       dwOfs: DIK_N;
13463
       dwOfs: DIK_N;
13456
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13464
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13457
       dwFlags: 0),
13465
       dwFlags: 0),
13458
    (  pguid: @GUID_Key;
13466
    (  pguid: @GUID_Key;
13459
       dwOfs: DIK_M;
13467
       dwOfs: DIK_M;
13460
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13468
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13461
       dwFlags: 0),
13469
       dwFlags: 0),
13462
    (  pguid: @GUID_Key;
13470
    (  pguid: @GUID_Key;
13463
       dwOfs: DIK_COMMA;
13471
       dwOfs: DIK_COMMA;
13464
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13472
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13465
       dwFlags: 0),
13473
       dwFlags: 0),
13466
    (  pguid: @GUID_Key;
13474
    (  pguid: @GUID_Key;
13467
       dwOfs: DIK_PERIOD;  // on main kbd
13475
       dwOfs: DIK_PERIOD;  // on main kbd
13468
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13476
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13469
       dwFlags: 0),
13477
       dwFlags: 0),
13470
    (  pguid: @GUID_Key;
13478
    (  pguid: @GUID_Key;
13471
       dwOfs: DIK_SLASH;  // "-" on german kbds
13479
       dwOfs: DIK_SLASH;  // "-" on german kbds
13472
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13480
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13473
       dwFlags: 0),
13481
       dwFlags: 0),
13474
    (  pguid: @GUID_Key;
13482
    (  pguid: @GUID_Key;
13475
       dwOfs: DIK_RSHIFT;
13483
       dwOfs: DIK_RSHIFT;
13476
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13484
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13477
       dwFlags: 0),
13485
       dwFlags: 0),
13478
    // --- misc keys (bye, bye, order) ----------------
13486
    // --- misc keys (bye, bye, order) ----------------
13479
    (  pguid: @GUID_Key;
13487
    (  pguid: @GUID_Key;
13480
       dwOfs: DIK_MULTIPLY;  // on numeric keypad
13488
       dwOfs: DIK_MULTIPLY;  // on numeric keypad
13481
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13489
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13482
       dwFlags: 0),
13490
       dwFlags: 0),
13483
    (  pguid: @GUID_Key;
13491
    (  pguid: @GUID_Key;
13484
       dwOfs: DIK_LMENU;  // left ALT
13492
       dwOfs: DIK_LMENU;  // left ALT
13485
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13493
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13486
       dwFlags: 0),
13494
       dwFlags: 0),
13487
    (  pguid: @GUID_Key;
13495
    (  pguid: @GUID_Key;
13488
       dwOfs: DIK_SPACE;  // space bar
13496
       dwOfs: DIK_SPACE;  // space bar
13489
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13497
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13490
       dwFlags: 0),
13498
       dwFlags: 0),
13491
    (  pguid: @GUID_Key;
13499
    (  pguid: @GUID_Key;
13492
       dwOfs: DIK_CAPITAL;   // caps lock (on main kbd, above LSHIFT)
13500
       dwOfs: DIK_CAPITAL;   // caps lock (on main kbd, above LSHIFT)
13493
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13501
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13494
       dwFlags: 0),
13502
       dwFlags: 0),
13495
    // ---------- function keys -----------
13503
    // ---------- function keys -----------
13496
    (  pguid: @GUID_Key;
13504
    (  pguid: @GUID_Key;
13497
       dwOfs: DIK_F1;
13505
       dwOfs: DIK_F1;
13498
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13506
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13499
       dwFlags: 0),
13507
       dwFlags: 0),
13500
    (  pguid: @GUID_Key;
13508
    (  pguid: @GUID_Key;
13501
       dwOfs: DIK_F2;
13509
       dwOfs: DIK_F2;
13502
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13510
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13503
       dwFlags: 0),
13511
       dwFlags: 0),
13504
    (  pguid: @GUID_Key;
13512
    (  pguid: @GUID_Key;
13505
       dwOfs: DIK_F3;
13513
       dwOfs: DIK_F3;
13506
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13514
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13507
       dwFlags: 0),
13515
       dwFlags: 0),
13508
    (  pguid: @GUID_Key;
13516
    (  pguid: @GUID_Key;
13509
       dwOfs: DIK_F4;
13517
       dwOfs: DIK_F4;
13510
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13518
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13511
       dwFlags: 0),
13519
       dwFlags: 0),
13512
    (  pguid: @GUID_Key;
13520
    (  pguid: @GUID_Key;
13513
       dwOfs: DIK_F5;
13521
       dwOfs: DIK_F5;
13514
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13522
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13515
       dwFlags: 0),
13523
       dwFlags: 0),
13516
    (  pguid: @GUID_Key;
13524
    (  pguid: @GUID_Key;
13517
       dwOfs: DIK_F6;
13525
       dwOfs: DIK_F6;
13518
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13526
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13519
       dwFlags: 0),
13527
       dwFlags: 0),
13520
    (  pguid: @GUID_Key;
13528
    (  pguid: @GUID_Key;
13521
       dwOfs: DIK_F7;
13529
       dwOfs: DIK_F7;
13522
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13530
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13523
       dwFlags: 0),
13531
       dwFlags: 0),
13524
    (  pguid: @GUID_Key;
13532
    (  pguid: @GUID_Key;
13525
       dwOfs: DIK_F8;
13533
       dwOfs: DIK_F8;
13526
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13534
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13527
       dwFlags: 0),
13535
       dwFlags: 0),
13528
    (  pguid: @GUID_Key;
13536
    (  pguid: @GUID_Key;
13529
       dwOfs: DIK_F9;
13537
       dwOfs: DIK_F9;
13530
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13538
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13531
       dwFlags: 0),
13539
       dwFlags: 0),
13532
    (  pguid: @GUID_Key;
13540
    (  pguid: @GUID_Key;
13533
       dwOfs: DIK_F10;
13541
       dwOfs: DIK_F10;
13534
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13542
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13535
       dwFlags: 0),
13543
       dwFlags: 0),
13536
    // ------- F11, F12 after numeric keypad (for "historical reasons" -- XT kbd)
13544
    // ------- F11, F12 after numeric keypad (for "historical reasons" -- XT kbd)
13537
 
13545
 
13538
    // --------- numeric keypad (mostly, that is) -----------
13546
    // --------- numeric keypad (mostly, that is) -----------
13539
    (  pguid: @GUID_Key;
13547
    (  pguid: @GUID_Key;
13540
       dwOfs: DIK_NUMLOCK;   // numeric keypad
13548
       dwOfs: DIK_NUMLOCK;   // numeric keypad
13541
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13549
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13542
       dwFlags: 0),
13550
       dwFlags: 0),
13543
    (  pguid: @GUID_Key;
13551
    (  pguid: @GUID_Key;
13544
       dwOfs: DIK_SCROLL;  // scroll lock
13552
       dwOfs: DIK_SCROLL;  // scroll lock
13545
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13553
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13546
       dwFlags: 0),
13554
       dwFlags: 0),
13547
    (  pguid: @GUID_Key;
13555
    (  pguid: @GUID_Key;
13548
       dwOfs: DIK_NUMPAD7;
13556
       dwOfs: DIK_NUMPAD7;
13549
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13557
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13550
       dwFlags: 0),
13558
       dwFlags: 0),
13551
    (  pguid: @GUID_Key;
13559
    (  pguid: @GUID_Key;
13552
       dwOfs: DIK_NUMPAD8;
13560
       dwOfs: DIK_NUMPAD8;
13553
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13561
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13554
       dwFlags: 0),
13562
       dwFlags: 0),
13555
    (  pguid: @GUID_Key;
13563
    (  pguid: @GUID_Key;
13556
       dwOfs: DIK_NUMPAD9;
13564
       dwOfs: DIK_NUMPAD9;
13557
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13565
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13558
       dwFlags: 0),
13566
       dwFlags: 0),
13559
    (  pguid: @GUID_Key;
13567
    (  pguid: @GUID_Key;
13560
       dwOfs: DIK_SUBTRACT;  // "-" on numeric keypad
13568
       dwOfs: DIK_SUBTRACT;  // "-" on numeric keypad
13561
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13569
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13562
       dwFlags: 0),
13570
       dwFlags: 0),
13563
    (  pguid: @GUID_Key;
13571
    (  pguid: @GUID_Key;
13564
       dwOfs: DIK_NUMPAD4;
13572
       dwOfs: DIK_NUMPAD4;
13565
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13573
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13566
       dwFlags: 0),
13574
       dwFlags: 0),
13567
    (  pguid: @GUID_Key;
13575
    (  pguid: @GUID_Key;
13568
       dwOfs: DIK_NUMPAD5;
13576
       dwOfs: DIK_NUMPAD5;
13569
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13577
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13570
       dwFlags: 0),
13578
       dwFlags: 0),
13571
    (  pguid: @GUID_Key;
13579
    (  pguid: @GUID_Key;
13572
       dwOfs: DIK_NUMPAD6;
13580
       dwOfs: DIK_NUMPAD6;
13573
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13581
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13574
       dwFlags: 0),
13582
       dwFlags: 0),
13575
    (  pguid: @GUID_Key;
13583
    (  pguid: @GUID_Key;
13576
       dwOfs: DIK_ADD;   // "+" on numeric keypad
13584
       dwOfs: DIK_ADD;   // "+" on numeric keypad
13577
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13585
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13578
       dwFlags: 0),
13586
       dwFlags: 0),
13579
    (  pguid: @GUID_Key;
13587
    (  pguid: @GUID_Key;
13580
       dwOfs: DIK_NUMPAD1;
13588
       dwOfs: DIK_NUMPAD1;
13581
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13589
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13582
       dwFlags: 0),
13590
       dwFlags: 0),
13583
    (  pguid: @GUID_Key;
13591
    (  pguid: @GUID_Key;
13584
       dwOfs: DIK_NUMPAD2;
13592
       dwOfs: DIK_NUMPAD2;
13585
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13593
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13586
       dwFlags: 0),
13594
       dwFlags: 0),
13587
    (  pguid: @GUID_Key;
13595
    (  pguid: @GUID_Key;
13588
       dwOfs: DIK_NUMPAD3;
13596
       dwOfs: DIK_NUMPAD3;
13589
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13597
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13590
       dwFlags: 0),
13598
       dwFlags: 0),
13591
    (  pguid: @GUID_Key;
13599
    (  pguid: @GUID_Key;
13592
       dwOfs: DIK_NUMPAD0;  // "0" or "Insert" on numeric keypad
13600
       dwOfs: DIK_NUMPAD0;  // "0" or "Insert" on numeric keypad
13593
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13601
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13594
       dwFlags: 0),
13602
       dwFlags: 0),
13595
    (  pguid: @GUID_Key;
13603
    (  pguid: @GUID_Key;
13596
       dwOfs: DIK_DECIMAL;  // "." or "Del" on numeric keypad
13604
       dwOfs: DIK_DECIMAL;  // "." or "Del" on numeric keypad
13597
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13605
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13598
       dwFlags: 0),
13606
       dwFlags: 0),
13599
    (  pguid: @GUID_Key;
13607
    (  pguid: @GUID_Key;
13600
       dwOfs: $54;
13608
       dwOfs: $54;
13601
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13609
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13602
       dwFlags: 0),
13610
       dwFlags: 0),
13603
    // "extended" function keys; F13 to F15 only on NEC PC98
13611
    // "extended" function keys; F13 to F15 only on NEC PC98
13604
    (  pguid: @GUID_Key;
13612
    (  pguid: @GUID_Key;
13605
       dwOfs: DIK_F11;
13613
       dwOfs: DIK_F11;
13606
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13614
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13607
       dwFlags: 0),
13615
       dwFlags: 0),
13608
    (  pguid: @GUID_Key;
13616
    (  pguid: @GUID_Key;
13609
       dwOfs: DIK_F12;
13617
       dwOfs: DIK_F12;
13610
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13618
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13611
       dwFlags: 0),
13619
       dwFlags: 0),
13612
    // -------------------------------------------------
13620
    // -------------------------------------------------
13613
    // a whole lot of keys for asian kbds only
13621
    // a whole lot of keys for asian kbds only
13614
    // -------------------------------------------------
13622
    // -------------------------------------------------
13615
    (  pguid: @GUID_Key;
13623
    (  pguid: @GUID_Key;
13616
       dwOfs: DIK_NUMPADENTER;  // Enter on numeric keypad
13624
       dwOfs: DIK_NUMPADENTER;  // Enter on numeric keypad
13617
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13625
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13618
       dwFlags: 0),
13626
       dwFlags: 0),
13619
    (  pguid: @GUID_Key;
13627
    (  pguid: @GUID_Key;
13620
       dwOfs: DIK_RCONTROL;        // right Ctrl on main kbd
13628
       dwOfs: DIK_RCONTROL;        // right Ctrl on main kbd
13621
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13629
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13622
       dwFlags: 0),
13630
       dwFlags: 0),
13623
    (  pguid: @GUID_Key;   // "," on numeric keypad (NEC PC98 only)
13631
    (  pguid: @GUID_Key;   // "," on numeric keypad (NEC PC98 only)
13624
       dwOfs: DIK_NUMPADCOMMA;
13632
       dwOfs: DIK_NUMPADCOMMA;
13625
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13633
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13626
       dwFlags: 0),
13634
       dwFlags: 0),
13627
    (  pguid: @GUID_Key;
13635
    (  pguid: @GUID_Key;
13628
       dwOfs: DIK_DIVIDE;   // "/" on numeric keypad
13636
       dwOfs: DIK_DIVIDE;   // "/" on numeric keypad
13629
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13637
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13630
       dwFlags: 0),
13638
       dwFlags: 0),
13631
    (  pguid: @GUID_Key;
13639
    (  pguid: @GUID_Key;
13632
       dwOfs: DIK_SYSRQ;   // "System request", "Druck/S-Abf" on german kbds
13640
       dwOfs: DIK_SYSRQ;   // "System request", "Druck/S-Abf" on german kbds
13633
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13641
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13634
       dwFlags: 0),
13642
       dwFlags: 0),
13635
    (  pguid: @GUID_Key;
13643
    (  pguid: @GUID_Key;
13636
       dwOfs: DIK_RMENU;  // right ALT
13644
       dwOfs: DIK_RMENU;  // right ALT
13637
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13645
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13638
       dwFlags: 0),
13646
       dwFlags: 0),
13639
    (  pguid: @GUID_Key;
13647
    (  pguid: @GUID_Key;
13640
       dwOfs: DIK_PAUSE;  // "Pause" - not reliable on some kbds
13648
       dwOfs: DIK_PAUSE;  // "Pause" - not reliable on some kbds
13641
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13649
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13642
       dwFlags: 0),
13650
       dwFlags: 0),
13643
 
13651
 
13644
    // ----------- arrow keypad -----------------
13652
    // ----------- arrow keypad -----------------
13645
    (  pguid: @GUID_Key;
13653
    (  pguid: @GUID_Key;
13646
       dwOfs:   DIK_HOME;    // Home on arrow keypad
13654
       dwOfs:   DIK_HOME;    // Home on arrow keypad
13647
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13655
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13648
       dwFlags: 0),
13656
       dwFlags: 0),
13649
    (  pguid: @GUID_Key;
13657
    (  pguid: @GUID_Key;
13650
       dwOfs: DIK_UP;        // UpArrow on arrow keypad
13658
       dwOfs: DIK_UP;        // UpArrow on arrow keypad
13651
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13659
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13652
       dwFlags: 0),
13660
       dwFlags: 0),
13653
    (  pguid: @GUID_Key;
13661
    (  pguid: @GUID_Key;
13654
       dwOfs: DIK_PRIOR;    // PgUp on arrow keypad
13662
       dwOfs: DIK_PRIOR;    // PgUp on arrow keypad
13655
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13663
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13656
       dwFlags: 0),
13664
       dwFlags: 0),
13657
    (  pguid: @GUID_Key;
13665
    (  pguid: @GUID_Key;
13658
       dwOfs: DIK_LEFT;    // LeftArrow on arrow keypad
13666
       dwOfs: DIK_LEFT;    // LeftArrow on arrow keypad
13659
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13667
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13660
       dwFlags: 0),
13668
       dwFlags: 0),
13661
    (  pguid: @GUID_Key;
13669
    (  pguid: @GUID_Key;
13662
       dwOfs: DIK_RIGHT;    // RightArrow on arrow keypad
13670
       dwOfs: DIK_RIGHT;    // RightArrow on arrow keypad
13663
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13671
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13664
       dwFlags: 0),
13672
       dwFlags: 0),
13665
    (  pguid: @GUID_Key;
13673
    (  pguid: @GUID_Key;
13666
       dwOfs: DIK_END;    // End on arrow keypad
13674
       dwOfs: DIK_END;    // End on arrow keypad
13667
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13675
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13668
       dwFlags: 0),
13676
       dwFlags: 0),
13669
    (  pguid: @GUID_Key;
13677
    (  pguid: @GUID_Key;
13670
       dwOfs: DIK_DOWN;    // DownArrow on arrow keypad
13678
       dwOfs: DIK_DOWN;    // DownArrow on arrow keypad
13671
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13679
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13672
       dwFlags: 0),
13680
       dwFlags: 0),
13673
    (  pguid: @GUID_Key;
13681
    (  pguid: @GUID_Key;
13674
       dwOfs: DIK_NEXT;    // PgDn on arrow keypad
13682
       dwOfs: DIK_NEXT;    // PgDn on arrow keypad
13675
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13683
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13676
       dwFlags: 0),
13684
       dwFlags: 0),
13677
    (  pguid: @GUID_Key;
13685
    (  pguid: @GUID_Key;
13678
       dwOfs: DIK_INSERT;    // Insert on arrow keypad
13686
       dwOfs: DIK_INSERT;    // Insert on arrow keypad
13679
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13687
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13680
       dwFlags: 0),
13688
       dwFlags: 0),
13681
    (  pguid: @GUID_Key;
13689
    (  pguid: @GUID_Key;
13682
       dwOfs: DIK_DELETE;    // Delete on arrow keypad
13690
       dwOfs: DIK_DELETE;    // Delete on arrow keypad
13683
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13691
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13684
       dwFlags: 0),
13692
       dwFlags: 0),
13685
    (  pguid: @GUID_Key;
13693
    (  pguid: @GUID_Key;
13686
       dwOfs: DIK_LWIN;    // Left Windows key
13694
       dwOfs: DIK_LWIN;    // Left Windows key
13687
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13695
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13688
       dwFlags: 0),
13696
       dwFlags: 0),
13689
    (  pguid: @GUID_Key;
13697
    (  pguid: @GUID_Key;
13690
       dwOfs: DIK_RWIN;    // Right Windows key
13698
       dwOfs: DIK_RWIN;    // Right Windows key
13691
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13699
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13692
       dwFlags: 0),
13700
       dwFlags: 0),
13693
    (  pguid: @GUID_Key;
13701
    (  pguid: @GUID_Key;
13694
       dwOfs: DIK_APPS;    // AppMenu key
13702
       dwOfs: DIK_APPS;    // AppMenu key
13695
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13703
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13696
       dwFlags: 0),
13704
       dwFlags: 0),
13697
    // -------- added with Win 98 / DirectX 6.1 ------------
13705
    // -------- added with Win 98 / DirectX 6.1 ------------
13698
    (  pguid: @GUID_Key;
13706
    (  pguid: @GUID_Key;
13699
       dwOfs: 222;    // Power on key
13707
       dwOfs: 222;    // Power on key
13700
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13708
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13701
       dwFlags: 0),
13709
       dwFlags: 0),
13702
    (  pguid: @GUID_Key;
13710
    (  pguid: @GUID_Key;
13703
       dwOfs: 223;    // Sleep key
13711
       dwOfs: 223;    // Sleep key
13704
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13712
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13705
       dwFlags: 0),
13713
       dwFlags: 0),
13706
    (  pguid: @GUID_Key;
13714
    (  pguid: @GUID_Key;
13707
       dwOfs: 227;   // Wake (up) key. The german "translation"
13715
       dwOfs: 227;   // Wake (up) key. The german "translation"
13708
                     // reads "Kielwasser" (ship's wake) ;-)
13716
                     // reads "Kielwasser" (ship's wake) ;-)
13709
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13717
       dwType: DIDFT_BUTTON or DIDFT_NOCOLLECTION;
13710
       dwFlags: 0)
13718
       dwFlags: 0)
13711
  );
13719
  );
13712
*)
13720
*)
13713
 
13721
 
13714
var  // set by initialization - I was simply too lazy
13722
var  // set by initialization - I was simply too lazy
13715
  _c_dfDIKeyboard_Objects: array[0..255] of TDIObjectDataFormat;
13723
  _c_dfDIKeyboard_Objects: array[0..255] of TDIObjectDataFormat;
13716
const
13724
const
13717
  c_dfDIKeyboard: TDIDataFormat = (
13725
  c_dfDIKeyboard: TDIDataFormat = (
13718
    dwSize: Sizeof(c_dfDIKeyboard);
13726
    dwSize: Sizeof(c_dfDIKeyboard);
13719
    dwObjSize: Sizeof(TDIObjectDataFormat);
13727
    dwObjSize: Sizeof(TDIObjectDataFormat);
13720
    dwFlags: DIDF_RELAXIS;
13728
    dwFlags: DIDF_RELAXIS;
13721
    dwDataSize: Sizeof(TDIKeyboardState);
13729
    dwDataSize: Sizeof(TDIKeyboardState);
13722
    dwNumObjs: High(_c_dfDIKeyboard_Objects)+1;
13730
    dwNumObjs: High(_c_dfDIKeyboard_Objects)+1;
13723
    rgodf: @_c_dfDIKeyboard_Objects[Low(_c_dfDIKeyboard_Objects)]
13731
    rgodf: @_c_dfDIKeyboard_Objects[Low(_c_dfDIKeyboard_Objects)]
13724
  );
13732
  );
13725
 
13733
 
13726
(****************************************************************************
13734
(****************************************************************************
13727
 *
13735
 *
13728
 *      Joystick
13736
 *      Joystick
13729
 *
13737
 *
13730
 ****************************************************************************)
13738
 ****************************************************************************)
13731
 
13739
 
13732
 
13740
 
13733
type
13741
type
13734
  PDIJoyState = ^TDIJoyState;
13742
  PDIJoyState = ^TDIJoyState;
13735
  TDIJoyState = packed record
13743
  TDIJoyState = packed record
13736
    lX: Longint;   (* x-axis position              *)
13744
    lX: Longint;   (* x-axis position              *)
13737
    lY: Longint;   (* y-axis position              *)
13745
    lY: Longint;   (* y-axis position              *)
13738
    lZ: Longint;   (* z-axis position              *)
13746
    lZ: Longint;   (* z-axis position              *)
13739
    lRx: Longint;   (* x-axis rotation              *)
13747
    lRx: Longint;   (* x-axis rotation              *)
13740
    lRy: Longint;   (* y-axis rotation              *)
13748
    lRy: Longint;   (* y-axis rotation              *)
13741
    lRz: Longint;   (* z-axis rotation              *)
13749
    lRz: Longint;   (* z-axis rotation              *)
13742
    rglSlider: Array [0..1] of Longint;   (* extra axes positions         *)
13750
    rglSlider: Array [0..1] of Longint;   (* extra axes positions         *)
13743
    rgdwPOV: Array [0..3] of DWORD;   (* POV directions               *)
13751
    rgdwPOV: Array [0..3] of DWORD;   (* POV directions               *)
13744
    rgbButtons: Array [0..31] of BYTE;   (* 32 buttons                   *)
13752
    rgbButtons: Array [0..31] of BYTE;   (* 32 buttons                   *)
13745
  end;
13753
  end;
13746
 
13754
 
13747
  PDIJoyState2 = ^TDIJoyState2;
13755
  PDIJoyState2 = ^TDIJoyState2;
13748
  TDIJoyState2 = packed record
13756
  TDIJoyState2 = packed record
13749
    lX: Longint;   (* x-axis position              *)
13757
    lX: Longint;   (* x-axis position              *)
13750
    lY: Longint;   (* y-axis position              *)
13758
    lY: Longint;   (* y-axis position              *)
13751
    lZ: Longint;   (* z-axis position              *)
13759
    lZ: Longint;   (* z-axis position              *)
13752
    lRx: Longint;   (* x-axis rotation              *)
13760
    lRx: Longint;   (* x-axis rotation              *)
13753
    lRy: Longint;   (* y-axis rotation              *)
13761
    lRy: Longint;   (* y-axis rotation              *)
13754
    lRz: Longint;   (* z-axis rotation              *)
13762
    lRz: Longint;   (* z-axis rotation              *)
13755
    rglSlider: Array [0..1] of Longint;   (* extra axes positions         *)
13763
    rglSlider: Array [0..1] of Longint;   (* extra axes positions         *)
13756
    rgdwPOV: Array [0..3] of DWORD;   (* POV directions               *)
13764
    rgdwPOV: Array [0..3] of DWORD;   (* POV directions               *)
13757
    rgbButtons: Array [0..127] of BYTE;   (* 128 buttons                  *)
13765
    rgbButtons: Array [0..127] of BYTE;   (* 128 buttons                  *)
13758
    lVX: Longint;   (* x-axis velocity              *)
13766
    lVX: Longint;   (* x-axis velocity              *)
13759
    lVY: Longint;   (* y-axis velocity              *)
13767
    lVY: Longint;   (* y-axis velocity              *)
13760
    lVZ: Longint;   (* z-axis velocity              *)
13768
    lVZ: Longint;   (* z-axis velocity              *)
13761
    lVRx: Longint;   (* x-axis angular velocity      *)
13769
    lVRx: Longint;   (* x-axis angular velocity      *)
13762
    lVRy: Longint;   (* y-axis angular velocity      *)
13770
    lVRy: Longint;   (* y-axis angular velocity      *)
13763
    lVRz: Longint;   (* z-axis angular velocity      *)
13771
    lVRz: Longint;   (* z-axis angular velocity      *)
13764
    rglVSlider: Array [0..1] of Longint;   (* extra axes velocities        *)
13772
    rglVSlider: Array [0..1] of Longint;   (* extra axes velocities        *)
13765
    lAX: Longint;   (* x-axis acceleration          *)
13773
    lAX: Longint;   (* x-axis acceleration          *)
13766
    lAY: Longint;   (* y-axis acceleration          *)
13774
    lAY: Longint;   (* y-axis acceleration          *)
13767
    lAZ: Longint;   (* z-axis acceleration          *)
13775
    lAZ: Longint;   (* z-axis acceleration          *)
13768
    lARx: Longint;   (* x-axis angular acceleration  *)
13776
    lARx: Longint;   (* x-axis angular acceleration  *)
13769
    lARy: Longint;   (* y-axis angular acceleration  *)
13777
    lARy: Longint;   (* y-axis angular acceleration  *)
13770
    lARz: Longint;   (* z-axis angular acceleration  *)
13778
    lARz: Longint;   (* z-axis angular acceleration  *)
13771
    rglASlider: Array [0..1] of Longint;   (* extra axes accelerations     *)
13779
    rglASlider: Array [0..1] of Longint;   (* extra axes accelerations     *)
13772
    lFX: Longint;   (* x-axis force                 *)
13780
    lFX: Longint;   (* x-axis force                 *)
13773
    lFY: Longint;   (* y-axis force                 *)
13781
    lFY: Longint;   (* y-axis force                 *)
13774
    lFZ: Longint;   (* z-axis force                 *)
13782
    lFZ: Longint;   (* z-axis force                 *)
13775
    lFRx: Longint;   (* x-axis torque                *)
13783
    lFRx: Longint;   (* x-axis torque                *)
13776
    lFRy: Longint;   (* y-axis torque                *)
13784
    lFRy: Longint;   (* y-axis torque                *)
13777
    lFRz: Longint;   (* z-axis torque                *)
13785
    lFRz: Longint;   (* z-axis torque                *)
13778
    rglFSlider: Array [0..1] of Longint;   (* extra axes forces            *)
13786
    rglFSlider: Array [0..1] of Longint;   (* extra axes forces            *)
13779
  end;
13787
  end;
13780
 
13788
 
13781
 
13789
 
13782
function DIJOFS_SLIDER(n: variant) : variant;
13790
function DIJOFS_SLIDER(n: variant) : variant;
13783
 
13791
 
13784
function DIJOFS_POV(n: variant) : variant;
13792
function DIJOFS_POV(n: variant) : variant;
13785
 
13793
 
13786
function DIJOFS_BUTTON(n: variant) : variant;
13794
function DIJOFS_BUTTON(n: variant) : variant;
13787
const
13795
const
13788
  DIJOFS_BUTTON_ = 48;
13796
  DIJOFS_BUTTON_ = 48;
13789
 
13797
 
13790
const
13798
const
13791
  DIJOFS_BUTTON0 = DIJOFS_BUTTON_ + 0;
13799
  DIJOFS_BUTTON0 = DIJOFS_BUTTON_ + 0;
13792
  DIJOFS_BUTTON1 = DIJOFS_BUTTON_ + 1;
13800
  DIJOFS_BUTTON1 = DIJOFS_BUTTON_ + 1;
13793
  DIJOFS_BUTTON2 = DIJOFS_BUTTON_ + 2;
13801
  DIJOFS_BUTTON2 = DIJOFS_BUTTON_ + 2;
13794
  DIJOFS_BUTTON3 = DIJOFS_BUTTON_ + 3;
13802
  DIJOFS_BUTTON3 = DIJOFS_BUTTON_ + 3;
13795
  DIJOFS_BUTTON4 = DIJOFS_BUTTON_ + 4;
13803
  DIJOFS_BUTTON4 = DIJOFS_BUTTON_ + 4;
13796
  DIJOFS_BUTTON5 = DIJOFS_BUTTON_ + 5;
13804
  DIJOFS_BUTTON5 = DIJOFS_BUTTON_ + 5;
13797
  DIJOFS_BUTTON6 = DIJOFS_BUTTON_ + 6;
13805
  DIJOFS_BUTTON6 = DIJOFS_BUTTON_ + 6;
13798
  DIJOFS_BUTTON7 = DIJOFS_BUTTON_ + 7;
13806
  DIJOFS_BUTTON7 = DIJOFS_BUTTON_ + 7;
13799
  DIJOFS_BUTTON8 = DIJOFS_BUTTON_ + 8;
13807
  DIJOFS_BUTTON8 = DIJOFS_BUTTON_ + 8;
13800
  DIJOFS_BUTTON9 = DIJOFS_BUTTON_ + 9;
13808
  DIJOFS_BUTTON9 = DIJOFS_BUTTON_ + 9;
13801
  DIJOFS_BUTTON10 = DIJOFS_BUTTON_ + 10;
13809
  DIJOFS_BUTTON10 = DIJOFS_BUTTON_ + 10;
13802
  DIJOFS_BUTTON11 = DIJOFS_BUTTON_ + 11;
13810
  DIJOFS_BUTTON11 = DIJOFS_BUTTON_ + 11;
13803
  DIJOFS_BUTTON12 = DIJOFS_BUTTON_ + 12;
13811
  DIJOFS_BUTTON12 = DIJOFS_BUTTON_ + 12;
13804
  DIJOFS_BUTTON13 = DIJOFS_BUTTON_ + 13;
13812
  DIJOFS_BUTTON13 = DIJOFS_BUTTON_ + 13;
13805
  DIJOFS_BUTTON14 = DIJOFS_BUTTON_ + 14;
13813
  DIJOFS_BUTTON14 = DIJOFS_BUTTON_ + 14;
13806
  DIJOFS_BUTTON15 = DIJOFS_BUTTON_ + 15;
13814
  DIJOFS_BUTTON15 = DIJOFS_BUTTON_ + 15;
13807
  DIJOFS_BUTTON16 = DIJOFS_BUTTON_ + 16;
13815
  DIJOFS_BUTTON16 = DIJOFS_BUTTON_ + 16;
13808
  DIJOFS_BUTTON17 = DIJOFS_BUTTON_ + 17;
13816
  DIJOFS_BUTTON17 = DIJOFS_BUTTON_ + 17;
13809
  DIJOFS_BUTTON18 = DIJOFS_BUTTON_ + 18;
13817
  DIJOFS_BUTTON18 = DIJOFS_BUTTON_ + 18;
13810
  DIJOFS_BUTTON19 = DIJOFS_BUTTON_ + 19;
13818
  DIJOFS_BUTTON19 = DIJOFS_BUTTON_ + 19;
13811
  DIJOFS_BUTTON20 = DIJOFS_BUTTON_ + 20;
13819
  DIJOFS_BUTTON20 = DIJOFS_BUTTON_ + 20;
13812
  DIJOFS_BUTTON21 = DIJOFS_BUTTON_ + 21;
13820
  DIJOFS_BUTTON21 = DIJOFS_BUTTON_ + 21;
13813
  DIJOFS_BUTTON22 = DIJOFS_BUTTON_ + 22;
13821
  DIJOFS_BUTTON22 = DIJOFS_BUTTON_ + 22;
13814
  DIJOFS_BUTTON23 = DIJOFS_BUTTON_ + 23;
13822
  DIJOFS_BUTTON23 = DIJOFS_BUTTON_ + 23;
13815
  DIJOFS_BUTTON24 = DIJOFS_BUTTON_ + 24;
13823
  DIJOFS_BUTTON24 = DIJOFS_BUTTON_ + 24;
13816
  DIJOFS_BUTTON25 = DIJOFS_BUTTON_ + 25;
13824
  DIJOFS_BUTTON25 = DIJOFS_BUTTON_ + 25;
13817
  DIJOFS_BUTTON26 = DIJOFS_BUTTON_ + 26;
13825
  DIJOFS_BUTTON26 = DIJOFS_BUTTON_ + 26;
13818
  DIJOFS_BUTTON27 = DIJOFS_BUTTON_ + 27;
13826
  DIJOFS_BUTTON27 = DIJOFS_BUTTON_ + 27;
13819
  DIJOFS_BUTTON28 = DIJOFS_BUTTON_ + 28;
13827
  DIJOFS_BUTTON28 = DIJOFS_BUTTON_ + 28;
13820
  DIJOFS_BUTTON29 = DIJOFS_BUTTON_ + 29;
13828
  DIJOFS_BUTTON29 = DIJOFS_BUTTON_ + 29;
13821
  DIJOFS_BUTTON30 = DIJOFS_BUTTON_ + 30;
13829
  DIJOFS_BUTTON30 = DIJOFS_BUTTON_ + 30;
13822
  DIJOFS_BUTTON31 = DIJOFS_BUTTON_ + 31;
13830
  DIJOFS_BUTTON31 = DIJOFS_BUTTON_ + 31;
13823
 
13831
 
13824
 
13832
 
13825
const
13833
const
13826
  DIJOFS_X  =0;
13834
  DIJOFS_X  =0;
13827
  DIJOFS_Y  =4;
13835
  DIJOFS_Y  =4;
13828
  DIJOFS_Z  =8;
13836
  DIJOFS_Z  =8;
13829
  DIJOFS_RX =12;
13837
  DIJOFS_RX =12;
13830
  DIJOFS_RY =16;
13838
  DIJOFS_RY =16;
13831
  DIJOFS_RZ =20;
13839
  DIJOFS_RZ =20;
13832
 
13840
 
13833
  _c_dfDIJoystick_Objects: array[0..43] of TDIObjectDataFormat = (
13841
  _c_dfDIJoystick_Objects: array[0..43] of TDIObjectDataFormat = (
13834
    (  pguid: @GUID_XAxis;
13842
    (  pguid: @GUID_XAxis;
13835
       dwOfs: DIJOFS_X; dwType: $80000000 or DIDFT_AXIS or DIDFT_NOCOLLECTION; dwFlags: $100),
13843
       dwOfs: DIJOFS_X; dwType: $80000000 or DIDFT_AXIS or DIDFT_NOCOLLECTION; dwFlags: $100),
13836
    (  pguid: @GUID_YAxis;
13844
    (  pguid: @GUID_YAxis;
13837
       dwOfs: DIJOFS_Y; dwType: $80000000 or DIDFT_AXIS or DIDFT_NOCOLLECTION; dwFlags: $100),
13845
       dwOfs: DIJOFS_Y; dwType: $80000000 or DIDFT_AXIS or DIDFT_NOCOLLECTION; dwFlags: $100),
13838
    (  pguid: @GUID_ZAxis;
13846
    (  pguid: @GUID_ZAxis;
13839
       dwOfs: DIJOFS_Z; dwType: $80000000 or DIDFT_AXIS or DIDFT_NOCOLLECTION; dwFlags: $100),
13847
       dwOfs: DIJOFS_Z; dwType: $80000000 or DIDFT_AXIS or DIDFT_NOCOLLECTION; dwFlags: $100),
13840
    (  pguid: @GUID_RxAxis;
13848
    (  pguid: @GUID_RxAxis;
13841
       dwOfs: DIJOFS_RX; dwType: $80000000 or DIDFT_AXIS or DIDFT_NOCOLLECTION; dwFlags: $100),
13849
       dwOfs: DIJOFS_RX; dwType: $80000000 or DIDFT_AXIS or DIDFT_NOCOLLECTION; dwFlags: $100),
13842
    (  pguid: @GUID_RyAxis;
13850
    (  pguid: @GUID_RyAxis;
13843
       dwOfs: DIJOFS_RY; dwType: $80000000 or DIDFT_AXIS or DIDFT_NOCOLLECTION; dwFlags: $100),
13851
       dwOfs: DIJOFS_RY; dwType: $80000000 or DIDFT_AXIS or DIDFT_NOCOLLECTION; dwFlags: $100),
13844
    (  pguid: @GUID_RzAxis;
13852
    (  pguid: @GUID_RzAxis;
13845
       dwOfs: DIJOFS_RZ; dwType: $80000000 or DIDFT_AXIS or DIDFT_NOCOLLECTION; dwFlags: $100),
13853
       dwOfs: DIJOFS_RZ; dwType: $80000000 or DIDFT_AXIS or DIDFT_NOCOLLECTION; dwFlags: $100),
13846
 
13854
 
13847
    (  pguid: @GUID_Slider;  // 2 Sliders
13855
    (  pguid: @GUID_Slider;  // 2 Sliders
13848
       dwOfs: 24; dwType: $80000000 or DIDFT_AXIS or DIDFT_NOCOLLECTION; dwFlags: $100),
13856
       dwOfs: 24; dwType: $80000000 or DIDFT_AXIS or DIDFT_NOCOLLECTION; dwFlags: $100),
13849
    (  pguid: @GUID_Slider;
13857
    (  pguid: @GUID_Slider;
13850
       dwOfs: 28; dwType: $80000000 or DIDFT_AXIS or DIDFT_NOCOLLECTION; dwFlags: $100),
13858
       dwOfs: 28; dwType: $80000000 or DIDFT_AXIS or DIDFT_NOCOLLECTION; dwFlags: $100),
13851
 
13859
 
13852
    (  pguid: @GUID_POV;  // 4 POVs (yes, really)
13860
    (  pguid: @GUID_POV;  // 4 POVs (yes, really)
13853
       dwOfs: 32; dwType: $80000000 or DIDFT_POV or DIDFT_NOCOLLECTION; dwFlags: 0),
13861
       dwOfs: 32; dwType: $80000000 or DIDFT_POV or DIDFT_NOCOLLECTION; dwFlags: 0),
13854
    (  pguid: @GUID_POV;
13862
    (  pguid: @GUID_POV;
13855
       dwOfs: 36; dwType: $80000000 or DIDFT_POV or DIDFT_NOCOLLECTION; dwFlags: 0),
13863
       dwOfs: 36; dwType: $80000000 or DIDFT_POV or DIDFT_NOCOLLECTION; dwFlags: 0),
13856
    (  pguid: @GUID_POV;
13864
    (  pguid: @GUID_POV;
13857
       dwOfs: 40; dwType: $80000000 or DIDFT_POV or DIDFT_NOCOLLECTION; dwFlags: 0),
13865
       dwOfs: 40; dwType: $80000000 or DIDFT_POV or DIDFT_NOCOLLECTION; dwFlags: 0),
13858
    (  pguid: @GUID_POV;
13866
    (  pguid: @GUID_POV;
13859
       dwOfs: 44; dwType: $80000000 or DIDFT_POV or DIDFT_NOCOLLECTION; dwFlags: 0),
13867
       dwOfs: 44; dwType: $80000000 or DIDFT_POV or DIDFT_NOCOLLECTION; dwFlags: 0),
13860
 
13868
 
13861
    (  pguid: nil;   // Buttons
13869
    (  pguid: nil;   // Buttons
13862
       dwOfs: DIJOFS_BUTTON0; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13870
       dwOfs: DIJOFS_BUTTON0; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13863
    (  pguid: nil;
13871
    (  pguid: nil;
13864
       dwOfs: DIJOFS_BUTTON1; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13872
       dwOfs: DIJOFS_BUTTON1; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13865
    (  pguid: nil;
13873
    (  pguid: nil;
13866
       dwOfs: DIJOFS_BUTTON2; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13874
       dwOfs: DIJOFS_BUTTON2; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13867
    (  pguid: nil;
13875
    (  pguid: nil;
13868
       dwOfs: DIJOFS_BUTTON3; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13876
       dwOfs: DIJOFS_BUTTON3; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13869
    (  pguid: nil;
13877
    (  pguid: nil;
13870
       dwOfs: DIJOFS_BUTTON4; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13878
       dwOfs: DIJOFS_BUTTON4; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13871
    (  pguid: nil;
13879
    (  pguid: nil;
13872
       dwOfs: DIJOFS_BUTTON5; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13880
       dwOfs: DIJOFS_BUTTON5; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13873
    (  pguid: nil;
13881
    (  pguid: nil;
13874
       dwOfs: DIJOFS_BUTTON6; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13882
       dwOfs: DIJOFS_BUTTON6; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13875
    (  pguid: nil;
13883
    (  pguid: nil;
13876
       dwOfs: DIJOFS_BUTTON7; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13884
       dwOfs: DIJOFS_BUTTON7; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13877
    (  pguid: nil;
13885
    (  pguid: nil;
13878
       dwOfs: DIJOFS_BUTTON8; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13886
       dwOfs: DIJOFS_BUTTON8; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13879
    (  pguid: nil;
13887
    (  pguid: nil;
13880
       dwOfs: DIJOFS_BUTTON9; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13888
       dwOfs: DIJOFS_BUTTON9; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13881
    (  pguid: nil;
13889
    (  pguid: nil;
13882
       dwOfs: DIJOFS_BUTTON10; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13890
       dwOfs: DIJOFS_BUTTON10; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13883
    (  pguid: nil;
13891
    (  pguid: nil;
13884
       dwOfs: DIJOFS_BUTTON11; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13892
       dwOfs: DIJOFS_BUTTON11; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13885
    (  pguid: nil;
13893
    (  pguid: nil;
13886
       dwOfs: DIJOFS_BUTTON12; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13894
       dwOfs: DIJOFS_BUTTON12; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13887
    (  pguid: nil;
13895
    (  pguid: nil;
13888
       dwOfs: DIJOFS_BUTTON13; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13896
       dwOfs: DIJOFS_BUTTON13; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13889
    (  pguid: nil;
13897
    (  pguid: nil;
13890
       dwOfs: DIJOFS_BUTTON14; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13898
       dwOfs: DIJOFS_BUTTON14; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13891
    (  pguid: nil;
13899
    (  pguid: nil;
13892
       dwOfs: DIJOFS_BUTTON15; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13900
       dwOfs: DIJOFS_BUTTON15; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13893
    (  pguid: nil;
13901
    (  pguid: nil;
13894
       dwOfs: DIJOFS_BUTTON16; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13902
       dwOfs: DIJOFS_BUTTON16; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13895
    (  pguid: nil;
13903
    (  pguid: nil;
13896
       dwOfs: DIJOFS_BUTTON17; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13904
       dwOfs: DIJOFS_BUTTON17; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13897
    (  pguid: nil;
13905
    (  pguid: nil;
13898
       dwOfs: DIJOFS_BUTTON18; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13906
       dwOfs: DIJOFS_BUTTON18; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13899
    (  pguid: nil;
13907
    (  pguid: nil;
13900
       dwOfs: DIJOFS_BUTTON19; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13908
       dwOfs: DIJOFS_BUTTON19; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13901
    (  pguid: nil;
13909
    (  pguid: nil;
13902
       dwOfs: DIJOFS_BUTTON20; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13910
       dwOfs: DIJOFS_BUTTON20; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13903
    (  pguid: nil;
13911
    (  pguid: nil;
13904
       dwOfs: DIJOFS_BUTTON21; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13912
       dwOfs: DIJOFS_BUTTON21; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13905
    (  pguid: nil;
13913
    (  pguid: nil;
13906
       dwOfs: DIJOFS_BUTTON22; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13914
       dwOfs: DIJOFS_BUTTON22; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13907
    (  pguid: nil;
13915
    (  pguid: nil;
13908
       dwOfs: DIJOFS_BUTTON23; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13916
       dwOfs: DIJOFS_BUTTON23; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13909
    (  pguid: nil;
13917
    (  pguid: nil;
13910
       dwOfs: DIJOFS_BUTTON24; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13918
       dwOfs: DIJOFS_BUTTON24; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13911
    (  pguid: nil;
13919
    (  pguid: nil;
13912
       dwOfs: DIJOFS_BUTTON25; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13920
       dwOfs: DIJOFS_BUTTON25; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13913
    (  pguid: nil;
13921
    (  pguid: nil;
13914
       dwOfs: DIJOFS_BUTTON26; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13922
       dwOfs: DIJOFS_BUTTON26; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13915
    (  pguid: nil;
13923
    (  pguid: nil;
13916
       dwOfs: DIJOFS_BUTTON27; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13924
       dwOfs: DIJOFS_BUTTON27; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13917
    (  pguid: nil;
13925
    (  pguid: nil;
13918
       dwOfs: DIJOFS_BUTTON28; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13926
       dwOfs: DIJOFS_BUTTON28; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13919
    (  pguid: nil;
13927
    (  pguid: nil;
13920
       dwOfs: DIJOFS_BUTTON29; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13928
       dwOfs: DIJOFS_BUTTON29; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13921
    (  pguid: nil;
13929
    (  pguid: nil;
13922
       dwOfs: DIJOFS_BUTTON30; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13930
       dwOfs: DIJOFS_BUTTON30; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0),
13923
    (  pguid: nil;
13931
    (  pguid: nil;
13924
       dwOfs: DIJOFS_BUTTON31; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0)
13932
       dwOfs: DIJOFS_BUTTON31; dwType: $80000000 or DIDFT_BUTTON or DIDFT_NOCOLLECTION; dwFlags: 0)
13925
  );
13933
  );
13926
 
13934
 
13927
  c_dfDIJoystick: TDIDataFormat = (
13935
  c_dfDIJoystick: TDIDataFormat = (
13928
    dwSize: Sizeof(c_dfDIJoystick);
13936
    dwSize: Sizeof(c_dfDIJoystick);
13929
    dwObjSize: Sizeof(TDIObjectDataFormat);  // $10
13937
    dwObjSize: Sizeof(TDIObjectDataFormat);  // $10
13930
    dwFlags: DIDF_ABSAXIS;
13938
    dwFlags: DIDF_ABSAXIS;
13931
    dwDataSize: SizeOf(TDIJoyState);         // $10
13939
    dwDataSize: SizeOf(TDIJoyState);         // $10
13932
    dwNumObjs: High(_c_dfDIJoystick_Objects)+1;  // $2C
13940
    dwNumObjs: High(_c_dfDIJoystick_Objects)+1;  // $2C
13933
    rgodf: @_c_dfDIJoystick_Objects[Low(_c_dfDIJoystick_Objects)]
13941
    rgodf: @_c_dfDIJoystick_Objects[Low(_c_dfDIJoystick_Objects)]
13934
  );
13942
  );
13935
 
13943
 
13936
var  // Set by initialization part -- didn't want to type in another 656 consts...
13944
var  // Set by initialization part -- didn't want to type in another 656 consts...
13937
  _c_dfDIJoystick2_Objects: array[0..$A3] of TDIObjectDataFormat;
13945
  _c_dfDIJoystick2_Objects: array[0..$A3] of TDIObjectDataFormat;
13938
  { Elements $00..$2B: exact copy of _c_dfDIJoystick
13946
  { Elements $00..$2B: exact copy of _c_dfDIJoystick
13939
    Elements $2C..$8B: more "buttons" with nil GUIDs
13947
    Elements $2C..$8B: more "buttons" with nil GUIDs
13940
    remaining elements ($8B..$A2):
13948
    remaining elements ($8B..$A2):
13941
     $8C,$8D,$8E: X axis, Y axis, Z axis with dwFlags = $0200
13949
     $8C,$8D,$8E: X axis, Y axis, Z axis with dwFlags = $0200
13942
     $8F,$90,$91: rX axis, rY axis, rZ axis with dwFlags = $0200
13950
     $8F,$90,$91: rX axis, rY axis, rZ axis with dwFlags = $0200
13943
     $92, $93: Slider with dwFlags = $0200
13951
     $92, $93: Slider with dwFlags = $0200
13944
     --------
13952
     --------
13945
     $94,$95,$96: X axis, Y axis, Z axis with dwFlags = $0300
13953
     $94,$95,$96: X axis, Y axis, Z axis with dwFlags = $0300
13946
     $97,$98,$99: rX axis, rY axis, rZ axis with dwFlags = $0300
13954
     $97,$98,$99: rX axis, rY axis, rZ axis with dwFlags = $0300
13947
     $9A,$9B: Slider with dwFlags = $0300
13955
     $9A,$9B: Slider with dwFlags = $0300
13948
     --------
13956
     --------
13949
     $9C,$9D,$9E: X axis, Y axis, Z axis with dwFlags = $0400
13957
     $9C,$9D,$9E: X axis, Y axis, Z axis with dwFlags = $0400
13950
     $9F, $A0, $A1: rX axis, rY axis, rZ axis with dwFlags = $0400
13958
     $9F, $A0, $A1: rX axis, rY axis, rZ axis with dwFlags = $0400
13951
     $A2, $A3: Slider with dwFlags = $0400
13959
     $A2, $A3: Slider with dwFlags = $0400
13952
  }
13960
  }
13953
const
13961
const
13954
  c_dfDIJoystick2: TDIDataFormat = (
13962
  c_dfDIJoystick2: TDIDataFormat = (
13955
    dwSize: Sizeof(c_dfDIJoystick2);
13963
    dwSize: Sizeof(c_dfDIJoystick2);
13956
    dwObjSize: Sizeof(TDIObjectDataFormat);
13964
    dwObjSize: Sizeof(TDIObjectDataFormat);
13957
    dwFlags: DIDF_ABSAXIS;
13965
    dwFlags: DIDF_ABSAXIS;
13958
    dwDataSize: SizeOf(TDIJoyState2);  // $110
13966
    dwDataSize: SizeOf(TDIJoyState2);  // $110
13959
    dwNumObjs: High(_c_dfDIJoystick2_Objects)+1;
13967
    dwNumObjs: High(_c_dfDIJoystick2_Objects)+1;
13960
    rgodf: @_c_dfDIJoystick2_Objects[Low(_c_dfDIJoystick2_Objects)]
13968
    rgodf: @_c_dfDIJoystick2_Objects[Low(_c_dfDIJoystick2_Objects)]
13961
  );
13969
  );
13962
 
13970
 
13963
(****************************************************************************
13971
(****************************************************************************
13964
 *
13972
 *
13965
 *  IDirectInput
13973
 *  IDirectInput
13966
 *
13974
 *
13967
 ****************************************************************************)
13975
 ****************************************************************************)
13968
 
13976
 
13969
 
13977
 
13970
  DIENUM_STOP = 0;
13978
  DIENUM_STOP = 0;
13971
  DIENUM_CONTINUE = 1;
13979
  DIENUM_CONTINUE = 1;
13972
 
13980
 
13973
type
13981
type
13974
  // as with the other enum functions: must rtn DIENUM_STOP or DIENUM_CONTINUE
13982
  // as with the other enum functions: must rtn DIENUM_STOP or DIENUM_CONTINUE
13975
  TDIEnumDevicesCallbackA = function (var lpddi: TDIDeviceInstanceA;
13983
  TDIEnumDevicesCallbackA = function (var lpddi: TDIDeviceInstanceA;
13976
      pvRef: Pointer): Integer; stdcall;  // BOOL; stdcall;
13984
      pvRef: Pointer): Integer; stdcall;  // BOOL; stdcall;
13977
  TDIEnumDevicesCallbackW = function (var lpddi: TDIDeviceInstanceW;
13985
  TDIEnumDevicesCallbackW = function (var lpddi: TDIDeviceInstanceW;
13978
      pvRef: Pointer): Integer; stdcall;  // BOOL; stdcall;
13986
      pvRef: Pointer): Integer; stdcall;  // BOOL; stdcall;
13979
  TDIEnumDevicesCallback = function (var lpddi: TDIDeviceInstance;
13987
  TDIEnumDevicesCallback = function (var lpddi: TDIDeviceInstance;
13980
      pvRef: Pointer): Integer; stdcall; // BOOL; stdcall;
13988
      pvRef: Pointer): Integer; stdcall; // BOOL; stdcall;
13981
  TDIEnumDevicesProc = TDIEnumDevicesCallback;
13989
  TDIEnumDevicesProc = TDIEnumDevicesCallback;
13982
 
13990
 
13983
const
13991
const
13984
  DIEDFL_ALLDEVICES       = $00000000;
13992
  DIEDFL_ALLDEVICES       = $00000000;
13985
  DIEDFL_ATTACHEDONLY     = $00000001;
13993
  DIEDFL_ATTACHEDONLY     = $00000001;
13986
  DIEDFL_FORCEFEEDBACK    = $00000100;
13994
  DIEDFL_FORCEFEEDBACK    = $00000100;
13987
 
13995
 
13988
type
13996
type
13989
 
13997
 
13990
  IDirectInputW = interface (IUnknown)
13998
  IDirectInputW = interface (IUnknown)
13991
    ['{89521361-AA8A-11CF-BFC7-444553540000}']
13999
    ['{89521361-AA8A-11CF-BFC7-444553540000}']
13992
    (*** IDirectInputW methods ***)
14000
    (*** IDirectInputW methods ***)
13993
    function CreateDevice(const rguid: TGUID; var lplpDirectInputDevice:
14001
    function CreateDevice(const rguid: TGUID; var lplpDirectInputDevice:
13994
        IDirectInputDeviceW; pUnkOuter: IUnknown) : HResult;  stdcall;
14002
        IDirectInputDeviceW; pUnkOuter: IUnknown) : HResult;  stdcall;
13995
    function EnumDevices(dwDevType: DWORD; lpCallback: TDIEnumDevicesCallbackW;
14003
    function EnumDevices(dwDevType: DWORD; lpCallback: TDIEnumDevicesCallbackW;
13996
        pvRef: Pointer; dwFlags: DWORD) : HResult;  stdcall;
14004
        pvRef: Pointer; dwFlags: DWORD) : HResult;  stdcall;
13997
    function GetDeviceStatus(const rguidInstance: TGUID) : HResult;  stdcall;
14005
    function GetDeviceStatus(const rguidInstance: TGUID) : HResult;  stdcall;
13998
    function RunControlPanel(hwndOwner: HWND; dwFlags: DWORD) : HResult;  stdcall;
14006
    function RunControlPanel(hwndOwner: HWND; dwFlags: DWORD) : HResult;  stdcall;
13999
    function Initialize(hinst: THandle; dwVersion: DWORD) : HResult;  stdcall;
14007
    function Initialize(hinst: THandle; dwVersion: DWORD) : HResult;  stdcall;
14000
  end;
14008
  end;
14001
 
14009
 
14002
  IDirectInputA = interface (IUnknown)
14010
  IDirectInputA = interface (IUnknown)
14003
    ['{89521360-AA8A-11CF-BFC7-444553540000}']
14011
    ['{89521360-AA8A-11CF-BFC7-444553540000}']
14004
    (*** IDirectInputA methods ***)
14012
    (*** IDirectInputA methods ***)
14005
    function CreateDevice(const rguid: TGUID; var lplpDirectInputDevice:
14013
    function CreateDevice(const rguid: TGUID; var lplpDirectInputDevice:
14006
        IDirectInputDeviceA; pUnkOuter: IUnknown) : HResult;  stdcall;
14014
        IDirectInputDeviceA; pUnkOuter: IUnknown) : HResult;  stdcall;
14007
    function EnumDevices(dwDevType: DWORD; lpCallback: TDIEnumDevicesCallbackA;
14015
    function EnumDevices(dwDevType: DWORD; lpCallback: TDIEnumDevicesCallbackA;
14008
        pvRef: Pointer; dwFlags: DWORD) : HResult;  stdcall;
14016
        pvRef: Pointer; dwFlags: DWORD) : HResult;  stdcall;
14009
    function GetDeviceStatus(const rguidInstance: TGUID) : HResult;  stdcall;
14017
    function GetDeviceStatus(const rguidInstance: TGUID) : HResult;  stdcall;
14010
    function RunControlPanel(hwndOwner: HWND; dwFlags: DWORD) : HResult;  stdcall;
14018
    function RunControlPanel(hwndOwner: HWND; dwFlags: DWORD) : HResult;  stdcall;
14011
    function Initialize(hinst: THandle; dwVersion: DWORD) : HResult;  stdcall;
14019
    function Initialize(hinst: THandle; dwVersion: DWORD) : HResult;  stdcall;
14012
  end;
14020
  end;
14013
 
14021
 
14014
{$IFDEF UNICODE}
14022
{$IFDEF UNICODE}
14015
  IDirectInput = IDirectInputW;
14023
  IDirectInput = IDirectInputW;
14016
{$ELSE}
14024
{$ELSE}
14017
  IDirectInput = IDirectInputA;
14025
  IDirectInput = IDirectInputA;
14018
{$ENDIF}
14026
{$ENDIF}
14019
 
14027
 
14020
 
14028
 
14021
  IDirectInput2W = interface (IDirectInputW)
14029
  IDirectInput2W = interface (IDirectInputW)
14022
    ['{5944E663-AA8A-11CF-BFC7-444553540000}']
14030
    ['{5944E663-AA8A-11CF-BFC7-444553540000}']
14023
    (*** IDirectInput2W methods ***)
14031
    (*** IDirectInput2W methods ***)
14024
    function FindDevice(const rguidClass: TGUID; ptszName: PWideChar; out pguidInstance: TGUID): HResult;  stdcall;
14032
    function FindDevice(const rguidClass: TGUID; ptszName: PWideChar; out pguidInstance: TGUID): HResult;  stdcall;
14025
  end;
14033
  end;
14026
 
14034
 
14027
  IDirectInput2A = interface (IDirectInputA)
14035
  IDirectInput2A = interface (IDirectInputA)
14028
    ['{5944E662-AA8A-11CF-BFC7-444553540000}']
14036
    ['{5944E662-AA8A-11CF-BFC7-444553540000}']
14029
    (*** IDirectInput2A methods ***)
14037
    (*** IDirectInput2A methods ***)
14030
    function FindDevice(const rguidClass: TGUID; ptszName: PAnsiChar; out pguidInstance: TGUID): HResult;  stdcall;
14038
    function FindDevice(const rguidClass: TGUID; ptszName: PAnsiChar; out pguidInstance: TGUID): HResult;  stdcall;
14031
  end;
14039
  end;
14032
 
14040
 
14033
{$IFDEF UNICODE}
14041
{$IFDEF UNICODE}
14034
  IDirectInput2 = IDirectInput2W;
14042
  IDirectInput2 = IDirectInput2W;
14035
{$ELSE}
14043
{$ELSE}
14036
  IDirectInput2 = IDirectInput2A;
14044
  IDirectInput2 = IDirectInput2A;
14037
{$ENDIF}
14045
{$ENDIF}
14038
 
14046
 
14039
 
14047
 
14040
type
14048
type
14041
  IDirectInput7W = interface (IDirectInput2W)
14049
  IDirectInput7W = interface (IDirectInput2W)
14042
    ['{9A4CB685-236D-11D3-8E9D-00C04F6844AE}']
14050
    ['{9A4CB685-236D-11D3-8E9D-00C04F6844AE}']
14043
    {*** IDirectInput7W methods ***}
14051
    {*** IDirectInput7W methods ***}
14044
    function CreateDeviceEx(const rguid, riid: TGUID; out lplpDirectInputDevice;
14052
    function CreateDeviceEx(const rguid, riid: TGUID; out lplpDirectInputDevice;
14045
        pUnkOuter: IUnknown) : HResult; stdcall;
14053
        pUnkOuter: IUnknown) : HResult; stdcall;
14046
  end;
14054
  end;
14047
 
14055
 
14048
  IDirectInput7A = interface (IDirectInput2A)
14056
  IDirectInput7A = interface (IDirectInput2A)
14049
    ['{9A4CB684-236D-11D3-8E9D-00C04F6844AE}']
14057
    ['{9A4CB684-236D-11D3-8E9D-00C04F6844AE}']
14050
    {*** IDirectInput7A methods ***}
14058
    {*** IDirectInput7A methods ***}
14051
    function CreateDeviceEx(const rguid, riid: TGUID; out lplpDirectInputDevice;
14059
    function CreateDeviceEx(const rguid, riid: TGUID; out lplpDirectInputDevice;
14052
        pUnkOuter: IUnknown) : HResult; stdcall;
14060
        pUnkOuter: IUnknown) : HResult; stdcall;
14053
  end;
14061
  end;
14054
 
14062
 
14055
{$IFDEF UNICODE}
14063
{$IFDEF UNICODE}
14056
  IDirectInput7 = IDirectInput7W;
14064
  IDirectInput7 = IDirectInput7W;
14057
{$ELSE}
14065
{$ELSE}
14058
  IDirectInput7 = IDirectInput7A;
14066
  IDirectInput7 = IDirectInput7A;
14059
{$ENDIF}
14067
{$ENDIF}
14060
 
14068
 
14061
 
14069
 
14062
var
14070
var
14063
  DirectInputCreateA : function (hinst: THandle; dwVersion: DWORD;
14071
  DirectInputCreateA : function (hinst: THandle; dwVersion: DWORD;
14064
      out ppDI: IDirectInputA;
14072
      out ppDI: IDirectInputA;
14065
      punkOuter: IUnknown) : HResult; stdcall;
14073
      punkOuter: IUnknown) : HResult; stdcall;
14066
  DirectInputCreateW : function (hinst: THandle; dwVersion: DWORD;
14074
  DirectInputCreateW : function (hinst: THandle; dwVersion: DWORD;
14067
      out ppDI: IDirectInputW;
14075
      out ppDI: IDirectInputW;
14068
      punkOuter: IUnknown) : HResult; stdcall;
14076
      punkOuter: IUnknown) : HResult; stdcall;
14069
  DirectInputCreate : function (hinst: THandle; dwVersion: DWORD;
14077
  DirectInputCreate : function (hinst: THandle; dwVersion: DWORD;
14070
      out ppDI: IDirectInput;
14078
      out ppDI: IDirectInput;
14071
      punkOuter: IUnknown) : HResult; stdcall;
14079
      punkOuter: IUnknown) : HResult; stdcall;
14072
 
14080
 
14073
  DirectInputCreateEx : function (
14081
  DirectInputCreateEx : function (
14074
      hinst: THandle;
14082
      hinst: THandle;
14075
      dwVersion: DWORD;
14083
      dwVersion: DWORD;
14076
      const riidltf: TGUID;
14084
      const riidltf: TGUID;
14077
      out ppvOut;
14085
      out ppvOut;
14078
      punkOuter: IUnknown) : HResult; stdcall;
14086
      punkOuter: IUnknown) : HResult; stdcall;
14079
 
14087
 
14080
(****************************************************************************
14088
(****************************************************************************
14081
 *
14089
 *
14082
 *      Interfaces
14090
 *      Interfaces
14083
 *
14091
 *
14084
 ****************************************************************************)
14092
 ****************************************************************************)
14085
type
14093
type
14086
  IID_IDirectInputW = IDirectInputW;
14094
  IID_IDirectInputW = IDirectInputW;
14087
  IID_IDirectInputA = IDirectInputA;
14095
  IID_IDirectInputA = IDirectInputA;
14088
  IID_IDirectInput = IDirectInput;
14096
  IID_IDirectInput = IDirectInput;
14089
 
14097
 
14090
  IID_IDirectInput2W = IDirectInput2W;
14098
  IID_IDirectInput2W = IDirectInput2W;
14091
  IID_IDirectInput2A = IDirectInput2A;
14099
  IID_IDirectInput2A = IDirectInput2A;
14092
  IID_IDirectInput2 = IDirectInput2;
14100
  IID_IDirectInput2 = IDirectInput2;
14093
 
14101
 
14094
  IID_IDirectInput7W = IDirectInput7W;
14102
  IID_IDirectInput7W = IDirectInput7W;
14095
  IID_IDirectInput7A = IDirectInput7A;
14103
  IID_IDirectInput7A = IDirectInput7A;
14096
  IID_IDirectInput7 = IDirectInput7;
14104
  IID_IDirectInput7 = IDirectInput7;
14097
 
14105
 
14098
  IID_IDirectInputDeviceW = IDirectInputDeviceW;
14106
  IID_IDirectInputDeviceW = IDirectInputDeviceW;
14099
  IID_IDirectInputDeviceA = IDirectInputDeviceA;
14107
  IID_IDirectInputDeviceA = IDirectInputDeviceA;
14100
  IID_IDirectInputDevice = IDirectInputDevice;
14108
  IID_IDirectInputDevice = IDirectInputDevice;
14101
 
14109
 
14102
  IID_IDirectInputDevice2W = IDirectInputDevice2W;
14110
  IID_IDirectInputDevice2W = IDirectInputDevice2W;
14103
  IID_IDirectInputDevice2A = IDirectInputDevice2A;
14111
  IID_IDirectInputDevice2A = IDirectInputDevice2A;
14104
  IID_IDirectInputDevice2 = IDirectInputDevice2;
14112
  IID_IDirectInputDevice2 = IDirectInputDevice2;
14105
 
14113
 
14106
  IID_IDirectInputEffect = IDirectInputEffect;
14114
  IID_IDirectInputEffect = IDirectInputEffect;
14107
 
14115
 
14108
  IID_IDirectInputDevice7W = IDirectInputDevice7W;
14116
  IID_IDirectInputDevice7W = IDirectInputDevice7W;
14109
  IID_IDirectInputDevice7A = IDirectInputDevice7A;
14117
  IID_IDirectInputDevice7A = IDirectInputDevice7A;
14110
  IID_IDirectInputDevice7 = IDirectInputDevice7;
14118
  IID_IDirectInputDevice7 = IDirectInputDevice7;
14111
 
14119
 
14112
(****************************************************************************
14120
(****************************************************************************
14113
 *
14121
 *
14114
 *  Return Codes
14122
 *  Return Codes
14115
 *
14123
 *
14116
 ****************************************************************************)
14124
 ****************************************************************************)
14117
 
14125
 
14118
(*
14126
(*
14119
 *  The operation completed successfully.
14127
 *  The operation completed successfully.
14120
 *)
14128
 *)
14121
const
14129
const
14122
  DI_OK = S_OK;
14130
  DI_OK = S_OK;
14123
 
14131
 
14124
(*
14132
(*
14125
 *  The device exists but is not currently attached.
14133
 *  The device exists but is not currently attached.
14126
 *)
14134
 *)
14127
  DI_NOTATTACHED = S_FALSE;
14135
  DI_NOTATTACHED = S_FALSE;
14128
 
14136
 
14129
(*
14137
(*
14130
 *  The device buffer overflowed.  Some input was lost.
14138
 *  The device buffer overflowed.  Some input was lost.
14131
 *)
14139
 *)
14132
  DI_BUFFEROVERFLOW = S_FALSE;
14140
  DI_BUFFEROVERFLOW = S_FALSE;
14133
 
14141
 
14134
(*
14142
(*
14135
 *  The change in device properties had no effect.
14143
 *  The change in device properties had no effect.
14136
 *)
14144
 *)
14137
  DI_PROPNOEFFECT = S_FALSE;
14145
  DI_PROPNOEFFECT = S_FALSE;
14138
 
14146
 
14139
(*
14147
(*
14140
 *  The operation had no effect.
14148
 *  The operation had no effect.
14141
 *)
14149
 *)
14142
  DI_NOEFFECT = S_FALSE;
14150
  DI_NOEFFECT = S_FALSE;
14143
 
14151
 
14144
(*
14152
(*
14145
 *  The device is a polled device.  As a result, device buffering
14153
 *  The device is a polled device.  As a result, device buffering
14146
 *  will not collect any data and event notifications will not be
14154
 *  will not collect any data and event notifications will not be
14147
 *  signalled until GetDeviceState is called.
14155
 *  signalled until GetDeviceState is called.
14148
 *)
14156
 *)
14149
  DI_POLLEDDEVICE = $00000002;
14157
  DI_POLLEDDEVICE = $00000002;
14150
 
14158
 
14151
(*
14159
(*
14152
 *  The parameters of the effect were successfully updated by
14160
 *  The parameters of the effect were successfully updated by
14153
 *  IDirectInputEffect::SetParameters, but the effect was not
14161
 *  IDirectInputEffect::SetParameters, but the effect was not
14154
 *  downloaded because the device is not exclusively acquired
14162
 *  downloaded because the device is not exclusively acquired
14155
 *  or because the DIEP_NODOWNLOAD flag was passed.
14163
 *  or because the DIEP_NODOWNLOAD flag was passed.
14156
 *)
14164
 *)
14157
  DI_DOWNLOADSKIPPED = $00000003;
14165
  DI_DOWNLOADSKIPPED = $00000003;
14158
 
14166
 
14159
(*
14167
(*
14160
 *  The parameters of the effect were successfully updated by
14168
 *  The parameters of the effect were successfully updated by
14161
 *  IDirectInputEffect::SetParameters, but in order to change
14169
 *  IDirectInputEffect::SetParameters, but in order to change
14162
 *  the parameters, the effect needed to be restarted.
14170
 *  the parameters, the effect needed to be restarted.
14163
 *)
14171
 *)
14164
  DI_EFFECTRESTARTED = $00000004;
14172
  DI_EFFECTRESTARTED = $00000004;
14165
 
14173
 
14166
(*
14174
(*
14167
 *  The parameters of the effect were successfully updated by
14175
 *  The parameters of the effect were successfully updated by
14168
 *  IDirectInputEffect::SetParameters, but some of them were
14176
 *  IDirectInputEffect::SetParameters, but some of them were
14169
 *  beyond the capabilities of the device and were truncated.
14177
 *  beyond the capabilities of the device and were truncated.
14170
 *)
14178
 *)
14171
  DI_TRUNCATED = $00000008;
14179
  DI_TRUNCATED = $00000008;
14172
 
14180
 
14173
(*
14181
(*
14174
 *  Equal to DI_EFFECTRESTARTED | DI_TRUNCATED.
14182
 *  Equal to DI_EFFECTRESTARTED | DI_TRUNCATED.
14175
 *)
14183
 *)
14176
  DI_TRUNCATEDANDRESTARTED = $0000000C;
14184
  DI_TRUNCATEDANDRESTARTED = $0000000C;
14177
 
14185
 
14178
  SEVERITY_ERROR_FACILITY_WIN32 =
14186
  SEVERITY_ERROR_FACILITY_WIN32 =
14179
      HResult(SEVERITY_ERROR shl 31) or HResult(FACILITY_WIN32 shl 16);
14187
      HResult(SEVERITY_ERROR shl 31) or HResult(FACILITY_WIN32 shl 16);
14180
 
14188
 
14181
(*
14189
(*
14182
 *  The application requires a newer version of DirectInput.
14190
 *  The application requires a newer version of DirectInput.
14183
 *)
14191
 *)
14184
 
14192
 
14185
  DIERR_OLDDIRECTINPUTVERSION = SEVERITY_ERROR_FACILITY_WIN32
14193
  DIERR_OLDDIRECTINPUTVERSION = SEVERITY_ERROR_FACILITY_WIN32
14186
      or ERROR_OLD_WIN_VERSION;
14194
      or ERROR_OLD_WIN_VERSION;
14187
 
14195
 
14188
(*
14196
(*
14189
 *  The application was written for an unsupported prerelease version
14197
 *  The application was written for an unsupported prerelease version
14190
 *  of DirectInput.
14198
 *  of DirectInput.
14191
 *)
14199
 *)
14192
  DIERR_BETADIRECTINPUTVERSION = SEVERITY_ERROR_FACILITY_WIN32
14200
  DIERR_BETADIRECTINPUTVERSION = SEVERITY_ERROR_FACILITY_WIN32
14193
      or ERROR_RMODE_APP;
14201
      or ERROR_RMODE_APP;
14194
 
14202
 
14195
(*
14203
(*
14196
 *  The object could not be created due to an incompatible driver version
14204
 *  The object could not be created due to an incompatible driver version
14197
 *  or mismatched or incomplete driver components.
14205
 *  or mismatched or incomplete driver components.
14198
 *)
14206
 *)
14199
  DIERR_BADDRIVERVER = SEVERITY_ERROR_FACILITY_WIN32
14207
  DIERR_BADDRIVERVER = SEVERITY_ERROR_FACILITY_WIN32
14200
      or ERROR_BAD_DRIVER_LEVEL;
14208
      or ERROR_BAD_DRIVER_LEVEL;
14201
 
14209
 
14202
(*
14210
(*
14203
 * The device or device instance or effect is not registered with DirectInput.
14211
 * The device or device instance or effect is not registered with DirectInput.
14204
 *)
14212
 *)
14205
  DIERR_DEVICENOTREG = REGDB_E_CLASSNOTREG;
14213
  DIERR_DEVICENOTREG = REGDB_E_CLASSNOTREG;
14206
 
14214
 
14207
(*
14215
(*
14208
 * The requested object does not exist.
14216
 * The requested object does not exist.
14209
 *)
14217
 *)
14210
  DIERR_NOTFOUND = SEVERITY_ERROR_FACILITY_WIN32
14218
  DIERR_NOTFOUND = SEVERITY_ERROR_FACILITY_WIN32
14211
      or ERROR_FILE_NOT_FOUND;
14219
      or ERROR_FILE_NOT_FOUND;
14212
 
14220
 
14213
(*
14221
(*
14214
 * The requested object does not exist.
14222
 * The requested object does not exist.
14215
 *)
14223
 *)
14216
  DIERR_OBJECTNOTFOUND = SEVERITY_ERROR_FACILITY_WIN32
14224
  DIERR_OBJECTNOTFOUND = SEVERITY_ERROR_FACILITY_WIN32
14217
      or ERROR_FILE_NOT_FOUND;
14225
      or ERROR_FILE_NOT_FOUND;
14218
 
14226
 
14219
(*
14227
(*
14220
 * An invalid parameter was passed to the returning function,
14228
 * An invalid parameter was passed to the returning function,
14221
 * or the object was not in a state that admitted the function
14229
 * or the object was not in a state that admitted the function
14222
 * to be called.
14230
 * to be called.
14223
 *)
14231
 *)
14224
  DIERR_INVALIDPARAM = E_INVALIDARG;
14232
  DIERR_INVALIDPARAM = E_INVALIDARG;
14225
 
14233
 
14226
(*
14234
(*
14227
 * The specified interface is not supported by the object
14235
 * The specified interface is not supported by the object
14228
 *)
14236
 *)
14229
  DIERR_NOINTERFACE = E_NOINTERFACE;
14237
  DIERR_NOINTERFACE = E_NOINTERFACE;
14230
 
14238
 
14231
(*
14239
(*
14232
 * An undetermined error occured inside the DInput subsystem
14240
 * An undetermined error occured inside the DInput subsystem
14233
 *)
14241
 *)
14234
  DIERR_GENERIC = E_FAIL;
14242
  DIERR_GENERIC = E_FAIL;
14235
 
14243
 
14236
(*
14244
(*
14237
 * The DInput subsystem couldn't allocate sufficient memory to complete the
14245
 * The DInput subsystem couldn't allocate sufficient memory to complete the
14238
 * caller's request.
14246
 * caller's request.
14239
 *)
14247
 *)
14240
  DIERR_OUTOFMEMORY = E_OUTOFMEMORY;
14248
  DIERR_OUTOFMEMORY = E_OUTOFMEMORY;
14241
 
14249
 
14242
(*
14250
(*
14243
 * The function called is not supported at this time
14251
 * The function called is not supported at this time
14244
 *)
14252
 *)
14245
  DIERR_UNSUPPORTED = E_NOTIMPL;
14253
  DIERR_UNSUPPORTED = E_NOTIMPL;
14246
 
14254
 
14247
(*
14255
(*
14248
 * This object has not been initialized
14256
 * This object has not been initialized
14249
 *)
14257
 *)
14250
  DIERR_NOTINITIALIZED = SEVERITY_ERROR_FACILITY_WIN32
14258
  DIERR_NOTINITIALIZED = SEVERITY_ERROR_FACILITY_WIN32
14251
      or ERROR_NOT_READY;
14259
      or ERROR_NOT_READY;
14252
 
14260
 
14253
(*
14261
(*
14254
 * This object is already initialized
14262
 * This object is already initialized
14255
 *)
14263
 *)
14256
  DIERR_ALREADYINITIALIZED = SEVERITY_ERROR_FACILITY_WIN32
14264
  DIERR_ALREADYINITIALIZED = SEVERITY_ERROR_FACILITY_WIN32
14257
      or ERROR_ALREADY_INITIALIZED;
14265
      or ERROR_ALREADY_INITIALIZED;
14258
 
14266
 
14259
(*
14267
(*
14260
 * This object does not support aggregation
14268
 * This object does not support aggregation
14261
 *)
14269
 *)
14262
  DIERR_NOAGGREGATION = CLASS_E_NOAGGREGATION;
14270
  DIERR_NOAGGREGATION = CLASS_E_NOAGGREGATION;
14263
 
14271
 
14264
(*
14272
(*
14265
 * Another app has a higher priority level, preventing this call from
14273
 * Another app has a higher priority level, preventing this call from
14266
 * succeeding.
14274
 * succeeding.
14267
 *)
14275
 *)
14268
  DIERR_OTHERAPPHASPRIO = E_ACCESSDENIED;
14276
  DIERR_OTHERAPPHASPRIO = E_ACCESSDENIED;
14269
 
14277
 
14270
(*
14278
(*
14271
 * Access to the device has been lost.  It must be re-acquired.
14279
 * Access to the device has been lost.  It must be re-acquired.
14272
 *)
14280
 *)
14273
  DIERR_INPUTLOST = SEVERITY_ERROR_FACILITY_WIN32
14281
  DIERR_INPUTLOST = SEVERITY_ERROR_FACILITY_WIN32
14274
      or ERROR_READ_FAULT;
14282
      or ERROR_READ_FAULT;
14275
 
14283
 
14276
(*
14284
(*
14277
 * The operation cannot be performed while the device is acquired.
14285
 * The operation cannot be performed while the device is acquired.
14278
 *)
14286
 *)
14279
  DIERR_ACQUIRED = SEVERITY_ERROR_FACILITY_WIN32
14287
  DIERR_ACQUIRED = SEVERITY_ERROR_FACILITY_WIN32
14280
      or ERROR_BUSY;
14288
      or ERROR_BUSY;
14281
 
14289
 
14282
(*
14290
(*
14283
 * The operation cannot be performed unless the device is acquired.
14291
 * The operation cannot be performed unless the device is acquired.
14284
 *)
14292
 *)
14285
  DIERR_NOTACQUIRED = SEVERITY_ERROR_FACILITY_WIN32
14293
  DIERR_NOTACQUIRED = SEVERITY_ERROR_FACILITY_WIN32
14286
      or ERROR_INVALID_ACCESS;
14294
      or ERROR_INVALID_ACCESS;
14287
 
14295
 
14288
(*
14296
(*
14289
 * The specified property cannot be changed.
14297
 * The specified property cannot be changed.
14290
 *)
14298
 *)
14291
  DIERR_READONLY = E_ACCESSDENIED;
14299
  DIERR_READONLY = E_ACCESSDENIED;
14292
 
14300
 
14293
(*
14301
(*
14294
 * The device already has an event notification associated with it.
14302
 * The device already has an event notification associated with it.
14295
 *)
14303
 *)
14296
  DIERR_HANDLEEXISTS = E_ACCESSDENIED;
14304
  DIERR_HANDLEEXISTS = E_ACCESSDENIED;
14297
 
14305
 
14298
(*
14306
(*
14299
 * Data is not yet available.
14307
 * Data is not yet available.
14300
 *)
14308
 *)
14301
  E_PENDING = HResult($80070007);
14309
  E_PENDING = HResult($80070007);
14302
 
14310
 
14303
(*
14311
(*
14304
 * Unable to IDirectInputJoyConfig_Acquire because the user
14312
 * Unable to IDirectInputJoyConfig_Acquire because the user
14305
 * does not have sufficient privileges to change the joystick
14313
 * does not have sufficient privileges to change the joystick
14306
 * configuration.
14314
 * configuration.
14307
 *)
14315
 *)
14308
  DIERR_INSUFFICIENTPRIVS = HResult($80040200);
14316
  DIERR_INSUFFICIENTPRIVS = HResult($80040200);
14309
 
14317
 
14310
(*
14318
(*
14311
 * The device is full.
14319
 * The device is full.
14312
 *)
14320
 *)
14313
  DIERR_DEVICEFULL = DIERR_INSUFFICIENTPRIVS + 1;
14321
  DIERR_DEVICEFULL = DIERR_INSUFFICIENTPRIVS + 1;
14314
 
14322
 
14315
(*
14323
(*
14316
 * Not all the requested information fit into the buffer.
14324
 * Not all the requested information fit into the buffer.
14317
 *)
14325
 *)
14318
  DIERR_MOREDATA = DIERR_INSUFFICIENTPRIVS + 2;
14326
  DIERR_MOREDATA = DIERR_INSUFFICIENTPRIVS + 2;
14319
 
14327
 
14320
(*
14328
(*
14321
 * The effect is not downloaded.
14329
 * The effect is not downloaded.
14322
 *)
14330
 *)
14323
  DIERR_NOTDOWNLOADED = DIERR_INSUFFICIENTPRIVS + 3;
14331
  DIERR_NOTDOWNLOADED = DIERR_INSUFFICIENTPRIVS + 3;
14324
 
14332
 
14325
(*
14333
(*
14326
 *  The device cannot be reinitialized because there are still effects
14334
 *  The device cannot be reinitialized because there are still effects
14327
 *  attached to it.
14335
 *  attached to it.
14328
 *)
14336
 *)
14329
  DIERR_HASEFFECTS = DIERR_INSUFFICIENTPRIVS + 4;
14337
  DIERR_HASEFFECTS = DIERR_INSUFFICIENTPRIVS + 4;
14330
 
14338
 
14331
(*
14339
(*
14332
 *  The operation cannot be performed unless the device is acquired
14340
 *  The operation cannot be performed unless the device is acquired
14333
 *  in DISCL_EXCLUSIVE mode.
14341
 *  in DISCL_EXCLUSIVE mode.
14334
 *)
14342
 *)
14335
  DIERR_NOTEXCLUSIVEACQUIRED = DIERR_INSUFFICIENTPRIVS + 5;
14343
  DIERR_NOTEXCLUSIVEACQUIRED = DIERR_INSUFFICIENTPRIVS + 5;
14336
 
14344
 
14337
(*
14345
(*
14338
 *  The effect could not be downloaded because essential information
14346
 *  The effect could not be downloaded because essential information
14339
 *  is missing.  For example, no axes have been associated with the
14347
 *  is missing.  For example, no axes have been associated with the
14340
 *  effect, or no type-specific information has been created.
14348
 *  effect, or no type-specific information has been created.
14341
 *)
14349
 *)
14342
  DIERR_INCOMPLETEEFFECT = DIERR_INSUFFICIENTPRIVS + 6;
14350
  DIERR_INCOMPLETEEFFECT = DIERR_INSUFFICIENTPRIVS + 6;
14343
 
14351
 
14344
(*
14352
(*
14345
 *  Attempted to read buffered device data from a device that is
14353
 *  Attempted to read buffered device data from a device that is
14346
 *  not buffered.
14354
 *  not buffered.
14347
 *)
14355
 *)
14348
  DIERR_NOTBUFFERED = DIERR_INSUFFICIENTPRIVS + 7;
14356
  DIERR_NOTBUFFERED = DIERR_INSUFFICIENTPRIVS + 7;
14349
 
14357
 
14350
(*
14358
(*
14351
 *  An attempt was made to modify parameters of an effect while it is
14359
 *  An attempt was made to modify parameters of an effect while it is
14352
 *  playing.  Not all hardware devices support altering the parameters
14360
 *  playing.  Not all hardware devices support altering the parameters
14353
 *  of an effect while it is playing.
14361
 *  of an effect while it is playing.
14354
 *)
14362
 *)
14355
  DIERR_EFFECTPLAYING = DIERR_INSUFFICIENTPRIVS + 8;
14363
  DIERR_EFFECTPLAYING = DIERR_INSUFFICIENTPRIVS + 8;
14356
 
14364
 
14357
(*
14365
(*
14358
 *  The operation could not be completed because the device is not
14366
 *  The operation could not be completed because the device is not
14359
 *  plugged in.
14367
 *  plugged in.
14360
 *)
14368
 *)
14361
  DIERR_UNPLUGGED                = $80040209;
14369
  DIERR_UNPLUGGED                = $80040209;
14362
 
14370
 
14363
(*
14371
(*
14364
 *  SendDeviceData failed because more information was requested
14372
 *  SendDeviceData failed because more information was requested
14365
 *  to be sent than can be sent to the device.  Some devices have
14373
 *  to be sent than can be sent to the device.  Some devices have
14366
 *  restrictions on how much data can be sent to them.  (For example,
14374
 *  restrictions on how much data can be sent to them.  (For example,
14367
 *  there might be a limit on the number of buttons that can be
14375
 *  there might be a limit on the number of buttons that can be
14368
 *  pressed at once.)
14376
 *  pressed at once.)
14369
 *)
14377
 *)
14370
 DIERR_REPORTFULL                = $8004020A;
14378
 DIERR_REPORTFULL                = $8004020A;
14371
 
14379
 
14372
 
14380
 
14373
(****************************************************************************
14381
(****************************************************************************
14374
 *
14382
 *
14375
 *  Definitions for non-IDirectInput (VJoyD) features defined more recently
14383
 *  Definitions for non-IDirectInput (VJoyD) features defined more recently
14376
 *  than the current sdk files
14384
 *  than the current sdk files
14377
 *
14385
 *
14378
 ****************************************************************************)
14386
 ****************************************************************************)
14379
 
14387
 
14380
(*
14388
(*
14381
 * Flag to indicate that the dwReserved2 field of the JOYINFOEX structure
14389
 * Flag to indicate that the dwReserved2 field of the JOYINFOEX structure
14382
 * contains mini-driver specific data to be passed by VJoyD to the mini-
14390
 * contains mini-driver specific data to be passed by VJoyD to the mini-
14383
 * driver instead of doing a poll.
14391
 * driver instead of doing a poll.
14384
 *)
14392
 *)
14385
  JOY_PASSDRIVERDATA          = $10000000;
14393
  JOY_PASSDRIVERDATA          = $10000000;
14386
 
14394
 
14387
(*
14395
(*
14388
 * Informs the joystick driver that the configuration has been changed
14396
 * Informs the joystick driver that the configuration has been changed
14389
 * and should be reloaded from the registery.
14397
 * and should be reloaded from the registery.
14390
 * dwFlags is reserved and should be set to zero
14398
 * dwFlags is reserved and should be set to zero
14391
 *)
14399
 *)
14392
 
14400
 
14393
function joyConfigChanged(dwFlags: DWORD) : MMRESULT; stdcall;
14401
function joyConfigChanged(dwFlags: DWORD) : MMRESULT; stdcall;
14394
 
14402
 
14395
const
14403
const
14396
(*
14404
(*
14397
 * Hardware Setting indicating that the device is a headtracker
14405
 * Hardware Setting indicating that the device is a headtracker
14398
 *)
14406
 *)
14399
  JOY_HWS_ISHEADTRACKER       = $02000000;
14407
  JOY_HWS_ISHEADTRACKER       = $02000000;
14400
 
14408
 
14401
(*
14409
(*
14402
 * Hardware Setting indicating that the VxD is used to replace
14410
 * Hardware Setting indicating that the VxD is used to replace
14403
 * the standard analog polling
14411
 * the standard analog polling
14404
 *)
14412
 *)
14405
  JOY_HWS_ISGAMEPORTDRIVER    = $04000000;
14413
  JOY_HWS_ISGAMEPORTDRIVER    = $04000000;
14406
 
14414
 
14407
(*
14415
(*
14408
 * Hardware Setting indicating that the driver needs a standard
14416
 * Hardware Setting indicating that the driver needs a standard
14409
 * gameport in order to communicate with the device.
14417
 * gameport in order to communicate with the device.
14410
 *)
14418
 *)
14411
  JOY_HWS_ISANALOGPORTDRIVER  = $08000000;
14419
  JOY_HWS_ISANALOGPORTDRIVER  = $08000000;
14412
 
14420
 
14413
(*
14421
(*
14414
 * Hardware Setting indicating that VJoyD should not load this
14422
 * Hardware Setting indicating that VJoyD should not load this
14415
 * driver, it will be loaded externally and will register with
14423
 * driver, it will be loaded externally and will register with
14416
 * VJoyD of it's own accord.
14424
 * VJoyD of it's own accord.
14417
 *)
14425
 *)
14418
  JOY_HWS_AUTOLOAD            = $10000000;
14426
  JOY_HWS_AUTOLOAD            = $10000000;
14419
 
14427
 
14420
(*
14428
(*
14421
 * Hardware Setting indicating that the driver acquires any
14429
 * Hardware Setting indicating that the driver acquires any
14422
 * resources needed without needing a devnode through VJoyD.
14430
 * resources needed without needing a devnode through VJoyD.
14423
 *)
14431
 *)
14424
  JOY_HWS_NODEVNODE           = $20000000;
14432
  JOY_HWS_NODEVNODE           = $20000000;
14425
 
14433
 
14426
(*
14434
(*
14427
 * Hardware Setting indicating that the device is a gameport bus
14435
 * Hardware Setting indicating that the device is a gameport bus
14428
 *)
14436
 *)
14429
  JOY_HWS_ISGAMEPORTBUS       = $80000000;
14437
  JOY_HWS_ISGAMEPORTBUS       = $80000000;
14430
  JOY_HWS_GAMEPORTBUSBUSY     = $00000001;
14438
  JOY_HWS_GAMEPORTBUSBUSY     = $00000001;
14431
 
14439
 
14432
//from older Verion:
14440
//from older Verion:
14433
(*
14441
(*
14434
 * Hardware Setting indicating that the VxD can be used as
14442
 * Hardware Setting indicating that the VxD can be used as
14435
 * a port 201h emulator.
14443
 * a port 201h emulator.
14436
 *)
14444
 *)
14437
  JOY_HWS_ISGAMEPORTEMULATOR  = $40000000;
14445
  JOY_HWS_ISGAMEPORTEMULATOR  = $40000000;
14438
 
14446
 
14439
 
14447
 
14440
(*
14448
(*
14441
 * Usage Setting indicating that the settings are volatile and
14449
 * Usage Setting indicating that the settings are volatile and
14442
 * should be removed if still present on a reboot.
14450
 * should be removed if still present on a reboot.
14443
 *)
14451
 *)
14444
  JOY_US_VOLATILE             = $00000008;
14452
  JOY_US_VOLATILE             = $00000008;
14445
 
14453
 
14446
(****************************************************************************
14454
(****************************************************************************
14447
 *
14455
 *
14448
 *  Definitions for non-IDirectInput (VJoyD) features defined more recently
14456
 *  Definitions for non-IDirectInput (VJoyD) features defined more recently
14449
 *  than the current ddk files
14457
 *  than the current ddk files
14450
 *
14458
 *
14451
 ****************************************************************************)
14459
 ****************************************************************************)
14452
 
14460
 
14453
(*
14461
(*
14454
 * Poll type in which the do_other field of the JOYOEMPOLLDATA
14462
 * Poll type in which the do_other field of the JOYOEMPOLLDATA
14455
 * structure contains mini-driver specific data passed from an app.
14463
 * structure contains mini-driver specific data passed from an app.
14456
 *)
14464
 *)
14457
  JOY_OEMPOLL_PASSDRIVERDATA  = 7;
14465
  JOY_OEMPOLL_PASSDRIVERDATA  = 7;
14458
 
14466
 
-
 
14467
{$IFDEF UseDirectPlay} // Daniel Marschall 12.04.2024 Added to avoid Windows showing "This app requires DirectPlay"
14459
//DirectPlay file
14468
//DirectPlay file
14460
 
14469
 
14461
(*==========================================================================;
14470
(*==========================================================================;
14462
 *
14471
 *
14463
 *  Copyright (C) Microsoft Corporation.  All Rights Reserved.
14472
 *  Copyright (C) Microsoft Corporation.  All Rights Reserved.
14464
 *
14473
 *
14465
 *  File:       dplay.h dplobby.h
14474
 *  File:       dplay.h dplobby.h
14466
 *  Content:    DirectPlay include files
14475
 *  Content:    DirectPlay include files
14467
 *
14476
 *
14468
 *  DirectX 7 Delphi adaptation by Erik Unger
14477
 *  DirectX 7 Delphi adaptation by Erik Unger
14469
 *
14478
 *
14470
 *  Modified: 4-Jun-2000
14479
 *  Modified: 4-Jun-2000
14471
 *
14480
 *
14472
 *  Download: http://www.delphi-jedi.org/DelphiGraphics/
14481
 *  Download: http://www.delphi-jedi.org/DelphiGraphics/
14473
 *  E-Mail: DelphiDirectX@next-reality.com
14482
 *  E-Mail: DelphiDirectX@next-reality.com
14474
 *
14483
 *
14475
 ***************************************************************************)
14484
 ***************************************************************************)
14476
 
14485
 
14477
var
14486
var
14478
  DPlayDLL : HMODULE = 0;
14487
  DPlayDLL : HMODULE = 0;
14479
 
14488
 
14480
(*==========================================================================;
14489
(*==========================================================================;
14481
 *
14490
 *
14482
 *  Copyright (C) 1994-1997 Microsoft Corporation.  All Rights Reserved.
14491
 *  Copyright (C) 1994-1997 Microsoft Corporation.  All Rights Reserved.
14483
 *
14492
 *
14484
 *  File:       dplay.h
14493
 *  File:       dplay.h
14485
 *  Content:    DirectPlay include file
14494
 *  Content:    DirectPlay include file
14486
 *
14495
 *
14487
 ***************************************************************************)
14496
 ***************************************************************************)
14488
 
14497
 
14489
function DPErrorString(Value: HResult) : string;
14498
function DPErrorString(Value: HResult) : string;
14490
 
14499
 
14491
const
14500
const
14492
// {D1EB6D20-8923-11d0-9D97-00A0C90A43CB}
14501
// {D1EB6D20-8923-11d0-9D97-00A0C90A43CB}
14493
  CLSID_DirectPlay: TGUID =
14502
  CLSID_DirectPlay: TGUID =
14494
      (D1:$d1eb6d20;D2:$8923;D3:$11d0;D4:($9d,$97,$00,$a0,$c9,$a,$43,$cb));
14503
      (D1:$d1eb6d20;D2:$8923;D3:$11d0;D4:($9d,$97,$00,$a0,$c9,$a,$43,$cb));
14495
 
14504
 
14496
(*
14505
(*
14497
 * GUIDS used by Service Providers shipped with DirectPlay
14506
 * GUIDS used by Service Providers shipped with DirectPlay
14498
 * Use these to identify Service Provider returned by EnumConnections
14507
 * Use these to identify Service Provider returned by EnumConnections
14499
 *)
14508
 *)
14500
 
14509
 
14501
// GUID for IPX service provider
14510
// GUID for IPX service provider
14502
// {685BC400-9D2C-11cf-A9CD-00AA006886E3}
14511
// {685BC400-9D2C-11cf-A9CD-00AA006886E3}
14503
  DPSPGUID_IPX: TGUID =
14512
  DPSPGUID_IPX: TGUID =
14504
      (D1:$685bc400;D2:$9d2c;D3:$11cf;D4:($a9,$cd,$00,$aa,$00,$68,$86,$e3));
14513
      (D1:$685bc400;D2:$9d2c;D3:$11cf;D4:($a9,$cd,$00,$aa,$00,$68,$86,$e3));
14505
 
14514
 
14506
// GUID for TCP/IP service provider
14515
// GUID for TCP/IP service provider
14507
// 36E95EE0-8577-11cf-960C-0080C7534E82
14516
// 36E95EE0-8577-11cf-960C-0080C7534E82
14508
  DPSPGUID_TCPIP: TGUID =
14517
  DPSPGUID_TCPIP: TGUID =
14509
      (D1:$36E95EE0;D2:$8577;D3:$11cf;D4:($96,$0c,$00,$80,$c7,$53,$4e,$82));
14518
      (D1:$36E95EE0;D2:$8577;D3:$11cf;D4:($96,$0c,$00,$80,$c7,$53,$4e,$82));
14510
 
14519
 
14511
// GUID for Serial service provider
14520
// GUID for Serial service provider
14512
// {0F1D6860-88D9-11cf-9C4E-00A0C905425E}
14521
// {0F1D6860-88D9-11cf-9C4E-00A0C905425E}
14513
  DPSPGUID_SERIAL: TGUID =
14522
  DPSPGUID_SERIAL: TGUID =
14514
      (D1:$f1d6860;D2:$88d9;D3:$11cf;D4:($9c,$4e,$00,$a0,$c9,$05,$42,$5e));
14523
      (D1:$f1d6860;D2:$88d9;D3:$11cf;D4:($9c,$4e,$00,$a0,$c9,$05,$42,$5e));
14515
 
14524
 
14516
// GUID for Modem service provider
14525
// GUID for Modem service provider
14517
// {44EAA760-CB68-11cf-9C4E-00A0C905425E}
14526
// {44EAA760-CB68-11cf-9C4E-00A0C905425E}
14518
  DPSPGUID_MODEM: TGUID =
14527
  DPSPGUID_MODEM: TGUID =
14519
      (D1:$44eaa760;D2:$cb68;D3:$11cf;D4:($9c,$4e,$00,$a0,$c9,$05,$42,$5e));
14528
      (D1:$44eaa760;D2:$cb68;D3:$11cf;D4:($9c,$4e,$00,$a0,$c9,$05,$42,$5e));
14520
 
14529
 
14521
 
14530
 
14522
(****************************************************************************
14531
(****************************************************************************
14523
 *
14532
 *
14524
 * DirectPlay Structures
14533
 * DirectPlay Structures
14525
 *
14534
 *
14526
 * Various structures used to invoke DirectPlay.
14535
 * Various structures used to invoke DirectPlay.
14527
 *
14536
 *
14528
 ****************************************************************************)
14537
 ****************************************************************************)
14529
 
14538
 
14530
type
14539
type
14531
{$IFDEF UNICODE}
-
 
14532
  PCharAW = PWideChar;
-
 
14533
{$ELSE}
-
 
14534
  PCharAW = PAnsiChar;
-
 
14535
{$ENDIF}
-
 
14536
(*
14540
 (*
14537
 * TDPID
14541
 * TDPID
14538
 * DirectPlay player and group ID
14542
 * DirectPlay player and group ID
14539
 *)
14543
 *)
14540
  TDPID = DWORD;
14544
  TDPID = DWORD;
14541
  PDPID = ^TDPID;
14545
  PDPID = ^TDPID;
14542
 
14546
 
14543
 
14547
 
14544
const
14548
const
14545
(*
14549
(*
14546
 * DPID that system messages come from
14550
 * DPID that system messages come from
14547
 *)
14551
 *)
14548
  DPID_SYSMSG = 0;
14552
  DPID_SYSMSG = 0;
14549
 
14553
 
14550
(*
14554
(*
14551
 * DPID representing all players in the session
14555
 * DPID representing all players in the session
14552
 *)
14556
 *)
14553
  DPID_ALLPLAYERS = 0;
14557
  DPID_ALLPLAYERS = 0;
14554
 
14558
 
14555
(*
14559
(*
14556
 * DPID representing the server player
14560
 * DPID representing the server player
14557
 *)
14561
 *)
14558
  DPID_SERVERPLAYER = 1;
14562
  DPID_SERVERPLAYER = 1;
14559
 
14563
 
14560
(*
14564
(*
14561
 * DPID representing the maximum ID in the range of DPID's reserved for
14565
 * DPID representing the maximum ID in the range of DPID's reserved for
14562
 * use by DirectPlay.
14566
 * use by DirectPlay.
14563
 *)
14567
 *)
14564
  DPID_RESERVEDRANGE = 100;
14568
  DPID_RESERVEDRANGE = 100;
14565
 
14569
 
14566
(*
14570
(*
14567
 * The player ID is unknown (used with e.g. DPSESSION_NOMESSAGEID)
14571
 * The player ID is unknown (used with e.g. DPSESSION_NOMESSAGEID)
14568
 *)
14572
 *)
14569
  DPID_UNKNOWN = $FFFFFFFF;
14573
  DPID_UNKNOWN = $FFFFFFFF;
14570
 
14574
 
14571
type
14575
type
14572
(*
14576
(*
14573
 * DPCAPS
14577
 * DPCAPS
14574
 * Used to obtain the capabilities of a DirectPlay object
14578
 * Used to obtain the capabilities of a DirectPlay object
14575
 *)
14579
 *)
14576
  PDPCaps = ^TDPCaps;
14580
  PDPCaps = ^TDPCaps;
14577
  TDPCaps = packed record
14581
  TDPCaps = packed record
14578
    dwSize: DWORD;              // Size of structure, in bytes
14582
    dwSize: DWORD;              // Size of structure, in bytes
14579
    dwFlags: DWORD;             // DPCAPS_xxx flags
14583
    dwFlags: DWORD;             // DPCAPS_xxx flags
14580
    dwMaxBufferSize: DWORD;     // Maximum message size, in bytes,  for this service provider
14584
    dwMaxBufferSize: DWORD;     // Maximum message size, in bytes,  for this service provider
14581
    dwMaxQueueSize: DWORD;      // Obsolete.
14585
    dwMaxQueueSize: DWORD;      // Obsolete.
14582
    dwMaxPlayers: DWORD;        // Maximum players/groups (local + remote)
14586
    dwMaxPlayers: DWORD;        // Maximum players/groups (local + remote)
14583
    dwHundredBaud: DWORD;       // Bandwidth in 100 bits per second units;
14587
    dwHundredBaud: DWORD;       // Bandwidth in 100 bits per second units;
14584
                                // i.e. 24 is 2400, 96 is 9600, etc.
14588
                                // i.e. 24 is 2400, 96 is 9600, etc.
14585
    dwLatency: DWORD;           // Estimated latency; 0 = unknown
14589
    dwLatency: DWORD;           // Estimated latency; 0 = unknown
14586
    dwMaxLocalPlayers: DWORD;   // Maximum # of locally created players allowed
14590
    dwMaxLocalPlayers: DWORD;   // Maximum # of locally created players allowed
14587
    dwHeaderLength: DWORD;      // Maximum header length, in bytes, on messages
14591
    dwHeaderLength: DWORD;      // Maximum header length, in bytes, on messages
14588
                                // added by the service provider
14592
                                // added by the service provider
14589
    dwTimeout: DWORD;           // Service provider's suggested timeout value
14593
    dwTimeout: DWORD;           // Service provider's suggested timeout value
14590
                                // This is how long DirectPlay will wait for
14594
                                // This is how long DirectPlay will wait for
14591
                                // responses to system messages
14595
                                // responses to system messages
14592
  end;
14596
  end;
14593
 
14597
 
14594
const
14598
const
14595
(*
14599
(*
14596
 * This DirectPlay object is the session host.  If the host exits the
14600
 * This DirectPlay object is the session host.  If the host exits the
14597
 * session, another application will become the host and receive a
14601
 * session, another application will become the host and receive a
14598
 * DPSYS_HOST system message.
14602
 * DPSYS_HOST system message.
14599
 *)
14603
 *)
14600
  DPCAPS_ISHOST = $00000002;
14604
  DPCAPS_ISHOST = $00000002;
14601
 
14605
 
14602
(*
14606
(*
14603
 * The service provider bound to this DirectPlay object can optimize
14607
 * The service provider bound to this DirectPlay object can optimize
14604
 * group messaging.
14608
 * group messaging.
14605
 *)
14609
 *)
14606
  DPCAPS_GROUPOPTIMIZED = $00000008;
14610
  DPCAPS_GROUPOPTIMIZED = $00000008;
14607
 
14611
 
14608
(*
14612
(*
14609
 * The service provider bound to this DirectPlay object can optimize
14613
 * The service provider bound to this DirectPlay object can optimize
14610
 * keep alives (see DPSESSION_KEEPALIVE)
14614
 * keep alives (see DPSESSION_KEEPALIVE)
14611
 *)
14615
 *)
14612
  DPCAPS_KEEPALIVEOPTIMIZED = $00000010;
14616
  DPCAPS_KEEPALIVEOPTIMIZED = $00000010;
14613
 
14617
 
14614
(*
14618
(*
14615
 * The service provider bound to this DirectPlay object can optimize
14619
 * The service provider bound to this DirectPlay object can optimize
14616
 * guaranteed message delivery.
14620
 * guaranteed message delivery.
14617
 *)
14621
 *)
14618
  DPCAPS_GUARANTEEDOPTIMIZED = $00000020;
14622
  DPCAPS_GUARANTEEDOPTIMIZED = $00000020;
14619
 
14623
 
14620
(*
14624
(*
14621
 * This DirectPlay object supports guaranteed message delivery.
14625
 * This DirectPlay object supports guaranteed message delivery.
14622
 *)
14626
 *)
14623
  DPCAPS_GUARANTEEDSUPPORTED = $00000040;
14627
  DPCAPS_GUARANTEEDSUPPORTED = $00000040;
14624
 
14628
 
14625
(*
14629
(*
14626
 * This DirectPlay object supports digital signing of messages.
14630
 * This DirectPlay object supports digital signing of messages.
14627
 *)
14631
 *)
14628
  DPCAPS_SIGNINGSUPPORTED = $00000080;
14632
  DPCAPS_SIGNINGSUPPORTED = $00000080;
14629
 
14633
 
14630
(*
14634
(*
14631
 * This DirectPlay object supports encryption of messages.
14635
 * This DirectPlay object supports encryption of messages.
14632
 *)
14636
 *)
14633
  DPCAPS_ENCRYPTIONSUPPORTED = $00000100;
14637
  DPCAPS_ENCRYPTIONSUPPORTED = $00000100;
14634
 
14638
 
14635
(*
14639
(*
14636
 * This DirectPlay player was created on this machine
14640
 * This DirectPlay player was created on this machine
14637
 *)
14641
 *)
14638
  DPPLAYERCAPS_LOCAL = $00000800;
14642
  DPPLAYERCAPS_LOCAL = $00000800;
14639
 
14643
 
14640
(*
14644
(*
14641
 * Current Open settings supports all forms of Cancel
14645
 * Current Open settings supports all forms of Cancel
14642
 *)
14646
 *)
14643
  DPCAPS_ASYNCCANCELSUPPORTED = $00001000;
14647
  DPCAPS_ASYNCCANCELSUPPORTED = $00001000;
14644
 
14648
 
14645
(*
14649
(*
14646
 * Current Open settings supports CancelAll, but not Cancel
14650
 * Current Open settings supports CancelAll, but not Cancel
14647
 *)
14651
 *)
14648
  DPCAPS_ASYNCCANCELALLSUPPORTED = $00002000;
14652
  DPCAPS_ASYNCCANCELALLSUPPORTED = $00002000;
14649
 
14653
 
14650
(*
14654
(*
14651
 * Current Open settings supports Send Timeouts for sends
14655
 * Current Open settings supports Send Timeouts for sends
14652
 *)
14656
 *)
14653
  DPCAPS_SENDTIMEOUTSUPPORTED = $00004000;
14657
  DPCAPS_SENDTIMEOUTSUPPORTED = $00004000;
14654
 
14658
 
14655
(*
14659
(*
14656
 * Current Open settings supports send priority
14660
 * Current Open settings supports send priority
14657
 *)
14661
 *)
14658
  DPCAPS_SENDPRIORITYSUPPORTED = $00008000;
14662
  DPCAPS_SENDPRIORITYSUPPORTED = $00008000;
14659
 
14663
 
14660
(*
14664
(*
14661
 * Current Open settings supports DPSEND_ASYNC flag
14665
 * Current Open settings supports DPSEND_ASYNC flag
14662
 *)
14666
 *)
14663
  DPCAPS_ASYNCSUPPORTED = $00010000;
14667
  DPCAPS_ASYNCSUPPORTED = $00010000;
14664
 
14668
 
14665
type
14669
type
14666
(*
14670
(*
14667
 * TDPSessionDesc2
14671
 * TDPSessionDesc2
14668
 * Used to describe the properties of a DirectPlay
14672
 * Used to describe the properties of a DirectPlay
14669
 * session instance
14673
 * session instance
14670
 *)
14674
 *)
14671
  PDPSessionDesc2 = ^TDPSessionDesc2;
14675
  PDPSessionDesc2 = ^TDPSessionDesc2;
14672
  TDPSessionDesc2 = packed record
14676
  TDPSessionDesc2 = packed record
14673
    dwSize: DWORD;             // Size of structure
14677
    dwSize: DWORD;             // Size of structure
14674
    dwFlags: DWORD;            // DPSESSION_xxx flags
14678
    dwFlags: DWORD;            // DPSESSION_xxx flags
14675
    guidInstance: TGUID;       // ID for the session instance
14679
    guidInstance: TGUID;       // ID for the session instance
14676
    guidApplication: TGUID;    // GUID of the DirectPlay application.
14680
    guidApplication: TGUID;    // GUID of the DirectPlay application.
14677
                               // GUID_NULL for all applications.
14681
                               // GUID_NULL for all applications.
14678
    dwMaxPlayers: DWORD;       // Maximum # players allowed in session
14682
    dwMaxPlayers: DWORD;       // Maximum # players allowed in session
14679
    dwCurrentPlayers: DWORD;   // Current # players in session (read only)
14683
    dwCurrentPlayers: DWORD;   // Current # players in session (read only)
14680
    case integer of
14684
    case integer of
14681
      0 : (
14685
      0 : (
14682
    lpszSessionName: PCharAW;  // Name of the session
14686
    lpszSessionName: PCharAW;  // Name of the session
14683
    lpszPassword: PCharAW;     // Password of the session (optional)
14687
    lpszPassword: PCharAW;     // Password of the session (optional)
14684
    dwReserved1: DWORD;        // Reserved for future MS use.
14688
    dwReserved1: DWORD;        // Reserved for future MS use.
14685
    dwReserved2: DWORD;
14689
    dwReserved2: DWORD;
14686
    dwUser1: DWORD;            // For use by the application
14690
    dwUser1: DWORD;            // For use by the application
14687
    dwUser2: DWORD;
14691
    dwUser2: DWORD;
14688
    dwUser3: DWORD;
14692
    dwUser3: DWORD;
14689
    dwUser4: DWORD;
14693
    dwUser4: DWORD;
14690
      );
14694
      );
14691
      1 : (
14695
      1 : (
14692
    lpszSessionNameA: PAnsiChar;   // Name of the session
14696
    lpszSessionNameA: PAnsiChar;   // Name of the session
14693
    lpszPasswordA: PAnsiChar       // Password of the session (optional)
14697
    lpszPasswordA: PAnsiChar       // Password of the session (optional)
14694
      );
14698
      );
14695
      2 : (
14699
      2 : (
14696
    lpszSessionNameW: PWideChar;
14700
    lpszSessionNameW: PWideChar;
14697
    lpszPasswordW: PWideChar
14701
    lpszPasswordW: PWideChar
14698
      );
14702
      );
14699
  end;
14703
  end;
14700
 
14704
 
14701
const
14705
const
14702
(*
14706
(*
14703
 * Applications cannot create new players in this session.
14707
 * Applications cannot create new players in this session.
14704
 *)
14708
 *)
14705
  DPSESSION_NEWPLAYERSDISABLED = $00000001;
14709
  DPSESSION_NEWPLAYERSDISABLED = $00000001;
14706
 
14710
 
14707
(*
14711
(*
14708
 * If the DirectPlay object that created the session, the host,
14712
 * If the DirectPlay object that created the session, the host,
14709
 * quits, then the host will attempt to migrate to another
14713
 * quits, then the host will attempt to migrate to another
14710
 * DirectPlay object so that new players can continue to be created
14714
 * DirectPlay object so that new players can continue to be created
14711
 * and new applications can join the session.
14715
 * and new applications can join the session.
14712
 *)
14716
 *)
14713
  DPSESSION_MIGRATEHOST = $00000004;
14717
  DPSESSION_MIGRATEHOST = $00000004;
14714
 
14718
 
14715
(*
14719
(*
14716
 * This flag tells DirectPlay not to set the idPlayerTo and idPlayerFrom
14720
 * This flag tells DirectPlay not to set the idPlayerTo and idPlayerFrom
14717
 * fields in player messages.  This cuts two DWORD's off the message
14721
 * fields in player messages.  This cuts two DWORD's off the message
14718
 * overhead.
14722
 * overhead.
14719
 *)
14723
 *)
14720
  DPSESSION_NOMESSAGEID = $00000008;
14724
  DPSESSION_NOMESSAGEID = $00000008;
14721
 
14725
 
14722
(*
14726
(*
14723
 * This flag tells DirectPlay to not allow any new applications to
14727
 * This flag tells DirectPlay to not allow any new applications to
14724
 * join the session.  Applications already in the session can still
14728
 * join the session.  Applications already in the session can still
14725
 * create new players.
14729
 * create new players.
14726
 *)
14730
 *)
14727
  DPSESSION_JOINDISABLED = $00000020;
14731
  DPSESSION_JOINDISABLED = $00000020;
14728
 
14732
 
14729
(*
14733
(*
14730
 * This flag tells DirectPlay to detect when remote players
14734
 * This flag tells DirectPlay to detect when remote players
14731
 * exit abnormally (e.g. their computer or modem gets unplugged)
14735
 * exit abnormally (e.g. their computer or modem gets unplugged)
14732
 *)
14736
 *)
14733
  DPSESSION_KEEPALIVE = $00000040;
14737
  DPSESSION_KEEPALIVE = $00000040;
14734
 
14738
 
14735
(*
14739
(*
14736
 * This flag tells DirectPlay not to send a message to all players
14740
 * This flag tells DirectPlay not to send a message to all players
14737
 * when a players remote data changes
14741
 * when a players remote data changes
14738
 *)
14742
 *)
14739
  DPSESSION_NODATAMESSAGES = $00000080;
14743
  DPSESSION_NODATAMESSAGES = $00000080;
14740
 
14744
 
14741
(*
14745
(*
14742
 * This flag indicates that the session belongs to a secure server
14746
 * This flag indicates that the session belongs to a secure server
14743
 * and needs user authentication
14747
 * and needs user authentication
14744
 *)
14748
 *)
14745
  DPSESSION_SECURESERVER = $00000100;
14749
  DPSESSION_SECURESERVER = $00000100;
14746
 
14750
 
14747
(*
14751
(*
14748
 * This flag indicates that the session is private and requirs a password
14752
 * This flag indicates that the session is private and requirs a password
14749
 * for EnumSessions as well as Open.
14753
 * for EnumSessions as well as Open.
14750
 *)
14754
 *)
14751
  DPSESSION_PRIVATE = $00000200;
14755
  DPSESSION_PRIVATE = $00000200;
14752
 
14756
 
14753
(*
14757
(*
14754
 * This flag indicates that the session requires a password for joining.
14758
 * This flag indicates that the session requires a password for joining.
14755
 *)
14759
 *)
14756
  DPSESSION_PASSWORDREQUIRED = $00000400;
14760
  DPSESSION_PASSWORDREQUIRED = $00000400;
14757
 
14761
 
14758
(*
14762
(*
14759
 * This flag tells DirectPlay to route all messages through the server
14763
 * This flag tells DirectPlay to route all messages through the server
14760
 *)
14764
 *)
14761
  DPSESSION_MULTICASTSERVER = $00000800;
14765
  DPSESSION_MULTICASTSERVER = $00000800;
14762
 
14766
 
14763
(*
14767
(*
14764
 * This flag tells DirectPlay to only download information about the
14768
 * This flag tells DirectPlay to only download information about the
14765
 * DPPLAYER_SERVERPLAYER.
14769
 * DPPLAYER_SERVERPLAYER.
14766
 *)
14770
 *)
14767
  DPSESSION_CLIENTSERVER = $00001000;
14771
  DPSESSION_CLIENTSERVER = $00001000;
14768
 
14772
 
14769
(*
14773
(*
14770
 * This flag tells DirectPlay to use the protocol built into dplay
14774
 * This flag tells DirectPlay to use the protocol built into dplay
14771
 * for reliability and statistics all the time.  When this bit is
14775
 * for reliability and statistics all the time.  When this bit is
14772
 * set, only other sessions with this bit set can join or be joined.
14776
 * set, only other sessions with this bit set can join or be joined.
14773
 *)
14777
 *)
14774
  DPSESSION_DIRECTPLAYPROTOCOL = $00002000;
14778
  DPSESSION_DIRECTPLAYPROTOCOL = $00002000;
14775
 
14779
 
14776
(*
14780
(*
14777
 * This flag tells DirectPlay that preserving order of received
14781
 * This flag tells DirectPlay that preserving order of received
14778
 * packets is not important, when using reliable delivery.  This
14782
 * packets is not important, when using reliable delivery.  This
14779
 * will allow messages to be indicated out of order if preceding
14783
 * will allow messages to be indicated out of order if preceding
14780
 * messages have not yet arrived.  Otherwise DPLAY will wait for
14784
 * messages have not yet arrived.  Otherwise DPLAY will wait for
14781
 * earlier messages before delivering later reliable messages.
14785
 * earlier messages before delivering later reliable messages.
14782
 *)
14786
 *)
14783
  DPSESSION_NOPRESERVEORDER = $00004000;
14787
  DPSESSION_NOPRESERVEORDER = $00004000;
14784
 
14788
 
14785
 
14789
 
14786
(*
14790
(*
14787
 * This flag tells DirectPlay to optimize communication for latency
14791
 * This flag tells DirectPlay to optimize communication for latency
14788
 *)
14792
 *)
14789
  DPSESSION_OPTIMIZELATENCY = $00008000;
14793
  DPSESSION_OPTIMIZELATENCY = $00008000;
14790
 
14794
 
14791
type
14795
type
14792
(*
14796
(*
14793
 * TDPName
14797
 * TDPName
14794
 * Used to hold the name of a DirectPlay entity
14798
 * Used to hold the name of a DirectPlay entity
14795
 * like a player or a group
14799
 * like a player or a group
14796
 *)
14800
 *)
14797
  PDPName = ^TDPName;
14801
  PDPName = ^TDPName;
14798
  TDPName = packed record
14802
  TDPName = packed record
14799
    dwSize: DWORD;    // Size of structure
14803
    dwSize: DWORD;    // Size of structure
14800
    dwFlags: DWORD;   // Not used. Must be zero.
14804
    dwFlags: DWORD;   // Not used. Must be zero.
14801
    case Integer of
14805
    case Integer of
14802
      0 : (
14806
      0 : (
14803
    lpszShortName : PCharAW; // The short or friendly name
14807
    lpszShortName : PCharAW; // The short or friendly name
14804
    lpszLongName : PCharAW;  // The long or formal name
14808
    lpszLongName : PCharAW;  // The long or formal name
14805
      );
14809
      );
14806
      1 : (
14810
      1 : (
14807
    lpszShortNameA : PAnsiChar;
14811
    lpszShortNameA : PAnsiChar;
14808
    lpszLongNameA : PAnsiChar;
14812
    lpszLongNameA : PAnsiChar;
14809
      );
14813
      );
14810
      2 : (
14814
      2 : (
14811
    lpszShortNameW : PWideChar;
14815
    lpszShortNameW : PWideChar;
14812
    lpszLongNameW : PWideChar;
14816
    lpszLongNameW : PWideChar;
14813
      );
14817
      );
14814
  end;
14818
  end;
14815
 
14819
 
14816
(*
14820
(*
14817
 * TDPCredentials
14821
 * TDPCredentials
14818
 * Used to hold the user name and password of a DirectPlay user
14822
 * Used to hold the user name and password of a DirectPlay user
14819
 *)
14823
 *)
14820
 
14824
 
14821
  PDPCredentials = ^TDPCredentials;
14825
  PDPCredentials = ^TDPCredentials;
14822
  TDPCredentials = packed record
14826
  TDPCredentials = packed record
14823
    dwSize: DWORD;    // Size of structure
14827
    dwSize: DWORD;    // Size of structure
14824
    dwFlags: DWORD;   // Not used. Must be zero.
14828
    dwFlags: DWORD;   // Not used. Must be zero.
14825
    case Integer of
14829
    case Integer of
14826
      0 : (
14830
      0 : (
14827
    lpszUsername: PCharAW;   // User name of the account
14831
    lpszUsername: PCharAW;   // User name of the account
14828
    lpszPassword: PCharAW;   // Password of the account
14832
    lpszPassword: PCharAW;   // Password of the account
14829
    lpszDomain:   PCharAW;   // Domain name of the account
14833
    lpszDomain:   PCharAW;   // Domain name of the account
14830
      );
14834
      );
14831
      1 : (
14835
      1 : (
14832
    lpszUsernameA: PAnsiChar;   // User name of the account
14836
    lpszUsernameA: PAnsiChar;   // User name of the account
14833
    lpszPasswordA: PAnsiChar;   // Password of the account
14837
    lpszPasswordA: PAnsiChar;   // Password of the account
14834
    lpszDomainA:   PAnsiChar;   // Domain name of the account
14838
    lpszDomainA:   PAnsiChar;   // Domain name of the account
14835
      );
14839
      );
14836
      2 : (
14840
      2 : (
14837
    lpszUsernameW: PWideChar;   // User name of the account
14841
    lpszUsernameW: PWideChar;   // User name of the account
14838
    lpszPasswordW: PWideChar;   // Password of the account
14842
    lpszPasswordW: PWideChar;   // Password of the account
14839
    lpszDomainW:   PWideChar;   // Domain name of the account
14843
    lpszDomainW:   PWideChar;   // Domain name of the account
14840
      );
14844
      );
14841
  end;
14845
  end;
14842
 
14846
 
14843
(*
14847
(*
14844
 * TDPSecurityDesc
14848
 * TDPSecurityDesc
14845
 * Used to describe the security properties of a DirectPlay
14849
 * Used to describe the security properties of a DirectPlay
14846
 * session instance
14850
 * session instance
14847
 *)
14851
 *)
14848
  PDPSecurityDesc = ^TDPSecurityDesc;
14852
  PDPSecurityDesc = ^TDPSecurityDesc;
14849
  TDPSecurityDesc = packed record
14853
  TDPSecurityDesc = packed record
14850
    dwSize: DWORD;                  // Size of structure
14854
    dwSize: DWORD;                  // Size of structure
14851
    dwFlags: DWORD;                 // Not used. Must be zero.
14855
    dwFlags: DWORD;                 // Not used. Must be zero.
14852
    case Integer of
14856
    case Integer of
14853
      0 : (
14857
      0 : (
14854
    lpszSSPIProvider : PCharAW;  // SSPI provider name
14858
    lpszSSPIProvider : PCharAW;  // SSPI provider name
14855
    lpszCAPIProvider : PCharAW;  // CAPI provider name
14859
    lpszCAPIProvider : PCharAW;  // CAPI provider name
14856
    dwCAPIProviderType: DWORD;      // Crypto Service Provider type
14860
    dwCAPIProviderType: DWORD;      // Crypto Service Provider type
14857
    dwEncryptionAlgorithm: DWORD;   // Encryption Algorithm type
14861
    dwEncryptionAlgorithm: DWORD;   // Encryption Algorithm type
14858
      );
14862
      );
14859
      1 : (
14863
      1 : (
14860
    lpszSSPIProviderA : PAnsiChar;  // SSPI provider name
14864
    lpszSSPIProviderA : PAnsiChar;  // SSPI provider name
14861
    lpszCAPIProviderA : PAnsiChar;  // CAPI provider name
14865
    lpszCAPIProviderA : PAnsiChar;  // CAPI provider name
14862
      );
14866
      );
14863
      2 : (
14867
      2 : (
14864
    lpszSSPIProviderW : PWideChar;  // SSPI provider name
14868
    lpszSSPIProviderW : PWideChar;  // SSPI provider name
14865
    lpszCAPIProviderW : PWideChar;  // CAPI provider name
14869
    lpszCAPIProviderW : PWideChar;  // CAPI provider name
14866
      );
14870
      );
14867
  end;
14871
  end;
14868
 
14872
 
14869
(*
14873
(*
14870
 * DPACCOUNTDESC
14874
 * DPACCOUNTDESC
14871
 * Used to describe a user membership account
14875
 * Used to describe a user membership account
14872
 *)
14876
 *)
14873
 
14877
 
14874
  PDPAccountDesc = ^TDPAccountDesc;
14878
  PDPAccountDesc = ^TDPAccountDesc;
14875
  TDPAccountDesc = packed record
14879
  TDPAccountDesc = packed record
14876
    dwSize: DWORD;    // Size of structure
14880
    dwSize: DWORD;    // Size of structure
14877
    dwFlags: DWORD;   // Not used. Must be zero.
14881
    dwFlags: DWORD;   // Not used. Must be zero.
14878
    case Integer of
14882
    case Integer of
14879
      0 : (lpszAccountID : PCharAW);  // Account identifier
14883
      0 : (lpszAccountID : PCharAW);  // Account identifier
14880
      1 : (lpszAccountIDA : PAnsiChar);
14884
      1 : (lpszAccountIDA : PAnsiChar);
14881
      2 : (lpszAccountIDW : PWideChar);
14885
      2 : (lpszAccountIDW : PWideChar);
14882
  end;
14886
  end;
14883
 
14887
 
14884
(*
14888
(*
14885
 * TDPLConnection
14889
 * TDPLConnection
14886
 * Used to hold all in the informaion needed to connect
14890
 * Used to hold all in the informaion needed to connect
14887
 * an application to a session or create a session
14891
 * an application to a session or create a session
14888
 *)
14892
 *)
14889
  PDPLConnection = ^TDPLConnection;
14893
  PDPLConnection = ^TDPLConnection;
14890
  TDPLConnection = packed record
14894
  TDPLConnection = packed record
14891
    dwSize: DWORD;                     // Size of this structure
14895
    dwSize: DWORD;                     // Size of this structure
14892
    dwFlags: DWORD;                    // Flags specific to this structure
14896
    dwFlags: DWORD;                    // Flags specific to this structure
14893
    lpSessionDesc: PDPSessionDesc2;    // Pointer to session desc to use on connect
14897
    lpSessionDesc: PDPSessionDesc2;    // Pointer to session desc to use on connect
14894
    lpPlayerName: PDPName;             // Pointer to Player name structure
14898
    lpPlayerName: PDPName;             // Pointer to Player name structure
14895
    guidSP: TGUID;                     // GUID of the DPlay SP to use
14899
    guidSP: TGUID;                     // GUID of the DPlay SP to use
14896
    lpAddress: Pointer;                // Address for service provider
14900
    lpAddress: Pointer;                // Address for service provider
14897
    dwAddressSize: DWORD;              // Size of address data
14901
    dwAddressSize: DWORD;              // Size of address data
14898
  end;
14902
  end;
14899
 
14903
 
14900
(*
14904
(*
14901
 * TDPChat
14905
 * TDPChat
14902
 * Used to hold the a DirectPlay chat message
14906
 * Used to hold the a DirectPlay chat message
14903
 *)
14907
 *)
14904
  PDPChat = ^TDPChat;
14908
  PDPChat = ^TDPChat;
14905
  TDPChat = packed record
14909
  TDPChat = packed record
14906
    dwSize: DWORD;
14910
    dwSize: DWORD;
14907
    dwFlags: DWORD;
14911
    dwFlags: DWORD;
14908
    case Integer of
14912
    case Integer of
14909
      0 : (lpszMessage : PCharAW);  // Message string
14913
      0 : (lpszMessage : PCharAW);  // Message string
14910
      1 : (lpszMessageA : PAnsiChar);
14914
      1 : (lpszMessageA : PAnsiChar);
14911
      2 : (lpszMessageW : PWideChar);
14915
      2 : (lpszMessageW : PWideChar);
14912
  end;
14916
  end;
14913
 
14917
 
14914
(*
14918
(*
14915
 * TSGBuffer
14919
 * TSGBuffer
14916
 * Scatter Gather Buffer used for SendEx
14920
 * Scatter Gather Buffer used for SendEx
14917
 *)
14921
 *)
14918
  PSGBuffer = ^TSGBuffer;
14922
  PSGBuffer = ^TSGBuffer;
14919
  TSGBuffer = packed record
14923
  TSGBuffer = packed record
14920
    len: UINT;
14924
    len: UINT;
14921
    pData: PUCHAR;
14925
    pData: PUCHAR;
14922
  end;
14926
  end;
14923
 
14927
 
14924
(****************************************************************************
14928
(****************************************************************************
14925
 *
14929
 *
14926
 * Prototypes for DirectPlay callback functions
14930
 * Prototypes for DirectPlay callback functions
14927
 *
14931
 *
14928
 ****************************************************************************)
14932
 ****************************************************************************)
14929
 
14933
 
14930
(*
14934
(*
14931
 * Callback for IDirectPlay2::EnumSessions
14935
 * Callback for IDirectPlay2::EnumSessions
14932
 *)
14936
 *)
14933
  TDPEnumSessionsCallback2 = function(lpThisSD: PDPSessionDesc2;
14937
  TDPEnumSessionsCallback2 = function(lpThisSD: PDPSessionDesc2;
14934
      var lpdwTimeOut: DWORD; dwFlags: DWORD; lpContext: Pointer) : BOOL; stdcall;
14938
      var lpdwTimeOut: DWORD; dwFlags: DWORD; lpContext: Pointer) : BOOL; stdcall;
14935
 
14939
 
14936
const
14940
const
14937
(*
14941
(*
14938
 * This flag is set on the EnumSessions callback dwFlags parameter when
14942
 * This flag is set on the EnumSessions callback dwFlags parameter when
14939
 * the time out has occurred. There will be no session data for this
14943
 * the time out has occurred. There will be no session data for this
14940
 * callback. If *lpdwTimeOut is set to a non-zero value and the
14944
 * callback. If *lpdwTimeOut is set to a non-zero value and the
14941
 * EnumSessionsCallback function returns TRUE then EnumSessions will
14945
 * EnumSessionsCallback function returns TRUE then EnumSessions will
14942
 * continue waiting until the next timeout occurs. Timeouts are in
14946
 * continue waiting until the next timeout occurs. Timeouts are in
14943
 * milliseconds.
14947
 * milliseconds.
14944
 *)
14948
 *)
14945
  DPESC_TIMEDOUT = $00000001;
14949
  DPESC_TIMEDOUT = $00000001;
14946
 
14950
 
14947
type
14951
type
14948
(*
14952
(*
14949
 * Callback for IDirectPlay2.EnumPlayers
14953
 * Callback for IDirectPlay2.EnumPlayers
14950
 *              IDirectPlay2.EnumGroups
14954
 *              IDirectPlay2.EnumGroups
14951
 *              IDirectPlay2.EnumGroupPlayers
14955
 *              IDirectPlay2.EnumGroupPlayers
14952
 *)
14956
 *)
14953
  TDPEnumPlayersCallback2 = function(DPID: TDPID; dwPlayerType: DWORD;
14957
  TDPEnumPlayersCallback2 = function(DPID: TDPID; dwPlayerType: DWORD;
14954
      const lpName: TDPName; dwFlags: DWORD; lpContext: Pointer) : BOOL; stdcall;
14958
      const lpName: TDPName; dwFlags: DWORD; lpContext: Pointer) : BOOL; stdcall;
14955
 
14959
 
14956
 
14960
 
14957
(*
14961
(*
14958
 * ANSI callback for DirectPlayEnumerate
14962
 * ANSI callback for DirectPlayEnumerate
14959
 * This callback prototype will be used if compiling
14963
 * This callback prototype will be used if compiling
14960
 * for ANSI strings
14964
 * for ANSI strings
14961
 *)
14965
 *)
14962
  TDPEnumDPCallbackA = function(const lpguidSP: TGUID; lpSPName: PAnsiChar;
14966
  TDPEnumDPCallbackA = function(const lpguidSP: TGUID; lpSPName: PAnsiChar;
14963
      dwMajorVersion: DWORD; dwMinorVersion: DWORD; lpContext: Pointer) : BOOL; stdcall;
14967
      dwMajorVersion: DWORD; dwMinorVersion: DWORD; lpContext: Pointer) : BOOL; stdcall;
14964
 
14968
 
14965
(*
14969
(*
14966
 * Unicode callback for DirectPlayEnumerate
14970
 * Unicode callback for DirectPlayEnumerate
14967
 * This callback prototype will be used if compiling
14971
 * This callback prototype will be used if compiling
14968
 * for Unicode strings
14972
 * for Unicode strings
14969
 *)
14973
 *)
14970
  TDPEnumDPCallbackW = function(const lpguidSP: TGUID; lpSPName: PWideChar;
14974
  TDPEnumDPCallbackW = function(const lpguidSP: TGUID; lpSPName: PWideChar;
14971
      dwMajorVersion: DWORD; dwMinorVersion: DWORD; lpContext: Pointer) : BOOL; stdcall;
14975
      dwMajorVersion: DWORD; dwMinorVersion: DWORD; lpContext: Pointer) : BOOL; stdcall;
14972
 
14976
 
14973
(*
14977
(*
14974
 * Callback for DirectPlayEnumerate
14978
 * Callback for DirectPlayEnumerate
14975
 *)
14979
 *)
14976
{$IFDEF UNICODE}
14980
{$IFDEF UNICODE}
14977
  TDPEnumDPCallback = TDPEnumDPCallbackW;
14981
  TDPEnumDPCallback = TDPEnumDPCallbackW;
14978
{$ELSE}
14982
{$ELSE}
14979
  TDPEnumDPCallback = TDPEnumDPCallbackA;
14983
  TDPEnumDPCallback = TDPEnumDPCallbackA;
14980
{$ENDIF}
14984
{$ENDIF}
14981
 
14985
 
14982
(*
14986
(*
14983
 * Callback for IDirectPlay3(A/W).EnumConnections
14987
 * Callback for IDirectPlay3(A/W).EnumConnections
14984
 *)
14988
 *)
14985
  TDPEnumConnectionsCallback = function(const lpguidSP: TGUID;
14989
  TDPEnumConnectionsCallback = function(const lpguidSP: TGUID;
14986
      lpConnection: Pointer; dwConnectionSize: DWORD; const lpName: TDPName;
14990
      lpConnection: Pointer; dwConnectionSize: DWORD; const lpName: TDPName;
14987
      dwFlags: DWORD; lpContext: Pointer) : BOOL; stdcall;
14991
      dwFlags: DWORD; lpContext: Pointer) : BOOL; stdcall;
14988
 
14992
 
14989
(*
14993
(*
14990
 * API's
14994
 * API's
14991
 *)
14995
 *)
14992
 
14996
 
14993
var
14997
var
14994
  DirectPlayEnumerate : function (lpEnumDPCallback: TDPEnumDPCallback;
14998
  DirectPlayEnumerate : function (lpEnumDPCallback: TDPEnumDPCallback;
14995
      lpContext: Pointer) : HResult; stdcall;
14999
      lpContext: Pointer) : HResult; stdcall;
14996
  DirectPlayEnumerateA : function (lpEnumDPCallback: TDPEnumDPCallbackA;
15000
  DirectPlayEnumerateA : function (lpEnumDPCallback: TDPEnumDPCallbackA;
14997
      lpContext: Pointer) : HResult; stdcall;
15001
      lpContext: Pointer) : HResult; stdcall;
14998
  DirectPlayEnumerateW : function (lpEnumDPCallback: TDPEnumDPCallbackW;
15002
  DirectPlayEnumerateW : function (lpEnumDPCallback: TDPEnumDPCallbackW;
14999
      lpContext: Pointer) : HResult; stdcall;
15003
      lpContext: Pointer) : HResult; stdcall;
15000
 
15004
 
15001
 
15005
 
15002
(****************************************************************************
15006
(****************************************************************************
15003
 *
15007
 *
15004
 * IDirectPlay2 (and IDirectPlay2A) Interface
15008
 * IDirectPlay2 (and IDirectPlay2A) Interface
15005
 *
15009
 *
15006
 ****************************************************************************)
15010
 ****************************************************************************)
15007
 
15011
 
15008
type
15012
type
15009
  IDirectPlay2AW = interface (IUnknown)
15013
  IDirectPlay2AW = interface (IUnknown)
15010
    (*** IDirectPlay2 methods ***)
15014
    (*** IDirectPlay2 methods ***)
15011
    function AddPlayerToGroup(idGroup: TDPID; idPlayer: TDPID) : HResult; stdcall;
15015
    function AddPlayerToGroup(idGroup: TDPID; idPlayer: TDPID) : HResult; stdcall;
15012
    function Close: HResult; stdcall;
15016
    function Close: HResult; stdcall;
15013
    function CreateGroup(out lpidGroup: TDPID; lpGroupName: PDPName;
15017
    function CreateGroup(out lpidGroup: TDPID; lpGroupName: PDPName;
15014
        lpData: Pointer; dwDataSize: DWORD; dwFlags: DWORD) : HResult; stdcall;
15018
        lpData: Pointer; dwDataSize: DWORD; dwFlags: DWORD) : HResult; stdcall;
15015
    function CreatePlayer(out lpidPlayer: TDPID; pPlayerName: PDPName;
15019
    function CreatePlayer(out lpidPlayer: TDPID; pPlayerName: PDPName;
15016
        hEvent: THandle; lpData: Pointer; dwDataSize: DWORD; dwFlags: DWORD) : HResult; stdcall;
15020
        hEvent: THandle; lpData: Pointer; dwDataSize: DWORD; dwFlags: DWORD) : HResult; stdcall;
15017
    function DeletePlayerFromGroup(idGroup: TDPID; idPlayer: TDPID) : HResult; stdcall;
15021
    function DeletePlayerFromGroup(idGroup: TDPID; idPlayer: TDPID) : HResult; stdcall;
15018
    function DestroyGroup(idGroup: TDPID) : HResult; stdcall;
15022
    function DestroyGroup(idGroup: TDPID) : HResult; stdcall;
15019
    function DestroyPlayer(idPlayer: TDPID) : HResult; stdcall;
15023
    function DestroyPlayer(idPlayer: TDPID) : HResult; stdcall;
15020
    function EnumGroupPlayers(idGroup: TDPID; lpguidInstance: PGUID;
15024
    function EnumGroupPlayers(idGroup: TDPID; lpguidInstance: PGUID;
15021
        lpEnumPlayersCallback2: TDPEnumPlayersCallback2; lpContext: Pointer;
15025
        lpEnumPlayersCallback2: TDPEnumPlayersCallback2; lpContext: Pointer;
15022
        dwFlags: DWORD) : HResult; stdcall;
15026
        dwFlags: DWORD) : HResult; stdcall;
15023
    function EnumGroups(lpguidInstance: PGUID; lpEnumPlayersCallback2:
15027
    function EnumGroups(lpguidInstance: PGUID; lpEnumPlayersCallback2:
15024
        TDPEnumPlayersCallback2; lpContext: Pointer; dwFlags: DWORD) : HResult; stdcall;
15028
        TDPEnumPlayersCallback2; lpContext: Pointer; dwFlags: DWORD) : HResult; stdcall;
15025
    function EnumPlayers(lpguidInstance: PGUID; lpEnumPlayersCallback2:
15029
    function EnumPlayers(lpguidInstance: PGUID; lpEnumPlayersCallback2:
15026
        TDPEnumPlayersCallback2; lpContext: Pointer; dwFlags: DWORD) : HResult; stdcall;
15030
        TDPEnumPlayersCallback2; lpContext: Pointer; dwFlags: DWORD) : HResult; stdcall;
15027
    function EnumSessions(const lpsd: TDPSessionDesc2; dwTimeout: DWORD;
15031
    function EnumSessions(const lpsd: TDPSessionDesc2; dwTimeout: DWORD;
15028
        lpEnumSessionsCallback2: TDPEnumSessionsCallback2; lpContext: Pointer;
15032
        lpEnumSessionsCallback2: TDPEnumSessionsCallback2; lpContext: Pointer;
15029
        dwFlags: DWORD) : HResult; stdcall;
15033
        dwFlags: DWORD) : HResult; stdcall;
15030
    function GetCaps(var lpDPCaps: TDPCaps; dwFlags: DWORD) : HResult; stdcall;
15034
    function GetCaps(var lpDPCaps: TDPCaps; dwFlags: DWORD) : HResult; stdcall;
15031
    function GetGroupData(idGroup: TDPID; lpData: Pointer; var lpdwDataSize: DWORD;
15035
    function GetGroupData(idGroup: TDPID; lpData: Pointer; var lpdwDataSize: DWORD;
15032
        dwFlags: DWORD) : HResult; stdcall;
15036
        dwFlags: DWORD) : HResult; stdcall;
15033
    function GetGroupName(idGroup: TDPID; lpData: Pointer; var lpdwDataSize: DWORD) :
15037
    function GetGroupName(idGroup: TDPID; lpData: Pointer; var lpdwDataSize: DWORD) :
15034
        HResult; stdcall;
15038
        HResult; stdcall;
15035
    function GetMessageCount(idPlayer: TDPID; var lpdwCount: DWORD) : HResult; stdcall;
15039
    function GetMessageCount(idPlayer: TDPID; var lpdwCount: DWORD) : HResult; stdcall;
15036
    function GetPlayerAddress(idPlayer: TDPID; lpAddress: Pointer;
15040
    function GetPlayerAddress(idPlayer: TDPID; lpAddress: Pointer;
15037
        var lpdwAddressSize: DWORD) : HResult; stdcall;
15041
        var lpdwAddressSize: DWORD) : HResult; stdcall;
15038
    function GetPlayerCaps(idPlayer: TDPID; var lpPlayerCaps: TDPCaps;
15042
    function GetPlayerCaps(idPlayer: TDPID; var lpPlayerCaps: TDPCaps;
15039
        dwFlags: DWORD) : HResult; stdcall;
15043
        dwFlags: DWORD) : HResult; stdcall;
15040
    function GetPlayerData(idPlayer: TDPID; lpData: Pointer; var lpdwDataSize: DWORD;
15044
    function GetPlayerData(idPlayer: TDPID; lpData: Pointer; var lpdwDataSize: DWORD;
15041
        dwFlags: DWORD) : HResult; stdcall;
15045
        dwFlags: DWORD) : HResult; stdcall;
15042
    function GetPlayerName(idPlayer: TDPID; lpData: Pointer; var lpdwDataSize: DWORD) : HResult; stdcall;
15046
    function GetPlayerName(idPlayer: TDPID; lpData: Pointer; var lpdwDataSize: DWORD) : HResult; stdcall;
15043
    function GetSessionDesc(lpData: Pointer; var lpdwDataSize: DWORD) : HResult; stdcall;
15047
    function GetSessionDesc(lpData: Pointer; var lpdwDataSize: DWORD) : HResult; stdcall;
15044
    function Initialize(const lpGUID: TGUID) : HResult; stdcall;
15048
    function Initialize(const lpGUID: TGUID) : HResult; stdcall;
15045
    function Open(var lpsd: TDPSessionDesc2; dwFlags: DWORD) : HResult; stdcall;
15049
    function Open(var lpsd: TDPSessionDesc2; dwFlags: DWORD) : HResult; stdcall;
15046
    function Receive(var lpidFrom: TDPID; var lpidTo: TDPID; dwFlags: DWORD;
15050
    function Receive(var lpidFrom: TDPID; var lpidTo: TDPID; dwFlags: DWORD;
15047
        lpData: Pointer; var lpdwDataSize: DWORD) : HResult; stdcall;
15051
        lpData: Pointer; var lpdwDataSize: DWORD) : HResult; stdcall;
15048
    function Send(idFrom: TDPID; lpidTo: TDPID; dwFlags: DWORD; var lpData;
15052
    function Send(idFrom: TDPID; lpidTo: TDPID; dwFlags: DWORD; var lpData;
15049
        lpdwDataSize: DWORD) : HResult; stdcall;
15053
        lpdwDataSize: DWORD) : HResult; stdcall;
15050
    function SetGroupData(idGroup: TDPID; lpData: Pointer; dwDataSize: DWORD;
15054
    function SetGroupData(idGroup: TDPID; lpData: Pointer; dwDataSize: DWORD;
15051
        dwFlags: DWORD) : HResult; stdcall;
15055
        dwFlags: DWORD) : HResult; stdcall;
15052
    function SetGroupName(idGroup: TDPID; lpGroupName: PDPName;
15056
    function SetGroupName(idGroup: TDPID; lpGroupName: PDPName;
15053
        dwFlags: DWORD) : HResult; stdcall;
15057
        dwFlags: DWORD) : HResult; stdcall;
15054
    function SetPlayerData(idPlayer: TDPID; lpData: Pointer; dwDataSize: DWORD;
15058
    function SetPlayerData(idPlayer: TDPID; lpData: Pointer; dwDataSize: DWORD;
15055
        dwFlags: DWORD) : HResult; stdcall;
15059
        dwFlags: DWORD) : HResult; stdcall;
15056
    function SetPlayerName(idPlayer: TDPID; lpPlayerName: PDPName;
15060
    function SetPlayerName(idPlayer: TDPID; lpPlayerName: PDPName;
15057
        dwFlags: DWORD) : HResult; stdcall;
15061
        dwFlags: DWORD) : HResult; stdcall;
15058
    function SetSessionDesc(var lpSessDesc: TDPSessionDesc2; dwFlags: DWORD) :
15062
    function SetSessionDesc(var lpSessDesc: TDPSessionDesc2; dwFlags: DWORD) :
15059
        HResult; stdcall;
15063
        HResult; stdcall;
15060
  end;
15064
  end;
15061
 
15065
 
15062
  IDirectPlay2W = interface (IDirectPlay2AW)
15066
  IDirectPlay2W = interface (IDirectPlay2AW)
15063
    ['{2B74F7C0-9154-11CF-A9CD-00AA006886E3}']
15067
    ['{2B74F7C0-9154-11CF-A9CD-00AA006886E3}']
15064
  end;
15068
  end;
15065
  IDirectPlay2A = interface (IDirectPlay2AW)
15069
  IDirectPlay2A = interface (IDirectPlay2AW)
15066
    ['{9d460580-a822-11cf-960c-0080c7534e82}']
15070
    ['{9d460580-a822-11cf-960c-0080c7534e82}']
15067
  end;
15071
  end;
15068
 
15072
 
15069
{$IFDEF UNICODE}
15073
{$IFDEF UNICODE}
15070
  IDirectPlay2 = IDirectPlay2W;
15074
  IDirectPlay2 = IDirectPlay2W;
15071
{$ELSE}
15075
{$ELSE}
15072
  IDirectPlay2 = IDirectPlay2A;
15076
  IDirectPlay2 = IDirectPlay2A;
15073
{$ENDIF}
15077
{$ENDIF}
15074
 
15078
 
15075
(****************************************************************************
15079
(****************************************************************************
15076
 *
15080
 *
15077
 * IDirectPlay3 (and IDirectPlay3A) Interface
15081
 * IDirectPlay3 (and IDirectPlay3A) Interface
15078
 *
15082
 *
15079
 ****************************************************************************)
15083
 ****************************************************************************)
15080
 
15084
 
15081
  IDirectPlay3AW = interface (IDirectPlay2AW)
15085
  IDirectPlay3AW = interface (IDirectPlay2AW)
15082
    (*** IDirectPlay3 methods ***)
15086
    (*** IDirectPlay3 methods ***)
15083
    function AddGroupToGroup(idParentGroup: TDPID; idGroup: TDPID) : HResult; stdcall;
15087
    function AddGroupToGroup(idParentGroup: TDPID; idGroup: TDPID) : HResult; stdcall;
15084
    function CreateGroupInGroup(idParentGroup: TDPID; var lpidGroup: TDPID;
15088
    function CreateGroupInGroup(idParentGroup: TDPID; var lpidGroup: TDPID;
15085
        lpGroupName: PDPName; lpData: Pointer; dwDataSize: DWORD;
15089
        lpGroupName: PDPName; lpData: Pointer; dwDataSize: DWORD;
15086
        dwFlags: DWORD) : HResult; stdcall;
15090
        dwFlags: DWORD) : HResult; stdcall;
15087
    function DeleteGroupFromGroup(idParentGroup: TDPID; idGroup: TDPID) : HResult; stdcall;
15091
    function DeleteGroupFromGroup(idParentGroup: TDPID; idGroup: TDPID) : HResult; stdcall;
15088
    function EnumConnections(lpguidApplication: PGUID;
15092
    function EnumConnections(lpguidApplication: PGUID;
15089
        lpEnumCallback: TDPEnumConnectionsCallback; lpContext: Pointer;
15093
        lpEnumCallback: TDPEnumConnectionsCallback; lpContext: Pointer;
15090
        dwFlags: DWORD) : HResult; stdcall;
15094
        dwFlags: DWORD) : HResult; stdcall;
15091
    function EnumGroupsInGroup(idGroup: TDPID; lpguidInstance: PGUID;
15095
    function EnumGroupsInGroup(idGroup: TDPID; lpguidInstance: PGUID;
15092
        lpEnumPlayersCallback2: TDPEnumPlayersCallback2; lpContext: Pointer;
15096
        lpEnumPlayersCallback2: TDPEnumPlayersCallback2; lpContext: Pointer;
15093
        dwFlags: DWORD) : HResult; stdcall;
15097
        dwFlags: DWORD) : HResult; stdcall;
15094
    function GetGroupConnectionSettings(dwFlags: DWORD; idGroup: TDPID;
15098
    function GetGroupConnectionSettings(dwFlags: DWORD; idGroup: TDPID;
15095
        lpData: Pointer; var lpdwDataSize: DWORD) : HResult; stdcall;
15099
        lpData: Pointer; var lpdwDataSize: DWORD) : HResult; stdcall;
15096
    function InitializeConnection(lpConnection: Pointer; dwFlags: DWORD) : HResult; stdcall;
15100
    function InitializeConnection(lpConnection: Pointer; dwFlags: DWORD) : HResult; stdcall;
15097
    function SecureOpen(var lpsd: TDPSessionDesc2; dwFlags: DWORD;
15101
    function SecureOpen(var lpsd: TDPSessionDesc2; dwFlags: DWORD;
15098
        var lpSecurity: TDPSecurityDesc; var lpCredentials: TDPCredentials) : HResult; stdcall;
15102
        var lpSecurity: TDPSecurityDesc; var lpCredentials: TDPCredentials) : HResult; stdcall;
15099
    function SendChatMessage(idFrom: TDPID; idTo: TDPID; dwFlags: DWORD;
15103
    function SendChatMessage(idFrom: TDPID; idTo: TDPID; dwFlags: DWORD;
15100
        var lpChatMessage: TDPChat) : HResult; stdcall;
15104
        var lpChatMessage: TDPChat) : HResult; stdcall;
15101
    function SetGroupConnectionSettings(dwFlags: DWORD; idGroup: TDPID;
15105
    function SetGroupConnectionSettings(dwFlags: DWORD; idGroup: TDPID;
15102
        var lpConnection: TDPLConnection) : HResult; stdcall;
15106
        var lpConnection: TDPLConnection) : HResult; stdcall;
15103
    function StartSession(dwFlags: DWORD; idGroup: TDPID) : HResult; stdcall;
15107
    function StartSession(dwFlags: DWORD; idGroup: TDPID) : HResult; stdcall;
15104
    function GetGroupFlags(idGroup: TDPID; out lpdwFlags: DWORD) : HResult; stdcall;
15108
    function GetGroupFlags(idGroup: TDPID; out lpdwFlags: DWORD) : HResult; stdcall;
15105
    function GetGroupParent(idGroup: TDPID; out lpidParent: TDPID) : HResult; stdcall;
15109
    function GetGroupParent(idGroup: TDPID; out lpidParent: TDPID) : HResult; stdcall;
15106
    function GetPlayerAccount(idPlayer: TDPID; dwFlags: DWORD; var lpData;
15110
    function GetPlayerAccount(idPlayer: TDPID; dwFlags: DWORD; var lpData;
15107
        var lpdwDataSize: DWORD) : HResult; stdcall;
15111
        var lpdwDataSize: DWORD) : HResult; stdcall;
15108
    function GetPlayerFlags(idPlayer: TDPID; out lpdwFlags: DWORD) : HResult; stdcall;
15112
    function GetPlayerFlags(idPlayer: TDPID; out lpdwFlags: DWORD) : HResult; stdcall;
15109
  end;
15113
  end;
15110
 
15114
 
15111
 
15115
 
15112
  IDirectPlay3W = interface (IDirectPlay3AW)
15116
  IDirectPlay3W = interface (IDirectPlay3AW)
15113
    ['{133EFE40-32DC-11D0-9CFB-00A0C90A43CB}']
15117
    ['{133EFE40-32DC-11D0-9CFB-00A0C90A43CB}']
15114
  end;
15118
  end;
15115
  IDirectPlay3A = interface (IDirectPlay3AW)
15119
  IDirectPlay3A = interface (IDirectPlay3AW)
15116
    ['{133efe41-32dc-11d0-9cfb-00a0c90a43cb}']
15120
    ['{133efe41-32dc-11d0-9cfb-00a0c90a43cb}']
15117
  end;
15121
  end;
15118
 
15122
 
15119
{$IFDEF UNICODE}
15123
{$IFDEF UNICODE}
15120
  IDirectPlay3 = IDirectPlay3W;
15124
  IDirectPlay3 = IDirectPlay3W;
15121
{$ELSE}
15125
{$ELSE}
15122
  IDirectPlay3 = IDirectPlay3A;
15126
  IDirectPlay3 = IDirectPlay3A;
15123
{$ENDIF}
15127
{$ENDIF}
15124
 
15128
 
15125
 
15129
 
15126
(****************************************************************************
15130
(****************************************************************************
15127
 *
15131
 *
15128
 * IDirectPlay4 (and IDirectPlay4A) Interface
15132
 * IDirectPlay4 (and IDirectPlay4A) Interface
15129
 *
15133
 *
15130
 ****************************************************************************)
15134
 ****************************************************************************)
15131
 
15135
 
15132
  IDirectPlay4AW = interface (IDirectPlay3AW)
15136
  IDirectPlay4AW = interface (IDirectPlay3AW)
15133
    (*** IDirectPlay4 methods ***)
15137
    (*** IDirectPlay4 methods ***)
15134
    function GetGroupOwner(idGroup: TDPID; out idOwner: TDPID) : HResult; stdcall;
15138
    function GetGroupOwner(idGroup: TDPID; out idOwner: TDPID) : HResult; stdcall;
15135
    function SetGroupOwner(idGroup: TDPID; idOwner: TDPID) : HResult; stdcall;
15139
    function SetGroupOwner(idGroup: TDPID; idOwner: TDPID) : HResult; stdcall;
15136
    function SendEx(idFrom: TDPID; idTo: TDPID; dwFlags: DWORD; lpData: Pointer;
15140
    function SendEx(idFrom: TDPID; idTo: TDPID; dwFlags: DWORD; lpData: Pointer;
15137
        dwDataSize: DWORD; dwPriority: DWORD; dwTimeout: DWORD;
15141
        dwDataSize: DWORD; dwPriority: DWORD; dwTimeout: DWORD;
15138
        lpContext: Pointer; lpdwMsgId: PDWORD) : HResult; stdcall;
15142
        lpContext: Pointer; lpdwMsgId: PDWORD) : HResult; stdcall;
15139
    function GetMessageQueue(idFrom: TDPID; idTo: TDPID; dwFlags: DWORD;
15143
    function GetMessageQueue(idFrom: TDPID; idTo: TDPID; dwFlags: DWORD;
15140
        lpdwNumMsgs: PDWORD; lpdwNumBytes: PDWORD) : HResult; stdcall;
15144
        lpdwNumMsgs: PDWORD; lpdwNumBytes: PDWORD) : HResult; stdcall;
15141
    function CancelMessage(dwMessageID: DWORD; dwFlags: DWORD) : HResult; stdcall;
15145
    function CancelMessage(dwMessageID: DWORD; dwFlags: DWORD) : HResult; stdcall;
15142
    function CancelPriority(dwMinPriority: DWORD; dwMaxPriority: DWORD; dwFlags: DWORD) : HResult; stdcall;
15146
    function CancelPriority(dwMinPriority: DWORD; dwMaxPriority: DWORD; dwFlags: DWORD) : HResult; stdcall;
15143
  end;
15147
  end;
15144
 
15148
 
15145
 
15149
 
15146
  IDirectPlay4W = interface (IDirectPlay4AW)
15150
  IDirectPlay4W = interface (IDirectPlay4AW)
15147
    ['{0ab1c530-4745-11D1-a7a1-0000f803abfc}']
15151
    ['{0ab1c530-4745-11D1-a7a1-0000f803abfc}']
15148
  end;
15152
  end;
15149
  IDirectPlay4A = interface (IDirectPlay4AW)
15153
  IDirectPlay4A = interface (IDirectPlay4AW)
15150
    ['{0ab1c531-4745-11D1-a7a1-0000f803abfc}']
15154
    ['{0ab1c531-4745-11D1-a7a1-0000f803abfc}']
15151
  end;
15155
  end;
15152
 
15156
 
15153
{$IFDEF UNICODE}
15157
{$IFDEF UNICODE}
15154
  IDirectPlay4 = IDirectPlay4W;
15158
  IDirectPlay4 = IDirectPlay4W;
15155
{$ELSE}
15159
{$ELSE}
15156
  IDirectPlay4 = IDirectPlay4A;
15160
  IDirectPlay4 = IDirectPlay4A;
15157
{$ENDIF}
15161
{$ENDIF}
15158
 
15162
 
15159
 
15163
 
15160
const
15164
const
15161
(****************************************************************************
15165
(****************************************************************************
15162
 *
15166
 *
15163
 * EnumConnections API flags
15167
 * EnumConnections API flags
15164
 *
15168
 *
15165
 ****************************************************************************)
15169
 ****************************************************************************)
15166
 
15170
 
15167
(*
15171
(*
15168
 * Enumerate Service Providers
15172
 * Enumerate Service Providers
15169
 *)
15173
 *)
15170
  DPCONNECTION_DIRECTPLAY = $00000001;
15174
  DPCONNECTION_DIRECTPLAY = $00000001;
15171
 
15175
 
15172
(*
15176
(*
15173
 * Enumerate Lobby Providers
15177
 * Enumerate Lobby Providers
15174
 *)
15178
 *)
15175
  DPCONNECTION_DIRECTPLAYLOBBY = $00000002;
15179
  DPCONNECTION_DIRECTPLAYLOBBY = $00000002;
15176
 
15180
 
15177
(****************************************************************************
15181
(****************************************************************************
15178
 *
15182
 *
15179
 * EnumPlayers API flags
15183
 * EnumPlayers API flags
15180
 *
15184
 *
15181
 ****************************************************************************)
15185
 ****************************************************************************)
15182
 
15186
 
15183
(*
15187
(*
15184
 * Enumerate all players in the current session
15188
 * Enumerate all players in the current session
15185
 *)
15189
 *)
15186
  DPENUMPLAYERS_ALL = $00000000;
15190
  DPENUMPLAYERS_ALL = $00000000;
15187
  DPENUMGROUPS_ALL = DPENUMPLAYERS_ALL;
15191
  DPENUMGROUPS_ALL = DPENUMPLAYERS_ALL;
15188
 
15192
 
15189
(*
15193
(*
15190
 * Enumerate only local (created by this application) players
15194
 * Enumerate only local (created by this application) players
15191
 * or groups
15195
 * or groups
15192
 *)
15196
 *)
15193
  DPENUMPLAYERS_LOCAL = $00000008;
15197
  DPENUMPLAYERS_LOCAL = $00000008;
15194
  DPENUMGROUPS_LOCAL = DPENUMPLAYERS_LOCAL;
15198
  DPENUMGROUPS_LOCAL = DPENUMPLAYERS_LOCAL;
15195
 
15199
 
15196
(*
15200
(*
15197
 * Enumerate only remote (non-local) players
15201
 * Enumerate only remote (non-local) players
15198
 * or groups
15202
 * or groups
15199
 *)
15203
 *)
15200
  DPENUMPLAYERS_REMOTE = $00000010;
15204
  DPENUMPLAYERS_REMOTE = $00000010;
15201
  DPENUMGROUPS_REMOTE = DPENUMPLAYERS_REMOTE;
15205
  DPENUMGROUPS_REMOTE = DPENUMPLAYERS_REMOTE;
15202
 
15206
 
15203
(*
15207
(*
15204
 * Enumerate groups along with the players
15208
 * Enumerate groups along with the players
15205
 *)
15209
 *)
15206
  DPENUMPLAYERS_GROUP = $00000020;
15210
  DPENUMPLAYERS_GROUP = $00000020;
15207
 
15211
 
15208
(*
15212
(*
15209
 * Enumerate players or groups in another session
15213
 * Enumerate players or groups in another session
15210
 * (must supply lpguidInstance)
15214
 * (must supply lpguidInstance)
15211
 *)
15215
 *)
15212
  DPENUMPLAYERS_SESSION = $00000080;
15216
  DPENUMPLAYERS_SESSION = $00000080;
15213
  DPENUMGROUPS_SESSION = DPENUMPLAYERS_SESSION;
15217
  DPENUMGROUPS_SESSION = DPENUMPLAYERS_SESSION;
15214
 
15218
 
15215
(*
15219
(*
15216
 * Enumerate server players
15220
 * Enumerate server players
15217
 *)
15221
 *)
15218
  DPENUMPLAYERS_SERVERPLAYER = $00000100;
15222
  DPENUMPLAYERS_SERVERPLAYER = $00000100;
15219
 
15223
 
15220
(*
15224
(*
15221
 * Enumerate spectator players
15225
 * Enumerate spectator players
15222
 *)
15226
 *)
15223
  DPENUMPLAYERS_SPECTATOR = $00000200;
15227
  DPENUMPLAYERS_SPECTATOR = $00000200;
15224
 
15228
 
15225
(*
15229
(*
15226
 * Enumerate shortcut groups
15230
 * Enumerate shortcut groups
15227
 *)
15231
 *)
15228
  DPENUMGROUPS_SHORTCUT = $00000400;
15232
  DPENUMGROUPS_SHORTCUT = $00000400;
15229
 
15233
 
15230
(*
15234
(*
15231
 * Enumerate staging area groups
15235
 * Enumerate staging area groups
15232
 *)
15236
 *)
15233
  DPENUMGROUPS_STAGINGAREA = $00000800;
15237
  DPENUMGROUPS_STAGINGAREA = $00000800;
15234
 
15238
 
15235
(*
15239
(*
15236
 * Enumerate hidden groups
15240
 * Enumerate hidden groups
15237
 *)
15241
 *)
15238
  DPENUMGROUPS_HIDDEN = $00001000;
15242
  DPENUMGROUPS_HIDDEN = $00001000;
15239
 
15243
 
15240
(*
15244
(*
15241
 * Enumerate the group's owner
15245
 * Enumerate the group's owner
15242
 *)
15246
 *)
15243
  DPENUMPLAYERS_OWNER = $00002000;
15247
  DPENUMPLAYERS_OWNER = $00002000;
15244
 
15248
 
15245
(****************************************************************************
15249
(****************************************************************************
15246
 *
15250
 *
15247
 * CreatePlayer API flags
15251
 * CreatePlayer API flags
15248
 *
15252
 *
15249
 ****************************************************************************)
15253
 ****************************************************************************)
15250
 
15254
 
15251
(*
15255
(*
15252
 * This flag indicates that this player should be designated
15256
 * This flag indicates that this player should be designated
15253
 * the server player. The app should specify this at CreatePlayer.
15257
 * the server player. The app should specify this at CreatePlayer.
15254
 *)
15258
 *)
15255
  DPPLAYER_SERVERPLAYER = DPENUMPLAYERS_SERVERPLAYER;
15259
  DPPLAYER_SERVERPLAYER = DPENUMPLAYERS_SERVERPLAYER;
15256
 
15260
 
15257
(*
15261
(*
15258
 * This flag indicates that this player should be designated
15262
 * This flag indicates that this player should be designated
15259
 * a spectator. The app should specify this at CreatePlayer.
15263
 * a spectator. The app should specify this at CreatePlayer.
15260
 *)
15264
 *)
15261
  DPPLAYER_SPECTATOR = DPENUMPLAYERS_SPECTATOR;
15265
  DPPLAYER_SPECTATOR = DPENUMPLAYERS_SPECTATOR;
15262
 
15266
 
15263
(*
15267
(*
15264
 * This flag indicates that this player was created locally.
15268
 * This flag indicates that this player was created locally.
15265
 * (returned from GetPlayerFlags)
15269
 * (returned from GetPlayerFlags)
15266
 *)
15270
 *)
15267
  DPPLAYER_LOCAL = DPENUMPLAYERS_LOCAL;
15271
  DPPLAYER_LOCAL = DPENUMPLAYERS_LOCAL;
15268
 
15272
 
15269
(*
15273
(*
15270
 * This flag indicates that this player is the group's owner
15274
 * This flag indicates that this player is the group's owner
15271
 * (Only returned in EnumGroupPlayers)
15275
 * (Only returned in EnumGroupPlayers)
15272
 *)
15276
 *)
15273
  DPPLAYER_OWNER = DPENUMPLAYERS_OWNER;
15277
  DPPLAYER_OWNER = DPENUMPLAYERS_OWNER;
15274
 
15278
 
15275
(****************************************************************************
15279
(****************************************************************************
15276
 *
15280
 *
15277
 * CreateGroup API flags
15281
 * CreateGroup API flags
15278
 *
15282
 *
15279
 ****************************************************************************)
15283
 ****************************************************************************)
15280
 
15284
 
15281
(*
15285
(*
15282
 * This flag indicates that the StartSession can be called on the group.
15286
 * This flag indicates that the StartSession can be called on the group.
15283
 * The app should specify this at CreateGroup, or CreateGroupInGroup.
15287
 * The app should specify this at CreateGroup, or CreateGroupInGroup.
15284
 *)
15288
 *)
15285
  DPGROUP_STAGINGAREA = DPENUMGROUPS_STAGINGAREA;
15289
  DPGROUP_STAGINGAREA = DPENUMGROUPS_STAGINGAREA;
15286
 
15290
 
15287
(*
15291
(*
15288
 * This flag indicates that this group was created locally.
15292
 * This flag indicates that this group was created locally.
15289
 * (returned from GetGroupFlags)
15293
 * (returned from GetGroupFlags)
15290
 *)
15294
 *)
15291
  DPGROUP_LOCAL = DPENUMGROUPS_LOCAL;
15295
  DPGROUP_LOCAL = DPENUMGROUPS_LOCAL;
15292
 
15296
 
15293
(*
15297
(*
15294
 * This flag indicates that this group was created hidden.
15298
 * This flag indicates that this group was created hidden.
15295
 *)
15299
 *)
15296
  DPGROUP_HIDDEN = DPENUMGROUPS_HIDDEN;
15300
  DPGROUP_HIDDEN = DPENUMGROUPS_HIDDEN;
15297
 
15301
 
15298
(****************************************************************************
15302
(****************************************************************************
15299
 *
15303
 *
15300
 * EnumSessions API flags
15304
 * EnumSessions API flags
15301
 *
15305
 *
15302
 ****************************************************************************)
15306
 ****************************************************************************)
15303
 
15307
 
15304
(*
15308
(*
15305
 * Enumerate sessions which can be joined
15309
 * Enumerate sessions which can be joined
15306
 *)
15310
 *)
15307
  DPENUMSESSIONS_AVAILABLE = $00000001;
15311
  DPENUMSESSIONS_AVAILABLE = $00000001;
15308
 
15312
 
15309
(*
15313
(*
15310
 * Enumerate all sessions even if they can't be joined.
15314
 * Enumerate all sessions even if they can't be joined.
15311
 *)
15315
 *)
15312
  DPENUMSESSIONS_ALL = $00000002;
15316
  DPENUMSESSIONS_ALL = $00000002;
15313
 
15317
 
15314
(*
15318
(*
15315
 * Start an asynchronous enum sessions
15319
 * Start an asynchronous enum sessions
15316
 *)
15320
 *)
15317
  DPENUMSESSIONS_ASYNC = $00000010;
15321
  DPENUMSESSIONS_ASYNC = $00000010;
15318
 
15322
 
15319
(*
15323
(*
15320
 * Stop an asynchronous enum sessions
15324
 * Stop an asynchronous enum sessions
15321
 *)
15325
 *)
15322
  DPENUMSESSIONS_STOPASYNC = $00000020;
15326
  DPENUMSESSIONS_STOPASYNC = $00000020;
15323
 
15327
 
15324
(*
15328
(*
15325
 * Enumerate sessions even if they require a password
15329
 * Enumerate sessions even if they require a password
15326
 *)
15330
 *)
15327
  DPENUMSESSIONS_PASSWORDREQUIRED = $00000040;
15331
  DPENUMSESSIONS_PASSWORDREQUIRED = $00000040;
15328
 
15332
 
15329
(*
15333
(*
15330
 * Return status about progress of enumeration instead of
15334
 * Return status about progress of enumeration instead of
15331
 * showing any status dialogs.
15335
 * showing any status dialogs.
15332
 *)
15336
 *)
15333
  DPENUMSESSIONS_RETURNSTATUS = $00000080;
15337
  DPENUMSESSIONS_RETURNSTATUS = $00000080;
15334
 
15338
 
15335
(****************************************************************************
15339
(****************************************************************************
15336
 *
15340
 *
15337
 * GetCaps and GetPlayerCaps API flags
15341
 * GetCaps and GetPlayerCaps API flags
15338
 *
15342
 *
15339
 ****************************************************************************)
15343
 ****************************************************************************)
15340
 
15344
 
15341
(*
15345
(*
15342
 * The latency returned should be for guaranteed message sending.
15346
 * The latency returned should be for guaranteed message sending.
15343
 * Default is non-guaranteed messaging.
15347
 * Default is non-guaranteed messaging.
15344
 *)
15348
 *)
15345
  DPGETCAPS_GUARANTEED = $00000001;
15349
  DPGETCAPS_GUARANTEED = $00000001;
15346
 
15350
 
15347
(****************************************************************************
15351
(****************************************************************************
15348
 *
15352
 *
15349
 * GetGroupData, GetPlayerData API flags
15353
 * GetGroupData, GetPlayerData API flags
15350
 * Remote and local Group/Player data is maintained separately.
15354
 * Remote and local Group/Player data is maintained separately.
15351
 * Default is DPGET_REMOTE.
15355
 * Default is DPGET_REMOTE.
15352
 *
15356
 *
15353
 ****************************************************************************)
15357
 ****************************************************************************)
15354
 
15358
 
15355
(*
15359
(*
15356
 * Get the remote data (set by any DirectPlay object in
15360
 * Get the remote data (set by any DirectPlay object in
15357
 * the session using DPSET_REMOTE)
15361
 * the session using DPSET_REMOTE)
15358
 *)
15362
 *)
15359
  DPGET_REMOTE = $00000000;
15363
  DPGET_REMOTE = $00000000;
15360
 
15364
 
15361
(*
15365
(*
15362
 * Get the local data (set by this DirectPlay object
15366
 * Get the local data (set by this DirectPlay object
15363
 * using DPSET_LOCAL)
15367
 * using DPSET_LOCAL)
15364
 *)
15368
 *)
15365
  DPGET_LOCAL = $00000001;
15369
  DPGET_LOCAL = $00000001;
15366
 
15370
 
15367
(****************************************************************************
15371
(****************************************************************************
15368
 *
15372
 *
15369
 * Open API flags
15373
 * Open API flags
15370
 *
15374
 *
15371
 ****************************************************************************)
15375
 ****************************************************************************)
15372
 
15376
 
15373
(*
15377
(*
15374
 * Join the session that is described by the DPSESSIONDESC2 structure
15378
 * Join the session that is described by the DPSESSIONDESC2 structure
15375
 *)
15379
 *)
15376
  DPOPEN_JOIN = $00000001;
15380
  DPOPEN_JOIN = $00000001;
15377
 
15381
 
15378
(*
15382
(*
15379
 * Create a new session as described by the DPSESSIONDESC2 structure
15383
 * Create a new session as described by the DPSESSIONDESC2 structure
15380
 *)
15384
 *)
15381
  DPOPEN_CREATE = $00000002;
15385
  DPOPEN_CREATE = $00000002;
15382
 
15386
 
15383
(*
15387
(*
15384
 * Return status about progress of open instead of showing
15388
 * Return status about progress of open instead of showing
15385
 * any status dialogs.
15389
 * any status dialogs.
15386
 *)
15390
 *)
15387
  DPOPEN_RETURNSTATUS = DPENUMSESSIONS_RETURNSTATUS;
15391
  DPOPEN_RETURNSTATUS = DPENUMSESSIONS_RETURNSTATUS;
15388
 
15392
 
15389
(****************************************************************************
15393
(****************************************************************************
15390
 *
15394
 *
15391
 * DPLCONNECTION flags
15395
 * DPLCONNECTION flags
15392
 *
15396
 *
15393
 ****************************************************************************)
15397
 ****************************************************************************)
15394
 
15398
 
15395
(*
15399
(*
15396
 * This application should create a new session as
15400
 * This application should create a new session as
15397
 * described by the DPSESIONDESC structure
15401
 * described by the DPSESIONDESC structure
15398
 *)
15402
 *)
15399
  DPLCONNECTION_CREATESESSION = DPOPEN_CREATE;
15403
  DPLCONNECTION_CREATESESSION = DPOPEN_CREATE;
15400
 
15404
 
15401
(*
15405
(*
15402
 * This application should join the session described by
15406
 * This application should join the session described by
15403
 * the DPSESIONDESC structure with the lpAddress data
15407
 * the DPSESIONDESC structure with the lpAddress data
15404
 *)
15408
 *)
15405
  DPLCONNECTION_JOINSESSION = DPOPEN_JOIN;
15409
  DPLCONNECTION_JOINSESSION = DPOPEN_JOIN;
15406
 
15410
 
15407
(****************************************************************************
15411
(****************************************************************************
15408
 *
15412
 *
15409
 * Receive API flags
15413
 * Receive API flags
15410
 * Default is DPRECEIVE_ALL
15414
 * Default is DPRECEIVE_ALL
15411
 *
15415
 *
15412
 ****************************************************************************)
15416
 ****************************************************************************)
15413
 
15417
 
15414
(*
15418
(*
15415
 * Get the first message in the queue
15419
 * Get the first message in the queue
15416
 *)
15420
 *)
15417
  DPRECEIVE_ALL = $00000001;
15421
  DPRECEIVE_ALL = $00000001;
15418
 
15422
 
15419
(*
15423
(*
15420
 * Get the first message in the queue directed to a specific player
15424
 * Get the first message in the queue directed to a specific player
15421
 *)
15425
 *)
15422
  DPRECEIVE_TOPLAYER = $00000002;
15426
  DPRECEIVE_TOPLAYER = $00000002;
15423
 
15427
 
15424
(*
15428
(*
15425
 * Get the first message in the queue from a specific player
15429
 * Get the first message in the queue from a specific player
15426
 *)
15430
 *)
15427
  DPRECEIVE_FROMPLAYER = $00000004;
15431
  DPRECEIVE_FROMPLAYER = $00000004;
15428
 
15432
 
15429
(*
15433
(*
15430
 * Get the message but don't remove it from the queue
15434
 * Get the message but don't remove it from the queue
15431
 *)
15435
 *)
15432
  DPRECEIVE_PEEK = $00000008;
15436
  DPRECEIVE_PEEK = $00000008;
15433
 
15437
 
15434
(****************************************************************************
15438
(****************************************************************************
15435
 *
15439
 *
15436
 * Send API flags
15440
 * Send API flags
15437
 *
15441
 *
15438
 ****************************************************************************)
15442
 ****************************************************************************)
15439
 
15443
 
15440
(*
15444
(*
15441
 * Send the message using a guaranteed send method.
15445
 * Send the message using a guaranteed send method.
15442
 * Default is non-guaranteed.
15446
 * Default is non-guaranteed.
15443
 *)
15447
 *)
15444
  DPSEND_GUARANTEED = $00000001;
15448
  DPSEND_GUARANTEED = $00000001;
15445
 
15449
 
15446
(*
15450
(*
15447
 * This flag is obsolete. It is ignored by DirectPlay
15451
 * This flag is obsolete. It is ignored by DirectPlay
15448
 *)
15452
 *)
15449
  DPSEND_HIGHPRIORITY = $00000002;
15453
  DPSEND_HIGHPRIORITY = $00000002;
15450
 
15454
 
15451
(*
15455
(*
15452
 * This flag is obsolete. It is ignored by DirectPlay
15456
 * This flag is obsolete. It is ignored by DirectPlay
15453
 *)
15457
 *)
15454
  DPSEND_OPENSTREAM = $00000008;
15458
  DPSEND_OPENSTREAM = $00000008;
15455
 
15459
 
15456
(*
15460
(*
15457
 * This flag is obsolete. It is ignored by DirectPlay
15461
 * This flag is obsolete. It is ignored by DirectPlay
15458
 *)
15462
 *)
15459
  DPSEND_CLOSESTREAM = $00000010;
15463
  DPSEND_CLOSESTREAM = $00000010;
15460
 
15464
 
15461
(*
15465
(*
15462
 * Send the message digitally signed to ensure authenticity.
15466
 * Send the message digitally signed to ensure authenticity.
15463
 *)
15467
 *)
15464
  DPSEND_SIGNED = $00000020;
15468
  DPSEND_SIGNED = $00000020;
15465
 
15469
 
15466
(*
15470
(*
15467
 * Send the message with encryption to ensure privacy.
15471
 * Send the message with encryption to ensure privacy.
15468
 *)
15472
 *)
15469
  DPSEND_ENCRYPTED = $00000040;
15473
  DPSEND_ENCRYPTED = $00000040;
15470
 
15474
 
15471
(*
15475
(*
15472
 * The message is a lobby system message
15476
 * The message is a lobby system message
15473
 *)
15477
 *)
15474
  DPSEND_LOBBYSYSTEMMESSAGE = $00000080;
15478
  DPSEND_LOBBYSYSTEMMESSAGE = $00000080;
15475
 
15479
 
15476
(*
15480
(*
15477
 * andyco - added this so we can make addforward async.
15481
 * andyco - added this so we can make addforward async.
15478
 * needs to be sanitized when we add / expose full async
15482
 * needs to be sanitized when we add / expose full async
15479
 * support.  8/3/97.
15483
 * support.  8/3/97.
15480
 *)
15484
 *)
15481
  DPSEND_ASYNC = $00000200;
15485
  DPSEND_ASYNC = $00000200;
15482
 
15486
 
15483
(*
15487
(*
15484
 * When a message is completed, don't tell me.
15488
 * When a message is completed, don't tell me.
15485
 * by default the application is notified with a system message.
15489
 * by default the application is notified with a system message.
15486
 *)
15490
 *)
15487
  DPSEND_NOSENDCOMPLETEMSG = $00000400;
15491
  DPSEND_NOSENDCOMPLETEMSG = $00000400;
15488
 
15492
 
15489
 
15493
 
15490
(*
15494
(*
15491
 * Maximum priority for sends available to applications
15495
 * Maximum priority for sends available to applications
15492
 *)
15496
 *)
15493
  DPSEND_MAX_PRI = $0000FFFF;
15497
  DPSEND_MAX_PRI = $0000FFFF;
15494
  DPSEND_MAX_PRIORITY = DPSEND_MAX_PRI;
15498
  DPSEND_MAX_PRIORITY = DPSEND_MAX_PRI;
15495
 
15499
 
15496
(****************************************************************************
15500
(****************************************************************************
15497
 *
15501
 *
15498
 * SetGroupData, SetGroupName, SetPlayerData, SetPlayerName,
15502
 * SetGroupData, SetGroupName, SetPlayerData, SetPlayerName,
15499
 * SetSessionDesc API flags.
15503
 * SetSessionDesc API flags.
15500
 * Default is DPSET_REMOTE.
15504
 * Default is DPSET_REMOTE.
15501
 *
15505
 *
15502
 ****************************************************************************)
15506
 ****************************************************************************)
15503
 
15507
 
15504
(*
15508
(*
15505
 * Propagate the data to all players in the session
15509
 * Propagate the data to all players in the session
15506
 *)
15510
 *)
15507
  DPSET_REMOTE = $00000000;
15511
  DPSET_REMOTE = $00000000;
15508
 
15512
 
15509
(*
15513
(*
15510
 * Do not propagate the data to other players
15514
 * Do not propagate the data to other players
15511
 *)
15515
 *)
15512
  DPSET_LOCAL = $00000001;
15516
  DPSET_LOCAL = $00000001;
15513
 
15517
 
15514
(*
15518
(*
15515
 * Used with DPSET_REMOTE, use guaranteed message send to
15519
 * Used with DPSET_REMOTE, use guaranteed message send to
15516
 * propagate the data
15520
 * propagate the data
15517
 *)
15521
 *)
15518
  DPSET_GUARANTEED = $00000002;
15522
  DPSET_GUARANTEED = $00000002;
15519
 
15523
 
15520
(****************************************************************************
15524
(****************************************************************************
15521
 *
15525
 *
15522
 * GetMessageQueue API flags.
15526
 * GetMessageQueue API flags.
15523
 * Default is DPMESSAGEQUEUE_SEND
15527
 * Default is DPMESSAGEQUEUE_SEND
15524
 *
15528
 *
15525
 ****************************************************************************)
15529
 ****************************************************************************)
15526
 
15530
 
15527
(*
15531
(*
15528
 * Get Send Queue - requires Service Provider Support
15532
 * Get Send Queue - requires Service Provider Support
15529
 *)
15533
 *)
15530
  DPMESSAGEQUEUE_SEND = $00000001;
15534
  DPMESSAGEQUEUE_SEND = $00000001;
15531
 
15535
 
15532
(*
15536
(*
15533
 * Get Receive Queue
15537
 * Get Receive Queue
15534
 *)
15538
 *)
15535
  DPMESSAGEQUEUE_RECEIVE = $00000002;
15539
  DPMESSAGEQUEUE_RECEIVE = $00000002;
15536
 
15540
 
15537
(****************************************************************************
15541
(****************************************************************************
15538
 *
15542
 *
15539
 * Connect API flags
15543
 * Connect API flags
15540
 *
15544
 *
15541
 ****************************************************************************)
15545
 ****************************************************************************)
15542
 
15546
 
15543
(*
15547
(*
15544
 * Start an asynchronous connect which returns status codes
15548
 * Start an asynchronous connect which returns status codes
15545
 *)
15549
 *)
15546
  DPCONNECT_RETURNSTATUS = DPENUMSESSIONS_RETURNSTATUS;
15550
  DPCONNECT_RETURNSTATUS = DPENUMSESSIONS_RETURNSTATUS;
15547
 
15551
 
15548
(****************************************************************************
15552
(****************************************************************************
15549
 *
15553
 *
15550
 * DirectPlay system messages and message data structures
15554
 * DirectPlay system messages and message data structures
15551
 *
15555
 *
15552
 * All system message come 'From' player DPID_SYSMSG.  To determine what type
15556
 * All system message come 'From' player DPID_SYSMSG.  To determine what type
15553
 * of message it is, cast the lpData from Receive to TDPMsg_Generic and check
15557
 * of message it is, cast the lpData from Receive to TDPMsg_Generic and check
15554
 * the dwType member against one of the following DPSYS_xxx constants. Once
15558
 * the dwType member against one of the following DPSYS_xxx constants. Once
15555
 * a match is found, cast the lpData to the corresponding of the DPMSG_xxx
15559
 * a match is found, cast the lpData to the corresponding of the DPMSG_xxx
15556
 * structures to access the data of the message.
15560
 * structures to access the data of the message.
15557
 *
15561
 *
15558
 ****************************************************************************)
15562
 ****************************************************************************)
15559
 
15563
 
15560
(*
15564
(*
15561
 * A new player or group has been created in the session
15565
 * A new player or group has been created in the session
15562
 * Use TDPMsg_CreatePlayerOrGroup.  Check dwPlayerType to see if it
15566
 * Use TDPMsg_CreatePlayerOrGroup.  Check dwPlayerType to see if it
15563
 * is a player or a group.
15567
 * is a player or a group.
15564
 *)
15568
 *)
15565
  DPSYS_CREATEPLAYERORGROUP = $0003;
15569
  DPSYS_CREATEPLAYERORGROUP = $0003;
15566
 
15570
 
15567
(*
15571
(*
15568
 * A player has been deleted from the session
15572
 * A player has been deleted from the session
15569
 * Use TDPMsg_DestroyPlayerOrGroup
15573
 * Use TDPMsg_DestroyPlayerOrGroup
15570
 *)
15574
 *)
15571
  DPSYS_DESTROYPLAYERORGROUP = $0005;
15575
  DPSYS_DESTROYPLAYERORGROUP = $0005;
15572
 
15576
 
15573
(*
15577
(*
15574
 * A player has been added to a group
15578
 * A player has been added to a group
15575
 * Use DPMSG_ADDPLAYERTOGROUP
15579
 * Use DPMSG_ADDPLAYERTOGROUP
15576
 *)
15580
 *)
15577
  DPSYS_ADDPLAYERTOGROUP = $0007;
15581
  DPSYS_ADDPLAYERTOGROUP = $0007;
15578
 
15582
 
15579
(*
15583
(*
15580
 * A player has been removed from a group
15584
 * A player has been removed from a group
15581
 * Use DPMSG_DELETEPLAYERFROMGROUP
15585
 * Use DPMSG_DELETEPLAYERFROMGROUP
15582
 *)
15586
 *)
15583
  DPSYS_DELETEPLAYERFROMGROUP = $0021;
15587
  DPSYS_DELETEPLAYERFROMGROUP = $0021;
15584
 
15588
 
15585
(*
15589
(*
15586
 * This DirectPlay object lost its connection with all the
15590
 * This DirectPlay object lost its connection with all the
15587
 * other players in the session.
15591
 * other players in the session.
15588
 * Use DPMSG_SESSIONLOST.
15592
 * Use DPMSG_SESSIONLOST.
15589
 *)
15593
 *)
15590
  DPSYS_SESSIONLOST = $0031;
15594
  DPSYS_SESSIONLOST = $0031;
15591
 
15595
 
15592
(*
15596
(*
15593
 * The current host has left the session.
15597
 * The current host has left the session.
15594
 * This DirectPlay object is now the host.
15598
 * This DirectPlay object is now the host.
15595
 * Use DPMSG_HOST.
15599
 * Use DPMSG_HOST.
15596
 *)
15600
 *)
15597
  DPSYS_HOST = $0101;
15601
  DPSYS_HOST = $0101;
15598
 
15602
 
15599
(*
15603
(*
15600
 * The remote data associated with a player or
15604
 * The remote data associated with a player or
15601
 * group has changed. Check dwPlayerType to see
15605
 * group has changed. Check dwPlayerType to see
15602
 * if it is a player or a group
15606
 * if it is a player or a group
15603
 * Use DPMSG_SETPLAYERORGROUPDATA
15607
 * Use DPMSG_SETPLAYERORGROUPDATA
15604
 *)
15608
 *)
15605
  DPSYS_SETPLAYERORGROUPDATA = $0102;
15609
  DPSYS_SETPLAYERORGROUPDATA = $0102;
15606
 
15610
 
15607
(*
15611
(*
15608
 * The name of a player or group has changed.
15612
 * The name of a player or group has changed.
15609
 * Check dwPlayerType to see if it is a player
15613
 * Check dwPlayerType to see if it is a player
15610
 * or a group.
15614
 * or a group.
15611
 * Use TDPMsg_SetPlayerOrGroupName
15615
 * Use TDPMsg_SetPlayerOrGroupName
15612
 *)
15616
 *)
15613
  DPSYS_SETPLAYERORGROUPNAME = $0103;
15617
  DPSYS_SETPLAYERORGROUPNAME = $0103;
15614
 
15618
 
15615
(*
15619
(*
15616
 * The session description has changed.
15620
 * The session description has changed.
15617
 * Use DPMSG_SETSESSIONDESC
15621
 * Use DPMSG_SETSESSIONDESC
15618
 *)
15622
 *)
15619
  DPSYS_SETSESSIONDESC = $0104;
15623
  DPSYS_SETSESSIONDESC = $0104;
15620
 
15624
 
15621
(*
15625
(*
15622
 * A group has been added to a group
15626
 * A group has been added to a group
15623
 * Use TDPMsg_AddGroupToGroup
15627
 * Use TDPMsg_AddGroupToGroup
15624
 *)
15628
 *)
15625
  DPSYS_ADDGROUPTOGROUP = $0105;
15629
  DPSYS_ADDGROUPTOGROUP = $0105;
15626
 
15630
 
15627
(*
15631
(*
15628
 * A group has been removed from a group
15632
 * A group has been removed from a group
15629
 * Use DPMsg_DeleteGroupFromGroup
15633
 * Use DPMsg_DeleteGroupFromGroup
15630
 *)
15634
 *)
15631
  DPSYS_DELETEGROUPFROMGROUP = $0106;
15635
  DPSYS_DELETEGROUPFROMGROUP = $0106;
15632
 
15636
 
15633
(*
15637
(*
15634
 * A secure player-player message has arrived.
15638
 * A secure player-player message has arrived.
15635
 * Use DPMSG_SECUREMESSAGE
15639
 * Use DPMSG_SECUREMESSAGE
15636
 *)
15640
 *)
15637
  DPSYS_SECUREMESSAGE = $0107;
15641
  DPSYS_SECUREMESSAGE = $0107;
15638
 
15642
 
15639
(*
15643
(*
15640
 * Start a new session.
15644
 * Start a new session.
15641
 * Use DPMSG_STARTSESSION
15645
 * Use DPMSG_STARTSESSION
15642
 *)
15646
 *)
15643
  DPSYS_STARTSESSION = $0108;
15647
  DPSYS_STARTSESSION = $0108;
15644
 
15648
 
15645
(*
15649
(*
15646
 * A chat message has arrived
15650
 * A chat message has arrived
15647
 * Use DPMSG_CHAT
15651
 * Use DPMSG_CHAT
15648
 *)
15652
 *)
15649
  DPSYS_CHAT = $0109;
15653
  DPSYS_CHAT = $0109;
15650
 
15654
 
15651
(*
15655
(*
15652
 * The owner of a group has changed
15656
 * The owner of a group has changed
15653
 * Use DPMSG_SETGROUPOWNER
15657
 * Use DPMSG_SETGROUPOWNER
15654
 *)
15658
 *)
15655
  DPSYS_SETGROUPOWNER = $010A;
15659
  DPSYS_SETGROUPOWNER = $010A;
15656
 
15660
 
15657
(*
15661
(*
15658
 * An async send has finished, failed or been cancelled
15662
 * An async send has finished, failed or been cancelled
15659
 * Use DPMSG_SENDCOMPLETE
15663
 * Use DPMSG_SENDCOMPLETE
15660
 *)
15664
 *)
15661
  DPSYS_SENDCOMPLETE = $010D;
15665
  DPSYS_SENDCOMPLETE = $010D;
15662
 
15666
 
15663
(*
15667
(*
15664
 * Used in the dwPlayerType field to indicate if it applies to a group
15668
 * Used in the dwPlayerType field to indicate if it applies to a group
15665
 * or a player
15669
 * or a player
15666
 *)
15670
 *)
15667
  DPPLAYERTYPE_GROUP = $00000000;
15671
  DPPLAYERTYPE_GROUP = $00000000;
15668
  DPPLAYERTYPE_PLAYER = $00000001;
15672
  DPPLAYERTYPE_PLAYER = $00000001;
15669
 
15673
 
15670
type
15674
type
15671
(*
15675
(*
15672
 * TDPMsg_Generic
15676
 * TDPMsg_Generic
15673
 * Generic message structure used to identify the message type.
15677
 * Generic message structure used to identify the message type.
15674
 *)
15678
 *)
15675
  PDPMsg_Generic = ^TDPMsg_Generic;
15679
  PDPMsg_Generic = ^TDPMsg_Generic;
15676
  TDPMsg_Generic = packed record
15680
  TDPMsg_Generic = packed record
15677
    dwType: DWORD;   // Message type
15681
    dwType: DWORD;   // Message type
15678
  end;
15682
  end;
15679
 
15683
 
15680
(*
15684
(*
15681
 * TDPMsg_CreatePlayerOrGroup
15685
 * TDPMsg_CreatePlayerOrGroup
15682
 * System message generated when a new player or group
15686
 * System message generated when a new player or group
15683
 * created in the session with information about it.
15687
 * created in the session with information about it.
15684
 *)
15688
 *)
15685
  PDPMsg_CreatePlayerOrGroup = ^TDPMsg_CreatePlayerOrGroup;
15689
  PDPMsg_CreatePlayerOrGroup = ^TDPMsg_CreatePlayerOrGroup;
15686
  TDPMsg_CreatePlayerOrGroup = packed record
15690
  TDPMsg_CreatePlayerOrGroup = packed record
15687
    dwType: DWORD;             // Message type
15691
    dwType: DWORD;             // Message type
15688
    dwPlayerType: DWORD;       // Is it a player or group
15692
    dwPlayerType: DWORD;       // Is it a player or group
15689
    DPID: TDPID;               // ID of the player or group
15693
    DPID: TDPID;               // ID of the player or group
15690
    dwCurrentPlayers: DWORD;   // current # players & groups in session
15694
    dwCurrentPlayers: DWORD;   // current # players & groups in session
15691
    lpData: Pointer;           // pointer to remote data
15695
    lpData: Pointer;           // pointer to remote data
15692
    dwDataSize: DWORD;         // size of remote data
15696
    dwDataSize: DWORD;         // size of remote data
15693
    dpnName: TDPName;           // structure with name info
15697
    dpnName: TDPName;           // structure with name info
15694
                               // the following fields are only available when using
15698
                               // the following fields are only available when using
15695
                               // the IDirectPlay3 interface or greater
15699
                               // the IDirectPlay3 interface or greater
15696
    dpIdParent: TDPID;         // id of parent group
15700
    dpIdParent: TDPID;         // id of parent group
15697
    dwFlags: DWORD;            // player or group flags
15701
    dwFlags: DWORD;            // player or group flags
15698
  end;
15702
  end;
15699
 
15703
 
15700
(*
15704
(*
15701
 * TDPMsg_DestroyPlayerOrGroup
15705
 * TDPMsg_DestroyPlayerOrGroup
15702
 * System message generated when a player or group is being
15706
 * System message generated when a player or group is being
15703
 * destroyed in the session with information about it.
15707
 * destroyed in the session with information about it.
15704
 *)
15708
 *)
15705
  PDPMsg_DestroyPlayerOrGroup= ^TDPMsg_DestroyPlayerOrGroup;
15709
  PDPMsg_DestroyPlayerOrGroup= ^TDPMsg_DestroyPlayerOrGroup;
15706
  TDPMsg_DestroyPlayerOrGroup = packed record
15710
  TDPMsg_DestroyPlayerOrGroup = packed record
15707
    dwType: DWORD;             // Message type
15711
    dwType: DWORD;             // Message type
15708
    dwPlayerType: DWORD;       // Is it a player or group
15712
    dwPlayerType: DWORD;       // Is it a player or group
15709
    DPID: TDPID;                // player ID being deleted
15713
    DPID: TDPID;                // player ID being deleted
15710
    lpLocalData: Pointer;      // copy of players local data
15714
    lpLocalData: Pointer;      // copy of players local data
15711
    dwLocalDataSize: DWORD;    // sizeof local data
15715
    dwLocalDataSize: DWORD;    // sizeof local data
15712
    lpRemoteData: Pointer;     // copy of players remote data
15716
    lpRemoteData: Pointer;     // copy of players remote data
15713
    dwRemoteDataSize: DWORD;   // sizeof remote data
15717
    dwRemoteDataSize: DWORD;   // sizeof remote data
15714
                               // the following fields are only available when using
15718
                               // the following fields are only available when using
15715
                               // the IDirectPlay3 interface or greater
15719
                               // the IDirectPlay3 interface or greater
15716
    dpnName: TDPName;           // structure with name info
15720
    dpnName: TDPName;           // structure with name info
15717
    dpIdParent: TDPID;          // id of parent group
15721
    dpIdParent: TDPID;          // id of parent group
15718
    dwFlags: DWORD;            // player or group flags
15722
    dwFlags: DWORD;            // player or group flags
15719
  end;
15723
  end;
15720
 
15724
 
15721
(*
15725
(*
15722
 * DPMSG_ADDPLAYERTOGROUP
15726
 * DPMSG_ADDPLAYERTOGROUP
15723
 * System message generated when a player is being added
15727
 * System message generated when a player is being added
15724
 * to a group.
15728
 * to a group.
15725
 *)
15729
 *)
15726
  PDPMsg_AddPlayerToGroup = ^TDPMsg_AddPlayerToGroup;
15730
  PDPMsg_AddPlayerToGroup = ^TDPMsg_AddPlayerToGroup;
15727
  TDPMsg_AddPlayerToGroup = packed record
15731
  TDPMsg_AddPlayerToGroup = packed record
15728
    dwType: DWORD;      // Message type
15732
    dwType: DWORD;      // Message type
15729
    dpIdGroup: TDPID;    // group ID being added to
15733
    dpIdGroup: TDPID;    // group ID being added to
15730
    dpIdPlayer: TDPID;   // player ID being added
15734
    dpIdPlayer: TDPID;   // player ID being added
15731
  end;
15735
  end;
15732
 
15736
 
15733
(*
15737
(*
15734
 * DPMSG_DELETEPLAYERFROMGROUP
15738
 * DPMSG_DELETEPLAYERFROMGROUP
15735
 * System message generated when a player is being
15739
 * System message generated when a player is being
15736
 * removed from a group
15740
 * removed from a group
15737
 *)
15741
 *)
15738
  PDPMsg_DeletePlayerFromGroup = ^TDPMsg_DeletePlayerFromGroup;
15742
  PDPMsg_DeletePlayerFromGroup = ^TDPMsg_DeletePlayerFromGroup;
15739
  TDPMsg_DeletePlayerFromGroup = TDPMsg_AddPlayerToGroup;
15743
  TDPMsg_DeletePlayerFromGroup = TDPMsg_AddPlayerToGroup;
15740
 
15744
 
15741
(*
15745
(*
15742
 * TDPMsg_AddGroupToGroup
15746
 * TDPMsg_AddGroupToGroup
15743
 * System message generated when a group is being added
15747
 * System message generated when a group is being added
15744
 * to a group.
15748
 * to a group.
15745
 *)
15749
 *)
15746
  PDPMsg_AddGroupToGroup = ^TDPMsg_AddGroupToGroup;
15750
  PDPMsg_AddGroupToGroup = ^TDPMsg_AddGroupToGroup;
15747
  TDPMsg_AddGroupToGroup = packed record
15751
  TDPMsg_AddGroupToGroup = packed record
15748
    dwType: DWORD;           // Message type
15752
    dwType: DWORD;           // Message type
15749
    dpIdParentGroup: TDPID;   // group ID being added to
15753
    dpIdParentGroup: TDPID;   // group ID being added to
15750
    dpIdGroup: TDPID;         // group ID being added
15754
    dpIdGroup: TDPID;         // group ID being added
15751
  end;
15755
  end;
15752
 
15756
 
15753
(*
15757
(*
15754
 * DPMsg_DeleteGroupFromGroup
15758
 * DPMsg_DeleteGroupFromGroup
15755
 * System message generated when a GROUP is being
15759
 * System message generated when a GROUP is being
15756
 * removed from a group
15760
 * removed from a group
15757
 *)
15761
 *)
15758
  PDPMsg_DeleteGroupFromGroup = ^TDPMsg_DeleteGroupFromGroup;
15762
  PDPMsg_DeleteGroupFromGroup = ^TDPMsg_DeleteGroupFromGroup;
15759
  TDPMsg_DeleteGroupFromGroup = TDPMsg_AddGroupToGroup;
15763
  TDPMsg_DeleteGroupFromGroup = TDPMsg_AddGroupToGroup;
15760
 
15764
 
15761
(*
15765
(*
15762
 * DPMSG_SETPLAYERORGROUPDATA
15766
 * DPMSG_SETPLAYERORGROUPDATA
15763
 * System message generated when remote data for a player or
15767
 * System message generated when remote data for a player or
15764
 * group has changed.
15768
 * group has changed.
15765
 *)
15769
 *)
15766
  PDPMsg_SetPlayerOrGroupData = ^TDPMsg_SetPlayerOrGroupData;
15770
  PDPMsg_SetPlayerOrGroupData = ^TDPMsg_SetPlayerOrGroupData;
15767
  TDPMsg_SetPlayerOrGroupData = packed record
15771
  TDPMsg_SetPlayerOrGroupData = packed record
15768
    dwType: DWORD;         // Message type
15772
    dwType: DWORD;         // Message type
15769
    dwPlayerType: DWORD;   // Is it a player or group
15773
    dwPlayerType: DWORD;   // Is it a player or group
15770
    DPID: TDPID;           // ID of player or group
15774
    DPID: TDPID;           // ID of player or group
15771
    lpData: Pointer;       // pointer to remote data
15775
    lpData: Pointer;       // pointer to remote data
15772
    dwDataSize: DWORD;     // size of remote data
15776
    dwDataSize: DWORD;     // size of remote data
15773
  end;
15777
  end;
15774
 
15778
 
15775
(*
15779
(*
15776
 * DPMSG_SETPLAYERORGROUPNAME
15780
 * DPMSG_SETPLAYERORGROUPNAME
15777
 * System message generated when the name of a player or
15781
 * System message generated when the name of a player or
15778
 * group has changed.
15782
 * group has changed.
15779
 *)
15783
 *)
15780
  PDPMsg_SetPlayerOrGroupName = ^TDPMsg_SetPlayerOrGroupName;
15784
  PDPMsg_SetPlayerOrGroupName = ^TDPMsg_SetPlayerOrGroupName;
15781
  TDPMsg_SetPlayerOrGroupName = packed record
15785
  TDPMsg_SetPlayerOrGroupName = packed record
15782
    dwType: DWORD;         // Message type
15786
    dwType: DWORD;         // Message type
15783
    dwPlayerType: DWORD;   // Is it a player or group
15787
    dwPlayerType: DWORD;   // Is it a player or group
15784
    DPID: TDPID;           // ID of player or group
15788
    DPID: TDPID;           // ID of player or group
15785
    dpnName: TDPName;      // structure with new name info
15789
    dpnName: TDPName;      // structure with new name info
15786
  end;
15790
  end;
15787
 
15791
 
15788
(*
15792
(*
15789
 * DPMSG_SETSESSIONDESC
15793
 * DPMSG_SETSESSIONDESC
15790
 * System message generated when session desc has changed
15794
 * System message generated when session desc has changed
15791
 *)
15795
 *)
15792
  PDPMsg_SetSessionDesc = ^TDPMsg_SetSessionDesc;
15796
  PDPMsg_SetSessionDesc = ^TDPMsg_SetSessionDesc;
15793
  TDPMsg_SetSessionDesc = packed record
15797
  TDPMsg_SetSessionDesc = packed record
15794
    dwType: DWORD;            // Message type
15798
    dwType: DWORD;            // Message type
15795
    dpDesc: TDPSessionDesc2;   // Session desc
15799
    dpDesc: TDPSessionDesc2;   // Session desc
15796
  end;
15800
  end;
15797
 
15801
 
15798
(*
15802
(*
15799
 * DPMSG_HOST
15803
 * DPMSG_HOST
15800
 * System message generated when the host has migrated to this
15804
 * System message generated when the host has migrated to this
15801
 * DirectPlay object.
15805
 * DirectPlay object.
15802
 *
15806
 *
15803
 *)
15807
 *)
15804
  PDPMsg_Host = ^TDPMsg_Host;
15808
  PDPMsg_Host = ^TDPMsg_Host;
15805
  TDPMsg_Host = TDPMsg_Generic;
15809
  TDPMsg_Host = TDPMsg_Generic;
15806
 
15810
 
15807
(*
15811
(*
15808
 * DPMSG_SESSIONLOST
15812
 * DPMSG_SESSIONLOST
15809
 * System message generated when the connection to the session is lost.
15813
 * System message generated when the connection to the session is lost.
15810
 *
15814
 *
15811
 *)
15815
 *)
15812
  PDPMsg_SessionLost = ^TDPMsg_SessionLost;
15816
  PDPMsg_SessionLost = ^TDPMsg_SessionLost;
15813
  TDPMsg_SessionLost = TDPMsg_Generic;
15817
  TDPMsg_SessionLost = TDPMsg_Generic;
15814
 
15818
 
15815
(*
15819
(*
15816
 * DPMSG_SECUREMESSAGE
15820
 * DPMSG_SECUREMESSAGE
15817
 * System message generated when a player requests a secure send
15821
 * System message generated when a player requests a secure send
15818
 *)
15822
 *)
15819
  PDPMsg_SecureMessage = ^TDPMsg_SecureMessage;
15823
  PDPMsg_SecureMessage = ^TDPMsg_SecureMessage;
15820
  TDPMsg_SecureMessage = packed record
15824
  TDPMsg_SecureMessage = packed record
15821
    dwType: DWORD;       // Message Type
15825
    dwType: DWORD;       // Message Type
15822
    dwFlags: DWORD;      // Signed/Encrypted
15826
    dwFlags: DWORD;      // Signed/Encrypted
15823
    dpIdFrom: TDPID;      // ID of Sending Player
15827
    dpIdFrom: TDPID;      // ID of Sending Player
15824
    lpData: Pointer;     // Player message
15828
    lpData: Pointer;     // Player message
15825
    dwDataSize: DWORD;   // Size of player message
15829
    dwDataSize: DWORD;   // Size of player message
15826
  end;
15830
  end;
15827
 
15831
 
15828
(*
15832
(*
15829
 * DPMSG_STARTSESSION
15833
 * DPMSG_STARTSESSION
15830
 * System message containing all information required to
15834
 * System message containing all information required to
15831
 * start a new session
15835
 * start a new session
15832
 *)
15836
 *)
15833
  PDPMsg_StartSession = ^TDPMsg_StartSession;
15837
  PDPMsg_StartSession = ^TDPMsg_StartSession;
15834
  TDPMsg_StartSession = packed record
15838
  TDPMsg_StartSession = packed record
15835
    dwType: DWORD;             // Message type
15839
    dwType: DWORD;             // Message type
15836
    lpConn: PDPLConnection;   // TDPLConnection structure
15840
    lpConn: PDPLConnection;   // TDPLConnection structure
15837
  end;
15841
  end;
15838
 
15842
 
15839
(*
15843
(*
15840
 * DPMSG_CHAT
15844
 * DPMSG_CHAT
15841
 * System message containing a chat message
15845
 * System message containing a chat message
15842
 *)
15846
 *)
15843
  PDPMsg_Chat = ^TDPMsg_Chat;
15847
  PDPMsg_Chat = ^TDPMsg_Chat;
15844
  TDPMsg_Chat = packed record
15848
  TDPMsg_Chat = packed record
15845
    dwType: DWORD;        // Message type
15849
    dwType: DWORD;        // Message type
15846
    dwFlags: DWORD;       // Message flags
15850
    dwFlags: DWORD;       // Message flags
15847
    idFromPlayer: TDPID;  // ID of the Sending Player
15851
    idFromPlayer: TDPID;  // ID of the Sending Player
15848
    idToPlayer: TDPID;    // ID of the To Player
15852
    idToPlayer: TDPID;    // ID of the To Player
15849
    idToGroup: TDPID;     // ID of the To Group
15853
    idToGroup: TDPID;     // ID of the To Group
15850
    lpChat: PDPChat;      // Pointer to a structure containing the chat message
15854
    lpChat: PDPChat;      // Pointer to a structure containing the chat message
15851
  end;
15855
  end;
15852
 
15856
 
15853
(*
15857
(*
15854
 * DPMSG_SETGROUPOWNER
15858
 * DPMSG_SETGROUPOWNER
15855
 * System message generated when the owner of a group has changed
15859
 * System message generated when the owner of a group has changed
15856
 *)
15860
 *)
15857
  PDPMsg_SetGroupOwner = ^TDPMsg_SetGroupOwner;
15861
  PDPMsg_SetGroupOwner = ^TDPMsg_SetGroupOwner;
15858
  TDPMsg_SetGroupOwner = packed record
15862
  TDPMsg_SetGroupOwner = packed record
15859
    dwType: DWORD;        // Message type
15863
    dwType: DWORD;        // Message type
15860
    idGroup: TDPID;       // ID of the group
15864
    idGroup: TDPID;       // ID of the group
15861
    idNewOwner: TDPID;    // ID of the player that is the new owner
15865
    idNewOwner: TDPID;    // ID of the player that is the new owner
15862
    idOldOwner: TDPID;    // ID of the player that used to be the owner
15866
    idOldOwner: TDPID;    // ID of the player that used to be the owner
15863
  end;
15867
  end;
15864
 
15868
 
15865
(*
15869
(*
15866
 * DPMSG_SENDCOMPLETE
15870
 * DPMSG_SENDCOMPLETE
15867
 * System message generated when finished with an Async Send message
15871
 * System message generated when finished with an Async Send message
15868
 *
15872
 *
15869
 * NOTE SENDPARMS has an overlay for DPMSG_SENDCOMPLETE, don't
15873
 * NOTE SENDPARMS has an overlay for DPMSG_SENDCOMPLETE, don't
15870
 *                change this message w/o changing SENDPARMS.
15874
 *                change this message w/o changing SENDPARMS.
15871
 *)
15875
 *)
15872
  PDPMsg_SendComplete = ^TDPMsg_SendComplete;
15876
  PDPMsg_SendComplete = ^TDPMsg_SendComplete;
15873
  TDPMsg_SendComplete = packed record
15877
  TDPMsg_SendComplete = packed record
15874
    dwType: DWORD;        // Message type
15878
    dwType: DWORD;        // Message type
15875
    idFrom: TDPID;
15879
    idFrom: TDPID;
15876
    idTo: TDPID;
15880
    idTo: TDPID;
15877
    dwFlags: DWORD;
15881
    dwFlags: DWORD;
15878
    dwPriority: DWORD;
15882
    dwPriority: DWORD;
15879
    dwTimeout: DWORD;
15883
    dwTimeout: DWORD;
15880
    lpvContext: Pointer;
15884
    lpvContext: Pointer;
15881
    dwMsgID: DWORD;
15885
    dwMsgID: DWORD;
15882
    hr: HRESULT;
15886
    hr: HRESULT;
15883
    dwSendTime: DWORD;
15887
    dwSendTime: DWORD;
15884
  end;
15888
  end;
15885
 
15889
 
15886
(****************************************************************************
15890
(****************************************************************************
15887
 *
15891
 *
15888
 * DIRECTPLAY ERRORS
15892
 * DIRECTPLAY ERRORS
15889
 *
15893
 *
15890
 * Errors are represented by negative values and cannot be combined.
15894
 * Errors are represented by negative values and cannot be combined.
15891
 *
15895
 *
15892
 ****************************************************************************)
15896
 ****************************************************************************)
15893
const
15897
const
15894
  MAKE_DPHRESULT = HResult($88770000);
15898
  MAKE_DPHRESULT = HResult($88770000);
15895
 
15899
 
15896
  DP_OK = S_OK;
15900
  DP_OK = S_OK;
15897
  DPERR_ALREADYINITIALIZED = MAKE_DPHRESULT + 5;
15901
  DPERR_ALREADYINITIALIZED = MAKE_DPHRESULT + 5;
15898
  DPERR_ACCESSDENIED = MAKE_DPHRESULT + 10;
15902
  DPERR_ACCESSDENIED = MAKE_DPHRESULT + 10;
15899
  DPERR_ACTIVEPLAYERS = MAKE_DPHRESULT + 20;
15903
  DPERR_ACTIVEPLAYERS = MAKE_DPHRESULT + 20;
15900
  DPERR_BUFFERTOOSMALL = MAKE_DPHRESULT + 30;
15904
  DPERR_BUFFERTOOSMALL = MAKE_DPHRESULT + 30;
15901
  DPERR_CANTADDPLAYER = MAKE_DPHRESULT + 40;
15905
  DPERR_CANTADDPLAYER = MAKE_DPHRESULT + 40;
15902
  DPERR_CANTCREATEGROUP = MAKE_DPHRESULT + 50;
15906
  DPERR_CANTCREATEGROUP = MAKE_DPHRESULT + 50;
15903
  DPERR_CANTCREATEPLAYER = MAKE_DPHRESULT + 60;
15907
  DPERR_CANTCREATEPLAYER = MAKE_DPHRESULT + 60;
15904
  DPERR_CANTCREATESESSION = MAKE_DPHRESULT + 70;
15908
  DPERR_CANTCREATESESSION = MAKE_DPHRESULT + 70;
15905
  DPERR_CAPSNOTAVAILABLEYET = MAKE_DPHRESULT + 80;
15909
  DPERR_CAPSNOTAVAILABLEYET = MAKE_DPHRESULT + 80;
15906
  DPERR_EXCEPTION = MAKE_DPHRESULT + 90;
15910
  DPERR_EXCEPTION = MAKE_DPHRESULT + 90;
15907
  DPERR_GENERIC = E_FAIL;
15911
  DPERR_GENERIC = E_FAIL;
15908
  DPERR_INVALIDFLAGS = MAKE_DPHRESULT + 120;
15912
  DPERR_INVALIDFLAGS = MAKE_DPHRESULT + 120;
15909
  DPERR_INVALIDOBJECT = MAKE_DPHRESULT + 130;
15913
  DPERR_INVALIDOBJECT = MAKE_DPHRESULT + 130;
15910
  DPERR_INVALIDPARAM = E_INVALIDARG;
15914
  DPERR_INVALIDPARAM = E_INVALIDARG;
15911
  DPERR_INVALIDPARAMS = DPERR_INVALIDPARAM;
15915
  DPERR_INVALIDPARAMS = DPERR_INVALIDPARAM;
15912
  DPERR_INVALIDPLAYER = MAKE_DPHRESULT + 150;
15916
  DPERR_INVALIDPLAYER = MAKE_DPHRESULT + 150;
15913
  DPERR_INVALIDGROUP = MAKE_DPHRESULT + 155;
15917
  DPERR_INVALIDGROUP = MAKE_DPHRESULT + 155;
15914
  DPERR_NOCAPS = MAKE_DPHRESULT + 160;
15918
  DPERR_NOCAPS = MAKE_DPHRESULT + 160;
15915
  DPERR_NOCONNECTION = MAKE_DPHRESULT + 170;
15919
  DPERR_NOCONNECTION = MAKE_DPHRESULT + 170;
15916
  DPERR_NOMEMORY = E_OUTOFMEMORY;
15920
  DPERR_NOMEMORY = E_OUTOFMEMORY;
15917
  DPERR_OUTOFMEMORY = DPERR_NOMEMORY;
15921
  DPERR_OUTOFMEMORY = DPERR_NOMEMORY;
15918
  DPERR_NOMESSAGES = MAKE_DPHRESULT + 190;
15922
  DPERR_NOMESSAGES = MAKE_DPHRESULT + 190;
15919
  DPERR_NONAMESERVERFOUND = MAKE_DPHRESULT + 200;
15923
  DPERR_NONAMESERVERFOUND = MAKE_DPHRESULT + 200;
15920
  DPERR_NOPLAYERS = MAKE_DPHRESULT + 210;
15924
  DPERR_NOPLAYERS = MAKE_DPHRESULT + 210;
15921
  DPERR_NOSESSIONS = MAKE_DPHRESULT + 220;
15925
  DPERR_NOSESSIONS = MAKE_DPHRESULT + 220;
15922
  DPERR_PENDING = E_PENDING;
15926
  DPERR_PENDING = E_PENDING;
15923
  DPERR_SENDTOOBIG = MAKE_DPHRESULT + 230;
15927
  DPERR_SENDTOOBIG = MAKE_DPHRESULT + 230;
15924
  DPERR_TIMEOUT = MAKE_DPHRESULT + 240;
15928
  DPERR_TIMEOUT = MAKE_DPHRESULT + 240;
15925
  DPERR_UNAVAILABLE = MAKE_DPHRESULT + 250;
15929
  DPERR_UNAVAILABLE = MAKE_DPHRESULT + 250;
15926
  DPERR_UNSUPPORTED = E_NOTIMPL;
15930
  DPERR_UNSUPPORTED = E_NOTIMPL;
15927
  DPERR_BUSY = MAKE_DPHRESULT + 270;
15931
  DPERR_BUSY = MAKE_DPHRESULT + 270;
15928
  DPERR_USERCANCEL = MAKE_DPHRESULT + 280;
15932
  DPERR_USERCANCEL = MAKE_DPHRESULT + 280;
15929
  DPERR_NOINTERFACE = E_NOINTERFACE;
15933
  DPERR_NOINTERFACE = E_NOINTERFACE;
15930
  DPERR_CANNOTCREATESERVER = MAKE_DPHRESULT + 290;
15934
  DPERR_CANNOTCREATESERVER = MAKE_DPHRESULT + 290;
15931
  DPERR_PLAYERLOST = MAKE_DPHRESULT + 300;
15935
  DPERR_PLAYERLOST = MAKE_DPHRESULT + 300;
15932
  DPERR_SESSIONLOST = MAKE_DPHRESULT + 310;
15936
  DPERR_SESSIONLOST = MAKE_DPHRESULT + 310;
15933
  DPERR_UNINITIALIZED = MAKE_DPHRESULT + 320;
15937
  DPERR_UNINITIALIZED = MAKE_DPHRESULT + 320;
15934
  DPERR_NONEWPLAYERS = MAKE_DPHRESULT + 330;
15938
  DPERR_NONEWPLAYERS = MAKE_DPHRESULT + 330;
15935
  DPERR_INVALIDPASSWORD = MAKE_DPHRESULT + 340;
15939
  DPERR_INVALIDPASSWORD = MAKE_DPHRESULT + 340;
15936
  DPERR_CONNECTING = MAKE_DPHRESULT + 350;
15940
  DPERR_CONNECTING = MAKE_DPHRESULT + 350;
15937
  DPERR_CONNECTIONLOST = MAKE_DPHRESULT + 360;
15941
  DPERR_CONNECTIONLOST = MAKE_DPHRESULT + 360;
15938
  DPERR_UNKNOWNMESSAGE = MAKE_DPHRESULT + 370;
15942
  DPERR_UNKNOWNMESSAGE = MAKE_DPHRESULT + 370;
15939
  DPERR_CANCELFAILED = MAKE_DPHRESULT + 380;
15943
  DPERR_CANCELFAILED = MAKE_DPHRESULT + 380;
15940
  DPERR_INVALIDPRIORITY = MAKE_DPHRESULT + 390;
15944
  DPERR_INVALIDPRIORITY = MAKE_DPHRESULT + 390;
15941
  DPERR_NOTHANDLED = MAKE_DPHRESULT + 400;
15945
  DPERR_NOTHANDLED = MAKE_DPHRESULT + 400;
15942
  DPERR_CANCELLED = MAKE_DPHRESULT + 410;
15946
  DPERR_CANCELLED = MAKE_DPHRESULT + 410;
15943
  DPERR_ABORTED = MAKE_DPHRESULT + 420;
15947
  DPERR_ABORTED = MAKE_DPHRESULT + 420;
15944
 
15948
 
15945
 
15949
 
15946
  DPERR_BUFFERTOOLARGE = MAKE_DPHRESULT + 1000;
15950
  DPERR_BUFFERTOOLARGE = MAKE_DPHRESULT + 1000;
15947
  DPERR_CANTCREATEPROCESS = MAKE_DPHRESULT + 1010;
15951
  DPERR_CANTCREATEPROCESS = MAKE_DPHRESULT + 1010;
15948
  DPERR_APPNOTSTARTED = MAKE_DPHRESULT + 1020;
15952
  DPERR_APPNOTSTARTED = MAKE_DPHRESULT + 1020;
15949
  DPERR_INVALIDINTERFACE = MAKE_DPHRESULT + 1030;
15953
  DPERR_INVALIDINTERFACE = MAKE_DPHRESULT + 1030;
15950
  DPERR_NOSERVICEPROVIDER = MAKE_DPHRESULT + 1040;
15954
  DPERR_NOSERVICEPROVIDER = MAKE_DPHRESULT + 1040;
15951
  DPERR_UNKNOWNAPPLICATION = MAKE_DPHRESULT + 1050;
15955
  DPERR_UNKNOWNAPPLICATION = MAKE_DPHRESULT + 1050;
15952
  DPERR_NOTLOBBIED = MAKE_DPHRESULT + 1070;
15956
  DPERR_NOTLOBBIED = MAKE_DPHRESULT + 1070;
15953
  DPERR_SERVICEPROVIDERLOADED = MAKE_DPHRESULT + 1080;
15957
  DPERR_SERVICEPROVIDERLOADED = MAKE_DPHRESULT + 1080;
15954
  DPERR_ALREADYREGISTERED = MAKE_DPHRESULT + 1090;
15958
  DPERR_ALREADYREGISTERED = MAKE_DPHRESULT + 1090;
15955
  DPERR_NOTREGISTERED = MAKE_DPHRESULT + 1100;
15959
  DPERR_NOTREGISTERED = MAKE_DPHRESULT + 1100;
15956
 
15960
 
15957
//
15961
//
15958
// Security related errors
15962
// Security related errors
15959
//
15963
//
15960
  DPERR_AUTHENTICATIONFAILED = MAKE_DPHRESULT + 2000;
15964
  DPERR_AUTHENTICATIONFAILED = MAKE_DPHRESULT + 2000;
15961
  DPERR_CANTLOADSSPI = MAKE_DPHRESULT + 2010;
15965
  DPERR_CANTLOADSSPI = MAKE_DPHRESULT + 2010;
15962
  DPERR_ENCRYPTIONFAILED = MAKE_DPHRESULT + 2020;
15966
  DPERR_ENCRYPTIONFAILED = MAKE_DPHRESULT + 2020;
15963
  DPERR_SIGNFAILED = MAKE_DPHRESULT + 2030;
15967
  DPERR_SIGNFAILED = MAKE_DPHRESULT + 2030;
15964
  DPERR_CANTLOADSECURITYPACKAGE = MAKE_DPHRESULT + 2040;
15968
  DPERR_CANTLOADSECURITYPACKAGE = MAKE_DPHRESULT + 2040;
15965
  DPERR_ENCRYPTIONNOTSUPPORTED = MAKE_DPHRESULT + 2050;
15969
  DPERR_ENCRYPTIONNOTSUPPORTED = MAKE_DPHRESULT + 2050;
15966
  DPERR_CANTLOADCAPI = MAKE_DPHRESULT + 2060;
15970
  DPERR_CANTLOADCAPI = MAKE_DPHRESULT + 2060;
15967
  DPERR_NOTLOGGEDIN = MAKE_DPHRESULT + 2070;
15971
  DPERR_NOTLOGGEDIN = MAKE_DPHRESULT + 2070;
15968
  DPERR_LOGONDENIED = MAKE_DPHRESULT + 2080;
15972
  DPERR_LOGONDENIED = MAKE_DPHRESULT + 2080;
15969
 
15973
 
15970
(****************************************************************************
15974
(****************************************************************************
15971
 *
15975
 *
15972
 *      dplay 1.0 obsolete structures + interfaces
15976
 *      dplay 1.0 obsolete structures + interfaces
15973
 *      Included for compatibility only. New apps should
15977
 *      Included for compatibility only. New apps should
15974
 *      use IDirectPlay2
15978
 *      use IDirectPlay2
15975
 *
15979
 *
15976
 ****************************************************************************)
15980
 ****************************************************************************)
15977
 
15981
 
15978
  DPOPEN_OPENSESSION = DPOPEN_JOIN;
15982
  DPOPEN_OPENSESSION = DPOPEN_JOIN;
15979
  DPOPEN_CREATESESSION = DPOPEN_CREATE;
15983
  DPOPEN_CREATESESSION = DPOPEN_CREATE;
15980
 
15984
 
15981
  DPENUMSESSIONS_PREVIOUS = $00000004;
15985
  DPENUMSESSIONS_PREVIOUS = $00000004;
15982
 
15986
 
15983
  DPENUMPLAYERS_PREVIOUS = $00000004;
15987
  DPENUMPLAYERS_PREVIOUS = $00000004;
15984
 
15988
 
15985
  DPSEND_GUARANTEE = DPSEND_GUARANTEED;
15989
  DPSEND_GUARANTEE = DPSEND_GUARANTEED;
15986
  DPSEND_TRYONCE = $00000004;
15990
  DPSEND_TRYONCE = $00000004;
15987
 
15991
 
15988
  DPCAPS_NAMESERVICE = $00000001;
15992
  DPCAPS_NAMESERVICE = $00000001;
15989
  DPCAPS_NAMESERVER = DPCAPS_ISHOST;
15993
  DPCAPS_NAMESERVER = DPCAPS_ISHOST;
15990
  DPCAPS_GUARANTEED = $00000004;
15994
  DPCAPS_GUARANTEED = $00000004;
15991
 
15995
 
15992
  DPLONGNAMELEN = 52;
15996
  DPLONGNAMELEN = 52;
15993
  DPSHORTNAMELEN = 20;
15997
  DPSHORTNAMELEN = 20;
15994
  DPSESSIONNAMELEN = 32;
15998
  DPSESSIONNAMELEN = 32;
15995
  DPPASSWORDLEN = 16;
15999
  DPPASSWORDLEN = 16;
15996
  DPUSERRESERVED = 16;
16000
  DPUSERRESERVED = 16;
15997
 
16001
 
15998
  DPSYS_ADDPLAYER = $0003;
16002
  DPSYS_ADDPLAYER = $0003;
15999
  DPSYS_DELETEPLAYER = $0005;
16003
  DPSYS_DELETEPLAYER = $0005;
16000
 
16004
 
16001
  DPSYS_DELETEGROUP = $0020;
16005
  DPSYS_DELETEGROUP = $0020;
16002
  DPSYS_DELETEPLAYERFROMGRP = $0021;
16006
  DPSYS_DELETEPLAYERFROMGRP = $0021;
16003
  DPSYS_CONNECT = $484b;
16007
  DPSYS_CONNECT = $484b;
16004
 
16008
 
16005
type
16009
type
16006
  PDPMsg_AddPlayer = ^TDPMsg_AddPlayer;
16010
  PDPMsg_AddPlayer = ^TDPMsg_AddPlayer;
16007
  TDPMsg_AddPlayer = packed record
16011
  TDPMsg_AddPlayer = packed record
16008
    dwType: DWORD;
16012
    dwType: DWORD;
16009
    dwPlayerType: DWORD;
16013
    dwPlayerType: DWORD;
16010
    DPID: TDPID;
16014
    DPID: TDPID;
16011
    szLongName: array[0..DPLONGNAMELEN-1] of Char;
16015
    szLongName: array[0..DPLONGNAMELEN-1] of Char;
16012
    szShortName: array[0..DPSHORTNAMELEN-1] of Char;
16016
    szShortName: array[0..DPSHORTNAMELEN-1] of Char;
16013
    dwCurrentPlayers: DWORD;
16017
    dwCurrentPlayers: DWORD;
16014
  end;
16018
  end;
16015
 
16019
 
16016
  PDPMsg_AddGroup = ^TDPMsg_AddGroup;
16020
  PDPMsg_AddGroup = ^TDPMsg_AddGroup;
16017
  TDPMsg_AddGroup = TDPMsg_AddPlayer;
16021
  TDPMsg_AddGroup = TDPMsg_AddPlayer;
16018
 
16022
 
16019
  PDPMsg_GroupAdd = ^TDPMsg_GroupAdd;
16023
  PDPMsg_GroupAdd = ^TDPMsg_GroupAdd;
16020
  TDPMsg_GroupAdd = packed record
16024
  TDPMsg_GroupAdd = packed record
16021
    dwType: DWORD;
16025
    dwType: DWORD;
16022
    dpIdGroup: TDPID;
16026
    dpIdGroup: TDPID;
16023
    dpIdPlayer: TDPID;
16027
    dpIdPlayer: TDPID;
16024
  end;
16028
  end;
16025
 
16029
 
16026
  PDPMsg_GroupDelete = ^TDPMsg_GroupDelete;
16030
  PDPMsg_GroupDelete = ^TDPMsg_GroupDelete;
16027
  TDPMsg_GroupDelete = TDPMsg_GroupAdd;
16031
  TDPMsg_GroupDelete = TDPMsg_GroupAdd;
16028
 
16032
 
16029
  PDPMsg_DeletePlayer = ^TDPMsg_DeletePlayer;
16033
  PDPMsg_DeletePlayer = ^TDPMsg_DeletePlayer;
16030
  TDPMsg_DeletePlayer = packed record
16034
  TDPMsg_DeletePlayer = packed record
16031
    dwType: DWORD;
16035
    dwType: DWORD;
16032
    DPID: TDPID;
16036
    DPID: TDPID;
16033
  end;
16037
  end;
16034
 
16038
 
16035
  TDPEnumPlayersCallback = function(dpId: TDPID; lpFriendlyName: PChar;
16039
  TDPEnumPlayersCallback = function(dpId: TDPID; lpFriendlyName: PChar;
16036
      lpFormalName: PChar; dwFlags: DWORD; lpContext: Pointer) : BOOL; stdcall;
16040
      lpFormalName: PChar; dwFlags: DWORD; lpContext: Pointer) : BOOL; stdcall;
16037
 
16041
 
16038
  PDPSessionDesc = ^TDPSessionDesc;
16042
  PDPSessionDesc = ^TDPSessionDesc;
16039
  TDPSessionDesc = packed record
16043
  TDPSessionDesc = packed record
16040
    dwSize: DWORD;
16044
    dwSize: DWORD;
16041
    guidSession: TGUID;
16045
    guidSession: TGUID;
16042
    dwSession: DWORD;
16046
    dwSession: DWORD;
16043
    dwMaxPlayers: DWORD;
16047
    dwMaxPlayers: DWORD;
16044
    dwCurrentPlayers: DWORD;
16048
    dwCurrentPlayers: DWORD;
16045
    dwFlags: DWORD;
16049
    dwFlags: DWORD;
16046
    szSessionName: Array [0..DPSESSIONNAMELEN-1] of char;
16050
    szSessionName: Array [0..DPSESSIONNAMELEN-1] of char;
16047
    szUserField: Array [0..DPUSERRESERVED-1] of char;
16051
    szUserField: Array [0..DPUSERRESERVED-1] of char;
16048
    dwReserved1: DWORD;
16052
    dwReserved1: DWORD;
16049
    szPassword: Array [0..DPPASSWORDLEN-1] of char;
16053
    szPassword: Array [0..DPPASSWORDLEN-1] of char;
16050
    dwReserved2: DWORD;
16054
    dwReserved2: DWORD;
16051
    dwUser1: DWORD;
16055
    dwUser1: DWORD;
16052
    dwUser2: DWORD;
16056
    dwUser2: DWORD;
16053
    dwUser3: DWORD;
16057
    dwUser3: DWORD;
16054
    dwUser4: DWORD;
16058
    dwUser4: DWORD;
16055
  end;
16059
  end;
16056
 
16060
 
16057
  TDPEnumSessionsCallback = function(const lpDPSessionDesc: TDPSessionDesc;
16061
  TDPEnumSessionsCallback = function(const lpDPSessionDesc: TDPSessionDesc;
16058
      lpContext: Pointer; var lpdwTimeOut: DWORD; dwFlags: DWORD) : BOOL; stdcall;
16062
      lpContext: Pointer; var lpdwTimeOut: DWORD; dwFlags: DWORD) : BOOL; stdcall;
16059
 
16063
 
16060
type
16064
type
16061
  IDirectPlay = interface (IUnknown)
16065
  IDirectPlay = interface (IUnknown)
16062
    ['{5454e9a0-db65-11ce-921c-00aa006c4972}']
16066
    ['{5454e9a0-db65-11ce-921c-00aa006c4972}']
16063
    (*** IDirectPlay methods ***)
16067
    (*** IDirectPlay methods ***)
16064
    function AddPlayerToGroup(pidGroup: TDPID; pidPlayer: TDPID) : HResult; stdcall;
16068
    function AddPlayerToGroup(pidGroup: TDPID; pidPlayer: TDPID) : HResult; stdcall;
16065
    function Close: HResult; stdcall;
16069
    function Close: HResult; stdcall;
16066
    function CreatePlayer(out lppidID: TDPID; lpPlayerFriendlyName: PChar;
16070
    function CreatePlayer(out lppidID: TDPID; lpPlayerFriendlyName: PChar;
16067
        lpPlayerFormalName: PChar; lpEvent: PHandle) : HResult; stdcall;
16071
        lpPlayerFormalName: PChar; lpEvent: PHandle) : HResult; stdcall;
16068
    function CreateGroup(out lppidID: TDPID; lpGroupFriendlyName: PChar;
16072
    function CreateGroup(out lppidID: TDPID; lpGroupFriendlyName: PChar;
16069
        lpGroupFormalName: PChar) : HResult; stdcall;
16073
        lpGroupFormalName: PChar) : HResult; stdcall;
16070
    function DeletePlayerFromGroup(pidGroup: TDPID; pidPlayer: TDPID) : HResult; stdcall;
16074
    function DeletePlayerFromGroup(pidGroup: TDPID; pidPlayer: TDPID) : HResult; stdcall;
16071
    function DestroyPlayer(pidID: TDPID) : HResult; stdcall;
16075
    function DestroyPlayer(pidID: TDPID) : HResult; stdcall;
16072
    function DestroyGroup(pidID: TDPID) : HResult; stdcall;
16076
    function DestroyGroup(pidID: TDPID) : HResult; stdcall;
16073
    function EnableNewPlayers(bEnable: BOOL) : HResult; stdcall;
16077
    function EnableNewPlayers(bEnable: BOOL) : HResult; stdcall;
16074
    function EnumGroupPlayers(pidGroupPID: TDPID; lpEnumPlayersCallback:
16078
    function EnumGroupPlayers(pidGroupPID: TDPID; lpEnumPlayersCallback:
16075
        TDPEnumPlayersCallback; lpContext: Pointer; dwFlags: DWORD) : HResult; stdcall;
16079
        TDPEnumPlayersCallback; lpContext: Pointer; dwFlags: DWORD) : HResult; stdcall;
16076
    function EnumGroups(dwSessionID: DWORD; lpEnumPlayersCallback:
16080
    function EnumGroups(dwSessionID: DWORD; lpEnumPlayersCallback:
16077
        TDPEnumPlayersCallback; lpContext: Pointer; dwFlags: DWORD) : HResult; stdcall;
16081
        TDPEnumPlayersCallback; lpContext: Pointer; dwFlags: DWORD) : HResult; stdcall;
16078
    function EnumPlayers(dwSessionId: DWORD; lpEnumPlayersCallback:
16082
    function EnumPlayers(dwSessionId: DWORD; lpEnumPlayersCallback:
16079
        TDPEnumPlayersCallback; lpContext: Pointer; dwFlags: DWORD) : HResult; stdcall;
16083
        TDPEnumPlayersCallback; lpContext: Pointer; dwFlags: DWORD) : HResult; stdcall;
16080
    function EnumSessions(var lpSDesc: TDPSessionDesc; dwTimeout: DWORD;
16084
    function EnumSessions(var lpSDesc: TDPSessionDesc; dwTimeout: DWORD;
16081
        lpEnumSessionsCallback: TDPEnumSessionsCallback; lpContext: Pointer;
16085
        lpEnumSessionsCallback: TDPEnumSessionsCallback; lpContext: Pointer;
16082
        dwFlags: DWORD) : HResult; stdcall;
16086
        dwFlags: DWORD) : HResult; stdcall;
16083
    function GetCaps(var lpDPCaps: TDPCaps) : HResult; stdcall;
16087
    function GetCaps(var lpDPCaps: TDPCaps) : HResult; stdcall;
16084
    function GetMessageCount(pidID: TDPID; var lpdwCount: DWORD) : HResult; stdcall;
16088
    function GetMessageCount(pidID: TDPID; var lpdwCount: DWORD) : HResult; stdcall;
16085
    function GetPlayerCaps(pidID: TDPID; var lpDPPlayerCaps: TDPCaps) : HResult; stdcall;
16089
    function GetPlayerCaps(pidID: TDPID; var lpDPPlayerCaps: TDPCaps) : HResult; stdcall;
16086
    function GetPlayerName(pidID: TDPID; lpPlayerFriendlyName: PChar;
16090
    function GetPlayerName(pidID: TDPID; lpPlayerFriendlyName: PChar;
16087
        var lpdwFriendlyNameLength: DWORD; lpPlayerFormalName: PChar;
16091
        var lpdwFriendlyNameLength: DWORD; lpPlayerFormalName: PChar;
16088
        var lpdwFormalNameLength: DWORD) : HResult; stdcall;
16092
        var lpdwFormalNameLength: DWORD) : HResult; stdcall;
16089
    function Initialize(const lpGUID: TGUID) : HResult; stdcall;
16093
    function Initialize(const lpGUID: TGUID) : HResult; stdcall;
16090
    function Open(var lpSDesc: TDPSessionDesc) : HResult; stdcall;
16094
    function Open(var lpSDesc: TDPSessionDesc) : HResult; stdcall;
16091
    function Receive(var lppidFrom, lppidTo: TDPID; dwFlags: DWORD;
16095
    function Receive(var lppidFrom, lppidTo: TDPID; dwFlags: DWORD;
16092
        var lpvBuffer; var lpdwSize: DWORD) : HResult; stdcall;
16096
        var lpvBuffer; var lpdwSize: DWORD) : HResult; stdcall;
16093
    function SaveSession(lpSessionName: PChar) : HResult; stdcall;
16097
    function SaveSession(lpSessionName: PChar) : HResult; stdcall;
16094
    function Send(pidFrom: TDPID; pidTo: TDPID; dwFlags: DWORD;
16098
    function Send(pidFrom: TDPID; pidTo: TDPID; dwFlags: DWORD;
16095
        var lpvBuffer; dwBuffSize: DWORD) : HResult; stdcall;
16099
        var lpvBuffer; dwBuffSize: DWORD) : HResult; stdcall;
16096
    function SetPlayerName(pidID: TDPID; lpPlayerFriendlyName: PChar;
16100
    function SetPlayerName(pidID: TDPID; lpPlayerFriendlyName: PChar;
16097
        lpPlayerFormalName: PChar) : HResult; stdcall;
16101
        lpPlayerFormalName: PChar) : HResult; stdcall;
16098
  end;
16102
  end;
16099
 
16103
 
16100
(*
16104
(*
16101
 * GUIDS used by DirectPlay objects
16105
 * GUIDS used by DirectPlay objects
16102
 *)
16106
 *)
16103
  IID_IDirectPlay2W = IDirectPlay2W;
16107
  IID_IDirectPlay2W = IDirectPlay2W;
16104
  IID_IDirectPlay2A = IDirectPlay2A;
16108
  IID_IDirectPlay2A = IDirectPlay2A;
16105
  IID_IDirectPlay2 =  IDirectPlay2;
16109
  IID_IDirectPlay2 =  IDirectPlay2;
16106
 
16110
 
16107
  IID_IDirectPlay3W = IDirectPlay3W;
16111
  IID_IDirectPlay3W = IDirectPlay3W;
16108
  IID_IDirectPlay3A = IDirectPlay3A;
16112
  IID_IDirectPlay3A = IDirectPlay3A;
16109
  IID_IDirectPlay3 =  IDirectPlay3;
16113
  IID_IDirectPlay3 =  IDirectPlay3;
16110
 
16114
 
16111
  IID_IDirectPlay4W = IDirectPlay4W;
16115
  IID_IDirectPlay4W = IDirectPlay4W;
16112
  IID_IDirectPlay4A = IDirectPlay4A;
16116
  IID_IDirectPlay4A = IDirectPlay4A;
16113
  IID_IDirectPlay4 =  IDirectPlay4;
16117
  IID_IDirectPlay4 =  IDirectPlay4;
16114
 
16118
 
16115
  IID_IDirectPlay = IDirectPlay;
16119
  IID_IDirectPlay = IDirectPlay;
16116
 
16120
 
16117
var
16121
var
16118
  DirectPlayCreate : function (lpGUID: PGUID; out lplpDP: IDirectPlay;
16122
  DirectPlayCreate : function (lpGUID: PGUID; out lplpDP: IDirectPlay;
16119
      pUnk: IUnknown) : HResult; stdcall;
16123
      pUnk: IUnknown) : HResult; stdcall;
16120
 
16124
 
16121
(*==========================================================================;
16125
(*==========================================================================;
16122
 *
16126
 *
16123
 *  Copyright (C) 1996-1997 Microsoft Corporation.  All Rights Reserved.
16127
 *  Copyright (C) 1996-1997 Microsoft Corporation.  All Rights Reserved.
16124
 *
16128
 *
16125
 *  File:       dplobby.h
16129
 *  File:       dplobby.h
16126
 *  Content:    DirectPlayLobby include file
16130
 *  Content:    DirectPlayLobby include file
16127
 ***************************************************************************)
16131
 ***************************************************************************)
16128
 
16132
 
16129
(*
16133
(*
16130
 * GUIDS used by DirectPlay objects
16134
 * GUIDS used by DirectPlay objects
16131
 *)
16135
 *)
16132
 
16136
 
16133
const
16137
const
16134
(* {2FE8F810-B2A5-11d0-A787-0000F803ABFC} *)
16138
(* {2FE8F810-B2A5-11d0-A787-0000F803ABFC} *)
16135
  CLSID_DirectPlayLobby: TGUID =
16139
  CLSID_DirectPlayLobby: TGUID =
16136
      (D1:$2fe8f810;D2:$b2a5;D3:$11d0;D4:($a7,$87,$00,$00,$f8,$3,$ab,$fc));
16140
      (D1:$2fe8f810;D2:$b2a5;D3:$11d0;D4:($a7,$87,$00,$00,$f8,$3,$ab,$fc));
16137
 
16141
 
16138
(****************************************************************************
16142
(****************************************************************************
16139
 *
16143
 *
16140
 * IDirectPlayLobby Structures
16144
 * IDirectPlayLobby Structures
16141
 *
16145
 *
16142
 * Various structures used to invoke DirectPlayLobby.
16146
 * Various structures used to invoke DirectPlayLobby.
16143
 *
16147
 *
16144
 ****************************************************************************)
16148
 ****************************************************************************)
16145
 
16149
 
16146
type
16150
type
16147
(*
16151
(*
16148
 * TDPLAppInfo
16152
 * TDPLAppInfo
16149
 * Used to hold information about a registered DirectPlay
16153
 * Used to hold information about a registered DirectPlay
16150
 * application
16154
 * application
16151
 *)
16155
 *)
16152
  PDPLAppInfo = ^TDPLAppInfo;
16156
  PDPLAppInfo = ^TDPLAppInfo;
16153
  TDPLAppInfo = packed record
16157
  TDPLAppInfo = packed record
16154
    dwSize: DWORD;            // Size of this structure
16158
    dwSize: DWORD;            // Size of this structure
16155
    guidApplication: TGUID;   // GUID of the Application
16159
    guidApplication: TGUID;   // GUID of the Application
16156
    case Integer of           // Pointer to the Application Name
16160
    case Integer of           // Pointer to the Application Name
16157
      0: (lpszAppName: PCharAW);
16161
      0: (lpszAppName: PCharAW);
16158
      1: (lpszAppNameW: PWideChar);
16162
      1: (lpszAppNameW: PWideChar);
16159
      3: (lpszAppNameA: PChar);
16163
      3: (lpszAppNameA: PChar);
16160
  end;
16164
  end;
16161
 
16165
 
16162
(*
16166
(*
16163
 * TDPCompoundAddressElement
16167
 * TDPCompoundAddressElement
16164
 *
16168
 *
16165
 * An array of these is passed to CreateCompoundAddresses()
16169
 * An array of these is passed to CreateCompoundAddresses()
16166
 *)
16170
 *)
16167
  PDPCompoundAddressElement = ^TDPCompoundAddressElement;
16171
  PDPCompoundAddressElement = ^TDPCompoundAddressElement;
16168
  TDPCompoundAddressElement = packed record
16172
  TDPCompoundAddressElement = packed record
16169
    guidDataType: TGUID;
16173
    guidDataType: TGUID;
16170
    dwDataSize: DWORD;
16174
    dwDataSize: DWORD;
16171
    lpData: Pointer;
16175
    lpData: Pointer;
16172
  end;                                
16176
  end;                                
16173
 
16177
 
16174
(*
16178
(*
16175
 * TDPApplicationDesc
16179
 * TDPApplicationDesc
16176
 * Used to register a DirectPlay application
16180
 * Used to register a DirectPlay application
16177
 *)
16181
 *)
16178
  PDPApplicationDesc = ^TDPApplicationDesc;
16182
  PDPApplicationDesc = ^TDPApplicationDesc;
16179
  TDPApplicationDesc = packed record
16183
  TDPApplicationDesc = packed record
16180
    dwSize: DWORD;
16184
    dwSize: DWORD;
16181
    dwFlags: DWORD;
16185
    dwFlags: DWORD;
16182
    case integer of
16186
    case integer of
16183
      0 : (lpszApplicationName: PCharAW;
16187
      0 : (lpszApplicationName: PCharAW;
16184
           guidApplication: TGUID;
16188
           guidApplication: TGUID;
16185
           lpszFilename: PCharAW;
16189
           lpszFilename: PCharAW;
16186
           lpszCommandLine: PCharAW;
16190
           lpszCommandLine: PCharAW;
16187
           lpszPath: PCharAW;
16191
           lpszPath: PCharAW;
16188
           lpszCurrentDirectory: PCharAW;
16192
           lpszCurrentDirectory: PCharAW;
16189
           lpszDescriptionA: PAnsiChar;
16193
           lpszDescriptionA: PAnsiChar;
16190
           lpszDescriptionW: PWideChar);
16194
           lpszDescriptionW: PWideChar);
16191
      1 : (lpszApplicationNameA: PAnsiChar;
16195
      1 : (lpszApplicationNameA: PAnsiChar;
16192
           filler1: TGUID;
16196
           filler1: TGUID;
16193
           lpszFilenameA: PAnsiChar;
16197
           lpszFilenameA: PAnsiChar;
16194
           lpszCommandLineA: PAnsiChar;
16198
           lpszCommandLineA: PAnsiChar;
16195
           lpszPathA: PAnsiChar;
16199
           lpszPathA: PAnsiChar;
16196
           lpszCurrentDirectoryA: PAnsiChar);
16200
           lpszCurrentDirectoryA: PAnsiChar);
16197
      2 : (lpszApplicationNameW: PWideChar;
16201
      2 : (lpszApplicationNameW: PWideChar;
16198
           filler2: TGUID;
16202
           filler2: TGUID;
16199
           lpszFilenameW: PWideChar;
16203
           lpszFilenameW: PWideChar;
16200
           lpszCommandLineW: PWideChar;
16204
           lpszCommandLineW: PWideChar;
16201
           lpszPathW: PWideChar;
16205
           lpszPathW: PWideChar;
16202
           lpszCurrentDirectoryW: PWideChar);
16206
           lpszCurrentDirectoryW: PWideChar);
16203
  end;
16207
  end;
16204
 
16208
 
16205
(*
16209
(*
16206
 * TDPApplicationDesc2
16210
 * TDPApplicationDesc2
16207
 * Used to register a DirectPlay application
16211
 * Used to register a DirectPlay application
16208
 *)
16212
 *)
16209
  PDPApplicationDesc2 = ^TDPApplicationDesc2;
16213
  PDPApplicationDesc2 = ^TDPApplicationDesc2;
16210
  TDPApplicationDesc2 = packed record
16214
  TDPApplicationDesc2 = packed record
16211
    dwSize: DWORD;
16215
    dwSize: DWORD;
16212
    dwFlags: DWORD;
16216
    dwFlags: DWORD;
16213
    case integer of
16217
    case integer of
16214
      0 : (lpszApplicationName: PCharAW;
16218
      0 : (lpszApplicationName: PCharAW;
16215
           guidApplication: TGUID;
16219
           guidApplication: TGUID;
16216
           lpszFilename: PCharAW;
16220
           lpszFilename: PCharAW;
16217
           lpszCommandLine: PCharAW;
16221
           lpszCommandLine: PCharAW;
16218
           lpszPath: PCharAW;
16222
           lpszPath: PCharAW;
16219
           lpszCurrentDirectory: PCharAW;
16223
           lpszCurrentDirectory: PCharAW;
16220
           lpszDescriptionA: PAnsiChar;
16224
           lpszDescriptionA: PAnsiChar;
16221
           lpszDescriptionW: PWideChar;
16225
           lpszDescriptionW: PWideChar;
16222
           lpszAppLauncherName: PCharAW);
16226
           lpszAppLauncherName: PCharAW);
16223
      1 : (lpszApplicationNameA: PAnsiChar;
16227
      1 : (lpszApplicationNameA: PAnsiChar;
16224
           filler1: TGUID;
16228
           filler1: TGUID;
16225
           lpszFilenameA: PAnsiChar;
16229
           lpszFilenameA: PAnsiChar;
16226
           lpszCommandLineA: PAnsiChar;
16230
           lpszCommandLineA: PAnsiChar;
16227
           lpszPathA: PAnsiChar;
16231
           lpszPathA: PAnsiChar;
16228
           lpszCurrentDirectoryA: PAnsiChar;
16232
           lpszCurrentDirectoryA: PAnsiChar;
16229
           filler3: PChar;
16233
           filler3: PChar;
16230
           filler4: PChar;
16234
           filler4: PChar;
16231
           lpszAppLauncherNameA: PAnsiChar);
16235
           lpszAppLauncherNameA: PAnsiChar);
16232
      2 : (lpszApplicationNameW: PWideChar;
16236
      2 : (lpszApplicationNameW: PWideChar;
16233
           filler2: TGUID;
16237
           filler2: TGUID;
16234
           lpszFilenameW: PWideChar;
16238
           lpszFilenameW: PWideChar;
16235
           lpszCommandLineW: PWideChar;
16239
           lpszCommandLineW: PWideChar;
16236
           lpszPathW: PWideChar;
16240
           lpszPathW: PWideChar;
16237
           lpszCurrentDirectoryW: PWideChar;
16241
           lpszCurrentDirectoryW: PWideChar;
16238
           filler5: PChar;
16242
           filler5: PChar;
16239
           filler6: PChar;
16243
           filler6: PChar;
16240
           lpszAppLauncherNameW: PWideChar);
16244
           lpszAppLauncherNameW: PWideChar);
16241
  end;
16245
  end;
16242
 
16246
 
16243
 
16247
 
16244
(****************************************************************************
16248
(****************************************************************************
16245
 *
16249
 *
16246
 * Enumeration Method Callback Prototypes
16250
 * Enumeration Method Callback Prototypes
16247
 *
16251
 *
16248
 ****************************************************************************)
16252
 ****************************************************************************)
16249
 
16253
 
16250
(*
16254
(*
16251
 * Callback for EnumAddress()
16255
 * Callback for EnumAddress()
16252
 *)
16256
 *)
16253
  TDPEnumAdressCallback = function(const guidDataType: TGUID;
16257
  TDPEnumAdressCallback = function(const guidDataType: TGUID;
16254
      dwDataSize: DWORD; lpData: Pointer; lpContext: Pointer) : BOOL; stdcall;
16258
      dwDataSize: DWORD; lpData: Pointer; lpContext: Pointer) : BOOL; stdcall;
16255
 
16259
 
16256
(*
16260
(*
16257
 * Callback for EnumAddressTypes()
16261
 * Callback for EnumAddressTypes()
16258
 *)
16262
 *)
16259
  TDPLEnumAddressTypesCallback = function(const guidDataType: TGUID;
16263
  TDPLEnumAddressTypesCallback = function(const guidDataType: TGUID;
16260
      lpContext: Pointer; dwFlags: DWORD) : BOOL; stdcall;
16264
      lpContext: Pointer; dwFlags: DWORD) : BOOL; stdcall;
16261
 
16265
 
16262
(*
16266
(*
16263
 * Callback for EnumLocalApplications()
16267
 * Callback for EnumLocalApplications()
16264
 *)
16268
 *)
16265
  TDPLEnumLocalApplicationsCallback = function(const lpAppInfo: TDPLAppInfo;
16269
  TDPLEnumLocalApplicationsCallback = function(const lpAppInfo: TDPLAppInfo;
16266
      lpContext: Pointer; dwFlags: DWORD) : BOOL; stdcall;
16270
      lpContext: Pointer; dwFlags: DWORD) : BOOL; stdcall;
16267
 
16271
 
16268
(****************************************************************************
16272
(****************************************************************************
16269
 *
16273
 *
16270
 * IDirectPlayLobby (and IDirectPlayLobbyA) Interface
16274
 * IDirectPlayLobby (and IDirectPlayLobbyA) Interface
16271
 *
16275
 *
16272
 ****************************************************************************)
16276
 ****************************************************************************)
16273
 
16277
 
16274
type
16278
type
16275
  IDirectPlayLobbyAW = interface (IUnknown)
16279
  IDirectPlayLobbyAW = interface (IUnknown)
16276
    (*** IDirectPlayLobby methods ***)
16280
    (*** IDirectPlayLobby methods ***)
16277
    function Connect(dwFlags: DWORD; out lplpDP: IDirectPlay2;
16281
    function Connect(dwFlags: DWORD; out lplpDP: IDirectPlay2;
16278
        pUnk: IUnknown) : HResult; stdcall;
16282
        pUnk: IUnknown) : HResult; stdcall;
16279
    function CreateAddress(const guidSP, guidDataType: TGUID; var lpData;
16283
    function CreateAddress(const guidSP, guidDataType: TGUID; var lpData;
16280
        dwDataSize: DWORD; var lpAddress; var lpdwAddressSize: DWORD) : HResult; stdcall;
16284
        dwDataSize: DWORD; var lpAddress; var lpdwAddressSize: DWORD) : HResult; stdcall;
16281
    function EnumAddress(lpEnumAddressCallback: TDPEnumAdressCallback;
16285
    function EnumAddress(lpEnumAddressCallback: TDPEnumAdressCallback;
16282
        var lpAddress; dwAddressSize: DWORD; lpContext : Pointer) : HResult; stdcall;
16286
        var lpAddress; dwAddressSize: DWORD; lpContext : Pointer) : HResult; stdcall;
16283
    function EnumAddressTypes(lpEnumAddressTypeCallback:
16287
    function EnumAddressTypes(lpEnumAddressTypeCallback:
16284
        TDPLEnumAddressTypesCallback; const guidSP: TGUID; lpContext: Pointer;
16288
        TDPLEnumAddressTypesCallback; const guidSP: TGUID; lpContext: Pointer;
16285
        dwFlags: DWORD) : HResult; stdcall;
16289
        dwFlags: DWORD) : HResult; stdcall;
16286
    function EnumLocalApplications(lpEnumLocalAppCallback: TDPLEnumLocalApplicationsCallback;
16290
    function EnumLocalApplications(lpEnumLocalAppCallback: TDPLEnumLocalApplicationsCallback;
16287
        lpContext: Pointer; dwFlags: DWORD) : HResult; stdcall;
16291
        lpContext: Pointer; dwFlags: DWORD) : HResult; stdcall;
16288
    function GetConnectionSettings(dwAppID: DWORD; lpData: PDPLConnection;
16292
    function GetConnectionSettings(dwAppID: DWORD; lpData: PDPLConnection;
16289
        var lpdwDataSize: DWORD) : HResult; stdcall;
16293
        var lpdwDataSize: DWORD) : HResult; stdcall;
16290
    function ReceiveLobbyMessage(dwFlags: DWORD; dwAppID: DWORD;
16294
    function ReceiveLobbyMessage(dwFlags: DWORD; dwAppID: DWORD;
16291
        var lpdwMessageFlags: DWORD; lpData: Pointer; var lpdwDataSize: DWORD) : HResult; stdcall;
16295
        var lpdwMessageFlags: DWORD; lpData: Pointer; var lpdwDataSize: DWORD) : HResult; stdcall;
16292
    function RunApplication(dwFlags: DWORD; var lpdwAppId: DWORD;
16296
    function RunApplication(dwFlags: DWORD; var lpdwAppId: DWORD;
16293
        const lpConn: TDPLConnection; hReceiveEvent: THandle) : HResult; stdcall;
16297
        const lpConn: TDPLConnection; hReceiveEvent: THandle) : HResult; stdcall;
16294
    function SendLobbyMessage(dwFlags: DWORD; dwAppID: DWORD; const lpData;
16298
    function SendLobbyMessage(dwFlags: DWORD; dwAppID: DWORD; const lpData;
16295
        dwDataSize: DWORD) : HResult; stdcall;
16299
        dwDataSize: DWORD) : HResult; stdcall;
16296
    function SetConnectionSettings(dwFlags: DWORD; dwAppID: DWORD;
16300
    function SetConnectionSettings(dwFlags: DWORD; dwAppID: DWORD;
16297
        var lpConn: TDPLConnection) : HResult; stdcall;
16301
        var lpConn: TDPLConnection) : HResult; stdcall;
16298
    function SetLobbyMessageEvent(dwFlags: DWORD; dwAppID: DWORD;
16302
    function SetLobbyMessageEvent(dwFlags: DWORD; dwAppID: DWORD;
16299
        hReceiveEvent: THandle) : HResult; stdcall;
16303
        hReceiveEvent: THandle) : HResult; stdcall;
16300
  end;
16304
  end;
16301
 
16305
 
16302
  IDirectPlayLobbyW = interface (IDirectPlayLobbyAW)
16306
  IDirectPlayLobbyW = interface (IDirectPlayLobbyAW)
16303
    ['{AF465C71-9588-11CF-A020-00AA006157AC}']
16307
    ['{AF465C71-9588-11CF-A020-00AA006157AC}']
16304
  end;
16308
  end;
16305
  IDirectPlayLobbyA = interface (IDirectPlayLobbyAW)
16309
  IDirectPlayLobbyA = interface (IDirectPlayLobbyAW)
16306
    ['{26C66A70-B367-11cf-A024-00AA006157AC}']
16310
    ['{26C66A70-B367-11cf-A024-00AA006157AC}']
16307
  end;
16311
  end;
16308
 
16312
 
16309
{$IFDEF UNICODE}
16313
{$IFDEF UNICODE}
16310
  IDirectPlayLobby = IDirectPlayLobbyW;
16314
  IDirectPlayLobby = IDirectPlayLobbyW;
16311
{$ELSE}
16315
{$ELSE}
16312
  IDirectPlayLobby = IDirectPlayLobbyA;
16316
  IDirectPlayLobby = IDirectPlayLobbyA;
16313
{$ENDIF}
16317
{$ENDIF}
16314
 
16318
 
16315
 
16319
 
16316
(****************************************************************************
16320
(****************************************************************************
16317
 *
16321
 *
16318
 * IDirectPlayLobby2 (and IDirectPlayLobby2A) Interface
16322
 * IDirectPlayLobby2 (and IDirectPlayLobby2A) Interface
16319
 *
16323
 *
16320
 ****************************************************************************)
16324
 ****************************************************************************)
16321
 
16325
 
16322
  IDirectPlayLobby2AW = interface(IDirectPlayLobbyAW)
16326
  IDirectPlayLobby2AW = interface(IDirectPlayLobbyAW)
16323
    (*** IDirectPlayLobby2 methods ***)
16327
    (*** IDirectPlayLobby2 methods ***)
16324
    function CreateCompoundAddress(const lpElements: TDPCompoundAddressElement;
16328
    function CreateCompoundAddress(const lpElements: TDPCompoundAddressElement;
16325
        dwElementCount: DWORD; lpAddress: Pointer; var lpdwAddressSize: DWORD) : HResult; stdcall;
16329
        dwElementCount: DWORD; lpAddress: Pointer; var lpdwAddressSize: DWORD) : HResult; stdcall;
16326
  end;
16330
  end;
16327
 
16331
 
16328
  IDirectPlayLobby2W = interface (IDirectPlayLobby2AW)
16332
  IDirectPlayLobby2W = interface (IDirectPlayLobby2AW)
16329
    ['{0194C220-A303-11D0-9C4F-00A0C905425E}']
16333
    ['{0194C220-A303-11D0-9C4F-00A0C905425E}']
16330
  end;
16334
  end;
16331
  IDirectPlayLobby2A = interface (IDirectPlayLobby2AW)
16335
  IDirectPlayLobby2A = interface (IDirectPlayLobby2AW)
16332
    ['{1BB4AF80-A303-11d0-9C4F-00A0C905425E}']
16336
    ['{1BB4AF80-A303-11d0-9C4F-00A0C905425E}']
16333
  end;
16337
  end;
16334
 
16338
 
16335
{$IFDEF UNICODE}
16339
{$IFDEF UNICODE}
16336
  IDirectPlayLobby2 = IDirectPlayLobby2W;
16340
  IDirectPlayLobby2 = IDirectPlayLobby2W;
16337
{$ELSE}
16341
{$ELSE}
16338
  IDirectPlayLobby2 = IDirectPlayLobby2A;
16342
  IDirectPlayLobby2 = IDirectPlayLobby2A;
16339
{$ENDIF}
16343
{$ENDIF}
16340
 
16344
 
16341
(****************************************************************************
16345
(****************************************************************************
16342
 *
16346
 *
16343
 * IDirectPlayLobby3 (and IDirectPlayLobby3A) Interface
16347
 * IDirectPlayLobby3 (and IDirectPlayLobby3A) Interface
16344
 *
16348
 *
16345
 ****************************************************************************)
16349
 ****************************************************************************)
16346
 
16350
 
16347
  IDirectPlayLobby3AW = interface(IDirectPlayLobby2AW)
16351
  IDirectPlayLobby3AW = interface(IDirectPlayLobby2AW)
16348
    (*** IDirectPlayLobby3 methods ***)
16352
    (*** IDirectPlayLobby3 methods ***)
16349
    function ConnectEx(dwFlags: DWORD; const riid: TGUID;
16353
    function ConnectEx(dwFlags: DWORD; const riid: TGUID;
16350
        out lplpDP; pUnk: IUnknown) : HResult; stdcall;
16354
        out lplpDP; pUnk: IUnknown) : HResult; stdcall;
16351
    function RegisterApplication(dwFlags: DWORD;
16355
    function RegisterApplication(dwFlags: DWORD;
16352
        var lpAppDesc: TDPApplicationDesc) : HResult; stdcall;
16356
        var lpAppDesc: TDPApplicationDesc) : HResult; stdcall;
16353
    function UnregisterApplication(dwFlags: DWORD;
16357
    function UnregisterApplication(dwFlags: DWORD;
16354
         const guidApplication: TGUID) : HResult; stdcall;
16358
         const guidApplication: TGUID) : HResult; stdcall;
16355
    function WaitForConnectionSettings(dwFlags: DWORD) : HResult; stdcall;
16359
    function WaitForConnectionSettings(dwFlags: DWORD) : HResult; stdcall;
16356
        end;
16360
        end;
16357
 
16361
 
16358
  IDirectPlayLobby3W = interface (IDirectPlayLobby3AW)
16362
  IDirectPlayLobby3W = interface (IDirectPlayLobby3AW)
16359
    ['{2DB72490-652C-11d1-A7A8-0000F803ABFC}']
16363
    ['{2DB72490-652C-11d1-A7A8-0000F803ABFC}']
16360
  end;
16364
  end;
16361
  IDirectPlayLobby3A = interface (IDirectPlayLobby3AW)
16365
  IDirectPlayLobby3A = interface (IDirectPlayLobby3AW)
16362
    ['{2DB72491-652C-11d1-A7A8-0000F803ABFC}']
16366
    ['{2DB72491-652C-11d1-A7A8-0000F803ABFC}']
16363
  end;
16367
  end;
16364
 
16368
 
16365
{$IFDEF UNICODE}
16369
{$IFDEF UNICODE}
16366
  IDirectPlayLobby3 = IDirectPlayLobby3W;
16370
  IDirectPlayLobby3 = IDirectPlayLobby3W;
16367
{$ELSE}
16371
{$ELSE}
16368
  IDirectPlayLobby3 = IDirectPlayLobby3A;
16372
  IDirectPlayLobby3 = IDirectPlayLobby3A;
16369
{$ENDIF}
16373
{$ENDIF}
16370
 
16374
 
16371
  IID_IDirectPlayLobbyW =  IDirectPlayLobbyW;
16375
  IID_IDirectPlayLobbyW =  IDirectPlayLobbyW;
16372
  IID_IDirectPlayLobbyA =  IDirectPlayLobbyA;
16376
  IID_IDirectPlayLobbyA =  IDirectPlayLobbyA;
16373
  IID_IDirectPlayLobby =   IDirectPlayLobby;
16377
  IID_IDirectPlayLobby =   IDirectPlayLobby;
16374
 
16378
 
16375
  IID_IDirectPlayLobby2W = IDirectPlayLobby2W;
16379
  IID_IDirectPlayLobby2W = IDirectPlayLobby2W;
16376
  IID_IDirectPlayLobby2A = IDirectPlayLobby2A;
16380
  IID_IDirectPlayLobby2A = IDirectPlayLobby2A;
16377
  IID_IDirectPlayLobby2 =  IDirectPlayLobby2;
16381
  IID_IDirectPlayLobby2 =  IDirectPlayLobby2;
16378
 
16382
 
16379
  IID_IDirectPlayLobby3W = IDirectPlayLobby3W;
16383
  IID_IDirectPlayLobby3W = IDirectPlayLobby3W;
16380
  IID_IDirectPlayLobby3A = IDirectPlayLobby3A;
16384
  IID_IDirectPlayLobby3A = IDirectPlayLobby3A;
16381
  IID_IDirectPlayLobby3 =  IDirectPlayLobby3;
16385
  IID_IDirectPlayLobby3 =  IDirectPlayLobby3;
16382
 
16386
 
16383
(****************************************************************************
16387
(****************************************************************************
16384
 *
16388
 *
16385
 * DirectPlayLobby API Prototypes
16389
 * DirectPlayLobby API Prototypes
16386
 *
16390
 *
16387
 ****************************************************************************)
16391
 ****************************************************************************)
16388
 
16392
 
16389
var
16393
var
16390
  DirectPlayLobbyCreateW : function (lpguidSP: PGUID; out lplpDPL:
16394
  DirectPlayLobbyCreateW : function (lpguidSP: PGUID; out lplpDPL:
16391
      IDirectPlayLobbyW; lpUnk: IUnknown; lpData: Pointer; dwDataSize: DWORD) : HResult; stdcall;
16395
      IDirectPlayLobbyW; lpUnk: IUnknown; lpData: Pointer; dwDataSize: DWORD) : HResult; stdcall;
16392
  DirectPlayLobbyCreateA : function (lpguidSP: PGUID; out lplpDPL:
16396
  DirectPlayLobbyCreateA : function (lpguidSP: PGUID; out lplpDPL:
16393
      IDirectPlayLobbyA; lpUnk: IUnknown; lpData: Pointer; dwDataSize: DWORD) : HResult; stdcall;
16397
      IDirectPlayLobbyA; lpUnk: IUnknown; lpData: Pointer; dwDataSize: DWORD) : HResult; stdcall;
16394
  DirectPlayLobbyCreate : function (lpguidSP: PGUID; out lplpDPL:
16398
  DirectPlayLobbyCreate : function (lpguidSP: PGUID; out lplpDPL:
16395
      IDirectPlayLobby; lpUnk: IUnknown; lpData: Pointer; dwDataSize: DWORD) : HResult; stdcall;
16399
      IDirectPlayLobby; lpUnk: IUnknown; lpData: Pointer; dwDataSize: DWORD) : HResult; stdcall;
16396
 
16400
 
16397
const
16401
const
16398
(****************************************************************************
16402
(****************************************************************************
16399
 *
16403
 *
16400
 * DirectPlayLobby Flags
16404
 * DirectPlayLobby Flags
16401
 *
16405
 *
16402
 ****************************************************************************)
16406
 ****************************************************************************)
16403
 
16407
 
16404
(*
16408
(*
16405
 *  This flag is used by IDirectPlayLobby.WaitForConnectionSettings to
16409
 *  This flag is used by IDirectPlayLobby.WaitForConnectionSettings to
16406
 *  cancel a current wait that is in progress.
16410
 *  cancel a current wait that is in progress.
16407
 *)
16411
 *)
16408
 DPLWAIT_CANCEL = $00000001;
16412
 DPLWAIT_CANCEL = $00000001;
16409
 
16413
 
16410
(*
16414
(*
16411
 *      This is a message flag used by ReceiveLobbyMessage.  It can be
16415
 *      This is a message flag used by ReceiveLobbyMessage.  It can be
16412
 *      returned in the dwMessageFlags parameter to indicate a message from
16416
 *      returned in the dwMessageFlags parameter to indicate a message from
16413
 *      the system.
16417
 *      the system.
16414
 *)
16418
 *)
16415
  DPLMSG_SYSTEM = $00000001;
16419
  DPLMSG_SYSTEM = $00000001;
16416
 
16420
 
16417
(*
16421
(*
16418
 *      This is a message flag used by ReceiveLobbyMessage and SendLobbyMessage.
16422
 *      This is a message flag used by ReceiveLobbyMessage and SendLobbyMessage.
16419
 *  It is used to indicate that the message is a standard lobby message.
16423
 *  It is used to indicate that the message is a standard lobby message.
16420
 *  TDPLMsg_SetProperty, TDPLMsg_SetPropertyResponse, TDPLMsg_GetProperty,
16424
 *  TDPLMsg_SetProperty, TDPLMsg_SetPropertyResponse, TDPLMsg_GetProperty,
16421
 *      TDPLMsg_GetPropertyResponse
16425
 *      TDPLMsg_GetPropertyResponse
16422
 *)
16426
 *)
16423
  DPLMSG_STANDARD = $00000002;
16427
  DPLMSG_STANDARD = $00000002;
16424
 
16428
 
16425
type
16429
type
16426
(****************************************************************************
16430
(****************************************************************************
16427
 *
16431
 *
16428
 * DirectPlayLobby messages and message data structures
16432
 * DirectPlayLobby messages and message data structures
16429
 *
16433
 *
16430
 * All system messages have a dwMessageFlags value of DPLMSG_SYSTEM returned
16434
 * All system messages have a dwMessageFlags value of DPLMSG_SYSTEM returned
16431
 * from a call to ReceiveLobbyMessage.
16435
 * from a call to ReceiveLobbyMessage.
16432
 *
16436
 *
16433
 * All standard messages have a dwMessageFlags value of DPLMSG_STANDARD returned
16437
 * All standard messages have a dwMessageFlags value of DPLMSG_STANDARD returned
16434
 * from a call to ReceiveLobbyMessage.
16438
 * from a call to ReceiveLobbyMessage.
16435
 *
16439
 *
16436
 ****************************************************************************)
16440
 ****************************************************************************)
16437
 
16441
 
16438
(*
16442
(*
16439
 * TDPLMsg_Generic
16443
 * TDPLMsg_Generic
16440
 * Generic message structure used to identify the message type.
16444
 * Generic message structure used to identify the message type.
16441
 *)
16445
 *)
16442
  PDPLMsg_Generic = ^TDPLMsg_Generic;
16446
  PDPLMsg_Generic = ^TDPLMsg_Generic;
16443
  TDPLMsg_Generic = packed record
16447
  TDPLMsg_Generic = packed record
16444
    dwType: DWORD;   // Message type
16448
    dwType: DWORD;   // Message type
16445
  end;
16449
  end;
16446
 
16450
 
16447
(*
16451
(*
16448
 * TDPLMsg_SystemMessage
16452
 * TDPLMsg_SystemMessage
16449
 * Generic message format for all system messages --
16453
 * Generic message format for all system messages --
16450
 * DPLSYS_CONNECTIONSETTINGSREAD, DPLSYS_DPLYCONNECTSUCCEEDED,
16454
 * DPLSYS_CONNECTIONSETTINGSREAD, DPLSYS_DPLYCONNECTSUCCEEDED,
16451
 * DPLSYS_DPLAYCONNECTFAILED, DPLSYS_APPTERMINATED, DPLSYS_NEWCONNECTIONSETTINGS
16455
 * DPLSYS_DPLAYCONNECTFAILED, DPLSYS_APPTERMINATED, DPLSYS_NEWCONNECTIONSETTINGS
16452
 *)
16456
 *)
16453
  PDPLMsg_SystemMessage = ^TDPLMsg_SystemMessage;
16457
  PDPLMsg_SystemMessage = ^TDPLMsg_SystemMessage;
16454
  TDPLMsg_SystemMessage = packed record
16458
  TDPLMsg_SystemMessage = packed record
16455
    dwType: DWORD;         // Message type
16459
    dwType: DWORD;         // Message type
16456
    guidInstance: TGUID;    // Instance GUID of the dplay session the message corresponds to
16460
    guidInstance: TGUID;    // Instance GUID of the dplay session the message corresponds to
16457
  end;
16461
  end;
16458
 
16462
 
16459
(*
16463
(*
16460
 *  TDPLMsg_SetProperty
16464
 *  TDPLMsg_SetProperty
16461
 *  Standard message sent by an application to a lobby to set a
16465
 *  Standard message sent by an application to a lobby to set a
16462
 *  property
16466
 *  property
16463
 *)
16467
 *)
16464
  PDPLMsg_SetProperty = ^TDPLMsg_SetProperty;
16468
  PDPLMsg_SetProperty = ^TDPLMsg_SetProperty;
16465
  TDPLMsg_SetProperty = packed record
16469
  TDPLMsg_SetProperty = packed record
16466
    dwType: DWORD;                           // Message type
16470
    dwType: DWORD;                           // Message type
16467
    dwRequestID: DWORD;                      // Request ID (DPL_NOCONFIRMATION if no confirmation desired)
16471
    dwRequestID: DWORD;                      // Request ID (DPL_NOCONFIRMATION if no confirmation desired)
16468
    guidPlayer: TGUID;                       // Player GUID
16472
    guidPlayer: TGUID;                       // Player GUID
16469
    guidPropertyTag: TGUID;                  // Property GUID
16473
    guidPropertyTag: TGUID;                  // Property GUID
16470
    dwDataSize: DWORD;                       // Size of data
16474
    dwDataSize: DWORD;                       // Size of data
16471
    dwPropertyData: array[0..0] of DWORD;    // Buffer containing data
16475
    dwPropertyData: array[0..0] of DWORD;    // Buffer containing data
16472
  end;
16476
  end;
16473
 
16477
 
16474
const
16478
const
16475
  DPL_NOCONFIRMATION = 0;
16479
  DPL_NOCONFIRMATION = 0;
16476
 
16480
 
16477
type
16481
type
16478
(*
16482
(*
16479
 *  TDPLMsg_SetPropertyResponse
16483
 *  TDPLMsg_SetPropertyResponse
16480
 *  Standard message returned by a lobby to confirm a
16484
 *  Standard message returned by a lobby to confirm a
16481
 *  TDPLMsg_SetProperty message.
16485
 *  TDPLMsg_SetProperty message.
16482
 *)
16486
 *)
16483
  PDPLMsg_SetPropertyResponse = ^TDPLMsg_SetPropertyResponse;
16487
  PDPLMsg_SetPropertyResponse = ^TDPLMsg_SetPropertyResponse;
16484
  TDPLMsg_SetPropertyResponse = packed record
16488
  TDPLMsg_SetPropertyResponse = packed record
16485
    dwType: DWORD;            // Message type
16489
    dwType: DWORD;            // Message type
16486
    dwRequestID: DWORD;       // Request ID
16490
    dwRequestID: DWORD;       // Request ID
16487
    guidPlayer: TGUID;        // Player GUID
16491
    guidPlayer: TGUID;        // Player GUID
16488
    guidPropertyTag: TGUID;   // Property GUID
16492
    guidPropertyTag: TGUID;   // Property GUID
16489
    hr: HResult;              // Return Code
16493
    hr: HResult;              // Return Code
16490
  end;
16494
  end;
16491
 
16495
 
16492
(*
16496
(*
16493
 *  TDPLMsg_GetProperty
16497
 *  TDPLMsg_GetProperty
16494
 *  Standard message sent by an application to a lobby to request
16498
 *  Standard message sent by an application to a lobby to request
16495
 *      the current value of a property
16499
 *      the current value of a property
16496
 *)
16500
 *)
16497
  PDPLMsg_GetProperty = ^TDPLMsg_GetProperty;
16501
  PDPLMsg_GetProperty = ^TDPLMsg_GetProperty;
16498
  TDPLMsg_GetProperty = packed record
16502
  TDPLMsg_GetProperty = packed record
16499
    dwType: DWORD;            // Message type
16503
    dwType: DWORD;            // Message type
16500
    dwRequestID: DWORD;       // Request ID
16504
    dwRequestID: DWORD;       // Request ID
16501
    guidPlayer: TGUID;        // Player GUID
16505
    guidPlayer: TGUID;        // Player GUID
16502
    guidPropertyTag: TGUID;   // Property GUID
16506
    guidPropertyTag: TGUID;   // Property GUID
16503
  end;
16507
  end;
16504
  LPDPLMSG_GETPROPERTY = ^TDPLMsg_GetProperty;
16508
  LPDPLMSG_GETPROPERTY = ^TDPLMsg_GetProperty;
16505
 
16509
 
16506
(*
16510
(*
16507
 *  TDPLMsg_GetPropertyResponse
16511
 *  TDPLMsg_GetPropertyResponse
16508
 *  Standard message returned by a lobby in response to a
16512
 *  Standard message returned by a lobby in response to a
16509
 *      TDPLMsg_GetProperty message.
16513
 *      TDPLMsg_GetProperty message.
16510
 *)
16514
 *)
16511
  PDPLMsg_GetPropertyResponse = ^TDPLMsg_GetPropertyResponse;
16515
  PDPLMsg_GetPropertyResponse = ^TDPLMsg_GetPropertyResponse;
16512
  TDPLMsg_GetPropertyResponse = packed record
16516
  TDPLMsg_GetPropertyResponse = packed record
16513
    dwType: DWORD;                           // Message type
16517
    dwType: DWORD;                           // Message type
16514
    dwRequestID: DWORD;                      // Request ID
16518
    dwRequestID: DWORD;                      // Request ID
16515
    guidPlayer: TGUID;                       // Player GUID
16519
    guidPlayer: TGUID;                       // Player GUID
16516
    guidPropertyTag: TGUID;                  // Property GUID
16520
    guidPropertyTag: TGUID;                  // Property GUID
16517
    hr: HResult;                             // Return Code
16521
    hr: HResult;                             // Return Code
16518
    dwDataSize: DWORD;                       // Size of data
16522
    dwDataSize: DWORD;                       // Size of data
16519
    dwPropertyData: array[0..0] of DWORD;    // Buffer containing data
16523
    dwPropertyData: array[0..0] of DWORD;    // Buffer containing data
16520
  end;
16524
  end;
16521
 
16525
 
16522
(*
16526
(*
16523
 *  TDPLMsg_NewSessionHost
16527
 *  TDPLMsg_NewSessionHost
16524
 *  Standard message returned by a lobby in response to a
16528
 *  Standard message returned by a lobby in response to a
16525
 *  the session host migrating to a new client
16529
 *  the session host migrating to a new client
16526
 *)
16530
 *)
16527
  PDPLMsg_NewSessionHost = ^TDPLMsg_NewSessionHost;
16531
  PDPLMsg_NewSessionHost = ^TDPLMsg_NewSessionHost;
16528
  TDPLMsg_NewSessionHost = packed record
16532
  TDPLMsg_NewSessionHost = packed record
16529
    dwType: DWORD;            // Message type
16533
    dwType: DWORD;            // Message type
16530
    guidInstance: TGUID;      // Property GUID
16534
    guidInstance: TGUID;      // Property GUID
16531
  end;
16535
  end;
16532
 
16536
 
16533
const
16537
const
16534
(******************************************
16538
(******************************************
16535
 *
16539
 *
16536
 *      DirectPlay Lobby message dwType values
16540
 *      DirectPlay Lobby message dwType values
16537
 *
16541
 *
16538
 *****************************************)
16542
 *****************************************)
16539
 
16543
 
16540
(*
16544
(*
16541
 *  The application has read the connection settings.
16545
 *  The application has read the connection settings.
16542
 *  It is now O.K. for the lobby client to release
16546
 *  It is now O.K. for the lobby client to release
16543
 *  its IDirectPlayLobby interface.
16547
 *  its IDirectPlayLobby interface.
16544
 *)
16548
 *)
16545
  DPLSYS_CONNECTIONSETTINGSREAD = $00000001;
16549
  DPLSYS_CONNECTIONSETTINGSREAD = $00000001;
16546
 
16550
 
16547
(*
16551
(*
16548
 *  The application's call to DirectPlayConnect failed
16552
 *  The application's call to DirectPlayConnect failed
16549
 *)
16553
 *)
16550
  DPLSYS_DPLAYCONNECTFAILED = $00000002;
16554
  DPLSYS_DPLAYCONNECTFAILED = $00000002;
16551
 
16555
 
16552
(*
16556
(*
16553
 *  The application has created a DirectPlay session.
16557
 *  The application has created a DirectPlay session.
16554
 *)
16558
 *)
16555
  DPLSYS_DPLAYCONNECTSUCCEEDED = $00000003;
16559
  DPLSYS_DPLAYCONNECTSUCCEEDED = $00000003;
16556
 
16560
 
16557
(*
16561
(*
16558
 *  The application has terminated.
16562
 *  The application has terminated.
16559
 *)
16563
 *)
16560
  DPLSYS_APPTERMINATED = $00000004;
16564
  DPLSYS_APPTERMINATED = $00000004;
16561
 
16565
 
16562
(*
16566
(*
16563
 *  The message is a TDPLMsg_SetProperty message.
16567
 *  The message is a TDPLMsg_SetProperty message.
16564
 *)
16568
 *)
16565
  DPLSYS_SETPROPERTY = $00000005;
16569
  DPLSYS_SETPROPERTY = $00000005;
16566
 
16570
 
16567
(*
16571
(*
16568
 *  The message is a TDPLMsg_SetPropertyResponse message.
16572
 *  The message is a TDPLMsg_SetPropertyResponse message.
16569
 *)
16573
 *)
16570
  DPLSYS_SETPROPERTYRESPONSE = $00000006;
16574
  DPLSYS_SETPROPERTYRESPONSE = $00000006;
16571
 
16575
 
16572
(*
16576
(*
16573
 *  The message is a TDPLMsg_GetProperty message.
16577
 *  The message is a TDPLMsg_GetProperty message.
16574
 *)
16578
 *)
16575
  DPLSYS_GETPROPERTY = $00000007;
16579
  DPLSYS_GETPROPERTY = $00000007;
16576
 
16580
 
16577
(*
16581
(*
16578
 *  The message is a TDPLMsg_GetPropertyResponse message.
16582
 *  The message is a TDPLMsg_GetPropertyResponse message.
16579
 *)
16583
 *)
16580
  DPLSYS_GETPROPERTYRESPONSE = $00000008;
16584
  DPLSYS_GETPROPERTYRESPONSE = $00000008;
16581
 
16585
 
16582
(*
16586
(*
16583
 *  The message is a TDPLMsg_NewSessionHost message.
16587
 *  The message is a TDPLMsg_NewSessionHost message.
16584
 *)
16588
 *)
16585
  DPLSYS_NEWSESSIONHOST = $00000009;
16589
  DPLSYS_NEWSESSIONHOST = $00000009;
16586
 
16590
 
16587
(*
16591
(*
16588
 *  New connection settings are available.
16592
 *  New connection settings are available.
16589
 *)
16593
 *)
16590
  DPLSYS_NEWCONNECTIONSETTINGS = $0000000A;
16594
  DPLSYS_NEWCONNECTIONSETTINGS = $0000000A;
16591
 
16595
 
16592
(****************************************************************************
16596
(****************************************************************************
16593
 *
16597
 *
16594
 * DirectPlay defined property GUIDs and associated data structures
16598
 * DirectPlay defined property GUIDs and associated data structures
16595
 *
16599
 *
16596
 ****************************************************************************)
16600
 ****************************************************************************)
16597
 
16601
 
16598
(*
16602
(*
16599
 * DPLPROPERTY_MessagesSupported
16603
 * DPLPROPERTY_MessagesSupported
16600
 *
16604
 *
16601
 * Request whether the lobby supports standard.  Lobby with respond with either
16605
 * Request whether the lobby supports standard.  Lobby with respond with either
16602
 * TRUE or FALSE or may not respond at all.
16606
 * TRUE or FALSE or may not respond at all.
16603
 *
16607
 *
16604
 * Property data is a single BOOL with TRUE or FALSE
16608
 * Property data is a single BOOL with TRUE or FALSE
16605
 *)
16609
 *)
16606
// {762CCDA1-D916-11d0-BA39-00C04FD7ED67}
16610
// {762CCDA1-D916-11d0-BA39-00C04FD7ED67}
16607
  DPLPROPERTY_MessagesSupported: TGUID =
16611
  DPLPROPERTY_MessagesSupported: TGUID =
16608
      (D1:$762ccda1;D2:$d916;D3:$11d0;D4:($ba,$39,$00,$c0,$4f,$d7,$ed,$67));
16612
      (D1:$762ccda1;D2:$d916;D3:$11d0;D4:($ba,$39,$00,$c0,$4f,$d7,$ed,$67));
16609
 
16613
 
16610
(*
16614
(*
16611
 * DPLPROPERTY_LobbyGuid
16615
 * DPLPROPERTY_LobbyGuid
16612
 *
16616
 *
16613
 * Request the GUID that identifies the lobby software that the application
16617
 * Request the GUID that identifies the lobby software that the application
16614
 * is communicating with.
16618
 * is communicating with.
16615
 *
16619
 *
16616
 * Property data is a single GUID.
16620
 * Property data is a single GUID.
16617
 *)
16621
 *)
16618
// {F56920A0-D218-11d0-BA39-00C04FD7ED67}
16622
// {F56920A0-D218-11d0-BA39-00C04FD7ED67}
16619
  DPLPROPERTY_LobbyGuid: TGUID =
16623
  DPLPROPERTY_LobbyGuid: TGUID =
16620
      (D1:$F56920A0;D2:$D218;D3:$11d0;D4:($ba,$39,$00,$c0,$4f,$d7,$ed,$67));
16624
      (D1:$F56920A0;D2:$D218;D3:$11d0;D4:($ba,$39,$00,$c0,$4f,$d7,$ed,$67));
16621
 
16625
 
16622
(*
16626
(*
16623
 * DPLPROPERTY_PlayerGuid
16627
 * DPLPROPERTY_PlayerGuid
16624
 *
16628
 *
16625
 * Request the GUID that identifies the player on this machine for sending
16629
 * Request the GUID that identifies the player on this machine for sending
16626
 * property data back to the lobby.
16630
 * property data back to the lobby.
16627
 *
16631
 *
16628
 * Property data is the DPLDATA_PLAYERDATA structure
16632
 * Property data is the DPLDATA_PLAYERDATA structure
16629
 *)
16633
 *)
16630
// {B4319322-D20D-11d0-BA39-00C04FD7ED67}
16634
// {B4319322-D20D-11d0-BA39-00C04FD7ED67}
16631
  DPLPROPERTY_PlayerGuid: TGUID =
16635
  DPLPROPERTY_PlayerGuid: TGUID =
16632
      (D1:$b4319322;D2:$d20d;D3:$11d0;D4:($ba,$39,$00,$c0,$4f,$d7,$ed,$67));
16636
      (D1:$b4319322;D2:$d20d;D3:$11d0;D4:($ba,$39,$00,$c0,$4f,$d7,$ed,$67));
16633
 
16637
 
16634
type
16638
type
16635
(*
16639
(*
16636
 * TDPLData_PlayerGUID
16640
 * TDPLData_PlayerGUID
16637
 *
16641
 *
16638
 * Data structure to hold the GUID of the player and player creation flags
16642
 * Data structure to hold the GUID of the player and player creation flags
16639
 * from the lobby.
16643
 * from the lobby.
16640
 *)
16644
 *)
16641
  PDPLData_PlayerGUID = ^TDPLData_PlayerGUID;
16645
  PDPLData_PlayerGUID = ^TDPLData_PlayerGUID;
16642
  TDPLData_PlayerGUID = packed record
16646
  TDPLData_PlayerGUID = packed record
16643
    guidPlayer: TGUID;
16647
    guidPlayer: TGUID;
16644
    dwPlayerFlags: DWORD;
16648
    dwPlayerFlags: DWORD;
16645
  end;
16649
  end;
16646
 
16650
 
16647
const
16651
const
16648
(*
16652
(*
16649
 * DPLPROPERTY_PlayerScore
16653
 * DPLPROPERTY_PlayerScore
16650
 *
16654
 *
16651
 * Used to send an array of long integers to the lobby indicating the
16655
 * Used to send an array of long integers to the lobby indicating the
16652
 * score of a player.
16656
 * score of a player.
16653
 *
16657
 *
16654
 * Property data is the TDPLData_PlayerScore structure.
16658
 * Property data is the TDPLData_PlayerScore structure.
16655
 *)
16659
 *)
16656
// {48784000-D219-11d0-BA39-00C04FD7ED67}
16660
// {48784000-D219-11d0-BA39-00C04FD7ED67}
16657
  DPLPROPERTY_PlayerScore: TGUID =
16661
  DPLPROPERTY_PlayerScore: TGUID =
16658
      (D1:$48784000;D2:$d219;D3:$11d0;D4:($ba,$39,$00,$c0,$4f,$d7,$ed,$67));
16662
      (D1:$48784000;D2:$d219;D3:$11d0;D4:($ba,$39,$00,$c0,$4f,$d7,$ed,$67));
16659
 
16663
 
16660
type
16664
type
16661
(*
16665
(*
16662
 * TDPLData_PlayerScore
16666
 * TDPLData_PlayerScore
16663
 *
16667
 *
16664
 * Data structure to hold an array of long integers representing a player score.
16668
 * Data structure to hold an array of long integers representing a player score.
16665
 * Application must allocate enough memory to hold all the scores.
16669
 * Application must allocate enough memory to hold all the scores.
16666
 *)
16670
 *)
16667
  PDPLData_PlayerScore = ^TDPLData_PlayerScore;
16671
  PDPLData_PlayerScore = ^TDPLData_PlayerScore;
16668
  TDPLData_PlayerScore = packed record
16672
  TDPLData_PlayerScore = packed record
16669
    dwScoreCount: DWORD;
16673
    dwScoreCount: DWORD;
16670
    Score: array[0..0] of LongInt;
16674
    Score: array[0..0] of LongInt;
16671
  end;
16675
  end;
16672
 
16676
 
16673
(****************************************************************************
16677
(****************************************************************************
16674
 *
16678
 *
16675
 * DirectPlay Address ID's
16679
 * DirectPlay Address ID's
16676
 *
16680
 *
16677
 ****************************************************************************)
16681
 ****************************************************************************)
16678
 
16682
 
16679
(* DirectPlay Address
16683
(* DirectPlay Address
16680
 *
16684
 *
16681
 * A DirectPlay address consists of multiple chunks of data, each tagged
16685
 * A DirectPlay address consists of multiple chunks of data, each tagged
16682
 * with a GUID signifying the type of data in the chunk. The chunk also
16686
 * with a GUID signifying the type of data in the chunk. The chunk also
16683
 * has a length so that unknown chunk types can be skipped.
16687
 * has a length so that unknown chunk types can be skipped.
16684
 *
16688
 *
16685
 * The EnumAddress() function is used to parse these address data chunks.
16689
 * The EnumAddress() function is used to parse these address data chunks.
16686
 *)
16690
 *)
16687
 
16691
 
16688
(*
16692
(*
16689
 * TDPAddress
16693
 * TDPAddress
16690
 *
16694
 *
16691
 * Header for block of address data elements
16695
 * Header for block of address data elements
16692
 *)
16696
 *)
16693
  PDPAddress = ^TDPAddress;
16697
  PDPAddress = ^TDPAddress;
16694
  TDPAddress = packed record
16698
  TDPAddress = packed record
16695
    guidDataType: TGUID;
16699
    guidDataType: TGUID;
16696
    dwDataSize: DWORD;
16700
    dwDataSize: DWORD;
16697
  end;
16701
  end;
16698
 
16702
 
16699
const
16703
const
16700
(*
16704
(*
16701
 * DPAID_TotalSize
16705
 * DPAID_TotalSize
16702
 *
16706
 *
16703
 * Chunk is a DWORD containing size of entire TDPAddress structure
16707
 * Chunk is a DWORD containing size of entire TDPAddress structure
16704
 *)
16708
 *)
16705
 
16709
 
16706
// {1318F560-912C-11d0-9DAA-00A0C90A43CB}
16710
// {1318F560-912C-11d0-9DAA-00A0C90A43CB}
16707
  DPAID_TotalSize: TGUID =
16711
  DPAID_TotalSize: TGUID =
16708
      (D1:$1318f560;D2:$912c;D3:$11d0;D4:($9d,$aa,$00,$a0,$c9,$a,$43,$cb));
16712
      (D1:$1318f560;D2:$912c;D3:$11d0;D4:($9d,$aa,$00,$a0,$c9,$a,$43,$cb));
16709
 
16713
 
16710
(*
16714
(*
16711
 * DPAID_ServiceProvider
16715
 * DPAID_ServiceProvider
16712
 *
16716
 *
16713
 * Chunk is a GUID describing the service provider that created the chunk.
16717
 * Chunk is a GUID describing the service provider that created the chunk.
16714
 * All addresses must contain this chunk.
16718
 * All addresses must contain this chunk.
16715
 *)
16719
 *)
16716
 
16720
 
16717
// {07D916C0-E0AF-11cf-9C4E-00A0C905425E}
16721
// {07D916C0-E0AF-11cf-9C4E-00A0C905425E}
16718
  DPAID_ServiceProvider: TGUID =
16722
  DPAID_ServiceProvider: TGUID =
16719
      (D1:$7d916c0;D2:$e0af;D3:$11cf;D4:($9c,$4e,$00,$a0,$c9,$5,$42,$5e));
16723
      (D1:$7d916c0;D2:$e0af;D3:$11cf;D4:($9c,$4e,$00,$a0,$c9,$5,$42,$5e));
16720
 
16724
 
16721
(*
16725
(*
16722
 * DPAID_LobbyProvider
16726
 * DPAID_LobbyProvider
16723
 *
16727
 *
16724
 * Chunk is a GUID describing the lobby provider that created the chunk.
16728
 * Chunk is a GUID describing the lobby provider that created the chunk.
16725
 * All addresses must contain this chunk.
16729
 * All addresses must contain this chunk.
16726
 *)
16730
 *)
16727
 
16731
 
16728
// {59B95640-9667-11d0-A77D-0000F803ABFC}
16732
// {59B95640-9667-11d0-A77D-0000F803ABFC}
16729
  DPAID_LobbyProvider: TGUID =
16733
  DPAID_LobbyProvider: TGUID =
16730
      (D1:$59b95640;D2:$9667;D3:$11d0;D4:($a7,$7d,$00,$00,$f8,$3,$ab,$fc));
16734
      (D1:$59b95640;D2:$9667;D3:$11d0;D4:($a7,$7d,$00,$00,$f8,$3,$ab,$fc));
16731
 
16735
 
16732
(*
16736
(*
16733
 * DPAID_Phone and DPAID_PhoneW
16737
 * DPAID_Phone and DPAID_PhoneW
16734
 *
16738
 *
16735
 * Chunk is a string containing a phone number (i.e. "1-800-555-1212")
16739
 * Chunk is a string containing a phone number (i.e. "1-800-555-1212")
16736
 * in ANSI or UNICODE format
16740
 * in ANSI or UNICODE format
16737
 *)
16741
 *)
16738
 
16742
 
16739
// {78EC89A0-E0AF-11cf-9C4E-00A0C905425E}
16743
// {78EC89A0-E0AF-11cf-9C4E-00A0C905425E}
16740
  DPAID_Phone: TGUID =
16744
  DPAID_Phone: TGUID =
16741
      (D1:$78ec89a0;D2:$e0af;D3:$11cf;D4:($9c,$4e,$00,$a0,$c9,$5,$42,$5e));
16745
      (D1:$78ec89a0;D2:$e0af;D3:$11cf;D4:($9c,$4e,$00,$a0,$c9,$5,$42,$5e));
16742
 
16746
 
16743
// {BA5A7A70-9DBF-11d0-9CC1-00A0C905425E}
16747
// {BA5A7A70-9DBF-11d0-9CC1-00A0C905425E}
16744
  DPAID_PhoneW: TGUID =
16748
  DPAID_PhoneW: TGUID =
16745
      (D1:$ba5a7a70;D2:$9dbf;D3:$11d0;D4:($9c,$c1,$00,$a0,$c9,$5,$42,$5e));
16749
      (D1:$ba5a7a70;D2:$9dbf;D3:$11d0;D4:($9c,$c1,$00,$a0,$c9,$5,$42,$5e));
16746
 
16750
 
16747
(*
16751
(*
16748
 * DPAID_Modem and DPAID_ModemW
16752
 * DPAID_Modem and DPAID_ModemW
16749
 *
16753
 *
16750
 * Chunk is a string containing a modem name registered with TAPI
16754
 * Chunk is a string containing a modem name registered with TAPI
16751
 * in ANSI or UNICODE format
16755
 * in ANSI or UNICODE format
16752
 *)
16756
 *)
16753
 
16757
 
16754
// {F6DCC200-A2FE-11d0-9C4F-00A0C905425E}
16758
// {F6DCC200-A2FE-11d0-9C4F-00A0C905425E}
16755
  DPAID_Modem: TGUID =
16759
  DPAID_Modem: TGUID =
16756
      (D1:$f6dcc200;D2:$a2fe;D3:$11d0;D4:($9c,$4f,$00,$a0,$c9,$5,$42,$5e));
16760
      (D1:$f6dcc200;D2:$a2fe;D3:$11d0;D4:($9c,$4f,$00,$a0,$c9,$5,$42,$5e));
16757
 
16761
 
16758
// {01FD92E0-A2FF-11d0-9C4F-00A0C905425E}
16762
// {01FD92E0-A2FF-11d0-9C4F-00A0C905425E}
16759
  DPAID_ModemW: TGUID =
16763
  DPAID_ModemW: TGUID =
16760
      (D1:$1fd92e0;D2:$a2ff;D3:$11d0;D4:($9c,$4f,$00,$a0,$c9,$5,$42,$5e));
16764
      (D1:$1fd92e0;D2:$a2ff;D3:$11d0;D4:($9c,$4f,$00,$a0,$c9,$5,$42,$5e));
16761
 
16765
 
16762
(*
16766
(*
16763
 * DPAID_Inet and DPAID_InetW
16767
 * DPAID_Inet and DPAID_InetW
16764
 *
16768
 *
16765
 * Chunk is a string containing a TCP/IP host name or an IP address
16769
 * Chunk is a string containing a TCP/IP host name or an IP address
16766
 * (i.e. "dplay.microsoft.com" or "137.55.100.173") in ANSI or UNICODE format
16770
 * (i.e. "dplay.microsoft.com" or "137.55.100.173") in ANSI or UNICODE format
16767
 *)
16771
 *)
16768
 
16772
 
16769
// {C4A54DA0-E0AF-11cf-9C4E-00A0C905425E}
16773
// {C4A54DA0-E0AF-11cf-9C4E-00A0C905425E}
16770
  DPAID_INet: TGUID =
16774
  DPAID_INet: TGUID =
16771
      (D1:$c4a54da0;D2:$e0af;D3:$11cf;D4:($9c,$4e,$00,$a0,$c9,$5,$42,$5e));
16775
      (D1:$c4a54da0;D2:$e0af;D3:$11cf;D4:($9c,$4e,$00,$a0,$c9,$5,$42,$5e));
16772
 
16776
 
16773
// {E63232A0-9DBF-11d0-9CC1-00A0C905425E}
16777
// {E63232A0-9DBF-11d0-9CC1-00A0C905425E}
16774
  DPAID_INetW: TGUID =
16778
  DPAID_INetW: TGUID =
16775
      (D1:$e63232a0;D2:$9dbf;D3:$11d0;D4:($9c,$c1,$00,$a0,$c9,$5,$42,$5e));
16779
      (D1:$e63232a0;D2:$9dbf;D3:$11d0;D4:($9c,$c1,$00,$a0,$c9,$5,$42,$5e));
16776
 
16780
 
16777
(*
16781
(*
16778
 * DPAID_InetPort
16782
 * DPAID_InetPort
16779
 *
16783
 *
16780
 * Chunk is the port number used for creating the apps TCP and UDP sockets.
16784
 * Chunk is the port number used for creating the apps TCP and UDP sockets.
16781
 * WORD value (i.e. 47624)
16785
 * WORD value (i.e. 47624)
16782
 *)
16786
 *)
16783
 
16787
 
16784
// {E4524541-8EA5-11d1-8A96-006097B01411}
16788
// {E4524541-8EA5-11d1-8A96-006097B01411}
16785
  DPAID_INetPort: TGUID =
16789
  DPAID_INetPort: TGUID =
16786
      (D1:$e4524541;D2:$8ea5;D3:$11d1;D4:($8a,$96,$00,$60,$97,$b0,$14,$11));
16790
      (D1:$e4524541;D2:$8ea5;D3:$11d1;D4:($8a,$96,$00,$60,$97,$b0,$14,$11));
16787
 
16791
 
16788
//@@BEGIN_MSINTERNAL
16792
//@@BEGIN_MSINTERNAL
16789
(*
16793
(*
16790
 * DPAID_MaxMessageSize
16794
 * DPAID_MaxMessageSize
16791
 *
16795
 *
16792
 * Tells DPLAY what the maximum allowed message size is.  Enables SPs to
16796
 * Tells DPLAY what the maximum allowed message size is.  Enables SPs to
16793
 *      combat Denial of Service attacks
16797
 *      combat Denial of Service attacks
16794
 *)
16798
 *)
16795
 
16799
 
16796
 // this terrible hack is needed so the SP can work with the Elmer build.
16800
 // this terrible hack is needed so the SP can work with the Elmer build.
16797
 // it can be removed when the MSINTERNAL stuff is removed
16801
 // it can be removed when the MSINTERNAL stuff is removed
16798
{$DEFINE MAXMSGSIZEGUIDDEFINED}
16802
{$DEFINE MAXMSGSIZEGUIDDEFINED}
16799
 
16803
 
16800
// {F5D09980-F0C4-11d1-8326-006097B01411}
16804
// {F5D09980-F0C4-11d1-8326-006097B01411}
16801
  DPAID_MaxMessageSize: TGUID =
16805
  DPAID_MaxMessageSize: TGUID =
16802
      (D1:$f5d09980;D2:$f0c4;D3:$11d1;D4:($83,$26,$00,$60,$97,$b0,$14,$11));
16806
      (D1:$f5d09980;D2:$f0c4;D3:$11d1;D4:($83,$26,$00,$60,$97,$b0,$14,$11));
16803
//@@END_MSINTERNAL
16807
//@@END_MSINTERNAL
16804
 
16808
 
16805
(*
16809
(*
16806
 * TDPComPortAddress
16810
 * TDPComPortAddress
16807
 *
16811
 *
16808
 * Used to specify com port settings. The constants that define baud rate,
16812
 * Used to specify com port settings. The constants that define baud rate,
16809
 * stop bits and parity are defined in WINBASE.H. The constants for flow
16813
 * stop bits and parity are defined in WINBASE.H. The constants for flow
16810
 * control are given below.
16814
 * control are given below.
16811
 *)
16815
 *)
16812
 
16816
 
16813
  DPCPA_NOFLOW       = 0;           // no flow control
16817
  DPCPA_NOFLOW       = 0;           // no flow control
16814
  DPCPA_XONXOFFFLOW  = 1;           // software flow control
16818
  DPCPA_XONXOFFFLOW  = 1;           // software flow control
16815
  DPCPA_RTSFLOW      = 2;           // hardware flow control with RTS
16819
  DPCPA_RTSFLOW      = 2;           // hardware flow control with RTS
16816
  DPCPA_DTRFLOW      = 3;           // hardware flow control with DTR
16820
  DPCPA_DTRFLOW      = 3;           // hardware flow control with DTR
16817
  DPCPA_RTSDTRFLOW   = 4;           // hardware flow control with RTS and DTR
16821
  DPCPA_RTSDTRFLOW   = 4;           // hardware flow control with RTS and DTR
16818
 
16822
 
16819
type
16823
type
16820
  PDPComPortAddress = ^TDPComPortAddress;
16824
  PDPComPortAddress = ^TDPComPortAddress;
16821
  TDPComPortAddress = packed record
16825
  TDPComPortAddress = packed record
16822
    dwComPort: DWORD;       // COM port to use (1-4)
16826
    dwComPort: DWORD;       // COM port to use (1-4)
16823
    dwBaudRate: DWORD;      // baud rate (100-256k)
16827
    dwBaudRate: DWORD;      // baud rate (100-256k)
16824
    dwStopBits: DWORD;      // no. stop bits (1-2)
16828
    dwStopBits: DWORD;      // no. stop bits (1-2)
16825
    dwParity: DWORD;        // parity (none, odd, even, mark)
16829
    dwParity: DWORD;        // parity (none, odd, even, mark)
16826
    dwFlowControl: DWORD;   // flow control (none, xon/xoff, rts, dtr)
16830
    dwFlowControl: DWORD;   // flow control (none, xon/xoff, rts, dtr)
16827
  end;
16831
  end;
16828
 
16832
 
16829
const
16833
const
16830
(*
16834
(*
16831
 * DPAID_ComPort
16835
 * DPAID_ComPort
16832
 *
16836
 *
16833
 * Chunk contains a TDPComPortAddress structure defining the serial port.
16837
 * Chunk contains a TDPComPortAddress structure defining the serial port.
16834
 *)
16838
 *)
16835
 
16839
 
16836
// {F2F0CE00-E0AF-11cf-9C4E-00A0C905425E}
16840
// {F2F0CE00-E0AF-11cf-9C4E-00A0C905425E}
16837
  DPAID_ComPort: TGUID =
16841
  DPAID_ComPort: TGUID =
16838
      (D1:$f2f0ce00;D2:$e0af;D3:$11cf;D4:($9c,$4e,$00,$a0,$c9,$5,$42,$5e));
16842
      (D1:$f2f0ce00;D2:$e0af;D3:$11cf;D4:($9c,$4e,$00,$a0,$c9,$5,$42,$5e));
16839
 
16843
 
16840
(****************************************************************************
16844
(****************************************************************************
16841
 *
16845
 *
16842
 *      dplobby 1.0 obsolete definitions
16846
 *      dplobby 1.0 obsolete definitions
16843
 *      Included for compatibility only.
16847
 *      Included for compatibility only.
16844
 *
16848
 *
16845
 ****************************************************************************)
16849
 ****************************************************************************)
16846
 
16850
 
16847
  DPLAD_SYSTEM = DPLMSG_SYSTEM;
16851
  DPLAD_SYSTEM = DPLMSG_SYSTEM;
16848
 
-
 
-
 
16852
{$ENDIF} // UseDirectPlay
16849
 
16853
 
16850
//DirectSetup file
16854
//DirectSetup file
16851
(*==========================================================================
16855
(*==========================================================================
16852
 *
16856
 *
16853
 *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
16857
 *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
16854
 *
16858
 *
16855
 *  File:       dsetup.h
16859
 *  File:       dsetup.h
16856
 *  Content:    DirectXSetup, error codes and flags
16860
 *  Content:    DirectXSetup, error codes and flags
16857
 *
16861
 *
16858
 *  DirectX 7.0 Delphi adaptation by Erik Unger
16862
 *  DirectX 7.0 Delphi adaptation by Erik Unger
16859
 *
16863
 *
16860
 *  Modyfied: 05-Oct-99
16864
 *  Modyfied: 05-Oct-99
16861
 *
16865
 *
16862
 *  Download: http://www.delphi-jedi.org/DelphiGraphics/
16866
 *  Download: http://www.delphi-jedi.org/DelphiGraphics/
16863
 *  E-Mail: DelphiDirectX@next-reality.com
16867
 *  E-Mail: DelphiDirectX@next-reality.com
16864
 *
16868
 *
16865
 ***************************************************************************)
16869
 ***************************************************************************)
16866
 
16870
 
16867
var
16871
var
16868
  DSetupDLL : HModule;
16872
  DSetupDLL : HModule;
16869
 
16873
 
16870
type
16874
type
16871
  PDLSVersion = ^TDLSVersion;
16875
  PDLSVersion = ^TDLSVersion;
16872
  TDLSVersion = packed record
16876
  TDLSVersion = packed record
16873
    dwVersionMS: DWORD;
16877
    dwVersionMS: DWORD;
16874
    dwVersionLS: DWORD;
16878
    dwVersionLS: DWORD;
16875
  end;
16879
  end;
16876
 
16880
 
16877
 
16881
 
16878
const
16882
const
16879
  FOURCC_VERS : array[0..3] of Char = ('v','e','r','s');
16883
  FOURCC_VERS : array[0..3] of Char = ('v','e','r','s');
16880
 
16884
 
16881
// DSETUP Error Codes, must remain compatible with previous setup.
16885
// DSETUP Error Codes, must remain compatible with previous setup.
16882
  DSETUPERR_SUCCESS_RESTART     = HResult(1);
16886
  DSETUPERR_SUCCESS_RESTART     = HResult(1);
16883
  DSETUPERR_SUCCESS             = HResult(0);
16887
  DSETUPERR_SUCCESS             = HResult(0);
16884
  DSETUPERR_BADWINDOWSVERSION   = HResult(-1);
16888
  DSETUPERR_BADWINDOWSVERSION   = HResult(-1);
16885
  DSETUPERR_SOURCEFILENOTFOUND  = HResult(-2);
16889
  DSETUPERR_SOURCEFILENOTFOUND  = HResult(-2);
16886
  DSETUPERR_BADSOURCESIZE       = HResult(-3);
16890
  DSETUPERR_BADSOURCESIZE       = HResult(-3);
16887
  DSETUPERR_BADSOURCETIME       = HResult(-4);
16891
  DSETUPERR_BADSOURCETIME       = HResult(-4);
16888
  DSETUPERR_NOCOPY              = HResult(-5);
16892
  DSETUPERR_NOCOPY              = HResult(-5);
16889
  DSETUPERR_OUTOFDISKSPACE      = HResult(-6);
16893
  DSETUPERR_OUTOFDISKSPACE      = HResult(-6);
16890
  DSETUPERR_CANTFINDINF         = HResult(-7);
16894
  DSETUPERR_CANTFINDINF         = HResult(-7);
16891
  DSETUPERR_CANTFINDDIR         = HResult(-8);
16895
  DSETUPERR_CANTFINDDIR         = HResult(-8);
16892
  DSETUPERR_INTERNAL            = HResult(-9);
16896
  DSETUPERR_INTERNAL            = HResult(-9);
16893
  DSETUPERR_NTWITHNO3D          = HResult(-10);  // REM: obsolete, you'll never see this
16897
  DSETUPERR_NTWITHNO3D          = HResult(-10);  // REM: obsolete, you'll never see this
16894
  DSETUPERR_UNKNOWNOS           = HResult(-11);
16898
  DSETUPERR_UNKNOWNOS           = HResult(-11);
16895
  DSETUPERR_USERHITCANCEL       = HResult(-12);
16899
  DSETUPERR_USERHITCANCEL       = HResult(-12);
16896
  DSETUPERR_NOTPREINSTALLEDONNT = HResult(-13);
16900
  DSETUPERR_NOTPREINSTALLEDONNT = HResult(-13);
16897
  DSETUPERR_NEWERVERSION        = HResult(-14);  
16901
  DSETUPERR_NEWERVERSION        = HResult(-14);  
16898
 
16902
 
16899
// DSETUP flags. DirectX 5.0 apps should use these flags only.
16903
// DSETUP flags. DirectX 5.0 apps should use these flags only.
16900
  DSETUP_DDRAWDRV     = $00000008;   (* install DirectDraw Drivers           *)
16904
  DSETUP_DDRAWDRV     = $00000008;   (* install DirectDraw Drivers           *)
16901
  DSETUP_DSOUNDDRV    = $00000010;   (* install DirectSound Drivers          *)
16905
  DSETUP_DSOUNDDRV    = $00000010;   (* install DirectSound Drivers          *)
16902
  DSETUP_DXCORE       = $00010000;   (* install DirectX runtime              *)
16906
  DSETUP_DXCORE       = $00010000;   (* install DirectX runtime              *)
16903
  DSETUP_DIRECTX = DSETUP_DXCORE or DSETUP_DDRAWDRV or DSETUP_DSOUNDDRV;
16907
  DSETUP_DIRECTX = DSETUP_DXCORE or DSETUP_DDRAWDRV or DSETUP_DSOUNDDRV;
16904
  DSETUP_TESTINSTALL  = $00020000;   (* just test install, don't do anything *)
16908
  DSETUP_TESTINSTALL  = $00020000;   (* just test install, don't do anything *)
16905
  DSETUP_USEROLDERFLAG= $02000000;   (* enable return DSETUPERR_NEWERVERSION *)
16909
  DSETUP_USEROLDERFLAG= $02000000;   (* enable return DSETUPERR_NEWERVERSION *)
16906
// Bug #22730
16910
// Bug #22730
16907
  DSETUP_NTINSTALL              = $00080000;   (* install on Win2K platform *)
16911
  DSETUP_NTINSTALL              = $00080000;   (* install on Win2K platform *)
16908
 
16912
 
16909
// These OBSOLETE flags are here for compatibility with pre-DX5 apps only.
16913
// These OBSOLETE flags are here for compatibility with pre-DX5 apps only.
16910
// They are present to allow DX3 apps to be recompiled with DX5 and still work.
16914
// They are present to allow DX3 apps to be recompiled with DX5 and still work.
16911
// DO NOT USE THEM for DX5. They will go away in future DX releases.
16915
// DO NOT USE THEM for DX5. They will go away in future DX releases.
16912
  DSETUP_DDRAW         = $00000001; (* OBSOLETE. install DirectDraw           *)
16916
  DSETUP_DDRAW         = $00000001; (* OBSOLETE. install DirectDraw           *)
16913
  DSETUP_DSOUND        = $00000002; (* OBSOLETE. install DirectSound          *)
16917
  DSETUP_DSOUND        = $00000002; (* OBSOLETE. install DirectSound          *)
16914
  DSETUP_DPLAY         = $00000004; (* OBSOLETE. install DirectPlay           *)
16918
  DSETUP_DPLAY         = $00000004; (* OBSOLETE. install DirectPlay           *)
16915
  DSETUP_DPLAYSP       = $00000020; (* OBSOLETE. install DirectPlay Providers *)
16919
  DSETUP_DPLAYSP       = $00000020; (* OBSOLETE. install DirectPlay Providers *)
16916
  DSETUP_DVIDEO        = $00000040; (* OBSOLETE. install DirectVideo          *)
16920
  DSETUP_DVIDEO        = $00000040; (* OBSOLETE. install DirectVideo          *)
16917
  DSETUP_D3D           = $00000200; (* OBSOLETE. install Direct3D             *)
16921
  DSETUP_D3D           = $00000200; (* OBSOLETE. install Direct3D             *)
16918
  DSETUP_DINPUT        = $00000800; (* OBSOLETE. install DirectInput          *)
16922
  DSETUP_DINPUT        = $00000800; (* OBSOLETE. install DirectInput          *)
16919
  DSETUP_DIRECTXSETUP  = $00001000; (* OBSOLETE. install DirectXSetup DLL's   *)
16923
  DSETUP_DIRECTXSETUP  = $00001000; (* OBSOLETE. install DirectXSetup DLL's   *)
16920
  DSETUP_NOUI          = $00002000; (* OBSOLETE. install DirectX with NO UI   *)
16924
  DSETUP_NOUI          = $00002000; (* OBSOLETE. install DirectX with NO UI   *)
16921
  DSETUP_PROMPTFORDRIVERS = $10000000; (* OBSOLETE. prompt when replacing display/audio drivers *)
16925
  DSETUP_PROMPTFORDRIVERS = $10000000; (* OBSOLETE. prompt when replacing display/audio drivers *)
16922
  DSETUP_RESTOREDRIVERS = $20000000;(* OBSOLETE. restore display/audio drivers *)
16926
  DSETUP_RESTOREDRIVERS = $20000000;(* OBSOLETE. restore display/audio drivers *)
16923
 
16927
 
16924
//******************************************************************
16928
//******************************************************************
16925
// DirectX Setup Callback mechanism
16929
// DirectX Setup Callback mechanism
16926
//******************************************************************
16930
//******************************************************************
16927
 
16931
 
16928
// DSETUP Message Info Codes, passed to callback as Reason parameter.
16932
// DSETUP Message Info Codes, passed to callback as Reason parameter.
16929
  DSETUP_CB_MSG_NOMESSAGE                 = 0;
16933
  DSETUP_CB_MSG_NOMESSAGE                 = 0;
16930
  DSETUP_CB_MSG_CANTINSTALL_UNKNOWNOS     = 1;
16934
  DSETUP_CB_MSG_CANTINSTALL_UNKNOWNOS     = 1;
16931
  DSETUP_CB_MSG_CANTINSTALL_NT            = 2;
16935
  DSETUP_CB_MSG_CANTINSTALL_NT            = 2;
16932
  DSETUP_CB_MSG_CANTINSTALL_BETA          = 3;
16936
  DSETUP_CB_MSG_CANTINSTALL_BETA          = 3;
16933
  DSETUP_CB_MSG_CANTINSTALL_NOTWIN32      = 4;
16937
  DSETUP_CB_MSG_CANTINSTALL_NOTWIN32      = 4;
16934
  DSETUP_CB_MSG_CANTINSTALL_WRONGLANGUAGE = 5;
16938
  DSETUP_CB_MSG_CANTINSTALL_WRONGLANGUAGE = 5;
16935
  DSETUP_CB_MSG_CANTINSTALL_WRONGPLATFORM = 6;
16939
  DSETUP_CB_MSG_CANTINSTALL_WRONGPLATFORM = 6;
16936
  DSETUP_CB_MSG_PREINSTALL_NT             = 7;
16940
  DSETUP_CB_MSG_PREINSTALL_NT             = 7;
16937
  DSETUP_CB_MSG_NOTPREINSTALLEDONNT       = 8;
16941
  DSETUP_CB_MSG_NOTPREINSTALLEDONNT       = 8;
16938
  DSETUP_CB_MSG_SETUP_INIT_FAILED         = 9;
16942
  DSETUP_CB_MSG_SETUP_INIT_FAILED         = 9;
16939
  DSETUP_CB_MSG_INTERNAL_ERROR            = 10;
16943
  DSETUP_CB_MSG_INTERNAL_ERROR            = 10;
16940
  DSETUP_CB_MSG_CHECK_DRIVER_UPGRADE      = 11;
16944
  DSETUP_CB_MSG_CHECK_DRIVER_UPGRADE      = 11;
16941
  DSETUP_CB_MSG_OUTOFDISKSPACE            = 12;
16945
  DSETUP_CB_MSG_OUTOFDISKSPACE            = 12;
16942
  DSETUP_CB_MSG_BEGIN_INSTALL             = 13;
16946
  DSETUP_CB_MSG_BEGIN_INSTALL             = 13;
16943
  DSETUP_CB_MSG_BEGIN_INSTALL_RUNTIME     = 14;
16947
  DSETUP_CB_MSG_BEGIN_INSTALL_RUNTIME     = 14;
16944
  DSETUP_CB_MSG_BEGIN_INSTALL_DRIVERS     = 15;
16948
  DSETUP_CB_MSG_BEGIN_INSTALL_DRIVERS     = 15;
16945
  DSETUP_CB_MSG_BEGIN_RESTORE_DRIVERS     = 16;
16949
  DSETUP_CB_MSG_BEGIN_RESTORE_DRIVERS     = 16;
16946
  DSETUP_CB_MSG_FILECOPYERROR             = 17;
16950
  DSETUP_CB_MSG_FILECOPYERROR             = 17;
16947
 
16951
 
16948
 
16952
 
16949
  DSETUP_CB_UPGRADE_TYPE_MASK      = $000F;
16953
  DSETUP_CB_UPGRADE_TYPE_MASK      = $000F;
16950
  DSETUP_CB_UPGRADE_KEEP           = $0001;
16954
  DSETUP_CB_UPGRADE_KEEP           = $0001;
16951
  DSETUP_CB_UPGRADE_SAFE           = $0002;
16955
  DSETUP_CB_UPGRADE_SAFE           = $0002;
16952
  DSETUP_CB_UPGRADE_FORCE          = $0004;
16956
  DSETUP_CB_UPGRADE_FORCE          = $0004;
16953
  DSETUP_CB_UPGRADE_UNKNOWN        = $0008;
16957
  DSETUP_CB_UPGRADE_UNKNOWN        = $0008;
16954
 
16958
 
16955
  DSETUP_CB_UPGRADE_HASWARNINGS    = $0100;
16959
  DSETUP_CB_UPGRADE_HASWARNINGS    = $0100;
16956
  DSETUP_CB_UPGRADE_CANTBACKUP     = $0200;
16960
  DSETUP_CB_UPGRADE_CANTBACKUP     = $0200;
16957
 
16961
 
16958
  DSETUP_CB_UPGRADE_DEVICE_ACTIVE  = $0800;
16962
  DSETUP_CB_UPGRADE_DEVICE_ACTIVE  = $0800;
16959
 
16963
 
16960
  DSETUP_CB_UPGRADE_DEVICE_DISPLAY = $1000;
16964
  DSETUP_CB_UPGRADE_DEVICE_DISPLAY = $1000;
16961
  DSETUP_CB_UPGRADE_DEVICE_MEDIA   = $2000;
16965
  DSETUP_CB_UPGRADE_DEVICE_MEDIA   = $2000;
16962
 
16966
 
16963
 
16967
 
16964
type
16968
type
16965
  PDSetup_CB_UpgradeInfo = ^TDSetup_CB_UpgradeInfo;
16969
  PDSetup_CB_UpgradeInfo = ^TDSetup_CB_UpgradeInfo;
16966
  TDSetup_CB_UpgradeInfo = record
16970
  TDSetup_CB_UpgradeInfo = record
16967
    UpgradeFlags: DWORD;
16971
    UpgradeFlags: DWORD;
16968
  end;
16972
  end;
16969
 
16973
 
16970
  PDSetup_CB_FileCopyError = ^TDSetup_CB_FileCopyError;
16974
  PDSetup_CB_FileCopyError = ^TDSetup_CB_FileCopyError;
16971
  TDSetup_CB_FileCopyError = record
16975
  TDSetup_CB_FileCopyError = record
16972
    dwError: DWORD;
16976
    dwError: DWORD;
16973
  end;
16977
  end;
16974
 
16978
 
16975
//
16979
//
16976
// Data Structures
16980
// Data Structures
16977
//
16981
//
16978
  PDirectXRegisterAppA = ^TDirectXRegisterAppA;
16982
  PDirectXRegisterAppA = ^TDirectXRegisterAppA;
16979
  TDirectXRegisterAppA = record
16983
  TDirectXRegisterAppA = record
16980
    dwSize: DWORD;
16984
    dwSize: DWORD;
16981
    dwFlags: DWORD;
16985
    dwFlags: DWORD;
16982
    lpszApplicationName: PAnsiChar;
16986
    lpszApplicationName: PAnsiChar;
16983
    lpGUID: PGUID;
16987
    lpGUID: PGUID;
16984
    lpszFilename: PAnsiChar;
16988
    lpszFilename: PAnsiChar;
16985
    lpszCommandLine: PAnsiChar;
16989
    lpszCommandLine: PAnsiChar;
16986
    lpszPath: PAnsiChar;
16990
    lpszPath: PAnsiChar;
16987
    lpszCurrentDirectory: PAnsiChar;
16991
    lpszCurrentDirectory: PAnsiChar;
16988
  end;
16992
  end;
16989
 
16993
 
16990
  PDirectXRegisterApp2A = ^TDirectXRegisterApp2A;
16994
  PDirectXRegisterApp2A = ^TDirectXRegisterApp2A;
16991
  TDirectXRegisterApp2A = record
16995
  TDirectXRegisterApp2A = record
16992
    dwSize: DWORD;
16996
    dwSize: DWORD;
16993
    dwFlags: DWORD;
16997
    dwFlags: DWORD;
16994
    lpszApplicationName: PAnsiChar;
16998
    lpszApplicationName: PAnsiChar;
16995
    lpGUID: PGUID;
16999
    lpGUID: PGUID;
16996
    lpszFilename: PAnsiChar;
17000
    lpszFilename: PAnsiChar;
16997
    lpszCommandLine: PAnsiChar;
17001
    lpszCommandLine: PAnsiChar;
16998
    lpszPath: PAnsiChar;
17002
    lpszPath: PAnsiChar;
16999
    lpszCurrentDirectory: PAnsiChar;
17003
    lpszCurrentDirectory: PAnsiChar;
17000
    lpszLauncherName: PAnsiChar;
17004
    lpszLauncherName: PAnsiChar;
17001
  end;
17005
  end;
17002
 
17006
 
17003
  PDirectXRegisterAppW = ^TDirectXRegisterAppW;
17007
  PDirectXRegisterAppW = ^TDirectXRegisterAppW;
17004
  TDirectXRegisterAppW = record
17008
  TDirectXRegisterAppW = record
17005
    dwSize: DWORD;
17009
    dwSize: DWORD;
17006
    dwFlags: DWORD;
17010
    dwFlags: DWORD;
17007
    lpszApplicationName: PWideChar;
17011
    lpszApplicationName: PWideChar;
17008
    lpGUID: PGUID;
17012
    lpGUID: PGUID;
17009
    lpszFilename: PWideChar;
17013
    lpszFilename: PWideChar;
17010
    lpszCommandLine: PWideChar;
17014
    lpszCommandLine: PWideChar;
17011
    lpszPath: PWideChar;
17015
    lpszPath: PWideChar;
17012
    lpszCurrentDirectory: PWideChar;
17016
    lpszCurrentDirectory: PWideChar;
17013
  end;
17017
  end;
17014
 
17018
 
17015
  PDirectXRegisterApp2W = ^TDirectXRegisterApp2W;
17019
  PDirectXRegisterApp2W = ^TDirectXRegisterApp2W;
17016
  TDirectXRegisterApp2W = record
17020
  TDirectXRegisterApp2W = record
17017
    dwSize: DWORD;
17021
    dwSize: DWORD;
17018
    dwFlags: DWORD;
17022
    dwFlags: DWORD;
17019
    lpszApplicationName: PWideChar;
17023
    lpszApplicationName: PWideChar;
17020
    lpGUID: PGUID;
17024
    lpGUID: PGUID;
17021
    lpszFilename: PWideChar;
17025
    lpszFilename: PWideChar;
17022
    lpszCommandLine: PWideChar;
17026
    lpszCommandLine: PWideChar;
17023
    lpszPath: PWideChar;
17027
    lpszPath: PWideChar;
17024
    lpszCurrentDirectory: PWideChar;
17028
    lpszCurrentDirectory: PWideChar;
17025
    lpszLauncherName: PWideChar;
17029
    lpszLauncherName: PWideChar;
17026
  end;
17030
  end;
17027
 
17031
 
17028
  PDirectXRegisterApp = ^TDirectXRegisterApp;
17032
  PDirectXRegisterApp = ^TDirectXRegisterApp;
17029
  PDirectXRegisterApp2 = ^TDirectXRegisterApp2;
17033
  PDirectXRegisterApp2 = ^TDirectXRegisterApp2;
17030
{$IFDEF UNICODE}
17034
{$IFDEF UNICODE}
17031
  TDirectXRegisterApp = TDirectXRegisterAppW;
17035
  TDirectXRegisterApp = TDirectXRegisterAppW;
17032
  TDirectXRegisterApp2 = TDirectXRegisterApp2W;
17036
  TDirectXRegisterApp2 = TDirectXRegisterApp2W;
17033
{$ELSE}
17037
{$ELSE}
17034
  TDirectXRegisterApp = TDirectXRegisterAppA;
17038
  TDirectXRegisterApp = TDirectXRegisterAppA;
17035
  TDirectXRegisterApp2 = TDirectXRegisterApp2A;
17039
  TDirectXRegisterApp2 = TDirectXRegisterApp2A;
17036
{$ENDIF}
17040
{$ENDIF}
17037
 
17041
 
17038
//
17042
//
17039
// API
17043
// API
17040
//
17044
//
17041
var
17045
var
17042
  DirectXSetupW : function (hWnd: HWND; lpszRootPath: PWideChar; dwFlags: DWORD) : Integer; stdcall;
17046
  DirectXSetupW : function (hWnd: HWND; lpszRootPath: PWideChar; dwFlags: DWORD) : Integer; stdcall;
17043
  DirectXSetupA : function (hWnd: HWND; lpszRootPath: PAnsiChar; dwFlags: DWORD) : Integer; stdcall;
17047
  DirectXSetupA : function (hWnd: HWND; lpszRootPath: PAnsiChar; dwFlags: DWORD) : Integer; stdcall;
17044
  DirectXSetup : function (hWnd: HWND; lpszRootPath: PCharAW; dwFlags: DWORD) : Integer; stdcall;
17048
  DirectXSetup : function (hWnd: HWND; lpszRootPath: PCharAW; dwFlags: DWORD) : Integer; stdcall;
17045
 
17049
 
17046
  DirectXDeviceDriverSetupW : function (hWnd: HWND; lpszDriverClass: PWideChar;
17050
  DirectXDeviceDriverSetupW : function (hWnd: HWND; lpszDriverClass: PWideChar;
17047
     lpszDriverPath: PWideChar; dwFlags: DWORD) : Integer; stdcall;
17051
     lpszDriverPath: PWideChar; dwFlags: DWORD) : Integer; stdcall;
17048
  DirectXDeviceDriverSetupA : function (hWnd: HWND; lpszDriverClass: PAnsiChar;
17052
  DirectXDeviceDriverSetupA : function (hWnd: HWND; lpszDriverClass: PAnsiChar;
17049
     lpszDriverPath: PAnsiChar; dwFlags: DWORD) : Integer; stdcall;
17053
     lpszDriverPath: PAnsiChar; dwFlags: DWORD) : Integer; stdcall;
17050
  DirectXDeviceDriverSetup : function (hWnd: HWND; lpszDriverClass: PCharAW;
17054
  DirectXDeviceDriverSetup : function (hWnd: HWND; lpszDriverClass: PCharAW;
17051
     lpszDriverPath: PCharAW; dwFlags: DWORD) : Integer; stdcall;
17055
     lpszDriverPath: PCharAW; dwFlags: DWORD) : Integer; stdcall;
17052
 
17056
 
17053
  DirectXRegisterApplicationW : function
17057
  DirectXRegisterApplicationW : function
17054
     (hWnd: HWND; const lpDXRegApp: TDirectXRegisterAppW) : Integer; stdcall;
17058
     (hWnd: HWND; const lpDXRegApp: TDirectXRegisterAppW) : Integer; stdcall;
17055
  DirectXRegisterApplicationA : function
17059
  DirectXRegisterApplicationA : function
17056
     (hWnd: HWND; const lpDXRegApp: TDirectXRegisterAppA) : Integer; stdcall;
17060
     (hWnd: HWND; const lpDXRegApp: TDirectXRegisterAppA) : Integer; stdcall;
17057
  DirectXRegisterApplication : function
17061
  DirectXRegisterApplication : function
17058
     (hWnd: HWND; const lpDXRegApp: TDirectXRegisterApp) : Integer; stdcall;
17062
     (hWnd: HWND; const lpDXRegApp: TDirectXRegisterApp) : Integer; stdcall;
17059
 
17063
 
17060
  DirectXUnRegisterApplication : function
17064
  DirectXUnRegisterApplication : function
17061
     (hWnd: HWND; const lpGUID: TGUID) : Integer; stdcall;
17065
     (hWnd: HWND; const lpGUID: TGUID) : Integer; stdcall;
17062
 
17066
 
17063
type
17067
type
17064
  TDSetup_Callback = function (Reason: DWORD; MsgType: DWORD; // Same as flags to MessageBox
17068
  TDSetup_Callback = function (Reason: DWORD; MsgType: DWORD; // Same as flags to MessageBox
17065
      szMessage: PChar; szName: PChar; pInfo: Pointer) : DWORD; stdcall;
17069
      szMessage: PChar; szName: PChar; pInfo: Pointer) : DWORD; stdcall;
17066
 
17070
 
17067
var
17071
var
17068
  DirectXSetupSetCallback : function (Callback: TDSetup_Callback) : Integer; stdcall;
17072
  DirectXSetupSetCallback : function (Callback: TDSetup_Callback) : Integer; stdcall;
17069
 
17073
 
17070
  DirectXSetupGetVersion : function (out lpdwVersion, lpdwMinorVersion: DWORD) : Integer; stdcall;
17074
  DirectXSetupGetVersion : function (out lpdwVersion, lpdwMinorVersion: DWORD) : Integer; stdcall;
17071
 
17075
 
17072
//DirectSound file
17076
//DirectSound file
17073
(*==========================================================================;
17077
(*==========================================================================;
17074
 *
17078
 *
17075
 *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
17079
 *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
17076
 *
17080
 *
17077
 *  File:       dsound.h
17081
 *  File:       dsound.h
17078
 *  Content:    DirectSound include file
17082
 *  Content:    DirectSound include file
17079
 *
17083
 *
17080
 *  DirectX 7.0 Delphi adaptation by Erik Unger
17084
 *  DirectX 7.0 Delphi adaptation by Erik Unger
17081
 *
17085
 *
17082
 *  Modified: 10-Sep-2000
17086
 *  Modified: 10-Sep-2000
17083
 *
17087
 *
17084
 *  Download: http://www.delphi-jedi.org/DelphiGraphics/
17088
 *  Download: http://www.delphi-jedi.org/DelphiGraphics/
17085
 *  E-Mail: DelphiDirectX@next-reality.com
17089
 *  E-Mail: DelphiDirectX@next-reality.com
17086
 *
17090
 *
17087
 ***************************************************************************)
17091
 ***************************************************************************)
17088
 
17092
 
17089
{
17093
{
17090
  Windows 98 and debug versions DInput and DSound
17094
  Windows 98 and debug versions DInput and DSound
17091
 
17095
 
17092
  Under Windows 98, the "debug" setup of the DirectX SDK 6.x skips DInput.DLL
17096
  Under Windows 98, the "debug" setup of the DirectX SDK 6.x skips DInput.DLL
17093
  and DSound.DLL, i.e. makes you end up with the retail version of these two
17097
  and DSound.DLL, i.e. makes you end up with the retail version of these two
17094
  files without any notice.
17098
  files without any notice.
17095
  The debug versions of DInput.DLL and DSound.DLL can be found in the
17099
  The debug versions of DInput.DLL and DSound.DLL can be found in the
17096
  \extras\Win98\Win98Dbg folder of the SDK CD; they need to be installed
17100
  \extras\Win98\Win98Dbg folder of the SDK CD; they need to be installed
17097
  "manually".
17101
  "manually".
17098
}
17102
}
17099
 
17103
 
17100
 
17104
 
17101
var
17105
var
17102
  DSoundDLL : HMODULE;
17106
  DSoundDLL : HMODULE;
17103
 
17107
 
17104
function DSErrorString(Value: HResult) : string;
17108
function DSErrorString(Value: HResult) : string;
17105
 
17109
 
17106
const
17110
const
17107
  _FACDS = $878;
17111
  _FACDS = $878;
17108
function MAKE_DSHResult(code: DWORD) : HResult;
17112
function MAKE_DSHResult(code: DWORD) : HResult;
17109
 
17113
 
17110
const
17114
const
17111
  FLT_MIN = 1.175494351E-38;
17115
  FLT_MIN = 1.175494351E-38;
17112
  FLT_MAX = 3.402823466E+38;
17116
  FLT_MAX = 3.402823466E+38;
17113
 
17117
 
17114
const
17118
const
17115
// Direct Sound Component GUID {47D4D946-62E8-11cf-93BC-444553540000}
17119
// Direct Sound Component GUID {47D4D946-62E8-11cf-93BC-444553540000}
17116
  CLSID_DirectSound: TGUID = '{47D4D946-62E8-11cf-93BC-444553540000}';
17120
  CLSID_DirectSound: TGUID = '{47D4D946-62E8-11cf-93BC-444553540000}';
17117
 
17121
 
17118
// DirectSound Capture Component GUID {B0210780-89CD-11d0-AF08-00A0C925CD16}
17122
// DirectSound Capture Component GUID {B0210780-89CD-11d0-AF08-00A0C925CD16}
17119
  CLSID_DirectSoundCapture: TGUID = '{47D4D946-62E8-11cf-93BC-444553540000}';
17123
  CLSID_DirectSoundCapture: TGUID = '{47D4D946-62E8-11cf-93BC-444553540000}';
17120
 
17124
 
17121
//
17125
//
17122
// Structures
17126
// Structures
17123
//
17127
//
17124
type
17128
type
17125
  IDirectSound = interface;
17129
  IDirectSound = interface;
17126
  IDirectSoundBuffer = interface;
17130
  IDirectSoundBuffer = interface;
17127
  IDirectSound3DListener = interface;
17131
  IDirectSound3DListener = interface;
17128
  IDirectSound3DBuffer = interface;
17132
  IDirectSound3DBuffer = interface;
17129
  IDirectSoundCapture = interface;
17133
  IDirectSoundCapture = interface;
17130
  IDirectSoundCaptureBuffer = interface;
17134
  IDirectSoundCaptureBuffer = interface;
17131
  IDirectSoundNotify = interface;
17135
  IDirectSoundNotify = interface;
17132
  IKsPropertySet = interface;
17136
  IKsPropertySet = interface;
17133
 
17137
 
17134
  PDSCaps = ^TDSCaps;
17138
  PDSCaps = ^TDSCaps;
17135
  TDSCaps = packed record
17139
  TDSCaps = packed record
17136
    dwSize: DWORD;
17140
    dwSize: DWORD;
17137
    dwFlags: DWORD;
17141
    dwFlags: DWORD;
17138
    dwMinSecondarySampleRate: DWORD;
17142
    dwMinSecondarySampleRate: DWORD;
17139
    dwMaxSecondarySampleRate: DWORD;
17143
    dwMaxSecondarySampleRate: DWORD;
17140
    dwPrimaryBuffers: DWORD;
17144
    dwPrimaryBuffers: DWORD;
17141
    dwMaxHwMixingAllBuffers: DWORD;
17145
    dwMaxHwMixingAllBuffers: DWORD;
17142
    dwMaxHwMixingStaticBuffers: DWORD;
17146
    dwMaxHwMixingStaticBuffers: DWORD;
17143
    dwMaxHwMixingStreamingBuffers: DWORD;
17147
    dwMaxHwMixingStreamingBuffers: DWORD;
17144
    dwFreeHwMixingAllBuffers: DWORD;
17148
    dwFreeHwMixingAllBuffers: DWORD;
17145
    dwFreeHwMixingStaticBuffers: DWORD;
17149
    dwFreeHwMixingStaticBuffers: DWORD;
17146
    dwFreeHwMixingStreamingBuffers: DWORD;
17150
    dwFreeHwMixingStreamingBuffers: DWORD;
17147
    dwMaxHw3DAllBuffers: DWORD;
17151
    dwMaxHw3DAllBuffers: DWORD;
17148
    dwMaxHw3DStaticBuffers: DWORD;
17152
    dwMaxHw3DStaticBuffers: DWORD;
17149
    dwMaxHw3DStreamingBuffers: DWORD;
17153
    dwMaxHw3DStreamingBuffers: DWORD;
17150
    dwFreeHw3DAllBuffers: DWORD;
17154
    dwFreeHw3DAllBuffers: DWORD;
17151
    dwFreeHw3DStaticBuffers: DWORD;
17155
    dwFreeHw3DStaticBuffers: DWORD;
17152
    dwFreeHw3DStreamingBuffers: DWORD;
17156
    dwFreeHw3DStreamingBuffers: DWORD;
17153
    dwTotalHwMemBytes: DWORD;
17157
    dwTotalHwMemBytes: DWORD;
17154
    dwFreeHwMemBytes: DWORD;
17158
    dwFreeHwMemBytes: DWORD;
17155
    dwMaxContigFreeHwMemBytes: DWORD;
17159
    dwMaxContigFreeHwMemBytes: DWORD;
17156
    dwUnlockTransferRateHwBuffers: DWORD;
17160
    dwUnlockTransferRateHwBuffers: DWORD;
17157
    dwPlayCpuOverheadSwBuffers: DWORD;
17161
    dwPlayCpuOverheadSwBuffers: DWORD;
17158
    dwReserved1: DWORD;
17162
    dwReserved1: DWORD;
17159
    dwReserved2: DWORD;
17163
    dwReserved2: DWORD;
17160
  end;
17164
  end;
17161
  PCDSCaps = ^TDSCaps;
17165
  PCDSCaps = ^TDSCaps;
17162
 
17166
 
17163
  PDSBCaps = ^TDSBCaps;
17167
  PDSBCaps = ^TDSBCaps;
17164
  TDSBCaps = packed record
17168
  TDSBCaps = packed record
17165
    dwSize: DWORD;
17169
    dwSize: DWORD;
17166
    dwFlags: DWORD;
17170
    dwFlags: DWORD;
17167
    dwBufferBytes: DWORD;
17171
    dwBufferBytes: DWORD;
17168
    dwUnlockTransferRate: DWORD;
17172
    dwUnlockTransferRate: DWORD;
17169
    dwPlayCpuOverhead: DWORD;
17173
    dwPlayCpuOverhead: DWORD;
17170
  end;
17174
  end;
17171
  PCDSBCaps = ^TDSBCaps;
17175
  PCDSBCaps = ^TDSBCaps;
17172
 
17176
 
17173
  TDSBufferDesc_DX6 = packed record
17177
  TDSBufferDesc_DX6 = packed record
17174
    dwSize: DWORD;
17178
    dwSize: DWORD;
17175
    dwFlags: DWORD;
17179
    dwFlags: DWORD;
17176
    dwBufferBytes: DWORD;
17180
    dwBufferBytes: DWORD;
17177
    dwReserved: DWORD;
17181
    dwReserved: DWORD;
17178
    lpwfxFormat: PWaveFormatEx;
17182
    lpwfxFormat: PWaveFormatEx;
17179
  end;
17183
  end;
17180
 
17184
 
17181
  TDSBufferDesc1 = TDSBufferDesc_DX6;
17185
  TDSBufferDesc1 = TDSBufferDesc_DX6;
17182
  PDSBufferDesc1 = ^TDSBufferDesc1;
17186
  PDSBufferDesc1 = ^TDSBufferDesc1;
17183
  PCDSBufferDesc1 = PDSBufferDesc1;
17187
  PCDSBufferDesc1 = PDSBufferDesc1;
17184
 
17188
 
17185
  TDSBufferDesc_DX7 = packed record
17189
  TDSBufferDesc_DX7 = packed record
17186
    dwSize: DWORD;
17190
    dwSize: DWORD;
17187
    dwFlags: DWORD;
17191
    dwFlags: DWORD;
17188
    dwBufferBytes: DWORD;
17192
    dwBufferBytes: DWORD;
17189
    dwReserved: DWORD;
17193
    dwReserved: DWORD;
17190
    lpwfxFormat: PWaveFormatEx;
17194
    lpwfxFormat: PWaveFormatEx;
17191
    guid3DAlgorithm: TGUID;
17195
    guid3DAlgorithm: TGUID;
17192
  end;
17196
  end;
17193
 
17197
 
17194
{$IFDEF DIRECTX6}
17198
{$IFDEF DIRECTX6}
17195
  TDSBufferDesc = TDSBufferDesc_DX6;
17199
  TDSBufferDesc = TDSBufferDesc_DX6;
17196
{$ELSE}
17200
{$ELSE}
17197
  TDSBufferDesc = TDSBufferDesc_DX7;
17201
  TDSBufferDesc = TDSBufferDesc_DX7;
17198
{$ENDIF}
17202
{$ENDIF}
17199
 
17203
 
17200
  PDSBufferDesc = ^TDSBufferDesc;
17204
  PDSBufferDesc = ^TDSBufferDesc;
17201
  PCDSBufferDesc = PDSBufferDesc;
17205
  PCDSBufferDesc = PDSBufferDesc;
17202
 
17206
 
17203
(***
17207
(***
17204
// Snipped from D3DTypes.pas:
17208
// Snipped from D3DTypes.pas:
17205
 
17209
 
17206
  TD3DValue = Single;
17210
  TD3DValue = Single;
17207
 
17211
 
17208
  PD3DVector = ^TD3DVector;
17212
  PD3DVector = ^TD3DVector;
17209
  TD3DVector = packed record
17213
  TD3DVector = packed record
17210
    case Integer of
17214
    case Integer of
17211
    0: (
17215
    0: (
17212
      x: TD3DValue;
17216
      x: TD3DValue;
17213
      y: TD3DValue;
17217
      y: TD3DValue;
17214
      z: TD3DValue;
17218
      z: TD3DValue;
17215
     );
17219
     );
17216
    1: (
17220
    1: (
17217
      dvX: TD3DValue;
17221
      dvX: TD3DValue;
17218
      dvY: TD3DValue;
17222
      dvY: TD3DValue;
17219
      dvZ: TD3DValue;
17223
      dvZ: TD3DValue;
17220
     );
17224
     );
17221
  end;
17225
  end;
17222
*)
17226
*)
17223
 
17227
 
17224
  PDS3DBuffer = ^TDS3DBuffer;
17228
  PDS3DBuffer = ^TDS3DBuffer;
17225
  TDS3DBuffer = packed record
17229
  TDS3DBuffer = packed record
17226
    dwSize: DWORD;
17230
    dwSize: DWORD;
17227
    vPosition: TD3DVector;
17231
    vPosition: TD3DVector;
17228
    vVelocity: TD3DVector;
17232
    vVelocity: TD3DVector;
17229
    dwInsideConeAngle: DWORD;
17233
    dwInsideConeAngle: DWORD;
17230
    dwOutsideConeAngle: DWORD;
17234
    dwOutsideConeAngle: DWORD;
17231
    vConeOrientation: TD3DVector;
17235
    vConeOrientation: TD3DVector;
17232
    lConeOutsideVolume: LongInt;
17236
    lConeOutsideVolume: LongInt;
17233
    flMinDistance: TD3DValue;
17237
    flMinDistance: TD3DValue;
17234
    flMaxDistance: TD3DValue;
17238
    flMaxDistance: TD3DValue;
17235
    dwMode: DWORD;
17239
    dwMode: DWORD;
17236
  end;
17240
  end;
17237
  TCDS3DBuffer = ^TDS3DBuffer;
17241
  TCDS3DBuffer = ^TDS3DBuffer;
17238
 
17242
 
17239
  PDS3DListener = ^TDS3DListener;
17243
  PDS3DListener = ^TDS3DListener;
17240
  TDS3DListener = packed record
17244
  TDS3DListener = packed record
17241
    dwSize: DWORD;
17245
    dwSize: DWORD;
17242
    vPosition: TD3DVector;
17246
    vPosition: TD3DVector;
17243
    vVelocity: TD3DVector;
17247
    vVelocity: TD3DVector;
17244
    vOrientFront: TD3DVector;
17248
    vOrientFront: TD3DVector;
17245
    vOrientTop: TD3DVector;
17249
    vOrientTop: TD3DVector;
17246
    flDistanceFactor: TD3DValue;
17250
    flDistanceFactor: TD3DValue;
17247
    flRolloffFactor: TD3DValue;
17251
    flRolloffFactor: TD3DValue;
17248
    flDopplerFactor: TD3DValue;
17252
    flDopplerFactor: TD3DValue;
17249
  end;
17253
  end;
17250
  PCDS3DListener = ^TDS3DListener;
17254
  PCDS3DListener = ^TDS3DListener;
17251
 
17255
 
17252
  PDSCCaps = ^TDSCCaps;
17256
  PDSCCaps = ^TDSCCaps;
17253
  TDSCCaps = packed record
17257
  TDSCCaps = packed record
17254
    dwSize: DWORD;
17258
    dwSize: DWORD;
17255
    dwFlags: DWORD;
17259
    dwFlags: DWORD;
17256
    dwFormats: DWORD;
17260
    dwFormats: DWORD;
17257
    dwChannels: DWORD;
17261
    dwChannels: DWORD;
17258
  end;
17262
  end;
17259
  PCDSCCaps = ^TDSCCaps;
17263
  PCDSCCaps = ^TDSCCaps;
17260
 
17264
 
17261
  PDSCBufferDesc = ^TDSCBufferDesc;
17265
  PDSCBufferDesc = ^TDSCBufferDesc;
17262
  TDSCBufferDesc = packed record
17266
  TDSCBufferDesc = packed record
17263
    dwSize: DWORD;
17267
    dwSize: DWORD;
17264
    dwFlags: DWORD;
17268
    dwFlags: DWORD;
17265
    dwBufferBytes: DWORD;
17269
    dwBufferBytes: DWORD;
17266
    dwReserved: DWORD;
17270
    dwReserved: DWORD;
17267
    lpwfxFormat: PWaveFormatEx;
17271
    lpwfxFormat: PWaveFormatEx;
17268
  end;
17272
  end;
17269
  PCDSCBufferDesc = ^TDSCBufferDesc;
17273
  PCDSCBufferDesc = ^TDSCBufferDesc;
17270
 
17274
 
17271
  PDSCBCaps = ^TDSCBCaps;
17275
  PDSCBCaps = ^TDSCBCaps;
17272
  TDSCBCaps = packed record
17276
  TDSCBCaps = packed record
17273
    dwSize: DWORD;
17277
    dwSize: DWORD;
17274
    dwFlags: DWORD;
17278
    dwFlags: DWORD;
17275
    dwBufferBytes: DWORD;
17279
    dwBufferBytes: DWORD;
17276
    dwReserved: DWORD;
17280
    dwReserved: DWORD;
17277
  end;
17281
  end;
17278
  PCDSCBCaps = ^TDSCBCaps;
17282
  PCDSCBCaps = ^TDSCBCaps;
17279
 
17283
 
17280
  PDSBPositionNotify = ^TDSBPositionNotify;
17284
  PDSBPositionNotify = ^TDSBPositionNotify;
17281
  TDSBPositionNotify = packed record
17285
  TDSBPositionNotify = packed record
17282
    dwOffset: DWORD;
17286
    dwOffset: DWORD;
17283
    hEventNotify: THandle;
17287
    hEventNotify: THandle;
17284
  end;
17288
  end;
17285
  PCDSBPositionNotify = ^TDSBPositionNotify;
17289
  PCDSBPositionNotify = ^TDSBPositionNotify;
17286
 
17290
 
17287
//
17291
//
17288
// DirectSound API
17292
// DirectSound API
17289
//
17293
//
17290
  TDSEnumCallbackW = function (lpGuid: PGUID; lpstrDescription: PWideChar;
17294
  TDSEnumCallbackW = function (lpGuid: PGUID; lpstrDescription: PWideChar;
17291
      lpstrModule: PWideChar; lpContext: Pointer) : BOOL; stdcall;
17295
      lpstrModule: PWideChar; lpContext: Pointer) : BOOL; stdcall;
17292
  TDSEnumCallbackA = function (lpGuid: PGUID; lpstrDescription: PAnsiChar;
17296
  TDSEnumCallbackA = function (lpGuid: PGUID; lpstrDescription: PAnsiChar;
17293
      lpstrModule: PAnsiChar; lpContext: Pointer) : BOOL; stdcall;
17297
      lpstrModule: PAnsiChar; lpContext: Pointer) : BOOL; stdcall;
17294
{$IFDEF UNICODE}
17298
{$IFDEF UNICODE}
17295
  TDSEnumCallback = TDSEnumCallbackW;
17299
  TDSEnumCallback = TDSEnumCallbackW;
17296
{$ELSE}
17300
{$ELSE}
17297
  TDSEnumCallback = TDSEnumCallbackA;
17301
  TDSEnumCallback = TDSEnumCallbackA;
17298
{$ENDIF}
17302
{$ENDIF}
17299
 
17303
 
17300
//
17304
//
17301
// IDirectSound
17305
// IDirectSound
17302
//
17306
//
17303
  IDirectSound = interface (IUnknown)
17307
  IDirectSound = interface (IUnknown)
17304
    ['{279AFA83-4981-11CE-A521-0020AF0BE560}']
17308
    ['{279AFA83-4981-11CE-A521-0020AF0BE560}']
17305
    // IDirectSound methods
17309
    // IDirectSound methods
17306
    function CreateSoundBuffer(const lpDSBufferDesc: TDSBufferDesc;
17310
    function CreateSoundBuffer(const lpDSBufferDesc: TDSBufferDesc;
17307
        out lpIDirectSoundBuffer: IDirectSoundBuffer;
17311
        out lpIDirectSoundBuffer: IDirectSoundBuffer;
17308
        pUnkOuter: IUnknown) : HResult; stdcall;
17312
        pUnkOuter: IUnknown) : HResult; stdcall;
17309
    function GetCaps(var lpDSCaps: TDSCaps) : HResult; stdcall;
17313
    function GetCaps(var lpDSCaps: TDSCaps) : HResult; stdcall;
17310
    function DuplicateSoundBuffer(lpDsbOriginal: IDirectSoundBuffer;
17314
    function DuplicateSoundBuffer(lpDsbOriginal: IDirectSoundBuffer;
17311
        out lpDsbDuplicate: IDirectSoundBuffer) : HResult; stdcall;
17315
        out lpDsbDuplicate: IDirectSoundBuffer) : HResult; stdcall;
17312
    function SetCooperativeLevel(hwnd: HWND; dwLevel: DWORD) : HResult; stdcall;
17316
    function SetCooperativeLevel(hwnd: HWND; dwLevel: DWORD) : HResult; stdcall;
17313
    function Compact: HResult; stdcall;
17317
    function Compact: HResult; stdcall;
17314
    function GetSpeakerConfig(var lpdwSpeakerConfig: DWORD) : HResult; stdcall;
17318
    function GetSpeakerConfig(var lpdwSpeakerConfig: DWORD) : HResult; stdcall;
17315
    function SetSpeakerConfig(dwSpeakerConfig: DWORD) : HResult; stdcall;
17319
    function SetSpeakerConfig(dwSpeakerConfig: DWORD) : HResult; stdcall;
17316
    function Initialize(lpGuid: PGUID) : HResult; stdcall;
17320
    function Initialize(lpGuid: PGUID) : HResult; stdcall;
17317
  end;
17321
  end;
17318
 
17322
 
17319
//
17323
//
17320
// IDirectSoundBuffer
17324
// IDirectSoundBuffer
17321
//
17325
//
17322
  IDirectSoundBuffer = interface (IUnknown)
17326
  IDirectSoundBuffer = interface (IUnknown)
17323
    ['{279AFA85-4981-11CE-A521-0020AF0BE560}']
17327
    ['{279AFA85-4981-11CE-A521-0020AF0BE560}']
17324
    // IDirectSoundBuffer methods
17328
    // IDirectSoundBuffer methods
17325
    function GetCaps(var lpDSCaps: TDSBCaps) : HResult; stdcall;
17329
    function GetCaps(var lpDSCaps: TDSBCaps) : HResult; stdcall;
17326
    function GetCurrentPosition
17330
    function GetCurrentPosition
17327
        (lpdwCapturePosition, lpdwReadPosition : PDWORD) : HResult; stdcall;
17331
        (lpdwCapturePosition, lpdwReadPosition : PDWORD) : HResult; stdcall;
17328
    function GetFormat(lpwfxFormat: PWaveFormatEx; dwSizeAllocated: DWORD;
17332
    function GetFormat(lpwfxFormat: PWaveFormatEx; dwSizeAllocated: DWORD;
17329
        lpdwSizeWritten: PWORD) : HResult; stdcall;
17333
        lpdwSizeWritten: PWORD) : HResult; stdcall;
17330
    function GetVolume(var lplVolume: integer) : HResult; stdcall;
17334
    function GetVolume(var lplVolume: integer) : HResult; stdcall;
17331
    function GetPan(var lplPan: integer) : HResult; stdcall;
17335
    function GetPan(var lplPan: integer) : HResult; stdcall;
17332
    function GetFrequency(var lpdwFrequency: DWORD) : HResult; stdcall;
17336
    function GetFrequency(var lpdwFrequency: DWORD) : HResult; stdcall;
17333
    function GetStatus(var lpdwStatus: DWORD) : HResult; stdcall;
17337
    function GetStatus(var lpdwStatus: DWORD) : HResult; stdcall;
17334
    function Initialize(lpDirectSound: IDirectSound;
17338
    function Initialize(lpDirectSound: IDirectSound;
17335
        const lpcDSBufferDesc: TDSBufferDesc) : HResult; stdcall;
17339
        const lpcDSBufferDesc: TDSBufferDesc) : HResult; stdcall;
17336
    function Lock(dwWriteCursor, dwWriteBytes: DWORD;
17340
    function Lock(dwWriteCursor, dwWriteBytes: DWORD;
17337
        var lplpvAudioPtr1: Pointer; var lpdwAudioBytes1: DWORD;
17341
        var lplpvAudioPtr1: Pointer; var lpdwAudioBytes1: DWORD;
17338
        var lplpvAudioPtr2: Pointer; var lpdwAudioBytes2: DWORD;
17342
        var lplpvAudioPtr2: Pointer; var lpdwAudioBytes2: DWORD;
17339
        dwFlags: DWORD) : HResult; stdcall;
17343
        dwFlags: DWORD) : HResult; stdcall;
17340
    function Play(dwReserved1,dwReserved2,dwFlags: DWORD) : HResult; stdcall;
17344
    function Play(dwReserved1,dwReserved2,dwFlags: DWORD) : HResult; stdcall;
17341
    function SetCurrentPosition(dwPosition: DWORD) : HResult; stdcall;
17345
    function SetCurrentPosition(dwPosition: DWORD) : HResult; stdcall;
17342
    function SetFormat(const lpcfxFormat: TWaveFormatEx) : HResult; stdcall;
17346
    function SetFormat(const lpcfxFormat: TWaveFormatEx) : HResult; stdcall;
17343
    function SetVolume(lVolume: integer) : HResult; stdcall;
17347
    function SetVolume(lVolume: integer) : HResult; stdcall;
17344
    function SetPan(lPan: integer) : HResult; stdcall;
17348
    function SetPan(lPan: integer) : HResult; stdcall;
17345
    function SetFrequency(dwFrequency: DWORD) : HResult; stdcall;
17349
    function SetFrequency(dwFrequency: DWORD) : HResult; stdcall;
17346
    function Stop: HResult; stdcall;
17350
    function Stop: HResult; stdcall;
17347
    function Unlock(lpvAudioPtr1: Pointer; dwAudioBytes1: DWORD;
17351
    function Unlock(lpvAudioPtr1: Pointer; dwAudioBytes1: DWORD;
17348
        lpvAudioPtr2: Pointer; dwAudioBytes2: DWORD) : HResult; stdcall;
17352
        lpvAudioPtr2: Pointer; dwAudioBytes2: DWORD) : HResult; stdcall;
17349
    function Restore: HResult; stdcall;
17353
    function Restore: HResult; stdcall;
17350
  end;
17354
  end;
17351
 
17355
 
17352
//
17356
//
17353
// IDirectSound3DListener
17357
// IDirectSound3DListener
17354
//
17358
//
17355
  IDirectSound3DListener = interface (IUnknown)
17359
  IDirectSound3DListener = interface (IUnknown)
17356
    ['{279AFA84-4981-11CE-A521-0020AF0BE560}']
17360
    ['{279AFA84-4981-11CE-A521-0020AF0BE560}']
17357
    // IDirectSound3D methods
17361
    // IDirectSound3D methods
17358
    function GetAllParameters(var lpListener: TDS3DListener) : HResult; stdcall;
17362
    function GetAllParameters(var lpListener: TDS3DListener) : HResult; stdcall;
17359
    function GetDistanceFactor(var lpflDistanceFactor: TD3DValue) : HResult; stdcall;
17363
    function GetDistanceFactor(var lpflDistanceFactor: TD3DValue) : HResult; stdcall;
17360
    function GetDopplerFactor(var lpflDopplerFactor: TD3DValue) : HResult; stdcall;
17364
    function GetDopplerFactor(var lpflDopplerFactor: TD3DValue) : HResult; stdcall;
17361
    function GetOrientation
17365
    function GetOrientation
17362
        (var lpvOrientFront, lpvOrientTop: TD3DVector) : HResult; stdcall;
17366
        (var lpvOrientFront, lpvOrientTop: TD3DVector) : HResult; stdcall;
17363
    function GetPosition(var lpvPosition: TD3DVector) : HResult; stdcall;
17367
    function GetPosition(var lpvPosition: TD3DVector) : HResult; stdcall;
17364
    function GetRolloffFactor(var lpflRolloffFactor: TD3DValue) : HResult; stdcall;
17368
    function GetRolloffFactor(var lpflRolloffFactor: TD3DValue) : HResult; stdcall;
17365
    function GetVelocity(var lpvVelocity: TD3DVector) : HResult; stdcall;
17369
    function GetVelocity(var lpvVelocity: TD3DVector) : HResult; stdcall;
17366
    function SetAllParameters
17370
    function SetAllParameters
17367
        (const lpcListener: TDS3DListener; dwApply: DWORD) : HResult; stdcall;
17371
        (const lpcListener: TDS3DListener; dwApply: DWORD) : HResult; stdcall;
17368
    function SetDistanceFactor
17372
    function SetDistanceFactor
17369
        (flDistanceFactor: TD3DValue; dwApply: DWORD) : HResult; stdcall;
17373
        (flDistanceFactor: TD3DValue; dwApply: DWORD) : HResult; stdcall;
17370
    function SetDopplerFactor
17374
    function SetDopplerFactor
17371
        (flDopplerFactor: TD3DValue; dwApply: DWORD) : HResult; stdcall;
17375
        (flDopplerFactor: TD3DValue; dwApply: DWORD) : HResult; stdcall;
17372
    function SetOrientation(xFront, yFront, zFront, xTop, yTop, zTop: TD3DValue;
17376
    function SetOrientation(xFront, yFront, zFront, xTop, yTop, zTop: TD3DValue;
17373
        dwApply: DWORD) : HResult; stdcall;
17377
        dwApply: DWORD) : HResult; stdcall;
17374
    function SetPosition(x, y, z: TD3DValue; dwApply: DWORD) : HResult; stdcall;
17378
    function SetPosition(x, y, z: TD3DValue; dwApply: DWORD) : HResult; stdcall;
17375
    function SetRolloffFactor
17379
    function SetRolloffFactor
17376
        (flRolloffFactor: TD3DValue; dwApply: DWORD) : HResult; stdcall;
17380
        (flRolloffFactor: TD3DValue; dwApply: DWORD) : HResult; stdcall;
17377
    function SetVelocity(x, y, z: TD3DValue; dwApply: DWORD) : HResult; stdcall;
17381
    function SetVelocity(x, y, z: TD3DValue; dwApply: DWORD) : HResult; stdcall;
17378
    function CommitDeferredSettings: HResult; stdcall;
17382
    function CommitDeferredSettings: HResult; stdcall;
17379
  end;
17383
  end;
17380
 
17384
 
17381
 
17385
 
17382
//
17386
//
17383
// IDirectSound3DBuffer
17387
// IDirectSound3DBuffer
17384
//
17388
//
17385
  IDirectSound3DBuffer = interface (IUnknown)
17389
  IDirectSound3DBuffer = interface (IUnknown)
17386
    ['{279AFA86-4981-11CE-A521-0020AF0BE560}']
17390
    ['{279AFA86-4981-11CE-A521-0020AF0BE560}']
17387
    // IDirectSoundBuffer3D methods
17391
    // IDirectSoundBuffer3D methods
17388
    function GetAllParameters(var lpDs3dBuffer: TDS3DBuffer) : HResult; stdcall;
17392
    function GetAllParameters(var lpDs3dBuffer: TDS3DBuffer) : HResult; stdcall;
17389
    function GetConeAngles
17393
    function GetConeAngles
17390
        (var lpdwInsideConeAngle, lpdwOutsideConeAngle: DWORD) : HResult; stdcall;
17394
        (var lpdwInsideConeAngle, lpdwOutsideConeAngle: DWORD) : HResult; stdcall;
17391
    function GetConeOrientation(var lpvOrientation: TD3DVector) : HResult; stdcall;
17395
    function GetConeOrientation(var lpvOrientation: TD3DVector) : HResult; stdcall;
17392
    function GetConeOutsideVolume(var lplConeOutsideVolume: integer) : HResult; stdcall;
17396
    function GetConeOutsideVolume(var lplConeOutsideVolume: integer) : HResult; stdcall;
17393
    function GetMaxDistance(var lpflMaxDistance: TD3DValue) : HResult; stdcall;
17397
    function GetMaxDistance(var lpflMaxDistance: TD3DValue) : HResult; stdcall;
17394
    function GetMinDistance(var lpflMinDistance: TD3DValue) : HResult; stdcall;
17398
    function GetMinDistance(var lpflMinDistance: TD3DValue) : HResult; stdcall;
17395
    function GetMode(var lpdwMode: DWORD) : HResult; stdcall;
17399
    function GetMode(var lpdwMode: DWORD) : HResult; stdcall;
17396
    function GetPosition(var lpvPosition: TD3DVector) : HResult; stdcall;
17400
    function GetPosition(var lpvPosition: TD3DVector) : HResult; stdcall;
17397
    function GetVelocity(var lpvVelocity: TD3DVector) : HResult; stdcall;
17401
    function GetVelocity(var lpvVelocity: TD3DVector) : HResult; stdcall;
17398
    function SetAllParameters
17402
    function SetAllParameters
17399
        (const lpcDs3dBuffer: TDS3DBuffer; dwApply: DWORD) : HResult; stdcall;
17403
        (const lpcDs3dBuffer: TDS3DBuffer; dwApply: DWORD) : HResult; stdcall;
17400
    function SetConeAngles
17404
    function SetConeAngles
17401
        (dwInsideConeAngle, dwOutsideConeAngle, dwApply: DWORD) : HResult; stdcall;
17405
        (dwInsideConeAngle, dwOutsideConeAngle, dwApply: DWORD) : HResult; stdcall;
17402
    function SetConeOrientation(x, y, z: TD3DValue; dwApply: DWORD) : HResult; stdcall;
17406
    function SetConeOrientation(x, y, z: TD3DValue; dwApply: DWORD) : HResult; stdcall;
17403
    function SetConeOutsideVolume
17407
    function SetConeOutsideVolume
17404
        (lConeOutsideVolume: LongInt; dwApply: DWORD) : HResult; stdcall;
17408
        (lConeOutsideVolume: LongInt; dwApply: DWORD) : HResult; stdcall;
17405
    function SetMaxDistance(flMaxDistance: TD3DValue; dwApply: DWORD) : HResult; stdcall;
17409
    function SetMaxDistance(flMaxDistance: TD3DValue; dwApply: DWORD) : HResult; stdcall;
17406
    function SetMinDistance(flMinDistance: TD3DValue; dwApply: DWORD) : HResult; stdcall;
17410
    function SetMinDistance(flMinDistance: TD3DValue; dwApply: DWORD) : HResult; stdcall;
17407
    function SetMode(dwMode: DWORD; dwApply: DWORD) : HResult; stdcall;
17411
    function SetMode(dwMode: DWORD; dwApply: DWORD) : HResult; stdcall;
17408
    function SetPosition(x, y, z: TD3DValue; dwApply: DWORD) : HResult; stdcall;
17412
    function SetPosition(x, y, z: TD3DValue; dwApply: DWORD) : HResult; stdcall;
17409
    function SetVelocity(x, y, z: TD3DValue; dwApply: DWORD) : HResult; stdcall;
17413
    function SetVelocity(x, y, z: TD3DValue; dwApply: DWORD) : HResult; stdcall;
17410
  end;
17414
  end;
17411
 
17415
 
17412
 
17416
 
17413
//
17417
//
17414
// IDirectSoundCapture
17418
// IDirectSoundCapture
17415
//
17419
//
17416
  IDirectSoundCapture = interface (IUnknown)
17420
  IDirectSoundCapture = interface (IUnknown)
17417
    ['{b0210781-89cd-11d0-af08-00a0c925cd16}']
17421
    ['{b0210781-89cd-11d0-af08-00a0c925cd16}']
17418
    // IDirectSoundCapture methods
17422
    // IDirectSoundCapture methods
17419
    function CreateCaptureBuffer(const lpDSCBufferDesc: TDSCBufferDesc;
17423
    function CreateCaptureBuffer(const lpDSCBufferDesc: TDSCBufferDesc;
17420
        var lplpDirectSoundCaptureBuffer: IDirectSoundCaptureBuffer;
17424
        var lplpDirectSoundCaptureBuffer: IDirectSoundCaptureBuffer;
17421
        pUnkOuter: IUnknown) : HResult; stdcall;
17425
        pUnkOuter: IUnknown) : HResult; stdcall;
17422
    function GetCaps(var lpdwCaps: TDSCCaps) : HResult; stdcall;
17426
    function GetCaps(var lpdwCaps: TDSCCaps) : HResult; stdcall;
17423
    function Initialize(lpGuid: PGUID) : HResult; stdcall;
17427
    function Initialize(lpGuid: PGUID) : HResult; stdcall;
17424
  end;
17428
  end;
17425
 
17429
 
17426
 
17430
 
17427
//
17431
//
17428
// IDirectSoundCaptureBuffer
17432
// IDirectSoundCaptureBuffer
17429
//
17433
//
17430
  IDirectSoundCaptureBuffer = interface (IUnknown)
17434
  IDirectSoundCaptureBuffer = interface (IUnknown)
17431
    ['{b0210782-89cd-11d0-af08-00a0c925cd16}']
17435
    ['{b0210782-89cd-11d0-af08-00a0c925cd16}']
17432
    // IDirectSoundCaptureBuffer methods
17436
    // IDirectSoundCaptureBuffer methods
17433
    function GetCaps(var lpdwCaps: TDSCBCaps) : HResult; stdcall;
17437
    function GetCaps(var lpdwCaps: TDSCBCaps) : HResult; stdcall;
17434
    function GetCurrentPosition
17438
    function GetCurrentPosition
17435
        (lpdwCapturePosition, lpdwReadPosition: PDWORD) : HResult; stdcall;
17439
        (lpdwCapturePosition, lpdwReadPosition: PDWORD) : HResult; stdcall;
17436
    function GetFormat(lpwfxFormat: PWaveFormatEx; dwSizeAllocated: DWORD;
17440
    function GetFormat(lpwfxFormat: PWaveFormatEx; dwSizeAllocated: DWORD;
17437
        lpdwSizeWritten : PDWORD) : HResult; stdcall;
17441
        lpdwSizeWritten : PDWORD) : HResult; stdcall;
17438
    function GetStatus(var lpdwStatus: DWORD) : HResult; stdcall;
17442
    function GetStatus(var lpdwStatus: DWORD) : HResult; stdcall;
17439
    function Initialize(lpDirectSoundCapture: IDirectSoundCapture;
17443
    function Initialize(lpDirectSoundCapture: IDirectSoundCapture;
17440
        const lpcDSBufferDesc: TDSCBufferDesc) : HResult; stdcall;
17444
        const lpcDSBufferDesc: TDSCBufferDesc) : HResult; stdcall;
17441
    function Lock(dwReadCursor, dwReadBytes: DWORD;
17445
    function Lock(dwReadCursor, dwReadBytes: DWORD;
17442
        var lplpvAudioPtr1: Pointer; var lpdwAudioBytes1: DWORD;
17446
        var lplpvAudioPtr1: Pointer; var lpdwAudioBytes1: DWORD;
17443
        var lplpvAudioPtr2: Pointer; var lpdwAudioBytes2: DWORD;
17447
        var lplpvAudioPtr2: Pointer; var lpdwAudioBytes2: DWORD;
17444
        dwFlags: DWORD) : HResult; stdcall;
17448
        dwFlags: DWORD) : HResult; stdcall;
17445
    function Start(dwFlags: DWORD) : HResult; stdcall;
17449
    function Start(dwFlags: DWORD) : HResult; stdcall;
17446
    function Stop: HResult; stdcall;
17450
    function Stop: HResult; stdcall;
17447
    function Unlock(lpvAudioPtr1: Pointer; dwAudioBytes1: DWORD;
17451
    function Unlock(lpvAudioPtr1: Pointer; dwAudioBytes1: DWORD;
17448
        lpvAudioPtr2: Pointer; dwAudioBytes2: DWORD) : HResult; stdcall;
17452
        lpvAudioPtr2: Pointer; dwAudioBytes2: DWORD) : HResult; stdcall;
17449
  end;
17453
  end;
17450
 
17454
 
17451
//
17455
//
17452
// IDirectSoundNotify
17456
// IDirectSoundNotify
17453
//
17457
//
17454
  IDirectSoundNotify = interface (IUnknown)
17458
  IDirectSoundNotify = interface (IUnknown)
17455
    ['{b0210783-89cd-11d0-af08-00a0c925cd16}']
17459
    ['{b0210783-89cd-11d0-af08-00a0c925cd16}']
17456
    // IDirectSoundNotify methods
17460
    // IDirectSoundNotify methods
17457
    function SetNotificationPositions(cPositionNotifies: DWORD;
17461
    function SetNotificationPositions(cPositionNotifies: DWORD;
17458
        const lpcPositionNotifies: TDSBPositionNotify) : HResult; stdcall;
17462
        const lpcPositionNotifies: TDSBPositionNotify) : HResult; stdcall;
17459
  end;
17463
  end;
17460
 
17464
 
17461
//
17465
//
17462
// IKsPropertySet
17466
// IKsPropertySet
17463
//
17467
//
17464
  IKsPropertySet = interface (IUnknown)
17468
  IKsPropertySet = interface (IUnknown)
17465
    ['{31efac30-515c-11d0-a9aa-00aa0061be93}']
17469
    ['{31efac30-515c-11d0-a9aa-00aa0061be93}']
17466
    // IKsPropertySet methods
17470
    // IKsPropertySet methods
17467
    function Get(const rguidPropSet: TGUID; ulId: DWORD; var pInstanceData;
17471
    function Get(const rguidPropSet: TGUID; ulId: DWORD; var pInstanceData;
17468
        ulInstanceLength: DWORD; var pPropertyData; ulDataLength: DWORD;
17472
        ulInstanceLength: DWORD; var pPropertyData; ulDataLength: DWORD;
17469
        var pulBytesReturned: DWORD) : HResult; stdcall;
17473
        var pulBytesReturned: DWORD) : HResult; stdcall;
17470
    // Warning: The following method is defined as Set() in DirectX
17474
    // Warning: The following method is defined as Set() in DirectX
17471
    //          which is a reserved word in Delphi!
17475
    //          which is a reserved word in Delphi!
17472
    function SetProperty(const rguidPropSet: TGUID; ulId: DWORD;
17476
    function SetProperty(const rguidPropSet: TGUID; ulId: DWORD;
17473
        var pInstanceData; ulInstanceLength: DWORD;
17477
        var pInstanceData; ulInstanceLength: DWORD;
17474
        var pPropertyData; pulDataLength: DWORD) : HResult; stdcall;
17478
        var pPropertyData; pulDataLength: DWORD) : HResult; stdcall;
17475
    function QuerySupport(const rguidPropSet: TGUID; ulId: DWORD;
17479
    function QuerySupport(const rguidPropSet: TGUID; ulId: DWORD;
17476
        var pulTypeSupport: DWORD) : HResult; stdcall;
17480
        var pulTypeSupport: DWORD) : HResult; stdcall;
17477
  end;
17481
  end;
17478
 
17482
 
17479
 
17483
 
17480
const
17484
const
17481
  KSPROPERTY_SUPPORT_GET = $00000001;
17485
  KSPROPERTY_SUPPORT_GET = $00000001;
17482
  KSPROPERTY_SUPPORT_SET = $00000002;
17486
  KSPROPERTY_SUPPORT_SET = $00000002;
17483
 
17487
 
17484
//
17488
//
17485
// GUID's for all the objects
17489
// GUID's for all the objects
17486
//
17490
//
17487
type
17491
type
17488
  IID_IDirectSound = IDirectSound;
17492
  IID_IDirectSound = IDirectSound;
17489
  IID_IDirectSoundBuffer = IDirectSoundBuffer;
17493
  IID_IDirectSoundBuffer = IDirectSoundBuffer;
17490
  IID_IDirectSound3DListener = IDirectSound3DListener;
17494
  IID_IDirectSound3DListener = IDirectSound3DListener;
17491
  IID_IDirectSound3DBuffer = IDirectSound3DBuffer;
17495
  IID_IDirectSound3DBuffer = IDirectSound3DBuffer;
17492
  IID_IDirectSoundCapture = IDirectSoundCapture;
17496
  IID_IDirectSoundCapture = IDirectSoundCapture;
17493
  IID_IDirectSoundCaptureBuffer = IDirectSoundCaptureBuffer;
17497
  IID_IDirectSoundCaptureBuffer = IDirectSoundCaptureBuffer;
17494
  IID_IDirectSoundNotify = IDirectSoundNotify;
17498
  IID_IDirectSoundNotify = IDirectSoundNotify;
17495
  IID_IKsPropertySet = IKsPropertySet;
17499
  IID_IKsPropertySet = IKsPropertySet;
17496
 
17500
 
17497
//
17501
//
17498
// Creation Routines
17502
// Creation Routines
17499
//
17503
//
17500
var
17504
var
17501
    DirectSoundCreate : function ( lpGuid: PGUID; out ppDS: IDirectSound;
17505
    DirectSoundCreate : function ( lpGuid: PGUID; out ppDS: IDirectSound;
17502
        pUnkOuter: IUnknown) : HResult; stdcall;
17506
        pUnkOuter: IUnknown) : HResult; stdcall;
17503
 
17507
 
17504
    DirectSoundEnumerateW : function (lpDSEnumCallback: TDSEnumCallbackW;
17508
    DirectSoundEnumerateW : function (lpDSEnumCallback: TDSEnumCallbackW;
17505
        lpContext: Pointer) : HResult; stdcall;
17509
        lpContext: Pointer) : HResult; stdcall;
17506
    DirectSoundEnumerateA : function (lpDSEnumCallback: TDSEnumCallbackA;
17510
    DirectSoundEnumerateA : function (lpDSEnumCallback: TDSEnumCallbackA;
17507
        lpContext: Pointer) : HResult; stdcall;
17511
        lpContext: Pointer) : HResult; stdcall;
17508
    DirectSoundEnumerate : function (lpDSEnumCallback: TDSEnumCallback;
17512
    DirectSoundEnumerate : function (lpDSEnumCallback: TDSEnumCallback;
17509
        lpContext: Pointer) : HResult; stdcall;
17513
        lpContext: Pointer) : HResult; stdcall;
17510
 
17514
 
17511
    DirectSoundCaptureCreate : function (lpGUID: PGUID;
17515
    DirectSoundCaptureCreate : function (lpGUID: PGUID;
17512
        out lplpDSC: IDirectSoundCapture;
17516
        out lplpDSC: IDirectSoundCapture;
17513
        pUnkOuter: IUnknown) : HResult; stdcall;
17517
        pUnkOuter: IUnknown) : HResult; stdcall;
17514
 
17518
 
17515
    DirectSoundCaptureEnumerateW : function (lpDSEnumCallback: TDSEnumCallbackW;
17519
    DirectSoundCaptureEnumerateW : function (lpDSEnumCallback: TDSEnumCallbackW;
17516
        lpContext: Pointer) : HResult; stdcall;
17520
        lpContext: Pointer) : HResult; stdcall;
17517
    DirectSoundCaptureEnumerateA : function (lpDSEnumCallback: TDSEnumCallbackA;
17521
    DirectSoundCaptureEnumerateA : function (lpDSEnumCallback: TDSEnumCallbackA;
17518
        lpContext: Pointer) : HResult; stdcall;
17522
        lpContext: Pointer) : HResult; stdcall;
17519
    DirectSoundCaptureEnumerate : function(lpDSEnumCallback: TDSEnumCallback;
17523
    DirectSoundCaptureEnumerate : function(lpDSEnumCallback: TDSEnumCallback;
17520
        lpContext: Pointer) : HResult; stdcall;
17524
        lpContext: Pointer) : HResult; stdcall;
17521
 
17525
 
17522
 
17526
 
17523
//
17527
//
17524
// Return Codes
17528
// Return Codes
17525
//
17529
//
17526
 
17530
 
17527
const
17531
const
17528
  MAKE_DSHRESULT_ = HResult($88780000);
17532
  MAKE_DSHRESULT_ = HResult($88780000);
17529
 
17533
 
17530
  DS_OK = 0;
17534
  DS_OK = 0;
17531
 
17535
 
17532
// The function completed successfully, but we had to substitute the 3D algorithm
17536
// The function completed successfully, but we had to substitute the 3D algorithm
17533
  DS_NO_VIRTUALIZATION = MAKE_DSHRESULT_ + 10;
17537
  DS_NO_VIRTUALIZATION = MAKE_DSHRESULT_ + 10;
17534
 
17538
 
17535
// The call failed because resources (such as a priority level)
17539
// The call failed because resources (such as a priority level)
17536
// were already being used by another caller.
17540
// were already being used by another caller.
17537
  DSERR_ALLOCATED = MAKE_DSHRESULT_ + 10;
17541
  DSERR_ALLOCATED = MAKE_DSHRESULT_ + 10;
17538
 
17542
 
17539
// The control (vol,pan,etc.) requested by the caller is not available.
17543
// The control (vol,pan,etc.) requested by the caller is not available.
17540
  DSERR_CONTROLUNAVAIL = MAKE_DSHRESULT_ + 30;
17544
  DSERR_CONTROLUNAVAIL = MAKE_DSHRESULT_ + 30;
17541
 
17545
 
17542
// An invalid parameter was passed to the returning function
17546
// An invalid parameter was passed to the returning function
17543
  DSERR_INVALIDPARAM = E_INVALIDARG;
17547
  DSERR_INVALIDPARAM = E_INVALIDARG;
17544
 
17548
 
17545
// This call is not valid for the current state of this object
17549
// This call is not valid for the current state of this object
17546
  DSERR_INVALIDCALL = MAKE_DSHRESULT_ + 50;
17550
  DSERR_INVALIDCALL = MAKE_DSHRESULT_ + 50;
17547
 
17551
 
17548
// An undetermined error occured inside the DirectSound subsystem
17552
// An undetermined error occured inside the DirectSound subsystem
17549
  DSERR_GENERIC = E_FAIL;
17553
  DSERR_GENERIC = E_FAIL;
17550
 
17554
 
17551
// The caller does not have the priority level required for the function to
17555
// The caller does not have the priority level required for the function to
17552
// succeed.
17556
// succeed.
17553
  DSERR_PRIOLEVELNEEDED = MAKE_DSHRESULT_ + 70;
17557
  DSERR_PRIOLEVELNEEDED = MAKE_DSHRESULT_ + 70;
17554
 
17558
 
17555
// Not enough free memory is available to complete the operation
17559
// Not enough free memory is available to complete the operation
17556
  DSERR_OUTOFMEMORY = E_OUTOFMEMORY;
17560
  DSERR_OUTOFMEMORY = E_OUTOFMEMORY;
17557
 
17561
 
17558
// The specified WAVE format is not supported
17562
// The specified WAVE format is not supported
17559
  DSERR_BADFORMAT = MAKE_DSHRESULT_ + 100;
17563
  DSERR_BADFORMAT = MAKE_DSHRESULT_ + 100;
17560
 
17564
 
17561
// The function called is not supported at this time
17565
// The function called is not supported at this time
17562
  DSERR_UNSUPPORTED = E_NOTIMPL;
17566
  DSERR_UNSUPPORTED = E_NOTIMPL;
17563
 
17567
 
17564
// No sound driver is available for use
17568
// No sound driver is available for use
17565
  DSERR_NODRIVER = MAKE_DSHRESULT_ + 120;
17569
  DSERR_NODRIVER = MAKE_DSHRESULT_ + 120;
17566
 
17570
 
17567
// This object is already initialized
17571
// This object is already initialized
17568
  DSERR_ALREADYINITIALIZED = MAKE_DSHRESULT_ + 130;
17572
  DSERR_ALREADYINITIALIZED = MAKE_DSHRESULT_ + 130;
17569
 
17573
 
17570
// This object does not support aggregation
17574
// This object does not support aggregation
17571
  DSERR_NOAGGREGATION = CLASS_E_NOAGGREGATION;
17575
  DSERR_NOAGGREGATION = CLASS_E_NOAGGREGATION;
17572
 
17576
 
17573
// The buffer memory has been lost, and must be restored.
17577
// The buffer memory has been lost, and must be restored.
17574
  DSERR_BUFFERLOST = MAKE_DSHRESULT_ + 150;
17578
  DSERR_BUFFERLOST = MAKE_DSHRESULT_ + 150;
17575
 
17579
 
17576
// Another app has a higher priority level, preventing this call from
17580
// Another app has a higher priority level, preventing this call from
17577
// succeeding.
17581
// succeeding.
17578
  DSERR_OTHERAPPHASPRIO = MAKE_DSHRESULT_ + 160;
17582
  DSERR_OTHERAPPHASPRIO = MAKE_DSHRESULT_ + 160;
17579
 
17583
 
17580
// This object has not been initialized
17584
// This object has not been initialized
17581
  DSERR_UNINITIALIZED = MAKE_DSHRESULT_ + 170;
17585
  DSERR_UNINITIALIZED = MAKE_DSHRESULT_ + 170;
17582
 
17586
 
17583
// The requested COM interface is not available
17587
// The requested COM interface is not available
17584
  DSERR_NOINTERFACE = E_NOINTERFACE;
17588
  DSERR_NOINTERFACE = E_NOINTERFACE;
17585
 
17589
 
17586
// Access is denied
17590
// Access is denied
17587
  DSERR_ACCESSDENIED = E_ACCESSDENIED;
17591
  DSERR_ACCESSDENIED = E_ACCESSDENIED;
17588
 
17592
 
17589
//
17593
//
17590
// Flags
17594
// Flags
17591
//
17595
//
17592
 
17596
 
17593
  DSCAPS_PRIMARYMONO = $00000001;
17597
  DSCAPS_PRIMARYMONO = $00000001;
17594
  DSCAPS_PRIMARYSTEREO = $00000002;
17598
  DSCAPS_PRIMARYSTEREO = $00000002;
17595
  DSCAPS_PRIMARY8BIT = $00000004;
17599
  DSCAPS_PRIMARY8BIT = $00000004;
17596
  DSCAPS_PRIMARY16BIT = $00000008;
17600
  DSCAPS_PRIMARY16BIT = $00000008;
17597
  DSCAPS_CONTINUOUSRATE = $00000010;
17601
  DSCAPS_CONTINUOUSRATE = $00000010;
17598
  DSCAPS_EMULDRIVER = $00000020;
17602
  DSCAPS_EMULDRIVER = $00000020;
17599
  DSCAPS_CERTIFIED = $00000040;
17603
  DSCAPS_CERTIFIED = $00000040;
17600
  DSCAPS_SECONDARYMONO = $00000100;
17604
  DSCAPS_SECONDARYMONO = $00000100;
17601
  DSCAPS_SECONDARYSTEREO = $00000200;
17605
  DSCAPS_SECONDARYSTEREO = $00000200;
17602
  DSCAPS_SECONDARY8BIT = $00000400;
17606
  DSCAPS_SECONDARY8BIT = $00000400;
17603
  DSCAPS_SECONDARY16BIT = $00000800;
17607
  DSCAPS_SECONDARY16BIT = $00000800;
17604
 
17608
 
17605
  DSSCL_NORMAL = $00000001;
17609
  DSSCL_NORMAL = $00000001;
17606
  DSSCL_PRIORITY = $00000002;
17610
  DSSCL_PRIORITY = $00000002;
17607
  DSSCL_EXCLUSIVE = $00000003;
17611
  DSSCL_EXCLUSIVE = $00000003;
17608
  DSSCL_WRITEPRIMARY = $00000004;
17612
  DSSCL_WRITEPRIMARY = $00000004;
17609
 
17613
 
17610
  DSSPEAKER_HEADPHONE = $00000001;
17614
  DSSPEAKER_HEADPHONE = $00000001;
17611
  DSSPEAKER_MONO = $00000002;
17615
  DSSPEAKER_MONO = $00000002;
17612
  DSSPEAKER_QUAD = $00000003;
17616
  DSSPEAKER_QUAD = $00000003;
17613
  DSSPEAKER_STEREO = $00000004;
17617
  DSSPEAKER_STEREO = $00000004;
17614
  DSSPEAKER_SURROUND = $00000005;
17618
  DSSPEAKER_SURROUND = $00000005;
17615
  DSSPEAKER_5POINT1 = $00000006;
17619
  DSSPEAKER_5POINT1 = $00000006;
17616
 
17620
 
17617
  DSSPEAKER_GEOMETRY_MIN     = $00000005;  //   5 degrees
17621
  DSSPEAKER_GEOMETRY_MIN     = $00000005;  //   5 degrees
17618
  DSSPEAKER_GEOMETRY_NARROW  = $0000000A;  //  10 degrees
17622
  DSSPEAKER_GEOMETRY_NARROW  = $0000000A;  //  10 degrees
17619
  DSSPEAKER_GEOMETRY_WIDE    = $00000014;  //  20 degrees
17623
  DSSPEAKER_GEOMETRY_WIDE    = $00000014;  //  20 degrees
17620
  DSSPEAKER_GEOMETRY_MAX     = $000000B4;  // 180 degrees
17624
  DSSPEAKER_GEOMETRY_MAX     = $000000B4;  // 180 degrees
17621
 
17625
 
17622
function DSSPEAKER_COMBINED(c, g: variant) : DWORD;
17626
function DSSPEAKER_COMBINED(c, g: variant) : DWORD;
17623
function DSSPEAKER_CONFIG(a: variant) : byte;
17627
function DSSPEAKER_CONFIG(a: variant) : byte;
17624
function DSSPEAKER_GEOMETRY(a: variant) : byte;
17628
function DSSPEAKER_GEOMETRY(a: variant) : byte;
17625
 
17629
 
17626
const
17630
const
17627
  DSBCAPS_PRIMARYBUFFER = $00000001;
17631
  DSBCAPS_PRIMARYBUFFER = $00000001;
17628
  DSBCAPS_STATIC = $00000002;
17632
  DSBCAPS_STATIC = $00000002;
17629
  DSBCAPS_LOCHARDWARE = $00000004;
17633
  DSBCAPS_LOCHARDWARE = $00000004;
17630
  DSBCAPS_LOCSOFTWARE = $00000008;
17634
  DSBCAPS_LOCSOFTWARE = $00000008;
17631
  DSBCAPS_CTRL3D = $00000010;
17635
  DSBCAPS_CTRL3D = $00000010;
17632
  DSBCAPS_CTRLFREQUENCY = $00000020;
17636
  DSBCAPS_CTRLFREQUENCY = $00000020;
17633
  DSBCAPS_CTRLPAN = $00000040;
17637
  DSBCAPS_CTRLPAN = $00000040;
17634
  DSBCAPS_CTRLVOLUME = $00000080;
17638
  DSBCAPS_CTRLVOLUME = $00000080;
17635
  DSBCAPS_CTRLPOSITIONNOTIFY = $00000100;
17639
  DSBCAPS_CTRLPOSITIONNOTIFY = $00000100;
17636
  DSBCAPS_STICKYFOCUS = $00004000;
17640
  DSBCAPS_STICKYFOCUS = $00004000;
17637
  DSBCAPS_GLOBALFOCUS = $00008000;
17641
  DSBCAPS_GLOBALFOCUS = $00008000;
17638
  DSBCAPS_GETCURRENTPOSITION2 = $00010000;
17642
  DSBCAPS_GETCURRENTPOSITION2 = $00010000;
17639
  DSBCAPS_MUTE3DATMAXDISTANCE = $00020000;
17643
  DSBCAPS_MUTE3DATMAXDISTANCE = $00020000;
17640
  DSBCAPS_LOCDEFER            = $00040000;
17644
  DSBCAPS_LOCDEFER            = $00040000;
17641
 
17645
 
17642
  DSBPLAY_LOOPING = $00000001;
17646
  DSBPLAY_LOOPING = $00000001;
17643
  DSBPLAY_LOCHARDWARE = $00000002;
17647
  DSBPLAY_LOCHARDWARE = $00000002;
17644
  DSBPLAY_LOCSOFTWARE = $00000004;
17648
  DSBPLAY_LOCSOFTWARE = $00000004;
17645
  DSBPLAY_TERMINATEBY_TIME = $00000008;
17649
  DSBPLAY_TERMINATEBY_TIME = $00000008;
17646
  DSBPLAY_TERMINATEBY_DISTANCE = $000000010;
17650
  DSBPLAY_TERMINATEBY_DISTANCE = $000000010;
17647
  DSBPLAY_TERMINATEBY_PRIORITY = $000000020;
17651
  DSBPLAY_TERMINATEBY_PRIORITY = $000000020;
17648
 
17652
 
17649
  DSBSTATUS_PLAYING = $00000001;
17653
  DSBSTATUS_PLAYING = $00000001;
17650
  DSBSTATUS_BUFFERLOST = $00000002;
17654
  DSBSTATUS_BUFFERLOST = $00000002;
17651
  DSBSTATUS_LOOPING = $00000004;
17655
  DSBSTATUS_LOOPING = $00000004;
17652
  DSBSTATUS_LOCHARDWARE = $00000008;
17656
  DSBSTATUS_LOCHARDWARE = $00000008;
17653
  DSBSTATUS_LOCSOFTWARE = $00000010;
17657
  DSBSTATUS_LOCSOFTWARE = $00000010;
17654
  DSBSTATUS_TERMINATED = $00000020;
17658
  DSBSTATUS_TERMINATED = $00000020;
17655
 
17659
 
17656
  DSBLOCK_FROMWRITECURSOR = $00000001;
17660
  DSBLOCK_FROMWRITECURSOR = $00000001;
17657
  DSBLOCK_ENTIREBUFFER = $00000002;
17661
  DSBLOCK_ENTIREBUFFER = $00000002;
17658
 
17662
 
17659
  DSBFREQUENCY_MIN = 100;
17663
  DSBFREQUENCY_MIN = 100;
17660
  DSBFREQUENCY_MAX = 100000;
17664
  DSBFREQUENCY_MAX = 100000;
17661
  DSBFREQUENCY_ORIGINAL = 0;
17665
  DSBFREQUENCY_ORIGINAL = 0;
17662
 
17666
 
17663
  DSBPAN_LEFT = -10000;
17667
  DSBPAN_LEFT = -10000;
17664
  DSBPAN_CENTER = 0;
17668
  DSBPAN_CENTER = 0;
17665
  DSBPAN_RIGHT = 10000;
17669
  DSBPAN_RIGHT = 10000;
17666
 
17670
 
17667
  DSBVOLUME_MIN = -10000;
17671
  DSBVOLUME_MIN = -10000;
17668
  DSBVOLUME_MAX = 0;
17672
  DSBVOLUME_MAX = 0;
17669
 
17673
 
17670
  DSBSIZE_MIN = 4;
17674
  DSBSIZE_MIN = 4;
17671
  DSBSIZE_MAX = $0FFFFFFF;
17675
  DSBSIZE_MAX = $0FFFFFFF;
17672
 
17676
 
17673
  DS3DMODE_NORMAL = $00000000;
17677
  DS3DMODE_NORMAL = $00000000;
17674
  DS3DMODE_HEADRELATIVE = $00000001;
17678
  DS3DMODE_HEADRELATIVE = $00000001;
17675
  DS3DMODE_DISABLE = $00000002;
17679
  DS3DMODE_DISABLE = $00000002;
17676
 
17680
 
17677
  DS3D_IMMEDIATE = $00000000;
17681
  DS3D_IMMEDIATE = $00000000;
17678
  DS3D_DEFERRED = $00000001;
17682
  DS3D_DEFERRED = $00000001;
17679
 
17683
 
17680
  DS3D_MINDISTANCEFACTOR = FLT_MIN;
17684
  DS3D_MINDISTANCEFACTOR = FLT_MIN;
17681
  DS3D_MAXDISTANCEFACTOR = FLT_MAX;
17685
  DS3D_MAXDISTANCEFACTOR = FLT_MAX;
17682
  DS3D_DEFAULTDISTANCEFACTOR = 1.0;
17686
  DS3D_DEFAULTDISTANCEFACTOR = 1.0;
17683
 
17687
 
17684
  DS3D_MINROLLOFFFACTOR = 0.0;
17688
  DS3D_MINROLLOFFFACTOR = 0.0;
17685
  DS3D_MAXROLLOFFFACTOR = 10.0;
17689
  DS3D_MAXROLLOFFFACTOR = 10.0;
17686
  DS3D_DEFAULTROLLOFFFACTOR = 1.0;
17690
  DS3D_DEFAULTROLLOFFFACTOR = 1.0;
17687
 
17691
 
17688
  DS3D_MINDOPPLERFACTOR = 0.0;
17692
  DS3D_MINDOPPLERFACTOR = 0.0;
17689
  DS3D_MAXDOPPLERFACTOR = 10.0;
17693
  DS3D_MAXDOPPLERFACTOR = 10.0;
17690
  DS3D_DEFAULTDOPPLERFACTOR = 1.0;
17694
  DS3D_DEFAULTDOPPLERFACTOR = 1.0;
17691
 
17695
 
17692
  DS3D_DEFAULTMINDISTANCE = 1.0;
17696
  DS3D_DEFAULTMINDISTANCE = 1.0;
17693
  DS3D_DEFAULTMAXDISTANCE = 1000000000.0;
17697
  DS3D_DEFAULTMAXDISTANCE = 1000000000.0;
17694
 
17698
 
17695
  DS3D_MINCONEANGLE = 0;
17699
  DS3D_MINCONEANGLE = 0;
17696
  DS3D_MAXCONEANGLE = 360;
17700
  DS3D_MAXCONEANGLE = 360;
17697
  DS3D_DEFAULTCONEANGLE = 360;
17701
  DS3D_DEFAULTCONEANGLE = 360;
17698
 
17702
 
17699
  DS3D_DEFAULTCONEOUTSIDEVOLUME = DSBVOLUME_MAX;
17703
  DS3D_DEFAULTCONEOUTSIDEVOLUME = DSBVOLUME_MAX;
17700
 
17704
 
17701
  DSCCAPS_EMULDRIVER = $00000020;
17705
  DSCCAPS_EMULDRIVER = $00000020;
17702
  DSCCAPS_CERTIFIED = DSCAPS_CERTIFIED;
17706
  DSCCAPS_CERTIFIED = DSCAPS_CERTIFIED;
17703
 
17707
 
17704
  DSCBCAPS_WAVEMAPPED = $80000000;
17708
  DSCBCAPS_WAVEMAPPED = $80000000;
17705
 
17709
 
17706
 
17710
 
17707
 
17711
 
17708
  DSBCAPS_CTRLDEFAULT = $000000E0;
17712
  DSBCAPS_CTRLDEFAULT = $000000E0;
17709
  DSBCAPS_CTRLALL = $000001F0;
17713
  DSBCAPS_CTRLALL = $000001F0;
17710
 
17714
 
17711
  DSCBLOCK_ENTIREBUFFER = $00000001;
17715
  DSCBLOCK_ENTIREBUFFER = $00000001;
17712
 
17716
 
17713
  DSCBSTATUS_CAPTURING = $00000001;
17717
  DSCBSTATUS_CAPTURING = $00000001;
17714
  DSCBSTATUS_LOOPING = $00000002;
17718
  DSCBSTATUS_LOOPING = $00000002;
17715
 
17719
 
17716
  DSCBSTART_LOOPING = $00000001;
17720
  DSCBSTART_LOOPING = $00000001;
17717
 
17721
 
17718
  DSBPN_OFFSETSTOP = DWORD(-1);
17722
  DSBPN_OFFSETSTOP = DWORD(-1);
17719
 
17723
 
17720
//
17724
//
17721
// DirectSound3D Algorithms
17725
// DirectSound3D Algorithms
17722
//
17726
//
17723
 
17727
 
17724
// Default DirectSound3D algorithm {00000000-0000-0000-0000-000000000000}
17728
// Default DirectSound3D algorithm {00000000-0000-0000-0000-000000000000}
17725
  DS3DALG_DEFAULT: TGUID = '{00000000-0000-0000-0000-000000000000}';
17729
  DS3DALG_DEFAULT: TGUID = '{00000000-0000-0000-0000-000000000000}';
17726
 
17730
 
17727
// No virtualization {C241333F-1C1B-11d2-94F5-00C04FC28ACA}
17731
// No virtualization {C241333F-1C1B-11d2-94F5-00C04FC28ACA}
17728
  DS3DALG_NO_VIRTUALIZATION: TGUID = '';
17732
  DS3DALG_NO_VIRTUALIZATION: TGUID = '';
17729
 
17733
 
17730
// High-quality HRTF algorithm {C2413340-1C1B-11d2-94F5-00C04FC28ACA}
17734
// High-quality HRTF algorithm {C2413340-1C1B-11d2-94F5-00C04FC28ACA}
17731
  DS3DALG_HRTF_FULL: TGUID = '{C2413340-1C1B-11d2-94F5-00C04FC28ACA}';
17735
  DS3DALG_HRTF_FULL: TGUID = '{C2413340-1C1B-11d2-94F5-00C04FC28ACA}';
17732
 
17736
 
17733
// Lower-quality HRTF algorithm {C2413342-1C1B-11d2-94F5-00C04FC28ACA}
17737
// Lower-quality HRTF algorithm {C2413342-1C1B-11d2-94F5-00C04FC28ACA}
17734
  DS3DALG_HRTF_LIGHT: TGUID = '{C2413342-1C1B-11d2-94F5-00C04FC28ACA}';
17738
  DS3DALG_HRTF_LIGHT: TGUID = '{C2413342-1C1B-11d2-94F5-00C04FC28ACA}';
17735
 
17739
 
17736
//DirectMusic file
17740
//DirectMusic file
17737
(*==========================================================================;
17741
(*==========================================================================;
17738
 *
17742
 *
17739
 *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
17743
 *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
17740
 *
17744
 *
17741
 *  Files:      dls1.h dls2.h dmdls.h dmerror.h dmksctrl.h
17745
 *  Files:      dls1.h dls2.h dmdls.h dmerror.h dmksctrl.h
17742
                dmusicc.h dmusici.h dmusicf.h dmusbuff.h
17746
                dmusicc.h dmusici.h dmusicf.h dmusbuff.h
17743
 *  Content:    DirectMusic, DirectSetup
17747
 *  Content:    DirectMusic, DirectSetup
17744
 *
17748
 *
17745
 *  DirectX 7.0 Delphi adaptation by Erik Unger
17749
 *  DirectX 7.0 Delphi adaptation by Erik Unger
17746
 *
17750
 *
17747
 *  Modyfied: 10-Sep-2000
17751
 *  Modyfied: 10-Sep-2000
17748
 *
17752
 *
17749
 *  Download: http://www.delphi-jedi.org/DelphiGraphics/
17753
 *  Download: http://www.delphi-jedi.org/DelphiGraphics/
17750
 *  E-Mail: DelphiDirectX@next-reality.com
17754
 *  E-Mail: DelphiDirectX@next-reality.com
17751
 *
17755
 *
17752
 ***************************************************************************)
17756
 ***************************************************************************)
17753
 
17757
 
17754
 
17758
 
17755
function MAKE_HRESULT(sev,fac,code: DWORD) : HResult;
17759
function MAKE_HRESULT(sev,fac,code: DWORD) : HResult;
17756
 
17760
 
17757
type
17761
type
17758
  mmioFOURCC = array [0..3] of Char;
17762
  mmioFOURCC = array [0..3] of Char;
17759
 
17763
 
17760
 
17764
 
17761
(*==========================================================================;
17765
(*==========================================================================;
17762
//
17766
//
17763
//  dls1.h
17767
//  dls1.h
17764
//
17768
//
17765
//
17769
//
17766
//  Description:
17770
//  Description:
17767
//
17771
//
17768
//  Interface defines and structures for the Instrument Collection Form
17772
//  Interface defines and structures for the Instrument Collection Form
17769
//  RIFF DLS.
17773
//  RIFF DLS.
17770
//
17774
//
17771
//
17775
//
17772
//  Written by Sonic Foundry 1996.  Released for public use.
17776
//  Written by Sonic Foundry 1996.  Released for public use.
17773
//
17777
//
17774
//=========================================================================*)
17778
//=========================================================================*)
17775
 
17779
 
17776
(*//////////////////////////////////////////////////////////////////////////
17780
(*//////////////////////////////////////////////////////////////////////////
17777
//
17781
//
17778
//
17782
//
17779
// Layout of an instrument collection:
17783
// Layout of an instrument collection:
17780
//
17784
//
17781
//
17785
//
17782
// RIFF [] 'DLS ' [dlid,colh,INSTLIST,WAVEPOOL,INFOLIST]
17786
// RIFF [] 'DLS ' [dlid,colh,INSTLIST,WAVEPOOL,INFOLIST]
17783
//
17787
//
17784
// INSTLIST
17788
// INSTLIST
17785
// LIST [] 'lins'
17789
// LIST [] 'lins'
17786
//               LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
17790
//               LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
17787
//               LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
17791
//               LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
17788
//               LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
17792
//               LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
17789
//
17793
//
17790
// RGNLIST
17794
// RGNLIST
17791
// LIST [] 'lrgn'
17795
// LIST [] 'lrgn'
17792
//               LIST [] 'rgn '  [rgnh,wsmp,wlnk,ARTLIST]
17796
//               LIST [] 'rgn '  [rgnh,wsmp,wlnk,ARTLIST]
17793
//               LIST [] 'rgn '  [rgnh,wsmp,wlnk,ARTLIST]
17797
//               LIST [] 'rgn '  [rgnh,wsmp,wlnk,ARTLIST]
17794
//               LIST [] 'rgn '  [rgnh,wsmp,wlnk,ARTLIST]
17798
//               LIST [] 'rgn '  [rgnh,wsmp,wlnk,ARTLIST]
17795
//
17799
//
17796
// ARTLIST
17800
// ARTLIST
17797
// LIST [] 'lart'
17801
// LIST [] 'lart'
17798
//         'art1' level 1 Articulation connection graph
17802
//         'art1' level 1 Articulation connection graph
17799
//         'art2' level 2 Articulation connection graph
17803
//         'art2' level 2 Articulation connection graph
17800
//         '3rd1' Possible 3rd party articulation structure 1
17804
//         '3rd1' Possible 3rd party articulation structure 1
17801
//         '3rd2' Possible 3rd party articulation structure 2 .... and so on
17805
//         '3rd2' Possible 3rd party articulation structure 2 .... and so on
17802
//
17806
//
17803
// WAVEPOOL
17807
// WAVEPOOL
17804
// ptbl [] [pool table]
17808
// ptbl [] [pool table]
17805
// LIST [] 'wvpl'
17809
// LIST [] 'wvpl'
17806
//               [path],
17810
//               [path],
17807
//               [path],
17811
//               [path],
17808
//               LIST [] 'wave' [dlid,RIFFWAVE]
17812
//               LIST [] 'wave' [dlid,RIFFWAVE]
17809
//               LIST [] 'wave' [dlid,RIFFWAVE]
17813
//               LIST [] 'wave' [dlid,RIFFWAVE]
17810
//               LIST [] 'wave' [dlid,RIFFWAVE]
17814
//               LIST [] 'wave' [dlid,RIFFWAVE]
17811
//               LIST [] 'wave' [dlid,RIFFWAVE]
17815
//               LIST [] 'wave' [dlid,RIFFWAVE]
17812
//               LIST [] 'wave' [dlid,RIFFWAVE]
17816
//               LIST [] 'wave' [dlid,RIFFWAVE]
17813
//
17817
//
17814
// INFOLIST
17818
// INFOLIST
17815
// LIST [] 'INFO'
17819
// LIST [] 'INFO'
17816
//               'icmt' 'One of those crazy comments.'
17820
//               'icmt' 'One of those crazy comments.'
17817
//               'icop' 'Copyright (C) 1996 Sonic Foundry'
17821
//               'icop' 'Copyright (C) 1996 Sonic Foundry'
17818
//
17822
//
17819
////////////////////////////////////////////////////////////////////////(*)
17823
////////////////////////////////////////////////////////////////////////(*)
17820
 
17824
 
17821
(*/////////////////////////////////////////////////////////////////////////
17825
(*/////////////////////////////////////////////////////////////////////////
17822
// FOURCC's used in the DLS file
17826
// FOURCC's used in the DLS file
17823
////////////////////////////////////////////////////////////////////////(*)
17827
////////////////////////////////////////////////////////////////////////(*)
17824
 
17828
 
17825
const
17829
const
17826
  FOURCC_DLS   : mmioFOURCC = ('D','L','S',' ');
17830
  FOURCC_DLS   : mmioFOURCC = ('D','L','S',' ');
17827
  FOURCC_DLID  : mmioFOURCC = ('d','l','i','d');
17831
  FOURCC_DLID  : mmioFOURCC = ('d','l','i','d');
17828
  FOURCC_COLH  : mmioFOURCC = ('c','o','l','h');
17832
  FOURCC_COLH  : mmioFOURCC = ('c','o','l','h');
17829
  FOURCC_WVPL  : mmioFOURCC = ('w','v','p','l');
17833
  FOURCC_WVPL  : mmioFOURCC = ('w','v','p','l');
17830
  FOURCC_PTBL  : mmioFOURCC = ('p','t','b','l');
17834
  FOURCC_PTBL  : mmioFOURCC = ('p','t','b','l');
17831
  FOURCC_PATH  : mmioFOURCC = ('p','a','t','h');
17835
  FOURCC_PATH  : mmioFOURCC = ('p','a','t','h');
17832
  FOURCC_wave  : mmioFOURCC = ('w','a','v','e');
17836
  FOURCC_wave  : mmioFOURCC = ('w','a','v','e');
17833
  FOURCC_LINS  : mmioFOURCC = ('l','i','n','s');
17837
  FOURCC_LINS  : mmioFOURCC = ('l','i','n','s');
17834
  FOURCC_INS   : mmioFOURCC = ('i','n','s',' ');
17838
  FOURCC_INS   : mmioFOURCC = ('i','n','s',' ');
17835
  FOURCC_INSH  : mmioFOURCC = ('i','n','s','h');
17839
  FOURCC_INSH  : mmioFOURCC = ('i','n','s','h');
17836
  FOURCC_LRGN  : mmioFOURCC = ('l','r','g','n');
17840
  FOURCC_LRGN  : mmioFOURCC = ('l','r','g','n');
17837
  FOURCC_RGN   : mmioFOURCC = ('r','g','n',' ');
17841
  FOURCC_RGN   : mmioFOURCC = ('r','g','n',' ');
17838
  FOURCC_RGNH  : mmioFOURCC = ('r','g','n','h');
17842
  FOURCC_RGNH  : mmioFOURCC = ('r','g','n','h');
17839
  FOURCC_LART  : mmioFOURCC = ('l','a','r','t');
17843
  FOURCC_LART  : mmioFOURCC = ('l','a','r','t');
17840
  FOURCC_ART1  : mmioFOURCC = ('a','r','t','1');
17844
  FOURCC_ART1  : mmioFOURCC = ('a','r','t','1');
17841
  FOURCC_WLNK  : mmioFOURCC = ('w','l','n','k');
17845
  FOURCC_WLNK  : mmioFOURCC = ('w','l','n','k');
17842
  FOURCC_WSMP  : mmioFOURCC = ('w','s','m','p');
17846
  FOURCC_WSMP  : mmioFOURCC = ('w','s','m','p');
17843
  //FOURCC_VERS  : mmioFOURCC = ('v','e','r','s');
17847
  //FOURCC_VERS  : mmioFOURCC = ('v','e','r','s');
17844
 
17848
 
17845
(*/////////////////////////////////////////////////////////////////////////
17849
(*/////////////////////////////////////////////////////////////////////////
17846
// Articulation connection graph definitions
17850
// Articulation connection graph definitions
17847
////////////////////////////////////////////////////////////////////////(*)
17851
////////////////////////////////////////////////////////////////////////(*)
17848
 
17852
 
17849
(* Generic Sources *)
17853
(* Generic Sources *)
17850
  CONN_SRC_NONE              = $0000;
17854
  CONN_SRC_NONE              = $0000;
17851
  CONN_SRC_LFO               = $0001;
17855
  CONN_SRC_LFO               = $0001;
17852
  CONN_SRC_KEYONVELOCITY     = $0002;
17856
  CONN_SRC_KEYONVELOCITY     = $0002;
17853
  CONN_SRC_KEYNUMBER         = $0003;
17857
  CONN_SRC_KEYNUMBER         = $0003;
17854
  CONN_SRC_EG1               = $0004;
17858
  CONN_SRC_EG1               = $0004;
17855
  CONN_SRC_EG2               = $0005;
17859
  CONN_SRC_EG2               = $0005;
17856
  CONN_SRC_PITCHWHEEL        = $0006;
17860
  CONN_SRC_PITCHWHEEL        = $0006;
17857
 
17861
 
17858
(* Midi Controllers 0-127 *)
17862
(* Midi Controllers 0-127 *)
17859
  CONN_SRC_CC1               = $0081;
17863
  CONN_SRC_CC1               = $0081;
17860
  CONN_SRC_CC7               = $0087;
17864
  CONN_SRC_CC7               = $0087;
17861
  CONN_SRC_CC10              = $008a;
17865
  CONN_SRC_CC10              = $008a;
17862
  CONN_SRC_CC11              = $008b;
17866
  CONN_SRC_CC11              = $008b;
17863
 
17867
 
17864
(* Generic Destinations *)
17868
(* Generic Destinations *)
17865
  CONN_DST_NONE              = $0000;
17869
  CONN_DST_NONE              = $0000;
17866
  CONN_DST_ATTENUATION       = $0001;
17870
  CONN_DST_ATTENUATION       = $0001;
17867
  CONN_DST_PITCH             = $0003;
17871
  CONN_DST_PITCH             = $0003;
17868
  CONN_DST_PAN               = $0004;
17872
  CONN_DST_PAN               = $0004;
17869
 
17873
 
17870
(* LFO Destinations *)
17874
(* LFO Destinations *)
17871
  CONN_DST_LFO_FREQUENCY     = $0104;
17875
  CONN_DST_LFO_FREQUENCY     = $0104;
17872
  CONN_DST_LFO_STARTDELAY    = $0105;
17876
  CONN_DST_LFO_STARTDELAY    = $0105;
17873
 
17877
 
17874
(* EG1 Destinations *)
17878
(* EG1 Destinations *)
17875
  CONN_DST_EG1_ATTACKTIME    = $0206;
17879
  CONN_DST_EG1_ATTACKTIME    = $0206;
17876
  CONN_DST_EG1_DECAYTIME     = $0207;
17880
  CONN_DST_EG1_DECAYTIME     = $0207;
17877
  CONN_DST_EG1_RELEASETIME   = $0209;
17881
  CONN_DST_EG1_RELEASETIME   = $0209;
17878
  CONN_DST_EG1_SUSTAINLEVEL  = $020a;
17882
  CONN_DST_EG1_SUSTAINLEVEL  = $020a;
17879
 
17883
 
17880
(* EG2 Destinations *)
17884
(* EG2 Destinations *)
17881
  CONN_DST_EG2_ATTACKTIME    = $030a;
17885
  CONN_DST_EG2_ATTACKTIME    = $030a;
17882
  CONN_DST_EG2_DECAYTIME     = $030b;
17886
  CONN_DST_EG2_DECAYTIME     = $030b;
17883
  CONN_DST_EG2_RELEASETIME   = $030d;
17887
  CONN_DST_EG2_RELEASETIME   = $030d;
17884
  CONN_DST_EG2_SUSTAINLEVEL  = $030e;
17888
  CONN_DST_EG2_SUSTAINLEVEL  = $030e;
17885
 
17889
 
17886
  CONN_TRN_NONE              = $0000;
17890
  CONN_TRN_NONE              = $0000;
17887
  CONN_TRN_CONCAVE           = $0001;
17891
  CONN_TRN_CONCAVE           = $0001;
17888
 
17892
 
17889
type
17893
type
17890
  PDLSId = ^TDLSId;
17894
  PDLSId = ^TDLSId;
17891
  TDLSId = packed record
17895
  TDLSId = packed record
17892
    ulData1 : ULONG;
17896
    ulData1 : ULONG;
17893
    usData2 : Word;
17897
    usData2 : Word;
17894
    usData3 : Word;
17898
    usData3 : Word;
17895
    abData4 : array [0..7] of BYTE;
17899
    abData4 : array [0..7] of BYTE;
17896
  end;
17900
  end;
17897
 
17901
 
17898
//  PDLSVersion = ^TDLSVersion;
17902
//  PDLSVersion = ^TDLSVersion;
17899
//  TDLSVersion = packed record
17903
//  TDLSVersion = packed record
17900
//    dwVersionMS,
17904
//    dwVersionMS,
17901
//    dwVersionLS : DWORD;
17905
//    dwVersionLS : DWORD;
17902
//  end;
17906
//  end;
17903
 
17907
 
17904
  PConnection = ^TConnection;
17908
  PConnection = ^TConnection;
17905
  TConnection = packed record
17909
  TConnection = packed record
17906
    usSource : Word;
17910
    usSource : Word;
17907
    usControl : Word;
17911
    usControl : Word;
17908
    SuDestination : Word;
17912
    SuDestination : Word;
17909
    usTransform :  Word;
17913
    usTransform :  Word;
17910
    lScale : LongInt;
17914
    lScale : LongInt;
17911
  end;
17915
  end;
17912
 
17916
 
17913
(* Level 1 Articulation Data *)
17917
(* Level 1 Articulation Data *)
17914
 
17918
 
17915
  PConnectionList = ^TConnectionList;
17919
  PConnectionList = ^TConnectionList;
17916
  TConnectionList = packed record
17920
  TConnectionList = packed record
17917
    cbSize : ULONG;            (* size of the connection list structure *)
17921
    cbSize : ULONG;            (* size of the connection list structure *)
17918
    cConnections : ULONG;      (* count of connections in the list *)
17922
    cConnections : ULONG;      (* count of connections in the list *)
17919
  end;
17923
  end;
17920
 
17924
 
17921
(*/////////////////////////////////////////////////////////////////////////
17925
(*/////////////////////////////////////////////////////////////////////////
17922
// Generic type defines for regions and instruments
17926
// Generic type defines for regions and instruments
17923
////////////////////////////////////////////////////////////////////////(*)
17927
////////////////////////////////////////////////////////////////////////(*)
17924
 
17928
 
17925
  PRGNRange = ^TRGNRange;
17929
  PRGNRange = ^TRGNRange;
17926
  TRGNRange = packed record
17930
  TRGNRange = packed record
17927
    usLow : Word;
17931
    usLow : Word;
17928
    usHigh : Word;
17932
    usHigh : Word;
17929
  end;
17933
  end;
17930
 
17934
 
17931
const
17935
const
17932
  F_INSTRUMENT_DRUMS      = $80000000;
17936
  F_INSTRUMENT_DRUMS      = $80000000;
17933
 
17937
 
17934
type
17938
type
17935
  PMIDILocale = ^TMIDILocale;
17939
  PMIDILocale = ^TMIDILocale;
17936
  TMIDILocale = packed record
17940
  TMIDILocale = packed record
17937
    ulBank : ULONG;
17941
    ulBank : ULONG;
17938
    ulInstrument : ULONG;
17942
    ulInstrument : ULONG;
17939
  end;
17943
  end;
17940
 
17944
 
17941
(*/////////////////////////////////////////////////////////////////////////
17945
(*/////////////////////////////////////////////////////////////////////////
17942
// Header structures found in an DLS file for collection, instruments, and
17946
// Header structures found in an DLS file for collection, instruments, and
17943
// regions.
17947
// regions.
17944
////////////////////////////////////////////////////////////////////////(*)
17948
////////////////////////////////////////////////////////////////////////(*)
17945
 
17949
 
17946
const
17950
const
17947
  F_RGN_OPTION_SELFNONEXCLUSIVE  = $0001;
17951
  F_RGN_OPTION_SELFNONEXCLUSIVE  = $0001;
17948
 
17952
 
17949
type
17953
type
17950
  PRGNHeader = ^TRGNHeader;
17954
  PRGNHeader = ^TRGNHeader;
17951
  TRGNHeader = packed record
17955
  TRGNHeader = packed record
17952
    RangeKey : TRGNRange;          (* Key range  *)
17956
    RangeKey : TRGNRange;          (* Key range  *)
17953
    RangeVelocity : TRGNRange;     (* Velocity Range  *)
17957
    RangeVelocity : TRGNRange;     (* Velocity Range  *)
17954
    fusOptions : Word   ;          (* Synthesis options for this range *)
17958
    fusOptions : Word   ;          (* Synthesis options for this range *)
17955
    usKeyGroup : Word   ;          (* Key grouping for non simultaneous play *)
17959
    usKeyGroup : Word   ;          (* Key grouping for non simultaneous play *)
17956
                                   (* 0 = no group, 1 up is group *)
17960
                                   (* 0 = no group, 1 up is group *)
17957
                                   (* for Level 1 only groups 1-15 are allowed *)
17961
                                   (* for Level 1 only groups 1-15 are allowed *)
17958
  end;
17962
  end;
17959
 
17963
 
17960
  PInstHeader = ^TInstHeader;
17964
  PInstHeader = ^TInstHeader;
17961
  TInstHeader = packed record
17965
  TInstHeader = packed record
17962
    cRegions : ULONG;                (* Count of regions in this instrument *)
17966
    cRegions : ULONG;                (* Count of regions in this instrument *)
17963
    Locale : TMIDILocale;            (* Intended MIDI locale of this instrument *)
17967
    Locale : TMIDILocale;            (* Intended MIDI locale of this instrument *)
17964
  end;
17968
  end;
17965
 
17969
 
17966
  PDLSHeader = ^TDLSHeader;
17970
  PDLSHeader = ^TDLSHeader;
17967
  TDLSHeader = packed record
17971
  TDLSHeader = packed record
17968
    cInstruments : ULONG;
17972
    cInstruments : ULONG;
17969
  end;
17973
  end;
17970
 
17974
 
17971
(*////////////////////////////////////////////////////////////////////////////
17975
(*////////////////////////////////////////////////////////////////////////////
17972
// definitions for the Wave link structure
17976
// definitions for the Wave link structure
17973
///////////////////////////////////////////////////////////////////////////(*)
17977
///////////////////////////////////////////////////////////////////////////(*)
17974
 
17978
 
17975
(* ****  For level 1 only WAVELINK_CHANNEL_MONO is valid  **** *)
17979
(* ****  For level 1 only WAVELINK_CHANNEL_MONO is valid  **** *)
17976
(* ulChannel allows for up to 32 channels of audio with each bit position *)
17980
(* ulChannel allows for up to 32 channels of audio with each bit position *)
17977
(* specifiying a channel of playback *)
17981
(* specifiying a channel of playback *)
17978
 
17982
 
17979
const
17983
const
17980
  WAVELINK_CHANNEL_LEFT    = $0001;
17984
  WAVELINK_CHANNEL_LEFT    = $0001;
17981
  WAVELINK_CHANNEL_RIGHT   = $0002;
17985
  WAVELINK_CHANNEL_RIGHT   = $0002;
17982
 
17986
 
17983
  F_WAVELINK_PHASE_MASTER  = $0001;
17987
  F_WAVELINK_PHASE_MASTER  = $0001;
17984
 
17988
 
17985
type
17989
type
17986
  PWaveLink = ^TWaveLink;
17990
  PWaveLink = ^TWaveLink;
17987
  TWaveLink = packed record  (* any paths or links are stored right after struct *)
17991
  TWaveLink = packed record  (* any paths or links are stored right after struct *)
17988
    fusOptions :   Word;     (* options flags for this wave *)
17992
    fusOptions :   Word;     (* options flags for this wave *)
17989
    usPhaseGroup : Word;     (* Phase grouping for locking channels *)
17993
    usPhaseGroup : Word;     (* Phase grouping for locking channels *)
17990
    ulChannel :    ULONG;    (* channel placement *)
17994
    ulChannel :    ULONG;    (* channel placement *)
17991
    ulTableIndex : ULONG;    (* index into the wave pool table, 0 based *)
17995
    ulTableIndex : ULONG;    (* index into the wave pool table, 0 based *)
17992
  end;
17996
  end;
17993
 
17997
 
17994
const
17998
const
17995
  POOL_CUE_NULL  = $ffffffff;
17999
  POOL_CUE_NULL  = $ffffffff;
17996
 
18000
 
17997
type
18001
type
17998
  PPoolCUE = ^TPoolCUE;
18002
  PPoolCUE = ^TPoolCUE;
17999
  TPoolCUE = packed record
18003
  TPoolCUE = packed record
18000
    ulOffset : ULONG;
18004
    ulOffset : ULONG;
18001
  end;
18005
  end;
18002
 
18006
 
18003
  PPoolTable = ^TPoolTable;
18007
  PPoolTable = ^TPoolTable;
18004
  TPoolTable = packed record
18008
  TPoolTable = packed record
18005
    cbSize : ULONG;             (* size of the pool table structure *)
18009
    cbSize : ULONG;             (* size of the pool table structure *)
18006
    cCues :  ULONG;             (* count of cues in the list *)
18010
    cCues :  ULONG;             (* count of cues in the list *)
18007
  end;
18011
  end;
18008
 
18012
 
18009
(*////////////////////////////////////////////////////////////////////////////
18013
(*////////////////////////////////////////////////////////////////////////////
18010
// Structures for the "wsmp" chunk
18014
// Structures for the "wsmp" chunk
18011
///////////////////////////////////////////////////////////////////////////(*)
18015
///////////////////////////////////////////////////////////////////////////(*)
18012
 
18016
 
18013
const
18017
const
18014
  F_WSMP_NO_TRUNCATION     = $0001;
18018
  F_WSMP_NO_TRUNCATION     = $0001;
18015
  F_WSMP_NO_COMPRESSION    = $0002;
18019
  F_WSMP_NO_COMPRESSION    = $0002;
18016
 
18020
 
18017
type
18021
type
18018
  PWSMPL = ^TWSMPL;
18022
  PWSMPL = ^TWSMPL;
18019
  TWSMPL = packed record
18023
  TWSMPL = packed record
18020
    cbSize :        ULONG;
18024
    cbSize :        ULONG;
18021
    usUnityNote :   Word;       (* MIDI Unity Playback Note *)
18025
    usUnityNote :   Word;       (* MIDI Unity Playback Note *)
18022
    sFineTune :     SmallInt;   (* Fine Tune in log tuning *)
18026
    sFineTune :     SmallInt;   (* Fine Tune in log tuning *)
18023
    lAttenuation :  Integer;    (* Overall Attenuation to be applied to data *)
18027
    lAttenuation :  Integer;    (* Overall Attenuation to be applied to data *)
18024
    fulOptions :    ULONG;      (* Flag options  *)
18028
    fulOptions :    ULONG;      (* Flag options  *)
18025
    cSampleLoops :  ULONG;      (* Count of Sample loops, 0 loops is one shot *)
18029
    cSampleLoops :  ULONG;      (* Count of Sample loops, 0 loops is one shot *)
18026
  end;
18030
  end;
18027
 
18031
 
18028
 
18032
 
18029
(* This loop type is a normal forward playing loop which is continually *)
18033
(* This loop type is a normal forward playing loop which is continually *)
18030
(* played until the envelope reaches an off threshold in the release *)
18034
(* played until the envelope reaches an off threshold in the release *)
18031
(* portion of the volume envelope *)
18035
(* portion of the volume envelope *)
18032
 
18036
 
18033
const
18037
const
18034
  WLOOP_TYPE_FORWARD  = 0;
18038
  WLOOP_TYPE_FORWARD  = 0;
18035
 
18039
 
18036
type
18040
type
18037
  TWLoop = packed record
18041
  TWLoop = packed record
18038
    cbSize :   ULONG;
18042
    cbSize :   ULONG;
18039
    ulType :   ULONG;           (* Loop Type *)
18043
    ulType :   ULONG;           (* Loop Type *)
18040
    ulStart :  ULONG;           (* Start of loop in samples *)
18044
    ulStart :  ULONG;           (* Start of loop in samples *)
18041
    ulLength : ULONG;           (* Length of loop in samples *)
18045
    ulLength : ULONG;           (* Length of loop in samples *)
18042
  end;
18046
  end;
18043
 
18047
 
18044
(*******************************************************************************
18048
(*******************************************************************************
18045
 
18049
 
18046
dls2.h
18050
dls2.h
18047
 
18051
 
18048
Description:
18052
Description:
18049
 
18053
 
18050
Interface defines and structures for the DLS2 extensions of DLS.
18054
Interface defines and structures for the DLS2 extensions of DLS.
18051
 
18055
 
18052
 
18056
 
18053
  Written by Microsoft 1998.  Released for public use.
18057
  Written by Microsoft 1998.  Released for public use.
18054
 
18058
 
18055
*******************************************************************************)
18059
*******************************************************************************)
18056
 
18060
 
18057
(*
18061
(*
18058
  FOURCC's used in the DLS2 file, in addition to DLS1 chunks
18062
  FOURCC's used in the DLS2 file, in addition to DLS1 chunks
18059
*)
18063
*)
18060
const
18064
const
18061
  FOURCC_RGN2  : mmioFOURCC = ('r','g','n','2');
18065
  FOURCC_RGN2  : mmioFOURCC = ('r','g','n','2');
18062
  FOURCC_LAR2  : mmioFOURCC = ('l','a','r','2');
18066
  FOURCC_LAR2  : mmioFOURCC = ('l','a','r','2');
18063
  FOURCC_ART2  : mmioFOURCC = ('a','r','t','2');
18067
  FOURCC_ART2  : mmioFOURCC = ('a','r','t','2');
18064
  FOURCC_CDL   : mmioFOURCC = ('c','d','l',' ');
18068
  FOURCC_CDL   : mmioFOURCC = ('c','d','l',' ');
18065
//  FOURCC_DLID  : mmioFOURCC = ('d','l','i','d');
18069
//  FOURCC_DLID  : mmioFOURCC = ('d','l','i','d');
18066
 
18070
 
18067
(*
18071
(*
18068
  Articulation connection graph definitions. These are in addition to
18072
  Articulation connection graph definitions. These are in addition to
18069
  the definitions in the DLS1 header.
18073
  the definitions in the DLS1 header.
18070
*)
18074
*)
18071
 
18075
 
18072
const
18076
const
18073
(* Generic Sources (in addition to DLS1 sources. *)
18077
(* Generic Sources (in addition to DLS1 sources. *)
18074
  CONN_SRC_POLYPRESSURE           = $0007;      (* Polyphonic Pressure *)
18078
  CONN_SRC_POLYPRESSURE           = $0007;      (* Polyphonic Pressure *)
18075
  CONN_SRC_CHANNELPRESSURE      = $0008;        (* Channel Pressure *)
18079
  CONN_SRC_CHANNELPRESSURE      = $0008;        (* Channel Pressure *)
18076
  CONN_SRC_VIBRATO                    = $0009;  (* Vibrato LFO *)
18080
  CONN_SRC_VIBRATO                    = $0009;  (* Vibrato LFO *)
18077
  CONN_SRC_MONOPRESSURE     = $000a; (* MIDI Mono pressure *)
18081
  CONN_SRC_MONOPRESSURE     = $000a; (* MIDI Mono pressure *)
18078
 
18082
 
18079
 
18083
 
18080
(* Midi Controllers *)
18084
(* Midi Controllers *)
18081
  CONN_SRC_CC91                     = $00db;    (* Reverb Send *)
18085
  CONN_SRC_CC91                     = $00db;    (* Reverb Send *)
18082
  CONN_SRC_CC93                     = $00dd;    (* Chorus Send *)
18086
  CONN_SRC_CC93                     = $00dd;    (* Chorus Send *)
18083
 
18087
 
18084
 
18088
 
18085
(* Generic Destinations *)
18089
(* Generic Destinations *)
18086
  CONN_DST_GAIN                 = $0001;        (* Same as CONN_DST_ ATTENUATION *)
18090
  CONN_DST_GAIN                 = $0001;        (* Same as CONN_DST_ ATTENUATION *)
18087
  CONN_DST_KEYNUMBER            = $0005;        (* Key Number Generator *)
18091
  CONN_DST_KEYNUMBER            = $0005;        (* Key Number Generator *)
18088
 
18092
 
18089
(* Audio Channel Output Destinations *)
18093
(* Audio Channel Output Destinations *)
18090
  CONN_DST_LEFT                     = $0010;    (* Left Channel Send *)
18094
  CONN_DST_LEFT                     = $0010;    (* Left Channel Send *)
18091
  CONN_DST_RIGHT                        = $0011;        (* Right Channel Send *)
18095
  CONN_DST_RIGHT                        = $0011;        (* Right Channel Send *)
18092
  CONN_DST_CENTER                         = $0012;      (* Center Channel Send *)
18096
  CONN_DST_CENTER                         = $0012;      (* Center Channel Send *)
18093
  CONN_DST_LEFTREAR                     = $0013;        (* Left Rear Channel Send *)
18097
  CONN_DST_LEFTREAR                     = $0013;        (* Left Rear Channel Send *)
18094
  CONN_DST_RIGHTREAR            = $0014;        (* Right Rear Channel Send *)
18098
  CONN_DST_RIGHTREAR            = $0014;        (* Right Rear Channel Send *)
18095
  CONN_DST_LFE_CHANNEL  = $0015;        (* LFE Channel Send *)
18099
  CONN_DST_LFE_CHANNEL  = $0015;        (* LFE Channel Send *)
18096
  CONN_DST_CHORUS                         = $0080;      (* Chorus Send *)
18100
  CONN_DST_CHORUS                         = $0080;      (* Chorus Send *)
18097
  CONN_DST_REVERB                         = $0081;      (* Reverb Send *)
18101
  CONN_DST_REVERB                         = $0081;      (* Reverb Send *)
18098
 
18102
 
18099
(* Vibrato LFO Destinations *)
18103
(* Vibrato LFO Destinations *)
18100
  CONN_DST_VIB_FREQUENCY                = $0114;        (* Vibrato Frequency *)
18104
  CONN_DST_VIB_FREQUENCY                = $0114;        (* Vibrato Frequency *)
18101
  CONN_DST_VIB_STARTDELAY         = $0115;      (* Vibrato Start Delay *)
18105
  CONN_DST_VIB_STARTDELAY         = $0115;      (* Vibrato Start Delay *)
18102
 
18106
 
18103
(* EG1 Destinations *)
18107
(* EG1 Destinations *)
18104
  CONN_DST_EG1_DELAYTIME                = $020B;        (* EG1 Delay Time *)
18108
  CONN_DST_EG1_DELAYTIME                = $020B;        (* EG1 Delay Time *)
18105
  CONN_DST_EG1_HOLDTIME         = $020C;        (* EG1 Hold Time *)
18109
  CONN_DST_EG1_HOLDTIME         = $020C;        (* EG1 Hold Time *)
18106
 
18110
 
18107
 
18111
 
18108
(*      EG2 Destinations *)
18112
(*      EG2 Destinations *)
18109
  CONN_DST_EG2_DELAYTIME                = $030F;        (* EG2 Delay Time *)
18113
  CONN_DST_EG2_DELAYTIME                = $030F;        (* EG2 Delay Time *)
18110
  CONN_DST_EG2_HOLDTIME         = $0310;        (* EG2 Hold Time *)
18114
  CONN_DST_EG2_HOLDTIME         = $0310;        (* EG2 Hold Time *)
18111
 
18115
 
18112
 
18116
 
18113
(* Filter Destinations *)
18117
(* Filter Destinations *)
18114
  CONN_DST_FILTER_CUTOFF                = $0500;        (* Filter Cutoff Frequency *)
18118
  CONN_DST_FILTER_CUTOFF                = $0500;        (* Filter Cutoff Frequency *)
18115
  CONN_DST_FILTER_Q                     = $0501;        (* Filter Resonance *)
18119
  CONN_DST_FILTER_Q                     = $0501;        (* Filter Resonance *)
18116
 
18120
 
18117
 
18121
 
18118
(* Transforms *)
18122
(* Transforms *)
18119
  CONN_TRN_CONVEX                       = $0002;        (* Convex Transform *)
18123
  CONN_TRN_CONVEX                       = $0002;        (* Convex Transform *)
18120
  CONN_TRN_SWITCH                       = $0003;        (* Switch Transform *)
18124
  CONN_TRN_SWITCH                       = $0003;        (* Switch Transform *)
18121
 
18125
 
18122
 
18126
 
18123
(*      Conditional chunk operators *)
18127
(*      Conditional chunk operators *)
18124
  DLS_CDL_AND                          = $0001; (* X = X & Y *)
18128
  DLS_CDL_AND                          = $0001; (* X = X & Y *)
18125
  DLS_CDL_OR                           = $0002; (* X = X | Y *)
18129
  DLS_CDL_OR                           = $0002; (* X = X | Y *)
18126
  DLS_CDL_XOR                          = $0003; (* X = X ^ Y *)
18130
  DLS_CDL_XOR                          = $0003; (* X = X ^ Y *)
18127
  DLS_CDL_ADD                        = $0004;   (* X = X + Y *)
18131
  DLS_CDL_ADD                        = $0004;   (* X = X + Y *)
18128
  DLS_CDL_SUBTRACT         = $0005;     (* X = X - Y *)
18132
  DLS_CDL_SUBTRACT         = $0005;     (* X = X - Y *)
18129
  DLS_CDL_MULTIPLY           = $0006;   (* X = X * Y *)
18133
  DLS_CDL_MULTIPLY           = $0006;   (* X = X * Y *)
18130
  DLS_CDL_DIVIDE                     = $0007;   (* X = X / Y *)
18134
  DLS_CDL_DIVIDE                     = $0007;   (* X = X / Y *)
18131
  DLS_CDL_LOGICAL_AND      = $0008;     (* X = X && Y *)
18135
  DLS_CDL_LOGICAL_AND      = $0008;     (* X = X && Y *)
18132
  DLS_CDL_LOGICAL_OR       = $0009;     (* X = X || Y *)
18136
  DLS_CDL_LOGICAL_OR       = $0009;     (* X = X || Y *)
18133
  DLS_CDL_LT                           = $000A; (* X = (X < Y) *)
18137
  DLS_CDL_LT                           = $000A; (* X = (X < Y) *)
18134
  DLS_CDL_LE                           = $000B; (* X = (X <= Y) *)
18138
  DLS_CDL_LE                           = $000B; (* X = (X <= Y) *)
18135
  DLS_CDL_GT                       = $000C;     (* X = (X > Y) *)
18139
  DLS_CDL_GT                       = $000C;     (* X = (X > Y) *)
18136
  DLS_CDL_GE                       = $000D;     (* X = (X >= Y) *)
18140
  DLS_CDL_GE                       = $000D;     (* X = (X >= Y) *)
18137
  DLS_CDL_EQ                       = $000E;     (* X = (X == Y) *)
18141
  DLS_CDL_EQ                       = $000E;     (* X = (X == Y) *)
18138
  DLS_CDL_NOT                        = $000F;   (* X = !X *)
18142
  DLS_CDL_NOT                        = $000F;   (* X = !X *)
18139
  DLS_CDL_CONST            = $0010;     (* 32-bit constant *)
18143
  DLS_CDL_CONST            = $0010;     (* 32-bit constant *)
18140
  DLS_CDL_QUERY            = $0011;     (* 32-bit value returned from query *)
18144
  DLS_CDL_QUERY            = $0011;     (* 32-bit value returned from query *)
18141
  DLS_CDL_QUERYSUPPORTED = $0012;       (* Test to see if DLSID Query is supported *)
18145
  DLS_CDL_QUERYSUPPORTED = $0012;       (* Test to see if DLSID Query is supported *)
18142
 
18146
 
18143
(*
18147
(*
18144
Loop and release
18148
Loop and release
18145
*)
18149
*)
18146
 
18150
 
18147
  WLOOP_TYPE_RELEASE  = 2;
18151
  WLOOP_TYPE_RELEASE  = 2;
18148
 
18152
 
18149
(*
18153
(*
18150
DLSID queries for <cdl-ck>
18154
DLSID queries for <cdl-ck>
18151
*)
18155
*)
18152
 
18156
 
18153
  DLSID_GMInHardware : TGUID =        '{178f2f24-c364-11d1-a760-0000f875ac12}';
18157
  DLSID_GMInHardware : TGUID =        '{178f2f24-c364-11d1-a760-0000f875ac12}';
18154
  DLSID_GSInHardware : TGUID =        '{178f2f25-c364-11d1-a760-0000f875ac12}';
18158
  DLSID_GSInHardware : TGUID =        '{178f2f25-c364-11d1-a760-0000f875ac12}';
18155
  DLSID_XGInHardware : TGUID =        '{178f2f26-c364-11d1-a760-0000f875ac12}';
18159
  DLSID_XGInHardware : TGUID =        '{178f2f26-c364-11d1-a760-0000f875ac12}';
18156
  DLSID_SupportsDLS1 : TGUID =        '{178f2f27-c364-11d1-a760-0000f875ac12}';
18160
  DLSID_SupportsDLS1 : TGUID =        '{178f2f27-c364-11d1-a760-0000f875ac12}';
18157
  DLSID_SupportsDLS2 : TGUID =        '{f14599e5-4689-11d2-afa6-00aa0024d8b6}';
18161
  DLSID_SupportsDLS2 : TGUID =        '{f14599e5-4689-11d2-afa6-00aa0024d8b6}';
18158
  DLSID_SampleMemorySize : TGUID =    '{178f2f28-c364-11d1-a760-0000f875ac12}';
18162
  DLSID_SampleMemorySize : TGUID =    '{178f2f28-c364-11d1-a760-0000f875ac12}';
18159
  DLSID_ManufacturersID : TGUID =     '{b03e1181-8095-11d2-a1ef-00600833dbd8}';
18163
  DLSID_ManufacturersID : TGUID =     '{b03e1181-8095-11d2-a1ef-00600833dbd8}';
18160
  DLSID_ProductID : TGUID =           '{b03e1182-8095-11d2-a1ef-00600833dbd8}';
18164
  DLSID_ProductID : TGUID =           '{b03e1182-8095-11d2-a1ef-00600833dbd8}';
18161
  DLSID_SamplePlaybackRate : TGUID =  '{2a91f713-a4bf-11d2-bbdf-00600833dbd8}';
18165
  DLSID_SamplePlaybackRate : TGUID =  '{2a91f713-a4bf-11d2-bbdf-00600833dbd8}';
18162
 
18166
 
18163
(************************************************************************
18167
(************************************************************************
18164
*                                                                       *
18168
*                                                                       *
18165
*   dmdls.h -- DLS download definitions for DirectMusic API's           *
18169
*   dmdls.h -- DLS download definitions for DirectMusic API's           *
18166
*                                                                       *
18170
*                                                                       *
18167
*   Copyright (c) 1998, Microsoft Corp. All rights reserved.            *
18171
*   Copyright (c) 1998, Microsoft Corp. All rights reserved.            *
18168
*                                                                       *
18172
*                                                                       *
18169
************************************************************************)
18173
************************************************************************)
18170
 
18174
 
18171
type
18175
type
18172
  TPCent =   LongInt;  (* Pitch cents *)
18176
  TPCent =   LongInt;  (* Pitch cents *)
18173
  TGCent =   LongInt;  (* Gain cents *)
18177
  TGCent =   LongInt;  (* Gain cents *)
18174
  TTCent =   LongInt;  (* Time cents *)
18178
  TTCent =   LongInt;  (* Time cents *)
18175
  TPercent = LongInt;  (* Per.. cent! *)
18179
  TPercent = LongInt;  (* Per.. cent! *)
18176
 
18180
 
18177
  PReference_Time = ^TReference_Time;
18181
  PReference_Time = ^TReference_Time;
18178
  TReference_Time = LongLong;
18182
  TReference_Time = LongLong;
18179
 
18183
 
18180
  TFourCC = DWORD;   (* a four character code *)
18184
  TFourCC = DWORD;   (* a four character code *)
18181
 
18185
 
18182
//function MAKEFOURCC (ch0, ch1, ch2, ch3: Char) : TFourCC;
18186
//function MAKEFOURCC (ch0, ch1, ch2, ch3: Char) : TFourCC;
18183
 
18187
 
18184
type
18188
type
18185
  TDMus_DownloadInfor = packed record
18189
  TDMus_DownloadInfor = packed record
18186
    dwDLType:                DWORD;      (* Instrument or Wave *)
18190
    dwDLType:                DWORD;      (* Instrument or Wave *)
18187
    dwDLId:                  DWORD;      (* Unique identifier to tag this download. *)
18191
    dwDLId:                  DWORD;      (* Unique identifier to tag this download. *)
18188
    dwNumOffsetTableEntries: DWORD;      (* Number of index in the offset address table. *)
18192
    dwNumOffsetTableEntries: DWORD;      (* Number of index in the offset address table. *)
18189
    cbSize:                  DWORD;      (* Total size of this memory chunk. *)
18193
    cbSize:                  DWORD;      (* Total size of this memory chunk. *)
18190
  end;
18194
  end;
18191
 
18195
 
18192
const
18196
const
18193
  DMUS_DOWNLOADINFO_INSTRUMENT   = 1;
18197
  DMUS_DOWNLOADINFO_INSTRUMENT   = 1;
18194
  DMUS_DOWNLOADINFO_WAVE         = 2;
18198
  DMUS_DOWNLOADINFO_WAVE         = 2;
18195
  DMUS_DOWNLOADINFO_INSTRUMENT2  = 3;   (* New version for better DLS2 support. *)
18199
  DMUS_DOWNLOADINFO_INSTRUMENT2  = 3;   (* New version for better DLS2 support. *)
18196
 
18200
 
18197
  DMUS_DEFAULT_SIZE_OFFSETTABLE  = 1;
18201
  DMUS_DEFAULT_SIZE_OFFSETTABLE  = 1;
18198
 
18202
 
18199
(* Flags for DMUS_INSTRUMENT's ulFlags member *)
18203
(* Flags for DMUS_INSTRUMENT's ulFlags member *)
18200
 
18204
 
18201
  DMUS_INSTRUMENT_GM_INSTRUMENT  = 1 shl 0;
18205
  DMUS_INSTRUMENT_GM_INSTRUMENT  = 1 shl 0;
18202
 
18206
 
18203
type
18207
type
18204
  TDMus_OffsetTable = packed record
18208
  TDMus_OffsetTable = packed record
18205
    ulOffsetTable : array [0..DMUS_DEFAULT_SIZE_OFFSETTABLE-1] of ULONG;
18209
    ulOffsetTable : array [0..DMUS_DEFAULT_SIZE_OFFSETTABLE-1] of ULONG;
18206
  end;
18210
  end;
18207
 
18211
 
18208
  TDMus_Instrument = packed record
18212
  TDMus_Instrument = packed record
18209
    ulPatch:          ULONG;
18213
    ulPatch:          ULONG;
18210
    ulFirstRegionIdx: ULONG;
18214
    ulFirstRegionIdx: ULONG;
18211
    ulGlobalArtIdx:   ULONG;                 (* If zero the instrument does not have an articulation *)
18215
    ulGlobalArtIdx:   ULONG;                 (* If zero the instrument does not have an articulation *)
18212
    ulFirstExtCkIdx:  ULONG;                 (* If zero no 3rd party entenstion chunks associated with the instrument *)
18216
    ulFirstExtCkIdx:  ULONG;                 (* If zero no 3rd party entenstion chunks associated with the instrument *)
18213
    ulCopyrightIdx:   ULONG;                 (* If zero no Copyright information associated with the instrument *)
18217
    ulCopyrightIdx:   ULONG;                 (* If zero no Copyright information associated with the instrument *)
18214
    ulFlags:          ULONG;
18218
    ulFlags:          ULONG;
18215
  end;
18219
  end;
18216
 
18220
 
18217
  TDMus_Region = packed record
18221
  TDMus_Region = packed record
18218
    RangeKey:         TRGNRange;
18222
    RangeKey:         TRGNRange;
18219
    RangeVelocity:    TRGNRange;
18223
    RangeVelocity:    TRGNRange;
18220
    fusOptions:       Word;
18224
    fusOptions:       Word;
18221
    usKeyGroup:       Word;
18225
    usKeyGroup:       Word;
18222
    ulRegionArtIdx:   ULONG;                 (* If zero the region does not have an articulation *)
18226
    ulRegionArtIdx:   ULONG;                 (* If zero the region does not have an articulation *)
18223
    ulNextRegionIdx:  ULONG;                 (* If zero no more regions *)
18227
    ulNextRegionIdx:  ULONG;                 (* If zero no more regions *)
18224
    ulFirstExtCkIdx:  ULONG;                 (* If zero no 3rd party entenstion chunks associated with the region *)
18228
    ulFirstExtCkIdx:  ULONG;                 (* If zero no 3rd party entenstion chunks associated with the region *)
18225
    WaveLink:         TWaveLink;
18229
    WaveLink:         TWaveLink;
18226
    WSMP:             TWSMPL;                (*  If WSMP.cSampleLoops > 1 then a WLOOP is included *)
18230
    WSMP:             TWSMPL;                (*  If WSMP.cSampleLoops > 1 then a WLOOP is included *)
18227
    WLOOP:            array [0..0] of TWLoop;
18231
    WLOOP:            array [0..0] of TWLoop;
18228
  end;
18232
  end;
18229
 
18233
 
18230
  TDMus_LFOParams = packed record
18234
  TDMus_LFOParams = packed record
18231
    pcFrequency:   TPCent;
18235
    pcFrequency:   TPCent;
18232
    tcDelay:       TTCent;
18236
    tcDelay:       TTCent;
18233
    gcVolumeScale: TGCent;
18237
    gcVolumeScale: TGCent;
18234
    pcPitchScale:  TPCent;
18238
    pcPitchScale:  TPCent;
18235
    gcMWToVolume:  TGCent;
18239
    gcMWToVolume:  TGCent;
18236
    pcMWToPitch:   TPCent;
18240
    pcMWToPitch:   TPCent;
18237
  end;
18241
  end;
18238
 
18242
 
18239
  TDMus_VEGParams = packed record
18243
  TDMus_VEGParams = packed record
18240
    tcAttack:      TTCent;
18244
    tcAttack:      TTCent;
18241
    tcDecay:       TTCent;
18245
    tcDecay:       TTCent;
18242
    ptSustain:     TPercent;
18246
    ptSustain:     TPercent;
18243
    tcRelease:     TTCent;
18247
    tcRelease:     TTCent;
18244
    tcVel2Attack:  TTCent;
18248
    tcVel2Attack:  TTCent;
18245
    tcKey2Decay:   TTCent;
18249
    tcKey2Decay:   TTCent;
18246
  end;
18250
  end;
18247
 
18251
 
18248
  TDMus_PEGParams = packed record
18252
  TDMus_PEGParams = packed record
18249
    tcAttack:      TTCent;
18253
    tcAttack:      TTCent;
18250
    tcDecay:       TTCent;
18254
    tcDecay:       TTCent;
18251
    ptSustain:     TPercent;
18255
    ptSustain:     TPercent;
18252
    tcRelease:     TTCent;
18256
    tcRelease:     TTCent;
18253
    tcVel2Attack:  TTCent;
18257
    tcVel2Attack:  TTCent;
18254
    tcKey2Decay:   TTCent;
18258
    tcKey2Decay:   TTCent;
18255
    pcRange:       TPCent;
18259
    pcRange:       TPCent;
18256
  end;
18260
  end;
18257
 
18261
 
18258
  TDMus_MSCParams = packed record
18262
  TDMus_MSCParams = packed record
18259
    ptDefaultPan: TPercent;
18263
    ptDefaultPan: TPercent;
18260
  end;
18264
  end;
18261
 
18265
 
18262
  TDMus_ArticParams = packed record
18266
  TDMus_ArticParams = packed record
18263
    LFO:      TDMus_LFOParams;
18267
    LFO:      TDMus_LFOParams;
18264
    VolEG:    TDMus_VEGParams;
18268
    VolEG:    TDMus_VEGParams;
18265
    PitchEG:  TDMus_PEGParams;
18269
    PitchEG:  TDMus_PEGParams;
18266
    Misc:     TDMus_MSCParams;
18270
    Misc:     TDMus_MSCParams;
18267
  end;
18271
  end;
18268
 
18272
 
18269
  TDMus_Articulation = packed record
18273
  TDMus_Articulation = packed record
18270
    ulArt1Idx:       ULONG;                  (* If zero no DLS Level 1 articulation chunk *)
18274
    ulArt1Idx:       ULONG;                  (* If zero no DLS Level 1 articulation chunk *)
18271
    ulFirstExtCkIdx: ULONG;                  (* If zero no 3rd party entenstion chunks associated with the articulation *)
18275
    ulFirstExtCkIdx: ULONG;                  (* If zero no 3rd party entenstion chunks associated with the articulation *)
18272
  end;
18276
  end;
18273
 
18277
 
18274
const
18278
const
18275
  DMUS_MIN_DATA_SIZE = 4;
18279
  DMUS_MIN_DATA_SIZE = 4;
18276
 
18280
 
18277
(*  The actual number is determined by cbSize of struct _DMUS_EXTENSIONCHUNK *)
18281
(*  The actual number is determined by cbSize of struct _DMUS_EXTENSIONCHUNK *)
18278
 
18282
 
18279
type
18283
type
18280
  DMus_ExtensionChunk = packed record
18284
  DMus_ExtensionChunk = packed record
18281
    cbSize:                      ULONG;           (*  Size of extension chunk  *)
18285
    cbSize:                      ULONG;           (*  Size of extension chunk  *)
18282
    ulNextExtCkIdx:              ULONG;           (*  If zero no more 3rd party entenstion chunks *)
18286
    ulNextExtCkIdx:              ULONG;           (*  If zero no more 3rd party entenstion chunks *)
18283
    ExtCkID:                     TFourCC;
18287
    ExtCkID:                     TFourCC;
18284
    byExtCk: array [0..DMUS_MIN_DATA_SIZE-1] of BYTE;  (*  The actual number that follows is determined by cbSize *)
18288
    byExtCk: array [0..DMUS_MIN_DATA_SIZE-1] of BYTE;  (*  The actual number that follows is determined by cbSize *)
18285
  end;
18289
  end;
18286
 
18290
 
18287
(*  The actual number is determined by cbSize of struct _DMUS_COPYRIGHT *)
18291
(*  The actual number is determined by cbSize of struct _DMUS_COPYRIGHT *)
18288
 
18292
 
18289
  TDmus_Copyright = packed record
18293
  TDmus_Copyright = packed record
18290
    cbSize:                          ULONG;              (*  Size of copyright information *)
18294
    cbSize:                          ULONG;              (*  Size of copyright information *)
18291
    byCopyright: array [0..DMUS_MIN_DATA_SIZE-1] of BYTE;               (*  The actual number that follows is determined by cbSize *)
18295
    byCopyright: array [0..DMUS_MIN_DATA_SIZE-1] of BYTE;               (*  The actual number that follows is determined by cbSize *)
18292
  end;
18296
  end;
18293
 
18297
 
18294
  TDMus_WaveData = packed record
18298
  TDMus_WaveData = packed record
18295
    cbSize:                     ULONG;          
18299
    cbSize:                     ULONG;          
18296
    byData: array [0..DMUS_MIN_DATA_SIZE-1] of BYTE;
18300
    byData: array [0..DMUS_MIN_DATA_SIZE-1] of BYTE;
18297
  end;
18301
  end;
18298
 
18302
 
18299
  TDMus_Wave = packed record
18303
  TDMus_Wave = packed record
18300
    ulFirstExtCkIdx: ULONG;              (* If zero no 3rd party entenstion chunks associated with the wave *)
18304
    ulFirstExtCkIdx: ULONG;              (* If zero no 3rd party entenstion chunks associated with the wave *)
18301
    ulCopyrightIdx:  ULONG;              (* If zero no Copyright information associated with the wave *)
18305
    ulCopyrightIdx:  ULONG;              (* If zero no Copyright information associated with the wave *)
18302
    ulWaveDataIdx:   ULONG;              (* Location of actual wave data. *)
18306
    ulWaveDataIdx:   ULONG;              (* Location of actual wave data. *)
18303
///    WaveformatEx:    TWaveFormatEx;
18307
///    WaveformatEx:    TWaveFormatEx;
18304
  end;
18308
  end;
18305
 
18309
 
18306
  PDMus_NoteRange = ^TDMus_NoteRange;
18310
  PDMus_NoteRange = ^TDMus_NoteRange;
18307
  TDMus_NoteRange = packed record
18311
  TDMus_NoteRange = packed record
18308
    dwLowNote:  DWORD;           (* Sets the low note for the range of MIDI note events to which the instrument responds.*)
18312
    dwLowNote:  DWORD;           (* Sets the low note for the range of MIDI note events to which the instrument responds.*)
18309
    dwHighNote: DWORD;           (* Sets the high note for the range of MIDI note events to which the instrument responds.*)
18313
    dwHighNote: DWORD;           (* Sets the high note for the range of MIDI note events to which the instrument responds.*)
18310
  end;
18314
  end;
18311
 
18315
 
18312
(************************************************************************
18316
(************************************************************************
18313
*                                                                       *
18317
*                                                                       *
18314
*   dmerror.h -- Error code returned by DirectMusic API's               *
18318
*   dmerror.h -- Error code returned by DirectMusic API's               *
18315
*                                                                       *
18319
*                                                                       *
18316
*   Copyright (c) 1998, Microsoft Corp. All rights reserved.            *
18320
*   Copyright (c) 1998, Microsoft Corp. All rights reserved.            *
18317
*                                                                       *
18321
*                                                                       *
18318
************************************************************************)
18322
************************************************************************)
18319
 
18323
 
18320
const
18324
const
18321
  FACILITY_DIRECTMUSIC      = $878;       (* Shared with DirectSound *)
18325
  FACILITY_DIRECTMUSIC      = $878;       (* Shared with DirectSound *)
18322
  DMUS_ERRBASE              = $1000;      (* Make error codes human readable in hex *)
18326
  DMUS_ERRBASE              = $1000;      (* Make error codes human readable in hex *)
18323
 
18327
 
18324
  MAKE_DMHRESULTSUCCESS = (0 shl 31) or (FACILITY_DIRECTMUSIC shl 16) or DMUS_ERRBASE;
18328
  MAKE_DMHRESULTSUCCESS = (0 shl 31) or (FACILITY_DIRECTMUSIC shl 16) or DMUS_ERRBASE;
18325
  MAKE_DMHRESULTERROR =   (1 shl 31) or (FACILITY_DIRECTMUSIC shl 16) or DMUS_ERRBASE;
18329
  MAKE_DMHRESULTERROR =   (1 shl 31) or (FACILITY_DIRECTMUSIC shl 16) or DMUS_ERRBASE;
18326
 
18330
 
18327
 
18331
 
18328
(* DMUS_S_PARTIALLOAD
18332
(* DMUS_S_PARTIALLOAD
18329
 *
18333
 *
18330
 * The object could only load partially. This can happen if some components are
18334
 * The object could only load partially. This can happen if some components are
18331
 * not registered properly, such as embedded tracks and tools.
18335
 * not registered properly, such as embedded tracks and tools.
18332
 *)
18336
 *)
18333
  DMUS_S_PARTIALLOAD               = MAKE_DMHRESULTSUCCESS + $091;
18337
  DMUS_S_PARTIALLOAD               = MAKE_DMHRESULTSUCCESS + $091;
18334
 
18338
 
18335
(* DMUS_S_PARTIALDOWNLOAD
18339
(* DMUS_S_PARTIALDOWNLOAD
18336
 *
18340
 *
18337
 * This code indicates that a band download was only successful in reaching
18341
 * This code indicates that a band download was only successful in reaching
18338
 * some, but not all, of the referenced ports. Some samples may not play
18342
 * some, but not all, of the referenced ports. Some samples may not play
18339
 * correctly.
18343
 * correctly.
18340
 *)
18344
 *)
18341
  DMUS_S_PARTIALDOWNLOAD          = MAKE_DMHRESULTSUCCESS + $092;
18345
  DMUS_S_PARTIALDOWNLOAD          = MAKE_DMHRESULTSUCCESS + $092;
18342
 
18346
 
18343
(* DMUS_S_REQUEUE
18347
(* DMUS_S_REQUEUE
18344
 *
18348
 *
18345
 * Return value from IDirectMusicTool::ProcessPMsg() which indicates to the
18349
 * Return value from IDirectMusicTool::ProcessPMsg() which indicates to the
18346
 * performance that it should cue the PMsg again automatically.
18350
 * performance that it should cue the PMsg again automatically.
18347
 *)
18351
 *)
18348
  DMUS_S_REQUEUE                   = MAKE_DMHRESULTSUCCESS + $200;
18352
  DMUS_S_REQUEUE                   = MAKE_DMHRESULTSUCCESS + $200;
18349
 
18353
 
18350
(* DMUS_S_FREE
18354
(* DMUS_S_FREE
18351
 *
18355
 *
18352
 * Return value from IDirectMusicTool::ProcessPMsg() which indicates to the
18356
 * Return value from IDirectMusicTool::ProcessPMsg() which indicates to the
18353
 * performance that it should free the PMsg automatically.
18357
 * performance that it should free the PMsg automatically.
18354
 *)
18358
 *)
18355
  DMUS_S_FREE                      = MAKE_DMHRESULTSUCCESS + $201;
18359
  DMUS_S_FREE                      = MAKE_DMHRESULTSUCCESS + $201;
18356
 
18360
 
18357
(* DMUS_S_END
18361
(* DMUS_S_END
18358
 *
18362
 *
18359
 * Return value from IDirectMusicTrack::Play() which indicates to the
18363
 * Return value from IDirectMusicTrack::Play() which indicates to the
18360
 * segment that the track has no more data after mtEnd.
18364
 * segment that the track has no more data after mtEnd.
18361
 *)
18365
 *)
18362
  DMUS_S_END                       = MAKE_DMHRESULTSUCCESS + $202;
18366
  DMUS_S_END                       = MAKE_DMHRESULTSUCCESS + $202;
18363
 
18367
 
18364
(* DMUS_S_STRING_TRUNCATED
18368
(* DMUS_S_STRING_TRUNCATED
18365
 *
18369
 *
18366
 * Returned string has been truncated to fit the buffer size.
18370
 * Returned string has been truncated to fit the buffer size.
18367
 *)
18371
 *)
18368
  DMUS_S_STRING_TRUNCATED          = MAKE_DMHRESULTSUCCESS + $210;
18372
  DMUS_S_STRING_TRUNCATED          = MAKE_DMHRESULTSUCCESS + $210;
18369
 
18373
 
18370
(* DMUS_S_LAST_TOOL
18374
(* DMUS_S_LAST_TOOL
18371
 *
18375
 *
18372
 * Returned from IDirectMusicGraph::StampPMsg(), this indicates that the PMsg
18376
 * Returned from IDirectMusicGraph::StampPMsg(), this indicates that the PMsg
18373
 * is already stamped with the last tool in the graph. The returned PMsg's
18377
 * is already stamped with the last tool in the graph. The returned PMsg's
18374
 * tool pointer is now NULL.
18378
 * tool pointer is now NULL.
18375
 *)
18379
 *)
18376
  DMUS_S_LAST_TOOL                 = MAKE_DMHRESULTSUCCESS + $211;
18380
  DMUS_S_LAST_TOOL                 = MAKE_DMHRESULTSUCCESS + $211;
18377
 
18381
 
18378
(* DMUS_S_OVER_CHORD
18382
(* DMUS_S_OVER_CHORD
18379
 *
18383
 *
18380
 * Returned from IDirectMusicPerformance::MusicToMIDI(), this indicates
18384
 * Returned from IDirectMusicPerformance::MusicToMIDI(), this indicates
18381
 * that no note has been calculated because the music value has the note
18385
 * that no note has been calculated because the music value has the note
18382
 * at a position higher than the top note of the chord. This applies only
18386
 * at a position higher than the top note of the chord. This applies only
18383
 * to DMUS_PLAYMODE_NORMALCHORD play mode. This success code indicates
18387
 * to DMUS_PLAYMODE_NORMALCHORD play mode. This success code indicates
18384
 * that the caller should not do anything with the note. It is not meant
18388
 * that the caller should not do anything with the note. It is not meant
18385
 * to be played against this chord.
18389
 * to be played against this chord.
18386
 *)
18390
 *)
18387
  DMUS_S_OVER_CHORD                = MAKE_DMHRESULTSUCCESS + $212;
18391
  DMUS_S_OVER_CHORD                = MAKE_DMHRESULTSUCCESS + $212;
18388
 
18392
 
18389
(* DMUS_S_UP_OCTAVE
18393
(* DMUS_S_UP_OCTAVE
18390
 *
18394
 *
18391
 * Returned from IDirectMusicPerformance::MIDIToMusic(),  and
18395
 * Returned from IDirectMusicPerformance::MIDIToMusic(),  and
18392
 * IDirectMusicPerformance::MusicToMIDI(), this indicates
18396
 * IDirectMusicPerformance::MusicToMIDI(), this indicates
18393
 * that the note conversion generated a note value that is below 0,
18397
 * that the note conversion generated a note value that is below 0,
18394
 * so it has been bumped up one or more octaves to be in the proper
18398
 * so it has been bumped up one or more octaves to be in the proper
18395
 * MIDI range of 0 through 127.
18399
 * MIDI range of 0 through 127.
18396
 * Note that this is valid for MIDIToMusic() when using play modes
18400
 * Note that this is valid for MIDIToMusic() when using play modes
18397
 * DMUS_PLAYMODE_FIXEDTOCHORD and DMUS_PLAYMODE_FIXEDTOKEY, both of
18401
 * DMUS_PLAYMODE_FIXEDTOCHORD and DMUS_PLAYMODE_FIXEDTOKEY, both of
18398
 * which store MIDI values in wMusicValue. With MusicToMIDI(), it is
18402
 * which store MIDI values in wMusicValue. With MusicToMIDI(), it is
18399
 * valid for all play modes.
18403
 * valid for all play modes.
18400
 * Ofcourse, DMUS_PLAYMODE_FIXED will never return this success code.
18404
 * Ofcourse, DMUS_PLAYMODE_FIXED will never return this success code.
18401
 *)
18405
 *)
18402
  DMUS_S_UP_OCTAVE                 = MAKE_DMHRESULTSUCCESS + $213;
18406
  DMUS_S_UP_OCTAVE                 = MAKE_DMHRESULTSUCCESS + $213;
18403
 
18407
 
18404
(* DMUS_S_DOWN_OCTAVE
18408
(* DMUS_S_DOWN_OCTAVE
18405
 *
18409
 *
18406
 * Returned from IDirectMusicPerformance::MIDIToMusic(),  and
18410
 * Returned from IDirectMusicPerformance::MIDIToMusic(),  and
18407
 * IDirectMusicPerformance::MusicToMIDI(), this indicates
18411
 * IDirectMusicPerformance::MusicToMIDI(), this indicates
18408
 * that the note conversion generated a note value that is above 127,
18412
 * that the note conversion generated a note value that is above 127,
18409
 * so it has been bumped down one or more octaves to be in the proper
18413
 * so it has been bumped down one or more octaves to be in the proper
18410
 * MIDI range of 0 through 127.
18414
 * MIDI range of 0 through 127.
18411
 * Note that this is valid for MIDIToMusic() when using play modes
18415
 * Note that this is valid for MIDIToMusic() when using play modes
18412
 * DMUS_PLAYMODE_FIXEDTOCHORD and DMUS_PLAYMODE_FIXEDTOKEY, both of
18416
 * DMUS_PLAYMODE_FIXEDTOCHORD and DMUS_PLAYMODE_FIXEDTOKEY, both of
18413
 * which store MIDI values in wMusicValue. With MusicToMIDI(), it is
18417
 * which store MIDI values in wMusicValue. With MusicToMIDI(), it is
18414
 * valid for all play modes.
18418
 * valid for all play modes.
18415
 * Ofcourse, DMUS_PLAYMODE_FIXED will never return this success code.
18419
 * Ofcourse, DMUS_PLAYMODE_FIXED will never return this success code.
18416
 *)
18420
 *)
18417
  DMUS_S_DOWN_OCTAVE               = MAKE_DMHRESULTSUCCESS + $214;
18421
  DMUS_S_DOWN_OCTAVE               = MAKE_DMHRESULTSUCCESS + $214;
18418
 
18422
 
18419
(* DMUS_S_NOBUFFERCONTROL
18423
(* DMUS_S_NOBUFFERCONTROL
18420
 *
18424
 *
18421
 * Although the audio output from the port will be routed to the
18425
 * Although the audio output from the port will be routed to the
18422
 * same device as the given DirectSound buffer, buffer controls
18426
 * same device as the given DirectSound buffer, buffer controls
18423
 * such as pan and volume will not affect the output.
18427
 * such as pan and volume will not affect the output.
18424
 *
18428
 *
18425
 *)
18429
 *)
18426
  DMUS_S_NOBUFFERCONTROL          = MAKE_DMHRESULTSUCCESS + $215;
18430
  DMUS_S_NOBUFFERCONTROL          = MAKE_DMHRESULTSUCCESS + $215;
18427
 
18431
 
18428
(* DMUS_E_DRIVER_FAILED
18432
(* DMUS_E_DRIVER_FAILED
18429
 *
18433
 *
18430
 * An unexpected error was returned from a device driver, indicating
18434
 * An unexpected error was returned from a device driver, indicating
18431
 * possible failure of the driver or hardware.
18435
 * possible failure of the driver or hardware.
18432
 *)
18436
 *)
18433
  DMUS_E_DRIVER_FAILED            = MAKE_DMHRESULTERROR + $0101;
18437
  DMUS_E_DRIVER_FAILED            = MAKE_DMHRESULTERROR + $0101;
18434
 
18438
 
18435
(* DMUS_E_PORTS_OPEN
18439
(* DMUS_E_PORTS_OPEN
18436
 *
18440
 *
18437
 * The requested operation cannot be performed while there are
18441
 * The requested operation cannot be performed while there are
18438
 * instantiated ports in any process in the system.
18442
 * instantiated ports in any process in the system.
18439
 *)
18443
 *)
18440
  DMUS_E_PORTS_OPEN               = MAKE_DMHRESULTERROR + $0102;
18444
  DMUS_E_PORTS_OPEN               = MAKE_DMHRESULTERROR + $0102;
18441
 
18445
 
18442
(* DMUS_E_DEVICE_IN_USE
18446
(* DMUS_E_DEVICE_IN_USE
18443
 *
18447
 *
18444
 * The requested device is already in use (possibly by a non-DirectMusic
18448
 * The requested device is already in use (possibly by a non-DirectMusic
18445
 * client) and cannot be opened again.
18449
 * client) and cannot be opened again.
18446
 *)
18450
 *)
18447
  DMUS_E_DEVICE_IN_USE            = MAKE_DMHRESULTERROR + $0103;
18451
  DMUS_E_DEVICE_IN_USE            = MAKE_DMHRESULTERROR + $0103;
18448
 
18452
 
18449
(* DMUS_E_INSUFFICIENTBUFFER
18453
(* DMUS_E_INSUFFICIENTBUFFER
18450
 *
18454
 *
18451
 * Buffer is not large enough for requested operation.
18455
 * Buffer is not large enough for requested operation.
18452
 *)
18456
 *)
18453
  DMUS_E_INSUFFICIENTBUFFER       = MAKE_DMHRESULTERROR + $0104;
18457
  DMUS_E_INSUFFICIENTBUFFER       = MAKE_DMHRESULTERROR + $0104;
18454
 
18458
 
18455
(* DMUS_E_BUFFERNOTSET
18459
(* DMUS_E_BUFFERNOTSET
18456
 *
18460
 *
18457
 * No buffer was prepared for the download data.
18461
 * No buffer was prepared for the download data.
18458
 *)
18462
 *)
18459
  DMUS_E_BUFFERNOTSET             = MAKE_DMHRESULTERROR + $0105;
18463
  DMUS_E_BUFFERNOTSET             = MAKE_DMHRESULTERROR + $0105;
18460
 
18464
 
18461
(* DMUS_E_BUFFERNOTAVAILABLE
18465
(* DMUS_E_BUFFERNOTAVAILABLE
18462
 *
18466
 *
18463
 * Download failed due to inability to access or create download buffer.
18467
 * Download failed due to inability to access or create download buffer.
18464
 *)
18468
 *)
18465
  DMUS_E_BUFFERNOTAVAILABLE       = MAKE_DMHRESULTERROR + $0106;
18469
  DMUS_E_BUFFERNOTAVAILABLE       = MAKE_DMHRESULTERROR + $0106;
18466
 
18470
 
18467
(* DMUS_E_NOTADLSCOL
18471
(* DMUS_E_NOTADLSCOL
18468
 *
18472
 *
18469
 * Error parsing DLS collection. File is corrupt.
18473
 * Error parsing DLS collection. File is corrupt.
18470
 *)
18474
 *)
18471
  DMUS_E_NOTADLSCOL               = MAKE_DMHRESULTERROR + $0108;
18475
  DMUS_E_NOTADLSCOL               = MAKE_DMHRESULTERROR + $0108;
18472
 
18476
 
18473
(* DMUS_E_INVALIDOFFSET
18477
(* DMUS_E_INVALIDOFFSET
18474
 *
18478
 *
18475
 * Wave chunks in DLS collection file are at incorrect offsets.
18479
 * Wave chunks in DLS collection file are at incorrect offsets.
18476
 *)
18480
 *)
18477
  DMUS_E_INVALIDOFFSET            = MAKE_DMHRESULTERROR + $0109;
18481
  DMUS_E_INVALIDOFFSET            = MAKE_DMHRESULTERROR + $0109;
18478
 
18482
 
18479
(* DMUS_E_ALREADY_LOADED
18483
(* DMUS_E_ALREADY_LOADED
18480
 *
18484
 *
18481
 * Second attempt to load a DLS collection that is currently open.
18485
 * Second attempt to load a DLS collection that is currently open.
18482
 *)
18486
 *)
18483
  DMUS_E_ALREADY_LOADED           = MAKE_DMHRESULTERROR + $0111;
18487
  DMUS_E_ALREADY_LOADED           = MAKE_DMHRESULTERROR + $0111;
18484
 
18488
 
18485
(* DMUS_E_INVALIDPOS
18489
(* DMUS_E_INVALIDPOS
18486
 *
18490
 *
18487
 * Error reading wave data from DLS collection. Indicates bad file.
18491
 * Error reading wave data from DLS collection. Indicates bad file.
18488
 *)
18492
 *)
18489
  DMUS_E_INVALIDPOS               = MAKE_DMHRESULTERROR + $0113;
18493
  DMUS_E_INVALIDPOS               = MAKE_DMHRESULTERROR + $0113;
18490
 
18494
 
18491
(* DMUS_E_INVALIDPATCH
18495
(* DMUS_E_INVALIDPATCH
18492
 *
18496
 *
18493
 * There is no instrument in the collection that matches patch number.
18497
 * There is no instrument in the collection that matches patch number.
18494
 *)
18498
 *)
18495
  DMUS_E_INVALIDPATCH             = MAKE_DMHRESULTERROR + $0114;
18499
  DMUS_E_INVALIDPATCH             = MAKE_DMHRESULTERROR + $0114;
18496
 
18500
 
18497
(* DMUS_E_CANNOTSEEK
18501
(* DMUS_E_CANNOTSEEK
18498
 *
18502
 *
18499
 * The IStream* doesn't support Seek().
18503
 * The IStream* doesn't support Seek().
18500
 *)
18504
 *)
18501
  DMUS_E_CANNOTSEEK               = MAKE_DMHRESULTERROR + $0115;
18505
  DMUS_E_CANNOTSEEK               = MAKE_DMHRESULTERROR + $0115;
18502
 
18506
 
18503
(* DMUS_E_CANNOTWRITE
18507
(* DMUS_E_CANNOTWRITE
18504
 *
18508
 *
18505
 * The IStream* doesn't support Write().
18509
 * The IStream* doesn't support Write().
18506
 *)
18510
 *)
18507
  DMUS_E_CANNOTWRITE              = MAKE_DMHRESULTERROR + $0116;
18511
  DMUS_E_CANNOTWRITE              = MAKE_DMHRESULTERROR + $0116;
18508
 
18512
 
18509
(* DMUS_E_CHUNKNOTFOUND
18513
(* DMUS_E_CHUNKNOTFOUND
18510
 *
18514
 *
18511
 * The RIFF parser doesn't contain a required chunk while parsing file.
18515
 * The RIFF parser doesn't contain a required chunk while parsing file.
18512
 *)
18516
 *)
18513
  DMUS_E_CHUNKNOTFOUND            = MAKE_DMHRESULTERROR + $0117;
18517
  DMUS_E_CHUNKNOTFOUND            = MAKE_DMHRESULTERROR + $0117;
18514
 
18518
 
18515
(* DMUS_E_INVALID_DOWNLOADID
18519
(* DMUS_E_INVALID_DOWNLOADID
18516
 *
18520
 *
18517
 * Invalid download id was used in the process of creating a download buffer.
18521
 * Invalid download id was used in the process of creating a download buffer.
18518
 *)
18522
 *)
18519
  DMUS_E_INVALID_DOWNLOADID       = MAKE_DMHRESULTERROR + $0119;
18523
  DMUS_E_INVALID_DOWNLOADID       = MAKE_DMHRESULTERROR + $0119;
18520
 
18524
 
18521
(* DMUS_E_NOT_DOWNLOADED_TO_PORT
18525
(* DMUS_E_NOT_DOWNLOADED_TO_PORT
18522
 *
18526
 *
18523
 * Tried to unload an object that was not downloaded or previously unloaded.
18527
 * Tried to unload an object that was not downloaded or previously unloaded.
18524
 *)
18528
 *)
18525
  DMUS_E_NOT_DOWNLOADED_TO_PORT   = MAKE_DMHRESULTERROR + $0120;
18529
  DMUS_E_NOT_DOWNLOADED_TO_PORT   = MAKE_DMHRESULTERROR + $0120;
18526
 
18530
 
18527
(* DMUS_E_ALREADY_DOWNLOADED
18531
(* DMUS_E_ALREADY_DOWNLOADED
18528
 *
18532
 *
18529
 * Buffer was already downloaded to synth.
18533
 * Buffer was already downloaded to synth.
18530
 *)
18534
 *)
18531
  DMUS_E_ALREADY_DOWNLOADED       = MAKE_DMHRESULTERROR + $0121;
18535
  DMUS_E_ALREADY_DOWNLOADED       = MAKE_DMHRESULTERROR + $0121;
18532
 
18536
 
18533
(* DMUS_E_UNKNOWN_PROPERTY
18537
(* DMUS_E_UNKNOWN_PROPERTY
18534
 *
18538
 *
18535
 * The specified property item was not recognized by the target object.
18539
 * The specified property item was not recognized by the target object.
18536
 *)
18540
 *)
18537
  DMUS_E_UNKNOWN_PROPERTY         = MAKE_DMHRESULTERROR + $0122;
18541
  DMUS_E_UNKNOWN_PROPERTY         = MAKE_DMHRESULTERROR + $0122;
18538
 
18542
 
18539
(* DMUS_E_SET_UNSUPPORTED
18543
(* DMUS_E_SET_UNSUPPORTED
18540
 *
18544
 *
18541
 * The specified property item may not be set on the target object.
18545
 * The specified property item may not be set on the target object.
18542
 *)
18546
 *)
18543
  DMUS_E_SET_UNSUPPORTED          = MAKE_DMHRESULTERROR + $0123;
18547
  DMUS_E_SET_UNSUPPORTED          = MAKE_DMHRESULTERROR + $0123;
18544
 
18548
 
18545
(* DMUS_E_GET_UNSUPPORTED
18549
(* DMUS_E_GET_UNSUPPORTED
18546
 *
18550
 *
18547
 * The specified property item may not be retrieved from the target object.
18551
 * The specified property item may not be retrieved from the target object.
18548
 *)
18552
 *)
18549
  DMUS_E_GET_UNSUPPORTED          = MAKE_DMHRESULTERROR + $0124;
18553
  DMUS_E_GET_UNSUPPORTED          = MAKE_DMHRESULTERROR + $0124;
18550
 
18554
 
18551
(* DMUS_E_NOTMONO
18555
(* DMUS_E_NOTMONO
18552
 *
18556
 *
18553
 * Wave chunk has more than one interleaved channel. DLS format requires MONO.
18557
 * Wave chunk has more than one interleaved channel. DLS format requires MONO.
18554
 *)
18558
 *)
18555
  DMUS_E_NOTMONO                  = MAKE_DMHRESULTERROR + $0125;
18559
  DMUS_E_NOTMONO                  = MAKE_DMHRESULTERROR + $0125;
18556
 
18560
 
18557
(* DMUS_E_BADARTICULATION
18561
(* DMUS_E_BADARTICULATION
18558
 *
18562
 *
18559
 * Invalid articulation chunk in DLS collection.
18563
 * Invalid articulation chunk in DLS collection.
18560
 *)
18564
 *)
18561
  DMUS_E_BADARTICULATION          = MAKE_DMHRESULTERROR + $0126;
18565
  DMUS_E_BADARTICULATION          = MAKE_DMHRESULTERROR + $0126;
18562
 
18566
 
18563
(* DMUS_E_BADINSTRUMENT
18567
(* DMUS_E_BADINSTRUMENT
18564
 *
18568
 *
18565
 * Invalid instrument chunk in DLS collection.
18569
 * Invalid instrument chunk in DLS collection.
18566
 *)
18570
 *)
18567
  DMUS_E_BADINSTRUMENT            = MAKE_DMHRESULTERROR + $0127;
18571
  DMUS_E_BADINSTRUMENT            = MAKE_DMHRESULTERROR + $0127;
18568
 
18572
 
18569
(* DMUS_E_BADWAVELINK
18573
(* DMUS_E_BADWAVELINK
18570
 *
18574
 *
18571
 * Wavelink chunk in DLS collection points to invalid wave.
18575
 * Wavelink chunk in DLS collection points to invalid wave.
18572
 *)
18576
 *)
18573
  DMUS_E_BADWAVELINK              = MAKE_DMHRESULTERROR + $0128;
18577
  DMUS_E_BADWAVELINK              = MAKE_DMHRESULTERROR + $0128;
18574
 
18578
 
18575
(* DMUS_E_NOARTICULATION
18579
(* DMUS_E_NOARTICULATION
18576
 *
18580
 *
18577
 * Articulation missing from instrument in DLS collection.
18581
 * Articulation missing from instrument in DLS collection.
18578
 *)
18582
 *)
18579
  DMUS_E_NOARTICULATION           = MAKE_DMHRESULTERROR + $0129;
18583
  DMUS_E_NOARTICULATION           = MAKE_DMHRESULTERROR + $0129;
18580
 
18584
 
18581
(* DMUS_E_NOTPCM
18585
(* DMUS_E_NOTPCM
18582
 *
18586
 *
18583
 * Downoaded DLS wave is not in PCM format.
18587
 * Downoaded DLS wave is not in PCM format.
18584
*)
18588
*)
18585
  DMUS_E_NOTPCM                   = MAKE_DMHRESULTERROR + $012A;
18589
  DMUS_E_NOTPCM                   = MAKE_DMHRESULTERROR + $012A;
18586
 
18590
 
18587
(* DMUS_E_BADWAVE
18591
(* DMUS_E_BADWAVE
18588
 *
18592
 *
18589
 * Bad wave chunk in DLS collection
18593
 * Bad wave chunk in DLS collection
18590
 *)
18594
 *)
18591
  DMUS_E_BADWAVE                  = MAKE_DMHRESULTERROR + $012B;
18595
  DMUS_E_BADWAVE                  = MAKE_DMHRESULTERROR + $012B;
18592
 
18596
 
18593
(* DMUS_E_BADOFFSETTABLE
18597
(* DMUS_E_BADOFFSETTABLE
18594
 *
18598
 *
18595
 * Offset Table for download buffer has errors.
18599
 * Offset Table for download buffer has errors.
18596
 *)
18600
 *)
18597
  DMUS_E_BADOFFSETTABLE           = MAKE_DMHRESULTERROR + $012C;
18601
  DMUS_E_BADOFFSETTABLE           = MAKE_DMHRESULTERROR + $012C;
18598
 
18602
 
18599
(* DMUS_E_UNKNOWNDOWNLOAD
18603
(* DMUS_E_UNKNOWNDOWNLOAD
18600
 *
18604
 *
18601
 * Attempted to download unknown data type.
18605
 * Attempted to download unknown data type.
18602
 *)
18606
 *)
18603
  DMUS_E_UNKNOWNDOWNLOAD          = MAKE_DMHRESULTERROR + $012D;
18607
  DMUS_E_UNKNOWNDOWNLOAD          = MAKE_DMHRESULTERROR + $012D;
18604
 
18608
 
18605
(* DMUS_E_NOSYNTHSINK
18609
(* DMUS_E_NOSYNTHSINK
18606
 *
18610
 *
18607
 * The operation could not be completed because no sink was connected to
18611
 * The operation could not be completed because no sink was connected to
18608
 * the synthesizer.
18612
 * the synthesizer.
18609
 *)
18613
 *)
18610
  DMUS_E_NOSYNTHSINK              = MAKE_DMHRESULTERROR + $012E;
18614
  DMUS_E_NOSYNTHSINK              = MAKE_DMHRESULTERROR + $012E;
18611
 
18615
 
18612
(* DMUS_E_ALREADYOPEN
18616
(* DMUS_E_ALREADYOPEN
18613
 *
18617
 *
18614
 * An attempt was made to open the software synthesizer while it was already
18618
 * An attempt was made to open the software synthesizer while it was already
18615
 * open.
18619
 * open.
18616
 * ASSERT?
18620
 * ASSERT?
18617
 *)
18621
 *)
18618
  DMUS_E_ALREADYOPEN              = MAKE_DMHRESULTERROR + $012F;
18622
  DMUS_E_ALREADYOPEN              = MAKE_DMHRESULTERROR + $012F;
18619
 
18623
 
18620
(* DMUS_E_ALREADYCLOSE
18624
(* DMUS_E_ALREADYCLOSE
18621
 *
18625
 *
18622
 * An attempt was made to close the software synthesizer while it was already
18626
 * An attempt was made to close the software synthesizer while it was already
18623
 * open.
18627
 * open.
18624
 * ASSERT?
18628
 * ASSERT?
18625
 *)
18629
 *)
18626
  DMUS_E_ALREADYCLOSED            = MAKE_DMHRESULTERROR + $0130;
18630
  DMUS_E_ALREADYCLOSED            = MAKE_DMHRESULTERROR + $0130;
18627
 
18631
 
18628
(* DMUS_E_SYNTHNOTCONFIGURED
18632
(* DMUS_E_SYNTHNOTCONFIGURED
18629
 *
18633
 *
18630
 * The operation could not be completed because the software synth has not
18634
 * The operation could not be completed because the software synth has not
18631
 * yet been fully configured.
18635
 * yet been fully configured.
18632
 * ASSERT?
18636
 * ASSERT?
18633
 *)
18637
 *)
18634
  DMUS_E_SYNTHNOTCONFIGURED       = MAKE_DMHRESULTERROR + $0131;
18638
  DMUS_E_SYNTHNOTCONFIGURED       = MAKE_DMHRESULTERROR + $0131;
18635
 
18639
 
18636
(* DMUS_E_SYNTHACTIVE
18640
(* DMUS_E_SYNTHACTIVE
18637
 *
18641
 *
18638
 * The operation cannot be carried out while the synthesizer is active.
18642
 * The operation cannot be carried out while the synthesizer is active.
18639
 *)
18643
 *)
18640
  DMUS_E_SYNTHACTIVE              = MAKE_DMHRESULTERROR + $0132;
18644
  DMUS_E_SYNTHACTIVE              = MAKE_DMHRESULTERROR + $0132;
18641
 
18645
 
18642
(* DMUS_E_CANNOTREAD
18646
(* DMUS_E_CANNOTREAD
18643
 *
18647
 *
18644
 * An error occurred while attempting to read from the IStream* object.
18648
 * An error occurred while attempting to read from the IStream* object.
18645
 *)
18649
 *)
18646
  DMUS_E_CANNOTREAD               = MAKE_DMHRESULTERROR + $0133;
18650
  DMUS_E_CANNOTREAD               = MAKE_DMHRESULTERROR + $0133;
18647
 
18651
 
18648
(* DMUS_E_DMUSIC_RELEASED
18652
(* DMUS_E_DMUSIC_RELEASED
18649
 *
18653
 *
18650
 * The operation cannot be performed because the final instance of the
18654
 * The operation cannot be performed because the final instance of the
18651
 * DirectMusic object was released. Ports cannot be used after final
18655
 * DirectMusic object was released. Ports cannot be used after final
18652
 * release of the DirectMusic object.
18656
 * release of the DirectMusic object.
18653
 *)
18657
 *)
18654
  DMUS_E_DMUSIC_RELEASED          = MAKE_DMHRESULTERROR + $0134;
18658
  DMUS_E_DMUSIC_RELEASED          = MAKE_DMHRESULTERROR + $0134;
18655
 
18659
 
18656
(* DMUS_E_BUFFER_EMPTY
18660
(* DMUS_E_BUFFER_EMPTY
18657
 *
18661
 *
18658
 * There was no data in the referenced buffer.
18662
 * There was no data in the referenced buffer.
18659
 *)
18663
 *)
18660
  DMUS_E_BUFFER_EMPTY             = MAKE_DMHRESULTERROR + $0135;
18664
  DMUS_E_BUFFER_EMPTY             = MAKE_DMHRESULTERROR + $0135;
18661
 
18665
 
18662
(* DMUS_E_BUFFER_FULL
18666
(* DMUS_E_BUFFER_FULL
18663
 *
18667
 *
18664
 * There is insufficient space to insert the given event into the buffer.
18668
 * There is insufficient space to insert the given event into the buffer.
18665
 *)
18669
 *)
18666
  DMUS_E_BUFFER_FULL              = MAKE_DMHRESULTERROR + $0136;
18670
  DMUS_E_BUFFER_FULL              = MAKE_DMHRESULTERROR + $0136;
18667
 
18671
 
18668
(* DMUS_E_PORT_NOT_CAPTURE
18672
(* DMUS_E_PORT_NOT_CAPTURE
18669
 *
18673
 *
18670
 * The given operation could not be carried out because the port is a
18674
 * The given operation could not be carried out because the port is a
18671
 * capture port.
18675
 * capture port.
18672
 *)
18676
 *)
18673
  DMUS_E_PORT_NOT_CAPTURE         = MAKE_DMHRESULTERROR + $0137;
18677
  DMUS_E_PORT_NOT_CAPTURE         = MAKE_DMHRESULTERROR + $0137;
18674
 
18678
 
18675
(* DMUS_E_PORT_NOT_RENDER
18679
(* DMUS_E_PORT_NOT_RENDER
18676
 *
18680
 *
18677
 * The given operation could not be carried out because the port is a
18681
 * The given operation could not be carried out because the port is a
18678
 * render port.
18682
 * render port.
18679
 *)
18683
 *)
18680
  DMUS_E_PORT_NOT_RENDER          = MAKE_DMHRESULTERROR + $0138;
18684
  DMUS_E_PORT_NOT_RENDER          = MAKE_DMHRESULTERROR + $0138;
18681
 
18685
 
18682
(* DMUS_E_DSOUND_NOT_SET
18686
(* DMUS_E_DSOUND_NOT_SET
18683
 *
18687
 *
18684
 * The port could not be created because no DirectSound has been specified.
18688
 * The port could not be created because no DirectSound has been specified.
18685
 * Specify a DirectSound interface via the IDirectMusic::SetDirectSound
18689
 * Specify a DirectSound interface via the IDirectMusic::SetDirectSound
18686
 * method; pass NULL to have DirectMusic manage usage of DirectSound.
18690
 * method; pass NULL to have DirectMusic manage usage of DirectSound.
18687
 *)
18691
 *)
18688
  DMUS_E_DSOUND_NOT_SET           = MAKE_DMHRESULTERROR + $0139;
18692
  DMUS_E_DSOUND_NOT_SET           = MAKE_DMHRESULTERROR + $0139;
18689
 
18693
 
18690
(* DMUS_E_ALREADY_ACTIVATED
18694
(* DMUS_E_ALREADY_ACTIVATED
18691
 *
18695
 *
18692
 * The operation cannot be carried out while the port is active.
18696
 * The operation cannot be carried out while the port is active.
18693
 *)
18697
 *)
18694
  DMUS_E_ALREADY_ACTIVATED        = MAKE_DMHRESULTERROR + $013A;
18698
  DMUS_E_ALREADY_ACTIVATED        = MAKE_DMHRESULTERROR + $013A;
18695
 
18699
 
18696
(* DMUS_E_INVALIDBUFFER
18700
(* DMUS_E_INVALIDBUFFER
18697
 *
18701
 *
18698
 * Invalid DirectSound buffer was handed to port.
18702
 * Invalid DirectSound buffer was handed to port.
18699
 *)
18703
 *)
18700
  DMUS_E_INVALIDBUFFER            = MAKE_DMHRESULTERROR + $013B;
18704
  DMUS_E_INVALIDBUFFER            = MAKE_DMHRESULTERROR + $013B;
18701
 
18705
 
18702
(* DMUS_E_WAVEFORMATNOTSUPPORTED
18706
(* DMUS_E_WAVEFORMATNOTSUPPORTED
18703
 *
18707
 *
18704
 * Invalid buffer format was handed to the synth sink.
18708
 * Invalid buffer format was handed to the synth sink.
18705
 *)
18709
 *)
18706
  DMUS_E_WAVEFORMATNOTSUPPORTED   = MAKE_DMHRESULTERROR + $013C;
18710
  DMUS_E_WAVEFORMATNOTSUPPORTED   = MAKE_DMHRESULTERROR + $013C;
18707
 
18711
 
18708
(* DMUS_E_SYNTHINACTIVE
18712
(* DMUS_E_SYNTHINACTIVE
18709
 *
18713
 *
18710
 * The operation cannot be carried out while the synthesizer is inactive.
18714
 * The operation cannot be carried out while the synthesizer is inactive.
18711
 *)
18715
 *)
18712
  DMUS_E_SYNTHINACTIVE            = MAKE_DMHRESULTERROR + $013D;
18716
  DMUS_E_SYNTHINACTIVE            = MAKE_DMHRESULTERROR + $013D;
18713
 
18717
 
18714
(* DMUS_E_DSOUND_ALREADY_SET
18718
(* DMUS_E_DSOUND_ALREADY_SET
18715
 *
18719
 *
18716
 * IDirectMusic::SetDirectSound has already been called. It may not be
18720
 * IDirectMusic::SetDirectSound has already been called. It may not be
18717
 * changed while in use.
18721
 * changed while in use.
18718
 *)
18722
 *)
18719
  DMUS_E_DSOUND_ALREADY_SET       = MAKE_DMHRESULTERROR + $013E;
18723
  DMUS_E_DSOUND_ALREADY_SET       = MAKE_DMHRESULTERROR + $013E;
18720
 
18724
 
18721
(* DMUS_E_INVALID_EVENT
18725
(* DMUS_E_INVALID_EVENT
18722
 *
18726
 *
18723
 * The given event is invalid (either it is not a valid MIDI message
18727
 * The given event is invalid (either it is not a valid MIDI message
18724
 * or it makes use of running status). The event cannot be packed
18728
 * or it makes use of running status). The event cannot be packed
18725
 * into the buffer.
18729
 * into the buffer.
18726
 *)
18730
 *)
18727
  DMUS_E_INVALID_EVENT            = MAKE_DMHRESULTERROR + $013F;
18731
  DMUS_E_INVALID_EVENT            = MAKE_DMHRESULTERROR + $013F;
18728
 
18732
 
18729
(* DMUS_E_UNSUPPORTED_STREAM
18733
(* DMUS_E_UNSUPPORTED_STREAM
18730
 *
18734
 *
18731
 * The IStream* object does not contain data supported by the loading object.
18735
 * The IStream* object does not contain data supported by the loading object.
18732
 *)
18736
 *)
18733
  DMUS_E_UNSUPPORTED_STREAM       = MAKE_DMHRESULTERROR + $0150;
18737
  DMUS_E_UNSUPPORTED_STREAM       = MAKE_DMHRESULTERROR + $0150;
18734
 
18738
 
18735
(* DMUS_E_ALREADY_INITED
18739
(* DMUS_E_ALREADY_INITED
18736
 *
18740
 *
18737
 * The object has already been initialized.
18741
 * The object has already been initialized.
18738
 *)
18742
 *)
18739
  DMUS_E_ALREADY_INITED           = MAKE_DMHRESULTERROR + $0151;
18743
  DMUS_E_ALREADY_INITED           = MAKE_DMHRESULTERROR + $0151;
18740
 
18744
 
18741
(* DMUS_E_INVALID_BAND
18745
(* DMUS_E_INVALID_BAND
18742
 *
18746
 *
18743
 * The file does not contain a valid band.
18747
 * The file does not contain a valid band.
18744
 *)
18748
 *)
18745
  DMUS_E_INVALID_BAND             = MAKE_DMHRESULTERROR + $0152;
18749
  DMUS_E_INVALID_BAND             = MAKE_DMHRESULTERROR + $0152;
18746
 
18750
 
18747
(* DMUS_E_TRACK_HDR_NOT_FIRST_CK
18751
(* DMUS_E_TRACK_HDR_NOT_FIRST_CK
18748
 *
18752
 *
18749
 * The IStream* object's data does not have a track header as the first chunk,
18753
 * The IStream* object's data does not have a track header as the first chunk,
18750
 * and therefore can not be read by the segment object.
18754
 * and therefore can not be read by the segment object.
18751
 *)
18755
 *)
18752
  DMUS_E_TRACK_HDR_NOT_FIRST_CK   = MAKE_DMHRESULTERROR + $0155;
18756
  DMUS_E_TRACK_HDR_NOT_FIRST_CK   = MAKE_DMHRESULTERROR + $0155;
18753
 
18757
 
18754
(* DMUS_E_TOOL_HDR_NOT_FIRST_CK
18758
(* DMUS_E_TOOL_HDR_NOT_FIRST_CK
18755
 *
18759
 *
18756
 * The IStream* object's data does not have a tool header as the first chunk,
18760
 * The IStream* object's data does not have a tool header as the first chunk,
18757
 * and therefore can not be read by the graph object.
18761
 * and therefore can not be read by the graph object.
18758
 *)
18762
 *)
18759
  DMUS_E_TOOL_HDR_NOT_FIRST_CK    = MAKE_DMHRESULTERROR + $0156;
18763
  DMUS_E_TOOL_HDR_NOT_FIRST_CK    = MAKE_DMHRESULTERROR + $0156;
18760
 
18764
 
18761
(* DMUS_E_INVALID_TRACK_HDR
18765
(* DMUS_E_INVALID_TRACK_HDR
18762
 *
18766
 *
18763
 * The IStream* object's data contains an invalid track header (ckid is 0 and
18767
 * The IStream* object's data contains an invalid track header (ckid is 0 and
18764
 * fccType is NULL,) and therefore can not be read by the segment object.
18768
 * fccType is NULL,) and therefore can not be read by the segment object.
18765
 *)
18769
 *)
18766
  DMUS_E_INVALID_TRACK_HDR        = MAKE_DMHRESULTERROR + $0157;
18770
  DMUS_E_INVALID_TRACK_HDR        = MAKE_DMHRESULTERROR + $0157;
18767
 
18771
 
18768
(* DMUS_E_INVALID_TOOL_HDR
18772
(* DMUS_E_INVALID_TOOL_HDR
18769
 *
18773
 *
18770
 * The IStream* object's data contains an invalid tool header (ckid is 0 and
18774
 * The IStream* object's data contains an invalid tool header (ckid is 0 and
18771
 * fccType is NULL,) and therefore can not be read by the graph object.
18775
 * fccType is NULL,) and therefore can not be read by the graph object.
18772
 *)
18776
 *)
18773
  DMUS_E_INVALID_TOOL_HDR         = MAKE_DMHRESULTERROR + $0158;
18777
  DMUS_E_INVALID_TOOL_HDR         = MAKE_DMHRESULTERROR + $0158;
18774
 
18778
 
18775
(* DMUS_E_ALL_TOOLS_FAILED
18779
(* DMUS_E_ALL_TOOLS_FAILED
18776
 *
18780
 *
18777
 * The graph object was unable to load all tools from the IStream* object data.
18781
 * The graph object was unable to load all tools from the IStream* object data.
18778
 * This may be due to errors in the stream, or the tools being incorrectly
18782
 * This may be due to errors in the stream, or the tools being incorrectly
18779
 * registered on the client.
18783
 * registered on the client.
18780
 *)
18784
 *)
18781
  DMUS_E_ALL_TOOLS_FAILED         = MAKE_DMHRESULTERROR + $0159;
18785
  DMUS_E_ALL_TOOLS_FAILED         = MAKE_DMHRESULTERROR + $0159;
18782
 
18786
 
18783
(* DMUS_E_ALL_TRACKS_FAILED
18787
(* DMUS_E_ALL_TRACKS_FAILED
18784
 *
18788
 *
18785
 * The segment object was unable to load all tracks from the IStream* object data.
18789
 * The segment object was unable to load all tracks from the IStream* object data.
18786
 * This may be due to errors in the stream, or the tracks being incorrectly
18790
 * This may be due to errors in the stream, or the tracks being incorrectly
18787
 * registered on the client.
18791
 * registered on the client.
18788
 *)
18792
 *)
18789
  DMUS_E_ALL_TRACKS_FAILED        = MAKE_DMHRESULTERROR + $0160;
18793
  DMUS_E_ALL_TRACKS_FAILED        = MAKE_DMHRESULTERROR + $0160;
18790
 
18794
 
18791
(* DMUS_E_NOT_FOUND
18795
(* DMUS_E_NOT_FOUND
18792
 *
18796
 *
18793
 * The requested item was not contained by the object.
18797
 * The requested item was not contained by the object.
18794
 *)
18798
 *)
18795
  DMUS_E_NOT_FOUND                = MAKE_DMHRESULTERROR + $0161;
18799
  DMUS_E_NOT_FOUND                = MAKE_DMHRESULTERROR + $0161;
18796
 
18800
 
18797
(* DMUS_E_NOT_INIT
18801
(* DMUS_E_NOT_INIT
18798
 *
18802
 *
18799
 * A required object is not initialized or failed to initialize.
18803
 * A required object is not initialized or failed to initialize.
18800
 *)
18804
 *)
18801
  DMUS_E_NOT_INIT                 = MAKE_DMHRESULTERROR + $0162;
18805
  DMUS_E_NOT_INIT                 = MAKE_DMHRESULTERROR + $0162;
18802
 
18806
 
18803
(* DMUS_E_TYPE_DISABLED
18807
(* DMUS_E_TYPE_DISABLED
18804
 *
18808
 *
18805
 * The requested parameter type is currently disabled. Parameter types may
18809
 * The requested parameter type is currently disabled. Parameter types may
18806
 * be enabled and disabled by certain calls to SetParam().
18810
 * be enabled and disabled by certain calls to SetParam().
18807
 *)
18811
 *)
18808
  DMUS_E_TYPE_DISABLED            = MAKE_DMHRESULTERROR + $0163;
18812
  DMUS_E_TYPE_DISABLED            = MAKE_DMHRESULTERROR + $0163;
18809
 
18813
 
18810
(* DMUS_E_TYPE_UNSUPPORTED
18814
(* DMUS_E_TYPE_UNSUPPORTED
18811
 *
18815
 *
18812
 * The requested parameter type is not supported on the object.
18816
 * The requested parameter type is not supported on the object.
18813
 *)
18817
 *)
18814
  DMUS_E_TYPE_UNSUPPORTED         = MAKE_DMHRESULTERROR + $0164;
18818
  DMUS_E_TYPE_UNSUPPORTED         = MAKE_DMHRESULTERROR + $0164;
18815
 
18819
 
18816
(* DMUS_E_TIME_PAST
18820
(* DMUS_E_TIME_PAST
18817
 *
18821
 *
18818
 * The time is in the past, and the operation can not succeed.
18822
 * The time is in the past, and the operation can not succeed.
18819
 *)
18823
 *)
18820
  DMUS_E_TIME_PAST                = MAKE_DMHRESULTERROR + $0165;
18824
  DMUS_E_TIME_PAST                = MAKE_DMHRESULTERROR + $0165;
18821
 
18825
 
18822
(* DMUS_E_TRACK_NOT_FOUND
18826
(* DMUS_E_TRACK_NOT_FOUND
18823
 *
18827
 *
18824
 * The requested track is not contained by the segment.
18828
 * The requested track is not contained by the segment.
18825
 *)
18829
 *)
18826
  DMUS_E_TRACK_NOT_FOUND        = MAKE_DMHRESULTERROR + $0166;
18830
  DMUS_E_TRACK_NOT_FOUND        = MAKE_DMHRESULTERROR + $0166;
18827
 
18831
 
18828
(* DMUS_E_NO_MASTER_CLOCK
18832
(* DMUS_E_NO_MASTER_CLOCK
18829
 *
18833
 *
18830
 * There is no master clock in the performance. Be sure to call
18834
 * There is no master clock in the performance. Be sure to call
18831
 * IDirectMusicPerformance::Init().
18835
 * IDirectMusicPerformance::Init().
18832
 *)
18836
 *)
18833
  DMUS_E_NO_MASTER_CLOCK          = MAKE_DMHRESULTERROR + $0170;
18837
  DMUS_E_NO_MASTER_CLOCK          = MAKE_DMHRESULTERROR + $0170;
18834
 
18838
 
18835
(* DMUS_E_LOADER_NOCLASSID
18839
(* DMUS_E_LOADER_NOCLASSID
18836
 *
18840
 *
18837
 * The class id field is required and missing in the DMUS_OBJECTDESC.
18841
 * The class id field is required and missing in the DMUS_OBJECTDESC.
18838
 *)
18842
 *)
18839
  DMUS_E_LOADER_NOCLASSID         = MAKE_DMHRESULTERROR + $0180;
18843
  DMUS_E_LOADER_NOCLASSID         = MAKE_DMHRESULTERROR + $0180;
18840
 
18844
 
18841
(* DMUS_E_LOADER_BADPATH
18845
(* DMUS_E_LOADER_BADPATH
18842
 *
18846
 *
18843
 * The requested file path is invalid.
18847
 * The requested file path is invalid.
18844
 *)
18848
 *)
18845
  DMUS_E_LOADER_BADPATH           = MAKE_DMHRESULTERROR + $0181;
18849
  DMUS_E_LOADER_BADPATH           = MAKE_DMHRESULTERROR + $0181;
18846
 
18850
 
18847
(* DMUS_E_LOADER_FAILEDOPEN
18851
(* DMUS_E_LOADER_FAILEDOPEN
18848
 *
18852
 *
18849
 * File open failed - either file doesn't exist or is locked.
18853
 * File open failed - either file doesn't exist or is locked.
18850
 *)
18854
 *)
18851
  DMUS_E_LOADER_FAILEDOPEN        = MAKE_DMHRESULTERROR + $0182;
18855
  DMUS_E_LOADER_FAILEDOPEN        = MAKE_DMHRESULTERROR + $0182;
18852
 
18856
 
18853
(* DMUS_E_LOADER_FORMATNOTSUPPORTED
18857
(* DMUS_E_LOADER_FORMATNOTSUPPORTED
18854
 *
18858
 *
18855
 * Search data type is not supported.
18859
 * Search data type is not supported.
18856
 *)
18860
 *)
18857
  DMUS_E_LOADER_FORMATNOTSUPPORTED    = MAKE_DMHRESULTERROR + $0183;
18861
  DMUS_E_LOADER_FORMATNOTSUPPORTED    = MAKE_DMHRESULTERROR + $0183;
18858
 
18862
 
18859
(* DMUS_E_LOADER_FAILEDCREATE
18863
(* DMUS_E_LOADER_FAILEDCREATE
18860
 *
18864
 *
18861
 * Unable to find or create object.
18865
 * Unable to find or create object.
18862
 *)
18866
 *)
18863
  DMUS_E_LOADER_FAILEDCREATE      = MAKE_DMHRESULTERROR + $0184;
18867
  DMUS_E_LOADER_FAILEDCREATE      = MAKE_DMHRESULTERROR + $0184;
18864
 
18868
 
18865
(* DMUS_E_LOADER_OBJECTNOTFOUND
18869
(* DMUS_E_LOADER_OBJECTNOTFOUND
18866
 *
18870
 *
18867
 * Object was not found.
18871
 * Object was not found.
18868
 *)
18872
 *)
18869
  DMUS_E_LOADER_OBJECTNOTFOUND    = MAKE_DMHRESULTERROR + $0185;
18873
  DMUS_E_LOADER_OBJECTNOTFOUND    = MAKE_DMHRESULTERROR + $0185;
18870
 
18874
 
18871
(* DMUS_E_LOADER_NOFILENAME
18875
(* DMUS_E_LOADER_NOFILENAME
18872
 *
18876
 *
18873
 * The file name is missing from the DMUS_OBJECTDESC.
18877
 * The file name is missing from the DMUS_OBJECTDESC.
18874
 *)
18878
 *)
18875
  DMUS_E_LOADER_NOFILENAME          = MAKE_DMHRESULTERROR + $0186;
18879
  DMUS_E_LOADER_NOFILENAME          = MAKE_DMHRESULTERROR + $0186;
18876
 
18880
 
18877
(* DMUS_E_INVALIDFILE
18881
(* DMUS_E_INVALIDFILE
18878
 *
18882
 *
18879
 * The file requested is not a valid file.
18883
 * The file requested is not a valid file.
18880
 *)
18884
 *)
18881
  DMUS_E_INVALIDFILE              = MAKE_DMHRESULTERROR + $0200;
18885
  DMUS_E_INVALIDFILE              = MAKE_DMHRESULTERROR + $0200;
18882
 
18886
 
18883
(* DMUS_E_ALREADY_EXISTS
18887
(* DMUS_E_ALREADY_EXISTS
18884
 *
18888
 *
18885
 * The tool is already contained in the graph. Create a new instance.
18889
 * The tool is already contained in the graph. Create a new instance.
18886
 *)
18890
 *)
18887
  DMUS_E_ALREADY_EXISTS           = MAKE_DMHRESULTERROR + $0201;
18891
  DMUS_E_ALREADY_EXISTS           = MAKE_DMHRESULTERROR + $0201;
18888
 
18892
 
18889
(* DMUS_E_OUT_OF_RANGE
18893
(* DMUS_E_OUT_OF_RANGE
18890
 *
18894
 *
18891
 * Value is out of range, for instance the requested length is longer than
18895
 * Value is out of range, for instance the requested length is longer than
18892
 * the segment.
18896
 * the segment.
18893
 *)
18897
 *)
18894
  DMUS_E_OUT_OF_RANGE             = MAKE_DMHRESULTERROR + $0202;
18898
  DMUS_E_OUT_OF_RANGE             = MAKE_DMHRESULTERROR + $0202;
18895
 
18899
 
18896
(* DMUS_E_SEGMENT_INIT_FAILED
18900
(* DMUS_E_SEGMENT_INIT_FAILED
18897
 *
18901
 *
18898
 * Segment initialization failed, most likely due to a critical memory situation.
18902
 * Segment initialization failed, most likely due to a critical memory situation.
18899
 *)
18903
 *)
18900
  DMUS_E_SEGMENT_INIT_FAILED      = MAKE_DMHRESULTERROR + $0203;
18904
  DMUS_E_SEGMENT_INIT_FAILED      = MAKE_DMHRESULTERROR + $0203;
18901
 
18905
 
18902
(* DMUS_E_ALREADY_SENT
18906
(* DMUS_E_ALREADY_SENT
18903
 *
18907
 *
18904
 * The DMUS_PMSG has already been sent to the performance object via
18908
 * The DMUS_PMSG has already been sent to the performance object via
18905
 * IDirectMusicPerformance::SendPMsg().
18909
 * IDirectMusicPerformance::SendPMsg().
18906
 *)
18910
 *)
18907
  DMUS_E_ALREADY_SENT             = MAKE_DMHRESULTERROR + $0204;
18911
  DMUS_E_ALREADY_SENT             = MAKE_DMHRESULTERROR + $0204;
18908
 
18912
 
18909
(* DMUS_E_CANNOT_FREE
18913
(* DMUS_E_CANNOT_FREE
18910
 *
18914
 *
18911
 * The DMUS_PMSG was either not allocated by the performance via
18915
 * The DMUS_PMSG was either not allocated by the performance via
18912
 * IDirectMusicPerformance::AllocPMsg(), or it was already freed via
18916
 * IDirectMusicPerformance::AllocPMsg(), or it was already freed via
18913
 * IDirectMusicPerformance::FreePMsg().
18917
 * IDirectMusicPerformance::FreePMsg().
18914
 *)
18918
 *)
18915
  DMUS_E_CANNOT_FREE              = MAKE_DMHRESULTERROR + $0205;
18919
  DMUS_E_CANNOT_FREE              = MAKE_DMHRESULTERROR + $0205;
18916
 
18920
 
18917
(* DMUS_E_CANNOT_OPEN_PORT
18921
(* DMUS_E_CANNOT_OPEN_PORT
18918
 *
18922
 *
18919
 * The default system port could not be opened.
18923
 * The default system port could not be opened.
18920
 *)
18924
 *)
18921
  DMUS_E_CANNOT_OPEN_PORT         = MAKE_DMHRESULTERROR + $0206;
18925
  DMUS_E_CANNOT_OPEN_PORT         = MAKE_DMHRESULTERROR + $0206;
18922
 
18926
 
18923
(* DMUS_E_CONNOT_CONVERT
18927
(* DMUS_E_CONNOT_CONVERT
18924
 *
18928
 *
18925
 * A call to MIDIToMusic() or MusicToMIDI() resulted in an error because
18929
 * A call to MIDIToMusic() or MusicToMIDI() resulted in an error because
18926
 * the requested conversion could not happen. This usually occurs when the
18930
 * the requested conversion could not happen. This usually occurs when the
18927
 * provided DMUS_CHORD_KEY structure has an invalid chord or scale pattern.
18931
 * provided DMUS_CHORD_KEY structure has an invalid chord or scale pattern.
18928
 *)
18932
 *)
18929
  DMUS_E_CONNOT_CONVERT           = MAKE_DMHRESULTERROR + $0207;
18933
  DMUS_E_CONNOT_CONVERT           = MAKE_DMHRESULTERROR + $0207;
18930
 
18934
 
18931
(* DMUS_E_DESCEND_CHUNK_FAIL
18935
(* DMUS_E_DESCEND_CHUNK_FAIL
18932
 *
18936
 *
18933
 * DMUS_E_DESCEND_CHUNK_FAIL is returned when the end of the file
18937
 * DMUS_E_DESCEND_CHUNK_FAIL is returned when the end of the file
18934
 * was reached before the desired chunk was found.
18938
 * was reached before the desired chunk was found.
18935
 *)
18939
 *)
18936
  DMUS_E_DESCEND_CHUNK_FAIL       = MAKE_DMHRESULTERROR + $0210;
18940
  DMUS_E_DESCEND_CHUNK_FAIL       = MAKE_DMHRESULTERROR + $0210;
18937
 
18941
 
18938
 
18942
 
18939
(************************************************************************
18943
(************************************************************************
18940
*                                                                       *
18944
*                                                                       *
18941
*   dmksctrl.h -- Definition of IKsControl                              *
18945
*   dmksctrl.h -- Definition of IKsControl                              *
18942
*                                                                       *
18946
*                                                                       *
18943
*   Copyright (c) 1998, Microsoft Corp. All rights reserved.            *
18947
*   Copyright (c) 1998, Microsoft Corp. All rights reserved.            *
18944
*                                                                       *
18948
*                                                                       *
18945
*                                                                       *
18949
*                                                                       *
18946
*   This header file contains the definition of IKsControl, which       *
18950
*   This header file contains the definition of IKsControl, which       *
18947
*   duplicates definitions from ks.h and ksproxy.h. Your code should    *
18951
*   duplicates definitions from ks.h and ksproxy.h. Your code should    *
18948
*   include ks.h and ksproxy.h directly if you have them (they are      *
18952
*   include ks.h and ksproxy.h directly if you have them (they are      *
18949
*   provided in the Windows 98 DDK and will be in the Windows NT 5      *
18953
*   provided in the Windows 98 DDK and will be in the Windows NT 5      *
18950
*   SDK).                                                               *
18954
*   SDK).                                                               *
18951
*                                                                       *
18955
*                                                                       *
18952
************************************************************************)
18956
************************************************************************)
18953
 
18957
 
18954
(*
18958
(*
18955
 * Warning: This will prevent the rest of ks.h from being pulled in if ks.h is
18959
 * Warning: This will prevent the rest of ks.h from being pulled in if ks.h is
18956
 * included after dmksctrl.h. Make sure you do not include both headers in
18960
 * included after dmksctrl.h. Make sure you do not include both headers in
18957
 * the same source file.
18961
 * the same source file.
18958
 *)
18962
 *)
18959
 
18963
 
18960
type
18964
type
18961
  PKsIdentifier = ^TKsIdentifier;
18965
  PKsIdentifier = ^TKsIdentifier;
18962
  TKsIdentifier = packed record
18966
  TKsIdentifier = packed record
18963
    case integer of
18967
    case integer of
18964
      1 : (
18968
      1 : (
18965
             Set_: TGUID;
18969
             Set_: TGUID;
18966
             Id : ULONG;
18970
             Id : ULONG;
18967
             Flags: ULONG
18971
             Flags: ULONG
18968
          );
18972
          );
18969
      2 : (Alignment: LONGLONG);
18973
      2 : (Alignment: LONGLONG);
18970
  end;
18974
  end;
18971
 
18975
 
18972
  PKsProperty = ^TKsProperty;
18976
  PKsProperty = ^TKsProperty;
18973
  TKsProperty = TKsIdentifier;
18977
  TKsProperty = TKsIdentifier;
18974
 
18978
 
18975
  PKsMethod = ^TKsMethod;
18979
  PKsMethod = ^TKsMethod;
18976
  TKsMethod = TKsIdentifier;
18980
  TKsMethod = TKsIdentifier;
18977
 
18981
 
18978
  PKsEvent = ^TKsEvent;
18982
  PKsEvent = ^TKsEvent;
18979
  TKsEvent = TKsIdentifier;
18983
  TKsEvent = TKsIdentifier;
18980
 
18984
 
18981
const
18985
const
18982
  KSMETHOD_TYPE_NONE                  = $00000000;
18986
  KSMETHOD_TYPE_NONE                  = $00000000;
18983
  KSMETHOD_TYPE_READ                  = $00000001;
18987
  KSMETHOD_TYPE_READ                  = $00000001;
18984
  KSMETHOD_TYPE_WRITE                 = $00000002;
18988
  KSMETHOD_TYPE_WRITE                 = $00000002;
18985
  KSMETHOD_TYPE_MODIFY                = $00000003;
18989
  KSMETHOD_TYPE_MODIFY                = $00000003;
18986
  KSMETHOD_TYPE_SOURCE                = $00000004;
18990
  KSMETHOD_TYPE_SOURCE                = $00000004;
18987
 
18991
 
18988
  KSMETHOD_TYPE_SEND                  = $00000001;
18992
  KSMETHOD_TYPE_SEND                  = $00000001;
18989
  KSMETHOD_TYPE_SETSUPPORT            = $00000100;
18993
  KSMETHOD_TYPE_SETSUPPORT            = $00000100;
18990
  KSMETHOD_TYPE_BASICSUPPORT          = $00000200;
18994
  KSMETHOD_TYPE_BASICSUPPORT          = $00000200;
18991
 
18995
 
18992
  KSPROPERTY_TYPE_GET                 = $00000001;
18996
  KSPROPERTY_TYPE_GET                 = $00000001;
18993
  KSPROPERTY_TYPE_SET                 = $00000002;
18997
  KSPROPERTY_TYPE_SET                 = $00000002;
18994
  KSPROPERTY_TYPE_SETSUPPORT          = $00000100;
18998
  KSPROPERTY_TYPE_SETSUPPORT          = $00000100;
18995
  KSPROPERTY_TYPE_BASICSUPPORT        = $00000200;
18999
  KSPROPERTY_TYPE_BASICSUPPORT        = $00000200;
18996
  KSPROPERTY_TYPE_RELATIONS           = $00000400;
19000
  KSPROPERTY_TYPE_RELATIONS           = $00000400;
18997
  KSPROPERTY_TYPE_SERIALIZESET        = $00000800;
19001
  KSPROPERTY_TYPE_SERIALIZESET        = $00000800;
18998
  KSPROPERTY_TYPE_UNSERIALIZESET      = $00001000;
19002
  KSPROPERTY_TYPE_UNSERIALIZESET      = $00001000;
18999
  KSPROPERTY_TYPE_SERIALIZERAW        = $00002000;
19003
  KSPROPERTY_TYPE_SERIALIZERAW        = $00002000;
19000
  KSPROPERTY_TYPE_UNSERIALIZERAW      = $00004000;
19004
  KSPROPERTY_TYPE_UNSERIALIZERAW      = $00004000;
19001
  KSPROPERTY_TYPE_SERIALIZESIZE       = $00008000;
19005
  KSPROPERTY_TYPE_SERIALIZESIZE       = $00008000;
19002
  KSPROPERTY_TYPE_DEFAULTVALUES       = $00010000;
19006
  KSPROPERTY_TYPE_DEFAULTVALUES       = $00010000;
19003
 
19007
 
19004
  KSPROPERTY_TYPE_TOPOLOGY            = $10000000;
19008
  KSPROPERTY_TYPE_TOPOLOGY            = $10000000;
19005
 
19009
 
19006
type
19010
type
19007
  IKsControl = interface (IUnknown)
19011
  IKsControl = interface (IUnknown)
19008
    ['{28F54685-06FD-11D2-B27A-00A0C9223196}']
19012
    ['{28F54685-06FD-11D2-B27A-00A0C9223196}']
19009
    function KsProperty (const pProperty: TKsProperty; PropertyLength: ULONG;
19013
    function KsProperty (const pProperty: TKsProperty; PropertyLength: ULONG;
19010
        var PropertyData; DataLength: ULONG; out BytesReturned: ULONG) : HResult; stdcall;
19014
        var PropertyData; DataLength: ULONG; out BytesReturned: ULONG) : HResult; stdcall;
19011
    function KsMethod(const Method: TKsMethod; MethodLength: ULONG;
19015
    function KsMethod(const Method: TKsMethod; MethodLength: ULONG;
19012
        var MethodData; DataLength: ULONG; out BytesReturned: ULONG) : HResult; stdcall;
19016
        var MethodData; DataLength: ULONG; out BytesReturned: ULONG) : HResult; stdcall;
19013
    function KsEvent (const Event: TKsEvent; EventLength: ULONG;
19017
    function KsEvent (const Event: TKsEvent; EventLength: ULONG;
19014
        var EventData; DataLength: ULONG; out BytesReturned: ULONG) : HResult; stdcall;
19018
        var EventData; DataLength: ULONG; out BytesReturned: ULONG) : HResult; stdcall;
19015
  end;
19019
  end;
19016
 
19020
 
19017
type
19021
type
19018
  IID_IKsControl = IKsControl;
19022
  IID_IKsControl = IKsControl;
19019
  STATIC_IID_IKsControl = IID_IKsControl;
19023
  STATIC_IID_IKsControl = IID_IKsControl;
19020
 
19024
 
19021
 
19025
 
19022
const
19026
const
19023
(* These formats are in ksmedia.h
19027
(* These formats are in ksmedia.h
19024
 *)
19028
 *)
19025
  KSDATAFORMAT_SUBTYPE_MIDI : TGUID = '{1D262760-E957-11CF-A5D6-28DB04C10000}';
19029
  KSDATAFORMAT_SUBTYPE_MIDI : TGUID = '{1D262760-E957-11CF-A5D6-28DB04C10000}';
19026
 
19030
 
19027
  KSDATAFORMAT_SUBTYPE_DIRECTMUSIC : TGUID = '{1a82f8bc-3f8b-11d2-b774-0060083316c1}';
19031
  KSDATAFORMAT_SUBTYPE_DIRECTMUSIC : TGUID = '{1a82f8bc-3f8b-11d2-b774-0060083316c1}';
19028
 
19032
 
19029
(************************************************************************
19033
(************************************************************************
19030
*                                                                       *
19034
*                                                                       *
19031
*   dmusicc.h -- This module defines the DirectMusic core API's         *
19035
*   dmusicc.h -- This module defines the DirectMusic core API's         *
19032
*                                                                       *
19036
*                                                                       *
19033
*   Copyright (c) 1998, Microsoft Corp. All rights reserved.            *
19037
*   Copyright (c) 1998, Microsoft Corp. All rights reserved.            *
19034
*                                                                       *
19038
*                                                                       *
19035
************************************************************************)
19039
************************************************************************)
19036
 
19040
 
19037
const
19041
const
19038
  DMUS_MAX_DESCRIPTION = 128;
19042
  DMUS_MAX_DESCRIPTION = 128;
19039
  DMUS_MAX_DRIVER = 128;
19043
  DMUS_MAX_DRIVER = 128;
19040
 
19044
 
19041
type
19045
type
19042
  PDMus_BufferDesc = ^TDMus_BufferDesc;
19046
  PDMus_BufferDesc = ^TDMus_BufferDesc;
19043
  TDMus_BufferDesc = packed record
19047
  TDMus_BufferDesc = packed record
19044
    dwSize,
19048
    dwSize,
19045
    dwFlags : DWORD;
19049
    dwFlags : DWORD;
19046
    guidBufferFormat : TGUID;
19050
    guidBufferFormat : TGUID;
19047
    cbBuffer : DWORD;
19051
    cbBuffer : DWORD;
19048
  end;
19052
  end;
19049
 
19053
 
19050
const
19054
const
19051
(* DMUS_EFFECT_ flags are used in the dwEffectFlags fields of both DMUS_PORTCAPS
19055
(* DMUS_EFFECT_ flags are used in the dwEffectFlags fields of both DMUS_PORTCAPS
19052
 * and DMUS_PORTPARAMS.
19056
 * and DMUS_PORTPARAMS.
19053
 *)
19057
 *)
19054
  DMUS_EFFECT_NONE             = $00000000;
19058
  DMUS_EFFECT_NONE             = $00000000;
19055
  DMUS_EFFECT_REVERB           = $00000001;
19059
  DMUS_EFFECT_REVERB           = $00000001;
19056
  DMUS_EFFECT_CHORUS           = $00000002;
19060
  DMUS_EFFECT_CHORUS           = $00000002;
19057
 
19061
 
19058
(* For DMUS_PORTCAPS dwClass
19062
(* For DMUS_PORTCAPS dwClass
19059
 *)
19063
 *)
19060
  DMUS_PC_INPUTCLASS        = 0;
19064
  DMUS_PC_INPUTCLASS        = 0;
19061
  DMUS_PC_OUTPUTCLASS       = 1;
19065
  DMUS_PC_OUTPUTCLASS       = 1;
19062
 
19066
 
19063
(* For DMUS_PORTCAPS dwFlags
19067
(* For DMUS_PORTCAPS dwFlags
19064
 *)
19068
 *)
19065
  DMUS_PC_DLS              = $00000001;
19069
  DMUS_PC_DLS              = $00000001;
19066
  DMUS_PC_EXTERNAL         = $00000002;
19070
  DMUS_PC_EXTERNAL         = $00000002;
19067
  DMUS_PC_SOFTWARESYNTH    = $00000004;
19071
  DMUS_PC_SOFTWARESYNTH    = $00000004;
19068
  DMUS_PC_MEMORYSIZEFIXED  = $00000008;
19072
  DMUS_PC_MEMORYSIZEFIXED  = $00000008;
19069
  DMUS_PC_GMINHARDWARE     = $00000010;
19073
  DMUS_PC_GMINHARDWARE     = $00000010;
19070
  DMUS_PC_GSINHARDWARE     = $00000020;
19074
  DMUS_PC_GSINHARDWARE     = $00000020;
19071
  DMUS_PC_XGINHARDWARE     = $00000040;
19075
  DMUS_PC_XGINHARDWARE     = $00000040;
19072
  DMUS_PC_DIRECTSOUND      = $00000080;
19076
  DMUS_PC_DIRECTSOUND      = $00000080;
19073
  DMUS_PC_SHAREABLE        = $00000100;
19077
  DMUS_PC_SHAREABLE        = $00000100;
19074
  DMUS_PC_DLS2             = $00000200;
19078
  DMUS_PC_DLS2             = $00000200;
19075
  DMUS_PC_SYSTEMMEMORY     = $7FFFFFFF;
19079
  DMUS_PC_SYSTEMMEMORY     = $7FFFFFFF;
19076
 
19080
 
19077
type
19081
type
19078
  PDMus_PortCaps = ^TDMus_PortCaps;
19082
  PDMus_PortCaps = ^TDMus_PortCaps;
19079
  TDMus_PortCaps = packed record
19083
  TDMus_PortCaps = packed record
19080
    dwSize:              DWORD;
19084
    dwSize:              DWORD;
19081
    dwFlags:             DWORD;
19085
    dwFlags:             DWORD;
19082
    guidPort:            TGUID;
19086
    guidPort:            TGUID;
19083
    dwClass:             DWORD;
19087
    dwClass:             DWORD;
19084
    dwType:              DWORD;
19088
    dwType:              DWORD;
19085
    dwMemorySize:        DWORD;
19089
    dwMemorySize:        DWORD;
19086
    dwMaxChannelGroups:  DWORD;
19090
    dwMaxChannelGroups:  DWORD;
19087
    dwMaxVoices:         DWORD;
19091
    dwMaxVoices:         DWORD;
19088
    dwMaxAudioChannels:  DWORD;
19092
    dwMaxAudioChannels:  DWORD;
19089
    dwEffectFlags:       DWORD;
19093
    dwEffectFlags:       DWORD;
19090
    wszDescription:      array [0..DMUS_MAX_DESCRIPTION-1] of WideChar;
19094
    wszDescription:      array [0..DMUS_MAX_DESCRIPTION-1] of WideChar;
19091
  end;
19095
  end;
19092
 
19096
 
19093
const
19097
const
19094
(* Values for DMUS_PORTCAPS dwType. This field indicates the underlying
19098
(* Values for DMUS_PORTCAPS dwType. This field indicates the underlying
19095
 * driver type of the port.
19099
 * driver type of the port.
19096
 *)
19100
 *)
19097
  DMUS_PORT_WINMM_DRIVER      = 0;
19101
  DMUS_PORT_WINMM_DRIVER      = 0;
19098
  DMUS_PORT_USER_MODE_SYNTH   = 1;
19102
  DMUS_PORT_USER_MODE_SYNTH   = 1;
19099
  DMUS_PORT_KERNEL_MODE       = 2;
19103
  DMUS_PORT_KERNEL_MODE       = 2;
19100
 
19104
 
19101
(* These flags (set in dwValidParams) indicate which other members of the *)
19105
(* These flags (set in dwValidParams) indicate which other members of the *)
19102
(* DMUS_PORTPARAMS are valid. *)
19106
(* DMUS_PORTPARAMS are valid. *)
19103
(* *)
19107
(* *)
19104
  DMUS_PORTPARAMS_VOICES           = $00000001;
19108
  DMUS_PORTPARAMS_VOICES           = $00000001;
19105
  DMUS_PORTPARAMS_CHANNELGROUPS    = $00000002;
19109
  DMUS_PORTPARAMS_CHANNELGROUPS    = $00000002;
19106
  DMUS_PORTPARAMS_AUDIOCHANNELS    = $00000004;
19110
  DMUS_PORTPARAMS_AUDIOCHANNELS    = $00000004;
19107
  DMUS_PORTPARAMS_SAMPLERATE       = $00000008;
19111
  DMUS_PORTPARAMS_SAMPLERATE       = $00000008;
19108
  DMUS_PORTPARAMS_EFFECTS          = $00000020;
19112
  DMUS_PORTPARAMS_EFFECTS          = $00000020;
19109
  DMUS_PORTPARAMS_SHARE            = $00000040;
19113
  DMUS_PORTPARAMS_SHARE            = $00000040;
19110
 
19114
 
19111
type
19115
type
19112
  PDMus_PortParams = ^TDMus_PortParams;
19116
  PDMus_PortParams = ^TDMus_PortParams;
19113
  TDMus_PortParams = packed record
19117
  TDMus_PortParams = packed record
19114
    dwSize:          DWORD;
19118
    dwSize:          DWORD;
19115
    dwValidParams:   DWORD;
19119
    dwValidParams:   DWORD;
19116
    dwVoices:        DWORD;
19120
    dwVoices:        DWORD;
19117
    dwChannelGroups: DWORD;
19121
    dwChannelGroups: DWORD;
19118
    dwAudioChannels: DWORD;
19122
    dwAudioChannels: DWORD;
19119
    dwSampleRate:    DWORD;
19123
    dwSampleRate:    DWORD;
19120
    dwEffectFlags:   DWORD;
19124
    dwEffectFlags:   DWORD;
19121
    fShare:          BOOL;
19125
    fShare:          BOOL;
19122
  end;
19126
  end;
19123
 
19127
 
19124
  PDMus_SynthStats = ^TDMus_SynthStats;
19128
  PDMus_SynthStats = ^TDMus_SynthStats;
19125
  TDMus_SynthStats = packed record
19129
  TDMus_SynthStats = packed record
19126
    dwSize:        DWORD;        (* Size in bytes of the structure *)
19130
    dwSize:        DWORD;        (* Size in bytes of the structure *)
19127
    dwValidStats:  DWORD;        (* Flags indicating which fields below are valid. *)
19131
    dwValidStats:  DWORD;        (* Flags indicating which fields below are valid. *)
19128
    dwVoices:      DWORD;        (* Average number of voices playing. *)
19132
    dwVoices:      DWORD;        (* Average number of voices playing. *)
19129
    dwTotalCPU:    DWORD;        (* Total CPU usage as percent * 100. *)
19133
    dwTotalCPU:    DWORD;        (* Total CPU usage as percent * 100. *)
19130
    dwCPUPerVoice: DWORD;        (* CPU per voice as percent * 100. *)
19134
    dwCPUPerVoice: DWORD;        (* CPU per voice as percent * 100. *)
19131
    dwLostNotes:   DWORD;        (* Number of notes lost in 1 second. *)
19135
    dwLostNotes:   DWORD;        (* Number of notes lost in 1 second. *)
19132
    dwFreeMemory:  DWORD;        (* Free memory in bytes *)
19136
    dwFreeMemory:  DWORD;        (* Free memory in bytes *)
19133
    lPeakVolume:   LongInt;      (* Decibel level * 100. *)
19137
    lPeakVolume:   LongInt;      (* Decibel level * 100. *)
19134
  end;
19138
  end;
19135
 
19139
 
19136
const
19140
const
19137
  DMUS_SYNTHSTATS_VOICES          = 1 shl 0;
19141
  DMUS_SYNTHSTATS_VOICES          = 1 shl 0;
19138
  DMUS_SYNTHSTATS_TOTAL_CPU       = 1 shl 1;
19142
  DMUS_SYNTHSTATS_TOTAL_CPU       = 1 shl 1;
19139
  DMUS_SYNTHSTATS_CPU_PER_VOICE   = 1 shl 2;
19143
  DMUS_SYNTHSTATS_CPU_PER_VOICE   = 1 shl 2;
19140
  DMUS_SYNTHSTATS_LOST_NOTES      = 1 shl 3;
19144
  DMUS_SYNTHSTATS_LOST_NOTES      = 1 shl 3;
19141
  DMUS_SYNTHSTATS_PEAK_VOLUME     = 1 shl 4;
19145
  DMUS_SYNTHSTATS_PEAK_VOLUME     = 1 shl 4;
19142
  DMUS_SYNTHSTATS_FREE_MEMORY     = 1 shl 5;
19146
  DMUS_SYNTHSTATS_FREE_MEMORY     = 1 shl 5;
19143
 
19147
 
19144
  DMUS_SYNTHSTATS_SYSTEMMEMORY   = DMUS_PC_SYSTEMMEMORY;
19148
  DMUS_SYNTHSTATS_SYSTEMMEMORY   = DMUS_PC_SYSTEMMEMORY;
19145
 
19149
 
19146
type
19150
type
19147
  TDMus_Waves_Reverb_Params = packed record
19151
  TDMus_Waves_Reverb_Params = packed record
19148
    fInGain,        (* Input gain in dB (to avoid output overflows) *)
19152
    fInGain,        (* Input gain in dB (to avoid output overflows) *)
19149
    fReverbMix,     (* Reverb mix in dB. 0dB means 100% wet reverb (no direct signal)
19153
    fReverbMix,     (* Reverb mix in dB. 0dB means 100% wet reverb (no direct signal)
19150
                    Negative values gives less wet signal.
19154
                    Negative values gives less wet signal.
19151
                    The coeficients are calculated so that the overall output level stays
19155
                    The coeficients are calculated so that the overall output level stays
19152
                    (approximately) constant regardless of the ammount of reverb mix. *)
19156
                    (approximately) constant regardless of the ammount of reverb mix. *)
19153
    fReverbTime,    (* The reverb decay time, in milliseconds. *)
19157
    fReverbTime,    (* The reverb decay time, in milliseconds. *)
19154
    fHighFreqRTRatio : Single; (* The ratio of the high frequencies to the global reverb time.
19158
    fHighFreqRTRatio : Single; (* The ratio of the high frequencies to the global reverb time.
19155
                    Unless very 'splashy-bright' reverbs are wanted, this should be set to
19159
                    Unless very 'splashy-bright' reverbs are wanted, this should be set to
19156
                    a value < 1.0.
19160
                    a value < 1.0.
19157
                    For example if dRevTime==1000ms and dHighFreqRTRatio=0.1 than the
19161
                    For example if dRevTime==1000ms and dHighFreqRTRatio=0.1 than the
19158
                    decay time for high frequencies will be 100ms.*)
19162
                    decay time for high frequencies will be 100ms.*)
19159
 
19163
 
19160
  end;
19164
  end;
19161
 
19165
 
19162
 
19166
 
19163
(*  Note: Default values for Reverb are:
19167
(*  Note: Default values for Reverb are:
19164
    fInGain             = 0.0dB   (no change in level)
19168
    fInGain             = 0.0dB   (no change in level)
19165
    fReverbMix          = -10.0dB   (a reasonable reverb mix)
19169
    fReverbMix          = -10.0dB   (a reasonable reverb mix)
19166
    fReverbTime         = 1000.0ms (one second global reverb time)
19170
    fReverbTime         = 1000.0ms (one second global reverb time)
19167
    fHighFreqRTRatio    = 0.001    (the ratio of the high frequencies to the global reverb time)
19171
    fHighFreqRTRatio    = 0.001    (the ratio of the high frequencies to the global reverb time)
19168
*)
19172
*)
19169
 
19173
 
19170
  TDMus_ClockType = (
19174
  TDMus_ClockType = (
19171
    DMUS_CLOCK_SYSTEM,
19175
    DMUS_CLOCK_SYSTEM,
19172
    DMUS_CLOCK_WAVE
19176
    DMUS_CLOCK_WAVE
19173
  );
19177
  );
19174
 
19178
 
19175
  PDMus_ClockInfo = ^TDMus_ClockInfo;
19179
  PDMus_ClockInfo = ^TDMus_ClockInfo;
19176
  TDMus_ClockInfo = packed record
19180
  TDMus_ClockInfo = packed record
19177
    dwSize : WORD;
19181
    dwSize : WORD;
19178
    ctType : TDMus_ClockType;
19182
    ctType : TDMus_ClockType;
19179
    guidClock : TGUID;          (* Identifies this time source *)
19183
    guidClock : TGUID;          (* Identifies this time source *)
19180
    wszDescription : array [0..DMUS_MAX_DESCRIPTION-1] of WideChar;
19184
    wszDescription : array [0..DMUS_MAX_DESCRIPTION-1] of WideChar;
19181
  end;
19185
  end;
19182
 
19186
 
19183
const
19187
const
19184
  DMUS_EVENT_STRUCTURED   = $00000001;  (* Unstructured data (SysEx, etc.) *)
19188
  DMUS_EVENT_STRUCTURED   = $00000001;  (* Unstructured data (SysEx, etc.) *)
19185
 
19189
 
19186
(* Standard values for voice priorities. Numerically higher priorities are higher in priority.
19190
(* Standard values for voice priorities. Numerically higher priorities are higher in priority.
19187
 * These priorities are used to set the voice priority for all voices on a channel. They are
19191
 * These priorities are used to set the voice priority for all voices on a channel. They are
19188
 * used in the dwPriority parameter of IDirectMusicPort::GetPriority and returned in the
19192
 * used in the dwPriority parameter of IDirectMusicPort::GetPriority and returned in the
19189
 * lpwPriority parameter of pdwPriority.
19193
 * lpwPriority parameter of pdwPriority.
19190
 *
19194
 *
19191
 * These priorities are shared with DirectSound.
19195
 * These priorities are shared with DirectSound.
19192
 *)
19196
 *)
19193
 
19197
 
19194
const
19198
const
19195
  DAUD_CRITICAL_VOICE_PRIORITY    = $F0000000;
19199
  DAUD_CRITICAL_VOICE_PRIORITY    = $F0000000;
19196
  DAUD_HIGH_VOICE_PRIORITY        = $C0000000;
19200
  DAUD_HIGH_VOICE_PRIORITY        = $C0000000;
19197
  DAUD_STANDARD_VOICE_PRIORITY    = $80000000;
19201
  DAUD_STANDARD_VOICE_PRIORITY    = $80000000;
19198
  DAUD_LOW_VOICE_PRIORITY         = $40000000;
19202
  DAUD_LOW_VOICE_PRIORITY         = $40000000;
19199
  DAUD_PERSIST_VOICE_PRIORITY     = $10000000;
19203
  DAUD_PERSIST_VOICE_PRIORITY     = $10000000;
19200
 
19204
 
19201
(* These are the default priorities assigned if not overridden. By default priorities are
19205
(* These are the default priorities assigned if not overridden. By default priorities are
19202
 * equal across channel groups (e.g. channel 5 on channel group 1 has the same priority as
19206
 * equal across channel groups (e.g. channel 5 on channel group 1 has the same priority as
19203
 * channel 5 on channel group 2;.
19207
 * channel 5 on channel group 2;.
19204
 *
19208
 *
19205
 * In accordance with DLS level 1, channel 10 has the highest priority, followed by 1 through 16
19209
 * In accordance with DLS level 1, channel 10 has the highest priority, followed by 1 through 16
19206
 * except for 10.
19210
 * except for 10.
19207
 *)
19211
 *)
19208
  DAUD_CHAN1_VOICE_PRIORITY_OFFSET    = $0000000E;
19212
  DAUD_CHAN1_VOICE_PRIORITY_OFFSET    = $0000000E;
19209
  DAUD_CHAN2_VOICE_PRIORITY_OFFSET    = $0000000D;
19213
  DAUD_CHAN2_VOICE_PRIORITY_OFFSET    = $0000000D;
19210
  DAUD_CHAN3_VOICE_PRIORITY_OFFSET    = $0000000C;
19214
  DAUD_CHAN3_VOICE_PRIORITY_OFFSET    = $0000000C;
19211
  DAUD_CHAN4_VOICE_PRIORITY_OFFSET    = $0000000B;
19215
  DAUD_CHAN4_VOICE_PRIORITY_OFFSET    = $0000000B;
19212
  DAUD_CHAN5_VOICE_PRIORITY_OFFSET    = $0000000A;
19216
  DAUD_CHAN5_VOICE_PRIORITY_OFFSET    = $0000000A;
19213
  DAUD_CHAN6_VOICE_PRIORITY_OFFSET    = $00000009;
19217
  DAUD_CHAN6_VOICE_PRIORITY_OFFSET    = $00000009;
19214
  DAUD_CHAN7_VOICE_PRIORITY_OFFSET    = $00000008;
19218
  DAUD_CHAN7_VOICE_PRIORITY_OFFSET    = $00000008;
19215
  DAUD_CHAN8_VOICE_PRIORITY_OFFSET    = $00000007;
19219
  DAUD_CHAN8_VOICE_PRIORITY_OFFSET    = $00000007;
19216
  DAUD_CHAN9_VOICE_PRIORITY_OFFSET    = $00000006;
19220
  DAUD_CHAN9_VOICE_PRIORITY_OFFSET    = $00000006;
19217
  DAUD_CHAN10_VOICE_PRIORITY_OFFSET   = $0000000F;
19221
  DAUD_CHAN10_VOICE_PRIORITY_OFFSET   = $0000000F;
19218
  DAUD_CHAN11_VOICE_PRIORITY_OFFSET   = $00000005;
19222
  DAUD_CHAN11_VOICE_PRIORITY_OFFSET   = $00000005;
19219
  DAUD_CHAN12_VOICE_PRIORITY_OFFSET   = $00000004;
19223
  DAUD_CHAN12_VOICE_PRIORITY_OFFSET   = $00000004;
19220
  DAUD_CHAN13_VOICE_PRIORITY_OFFSET   = $00000003;
19224
  DAUD_CHAN13_VOICE_PRIORITY_OFFSET   = $00000003;
19221
  DAUD_CHAN14_VOICE_PRIORITY_OFFSET   = $00000002;
19225
  DAUD_CHAN14_VOICE_PRIORITY_OFFSET   = $00000002;
19222
  DAUD_CHAN15_VOICE_PRIORITY_OFFSET   = $00000001;
19226
  DAUD_CHAN15_VOICE_PRIORITY_OFFSET   = $00000001;
19223
  DAUD_CHAN16_VOICE_PRIORITY_OFFSET   = $00000000;
19227
  DAUD_CHAN16_VOICE_PRIORITY_OFFSET   = $00000000;
19224
 
19228
 
19225
 
19229
 
19226
  DAUD_CHAN1_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN1_VOICE_PRIORITY_OFFSET);
19230
  DAUD_CHAN1_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN1_VOICE_PRIORITY_OFFSET);
19227
  DAUD_CHAN2_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN2_VOICE_PRIORITY_OFFSET);
19231
  DAUD_CHAN2_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN2_VOICE_PRIORITY_OFFSET);
19228
  DAUD_CHAN3_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN3_VOICE_PRIORITY_OFFSET);
19232
  DAUD_CHAN3_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN3_VOICE_PRIORITY_OFFSET);
19229
  DAUD_CHAN4_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN4_VOICE_PRIORITY_OFFSET);
19233
  DAUD_CHAN4_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN4_VOICE_PRIORITY_OFFSET);
19230
  DAUD_CHAN5_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN5_VOICE_PRIORITY_OFFSET);
19234
  DAUD_CHAN5_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN5_VOICE_PRIORITY_OFFSET);
19231
  DAUD_CHAN6_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN6_VOICE_PRIORITY_OFFSET);
19235
  DAUD_CHAN6_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN6_VOICE_PRIORITY_OFFSET);
19232
  DAUD_CHAN7_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN7_VOICE_PRIORITY_OFFSET);
19236
  DAUD_CHAN7_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN7_VOICE_PRIORITY_OFFSET);
19233
  DAUD_CHAN8_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN8_VOICE_PRIORITY_OFFSET);
19237
  DAUD_CHAN8_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN8_VOICE_PRIORITY_OFFSET);
19234
  DAUD_CHAN9_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN9_VOICE_PRIORITY_OFFSET);
19238
  DAUD_CHAN9_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN9_VOICE_PRIORITY_OFFSET);
19235
  DAUD_CHAN10_DEF_VOICE_PRIORITY  = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN10_VOICE_PRIORITY_OFFSET);
19239
  DAUD_CHAN10_DEF_VOICE_PRIORITY  = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN10_VOICE_PRIORITY_OFFSET);
19236
  DAUD_CHAN11_DEF_VOICE_PRIORITY  = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN11_VOICE_PRIORITY_OFFSET);
19240
  DAUD_CHAN11_DEF_VOICE_PRIORITY  = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN11_VOICE_PRIORITY_OFFSET);
19237
  DAUD_CHAN12_DEF_VOICE_PRIORITY  = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN12_VOICE_PRIORITY_OFFSET);
19241
  DAUD_CHAN12_DEF_VOICE_PRIORITY  = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN12_VOICE_PRIORITY_OFFSET);
19238
  DAUD_CHAN13_DEF_VOICE_PRIORITY  = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN13_VOICE_PRIORITY_OFFSET);
19242
  DAUD_CHAN13_DEF_VOICE_PRIORITY  = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN13_VOICE_PRIORITY_OFFSET);
19239
  DAUD_CHAN14_DEF_VOICE_PRIORITY  = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN14_VOICE_PRIORITY_OFFSET);
19243
  DAUD_CHAN14_DEF_VOICE_PRIORITY  = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN14_VOICE_PRIORITY_OFFSET);
19240
  DAUD_CHAN15_DEF_VOICE_PRIORITY  = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN15_VOICE_PRIORITY_OFFSET);
19244
  DAUD_CHAN15_DEF_VOICE_PRIORITY  = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN15_VOICE_PRIORITY_OFFSET);
19241
  DAUD_CHAN16_DEF_VOICE_PRIORITY  = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN16_VOICE_PRIORITY_OFFSET);
19245
  DAUD_CHAN16_DEF_VOICE_PRIORITY  = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN16_VOICE_PRIORITY_OFFSET);
19242
 
19246
 
19243
type
19247
type
19244
  IDirectMusicBuffer = interface;
19248
  IDirectMusicBuffer = interface;
19245
  IDirectMusicPort = interface;
19249
  IDirectMusicPort = interface;
19246
  IDirectMusicThru = interface;
19250
  IDirectMusicThru = interface;
19247
  IReferenceClock = interface;
19251
  IReferenceClock = interface;
19248
  PIReferenceClock = IReferenceClock;
19252
  PIReferenceClock = IReferenceClock;
19249
 
19253
 
19250
  IDirectMusic = interface (IUnknown)
19254
  IDirectMusic = interface (IUnknown)
19251
    ['{6536115a-7b2d-11d2-ba18-0000f875ac12}']
19255
    ['{6536115a-7b2d-11d2-ba18-0000f875ac12}']
19252
    function EnumPort (dwIndex: DWORD;
19256
    function EnumPort (dwIndex: DWORD;
19253
                       var pPortCaps: TDMus_PortCaps) : HResult; stdcall;
19257
                       var pPortCaps: TDMus_PortCaps) : HResult; stdcall;
19254
    function CreateMusicBuffer (var pBufferDesc: TDMus_BufferDesc;
19258
    function CreateMusicBuffer (var pBufferDesc: TDMus_BufferDesc;
19255
                                out ppBuffer: IDirectMusicBuffer;
19259
                                out ppBuffer: IDirectMusicBuffer;
19256
                                pUnkOuter: IUnknown) : HResult; stdcall;
19260
                                pUnkOuter: IUnknown) : HResult; stdcall;
19257
    function CreatePort (const rclsidPort: TGUID;
19261
    function CreatePort (const rclsidPort: TGUID;
19258
                         const pPortParams: TDMus_PortParams;
19262
                         const pPortParams: TDMus_PortParams;
19259
                         out ppPort: IDirectMusicPort;
19263
                         out ppPort: IDirectMusicPort;
19260
                         pUnkOuter: IUnknown) : HResult; stdcall;
19264
                         pUnkOuter: IUnknown) : HResult; stdcall;
19261
    function EnumMasterClock (dwIndex: DWORD;
19265
    function EnumMasterClock (dwIndex: DWORD;
19262
                              var lpClockInfo: TDMus_ClockInfo) : HResult; stdcall;
19266
                              var lpClockInfo: TDMus_ClockInfo) : HResult; stdcall;
19263
    function GetMasterClock (pguidClock: PGUID;
19267
    function GetMasterClock (pguidClock: PGUID;
19264
                             ppReferenceClock : PIReferenceClock) : HResult; stdcall;
19268
                             ppReferenceClock : PIReferenceClock) : HResult; stdcall;
19265
    function SetMasterClock (const rguidClock: TGUID) : HResult; stdcall;
19269
    function SetMasterClock (const rguidClock: TGUID) : HResult; stdcall;
19266
    function Activate (fEnable: BOOL) : HResult; stdcall;
19270
    function Activate (fEnable: BOOL) : HResult; stdcall;
19267
    function GetDefaultPort (out pguidPort: TGUID) : HResult; stdcall;
19271
    function GetDefaultPort (out pguidPort: TGUID) : HResult; stdcall;
19268
    function SetDirectSound (pDirectSound: IDirectSound;
19272
    function SetDirectSound (pDirectSound: IDirectSound;
19269
                             hWnd: HWND) : HResult; stdcall;
19273
                             hWnd: HWND) : HResult; stdcall;
19270
 
19274
 
19271
  end;
19275
  end;
19272
 
19276
 
19273
  IDirectMusicBuffer = interface (IUnknown)
19277
  IDirectMusicBuffer = interface (IUnknown)
19274
    ['{d2ac2878-b39b-11d1-8704-00600893b1bd}']
19278
    ['{d2ac2878-b39b-11d1-8704-00600893b1bd}']
19275
    function Flush : HResult; stdcall;
19279
    function Flush : HResult; stdcall;
19276
    function TotalTime (out prtTime: TReference_Time) : HResult; stdcall;
19280
    function TotalTime (out prtTime: TReference_Time) : HResult; stdcall;
19277
    function PackStructured (const rt: TReference_Time;
19281
    function PackStructured (const rt: TReference_Time;
19278
                             dwChannelGroup: DWORD;
19282
                             dwChannelGroup: DWORD;
19279
                             dwChannelMessage: DWORD ) : HResult; stdcall;
19283
                             dwChannelMessage: DWORD ) : HResult; stdcall;
19280
    function PackUnstructured (const rt: TReference_Time;
19284
    function PackUnstructured (const rt: TReference_Time;
19281
                               dwChannelGroup: DWORD;
19285
                               dwChannelGroup: DWORD;
19282
                               cb: DWORD;
19286
                               cb: DWORD;
19283
                               const lpb) : HResult; stdcall;
19287
                               const lpb) : HResult; stdcall;
19284
    function ResetReadPtr : HResult; stdcall;
19288
    function ResetReadPtr : HResult; stdcall;
19285
    function GetNextEvent (out prt: TReference_Time;
19289
    function GetNextEvent (out prt: TReference_Time;
19286
                           out pdwChannelGroup: DWORD;
19290
                           out pdwChannelGroup: DWORD;
19287
                           out pdwLength: DWORD;
19291
                           out pdwLength: DWORD;
19288
                           out ppData: Pointer) : HResult; stdcall;
19292
                           out ppData: Pointer) : HResult; stdcall;
19289
 
19293
 
19290
    function GetRawBufferPtr (out ppData: Pointer) : HResult; stdcall;
19294
    function GetRawBufferPtr (out ppData: Pointer) : HResult; stdcall;
19291
    function GetStartTime (out prt: TReference_Time) : HResult; stdcall;
19295
    function GetStartTime (out prt: TReference_Time) : HResult; stdcall;
19292
    function GetUsedBytes (out pcb: DWORD) : HResult; stdcall;
19296
    function GetUsedBytes (out pcb: DWORD) : HResult; stdcall;
19293
    function GetMaxBytes (out pcb: DWORD) : HResult; stdcall;
19297
    function GetMaxBytes (out pcb: DWORD) : HResult; stdcall;
19294
    function GetBufferFormat (out pGuidFormat: TGUID) : HResult; stdcall;
19298
    function GetBufferFormat (out pGuidFormat: TGUID) : HResult; stdcall;
19295
    function SetStartTime (const rt: TReference_Time) : HResult; stdcall;
19299
    function SetStartTime (const rt: TReference_Time) : HResult; stdcall;
19296
    function SetUsedBytes (cb: DWORD) : HResult; stdcall;
19300
    function SetUsedBytes (cb: DWORD) : HResult; stdcall;
19297
  end;
19301
  end;
19298
 
19302
 
19299
 
19303
 
19300
(* Format of DirectMusic events in a buffer
19304
(* Format of DirectMusic events in a buffer
19301
 *
19305
 *
19302
 * A buffer contains 1 or more events, each with the following header.
19306
 * A buffer contains 1 or more events, each with the following header.
19303
 * Immediately following the header is the event data. The header+data
19307
 * Immediately following the header is the event data. The header+data
19304
 * size is rounded to the nearest quadword (8 bytes).
19308
 * size is rounded to the nearest quadword (8 bytes).
19305
 *)
19309
 *)
19306
 
19310
 
19307
  TDMus_EventHeader = packed record
19311
  TDMus_EventHeader = packed record
19308
    cbEvent:        DWORD;                   (* Unrounded bytes in event *)
19312
    cbEvent:        DWORD;                   (* Unrounded bytes in event *)
19309
    dwChannelGroup: DWORD;                   (* Channel group of event *)
19313
    dwChannelGroup: DWORD;                   (* Channel group of event *)
19310
    rtDelta:        TReference_Time;         (* Delta from start time of entire buffer *)
19314
    rtDelta:        TReference_Time;         (* Delta from start time of entire buffer *)
19311
    dwFlags:        DWORD;                   (* Flags DMUS_EVENT_xxx *)
19315
    dwFlags:        DWORD;                   (* Flags DMUS_EVENT_xxx *)
19312
  end;
19316
  end;
19313
 
19317
 
19314
  IDirectMusicInstrument = interface (IUnknown)
19318
  IDirectMusicInstrument = interface (IUnknown)
19315
    ['{d2ac287d-b39b-11d1-8704-00600893b1bd}']
19319
    ['{d2ac287d-b39b-11d1-8704-00600893b1bd}']
19316
    function GetPatch (out pdwPatch: DWORD ) : HResult; stdcall;
19320
    function GetPatch (out pdwPatch: DWORD ) : HResult; stdcall;
19317
    function SetPatch (dwPatch: DWORD) : HResult; stdcall;
19321
    function SetPatch (dwPatch: DWORD) : HResult; stdcall;
19318
  end;
19322
  end;
19319
 
19323
 
19320
  IDirectMusicDownloadedInstrument = interface (IUnknown)
19324
  IDirectMusicDownloadedInstrument = interface (IUnknown)
19321
    ['{d2ac287e-b39b-11d1-8704-00600893b1bd}']
19325
    ['{d2ac287e-b39b-11d1-8704-00600893b1bd}']
19322
    (* None at this time *)
19326
    (* None at this time *)
19323
  end;
19327
  end;
19324
 
19328
 
19325
  IDirectMusicCollection = interface (IUnknown)
19329
  IDirectMusicCollection = interface (IUnknown)
19326
    ['{d2ac287c-b39b-11d1-8704-00600893b1bd}']
19330
    ['{d2ac287c-b39b-11d1-8704-00600893b1bd}']
19327
    function GetInstrument (dwPatch: DWORD;
19331
    function GetInstrument (dwPatch: DWORD;
19328
                            out ppInstrument: IDirectMusicInstrument) : HResult; stdcall;
19332
                            out ppInstrument: IDirectMusicInstrument) : HResult; stdcall;
19329
    function EnumInstrument (dwIndex: DWORD;
19333
    function EnumInstrument (dwIndex: DWORD;
19330
                             out pdwPatch: DWORD;
19334
                             out pdwPatch: DWORD;
19331
                             pwszName: LPWSTR;
19335
                             pwszName: LPWSTR;
19332
                             dwNameLen: DWORD) : HResult; stdcall;
19336
                             dwNameLen: DWORD) : HResult; stdcall;
19333
  end;
19337
  end;
19334
 
19338
 
19335
 
19339
 
19336
  IDirectMusicDownload = interface (IUnknown)
19340
  IDirectMusicDownload = interface (IUnknown)
19337
    ['{d2ac287b-b39b-11d1-8704-00600893b1bd}']
19341
    ['{d2ac287b-b39b-11d1-8704-00600893b1bd}']
19338
    function GetBuffer (out ppvBuffer: Pointer;
19342
    function GetBuffer (out ppvBuffer: Pointer;
19339
                        out pdwSize: DWORD) : HResult; stdcall;
19343
                        out pdwSize: DWORD) : HResult; stdcall;
19340
  end;
19344
  end;
19341
 
19345
 
19342
  IDirectMusicPortDownload = interface (IUnknown)
19346
  IDirectMusicPortDownload = interface (IUnknown)
19343
    ['{d2ac287a-b39b-11d1-8704-00600893b1bd}']
19347
    ['{d2ac287a-b39b-11d1-8704-00600893b1bd}']
19344
    function GetBuffer (dwDLId: DWORD;
19348
    function GetBuffer (dwDLId: DWORD;
19345
                        out ppIDMDownload: IDirectMusicDownload) : HResult; stdcall;
19349
                        out ppIDMDownload: IDirectMusicDownload) : HResult; stdcall;
19346
    function AllocateBuffer (dwSize: DWORD;
19350
    function AllocateBuffer (dwSize: DWORD;
19347
                             out ppIDMDownload: IDirectMusicDownload) : HResult; stdcall;
19351
                             out ppIDMDownload: IDirectMusicDownload) : HResult; stdcall;
19348
    function GetDLId (out pdwStartDLId: DWORD;
19352
    function GetDLId (out pdwStartDLId: DWORD;
19349
                      dwCount: DWORD) : HResult; stdcall;
19353
                      dwCount: DWORD) : HResult; stdcall;
19350
    function GetAppend (out pdwAppend: DWORD) : HResult; stdcall;
19354
    function GetAppend (out pdwAppend: DWORD) : HResult; stdcall;
19351
    function Download (pIDMDownload: IDirectMusicDownload) : HResult; stdcall;
19355
    function Download (pIDMDownload: IDirectMusicDownload) : HResult; stdcall;
19352
    function Unload(pIDMDownload: IDirectMusicDownload) : HResult; stdcall;
19356
    function Unload(pIDMDownload: IDirectMusicDownload) : HResult; stdcall;
19353
  end;
19357
  end;
19354
 
19358
 
19355
  IDirectMusicPort = interface (IUnknown)
19359
  IDirectMusicPort = interface (IUnknown)
19356
    ['{08f2d8c9-37c2-11d2-b9f9-0000f875ac12}']
19360
    ['{08f2d8c9-37c2-11d2-b9f9-0000f875ac12}']
19357
    function PlayBuffer (pBuffer: IDirectMusicBuffer) : HResult; stdcall;
19361
    function PlayBuffer (pBuffer: IDirectMusicBuffer) : HResult; stdcall;
19358
    function SetReadNotificationHandle (hEvent: THANDLE) : HResult; stdcall;
19362
    function SetReadNotificationHandle (hEvent: THANDLE) : HResult; stdcall;
19359
    function Read (pBuffer: IDirectMusicBuffer) : HResult; stdcall;
19363
    function Read (pBuffer: IDirectMusicBuffer) : HResult; stdcall;
19360
    function DownloadInstrument (pInstrument: IDirectMusicInstrument;
19364
    function DownloadInstrument (pInstrument: IDirectMusicInstrument;
19361
                                 out ppDownloadedInstrument: IDirectMusicDownloadedInstrument;
19365
                                 out ppDownloadedInstrument: IDirectMusicDownloadedInstrument;
19362
                                 pNoteRanges: PDMus_NoteRange;
19366
                                 pNoteRanges: PDMus_NoteRange;
19363
                                 dwNumNoteRanges: DWORD) : HResult; stdcall;
19367
                                 dwNumNoteRanges: DWORD) : HResult; stdcall;
19364
    function UnloadInstrument (pDownloadedInstrument: IDirectMusicDownloadedInstrument) : HResult; stdcall;
19368
    function UnloadInstrument (pDownloadedInstrument: IDirectMusicDownloadedInstrument) : HResult; stdcall;
19365
    function GetLatencyClock (out ppClock: IReferenceClock) : HResult; stdcall;
19369
    function GetLatencyClock (out ppClock: IReferenceClock) : HResult; stdcall;
19366
    function GetRunningStats (var pStats: TDMus_SynthStats) : HResult; stdcall;
19370
    function GetRunningStats (var pStats: TDMus_SynthStats) : HResult; stdcall;
19367
    function Compact : HResult; stdcall;
19371
    function Compact : HResult; stdcall;
19368
    function GetCaps (var pPortCaps: TDMus_PortCaps) : HResult; stdcall;
19372
    function GetCaps (var pPortCaps: TDMus_PortCaps) : HResult; stdcall;
19369
    function DeviceIoControl (dwIoControlCode: DWORD;
19373
    function DeviceIoControl (dwIoControlCode: DWORD;
19370
                              const lpInBuffer;
19374
                              const lpInBuffer;
19371
                              nInBufferSize: DWORD;
19375
                              nInBufferSize: DWORD;
19372
                              out lpOutBuffer;
19376
                              out lpOutBuffer;
19373
                              nOutBufferSize: DWORD;
19377
                              nOutBufferSize: DWORD;
19374
                              out lpBytesReturned: DWORD;
19378
                              out lpBytesReturned: DWORD;
19375
                              var lpOverlapped: TOVERLAPPED) : HResult; stdcall;
19379
                              var lpOverlapped: TOVERLAPPED) : HResult; stdcall;
19376
    function SetNumChannelGroups (dwChannelGroups: DWORD) : HResult; stdcall;
19380
    function SetNumChannelGroups (dwChannelGroups: DWORD) : HResult; stdcall;
19377
    function GetNumChannelGroups (out pdwChannelGroups: DWORD) : HResult; stdcall;
19381
    function GetNumChannelGroups (out pdwChannelGroups: DWORD) : HResult; stdcall;
19378
    function Activate (fActive: BOOL) : HResult; stdcall;
19382
    function Activate (fActive: BOOL) : HResult; stdcall;
19379
    function SetChannelPriority (dwChannelGroup, dwChannel,
19383
    function SetChannelPriority (dwChannelGroup, dwChannel,
19380
                                 dwPriority: DWORD) : HResult; stdcall;
19384
                                 dwPriority: DWORD) : HResult; stdcall;
19381
    function GetChannelPriority (dwChannelGroup, dwChannel: DWORD;
19385
    function GetChannelPriority (dwChannelGroup, dwChannel: DWORD;
19382
                                 out pdwPriority: DWORD) : HResult; stdcall;
19386
                                 out pdwPriority: DWORD) : HResult; stdcall;
19383
    function SetDirectSound (pDirectSound: IDirectSound;
19387
    function SetDirectSound (pDirectSound: IDirectSound;
19384
                             pDirectSoundBuffer: IDirectSoundBuffer) : HResult; stdcall;
19388
                             pDirectSoundBuffer: IDirectSoundBuffer) : HResult; stdcall;
19385
    function GetFormat (pWaveFormatEx: PWaveFormatEx;
19389
    function GetFormat (pWaveFormatEx: PWaveFormatEx;
19386
                        var pdwWaveFormatExSize: DWORD;
19390
                        var pdwWaveFormatExSize: DWORD;
19387
                        out pdwBufferSize: DWORD) : HResult; stdcall;
19391
                        out pdwBufferSize: DWORD) : HResult; stdcall;
19388
end;
19392
end;
19389
 
19393
 
19390
  IDirectMusicThru = interface (IUnknown)
19394
  IDirectMusicThru = interface (IUnknown)
19391
    ['{ced153e7-3606-11d2-b9f9-0000f875ac12}']
19395
    ['{ced153e7-3606-11d2-b9f9-0000f875ac12}']
19392
    function ThruChannel (dwSourceChannelGroup,
19396
    function ThruChannel (dwSourceChannelGroup,
19393
                          dwSourceChannel,
19397
                          dwSourceChannel,
19394
                          dwDestinationChannelGroup,
19398
                          dwDestinationChannelGroup,
19395
                          dwDestinationChannel: DWORD;
19399
                          dwDestinationChannel: DWORD;
19396
                          pDestinationPort: IDirectMusicPort) : HResult; stdcall;
19400
                          pDestinationPort: IDirectMusicPort) : HResult; stdcall;
19397
  end;
19401
  end;
19398
 
19402
 
19399
 
19403
 
19400
  IReferenceClock = interface (IUnknown)
19404
  IReferenceClock = interface (IUnknown)
19401
    ['{56a86897-0ad4-11ce-b03a-0020af0ba770}']
19405
    ['{56a86897-0ad4-11ce-b03a-0020af0ba770}']
19402
    (*  get the time now *)
19406
    (*  get the time now *)
19403
    function GetTime (out pTime: TReference_Time) : HResult; stdcall;
19407
    function GetTime (out pTime: TReference_Time) : HResult; stdcall;
19404
 
19408
 
19405
    (*  ask for an async notification that a time has elapsed *)
19409
    (*  ask for an async notification that a time has elapsed *)
19406
    function AdviseTime (const baseTime,                  (*  base time *)
19410
    function AdviseTime (const baseTime,                  (*  base time *)
19407
                         streamTime: TReference_Time;     (*  stream offset time *)
19411
                         streamTime: TReference_Time;     (*  stream offset time *)
19408
                         hEvent: THANDLE;                 (*  advise via this event *)
19412
                         hEvent: THANDLE;                 (*  advise via this event *)
19409
                         var pdwAdviseCookie: DWORD) : HResult; stdcall;   (*  where your cookie goes *)
19413
                         var pdwAdviseCookie: DWORD) : HResult; stdcall;   (*  where your cookie goes *)
19410
 
19414
 
19411
    (*  ask for an async periodic notification that a time has elapsed *)
19415
    (*  ask for an async periodic notification that a time has elapsed *)
19412
    function AdvisePeriodic (const startTime,                  (*  starting at this time *)
19416
    function AdvisePeriodic (const startTime,                  (*  starting at this time *)
19413
                             periodTime: TReference_Time;      (*  time between notifications *)
19417
                             periodTime: TReference_Time;      (*  time between notifications *)
19414
                             hSemaphore: THANDLE;              (*  advise via a semaphore *)
19418
                             hSemaphore: THANDLE;              (*  advise via a semaphore *)
19415
                             var pdwAdviseCookie: DWORD) : HResult; stdcall;   (*  where your cookie goes *)
19419
                             var pdwAdviseCookie: DWORD) : HResult; stdcall;   (*  where your cookie goes *)
19416
 
19420
 
19417
    (*  cancel a request for notification *)
19421
    (*  cancel a request for notification *)
19418
    function Unadvise (dwAdviseCookie: DWORD) : HResult; stdcall;
19422
    function Unadvise (dwAdviseCookie: DWORD) : HResult; stdcall;
19419
  end;
19423
  end;
19420
 
19424
 
19421
type
19425
type
19422
  IID_IDirectMusic = IDirectMusic;
19426
  IID_IDirectMusic = IDirectMusic;
19423
  IID_IDirectMusicBuffer = IDirectMusicBuffer;
19427
  IID_IDirectMusicBuffer = IDirectMusicBuffer;
19424
  IID_IDirectMusicPort = IDirectMusicPort;
19428
  IID_IDirectMusicPort = IDirectMusicPort;
19425
  IID_IDirectMusicThru = IDirectMusicThru;
19429
  IID_IDirectMusicThru = IDirectMusicThru;
19426
  IID_IDirectMusicPortDownload = IDirectMusicPortDownload;
19430
  IID_IDirectMusicPortDownload = IDirectMusicPortDownload;
19427
  IID_IDirectMusicDownload = IDirectMusicDownload;
19431
  IID_IDirectMusicDownload = IDirectMusicDownload;
19428
  IID_IDirectMusicCollection = IDirectMusicCollection;
19432
  IID_IDirectMusicCollection = IDirectMusicCollection;
19429
  IID_IDirectMusicInstrument = IDirectMusicInstrument;
19433
  IID_IDirectMusicInstrument = IDirectMusicInstrument;
19430
  IID_IDirectMusicDownloadedInstrument = IDirectMusicDownloadedInstrument;
19434
  IID_IDirectMusicDownloadedInstrument = IDirectMusicDownloadedInstrument;
19431
  IID_IReferenceClock = IReferenceClock;
19435
  IID_IReferenceClock = IReferenceClock;
19432
 
19436
 
19433
const
19437
const
19434
  CLSID_DirectMusic: TGUID = '{636b9f10-0c7d-11d1-95b2-0020afdc7421}';
19438
  CLSID_DirectMusic: TGUID = '{636b9f10-0c7d-11d1-95b2-0020afdc7421}';
19435
 
19439
 
19436
  CLSID_DirectMusicCollection: TGUID = '{480ff4b0-28b2-11d1-bef7-00c04fbf8fef}';
19440
  CLSID_DirectMusicCollection: TGUID = '{480ff4b0-28b2-11d1-bef7-00c04fbf8fef}';
19437
  CLSID_DirectMusicSynth: TGUID = '{58C2B4D0-46E7-11D1-89AC-00A0C9054129}';
19441
  CLSID_DirectMusicSynth: TGUID = '{58C2B4D0-46E7-11D1-89AC-00A0C9054129}';
19438
 
19442
 
19439
(* Property Query GUID_DMUS_PROP_GM_Hardware - Local GM set, no need to download
19443
(* Property Query GUID_DMUS_PROP_GM_Hardware - Local GM set, no need to download
19440
 * Property Query GUID_DMUS_PROP_GS_Hardware - Local GS set, no need to download
19444
 * Property Query GUID_DMUS_PROP_GS_Hardware - Local GS set, no need to download
19441
 * Property Query GUID_DMUS_PROP_XG_Hardware - Local XG set, no need to download
19445
 * Property Query GUID_DMUS_PROP_XG_Hardware - Local XG set, no need to download
19442
 * Property Query GUID_DMUS_PROP_DLS1        - Support DLS level 1
19446
 * Property Query GUID_DMUS_PROP_DLS1        - Support DLS level 1
19443
 * Property Query GUID_DMUS_PROP_XG_Capable  - Support minimum requirements of XG
19447
 * Property Query GUID_DMUS_PROP_XG_Capable  - Support minimum requirements of XG
19444
 * Property Query GUID_DMUS_PROP_GS_Capable  - Support minimum requirements of GS
19448
 * Property Query GUID_DMUS_PROP_GS_Capable  - Support minimum requirements of GS
19445
 * Property Query GUID_DMUS_PROP_SynthSink_DSOUND - Synthsink talks to DSound
19449
 * Property Query GUID_DMUS_PROP_SynthSink_DSOUND - Synthsink talks to DSound
19446
 * Property Query GUID_DMUS_PROP_SynthSink_WAVE - Synthsink talks to Wave device
19450
 * Property Query GUID_DMUS_PROP_SynthSink_WAVE - Synthsink talks to Wave device
19447
 *
19451
 *
19448
 * Item 0: Supported
19452
 * Item 0: Supported
19449
 * Returns a DWORD which is non-zero if the feature is supported
19453
 * Returns a DWORD which is non-zero if the feature is supported
19450
 *)
19454
 *)
19451
  GUID_DMUS_PROP_GM_Hardware: TGUID = '{178f2f24-c364-11d1-a760-0000f875ac12}';
19455
  GUID_DMUS_PROP_GM_Hardware: TGUID = '{178f2f24-c364-11d1-a760-0000f875ac12}';
19452
  GUID_DMUS_PROP_GS_Hardware: TGUID = '{178f2f25-c364-11d1-a760-0000f875ac12}';
19456
  GUID_DMUS_PROP_GS_Hardware: TGUID = '{178f2f25-c364-11d1-a760-0000f875ac12}';
19453
  GUID_DMUS_PROP_XG_Hardware: TGUID = '{178f2f26-c364-11d1-a760-0000f875ac12}';
19457
  GUID_DMUS_PROP_XG_Hardware: TGUID = '{178f2f26-c364-11d1-a760-0000f875ac12}';
19454
  GUID_DMUS_PROP_XG_Capable: TGUID = '{6496aba1-61b0-11d2-afa6-00aa0024d8b6}';
19458
  GUID_DMUS_PROP_XG_Capable: TGUID = '{6496aba1-61b0-11d2-afa6-00aa0024d8b6}';
19455
  GUID_DMUS_PROP_GS_Capable: TGUID = '{6496aba2-61b0-11d2-afa6-00aa0024d8b6}';
19459
  GUID_DMUS_PROP_GS_Capable: TGUID = '{6496aba2-61b0-11d2-afa6-00aa0024d8b6}';
19456
  GUID_DMUS_PROP_DLS1: TGUID = '{178f2f27-c364-11d1-a760-0000f875ac12}';
19460
  GUID_DMUS_PROP_DLS1: TGUID = '{178f2f27-c364-11d1-a760-0000f875ac12}';
19457
  GUID_DMUS_PROP_DLS2: TGUID = '{f14599e5-4689-11d2-afa6-00aa0024d8b6}';
19461
  GUID_DMUS_PROP_DLS2: TGUID = '{f14599e5-4689-11d2-afa6-00aa0024d8b6}';
19458
  GUID_DMUS_PROP_INSTRUMENT2: TGUID = '{865fd372-9f67-11d2-872a-00600893b1bd}';
19462
  GUID_DMUS_PROP_INSTRUMENT2: TGUID = '{865fd372-9f67-11d2-872a-00600893b1bd}';
19459
  GUID_DMUS_PROP_SynthSink_DSOUND: TGUID = '{0aa97844-c877-11d1-870c-00600893b1bd}';
19463
  GUID_DMUS_PROP_SynthSink_DSOUND: TGUID = '{0aa97844-c877-11d1-870c-00600893b1bd}';
19460
  GUID_DMUS_PROP_SynthSink_WAVE: TGUID = '{0aa97845-c877-11d1-870c-00600893b1bd}';
19464
  GUID_DMUS_PROP_SynthSink_WAVE: TGUID = '{0aa97845-c877-11d1-870c-00600893b1bd}';
19461
  GUID_DMUS_PROP_SampleMemorySize: TGUID = '{178f2f28-c364-11d1-a760-0000f875ac12}';
19465
  GUID_DMUS_PROP_SampleMemorySize: TGUID = '{178f2f28-c364-11d1-a760-0000f875ac12}';
19462
  GUID_DMUS_PROP_SamplePlaybackRate: TGUID = '{2a91f713-a4bf-11d2-bbdf-00600833dbd8}';
19466
  GUID_DMUS_PROP_SamplePlaybackRate: TGUID = '{2a91f713-a4bf-11d2-bbdf-00600833dbd8}';
19463
 
19467
 
19464
(* Property Get/Set GUID_DMUS_PROP_WriteLatency
19468
(* Property Get/Set GUID_DMUS_PROP_WriteLatency
19465
 *
19469
 *
19466
 * Item 0: Synth buffer write latency, in milliseconds
19470
 * Item 0: Synth buffer write latency, in milliseconds
19467
 * Get/Set SynthSink latency, the average time after the play head that the next buffer gets written.
19471
 * Get/Set SynthSink latency, the average time after the play head that the next buffer gets written.
19468
 *)
19472
 *)
19469
  GUID_DMUS_PROP_WriteLatency: TGUID = '{268a0fa0-60f2-11d2-afa6-00aa0024d8b6}';
19473
  GUID_DMUS_PROP_WriteLatency: TGUID = '{268a0fa0-60f2-11d2-afa6-00aa0024d8b6}';
19470
 
19474
 
19471
(* Property Get/Set GUID_DMUS_PROP_WritePeriod
19475
(* Property Get/Set GUID_DMUS_PROP_WritePeriod
19472
 *
19476
 *
19473
 * Item 0: Synth buffer write period, in milliseconds
19477
 * Item 0: Synth buffer write period, in milliseconds
19474
 * Get/Set SynthSink buffer write period, time span between successive writes.
19478
 * Get/Set SynthSink buffer write period, time span between successive writes.
19475
 *)
19479
 *)
19476
  GUID_DMUS_PROP_WritePeriod: TGUID = '{268a0fa1-60f2-11d2-afa6-00aa0024d8b6}';
19480
  GUID_DMUS_PROP_WritePeriod: TGUID = '{268a0fa1-60f2-11d2-afa6-00aa0024d8b6}';
19477
 
19481
 
19478
(* Property Get GUID_DMUS_PROP_MemorySize
19482
(* Property Get GUID_DMUS_PROP_MemorySize
19479
 *
19483
 *
19480
 * Item 0: Memory size
19484
 * Item 0: Memory size
19481
 * Returns a DWORD containing the total number of bytes of sample RAM
19485
 * Returns a DWORD containing the total number of bytes of sample RAM
19482
 *)
19486
 *)
19483
  GUID_DMUS_PROP_MemorySize: TGUID = '{178f2f28-c364-11d1-a760-0000f875ac12}';
19487
  GUID_DMUS_PROP_MemorySize: TGUID = '{178f2f28-c364-11d1-a760-0000f875ac12}';
19484
 
19488
 
19485
(* Property Set GUID_DMUS_PROP_WavesReverb
19489
(* Property Set GUID_DMUS_PROP_WavesReverb
19486
 *
19490
 *
19487
 * Item 0: DMUS_WAVES_REVERB structure
19491
 * Item 0: DMUS_WAVES_REVERB structure
19488
 * Sets reverb parameters
19492
 * Sets reverb parameters
19489
 *)
19493
 *)
19490
  GUID_DMUS_PROP_WavesReverb: TGUID = '{04cb5622-32e5-11d2-afa6-00aa0024d8b6}';
19494
  GUID_DMUS_PROP_WavesReverb: TGUID = '{04cb5622-32e5-11d2-afa6-00aa0024d8b6}';
19491
 
19495
 
19492
(* Property Set GUID_DMUS_PROP_Effects
19496
(* Property Set GUID_DMUS_PROP_Effects
19493
 *
19497
 *
19494
 * Item 0: DWORD with effects flags.
19498
 * Item 0: DWORD with effects flags.
19495
 * Get/Set effects bits, same as dwEffectFlags in DMUS_PORTPARAMS and DMUS_PORTCAPS:
19499
 * Get/Set effects bits, same as dwEffectFlags in DMUS_PORTPARAMS and DMUS_PORTCAPS:
19496
 * DMUS_EFFECT_NONE
19500
 * DMUS_EFFECT_NONE
19497
 * DMUS_EFFECT_REVERB
19501
 * DMUS_EFFECT_REVERB
19498
 * DMUS_EFFECT_CHORUS
19502
 * DMUS_EFFECT_CHORUS
19499
 *)
19503
 *)
19500
  GUID_DMUS_PROP_Effects: TGUID = '{cda8d611-684a-11d2-871e-00600893b1bd}';
19504
  GUID_DMUS_PROP_Effects: TGUID = '{cda8d611-684a-11d2-871e-00600893b1bd}';
19501
 
19505
 
19502
(* Property Set GUID_DMUS_PROP_LegacyCaps
19506
(* Property Set GUID_DMUS_PROP_LegacyCaps
19503
 *
19507
 *
19504
 * Item 0: The MIDINCAPS or MIDIOUTCAPS which describes the port's underlying WinMM device. This property is only supported
19508
 * Item 0: The MIDINCAPS or MIDIOUTCAPS which describes the port's underlying WinMM device. This property is only supported
19505
 * by ports which wrap WinMM devices.
19509
 * by ports which wrap WinMM devices.
19506
 *)
19510
 *)
19507
 
19511
 
19508
  GUID_DMUS_PROP_LegacyCaps: TGUID = '{cfa7cdc2-00a1-11d2-aad5-0000f875ac12}';
19512
  GUID_DMUS_PROP_LegacyCaps: TGUID = '{cfa7cdc2-00a1-11d2-aad5-0000f875ac12}';
19509
 
19513
 
19510
(* Property Set GUID_DMUS_Volume
19514
(* Property Set GUID_DMUS_Volume
19511
 *
19515
 *
19512
 * Item 0: A long which contains an offset, in 1/100 dB, to be added to the final volume
19516
 * Item 0: A long which contains an offset, in 1/100 dB, to be added to the final volume
19513
 *
19517
 *
19514
 *)
19518
 *)
19515
  GUID_DMUS_PROP_Volume: TGUID = '{fedfae25-e46e-11d1-aace-0000f875ac12}';
19519
  GUID_DMUS_PROP_Volume: TGUID = '{fedfae25-e46e-11d1-aace-0000f875ac12}';
19516
 
19520
 
19517
(* Min and Max values for setting volume with GUID_DMUS_PROP_Volume *)
19521
(* Min and Max values for setting volume with GUID_DMUS_PROP_Volume *)
19518
 
19522
 
19519
  DMUS_VOLUME_MAX =    2000;        (* +20 dB *)
19523
  DMUS_VOLUME_MAX =    2000;        (* +20 dB *)
19520
  DMUS_VOLUME_MIN =  -20000;        (* -200 dB *)
19524
  DMUS_VOLUME_MIN =  -20000;        (* -200 dB *)
19521
 
19525
 
19522
(************************************************************************
19526
(************************************************************************
19523
*                                                                       *
19527
*                                                                       *
19524
*   dmusici.h -- This module contains the API for the                   *
19528
*   dmusici.h -- This module contains the API for the                   *
19525
*                DirectMusic performance layer                          *
19529
*                DirectMusic performance layer                          *
19526
*                                                                       *
19530
*                                                                       *
19527
*   Copyright (c) 1998, Microsoft Corp. All rights reserved.            *
19531
*   Copyright (c) 1998, Microsoft Corp. All rights reserved.            *
19528
*                                                                       *
19532
*                                                                       *
19529
************************************************************************)
19533
************************************************************************)
19530
 
19534
 
19531
type
19535
type
19532
  TTransition_Type = WORD;
19536
  TTransition_Type = WORD;
19533
  PMusic_Time = ^TMusic_Time;
19537
  PMusic_Time = ^TMusic_Time;
19534
  TMusic_Time = LongInt;
19538
  TMusic_Time = LongInt;
19535
 
19539
 
19536
const
19540
const
19537
  DMUS_PPQ       = 768;     (* parts per quarter note *)
19541
  DMUS_PPQ       = 768;     (* parts per quarter note *)
19538
 
19542
 
19539
type
19543
type
19540
  TDMus_CommandT_Types = (
19544
  TDMus_CommandT_Types = (
19541
    DMUS_COMMANDT_GROOVE,
19545
    DMUS_COMMANDT_GROOVE,
19542
    DMUS_COMMANDT_FILL  ,
19546
    DMUS_COMMANDT_FILL  ,
19543
    DMUS_COMMANDT_INTRO ,
19547
    DMUS_COMMANDT_INTRO ,
19544
    DMUS_COMMANDT_BREAK ,
19548
    DMUS_COMMANDT_BREAK ,
19545
    DMUS_COMMANDT_END   ,
19549
    DMUS_COMMANDT_END   ,
19546
    DMUS_COMMANDT_ENDANDINTRO
19550
    DMUS_COMMANDT_ENDANDINTRO
19547
  );
19551
  );
19548
 
19552
 
19549
  TDMus_ShapeT_Types = (
19553
  TDMus_ShapeT_Types = (
19550
    DMUS_SHAPET_FALLING ,
19554
    DMUS_SHAPET_FALLING ,
19551
    DMUS_SHAPET_LEVEL   ,
19555
    DMUS_SHAPET_LEVEL   ,
19552
    DMUS_SHAPET_LOOPABLE,
19556
    DMUS_SHAPET_LOOPABLE,
19553
    DMUS_SHAPET_LOUD    ,
19557
    DMUS_SHAPET_LOUD    ,
19554
    DMUS_SHAPET_QUIET   ,
19558
    DMUS_SHAPET_QUIET   ,
19555
    DMUS_SHAPET_PEAKING ,
19559
    DMUS_SHAPET_PEAKING ,
19556
    DMUS_SHAPET_RANDOM  ,
19560
    DMUS_SHAPET_RANDOM  ,
19557
    DMUS_SHAPET_RISING  ,
19561
    DMUS_SHAPET_RISING  ,
19558
    DMUS_SHAPET_SONG
19562
    DMUS_SHAPET_SONG
19559
  );
19563
  );
19560
 
19564
 
19561
type
19565
type
19562
  TDMus_ComposeF_Flags = DWORD;
19566
  TDMus_ComposeF_Flags = DWORD;
19563
const
19567
const
19564
  DMUS_COMPOSEF_NONE              = 0;
19568
  DMUS_COMPOSEF_NONE              = 0;
19565
  DMUS_COMPOSEF_ALIGN             = $1;
19569
  DMUS_COMPOSEF_ALIGN             = $1;
19566
  DMUS_COMPOSEF_OVERLAP           = $2;
19570
  DMUS_COMPOSEF_OVERLAP           = $2;
19567
  DMUS_COMPOSEF_IMMEDIATE         = $4;
19571
  DMUS_COMPOSEF_IMMEDIATE         = $4;
19568
  DMUS_COMPOSEF_GRID              = $8;
19572
  DMUS_COMPOSEF_GRID              = $8;
19569
  DMUS_COMPOSEF_BEAT              = $10;
19573
  DMUS_COMPOSEF_BEAT              = $10;
19570
  DMUS_COMPOSEF_MEASURE           = $20;
19574
  DMUS_COMPOSEF_MEASURE           = $20;
19571
  DMUS_COMPOSEF_AFTERPREPARETIME  = $40;
19575
  DMUS_COMPOSEF_AFTERPREPARETIME  = $40;
19572
  DMUS_COMPOSEF_MODULATE          = $1000;
19576
  DMUS_COMPOSEF_MODULATE          = $1000;
19573
  DMUS_COMPOSEF_LONG              = $2000;
19577
  DMUS_COMPOSEF_LONG              = $2000;
19574
 
19578
 
19575
 
19579
 
19576
type
19580
type
19577
(* DMUS_PMsgF_FLAGS fill the TDMus_PMsg's dwFlags member *)
19581
(* DMUS_PMsgF_FLAGS fill the TDMus_PMsg's dwFlags member *)
19578
  TDMus_PMsgF_Flags = DWORD;
19582
  TDMus_PMsgF_Flags = DWORD;
19579
const
19583
const
19580
  DMUS_PMsgF_REFTIME          = 1;      (* if rtTime is valid *)
19584
  DMUS_PMsgF_REFTIME          = 1;      (* if rtTime is valid *)
19581
  DMUS_PMsgF_MUSICTIME        = 2;      (* if mtTime is valid *)
19585
  DMUS_PMsgF_MUSICTIME        = 2;      (* if mtTime is valid *)
19582
  DMUS_PMsgF_TOOL_IMMEDIATE   = 4;      (* if PMSG should be processed immediately *)
19586
  DMUS_PMsgF_TOOL_IMMEDIATE   = 4;      (* if PMSG should be processed immediately *)
19583
  DMUS_PMsgF_TOOL_QUEUE       = 8;      (* if PMSG should be processed a little early, at Queue time *)
19587
  DMUS_PMsgF_TOOL_QUEUE       = 8;      (* if PMSG should be processed a little early, at Queue time *)
19584
  DMUS_PMsgF_TOOL_ATTIME      = 16;     (* if PMSG should be processed at the time stamp *)
19588
  DMUS_PMsgF_TOOL_ATTIME      = 16;     (* if PMSG should be processed at the time stamp *)
19585
  DMUS_PMsgF_TOOL_FLUSH       = 32;     (* if PMSG is being flushed *)
19589
  DMUS_PMsgF_TOOL_FLUSH       = 32;     (* if PMSG is being flushed *)
19586
  (* The values of DMUS_TIME_RESOLVE_FLAGS may also be used inside the *)
19590
  (* The values of DMUS_TIME_RESOLVE_FLAGS may also be used inside the *)
19587
  (* TDMus_PMsg's dwFlags member. *)
19591
  (* TDMus_PMsg's dwFlags member. *)
19588
 
19592
 
19589
type
19593
type
19590
(* DMUS_PMsgT_TYPES fill the TDMus_PMsg's dwType member *)
19594
(* DMUS_PMsgT_TYPES fill the TDMus_PMsg's dwType member *)
19591
  TDMus_PMsgT_Types = (
19595
  TDMus_PMsgT_Types = (
19592
    DMUS_PMsgT_MIDI            ,      (* MIDI short message *)
19596
    DMUS_PMsgT_MIDI            ,      (* MIDI short message *)
19593
    DMUS_PMsgT_NOTE            ,      (* Interactive Music Note *)
19597
    DMUS_PMsgT_NOTE            ,      (* Interactive Music Note *)
19594
    DMUS_PMsgT_SYSEX           ,      (* MIDI long message (system exclusive message) *)
19598
    DMUS_PMsgT_SYSEX           ,      (* MIDI long message (system exclusive message) *)
19595
    DMUS_PMsgT_NOTIFICATION    ,      (* Notification message *)
19599
    DMUS_PMsgT_NOTIFICATION    ,      (* Notification message *)
19596
    DMUS_PMsgT_TEMPO           ,      (* Tempo message *)
19600
    DMUS_PMsgT_TEMPO           ,      (* Tempo message *)
19597
    DMUS_PMsgT_CURVE           ,      (* Control change / pitch bend, etc. curve *)
19601
    DMUS_PMsgT_CURVE           ,      (* Control change / pitch bend, etc. curve *)
19598
    DMUS_PMsgT_TIMESIG         ,      (* Time signature *)
19602
    DMUS_PMsgT_TIMESIG         ,      (* Time signature *)
19599
    DMUS_PMsgT_PATCH           ,      (* Patch changes *)
19603
    DMUS_PMsgT_PATCH           ,      (* Patch changes *)
19600
    DMUS_PMsgT_TRANSPOSE       ,      (* Transposition messages *)
19604
    DMUS_PMsgT_TRANSPOSE       ,      (* Transposition messages *)
19601
    DMUS_PMsgT_CHANNEL_PRIORITY,      (* Channel priority *)
19605
    DMUS_PMsgT_CHANNEL_PRIORITY,      (* Channel priority *)
19602
    DMUS_PMsgT_STOP            ,      (* Stop message *)
19606
    DMUS_PMsgT_STOP            ,      (* Stop message *)
19603
    DMUS_PMsgT_DIRTY                  (* Tells Tools that cache GetParam() info to refresh *)
19607
    DMUS_PMsgT_DIRTY                  (* Tells Tools that cache GetParam() info to refresh *)
19604
  );
19608
  );
19605
const
19609
const
19606
  DMUS_PMsgT_USER             = TDMus_PMsgT_Types(255); (* User message *)
19610
  DMUS_PMsgT_USER             = TDMus_PMsgT_Types(255); (* User message *)
19607
 
19611
 
19608
type
19612
type
19609
(* DMUS_SEGF_FLAGS correspond to IDirectMusicPerformance::PlaySegment, and other API *)
19613
(* DMUS_SEGF_FLAGS correspond to IDirectMusicPerformance::PlaySegment, and other API *)
19610
  TDMus_SegF_Flags = DWORD;
19614
  TDMus_SegF_Flags = DWORD;
19611
const
19615
const
19612
  DMUS_SEGF_REFTIME           = 64;     (* time parameter is in reference time  *)
19616
  DMUS_SEGF_REFTIME           = 64;     (* time parameter is in reference time  *)
19613
  DMUS_SEGF_SECONDARY         = 128;    (* secondary segment *)
19617
  DMUS_SEGF_SECONDARY         = 128;    (* secondary segment *)
19614
  DMUS_SEGF_QUEUE             = 256;    (* queue at the end of the primary segment queue (primary only) *)
19618
  DMUS_SEGF_QUEUE             = 256;    (* queue at the end of the primary segment queue (primary only) *)
19615
  DMUS_SEGF_CONTROL           = 512;    (* play as a control track (secondary segments only) *)
19619
  DMUS_SEGF_CONTROL           = 512;    (* play as a control track (secondary segments only) *)
19616
  DMUS_SEGF_AFTERPREPARETIME  = 1 shl 10;  (* play after the prepare time (See IDirectMusicPerformance::GetPrepareTime) *)
19620
  DMUS_SEGF_AFTERPREPARETIME  = 1 shl 10;  (* play after the prepare time (See IDirectMusicPerformance::GetPrepareTime) *)
19617
  DMUS_SEGF_GRID              = 1 shl 11;  (* play on grid boundary *)
19621
  DMUS_SEGF_GRID              = 1 shl 11;  (* play on grid boundary *)
19618
  DMUS_SEGF_BEAT              = 1 shl 12;  (* play on beat boundary *)
19622
  DMUS_SEGF_BEAT              = 1 shl 12;  (* play on beat boundary *)
19619
  DMUS_SEGF_MEASURE           = 1 shl 13;  (* play on measure boundary *)
19623
  DMUS_SEGF_MEASURE           = 1 shl 13;  (* play on measure boundary *)
19620
  DMUS_SEGF_DEFAULT           = 1 shl 14;  (* use segment's default boundary *)
19624
  DMUS_SEGF_DEFAULT           = 1 shl 14;  (* use segment's default boundary *)
19621
  DMUS_SEGF_NOINVALIDATE      = 1 shl 15;  (* play without invalidating the currently playing segment(s) *)
19625
  DMUS_SEGF_NOINVALIDATE      = 1 shl 15;  (* play without invalidating the currently playing segment(s) *)
19622
 
19626
 
19623
(* DMUS_TIME_RESOLVE_FLAGS correspond to IDirectMusicPerformance::GetResolvedTime, and can *)
19627
(* DMUS_TIME_RESOLVE_FLAGS correspond to IDirectMusicPerformance::GetResolvedTime, and can *)
19624
(* also be used interchangeably with the corresponding DMUS_SEGF_FLAGS, since their values *)
19628
(* also be used interchangeably with the corresponding DMUS_SEGF_FLAGS, since their values *)
19625
(* are intentionally the same *)
19629
(* are intentionally the same *)
19626
type
19630
type
19627
  TDMus_Time_Resolve_Flags = DWORD;
19631
  TDMus_Time_Resolve_Flags = DWORD;
19628
const
19632
const
19629
  DMUS_TIME_RESOLVE_AFTERPREPARETIME  = 1 shl 10;  (* resolve to a time after the prepare time *)
19633
  DMUS_TIME_RESOLVE_AFTERPREPARETIME  = 1 shl 10;  (* resolve to a time after the prepare time *)
19630
  DMUS_TIME_RESOLVE_GRID              = 1 shl 11;  (* resolve to a time on a grid boundary *)
19634
  DMUS_TIME_RESOLVE_GRID              = 1 shl 11;  (* resolve to a time on a grid boundary *)
19631
  DMUS_TIME_RESOLVE_BEAT              = 1 shl 12;  (* resolve to a time on a beat boundary *)
19635
  DMUS_TIME_RESOLVE_BEAT              = 1 shl 12;  (* resolve to a time on a beat boundary *)
19632
  DMUS_TIME_RESOLVE_MEASURE           = 1 shl 13;  (* resolve to a time on a measure boundary *)
19636
  DMUS_TIME_RESOLVE_MEASURE           = 1 shl 13;  (* resolve to a time on a measure boundary *)
19633
 
19637
 
19634
(* The following flags are sent in the IDirectMusicTrack::Play() method *)
19638
(* The following flags are sent in the IDirectMusicTrack::Play() method *)
19635
(* inside the dwFlags parameter *)
19639
(* inside the dwFlags parameter *)
19636
type
19640
type
19637
  TDMus_TrackF_Flags = DWORD;
19641
  TDMus_TrackF_Flags = DWORD;
19638
const
19642
const
19639
  DMUS_TRACKF_SEEK   = 1;      (* set on a seek *)
19643
  DMUS_TRACKF_SEEK   = 1;      (* set on a seek *)
19640
  DMUS_TRACKF_LOOP   = 2;      (* set on a loop (repeat) *)
19644
  DMUS_TRACKF_LOOP   = 2;      (* set on a loop (repeat) *)
19641
  DMUS_TRACKF_START  = 4;      (* set on first call to Play *)
19645
  DMUS_TRACKF_START  = 4;      (* set on first call to Play *)
19642
  DMUS_TRACKF_FLUSH  = 8;      (* set when this call is in response to a flush on the perfomance *)
19646
  DMUS_TRACKF_FLUSH  = 8;      (* set when this call is in response to a flush on the perfomance *)
19643
  DMUS_TRACKF_DIRTY  = 16;     (* set when the track should consider any cached values from a previous call to GetParam to be invalidated *)
19647
  DMUS_TRACKF_DIRTY  = 16;     (* set when the track should consider any cached values from a previous call to GetParam to be invalidated *)
19644
 
19648
 
19645
  DMUS_MAXSUBCHORD = 8;
19649
  DMUS_MAXSUBCHORD = 8;
19646
 
19650
 
19647
type
19651
type
19648
  IDirectMusicTrack =                interface;
19652
  IDirectMusicTrack =                interface;
19649
  IDirectMusicPerformance =          interface;
19653
  IDirectMusicPerformance =          interface;
19650
  IDirectMusicSegment =              interface;
19654
  IDirectMusicSegment =              interface;
19651
  IDirectMusicSegmentState =         interface;
19655
  IDirectMusicSegmentState =         interface;
19652
  IDirectMusicTool =                 interface;
19656
  IDirectMusicTool =                 interface;
19653
  IDirectMusicGraph =                interface;
19657
  IDirectMusicGraph =                interface;
19654
 
19658
 
19655
 
19659
 
19656
  PIDirectMusicSegmentState = ^IDirectMusicSegmentState;
19660
  PIDirectMusicSegmentState = ^IDirectMusicSegmentState;
19657
 
19661
 
19658
  TDMus_PMsg_Part = record
19662
  TDMus_PMsg_Part = record
19659
    dwSize:          DWORD;
19663
    dwSize:          DWORD;
19660
    rtTime:          TReference_Time;      (* real time (in 100 nanosecond increments) *)
19664
    rtTime:          TReference_Time;      (* real time (in 100 nanosecond increments) *)
19661
    mtTime:          TMusic_Time;          (* music time *)
19665
    mtTime:          TMusic_Time;          (* music time *)
19662
    dwFlags:         DWORD;                (* various bits (see DMUS_PMsg_FLAGS enumeration) *)
19666
    dwFlags:         DWORD;                (* various bits (see DMUS_PMsg_FLAGS enumeration) *)
19663
    dwPChannel:      DWORD;                (* Performance Channel. The Performance can *)
19667
    dwPChannel:      DWORD;                (* Performance Channel. The Performance can *)
19664
                                           (* use this to determine the port/channel. *)
19668
                                           (* use this to determine the port/channel. *)
19665
    dwVirtualTrackID:DWORD;                (* virtual track ID *)
19669
    dwVirtualTrackID:DWORD;                (* virtual track ID *)
19666
    pTool:           IDirectMusicTool;     (* tool interface pointer *)
19670
    pTool:           IDirectMusicTool;     (* tool interface pointer *)
19667
    pGraph:          IDirectMusicGraph;    (* tool graph interface pointer *)
19671
    pGraph:          IDirectMusicGraph;    (* tool graph interface pointer *)
19668
    dwType:          DWORD;                (* PMSG type (see DMUS_PMsgT_TYPES defines) *)
19672
    dwType:          DWORD;                (* PMSG type (see DMUS_PMsgT_TYPES defines) *)
19669
    dwVoiceID:       DWORD;                (* unique voice id which allows synthesizers to *)
19673
    dwVoiceID:       DWORD;                (* unique voice id which allows synthesizers to *)
19670
                                           (* identify a specific event. For DirectX 6.0, *)
19674
                                           (* identify a specific event. For DirectX 6.0, *)
19671
                                           (* this field should always be 0. *)
19675
                                           (* this field should always be 0. *)
19672
    dwGroupID:       DWORD;                (* Track group id *)
19676
    dwGroupID:       DWORD;                (* Track group id *)
19673
    punkUser:        IUnknown;             (* user com pointer, auto released upon PMSG free *)
19677
    punkUser:        IUnknown;             (* user com pointer, auto released upon PMSG free *)
19674
  end;
19678
  end;
19675
 
19679
 
19676
(* every TDMus_PMsg is based off of this structure. The Performance needs
19680
(* every TDMus_PMsg is based off of this structure. The Performance needs
19677
   to access these members consistently in every PMSG that goes through it. *)
19681
   to access these members consistently in every PMSG that goes through it. *)
19678
 
19682
 
19679
    (* begin DMUS_PMsg_PART *)
19683
    (* begin DMUS_PMsg_PART *)
19680
  PDMus_PMsg = ^TDMus_PMsg;  
19684
  PDMus_PMsg = ^TDMus_PMsg;  
19681
  TDMus_PMsg = TDMus_PMsg_Part;
19685
  TDMus_PMsg = TDMus_PMsg_Part;
19682
    (* end DMUS_PMsg_PART *)
19686
    (* end DMUS_PMsg_PART *)
19683
 
19687
 
19684
(* DMUS_NOTIFICATION_PMsg *)
19688
(* DMUS_NOTIFICATION_PMsg *)
19685
  PDMus_Notification_PMsg = ^TDMus_Notification_PMsg;
19689
  PDMus_Notification_PMsg = ^TDMus_Notification_PMsg;
19686
  TDMus_Notification_PMsg = record
19690
  TDMus_Notification_PMsg = record
19687
    (* begin DMUS_PMsg_PART *)
19691
    (* begin DMUS_PMsg_PART *)
19688
    dwSize:          DWORD;
19692
    dwSize:          DWORD;
19689
    rtTime:          TReference_Time;      (* real time (in 100 nanosecond increments) *)
19693
    rtTime:          TReference_Time;      (* real time (in 100 nanosecond increments) *)
19690
    mtTime:          TMusic_Time;          (* music time *)
19694
    mtTime:          TMusic_Time;          (* music time *)
19691
    dwFlags:         DWORD;                (* various bits (see DMUS_PMsg_FLAGS enumeration) *)
19695
    dwFlags:         DWORD;                (* various bits (see DMUS_PMsg_FLAGS enumeration) *)
19692
    dwPChannel:      DWORD;                (* Performance Channel. The Performance can *)
19696
    dwPChannel:      DWORD;                (* Performance Channel. The Performance can *)
19693
                                           (* use this to determine the port/channel. *)
19697
                                           (* use this to determine the port/channel. *)
19694
    dwVirtualTrackID:DWORD;                (* virtual track ID *)
19698
    dwVirtualTrackID:DWORD;                (* virtual track ID *)
19695
    pTool:           IDirectMusicTool;     (* tool interface pointer *)
19699
    pTool:           IDirectMusicTool;     (* tool interface pointer *)
19696
    pGraph:          IDirectMusicGraph;    (* tool graph interface pointer *)
19700
    pGraph:          IDirectMusicGraph;    (* tool graph interface pointer *)
19697
    dwType:          DWORD;                (* PMSG type (see DMUS_PMsgT_TYPES defines) *)
19701
    dwType:          DWORD;                (* PMSG type (see DMUS_PMsgT_TYPES defines) *)
19698
    dwVoiceID:       DWORD;                (* unique voice id which allows synthesizers to *)
19702
    dwVoiceID:       DWORD;                (* unique voice id which allows synthesizers to *)
19699
                                           (* identify a specific event. For DirectX 6.0, *)
19703
                                           (* identify a specific event. For DirectX 6.0, *)
19700
                                           (* this field should always be 0. *)
19704
                                           (* this field should always be 0. *)
19701
    dwGroupID:       DWORD;                (* Track group id *)
19705
    dwGroupID:       DWORD;                (* Track group id *)
19702
    punkUser:        IUnknown;             (* user com pointer, auto released upon PMSG free *)
19706
    punkUser:        IUnknown;             (* user com pointer, auto released upon PMSG free *)
19703
    (* end DMUS_PMsg_PART *)
19707
    (* end DMUS_PMsg_PART *)
19704
 
19708
 
19705
    guidNotificationType: TGUID;
19709
    guidNotificationType: TGUID;
19706
    dwNotificationOption: DWORD;
19710
    dwNotificationOption: DWORD;
19707
    dwField1:             DWORD;
19711
    dwField1:             DWORD;
19708
    dwField2:             DWORD;
19712
    dwField2:             DWORD;
19709
  end;
19713
  end;
19710
 
19714
 
19711
  TDMus_SubChord = packed record
19715
  TDMus_SubChord = packed record
19712
    dwChordPattern:    DWORD;    (* Notes in the subchord *)
19716
    dwChordPattern:    DWORD;    (* Notes in the subchord *)
19713
    dwScalePattern:    DWORD;    (* Notes in the scale *)
19717
    dwScalePattern:    DWORD;    (* Notes in the scale *)
19714
    dwInversionPoints: DWORD;    (* Where inversions can occur *)
19718
    dwInversionPoints: DWORD;    (* Where inversions can occur *)
19715
    dwLevels:          DWORD;    (* Which levels are supported by this subchord *)
19719
    dwLevels:          DWORD;    (* Which levels are supported by this subchord *)
19716
    bChordRoot:        BYTE;     (* Root of the subchord *)
19720
    bChordRoot:        BYTE;     (* Root of the subchord *)
19717
    bScaleRoot:        BYTE;     (* Root of the scale *)
19721
    bScaleRoot:        BYTE;     (* Root of the scale *)
19718
  end;
19722
  end;
19719
 
19723
 
19720
  TDMus_Chord_Key = packed record
19724
  TDMus_Chord_Key = packed record
19721
    wszName: array [0..15] of WideChar;  (* Name of the chord *)
19725
    wszName: array [0..15] of WideChar;  (* Name of the chord *)
19722
    wMeasure:       WORD;                (* Measure this falls on *)
19726
    wMeasure:       WORD;                (* Measure this falls on *)
19723
    bBeat:          BYTE;                (* Beat this falls on *)
19727
    bBeat:          BYTE;                (* Beat this falls on *)
19724
    bSubChordCount: BYTE;                (* Number of chords in the list of subchords *)
19728
    bSubChordCount: BYTE;                (* Number of chords in the list of subchords *)
19725
    SubChordList: array [0..DMUS_MAXSUBCHORD-1] of TDMus_SubChord; (* List of sub chords *)
19729
    SubChordList: array [0..DMUS_MAXSUBCHORD-1] of TDMus_SubChord; (* List of sub chords *)
19726
    dwScale:        DWORD;               (* Scale underlying the entire chord *)
19730
    dwScale:        DWORD;               (* Scale underlying the entire chord *)
19727
    bKey:           BYTE;                (* Key underlying the entire chord *)
19731
    bKey:           BYTE;                (* Key underlying the entire chord *)
19728
  end;
19732
  end;
19729
 
19733
 
19730
(* Time Signature structure, used by IDirectMusicStyle *)
19734
(* Time Signature structure, used by IDirectMusicStyle *)
19731
(* Also used as a parameter for GetParam() and SetParam *)
19735
(* Also used as a parameter for GetParam() and SetParam *)
19732
  TDMus_TimeSignature = packed record
19736
  TDMus_TimeSignature = packed record
19733
    mtTime:           TMusic_Time;
19737
    mtTime:           TMusic_Time;
19734
    bBeatsPerMeasure: BYTE;          (* beats per measure (top of time sig) *)
19738
    bBeatsPerMeasure: BYTE;          (* beats per measure (top of time sig) *)
19735
    bBeat:            BYTE;          (* what note receives the beat (bottom of time sig.) *)
19739
    bBeat:            BYTE;          (* what note receives the beat (bottom of time sig.) *)
19736
                                     (* we can assume that 0 means 256th note *)
19740
                                     (* we can assume that 0 means 256th note *)
19737
    wGridsPerBeat:    WORD;          (* grids per beat *)
19741
    wGridsPerBeat:    WORD;          (* grids per beat *)
19738
  end;
19742
  end;
19739
 
19743
 
19740
(*/////////////////////////////////////////////////////////////////////
19744
(*/////////////////////////////////////////////////////////////////////
19741
// IDirectMusicSegmentState *)
19745
// IDirectMusicSegmentState *)
19742
  IDirectMusicSegmentState = interface (IUnknown)
19746
  IDirectMusicSegmentState = interface (IUnknown)
19743
    ['{a3afdcc7-d3ee-11d1-bc8d-00a0c922e6eb}']
19747
    ['{a3afdcc7-d3ee-11d1-bc8d-00a0c922e6eb}']
19744
    function GetRepeats (out pdwRepeats: DWORD) : HResult; stdcall;
19748
    function GetRepeats (out pdwRepeats: DWORD) : HResult; stdcall;
19745
    function GetSegment (out ppSegment: IDirectMusicSegment) : HResult; stdcall;
19749
    function GetSegment (out ppSegment: IDirectMusicSegment) : HResult; stdcall;
19746
    function GetStartTime (out pmtStart: TMusic_Time) : HResult; stdcall;
19750
    function GetStartTime (out pmtStart: TMusic_Time) : HResult; stdcall;
19747
    function GetSeek (out pmtSeek: TMusic_Time) : HResult; stdcall;
19751
    function GetSeek (out pmtSeek: TMusic_Time) : HResult; stdcall;
19748
    function GetStartPoint (out pmtStart: TMusic_Time) : HResult; stdcall;
19752
    function GetStartPoint (out pmtStart: TMusic_Time) : HResult; stdcall;
19749
  end;
19753
  end;
19750
 
19754
 
19751
(*////////////////////////////////////////////////////////////////////
19755
(*////////////////////////////////////////////////////////////////////
19752
// IDirectMusicSegment *)
19756
// IDirectMusicSegment *)
19753
  IDirectMusicSegment = interface (IUnknown)
19757
  IDirectMusicSegment = interface (IUnknown)
19754
    ['{f96029a2-4282-11d2-8717-00600893b1bd}']
19758
    ['{f96029a2-4282-11d2-8717-00600893b1bd}']
19755
    function GetLength (out pmtLength: TMusic_Time) : HResult; stdcall;
19759
    function GetLength (out pmtLength: TMusic_Time) : HResult; stdcall;
19756
    function SetLength (mtLength: TMusic_Time) : HResult; stdcall;
19760
    function SetLength (mtLength: TMusic_Time) : HResult; stdcall;
19757
    function GetRepeats (out pdwRepeats: DWORD) : HResult; stdcall;
19761
    function GetRepeats (out pdwRepeats: DWORD) : HResult; stdcall;
19758
    function SetRepeats (dwRepeats: DWORD) : HResult; stdcall;
19762
    function SetRepeats (dwRepeats: DWORD) : HResult; stdcall;
19759
    function GetDefaultResolution (out pdwResolution: DWORD) : HResult; stdcall;
19763
    function GetDefaultResolution (out pdwResolution: DWORD) : HResult; stdcall;
19760
    function SetDefaultResolution (dwResolution: DWORD) : HResult; stdcall;
19764
    function SetDefaultResolution (dwResolution: DWORD) : HResult; stdcall;
19761
    function GetTrack (const rguidType: TGUID;
19765
    function GetTrack (const rguidType: TGUID;
19762
                       dwGroupBits, dwIndex: DWORD;
19766
                       dwGroupBits, dwIndex: DWORD;
19763
                       out ppTrack: IDirectMusicTrack) : HResult; stdcall;
19767
                       out ppTrack: IDirectMusicTrack) : HResult; stdcall;
19764
    function GetTrackGroup (pTrack: IDirectMusicTrack;
19768
    function GetTrackGroup (pTrack: IDirectMusicTrack;
19765
                            out pdwGroupBits: DWORD) : HResult; stdcall;
19769
                            out pdwGroupBits: DWORD) : HResult; stdcall;
19766
    function InsertTrack (pTrack: IDirectMusicTrack;
19770
    function InsertTrack (pTrack: IDirectMusicTrack;
19767
                          dwGroupBits: DWORD) : HResult; stdcall;
19771
                          dwGroupBits: DWORD) : HResult; stdcall;
19768
    function RemoveTrack (pTrack: IDirectMusicTrack) : HResult; stdcall;
19772
    function RemoveTrack (pTrack: IDirectMusicTrack) : HResult; stdcall;
19769
    function InitPlay (out ppSegState: IDirectMusicSegmentState;
19773
    function InitPlay (out ppSegState: IDirectMusicSegmentState;
19770
                       pPerformance: IDirectMusicPerformance;
19774
                       pPerformance: IDirectMusicPerformance;
19771
                       dwFlags: DWORD) : HResult; stdcall;
19775
                       dwFlags: DWORD) : HResult; stdcall;
19772
    function GetGraph (out ppGraph: IDirectMusicGraph) : HResult; stdcall;
19776
    function GetGraph (out ppGraph: IDirectMusicGraph) : HResult; stdcall;
19773
    function SetGraph (pGraph: IDirectMusicGraph) : HResult; stdcall;
19777
    function SetGraph (pGraph: IDirectMusicGraph) : HResult; stdcall;
19774
    function AddNotificationType (const rguidNotificationType: TGUID) : HResult; stdcall;
19778
    function AddNotificationType (const rguidNotificationType: TGUID) : HResult; stdcall;
19775
    function RemoveNotificationType (const rguidNotificationType: TGUID) : HResult; stdcall;
19779
    function RemoveNotificationType (const rguidNotificationType: TGUID) : HResult; stdcall;
19776
    function GetParam (const rguidType: TGUID;
19780
    function GetParam (const rguidType: TGUID;
19777
                       dwGroupBits, dwIndex: DWORD;
19781
                       dwGroupBits, dwIndex: DWORD;
19778
                       mtTime:       TMusic_Time;
19782
                       mtTime:       TMusic_Time;
19779
                       out pmtNext:  TMusic_Time;
19783
                       out pmtNext:  TMusic_Time;
19780
                       pParam: Pointer) : HResult; stdcall;
19784
                       pParam: Pointer) : HResult; stdcall;
19781
    function SetParam (const rguidType: TGUID;
19785
    function SetParam (const rguidType: TGUID;
19782
                       dwGroupBits, dwIndex: DWORD;
19786
                       dwGroupBits, dwIndex: DWORD;
19783
                       mtTime: TMusic_Time;
19787
                       mtTime: TMusic_Time;
19784
                       pParam: Pointer) : HResult; stdcall;
19788
                       pParam: Pointer) : HResult; stdcall;
19785
    function Clone (mtStart: TMusic_Time;
19789
    function Clone (mtStart: TMusic_Time;
19786
                    mtEnd:   TMusic_Time;
19790
                    mtEnd:   TMusic_Time;
19787
                    out ppSegment: IDirectMusicSegment) : HResult; stdcall;
19791
                    out ppSegment: IDirectMusicSegment) : HResult; stdcall;
19788
    function SetStartPoint (mtStart: TMusic_Time) : HResult; stdcall;
19792
    function SetStartPoint (mtStart: TMusic_Time) : HResult; stdcall;
19789
    function GetStartPoint (out pmtStart: TMusic_Time) : HResult; stdcall;
19793
    function GetStartPoint (out pmtStart: TMusic_Time) : HResult; stdcall;
19790
    function SetLoopPoints (mtStart: TMusic_Time;
19794
    function SetLoopPoints (mtStart: TMusic_Time;
19791
                            mtEnd:   TMusic_Time) : HResult; stdcall;
19795
                            mtEnd:   TMusic_Time) : HResult; stdcall;
19792
    function GetLoopPoints (out pmtStart, pmtEnd: TMusic_Time) : HResult; stdcall;
19796
    function GetLoopPoints (out pmtStart, pmtEnd: TMusic_Time) : HResult; stdcall;
19793
    function SetPChannelsUsed (dwNumPChannels: DWORD;
19797
    function SetPChannelsUsed (dwNumPChannels: DWORD;
19794
                               var paPChannels: DWORD) : HResult; stdcall;
19798
                               var paPChannels: DWORD) : HResult; stdcall;
19795
  end;
19799
  end;
19796
 
19800
 
19797
 
19801
 
19798
(*////////////////////////////////////////////////////////////////////
19802
(*////////////////////////////////////////////////////////////////////
19799
// IDirectMusicTrack *)
19803
// IDirectMusicTrack *)
19800
  IDirectMusicTrack = interface (IUnknown)
19804
  IDirectMusicTrack = interface (IUnknown)
19801
    ['{f96029a1-4282-11d2-8717-00600893b1bd}']
19805
    ['{f96029a1-4282-11d2-8717-00600893b1bd}']
19802
    function Init (pSegment: IDirectMusicSegment) : HResult; stdcall;
19806
    function Init (pSegment: IDirectMusicSegment) : HResult; stdcall;
19803
    function InitPlay (pSegmentState: IDirectMusicSegmentState;
19807
    function InitPlay (pSegmentState: IDirectMusicSegmentState;
19804
                       pPerformance:  IDirectMusicPerformance;
19808
                       pPerformance:  IDirectMusicPerformance;
19805
                       out ppStateData: Pointer;
19809
                       out ppStateData: Pointer;
19806
                       dwVirtualTrackID, dwFlags: DWORD) : HResult; stdcall;
19810
                       dwVirtualTrackID, dwFlags: DWORD) : HResult; stdcall;
19807
    function EndPlay (pStateData: Pointer) : HResult; stdcall;
19811
    function EndPlay (pStateData: Pointer) : HResult; stdcall;
19808
    function Play    (pStateData: Pointer;
19812
    function Play    (pStateData: Pointer;
19809
                      mtStart:    TMusic_Time;
19813
                      mtStart:    TMusic_Time;
19810
                      mtEnd:      TMusic_Time;
19814
                      mtEnd:      TMusic_Time;
19811
                      mtOffset:   TMusic_Time;
19815
                      mtOffset:   TMusic_Time;
19812
                      dwFlags:    DWORD;
19816
                      dwFlags:    DWORD;
19813
                      pPerf:      IDirectMusicPerformance;
19817
                      pPerf:      IDirectMusicPerformance;
19814
                      pSegSt:     IDirectMusicSegmentState;
19818
                      pSegSt:     IDirectMusicSegmentState;
19815
                      dwVirtualID:DWORD) : HResult; stdcall;
19819
                      dwVirtualID:DWORD) : HResult; stdcall;
19816
    function GetParam (const rguidType: TGUID;
19820
    function GetParam (const rguidType: TGUID;
19817
                       mtTime:      TMusic_Time;
19821
                       mtTime:      TMusic_Time;
19818
                       out pmtNext: TMusic_Time;
19822
                       out pmtNext: TMusic_Time;
19819
                       pParam: Pointer) : HResult; stdcall;
19823
                       pParam: Pointer) : HResult; stdcall;
19820
    function SetParam (const rguidType: TGUID;
19824
    function SetParam (const rguidType: TGUID;
19821
                       mtTime: TMusic_Time;
19825
                       mtTime: TMusic_Time;
19822
                       pParam: Pointer) : HResult; stdcall;
19826
                       pParam: Pointer) : HResult; stdcall;
19823
    function IsParamSupported  (const rguidType: TGUID) : HResult; stdcall;
19827
    function IsParamSupported  (const rguidType: TGUID) : HResult; stdcall;
19824
    function AddNotificationType (const rguidNotificationType: TGUID) : HResult; stdcall;
19828
    function AddNotificationType (const rguidNotificationType: TGUID) : HResult; stdcall;
19825
    function RemoveNotificationType (const rguidNotificationType: TGUID) : HResult; stdcall;
19829
    function RemoveNotificationType (const rguidNotificationType: TGUID) : HResult; stdcall;
19826
    function Clone (mtStart: TMusic_Time;
19830
    function Clone (mtStart: TMusic_Time;
19827
                    mtEnd:   TMusic_Time;
19831
                    mtEnd:   TMusic_Time;
19828
                    out ppTrack: IDirectMusicTrack) : HResult; stdcall;
19832
                    out ppTrack: IDirectMusicTrack) : HResult; stdcall;
19829
  end;
19833
  end;
19830
 
19834
 
19831
PIDirectMusic = ^IDirectMusic;
19835
PIDirectMusic = ^IDirectMusic;
19832
 
19836
 
19833
(*////////////////////////////////////////////////////////////////////
19837
(*////////////////////////////////////////////////////////////////////
19834
// IDirectMusicPerformance *)
19838
// IDirectMusicPerformance *)
19835
  IDirectMusicPerformance = interface (IUnknown)
19839
  IDirectMusicPerformance = interface (IUnknown)
19836
    ['{07d43d03-6523-11d2-871d-00600893b1bd}']
19840
    ['{07d43d03-6523-11d2-871d-00600893b1bd}']
19837
    function Init (ppDirectMusic: PIDirectMusic;
19841
    function Init (ppDirectMusic: PIDirectMusic;
19838
                   pDirectSound: IDirectSound;
19842
                   pDirectSound: IDirectSound;
19839
                   hWnd: HWND ) : HResult; stdcall;
19843
                   hWnd: HWND ) : HResult; stdcall;
19840
    function PlaySegment (pSegment: IDirectMusicSegment;
19844
    function PlaySegment (pSegment: IDirectMusicSegment;
19841
                          dwFlags: DWORD;
19845
                          dwFlags: DWORD;
19842
                          i64StartTime: LongLong;
19846
                          i64StartTime: LongLong;
19843
                          ppSegmentState: PIDirectMusicSegmentState) : HResult; stdcall;
19847
                          ppSegmentState: PIDirectMusicSegmentState) : HResult; stdcall;
19844
    function Stop (pSegment: IDirectMusicSegment;
19848
    function Stop (pSegment: IDirectMusicSegment;
19845
                   pSegmentState: IDirectMusicSegmentState;
19849
                   pSegmentState: IDirectMusicSegmentState;
19846
                   mtTime: TMusic_Time;
19850
                   mtTime: TMusic_Time;
19847
                   dwFlags: DWORD) : HResult; stdcall;
19851
                   dwFlags: DWORD) : HResult; stdcall;
19848
    function GetSegmentState (out ppSegmentState: IDirectMusicSegmentState;
19852
    function GetSegmentState (out ppSegmentState: IDirectMusicSegmentState;
19849
                              mtTime: TMusic_Time) : HResult; stdcall;
19853
                              mtTime: TMusic_Time) : HResult; stdcall;
19850
    function SetPrepareTime (dwMilliSeconds: DWORD) : HResult; stdcall;
19854
    function SetPrepareTime (dwMilliSeconds: DWORD) : HResult; stdcall;
19851
    function GetPrepareTime (out pdwMilliSeconds: DWORD) : HResult; stdcall;
19855
    function GetPrepareTime (out pdwMilliSeconds: DWORD) : HResult; stdcall;
19852
    function SetBumperLength (dwMilliSeconds: DWORD) : HResult; stdcall;
19856
    function SetBumperLength (dwMilliSeconds: DWORD) : HResult; stdcall;
19853
    function GetBumperLength (out pdwMilliSeconds: DWORD) : HResult; stdcall;
19857
    function GetBumperLength (out pdwMilliSeconds: DWORD) : HResult; stdcall;
19854
    function SendPMsg (out pPMSG: TDMus_PMsg) : HResult; stdcall;
19858
    function SendPMsg (out pPMSG: TDMus_PMsg) : HResult; stdcall;
19855
    function MusicToReferenceTime (mtTime: TMusic_Time;
19859
    function MusicToReferenceTime (mtTime: TMusic_Time;
19856
                                   out prtTime: TReference_Time) : HResult; stdcall;
19860
                                   out prtTime: TReference_Time) : HResult; stdcall;
19857
    function ReferenceToMusicTime (rtTime: TReference_Time;
19861
    function ReferenceToMusicTime (rtTime: TReference_Time;
19858
                                   out pmtTime: TMusic_Time) : HResult; stdcall;
19862
                                   out pmtTime: TMusic_Time) : HResult; stdcall;
19859
    function IsPlaying (pSegment: IDirectMusicSegment;
19863
    function IsPlaying (pSegment: IDirectMusicSegment;
19860
                        pSegState: IDirectMusicSegmentState) : HResult; stdcall;
19864
                        pSegState: IDirectMusicSegmentState) : HResult; stdcall;
19861
    function GetTime (prtNow: PReference_Time;
19865
    function GetTime (prtNow: PReference_Time;
19862
                      pmtNow: PMusic_Time) : HResult; stdcall;
19866
                      pmtNow: PMusic_Time) : HResult; stdcall;
19863
    function AllocPMsg (cb: ULONG;
19867
    function AllocPMsg (cb: ULONG;
19864
                        out ppPMSG: PDMus_PMsg) : HResult; stdcall;
19868
                        out ppPMSG: PDMus_PMsg) : HResult; stdcall;
19865
    function FreePMsg (pPMSG: PDMus_PMsg) : HResult; stdcall;
19869
    function FreePMsg (pPMSG: PDMus_PMsg) : HResult; stdcall;
19866
    function GetGraph (out ppGraph: IDirectMusicGraph) : HResult; stdcall;
19870
    function GetGraph (out ppGraph: IDirectMusicGraph) : HResult; stdcall;
19867
    function SetGraph (pGraph: IDirectMusicGraph) : HResult; stdcall;
19871
    function SetGraph (pGraph: IDirectMusicGraph) : HResult; stdcall;
19868
    function SetNotificationHandle (hNotification: THANDLE;
19872
    function SetNotificationHandle (hNotification: THANDLE;
19869
                                    rtMinimum: TReference_Time) : HResult; stdcall;
19873
                                    rtMinimum: TReference_Time) : HResult; stdcall;
19870
    function GetNotificationPMsg (out ppNotificationPMsg: PDMus_Notification_PMsg) : HResult; stdcall;
19874
    function GetNotificationPMsg (out ppNotificationPMsg: PDMus_Notification_PMsg) : HResult; stdcall;
19871
    function AddNotificationType (const rguidNotificationType: TGUID) : HResult; stdcall;
19875
    function AddNotificationType (const rguidNotificationType: TGUID) : HResult; stdcall;
19872
    function RemoveNotificationType (const rguidNotificationType: TGUID) : HResult; stdcall;
19876
    function RemoveNotificationType (const rguidNotificationType: TGUID) : HResult; stdcall;
19873
    function AddPort (pPort: IDirectMusicPort) : HResult; stdcall;
19877
    function AddPort (pPort: IDirectMusicPort) : HResult; stdcall;
19874
    function RemovePort (pPort: IDirectMusicPort) : HResult; stdcall;
19878
    function RemovePort (pPort: IDirectMusicPort) : HResult; stdcall;
19875
    function AssignPChannelBlock (dwBlockNum: DWORD;
19879
    function AssignPChannelBlock (dwBlockNum: DWORD;
19876
                                  pPort: IDirectMusicPort;
19880
                                  pPort: IDirectMusicPort;
19877
                                  dwGroup: DWORD) : HResult; stdcall;
19881
                                  dwGroup: DWORD) : HResult; stdcall;
19878
    function AssignPChannel (dwPChannel: DWORD;
19882
    function AssignPChannel (dwPChannel: DWORD;
19879
                             pPort: IDirectMusicPort;
19883
                             pPort: IDirectMusicPort;
19880
                             dwGroup, dwMChannel: DWORD) : HResult; stdcall;
19884
                             dwGroup, dwMChannel: DWORD) : HResult; stdcall;
19881
    function PChannelInfo (dwPChannel: DWORD;
19885
    function PChannelInfo (dwPChannel: DWORD;
19882
                           out ppPort: IDirectMusicPort;
19886
                           out ppPort: IDirectMusicPort;
19883
                           out pdwGroup, pdwMChannel: DWORD ) : HResult; stdcall;
19887
                           out pdwGroup, pdwMChannel: DWORD ) : HResult; stdcall;
19884
    function DownloadInstrument (pInst: IDirectMusicInstrument;
19888
    function DownloadInstrument (pInst: IDirectMusicInstrument;
19885
                                 dwPChannel: DWORD;
19889
                                 dwPChannel: DWORD;
19886
                                 out ppDownInst: IDirectMusicDownloadedInstrument;
19890
                                 out ppDownInst: IDirectMusicDownloadedInstrument;
19887
                                 var pNoteRanges: TDMus_NoteRange;
19891
                                 var pNoteRanges: TDMus_NoteRange;
19888
                                 dwNumNoteRanges: DWORD;
19892
                                 dwNumNoteRanges: DWORD;
19889
                                 out ppPort: IDirectMusicPort;
19893
                                 out ppPort: IDirectMusicPort;
19890
                                 out pdwGroup, pdwMChannel: DWORD) : HResult; stdcall;
19894
                                 out pdwGroup, pdwMChannel: DWORD) : HResult; stdcall;
19891
    function Invalidate (mtTime: TMusic_Time;
19895
    function Invalidate (mtTime: TMusic_Time;
19892
                         dwFlags: DWORD) : HResult; stdcall;
19896
                         dwFlags: DWORD) : HResult; stdcall;
19893
    function GetParam (const rguidType: TGUID;
19897
    function GetParam (const rguidType: TGUID;
19894
                       dwGroupBits, dwIndex: DWORD;
19898
                       dwGroupBits, dwIndex: DWORD;
19895
                       mtTime:      TMusic_Time;
19899
                       mtTime:      TMusic_Time;
19896
                       out pmtNext: TMusic_Time;
19900
                       out pmtNext: TMusic_Time;
19897
                       pParam: Pointer) : HResult; stdcall;
19901
                       pParam: Pointer) : HResult; stdcall;
19898
    function SetParam (const rguidType: TGUID;
19902
    function SetParam (const rguidType: TGUID;
19899
                       dwGroupBits, dwIndex: DWORD;
19903
                       dwGroupBits, dwIndex: DWORD;
19900
                       mtTime: TMusic_Time;
19904
                       mtTime: TMusic_Time;
19901
                       pParam: Pointer) : HResult; stdcall;
19905
                       pParam: Pointer) : HResult; stdcall;
19902
    function GetGlobalParam (const rguidType: TGUID;
19906
    function GetGlobalParam (const rguidType: TGUID;
19903
                             pParam: Pointer;
19907
                             pParam: Pointer;
19904
                             dwSize: DWORD) : HResult; stdcall;
19908
                             dwSize: DWORD) : HResult; stdcall;
19905
    function SetGlobalParam (const rguidType: TGUID;
19909
    function SetGlobalParam (const rguidType: TGUID;
19906
                             pParam: Pointer;
19910
                             pParam: Pointer;
19907
                             dwSize: DWORD) : HResult; stdcall;
19911
                             dwSize: DWORD) : HResult; stdcall;
19908
    function GetLatencyTime (out prtTime: TReference_Time) : HResult; stdcall;
19912
    function GetLatencyTime (out prtTime: TReference_Time) : HResult; stdcall;
19909
    function GetQueueTime (out prtTime: TReference_Time) : HResult; stdcall;
19913
    function GetQueueTime (out prtTime: TReference_Time) : HResult; stdcall;
19910
    function AdjustTime (rtAmount: TReference_Time) : HResult; stdcall;
19914
    function AdjustTime (rtAmount: TReference_Time) : HResult; stdcall;
19911
    function CloseDown : HResult; stdcall;
19915
    function CloseDown : HResult; stdcall;
19912
    function GetResolvedTime (rtTime: TReference_Time;
19916
    function GetResolvedTime (rtTime: TReference_Time;
19913
                              out prtResolved: TReference_Time;
19917
                              out prtResolved: TReference_Time;
19914
                              dwTimeResolveFlags: DWORD) : HResult; stdcall;
19918
                              dwTimeResolveFlags: DWORD) : HResult; stdcall;
19915
    function MIDIToMusic (bMIDIValue: BYTE;
19919
    function MIDIToMusic (bMIDIValue: BYTE;
19916
                          const pChord: TDMus_Chord_Key;
19920
                          const pChord: TDMus_Chord_Key;
19917
                          bPlayMode, bChordLevel: Byte;
19921
                          bPlayMode, bChordLevel: Byte;
19918
                          out pwMusicValue: WORD) : HResult; stdcall;
19922
                          out pwMusicValue: WORD) : HResult; stdcall;
19919
    function MusicToMIDI (wMusicValue: WORD;
19923
    function MusicToMIDI (wMusicValue: WORD;
19920
                          const pChord: TDMus_Chord_Key;
19924
                          const pChord: TDMus_Chord_Key;
19921
                          bPlayMode, bChordLevel: BYTE;
19925
                          bPlayMode, bChordLevel: BYTE;
19922
                          out pbMIDIValue: BYTE) : HResult; stdcall;
19926
                          out pbMIDIValue: BYTE) : HResult; stdcall;
19923
    function TimeToRhythm (mtTime: TMusic_Time;
19927
    function TimeToRhythm (mtTime: TMusic_Time;
19924
                           const pTimeSig: TDMus_TimeSignature;
19928
                           const pTimeSig: TDMus_TimeSignature;
19925
                           out pwMeasure: WORD;
19929
                           out pwMeasure: WORD;
19926
                           out pbBeat, pbGrid: BYTE;
19930
                           out pbBeat, pbGrid: BYTE;
19927
                           out pnOffset: SmallInt) : HResult; stdcall;
19931
                           out pnOffset: SmallInt) : HResult; stdcall;
19928
    function RhythmToTime (wMeasure: WORD;
19932
    function RhythmToTime (wMeasure: WORD;
19929
                           bBeat, bGrid: BYTE;
19933
                           bBeat, bGrid: BYTE;
19930
                           nOffset: SmallInt;
19934
                           nOffset: SmallInt;
19931
                           const pTimeSig: TDMus_TimeSignature;
19935
                           const pTimeSig: TDMus_TimeSignature;
19932
                           out pmtTime: TMusic_Time) : HResult; stdcall;
19936
                           out pmtTime: TMusic_Time) : HResult; stdcall;
19933
end;
19937
end;
19934
 
19938
 
19935
(*////////////////////////////////////////////////////////////////////
19939
(*////////////////////////////////////////////////////////////////////
19936
// IDirectMusicTool *)
19940
// IDirectMusicTool *)
19937
  IDirectMusicTool = interface (IUnknown)
19941
  IDirectMusicTool = interface (IUnknown)
19938
    ['{d2ac28ba-b39b-11d1-8704-00600893b1bd}']
19942
    ['{d2ac28ba-b39b-11d1-8704-00600893b1bd}']
19939
    function Init (pGraph: IDirectMusicGraph) : HResult; stdcall;
19943
    function Init (pGraph: IDirectMusicGraph) : HResult; stdcall;
19940
    function GetMsgDeliveryType (out pdwDeliveryType: DWORD) : HResult; stdcall;
19944
    function GetMsgDeliveryType (out pdwDeliveryType: DWORD) : HResult; stdcall;
19941
    function GetMediaTypeArraySize (out pdwNumElements: DWORD) : HResult; stdcall;
19945
    function GetMediaTypeArraySize (out pdwNumElements: DWORD) : HResult; stdcall;
19942
    function GetMediaTypes (out padwMediaTypes: PDWORD;
19946
    function GetMediaTypes (out padwMediaTypes: PDWORD;
19943
                            dwNumElements: DWORD) : HResult; stdcall;
19947
                            dwNumElements: DWORD) : HResult; stdcall;
19944
    function ProcessPMsg (pPerf: IDirectMusicPerformance;
19948
    function ProcessPMsg (pPerf: IDirectMusicPerformance;
19945
                          var pPMSG: TDMus_PMsg) : HResult; stdcall;
19949
                          var pPMSG: TDMus_PMsg) : HResult; stdcall;
19946
    function Flush (pPerf: IDirectMusicPerformance;
19950
    function Flush (pPerf: IDirectMusicPerformance;
19947
                    const pPMSG: TDMus_PMsg;
19951
                    const pPMSG: TDMus_PMsg;
19948
                    rtTime: TReference_Time) : HResult; stdcall;
19952
                    rtTime: TReference_Time) : HResult; stdcall;
19949
end;
19953
end;
19950
 
19954
 
19951
(*////////////////////////////////////////////////////////////////////
19955
(*////////////////////////////////////////////////////////////////////
19952
// IDirectMusicGraph *)
19956
// IDirectMusicGraph *)
19953
  IDirectMusicGraph = interface (IUnknown)
19957
  IDirectMusicGraph = interface (IUnknown)
19954
    ['{2befc277-5497-11d2-bccb-00a0c922e6eb}']
19958
    ['{2befc277-5497-11d2-bccb-00a0c922e6eb}']
19955
    function StampPMsg (var pPMSG: TDMus_PMsg ) : HResult; stdcall;
19959
    function StampPMsg (var pPMSG: TDMus_PMsg ) : HResult; stdcall;
19956
    function InsertTool (pTool: IDirectMusicTool;
19960
    function InsertTool (pTool: IDirectMusicTool;
19957
                         var pdwPChannels: DWORD;
19961
                         var pdwPChannels: DWORD;
19958
                         cPChannels: DWORD;
19962
                         cPChannels: DWORD;
19959
                         lIndex: LongInt) : HResult; stdcall;
19963
                         lIndex: LongInt) : HResult; stdcall;
19960
    function GetTool (dwIndex: DWORD;
19964
    function GetTool (dwIndex: DWORD;
19961
                      out ppTool: IDirectMusicTool) : HResult; stdcall;
19965
                      out ppTool: IDirectMusicTool) : HResult; stdcall;
19962
    function RemoveTool (pTool: IDirectMusicTool) : HResult; stdcall;
19966
    function RemoveTool (pTool: IDirectMusicTool) : HResult; stdcall;
19963
  end;
19967
  end;
19964
 
19968
 
19965
 
19969
 
19966
(* DMUS_NOTE_PMsg *)
19970
(* DMUS_NOTE_PMsg *)
19967
  TDMus_Note_PMsg = packed record
19971
  TDMus_Note_PMsg = packed record
19968
    (* begin DMUS_PMsg_PART *)
19972
    (* begin DMUS_PMsg_PART *)
19969
    dwSize:          DWORD;
19973
    dwSize:          DWORD;
19970
    rtTime:          TReference_Time;      (* real time (in 100 nanosecond increments) *)
19974
    rtTime:          TReference_Time;      (* real time (in 100 nanosecond increments) *)
19971
    mtTime:          TMusic_Time;          (* music time *)
19975
    mtTime:          TMusic_Time;          (* music time *)
19972
    dwFlags:         DWORD;                (* various bits (see DMUS_PMsg_FLAGS enumeration) *)
19976
    dwFlags:         DWORD;                (* various bits (see DMUS_PMsg_FLAGS enumeration) *)
19973
    dwPChannel:      DWORD;                (* Performance Channel. The Performance can *)
19977
    dwPChannel:      DWORD;                (* Performance Channel. The Performance can *)
19974
                                           (* use this to determine the port/channel. *)
19978
                                           (* use this to determine the port/channel. *)
19975
    dwVirtualTrackID:DWORD;                (* virtual track ID *)
19979
    dwVirtualTrackID:DWORD;                (* virtual track ID *)
19976
    pTool:           IDirectMusicTool;     (* tool interface pointer *)
19980
    pTool:           IDirectMusicTool;     (* tool interface pointer *)
19977
    pGraph:          IDirectMusicGraph;    (* tool graph interface pointer *)
19981
    pGraph:          IDirectMusicGraph;    (* tool graph interface pointer *)
19978
    dwType:          DWORD;                (* PMSG type (see DMUS_PMsgT_TYPES defines) *)
19982
    dwType:          DWORD;                (* PMSG type (see DMUS_PMsgT_TYPES defines) *)
19979
    dwVoiceID:       DWORD;                (* unique voice id which allows synthesizers to *)
19983
    dwVoiceID:       DWORD;                (* unique voice id which allows synthesizers to *)
19980
                                           (* identify a specific event. For DirectX 6.0, *)
19984
                                           (* identify a specific event. For DirectX 6.0, *)
19981
                                           (* this field should always be 0. *)
19985
                                           (* this field should always be 0. *)
19982
    dwGroupID:       DWORD;                (* Track group id *)
19986
    dwGroupID:       DWORD;                (* Track group id *)
19983
    punkUser:        IUnknown;             (* user com pointer, auto released upon PMSG free *)
19987
    punkUser:        IUnknown;             (* user com pointer, auto released upon PMSG free *)
19984
    (* end DMUS_PMsg_PART *)
19988
    (* end DMUS_PMsg_PART *)
19985
 
19989
 
19986
    mtDuration: TMusic_Time;    (* duration *)
19990
    mtDuration: TMusic_Time;    (* duration *)
19987
    wMusicValue:    WORD;       (* Description of note in chord and key. *)
19991
    wMusicValue:    WORD;       (* Description of note in chord and key. *)
19988
    wMeasure:       WORD;       (* Measure in which this note occurs *)
19992
    wMeasure:       WORD;       (* Measure in which this note occurs *)
19989
    nOffset:        SmallInt;   (* Offset from grid at which this note occurs *)
19993
    nOffset:        SmallInt;   (* Offset from grid at which this note occurs *)
19990
    bBeat:          BYTE;       (* Beat (in measure) at which this note occurs *)
19994
    bBeat:          BYTE;       (* Beat (in measure) at which this note occurs *)
19991
    bGrid:          BYTE;       (* Grid offset from beat at which this note occurs *)
19995
    bGrid:          BYTE;       (* Grid offset from beat at which this note occurs *)
19992
    bVelocity:      BYTE;       (* Note velocity *)
19996
    bVelocity:      BYTE;       (* Note velocity *)
19993
    bFlags:         BYTE;       (* see DMUS_NOTE_FLAGS *)
19997
    bFlags:         BYTE;       (* see DMUS_NOTE_FLAGS *)
19994
    bTimeRange:     BYTE;       (* Range to randomize time. *)
19998
    bTimeRange:     BYTE;       (* Range to randomize time. *)
19995
    bDurRange:      BYTE;       (* Range to randomize duration. *)
19999
    bDurRange:      BYTE;       (* Range to randomize duration. *)
19996
    bVelRange:      BYTE;       (* Range to randomize velocity. *)
20000
    bVelRange:      BYTE;       (* Range to randomize velocity. *)
19997
    bPlayModeFlags: BYTE;       (* Play mode *)
20001
    bPlayModeFlags: BYTE;       (* Play mode *)
19998
    bSubChordLevel: BYTE;       (* Which subchord level this note uses.  *)
20002
    bSubChordLevel: BYTE;       (* Which subchord level this note uses.  *)
19999
    bMidiValue:     BYTE;       (* The MIDI note value, converted from wMusicValue *)
20003
    bMidiValue:     BYTE;       (* The MIDI note value, converted from wMusicValue *)
20000
    cTranspose:     char;       (* Transposition to add to midi note value after converted from wMusicValue. *)
20004
    cTranspose:     char;       (* Transposition to add to midi note value after converted from wMusicValue. *)
20001
  end;
20005
  end;
20002
 
20006
 
20003
  TDMus_NoteF_Flags = DWORD;
20007
  TDMus_NoteF_Flags = DWORD;
20004
const
20008
const
20005
  DMUS_NOTEF_NOTEON = 1;     (* Set if this is a MIDI Note On. Otherwise, it is MIDI Note Off *)
20009
  DMUS_NOTEF_NOTEON = 1;     (* Set if this is a MIDI Note On. Otherwise, it is MIDI Note Off *)
20006
 
20010
 
20007
(* The DMUS_PLAYMODE_FLAGS are used to determine how to convert wMusicValue
20011
(* The DMUS_PLAYMODE_FLAGS are used to determine how to convert wMusicValue
20008
   into the appropriate bMidiValue.
20012
   into the appropriate bMidiValue.
20009
*)
20013
*)
20010
type
20014
type
20011
  TDMus_PlayMode_Flags = DWORD;
20015
  TDMus_PlayMode_Flags = DWORD;
20012
const
20016
const
20013
   DMUS_PLAYMODE_KEY_ROOT          = 1;  (* Transpose on top of the key root. *)
20017
   DMUS_PLAYMODE_KEY_ROOT          = 1;  (* Transpose on top of the key root. *)
20014
   DMUS_PLAYMODE_CHORD_ROOT        = 2;  (* Transpose on top of the chord root. *)
20018
   DMUS_PLAYMODE_CHORD_ROOT        = 2;  (* Transpose on top of the chord root. *)
20015
   DMUS_PLAYMODE_SCALE_INTERVALS   = 4;  (* Use scale intervals from scale pattern. *)
20019
   DMUS_PLAYMODE_SCALE_INTERVALS   = 4;  (* Use scale intervals from scale pattern. *)
20016
   DMUS_PLAYMODE_CHORD_INTERVALS   = 8;  (* Use chord intervals from chord pattern. *)
20020
   DMUS_PLAYMODE_CHORD_INTERVALS   = 8;  (* Use chord intervals from chord pattern. *)
20017
   DMUS_PLAYMODE_NONE              = 16; (* No mode. Indicates the parent part's mode should be used. *)
20021
   DMUS_PLAYMODE_NONE              = 16; (* No mode. Indicates the parent part's mode should be used. *)
20018
 
20022
 
20019
(* The following are playback modes that can be created by combining the DMUS_PLAYMODE_FLAGS
20023
(* The following are playback modes that can be created by combining the DMUS_PLAYMODE_FLAGS
20020
   in various ways:
20024
   in various ways:
20021
*)
20025
*)
20022
 
20026
 
20023
(* Fixed. wMusicValue holds final MIDI note value. This is used for drums, sound effects, and sequenced
20027
(* Fixed. wMusicValue holds final MIDI note value. This is used for drums, sound effects, and sequenced
20024
   notes that should not be transposed by the chord or scale.
20028
   notes that should not be transposed by the chord or scale.
20025
*)
20029
*)
20026
  DMUS_PLAYMODE_FIXED            = 0;
20030
  DMUS_PLAYMODE_FIXED            = 0;
20027
(* In fixed to key, the musicvalue is again a fixed MIDI value, but it
20031
(* In fixed to key, the musicvalue is again a fixed MIDI value, but it
20028
   is transposed on top of the key root.
20032
   is transposed on top of the key root.
20029
*)
20033
*)
20030
  DMUS_PLAYMODE_FIXEDTOKEY       = DMUS_PLAYMODE_KEY_ROOT;
20034
  DMUS_PLAYMODE_FIXEDTOKEY       = DMUS_PLAYMODE_KEY_ROOT;
20031
(* In fixed to chord, the musicvalue is also a fixed MIDI value, but it
20035
(* In fixed to chord, the musicvalue is also a fixed MIDI value, but it
20032
   is transposed on top of the chord root.
20036
   is transposed on top of the chord root.
20033
*)
20037
*)
20034
  DMUS_PLAYMODE_FIXEDTOCHORD     = DMUS_PLAYMODE_CHORD_ROOT;
20038
  DMUS_PLAYMODE_FIXEDTOCHORD     = DMUS_PLAYMODE_CHORD_ROOT;
20035
(* In Pedalpoint, the key root is used and the notes only track the intervals in
20039
(* In Pedalpoint, the key root is used and the notes only track the intervals in
20036
   the scale. The chord root and intervals are completely ignored. This is useful
20040
   the scale. The chord root and intervals are completely ignored. This is useful
20037
   for melodic lines that play relative to the key root.
20041
   for melodic lines that play relative to the key root.
20038
*)
20042
*)
20039
  DMUS_PLAYMODE_PEDALPOINT       = (DMUS_PLAYMODE_KEY_ROOT or DMUS_PLAYMODE_SCALE_INTERVALS);
20043
  DMUS_PLAYMODE_PEDALPOINT       = (DMUS_PLAYMODE_KEY_ROOT or DMUS_PLAYMODE_SCALE_INTERVALS);
20040
(* In the Melodic mode, the chord root is used but the notes only track the intervals in
20044
(* In the Melodic mode, the chord root is used but the notes only track the intervals in
20041
   the scale. The key root and chord intervals are completely ignored. This is useful
20045
   the scale. The key root and chord intervals are completely ignored. This is useful
20042
   for melodic lines that play relative to the chord root.
20046
   for melodic lines that play relative to the chord root.
20043
*)
20047
*)
20044
  DMUS_PLAYMODE_MELODIC          = (DMUS_PLAYMODE_CHORD_ROOT or DMUS_PLAYMODE_SCALE_INTERVALS);
20048
  DMUS_PLAYMODE_MELODIC          = (DMUS_PLAYMODE_CHORD_ROOT or DMUS_PLAYMODE_SCALE_INTERVALS);
20045
(* Normal chord mode is the prevalent playback mode.
20049
(* Normal chord mode is the prevalent playback mode.
20046
   The notes track the intervals in the chord, which is based on the chord root.
20050
   The notes track the intervals in the chord, which is based on the chord root.
20047
   If there is a scale component to the MusicValue, the additional intervals
20051
   If there is a scale component to the MusicValue, the additional intervals
20048
   are pulled from the scale and added.
20052
   are pulled from the scale and added.
20049
   If the chord does not have an interval to match the chord component of
20053
   If the chord does not have an interval to match the chord component of
20050
   the MusicValue, the note is silent.
20054
   the MusicValue, the note is silent.
20051
*)
20055
*)
20052
  DMUS_PLAYMODE_NORMALCHORD      = (DMUS_PLAYMODE_CHORD_ROOT or DMUS_PLAYMODE_CHORD_INTERVALS);
20056
  DMUS_PLAYMODE_NORMALCHORD      = (DMUS_PLAYMODE_CHORD_ROOT or DMUS_PLAYMODE_CHORD_INTERVALS);
20053
(* If it is desirable to play a note that is above the top of the chord, the
20057
(* If it is desirable to play a note that is above the top of the chord, the
20054
   always play mode (known as "purpleized" in a former life) finds a position
20058
   always play mode (known as "purpleized" in a former life) finds a position
20055
   for the note by using intervals from the scale. Essentially, this mode is
20059
   for the note by using intervals from the scale. Essentially, this mode is
20056
   a combination of the Normal and Melodic playback modes, where a failure
20060
   a combination of the Normal and Melodic playback modes, where a failure
20057
   in Normal causes a second try in Melodic mode.
20061
   in Normal causes a second try in Melodic mode.
20058
*)
20062
*)
20059
  DMUS_PLAYMODE_ALWAYSPLAY       = (DMUS_PLAYMODE_MELODIC or DMUS_PLAYMODE_NORMALCHORD);
20063
  DMUS_PLAYMODE_ALWAYSPLAY       = (DMUS_PLAYMODE_MELODIC or DMUS_PLAYMODE_NORMALCHORD);
20060
 
20064
 
20061
(*  Legacy names for modes... *)
20065
(*  Legacy names for modes... *)
20062
  DMUS_PLAYMODE_PURPLEIZED       = DMUS_PLAYMODE_ALWAYSPLAY;
20066
  DMUS_PLAYMODE_PURPLEIZED       = DMUS_PLAYMODE_ALWAYSPLAY;
20063
  DMUS_PLAYMODE_SCALE_ROOT       = DMUS_PLAYMODE_KEY_ROOT;
20067
  DMUS_PLAYMODE_SCALE_ROOT       = DMUS_PLAYMODE_KEY_ROOT;
20064
  DMUS_PLAYMODE_FIXEDTOSCALE     = DMUS_PLAYMODE_FIXEDTOKEY;
20068
  DMUS_PLAYMODE_FIXEDTOSCALE     = DMUS_PLAYMODE_FIXEDTOKEY;
20065
 
20069
 
20066
type
20070
type
20067
(* DMUS_MIDI_PMsg *)
20071
(* DMUS_MIDI_PMsg *)
20068
  TDMus_Midi_PMsg = record
20072
  TDMus_Midi_PMsg = record
20069
    (* begin DMUS_PMsg_PART *)
20073
    (* begin DMUS_PMsg_PART *)
20070
    dwSize:          DWORD;
20074
    dwSize:          DWORD;
20071
    rtTime:          TReference_Time;      (* real time (in 100 nanosecond increments) *)
20075
    rtTime:          TReference_Time;      (* real time (in 100 nanosecond increments) *)
20072
    mtTime:          TMusic_Time;          (* music time *)
20076
    mtTime:          TMusic_Time;          (* music time *)
20073
    dwFlags:         DWORD;                (* various bits (see DMUS_PMsg_FLAGS enumeration) *)
20077
    dwFlags:         DWORD;                (* various bits (see DMUS_PMsg_FLAGS enumeration) *)
20074
    dwPChannel:      DWORD;                (* Performance Channel. The Performance can *)
20078
    dwPChannel:      DWORD;                (* Performance Channel. The Performance can *)
20075
                                           (* use this to determine the port/channel. *)
20079
                                           (* use this to determine the port/channel. *)
20076
    dwVirtualTrackID:DWORD;                (* virtual track ID *)
20080
    dwVirtualTrackID:DWORD;                (* virtual track ID *)
20077
    pTool:           IDirectMusicTool;     (* tool interface pointer *)
20081
    pTool:           IDirectMusicTool;     (* tool interface pointer *)
20078
    pGraph:          IDirectMusicGraph;    (* tool graph interface pointer *)
20082
    pGraph:          IDirectMusicGraph;    (* tool graph interface pointer *)
20079
    dwType:          DWORD;                (* PMSG type (see DMUS_PMsgT_TYPES defines) *)
20083
    dwType:          DWORD;                (* PMSG type (see DMUS_PMsgT_TYPES defines) *)
20080
    dwVoiceID:       DWORD;                (* unique voice id which allows synthesizers to *)
20084
    dwVoiceID:       DWORD;                (* unique voice id which allows synthesizers to *)
20081
                                           (* identify a specific event. For DirectX 6.0, *)
20085
                                           (* identify a specific event. For DirectX 6.0, *)
20082
                                           (* this field should always be 0. *)
20086
                                           (* this field should always be 0. *)
20083
    dwGroupID:       DWORD;                (* Track group id *)
20087
    dwGroupID:       DWORD;                (* Track group id *)
20084
    punkUser:        IUnknown;             (* user com pointer, auto released upon PMSG free *)
20088
    punkUser:        IUnknown;             (* user com pointer, auto released upon PMSG free *)
20085
    (* end DMUS_PMsg_PART *)
20089
    (* end DMUS_PMsg_PART *)
20086
 
20090
 
20087
    bStatus: BYTE;
20091
    bStatus: BYTE;
20088
    bByte1:  BYTE;
20092
    bByte1:  BYTE;
20089
    bByte2:  BYTE;
20093
    bByte2:  BYTE;
20090
    bPad: array [0..0] of BYTE;
20094
    bPad: array [0..0] of BYTE;
20091
  end;
20095
  end;
20092
 
20096
 
20093
(* DMUS_PATCH_PMsg *)
20097
(* DMUS_PATCH_PMsg *)
20094
  TDMus_Patch_PMsg = packed record
20098
  TDMus_Patch_PMsg = packed record
20095
    (* begin DMUS_PMsg_PART *)
20099
    (* begin DMUS_PMsg_PART *)
20096
    dwSize:          DWORD;
20100
    dwSize:          DWORD;
20097
    rtTime:          TReference_Time;      (* real time (in 100 nanosecond increments) *)
20101
    rtTime:          TReference_Time;      (* real time (in 100 nanosecond increments) *)
20098
    mtTime:          TMusic_Time;          (* music time *)
20102
    mtTime:          TMusic_Time;          (* music time *)
20099
    dwFlags:         DWORD;                (* various bits (see DMUS_PMsg_FLAGS enumeration) *)
20103
    dwFlags:         DWORD;                (* various bits (see DMUS_PMsg_FLAGS enumeration) *)
20100
    dwPChannel:      DWORD;                (* Performance Channel. The Performance can *)
20104
    dwPChannel:      DWORD;                (* Performance Channel. The Performance can *)
20101
                                           (* use this to determine the port/channel. *)
20105
                                           (* use this to determine the port/channel. *)
20102
    dwVirtualTrackID:DWORD;                (* virtual track ID *)
20106
    dwVirtualTrackID:DWORD;                (* virtual track ID *)
20103
    pTool:           IDirectMusicTool;     (* tool interface pointer *)
20107
    pTool:           IDirectMusicTool;     (* tool interface pointer *)
20104
    pGraph:          IDirectMusicGraph;    (* tool graph interface pointer *)
20108
    pGraph:          IDirectMusicGraph;    (* tool graph interface pointer *)
20105
    dwType:          DWORD;                (* PMSG type (see DMUS_PMsgT_TYPES defines) *)
20109
    dwType:          DWORD;                (* PMSG type (see DMUS_PMsgT_TYPES defines) *)
20106
    dwVoiceID:       DWORD;                (* unique voice id which allows synthesizers to *)
20110
    dwVoiceID:       DWORD;                (* unique voice id which allows synthesizers to *)
20107
                                           (* identify a specific event. For DirectX 6.0, *)
20111
                                           (* identify a specific event. For DirectX 6.0, *)
20108
                                           (* this field should always be 0. *)
20112
                                           (* this field should always be 0. *)
20109
    dwGroupID:       DWORD;                (* Track group id *)
20113
    dwGroupID:       DWORD;                (* Track group id *)
20110
    punkUser:        IUnknown;             (* user com pointer, auto released upon PMSG free *)
20114
    punkUser:        IUnknown;             (* user com pointer, auto released upon PMSG free *)
20111
    (* end DMUS_PMsg_PART *)
20115
    (* end DMUS_PMsg_PART *)
20112
 
20116
 
20113
    byInstrument: BYTE;
20117
    byInstrument: BYTE;
20114
    byMSB:        BYTE;
20118
    byMSB:        BYTE;
20115
    byLSB:        BYTE;
20119
    byLSB:        BYTE;
20116
    byPad: array [0..0] of BYTE;
20120
    byPad: array [0..0] of BYTE;
20117
  end;
20121
  end;
20118
 
20122
 
20119
(* DMUS_TRANSPOSE_PMsg *)
20123
(* DMUS_TRANSPOSE_PMsg *)
20120
  TDMus_Transpose_PMsg = packed record
20124
  TDMus_Transpose_PMsg = packed record
20121
    (* begin DMUS_PMsg_PART *)
20125
    (* begin DMUS_PMsg_PART *)
20122
    dwSize:          DWORD;
20126
    dwSize:          DWORD;
20123
    rtTime:          TReference_Time;      (* real time (in 100 nanosecond increments) *)
20127
    rtTime:          TReference_Time;      (* real time (in 100 nanosecond increments) *)
20124
    mtTime:          TMusic_Time;          (* music time *)
20128
    mtTime:          TMusic_Time;          (* music time *)
20125
    dwFlags:         DWORD;                (* various bits (see DMUS_PMsg_FLAGS enumeration) *)
20129
    dwFlags:         DWORD;                (* various bits (see DMUS_PMsg_FLAGS enumeration) *)
20126
    dwPChannel:      DWORD;                (* Performance Channel. The Performance can *)
20130
    dwPChannel:      DWORD;                (* Performance Channel. The Performance can *)
20127
                                           (* use this to determine the port/channel. *)
20131
                                           (* use this to determine the port/channel. *)
20128
    dwVirtualTrackID:DWORD;                (* virtual track ID *)
20132
    dwVirtualTrackID:DWORD;                (* virtual track ID *)
20129
    pTool:           IDirectMusicTool;     (* tool interface pointer *)
20133
    pTool:           IDirectMusicTool;     (* tool interface pointer *)
20130
    pGraph:          IDirectMusicGraph;    (* tool graph interface pointer *)
20134
    pGraph:          IDirectMusicGraph;    (* tool graph interface pointer *)
20131
    dwType:          DWORD;                (* PMSG type (see DMUS_PMsgT_TYPES defines) *)
20135
    dwType:          DWORD;                (* PMSG type (see DMUS_PMsgT_TYPES defines) *)
20132
    dwVoiceID:       DWORD;                (* unique voice id which allows synthesizers to *)
20136
    dwVoiceID:       DWORD;                (* unique voice id which allows synthesizers to *)
20133
                                           (* identify a specific event. For DirectX 6.0, *)
20137
                                           (* identify a specific event. For DirectX 6.0, *)
20134
                                           (* this field should always be 0. *)
20138
                                           (* this field should always be 0. *)
20135
    dwGroupID:       DWORD;                (* Track group id *)
20139
    dwGroupID:       DWORD;                (* Track group id *)
20136
    punkUser:        IUnknown;             (* user com pointer, auto released upon PMSG free *)
20140
    punkUser:        IUnknown;             (* user com pointer, auto released upon PMSG free *)
20137
    (* end DMUS_PMsg_PART *)
20141
    (* end DMUS_PMsg_PART *)
20138
 
20142
 
20139
    nTranspose: SmallInt;
20143
    nTranspose: SmallInt;
20140
  end;
20144
  end;
20141
 
20145
 
20142
(* DMUS_CHANNEL_PRIORITY_PMsg *)
20146
(* DMUS_CHANNEL_PRIORITY_PMsg *)
20143
  TDMus_Channel_Priority_PMsg = packed record
20147
  TDMus_Channel_Priority_PMsg = packed record
20144
    (* begin DMUS_PMsg_PART *)
20148
    (* begin DMUS_PMsg_PART *)
20145
    dwSize:          DWORD;
20149
    dwSize:          DWORD;
20146
    rtTime:          TReference_Time;      (* real time (in 100 nanosecond increments) *)
20150
    rtTime:          TReference_Time;      (* real time (in 100 nanosecond increments) *)
20147
    mtTime:          TMusic_Time;          (* music time *)
20151
    mtTime:          TMusic_Time;          (* music time *)
20148
    dwFlags:         DWORD;                (* various bits (see DMUS_PMsg_FLAGS enumeration) *)
20152
    dwFlags:         DWORD;                (* various bits (see DMUS_PMsg_FLAGS enumeration) *)
20149
    dwPChannel:      DWORD;                (* Performance Channel. The Performance can *)
20153
    dwPChannel:      DWORD;                (* Performance Channel. The Performance can *)
20150
                                           (* use this to determine the port/channel. *)
20154
                                           (* use this to determine the port/channel. *)
20151
    dwVirtualTrackID:DWORD;                (* virtual track ID *)
20155
    dwVirtualTrackID:DWORD;                (* virtual track ID *)
20152
    pTool:           IDirectMusicTool;     (* tool interface pointer *)
20156
    pTool:           IDirectMusicTool;     (* tool interface pointer *)
20153
    pGraph:          IDirectMusicGraph;    (* tool graph interface pointer *)
20157
    pGraph:          IDirectMusicGraph;    (* tool graph interface pointer *)
20154
    dwType:          DWORD;                (* PMSG type (see DMUS_PMsgT_TYPES defines) *)
20158
    dwType:          DWORD;                (* PMSG type (see DMUS_PMsgT_TYPES defines) *)
20155
    dwVoiceID:       DWORD;                (* unique voice id which allows synthesizers to *)
20159
    dwVoiceID:       DWORD;                (* unique voice id which allows synthesizers to *)
20156
                                           (* identify a specific event. For DirectX 6.0, *)
20160
                                           (* identify a specific event. For DirectX 6.0, *)
20157
                                           (* this field should always be 0. *)
20161
                                           (* this field should always be 0. *)
20158
    dwGroupID:       DWORD;                (* Track group id *)
20162
    dwGroupID:       DWORD;                (* Track group id *)
20159
    punkUser:        IUnknown;             (* user com pointer, auto released upon PMSG free *)
20163
    punkUser:        IUnknown;             (* user com pointer, auto released upon PMSG free *)
20160
    (* end DMUS_PMsg_PART *)
20164
    (* end DMUS_PMsg_PART *)
20161
 
20165
 
20162
    dwChannelPriority: DWORD;
20166
    dwChannelPriority: DWORD;
20163
  end;
20167
  end;
20164
 
20168
 
20165
(* DMUS_TEMPO_PMsg *)
20169
(* DMUS_TEMPO_PMsg *)
20166
  TDMus_Tempo_PMsg = packed record
20170
  TDMus_Tempo_PMsg = packed record
20167
    (* begin DMUS_PMsg_PART *)
20171
    (* begin DMUS_PMsg_PART *)
20168
    dwSize:          DWORD;
20172
    dwSize:          DWORD;
20169
    rtTime:          TReference_Time;      (* real time (in 100 nanosecond increments) *)
20173
    rtTime:          TReference_Time;      (* real time (in 100 nanosecond increments) *)
20170
    mtTime:          TMusic_Time;          (* music time *)
20174
    mtTime:          TMusic_Time;          (* music time *)
20171
    dwFlags:         DWORD;                (* various bits (see DMUS_PMsg_FLAGS enumeration) *)
20175
    dwFlags:         DWORD;                (* various bits (see DMUS_PMsg_FLAGS enumeration) *)
20172
    dwPChannel:      DWORD;                (* Performance Channel. The Performance can *)
20176
    dwPChannel:      DWORD;                (* Performance Channel. The Performance can *)
20173
                                           (* use this to determine the port/channel. *)
20177
                                           (* use this to determine the port/channel. *)
20174
    dwVirtualTrackID:DWORD;                (* virtual track ID *)
20178
    dwVirtualTrackID:DWORD;                (* virtual track ID *)
20175
    pTool:           IDirectMusicTool;     (* tool interface pointer *)
20179
    pTool:           IDirectMusicTool;     (* tool interface pointer *)
20176
    pGraph:          IDirectMusicGraph;    (* tool graph interface pointer *)
20180
    pGraph:          IDirectMusicGraph;    (* tool graph interface pointer *)
20177
    dwType:          DWORD;                (* PMSG type (see DMUS_PMsgT_TYPES defines) *)
20181
    dwType:          DWORD;                (* PMSG type (see DMUS_PMsgT_TYPES defines) *)
20178
    dwVoiceID:       DWORD;                (* unique voice id which allows synthesizers to *)
20182
    dwVoiceID:       DWORD;                (* unique voice id which allows synthesizers to *)
20179
                                           (* identify a specific event. For DirectX 6.0, *)
20183
                                           (* identify a specific event. For DirectX 6.0, *)
20180
                                           (* this field should always be 0. *)
20184
                                           (* this field should always be 0. *)
20181
    dwGroupID:       DWORD;                (* Track group id *)
20185
    dwGroupID:       DWORD;                (* Track group id *)
20182
    punkUser:        IUnknown;             (* user com pointer, auto released upon PMSG free *)
20186
    punkUser:        IUnknown;             (* user com pointer, auto released upon PMSG free *)
20183
    (* end DMUS_PMsg_PART *)
20187
    (* end DMUS_PMsg_PART *)
20184
 
20188
 
20185
    dblTempo: double;                      (* the tempo *)
20189
    dblTempo: double;                      (* the tempo *)
20186
  end;
20190
  end;
20187
 
20191
 
20188
const
20192
const
20189
  DMUS_TEMPO_MAX         = 1000;
20193
  DMUS_TEMPO_MAX         = 1000;
20190
  DMUS_TEMPO_MIN         = 1;
20194
  DMUS_TEMPO_MIN         = 1;
20191
 
20195
 
20192
  DMUS_MASTERTEMPO_MAX   = 100.0;
20196
  DMUS_MASTERTEMPO_MAX   = 100.0;
20193
  DMUS_MASTERTEMPO_MIN   = 0.01;
20197
  DMUS_MASTERTEMPO_MIN   = 0.01;
20194
 
20198
 
20195
type
20199
type
20196
(* DMUS_SYSEX_PMsg *)
20200
(* DMUS_SYSEX_PMsg *)
20197
  TDMus_SysEx_PMsg = packed record
20201
  TDMus_SysEx_PMsg = packed record
20198
    (* begin DMUS_PMsg_PART *)
20202
    (* begin DMUS_PMsg_PART *)
20199
    dwSize:          DWORD;
20203
    dwSize:          DWORD;
20200
    rtTime:          TReference_Time;      (* real time (in 100 nanosecond increments) *)
20204
    rtTime:          TReference_Time;      (* real time (in 100 nanosecond increments) *)
20201
    mtTime:          TMusic_Time;          (* music time *)
20205
    mtTime:          TMusic_Time;          (* music time *)
20202
    dwFlags:         DWORD;                (* various bits (see DMUS_PMsg_FLAGS enumeration) *)
20206
    dwFlags:         DWORD;                (* various bits (see DMUS_PMsg_FLAGS enumeration) *)
20203
    dwPChannel:      DWORD;                (* Performance Channel. The Performance can *)
20207
    dwPChannel:      DWORD;                (* Performance Channel. The Performance can *)
20204
                                           (* use this to determine the port/channel. *)
20208
                                           (* use this to determine the port/channel. *)
20205
    dwVirtualTrackID:DWORD;                (* virtual track ID *)
20209
    dwVirtualTrackID:DWORD;                (* virtual track ID *)
20206
    pTool:           IDirectMusicTool;     (* tool interface pointer *)
20210
    pTool:           IDirectMusicTool;     (* tool interface pointer *)
20207
    pGraph:          IDirectMusicGraph;    (* tool graph interface pointer *)
20211
    pGraph:          IDirectMusicGraph;    (* tool graph interface pointer *)
20208
    dwType:          DWORD;                (* PMSG type (see DMUS_PMsgT_TYPES defines) *)
20212
    dwType:          DWORD;                (* PMSG type (see DMUS_PMsgT_TYPES defines) *)
20209
    dwVoiceID:       DWORD;                (* unique voice id which allows synthesizers to *)
20213
    dwVoiceID:       DWORD;                (* unique voice id which allows synthesizers to *)
20210
                                           (* identify a specific event. For DirectX 6.0, *)
20214
                                           (* identify a specific event. For DirectX 6.0, *)
20211
                                           (* this field should always be 0. *)
20215
                                           (* this field should always be 0. *)
20212
    dwGroupID:       DWORD;                (* Track group id *)
20216
    dwGroupID:       DWORD;                (* Track group id *)
20213
    punkUser:        IUnknown;             (* user com pointer, auto released upon PMSG free *)
20217
    punkUser:        IUnknown;             (* user com pointer, auto released upon PMSG free *)
20214
    (* end DMUS_PMsg_PART *)
20218
    (* end DMUS_PMsg_PART *)
20215
 
20219
 
20216
    dwLen:     DWORD;                      (* length of the data *)
20220
    dwLen:     DWORD;                      (* length of the data *)
20217
    abData: array [0..0] of BYTE;          (* array of data, length equal to dwLen *)
20221
    abData: array [0..0] of BYTE;          (* array of data, length equal to dwLen *)
20218
  end;
20222
  end;
20219
 
20223
 
20220
(* DMUS_CURVE_PMsg *)
20224
(* DMUS_CURVE_PMsg *)
20221
  TDMus_Curve_PMsg = packed record
20225
  TDMus_Curve_PMsg = packed record
20222
    (* begin DMUS_PMsg_PART *)
20226
    (* begin DMUS_PMsg_PART *)
20223
    dwSize:          DWORD;
20227
    dwSize:          DWORD;
20224
    rtTime:          TReference_Time;      (* real time (in 100 nanosecond increments) *)
20228
    rtTime:          TReference_Time;      (* real time (in 100 nanosecond increments) *)
20225
    mtTime:          TMusic_Time;          (* music time *)
20229
    mtTime:          TMusic_Time;          (* music time *)
20226
    dwFlags:         DWORD;                (* various bits (see DMUS_PMsg_FLAGS enumeration) *)
20230
    dwFlags:         DWORD;                (* various bits (see DMUS_PMsg_FLAGS enumeration) *)
20227
    dwPChannel:      DWORD;                (* Performance Channel. The Performance can *)
20231
    dwPChannel:      DWORD;                (* Performance Channel. The Performance can *)
20228
                                           (* use this to determine the port/channel. *)
20232
                                           (* use this to determine the port/channel. *)
20229
    dwVirtualTrackID:DWORD;                (* virtual track ID *)
20233
    dwVirtualTrackID:DWORD;                (* virtual track ID *)
20230
    pTool:           IDirectMusicTool;     (* tool interface pointer *)
20234
    pTool:           IDirectMusicTool;     (* tool interface pointer *)
20231
    pGraph:          IDirectMusicGraph;    (* tool graph interface pointer *)
20235
    pGraph:          IDirectMusicGraph;    (* tool graph interface pointer *)
20232
    dwType:          DWORD;                (* PMSG type (see DMUS_PMsgT_TYPES defines) *)
20236
    dwType:          DWORD;                (* PMSG type (see DMUS_PMsgT_TYPES defines) *)
20233
    dwVoiceID:       DWORD;                (* unique voice id which allows synthesizers to *)
20237
    dwVoiceID:       DWORD;                (* unique voice id which allows synthesizers to *)
20234
                                           (* identify a specific event. For DirectX 6.0, *)
20238
                                           (* identify a specific event. For DirectX 6.0, *)
20235
                                           (* this field should always be 0. *)
20239
                                           (* this field should always be 0. *)
20236
    dwGroupID:       DWORD;                (* Track group id *)
20240
    dwGroupID:       DWORD;                (* Track group id *)
20237
    punkUser:        IUnknown;             (* user com pointer, auto released upon PMSG free *)
20241
    punkUser:        IUnknown;             (* user com pointer, auto released upon PMSG free *)
20238
    (* end DMUS_PMsg_PART *)
20242
    (* end DMUS_PMsg_PART *)
20239
 
20243
 
20240
    mtDuration:      TMusic_Time;     (* how long this curve lasts *)
20244
    mtDuration:      TMusic_Time;     (* how long this curve lasts *)
20241
    mtOriginalStart: TMusic_Time;     (* must be set to either zero when this PMSG is created or to the original mtTime of the curve *)
20245
    mtOriginalStart: TMusic_Time;     (* must be set to either zero when this PMSG is created or to the original mtTime of the curve *)
20242
    mtResetDuration: TMusic_Time;     (* how long after the curve is finished to reset to the
20246
    mtResetDuration: TMusic_Time;     (* how long after the curve is finished to reset to the
20243
                                        reset value, nResetValue *)
20247
                                        reset value, nResetValue *)
20244
    nStartValue:     SmallInt;        (* curve's start value *)
20248
    nStartValue:     SmallInt;        (* curve's start value *)
20245
    nEndValue:       SmallInt;        (* curve's end value *)
20249
    nEndValue:       SmallInt;        (* curve's end value *)
20246
    nResetValue:     SmallInt;        (* curve's reset value, sent after mtResetDuration or
20250
    nResetValue:     SmallInt;        (* curve's reset value, sent after mtResetDuration or
20247
                                        upon a flush or invalidation *)
20251
                                        upon a flush or invalidation *)
20248
    wMeasure:        WORD;            (* Measure in which this curve occurs *)
20252
    wMeasure:        WORD;            (* Measure in which this curve occurs *)
20249
    nOffset:         SmallInt;        (* Offset from grid at which this curve occurs *)
20253
    nOffset:         SmallInt;        (* Offset from grid at which this curve occurs *)
20250
    bBeat:           BYTE;            (* Beat (in measure) at which this curve occurs *)
20254
    bBeat:           BYTE;            (* Beat (in measure) at which this curve occurs *)
20251
    bGrid:           BYTE;            (* Grid offset from beat at which this curve occurs *)
20255
    bGrid:           BYTE;            (* Grid offset from beat at which this curve occurs *)
20252
    bType:           BYTE;            (* type of curve *)
20256
    bType:           BYTE;            (* type of curve *)
20253
    bCurveShape:     BYTE;            (* shape of curve *)
20257
    bCurveShape:     BYTE;            (* shape of curve *)
20254
    bCCData:         BYTE;            (* CC# if this is a control change type *)
20258
    bCCData:         BYTE;            (* CC# if this is a control change type *)
20255
    bFlags:          BYTE;            (* set to 1 if the nResetValue must be sent when the
20259
    bFlags:          BYTE;            (* set to 1 if the nResetValue must be sent when the
20256
                                        time is reached or an invalidate occurs because
20260
                                        time is reached or an invalidate occurs because
20257
                                        of a transition. If 0, the curve stays
20261
                                        of a transition. If 0, the curve stays
20258
                                        permanently stuck at the new value. All bits besides
20262
                                        permanently stuck at the new value. All bits besides
20259
                                        1 are reserved. *)
20263
                                        1 are reserved. *)
20260
  end;
20264
  end;
20261
 
20265
 
20262
  TDMus_Curve_Flags = DWORD;
20266
  TDMus_Curve_Flags = DWORD;
20263
const
20267
const
20264
  DMUS_CURVE_RESET = 1;           (* Set if the curve needs to be reset. *)
20268
  DMUS_CURVE_RESET = 1;           (* Set if the curve needs to be reset. *)
20265
 
20269
 
20266
(* Curve shapes *)
20270
(* Curve shapes *)
20267
type
20271
type
20268
  TDMus_Curve_Shapes = (
20272
  TDMus_Curve_Shapes = (
20269
    DMUS_CURVES_LINEAR ,
20273
    DMUS_CURVES_LINEAR ,
20270
    DMUS_CURVES_INSTANT,
20274
    DMUS_CURVES_INSTANT,
20271
    DMUS_CURVES_EXP    ,
20275
    DMUS_CURVES_EXP    ,
20272
    DMUS_CURVES_LOG    ,
20276
    DMUS_CURVES_LOG    ,
20273
    DMUS_CURVES_SINE  
20277
    DMUS_CURVES_SINE  
20274
  );
20278
  );
20275
 
20279
 
20276
const
20280
const
20277
(* curve types *)
20281
(* curve types *)
20278
  DMUS_CURVET_PBCURVE      = $03;
20282
  DMUS_CURVET_PBCURVE      = $03;
20279
  DMUS_CURVET_CCCURVE      = $04;
20283
  DMUS_CURVET_CCCURVE      = $04;
20280
  DMUS_CURVET_MATCURVE     = $05;
20284
  DMUS_CURVET_MATCURVE     = $05;
20281
  DMUS_CURVET_PATCURVE     = $06;
20285
  DMUS_CURVET_PATCURVE     = $06;
20282
 
20286
 
20283
type
20287
type
20284
(* DMUS_TIMESIG_PMsg *)
20288
(* DMUS_TIMESIG_PMsg *)
20285
  TDMus_TimeSig_PMsg = packed record
20289
  TDMus_TimeSig_PMsg = packed record
20286
    (* begin DMUS_PMsg_PART *)
20290
    (* begin DMUS_PMsg_PART *)
20287
    dwSize:          DWORD;
20291
    dwSize:          DWORD;
20288
    rtTime:          TReference_Time;      (* real time (in 100 nanosecond increments) *)
20292
    rtTime:          TReference_Time;      (* real time (in 100 nanosecond increments) *)
20289
    mtTime:          TMusic_Time;          (* music time *)
20293
    mtTime:          TMusic_Time;          (* music time *)
20290
    dwFlags:         DWORD;                (* various bits (see DMUS_PMsg_FLAGS enumeration) *)
20294
    dwFlags:         DWORD;                (* various bits (see DMUS_PMsg_FLAGS enumeration) *)
20291
    dwPChannel:      DWORD;                (* Performance Channel. The Performance can *)
20295
    dwPChannel:      DWORD;                (* Performance Channel. The Performance can *)
20292
                                           (* use this to determine the port/channel. *)
20296
                                           (* use this to determine the port/channel. *)
20293
    dwVirtualTrackID:DWORD;                (* virtual track ID *)
20297
    dwVirtualTrackID:DWORD;                (* virtual track ID *)
20294
    pTool:           IDirectMusicTool;     (* tool interface pointer *)
20298
    pTool:           IDirectMusicTool;     (* tool interface pointer *)
20295
    pGraph:          IDirectMusicGraph;    (* tool graph interface pointer *)
20299
    pGraph:          IDirectMusicGraph;    (* tool graph interface pointer *)
20296
    dwType:          DWORD;                (* PMSG type (see DMUS_PMsgT_TYPES defines) *)
20300
    dwType:          DWORD;                (* PMSG type (see DMUS_PMsgT_TYPES defines) *)
20297
    dwVoiceID:       DWORD;                (* unique voice id which allows synthesizers to *)
20301
    dwVoiceID:       DWORD;                (* unique voice id which allows synthesizers to *)
20298
                                           (* identify a specific event. For DirectX 6.0, *)
20302
                                           (* identify a specific event. For DirectX 6.0, *)
20299
                                           (* this field should always be 0. *)
20303
                                           (* this field should always be 0. *)
20300
    dwGroupID:       DWORD;                (* Track group id *)
20304
    dwGroupID:       DWORD;                (* Track group id *)
20301
    punkUser:        IUnknown;             (* user com pointer, auto released upon PMSG free *)
20305
    punkUser:        IUnknown;             (* user com pointer, auto released upon PMSG free *)
20302
    (* end DMUS_PMsg_PART *)
20306
    (* end DMUS_PMsg_PART *)
20303
 
20307
 
20304
    (* Time signatures define how many beats per measure, which note receives *)
20308
    (* Time signatures define how many beats per measure, which note receives *)
20305
    (* the beat, and the grid resolution. *)
20309
    (* the beat, and the grid resolution. *)
20306
    bBeatsPerMeasure: BYTE;          (* beats per measure (top of time sig) *)
20310
    bBeatsPerMeasure: BYTE;          (* beats per measure (top of time sig) *)
20307
    bBeat:            BYTE;          (* what note receives the beat (bottom of time sig.) *)
20311
    bBeat:            BYTE;          (* what note receives the beat (bottom of time sig.) *)
20308
                                     (* we can assume that 0 means 256th note *)
20312
                                     (* we can assume that 0 means 256th note *)
20309
    wGridsPerBeat:    WORD;          (* grids per beat *)
20313
    wGridsPerBeat:    WORD;          (* grids per beat *)
20310
  end;
20314
  end;
20311
 
20315
 
20312
const
20316
const
20313
(* notification type values *)
20317
(* notification type values *)
20314
(* The following correspond to GUID_NOTIFICATION_SEGMENT *)
20318
(* The following correspond to GUID_NOTIFICATION_SEGMENT *)
20315
  DMUS_NOTIFICATION_SEGSTART     = 0;
20319
  DMUS_NOTIFICATION_SEGSTART     = 0;
20316
  DMUS_NOTIFICATION_SEGEND       = 1;
20320
  DMUS_NOTIFICATION_SEGEND       = 1;
20317
  DMUS_NOTIFICATION_SEGALMOSTEND = 2;
20321
  DMUS_NOTIFICATION_SEGALMOSTEND = 2;
20318
  DMUS_NOTIFICATION_SEGLOOP      = 3;
20322
  DMUS_NOTIFICATION_SEGLOOP      = 3;
20319
  DMUS_NOTIFICATION_SEGABORT     = 4;
20323
  DMUS_NOTIFICATION_SEGABORT     = 4;
20320
(* The following correspond to GUID_NOTIFICATION_PERFORMANCE *)
20324
(* The following correspond to GUID_NOTIFICATION_PERFORMANCE *)
20321
  DMUS_NOTIFICATION_MUSICSTARTED = 0;
20325
  DMUS_NOTIFICATION_MUSICSTARTED = 0;
20322
  DMUS_NOTIFICATION_MUSICSTOPPED = 1;
20326
  DMUS_NOTIFICATION_MUSICSTOPPED = 1;
20323
(* The following corresponds to GUID_NOTIFICATION_MEASUREANDBEAT *)
20327
(* The following corresponds to GUID_NOTIFICATION_MEASUREANDBEAT *)
20324
  DMUS_NOTIFICATION_MEASUREBEAT  = 0;
20328
  DMUS_NOTIFICATION_MEASUREBEAT  = 0;
20325
(* The following corresponds to GUID_NOTIFICATION_CHORD *)
20329
(* The following corresponds to GUID_NOTIFICATION_CHORD *)
20326
  DMUS_NOTIFICATION_CHORD        = 0;
20330
  DMUS_NOTIFICATION_CHORD        = 0;
20327
(* The following correspond to GUID_NOTIFICATION_COMMAND *)
20331
(* The following correspond to GUID_NOTIFICATION_COMMAND *)
20328
  DMUS_NOTIFICATION_GROOVE        = 0;
20332
  DMUS_NOTIFICATION_GROOVE        = 0;
20329
  DMUS_NOTIFICATION_EMBELLISHMENT = 1;
20333
  DMUS_NOTIFICATION_EMBELLISHMENT = 1;
20330
 
20334
 
20331
const
20335
const
20332
  DMUS_MAX_NAME          = 64;         (* Maximum object name length. *)
20336
  DMUS_MAX_NAME          = 64;         (* Maximum object name length. *)
20333
  DMUS_MAX_CATEGORY      = 64;         (* Maximum object category name length. *)
20337
  DMUS_MAX_CATEGORY      = 64;         (* Maximum object category name length. *)
20334
  DMUS_MAX_FILENAME      = MAX_PATH;
20338
  DMUS_MAX_FILENAME      = MAX_PATH;
20335
 
20339
 
20336
type
20340
type
20337
  PDMus_Version = ^TDMus_Version;
20341
  PDMus_Version = ^TDMus_Version;
20338
  TDMus_Version = packed record
20342
  TDMus_Version = packed record
20339
    dwVersionMS: DWORD;
20343
    dwVersionMS: DWORD;
20340
    dwVersionLS: DWORD;
20344
    dwVersionLS: DWORD;
20341
  end;
20345
  end;
20342
 
20346
 
20343
(*      The DMUSOBJECTDESC structure is used to communicate everything you could *)
20347
(*      The DMUSOBJECTDESC structure is used to communicate everything you could *)
20344
(*      possibly use to describe a DirectMusic object.  *)
20348
(*      possibly use to describe a DirectMusic object.  *)
20345
  PDMus_ObjectDesc = ^TDMus_ObjectDesc;
20349
  PDMus_ObjectDesc = ^TDMus_ObjectDesc;
20346
  TDMus_ObjectDesc = packed record
20350
  TDMus_ObjectDesc = packed record
20347
    dwSize:      DWORD;                     (* Size of this structure. *)
20351
    dwSize:      DWORD;                     (* Size of this structure. *)
20348
    dwValidData: DWORD;                     (* Flags indicating which fields below are valid. *)
20352
    dwValidData: DWORD;                     (* Flags indicating which fields below are valid. *)
20349
    guidObject:  TGUID;                     (* Unique ID for this object. *)
20353
    guidObject:  TGUID;                     (* Unique ID for this object. *)
20350
    guidClass:   TGUID;                     (* GUID for the class of object. *)
20354
    guidClass:   TGUID;                     (* GUID for the class of object. *)
20351
    ftDate:      TFileTime;                 (* Last edited date of object. *)
20355
    ftDate:      TFileTime;                 (* Last edited date of object. *)
20352
    vVersion:    TDMus_Version;              (* Version. *)
20356
    vVersion:    TDMus_Version;              (* Version. *)
20353
    wszName:     array [0..DMUS_MAX_NAME-1] of WCHAR; (* Name of object. *)
20357
    wszName:     array [0..DMUS_MAX_NAME-1] of WCHAR; (* Name of object. *)
20354
    wszCategory: array [0..DMUS_MAX_CATEGORY-1] of WCHAR; (* Category for object (optional). *)
20358
    wszCategory: array [0..DMUS_MAX_CATEGORY-1] of WCHAR; (* Category for object (optional). *)
20355
    wszFileName: array [0..DMUS_MAX_FILENAME-1] of WCHAR; (* File path. *)
20359
    wszFileName: array [0..DMUS_MAX_FILENAME-1] of WCHAR; (* File path. *)
20356
    llMemLength: LongLong;                     (* Size of Memory data. *)
20360
    llMemLength: LongLong;                     (* Size of Memory data. *)
20357
    pbMemData:   Pointer;                   (* Memory pointer for data. *)
20361
    pbMemData:   Pointer;                   (* Memory pointer for data. *)
20358
    dwDummy:     DWORD; ///?
20362
    dwDummy:     DWORD; ///?
20359
  end;
20363
  end;
20360
 
20364
 
20361
(*      Flags for dwValidData. When set, a flag indicates that the  *)
20365
(*      Flags for dwValidData. When set, a flag indicates that the  *)
20362
(*      corresponding field in DMUSOBJECTDESC holds valid data. *)
20366
(*      corresponding field in DMUSOBJECTDESC holds valid data. *)
20363
const
20367
const
20364
  DMUS_OBJ_OBJECT         = (1 shl 0);     (* Object GUID is valid. *)
20368
  DMUS_OBJ_OBJECT         = (1 shl 0);     (* Object GUID is valid. *)
20365
  DMUS_OBJ_CLASS          = (1 shl 1);     (* Class GUID is valid. *)
20369
  DMUS_OBJ_CLASS          = (1 shl 1);     (* Class GUID is valid. *)
20366
  DMUS_OBJ_NAME           = (1 shl 2);     (* Name is valid. *)
20370
  DMUS_OBJ_NAME           = (1 shl 2);     (* Name is valid. *)
20367
  DMUS_OBJ_CATEGORY       = (1 shl 3);     (* Category is valid. *)
20371
  DMUS_OBJ_CATEGORY       = (1 shl 3);     (* Category is valid. *)
20368
  DMUS_OBJ_FILENAME       = (1 shl 4);     (* File path is valid. *)
20372
  DMUS_OBJ_FILENAME       = (1 shl 4);     (* File path is valid. *)
20369
  DMUS_OBJ_FULLPATH       = (1 shl 5);     (* Path is full path. *)
20373
  DMUS_OBJ_FULLPATH       = (1 shl 5);     (* Path is full path. *)
20370
  DMUS_OBJ_URL            = (1 shl 6);     (* Path is URL. *)
20374
  DMUS_OBJ_URL            = (1 shl 6);     (* Path is URL. *)
20371
  DMUS_OBJ_VERSION        = (1 shl 7);     (* Version is valid. *)
20375
  DMUS_OBJ_VERSION        = (1 shl 7);     (* Version is valid. *)
20372
  DMUS_OBJ_DATE           = (1 shl 8);     (* Date is valid. *)
20376
  DMUS_OBJ_DATE           = (1 shl 8);     (* Date is valid. *)
20373
  DMUS_OBJ_LOADED         = (1 shl 9);     (* Object is currently loaded in memory. *)
20377
  DMUS_OBJ_LOADED         = (1 shl 9);     (* Object is currently loaded in memory. *)
20374
  DMUS_OBJ_MEMORY         = (1 shl 10);    (* Object is pointed to by pbMemData. *)
20378
  DMUS_OBJ_MEMORY         = (1 shl 10);    (* Object is pointed to by pbMemData. *)
20375
 
20379
 
20376
  DMUSB_LOADED    = (1 shl 0);        (* Set when band has been loaded *)
20380
  DMUSB_LOADED    = (1 shl 0);        (* Set when band has been loaded *)
20377
  DMUSB_DEFAULT   = (1 shl 1);        (* Set when band is default band for a style *)
20381
  DMUSB_DEFAULT   = (1 shl 1);        (* Set when band is default band for a style *)
20378
 
20382
 
20379
type
20383
type
20380
  IDirectMusicBand =                 interface;
20384
  IDirectMusicBand =                 interface;
20381
  IDirectMusicChordMap =             interface;
20385
  IDirectMusicChordMap =             interface;
20382
  IDirectMusicLoader =               interface;
20386
  IDirectMusicLoader =               interface;
20383
  IDirectMusicObject =               interface;
20387
  IDirectMusicObject =               interface;
20384
 
20388
 
20385
 
20389
 
20386
  IDirectMusicBand = interface (IUnknown)
20390
  IDirectMusicBand = interface (IUnknown)
20387
    ['{d2ac28c0-b39b-11d1-8704-00600893b1bd}']
20391
    ['{d2ac28c0-b39b-11d1-8704-00600893b1bd}']
20388
    function CreateSegment (out ppSegment: IDirectMusicSegment) : HResult; stdcall;
20392
    function CreateSegment (out ppSegment: IDirectMusicSegment) : HResult; stdcall;
20389
    function Download      (pPerformance: IDirectMusicPerformance) : HResult; stdcall;
20393
    function Download      (pPerformance: IDirectMusicPerformance) : HResult; stdcall;
20390
    function Unload        (pPerformance: IDirectMusicPerformance) : HResult; stdcall;
20394
    function Unload        (pPerformance: IDirectMusicPerformance) : HResult; stdcall;
20391
  end;
20395
  end;
20392
 
20396
 
20393
  IDirectMusicObject = interface (IUnknown)
20397
  IDirectMusicObject = interface (IUnknown)
20394
    ['{d2ac28b5-b39b-11d1-8704-00600893b1bd}']
20398
    ['{d2ac28b5-b39b-11d1-8704-00600893b1bd}']
20395
    function GetDescriptor (out pDesc: TDMus_ObjectDesc) : HResult; stdcall;
20399
    function GetDescriptor (out pDesc: TDMus_ObjectDesc) : HResult; stdcall;
20396
    function SetDescriptor (const pDesc: TDMus_ObjectDesc) : HResult; stdcall;
20400
    function SetDescriptor (const pDesc: TDMus_ObjectDesc) : HResult; stdcall;
20397
    function ParseDescriptor (var pStream;
20401
    function ParseDescriptor (var pStream;
20398
                              out pDesc: TDMus_ObjectDesc) : HResult; stdcall;
20402
                              out pDesc: TDMus_ObjectDesc) : HResult; stdcall;
20399
  end;
20403
  end;
20400
 
20404
 
20401
  IDirectMusicLoader = interface (IUnknown)
20405
  IDirectMusicLoader = interface (IUnknown)
20402
    ['{2ffaaca2-5dca-11d2-afa6-00aa0024d8b6}']
20406
    ['{2ffaaca2-5dca-11d2-afa6-00aa0024d8b6}']
20403
    function GetObject (const pDesc: TDMus_ObjectDesc;
20407
    function GetObject (const pDesc: TDMus_ObjectDesc;
20404
                        const riid : TGUID;
20408
                        const riid : TGUID;
20405
                        out ppv) : HResult; stdcall;
20409
                        out ppv) : HResult; stdcall;
20406
    function SetObject (const pDesc: TDMus_ObjectDesc) : HResult; stdcall;
20410
    function SetObject (const pDesc: TDMus_ObjectDesc) : HResult; stdcall;
20407
    function SetSearchDirectory (const rguidClass: TGUID;
20411
    function SetSearchDirectory (const rguidClass: TGUID;
20408
                                 pwzPath: PWideChar;
20412
                                 pwzPath: PWideChar;
20409
                                 fClear:  BOOL) : HResult; stdcall;
20413
                                 fClear:  BOOL) : HResult; stdcall;
20410
    function ScanDirectory (const rguidClass: TGUID;
20414
    function ScanDirectory (const rguidClass: TGUID;
20411
                            pwzFileExtension,
20415
                            pwzFileExtension,
20412
                            pwzScanFileName: PWideChar) : HResult; stdcall;
20416
                            pwzScanFileName: PWideChar) : HResult; stdcall;
20413
    function CacheObject (pObject: IDirectMusicObject) : HResult; stdcall;
20417
    function CacheObject (pObject: IDirectMusicObject) : HResult; stdcall;
20414
    function ReleaseObject (pObject: IDirectMusicObject) : HResult; stdcall;
20418
    function ReleaseObject (pObject: IDirectMusicObject) : HResult; stdcall;
20415
    function ClearCache (const rguidClass: TGUID) : HResult; stdcall;
20419
    function ClearCache (const rguidClass: TGUID) : HResult; stdcall;
20416
    function EnableCache (const rguidClass: TGUID;
20420
    function EnableCache (const rguidClass: TGUID;
20417
                          fEnable: BOOL) : HResult; stdcall;
20421
                          fEnable: BOOL) : HResult; stdcall;
20418
    function EnumObject (const rguidClass: TGUID;
20422
    function EnumObject (const rguidClass: TGUID;
20419
                         dwIndex: DWORD;
20423
                         dwIndex: DWORD;
20420
                         const pDesc: TDMus_ObjectDesc) : HResult; stdcall;
20424
                         const pDesc: TDMus_ObjectDesc) : HResult; stdcall;
20421
  end;
20425
  end;
20422
 
20426
 
20423
(*  Stream object supports IDirectMusicGetLoader interface to access loader while file parsing. *)
20427
(*  Stream object supports IDirectMusicGetLoader interface to access loader while file parsing. *)
20424
 
20428
 
20425
  IDirectMusicGetLoader = interface (IUnknown)
20429
  IDirectMusicGetLoader = interface (IUnknown)
20426
    ['{68a04844-d13d-11d1-afa6-00aa0024d8b6}']
20430
    ['{68a04844-d13d-11d1-afa6-00aa0024d8b6}']
20427
    function GetLoader (out ppLoader: IDirectMusicLoader) : HResult; stdcall;
20431
    function GetLoader (out ppLoader: IDirectMusicLoader) : HResult; stdcall;
20428
  end;
20432
  end;
20429
 
20433
 
20430
(*/////////////////////////////////////////////////////////////////////
20434
(*/////////////////////////////////////////////////////////////////////
20431
// IDirectMusicStyle *)
20435
// IDirectMusicStyle *)
20432
  IDirectMusicStyle = interface (IUnknown)
20436
  IDirectMusicStyle = interface (IUnknown)
20433
    ['{d2ac28bd-b39b-11d1-8704-00600893b1bd}']
20437
    ['{d2ac28bd-b39b-11d1-8704-00600893b1bd}']
20434
    function GetBand (pwszName: PWideChar;
20438
    function GetBand (pwszName: PWideChar;
20435
                      out ppBand: IDirectMusicBand) : HResult; stdcall;
20439
                      out ppBand: IDirectMusicBand) : HResult; stdcall;
20436
    function EnumBand (dwIndex: DWORD;
20440
    function EnumBand (dwIndex: DWORD;
20437
                       pwszName: PWideChar) : HResult; stdcall;
20441
                       pwszName: PWideChar) : HResult; stdcall;
20438
    function GetDefaultBand (out ppBand: IDirectMusicBand) : HResult; stdcall;
20442
    function GetDefaultBand (out ppBand: IDirectMusicBand) : HResult; stdcall;
20439
    function EnumMotif (dwIndex: DWORD;
20443
    function EnumMotif (dwIndex: DWORD;
20440
                        pwszName: PWideChar) : HResult; stdcall;
20444
                        pwszName: PWideChar) : HResult; stdcall;
20441
    function GetMotif (pwszName: PWideChar;
20445
    function GetMotif (pwszName: PWideChar;
20442
                       out ppSegment: IDirectMusicSegment) : HResult; stdcall;
20446
                       out ppSegment: IDirectMusicSegment) : HResult; stdcall;
20443
    function GetDefaultChordMap (out ppChordMap: IDirectMusicChordMap) : HResult; stdcall;
20447
    function GetDefaultChordMap (out ppChordMap: IDirectMusicChordMap) : HResult; stdcall;
20444
    function EnumChordMap (dwIndex: DWORD;
20448
    function EnumChordMap (dwIndex: DWORD;
20445
                           pwszName: PWideChar) : HResult; stdcall;
20449
                           pwszName: PWideChar) : HResult; stdcall;
20446
    function GetChordMap (pwszName: PWideChar;
20450
    function GetChordMap (pwszName: PWideChar;
20447
                          out ppChordMap: IDirectMusicChordMap) : HResult; stdcall;
20451
                          out ppChordMap: IDirectMusicChordMap) : HResult; stdcall;
20448
    function GetTimeSignature (out pTimeSig: TDMus_TimeSignature) : HResult; stdcall;
20452
    function GetTimeSignature (out pTimeSig: TDMus_TimeSignature) : HResult; stdcall;
20449
    function GetEmbellishmentLength (dwType, dwLevel: DWORD;
20453
    function GetEmbellishmentLength (dwType, dwLevel: DWORD;
20450
                                     out pdwMin, pdwMax: DWORD) : HResult; stdcall;
20454
                                     out pdwMin, pdwMax: DWORD) : HResult; stdcall;
20451
    function GetTempo (out pTempo: double) : HResult; stdcall;
20455
    function GetTempo (out pTempo: double) : HResult; stdcall;
20452
  end;
20456
  end;
20453
 
20457
 
20454
(*/////////////////////////////////////////////////////////////////////
20458
(*/////////////////////////////////////////////////////////////////////
20455
// IDirectMusicChordMap *)
20459
// IDirectMusicChordMap *)
20456
  IDirectMusicChordMap = interface (IUnknown)
20460
  IDirectMusicChordMap = interface (IUnknown)
20457
    ['{d2ac28be-b39b-11d1-8704-00600893b1bd}']
20461
    ['{d2ac28be-b39b-11d1-8704-00600893b1bd}']
20458
    function GetScale (out pdwScale: DWORD) : HResult; stdcall;
20462
    function GetScale (out pdwScale: DWORD) : HResult; stdcall;
20459
  end;
20463
  end;
20460
 
20464
 
20461
(*/////////////////////////////////////////////////////////////////////
20465
(*/////////////////////////////////////////////////////////////////////
20462
// IDirectMusicComposer *)
20466
// IDirectMusicComposer *)
20463
  IDirectMusicComposer = interface (IUnknown)
20467
  IDirectMusicComposer = interface (IUnknown)
20464
    ['{d2ac28bf-b39b-11d1-8704-00600893b1bd}']
20468
    ['{d2ac28bf-b39b-11d1-8704-00600893b1bd}']
20465
    function ComposeSegmentFromTemplate (pStyle: IDirectMusicStyle;
20469
    function ComposeSegmentFromTemplate (pStyle: IDirectMusicStyle;
20466
                                         pTempSeg: IDirectMusicSegment;
20470
                                         pTempSeg: IDirectMusicSegment;
20467
                                         wActivity: WORD;
20471
                                         wActivity: WORD;
20468
                                         pChordMap: IDirectMusicChordMap;
20472
                                         pChordMap: IDirectMusicChordMap;
20469
                                         out ppSectionSeg: IDirectMusicSegment) : HResult; stdcall;
20473
                                         out ppSectionSeg: IDirectMusicSegment) : HResult; stdcall;
20470
    function ComposeSegmentFromShape (pStyle: IDirectMusicStyle;
20474
    function ComposeSegmentFromShape (pStyle: IDirectMusicStyle;
20471
                                      wNumMeasures,
20475
                                      wNumMeasures,
20472
                                      wShape,
20476
                                      wShape,
20473
                                      wActivity: WORD;
20477
                                      wActivity: WORD;
20474
                                      fIntro:    BOOL;
20478
                                      fIntro:    BOOL;
20475
                                      fEnd:      BOOL;
20479
                                      fEnd:      BOOL;
20476
                                      pChordMap: IDirectMusicChordMap;
20480
                                      pChordMap: IDirectMusicChordMap;
20477
                                      out ppSectionSeg: IDirectMusicSegment) : HResult; stdcall;
20481
                                      out ppSectionSeg: IDirectMusicSegment) : HResult; stdcall;
20478
    function ComposeTransition (pFromSeg: IDirectMusicSegment;
20482
    function ComposeTransition (pFromSeg: IDirectMusicSegment;
20479
                                pToSeg:   IDirectMusicSegment;
20483
                                pToSeg:   IDirectMusicSegment;
20480
                                mtTime:   TMusic_Time;
20484
                                mtTime:   TMusic_Time;
20481
                                wCommand: WORD;
20485
                                wCommand: WORD;
20482
                                dwFlags:  DWORD;
20486
                                dwFlags:  DWORD;
20483
                                pChordMap:IDirectMusicChordMap;
20487
                                pChordMap:IDirectMusicChordMap;
20484
                                out ppSectionSeg: IDirectMusicSegment) : HResult; stdcall;
20488
                                out ppSectionSeg: IDirectMusicSegment) : HResult; stdcall;
20485
    function AutoTransition (pPerformance: IDirectMusicPerformance;
20489
    function AutoTransition (pPerformance: IDirectMusicPerformance;
20486
                             pToSeg:       IDirectMusicSegment;
20490
                             pToSeg:       IDirectMusicSegment;
20487
                             wCommand:     WORD;
20491
                             wCommand:     WORD;
20488
                             dwFlags:      DWORD;
20492
                             dwFlags:      DWORD;
20489
                             pChordMap:    IDirectMusicChordMap;
20493
                             pChordMap:    IDirectMusicChordMap;
20490
                             out ppTransSeg:      IDirectMusicSegment;
20494
                             out ppTransSeg:      IDirectMusicSegment;
20491
                             out ppToSegState:    IDirectMusicSegmentState;
20495
                             out ppToSegState:    IDirectMusicSegmentState;
20492
                             out ppTransSegState: IDirectMusicSegmentState) : HResult; stdcall;
20496
                             out ppTransSegState: IDirectMusicSegmentState) : HResult; stdcall;
20493
    function ComposeTemplateFromShape (wNumMeasures: WORD;
20497
    function ComposeTemplateFromShape (wNumMeasures: WORD;
20494
                                       wShape:       WORD;
20498
                                       wShape:       WORD;
20495
                                       fIntro:       BOOL;
20499
                                       fIntro:       BOOL;
20496
                                       fEnd:         BOOL;
20500
                                       fEnd:         BOOL;
20497
                                       wEndLength:   WORD;
20501
                                       wEndLength:   WORD;
20498
                                       out ppTempSeg:IDirectMusicSegment) : HResult; stdcall;
20502
                                       out ppTempSeg:IDirectMusicSegment) : HResult; stdcall;
20499
    function ChangeChordMap (pSectionSeg: IDirectMusicSegment;
20503
    function ChangeChordMap (pSectionSeg: IDirectMusicSegment;
20500
                             fTrackScale: BOOL;
20504
                             fTrackScale: BOOL;
20501
                             pChordMap:   IDirectMusicChordMap) : HResult; stdcall;
20505
                             pChordMap:   IDirectMusicChordMap) : HResult; stdcall;
20502
  end;
20506
  end;
20503
 
20507
 
20504
const  
20508
const  
20505
(* CLSID's *)
20509
(* CLSID's *)
20506
  CLSID_DirectMusicPerformance : TGUID = '{d2ac2881-b39b-11d1-8704-00600893b1bd}';
20510
  CLSID_DirectMusicPerformance : TGUID = '{d2ac2881-b39b-11d1-8704-00600893b1bd}';
20507
  CLSID_DirectMusicSegment : TGUID = '{d2ac2882-b39b-11d1-8704-00600893b1bd}';
20511
  CLSID_DirectMusicSegment : TGUID = '{d2ac2882-b39b-11d1-8704-00600893b1bd}';
20508
  CLSID_DirectMusicSegmentState : TGUID = '{d2ac2883-b39b-11d1-8704-00600893b1bd}';
20512
  CLSID_DirectMusicSegmentState : TGUID = '{d2ac2883-b39b-11d1-8704-00600893b1bd}';
20509
  CLSID_DirectMusicGraph : TGUID = '{d2ac2884-b39b-11d1-8704-00600893b1bd}';
20513
  CLSID_DirectMusicGraph : TGUID = '{d2ac2884-b39b-11d1-8704-00600893b1bd}';
20510
  CLSID_DirectMusicTempoTrack : TGUID = '{d2ac2885-b39b-11d1-8704-00600893b1bd}';
20514
  CLSID_DirectMusicTempoTrack : TGUID = '{d2ac2885-b39b-11d1-8704-00600893b1bd}';
20511
  CLSID_DirectMusicSeqTrack : TGUID = '{d2ac2886-b39b-11d1-8704-00600893b1bd}';
20515
  CLSID_DirectMusicSeqTrack : TGUID = '{d2ac2886-b39b-11d1-8704-00600893b1bd}';
20512
  CLSID_DirectMusicSysExTrack : TGUID = '{d2ac2887-b39b-11d1-8704-00600893b1bd}';
20516
  CLSID_DirectMusicSysExTrack : TGUID = '{d2ac2887-b39b-11d1-8704-00600893b1bd}';
20513
  CLSID_DirectMusicTimeSigTrack : TGUID = '{d2ac2888-b39b-11d1-8704-00600893b1bd}';
20517
  CLSID_DirectMusicTimeSigTrack : TGUID = '{d2ac2888-b39b-11d1-8704-00600893b1bd}';
20514
  CLSID_DirectMusicStyle : TGUID = '{d2ac288a-b39b-11d1-8704-00600893b1bd}';
20518
  CLSID_DirectMusicStyle : TGUID = '{d2ac288a-b39b-11d1-8704-00600893b1bd}';
20515
  CLSID_DirectMusicChordTrack : TGUID = '{d2ac288b-b39b-11d1-8704-00600893b1bd}';
20519
  CLSID_DirectMusicChordTrack : TGUID = '{d2ac288b-b39b-11d1-8704-00600893b1bd}';
20516
  CLSID_DirectMusicCommandTrack : TGUID = '{d2ac288c-b39b-11d1-8704-00600893b1bd}';
20520
  CLSID_DirectMusicCommandTrack : TGUID = '{d2ac288c-b39b-11d1-8704-00600893b1bd}';
20517
  CLSID_DirectMusicStyleTrack : TGUID = '{d2ac288d-b39b-11d1-8704-00600893b1bd}';
20521
  CLSID_DirectMusicStyleTrack : TGUID = '{d2ac288d-b39b-11d1-8704-00600893b1bd}';
20518
  CLSID_DirectMusicMotifTrack : TGUID = '{d2ac288e-b39b-11d1-8704-00600893b1bd}';
20522
  CLSID_DirectMusicMotifTrack : TGUID = '{d2ac288e-b39b-11d1-8704-00600893b1bd}';
20519
  CLSID_DirectMusicChordMap : TGUID = '{d2ac288f-b39b-11d1-8704-00600893b1bd}';
20523
  CLSID_DirectMusicChordMap : TGUID = '{d2ac288f-b39b-11d1-8704-00600893b1bd}';
20520
  CLSID_DirectMusicComposer : TGUID = '{d2ac2890-b39b-11d1-8704-00600893b1bd}';
20524
  CLSID_DirectMusicComposer : TGUID = '{d2ac2890-b39b-11d1-8704-00600893b1bd}';
20521
  CLSID_DirectMusicSignPostTrack : TGUID = '{f17e8672-c3b4-11d1-870b-00600893b1bd}';
20525
  CLSID_DirectMusicSignPostTrack : TGUID = '{f17e8672-c3b4-11d1-870b-00600893b1bd}';
20522
  CLSID_DirectMusicLoader : TGUID = '{d2ac2892-b39b-11d1-8704-00600893b1bd}';
20526
  CLSID_DirectMusicLoader : TGUID = '{d2ac2892-b39b-11d1-8704-00600893b1bd}';
20523
  CLSID_DirectMusicBandTrack : TGUID = '{d2ac2894-b39b-11d1-8704-00600893b1bd}';
20527
  CLSID_DirectMusicBandTrack : TGUID = '{d2ac2894-b39b-11d1-8704-00600893b1bd}';
20524
  CLSID_DirectMusicBand : TGUID = '{79ba9e00-b6ee-11d1-86be-00c04fbf8fef}';
20528
  CLSID_DirectMusicBand : TGUID = '{79ba9e00-b6ee-11d1-86be-00c04fbf8fef}';
20525
  CLSID_DirectMusicChordMapTrack : TGUID = '{d2ac2896-b39b-11d1-8704-00600893b1bd}';
20529
  CLSID_DirectMusicChordMapTrack : TGUID = '{d2ac2896-b39b-11d1-8704-00600893b1bd}';
20526
  CLSID_DirectMusicMuteTrack : TGUID = '{d2ac2898-b39b-11d1-8704-00600893b1bd}';
20530
  CLSID_DirectMusicMuteTrack : TGUID = '{d2ac2898-b39b-11d1-8704-00600893b1bd}';
20527
 
20531
 
20528
(* Special GUID for all object types. This is used by the loader. *)
20532
(* Special GUID for all object types. This is used by the loader. *)
20529
  GUID_DirectMusicAllTypes : TGUID = '{d2ac2893-b39b-11d1-8704-00600893b1bd}';
20533
  GUID_DirectMusicAllTypes : TGUID = '{d2ac2893-b39b-11d1-8704-00600893b1bd}';
20530
 
20534
 
20531
(* Notification guids *)
20535
(* Notification guids *)
20532
  GUID_NOTIFICATION_SEGMENT : TGUID = '{d2ac2899-b39b-11d1-8704-00600893b1bd}';
20536
  GUID_NOTIFICATION_SEGMENT : TGUID = '{d2ac2899-b39b-11d1-8704-00600893b1bd}';
20533
  GUID_NOTIFICATION_PERFORMANCE : TGUID = '{81f75bc5-4e5d-11d2-bcc7-00a0c922e6eb}';
20537
  GUID_NOTIFICATION_PERFORMANCE : TGUID = '{81f75bc5-4e5d-11d2-bcc7-00a0c922e6eb}';
20534
  GUID_NOTIFICATION_MEASUREANDBEAT : TGUID = '{d2ac289a-b39b-11d1-8704-00600893b1bd}';
20538
  GUID_NOTIFICATION_MEASUREANDBEAT : TGUID = '{d2ac289a-b39b-11d1-8704-00600893b1bd}';
20535
  GUID_NOTIFICATION_CHORD : TGUID = '{d2ac289b-b39b-11d1-8704-00600893b1bd}';
20539
  GUID_NOTIFICATION_CHORD : TGUID = '{d2ac289b-b39b-11d1-8704-00600893b1bd}';
20536
  GUID_NOTIFICATION_COMMAND : TGUID = '{d2ac289c-b39b-11d1-8704-00600893b1bd}';
20540
  GUID_NOTIFICATION_COMMAND : TGUID = '{d2ac289c-b39b-11d1-8704-00600893b1bd}';
20537
 
20541
 
20538
(* Track param type guids *)
20542
(* Track param type guids *)
20539
(* Use to get/set a DMUS_COMMAND_PARAM param in the Command track *)
20543
(* Use to get/set a DMUS_COMMAND_PARAM param in the Command track *)
20540
  GUID_CommandParam : TGUID = '{d2ac289d-b39b-11d1-8704-00600893b1bd}';
20544
  GUID_CommandParam : TGUID = '{d2ac289d-b39b-11d1-8704-00600893b1bd}';
20541
 
20545
 
20542
(* Use to get a DMUS_COMMAND_PARAM_2 param in the Command track *)
20546
(* Use to get a DMUS_COMMAND_PARAM_2 param in the Command track *)
20543
  GUID_CommandParam2 : TGUID = '{28f97ef7-9538-11d2-97a9-00c04fa36e58}';
20547
  GUID_CommandParam2 : TGUID = '{28f97ef7-9538-11d2-97a9-00c04fa36e58}';
20544
 
20548
 
20545
(* Use to get/set a DMUS_CHORD_PARAM param in the Chord track *)
20549
(* Use to get/set a DMUS_CHORD_PARAM param in the Chord track *)
20546
  GUID_ChordParam : TGUID = '{d2ac289e-b39b-11d1-8704-00600893b1bd}';
20550
  GUID_ChordParam : TGUID = '{d2ac289e-b39b-11d1-8704-00600893b1bd}';
20547
 
20551
 
20548
(* Use to get a DMUS_RHYTHM_PARAM param in the Chord track *)
20552
(* Use to get a DMUS_RHYTHM_PARAM param in the Chord track *)
20549
  GUID_RhythmParam : TGUID = '{d2ac289f-b39b-11d1-8704-00600893b1bd}';
20553
  GUID_RhythmParam : TGUID = '{d2ac289f-b39b-11d1-8704-00600893b1bd}';
20550
 
20554
 
20551
(* Use to get/set an IDirectMusicStyle param in the Style track *)
20555
(* Use to get/set an IDirectMusicStyle param in the Style track *)
20552
  GUID_IDirectMusicStyle : TGUID = '{d2ac28a1-b39b-11d1-8704-00600893b1bd}';
20556
  GUID_IDirectMusicStyle : TGUID = '{d2ac28a1-b39b-11d1-8704-00600893b1bd}';
20553
 
20557
 
20554
(* Use to get a DMUS_TIMESIGNATURE param in the Style and TimeSig tracks *)
20558
(* Use to get a DMUS_TIMESIGNATURE param in the Style and TimeSig tracks *)
20555
  GUID_TimeSignature : TGUID = '{d2ac28a4-b39b-11d1-8704-00600893b1bd}';
20559
  GUID_TimeSignature : TGUID = '{d2ac28a4-b39b-11d1-8704-00600893b1bd}';
20556
 
20560
 
20557
(* Use to get/set a DMUS_TEMPO_PARAM param in the Tempo track *)
20561
(* Use to get/set a DMUS_TEMPO_PARAM param in the Tempo track *)
20558
  GUID_TempoParam : TGUID = '{d2ac28a5-b39b-11d1-8704-00600893b1bd}';
20562
  GUID_TempoParam : TGUID = '{d2ac28a5-b39b-11d1-8704-00600893b1bd}';
20559
 
20563
 
20560
(* Use to set an IDirectMusicBand param in the Band track *)
20564
(* Use to set an IDirectMusicBand param in the Band track *)
20561
  GUID_IDirectMusicBand : TGUID = '{d2ac28ac-b39b-11d1-8704-00600893b1bd}';
20565
  GUID_IDirectMusicBand : TGUID = '{d2ac28ac-b39b-11d1-8704-00600893b1bd}';
20562
 
20566
 
20563
(* Use to get/set an IDirectMusicChordMap param in the ChordMap track *)
20567
(* Use to get/set an IDirectMusicChordMap param in the ChordMap track *)
20564
  GUID_IDirectMusicChordMap : TGUID = '{d2ac28ad-b39b-11d1-8704-00600893b1bd}';
20568
  GUID_IDirectMusicChordMap : TGUID = '{d2ac28ad-b39b-11d1-8704-00600893b1bd}';
20565
 
20569
 
20566
(* Use to get/set a DMUS_MUTE_PARAM param in the Mute track *)
20570
(* Use to get/set a DMUS_MUTE_PARAM param in the Mute track *)
20567
  GUID_MuteParam : TGUID = '{d2ac28af-b39b-11d1-8704-00600893b1bd}';
20571
  GUID_MuteParam : TGUID = '{d2ac28af-b39b-11d1-8704-00600893b1bd}';
20568
 
20572
 
20569
(* These guids are used in IDirectMusicSegment::SetParam to tell the band track to perform various actions.
20573
(* These guids are used in IDirectMusicSegment::SetParam to tell the band track to perform various actions.
20570
 *)
20574
 *)
20571
(* Download bands for the IDirectMusicSegment *)
20575
(* Download bands for the IDirectMusicSegment *)
20572
  GUID_Download : TGUID = '{d2ac28a7-b39b-11d1-8704-00600893b1bd}';
20576
  GUID_Download : TGUID = '{d2ac28a7-b39b-11d1-8704-00600893b1bd}';
20573
 
20577
 
20574
(* Unload bands for the IDirectMusicSegment *)
20578
(* Unload bands for the IDirectMusicSegment *)
20575
  GUID_Unload : TGUID = '{d2ac28a8-b39b-11d1-8704-00600893b1bd}';
20579
  GUID_Unload : TGUID = '{d2ac28a8-b39b-11d1-8704-00600893b1bd}';
20576
 
20580
 
20577
(* Connect segment's bands to an IDirectMusicCollection *)
20581
(* Connect segment's bands to an IDirectMusicCollection *)
20578
  GUID_ConnectToDLSCollection : TGUID = '{1db1ae6b-e92e-11d1-a8c5-00c04fa3726e}';
20582
  GUID_ConnectToDLSCollection : TGUID = '{1db1ae6b-e92e-11d1-a8c5-00c04fa3726e}';
20579
 
20583
 
20580
(* Enable/disable autodownloading of bands *)
20584
(* Enable/disable autodownloading of bands *)
20581
  GUID_Enable_Auto_Download : TGUID = '{d2ac28a9-b39b-11d1-8704-00600893b1bd}';
20585
  GUID_Enable_Auto_Download : TGUID = '{d2ac28a9-b39b-11d1-8704-00600893b1bd}';
20582
  GUID_Disable_Auto_Download : TGUID = '{d2ac28aa-b39b-11d1-8704-00600893b1bd}';
20586
  GUID_Disable_Auto_Download : TGUID = '{d2ac28aa-b39b-11d1-8704-00600893b1bd}';
20583
 
20587
 
20584
(* Clear all bands *)
20588
(* Clear all bands *)
20585
  GUID_Clear_All_Bands : TGUID = '{d2ac28ab-b39b-11d1-8704-00600893b1bd}';
20589
  GUID_Clear_All_Bands : TGUID = '{d2ac28ab-b39b-11d1-8704-00600893b1bd}';
20586
 
20590
 
20587
(* Set segment to manage all program changes, bank selects, etc. for simple playback of a standard MIDI file *)
20591
(* Set segment to manage all program changes, bank selects, etc. for simple playback of a standard MIDI file *)
20588
  _GUID_StandardMIDIFile = '{06621075-e92e-11d1-a8c5-00c04fa3726e}';
20592
  _GUID_StandardMIDIFile = '{06621075-e92e-11d1-a8c5-00c04fa3726e}';
20589
  GUID_StandardMIDIFile : TGUID = _GUID_StandardMIDIFile;
20593
  GUID_StandardMIDIFile : TGUID = _GUID_StandardMIDIFile;
20590
(* For compatibility with beta releases... *)
20594
(* For compatibility with beta releases... *)
20591
  GUID_IgnoreBankSelectForGM : TGUID = _GUID_StandardMIDIFile;
20595
  GUID_IgnoreBankSelectForGM : TGUID = _GUID_StandardMIDIFile;
20592
 
20596
 
20593
(* Disable/enable param guids. Use these in SetParam calls to disable or enable sending
20597
(* Disable/enable param guids. Use these in SetParam calls to disable or enable sending
20594
 * specific PMsg types.
20598
 * specific PMsg types.
20595
 *)
20599
 *)
20596
  GUID_DisableTimeSig : TGUID = '{45fc707b-1db4-11d2-bcac-00a0c922e6eb}';
20600
  GUID_DisableTimeSig : TGUID = '{45fc707b-1db4-11d2-bcac-00a0c922e6eb}';
20597
  GUID_EnableTimeSig : TGUID = '{45fc707c-1db4-11d2-bcac-00a0c922e6eb}';
20601
  GUID_EnableTimeSig : TGUID = '{45fc707c-1db4-11d2-bcac-00a0c922e6eb}';
20598
  GUID_DisableTempo : TGUID = '{45fc707d-1db4-11d2-bcac-00a0c922e6eb}';
20602
  GUID_DisableTempo : TGUID = '{45fc707d-1db4-11d2-bcac-00a0c922e6eb}';
20599
  GUID_EnableTempo : TGUID = '{45fc707e-1db4-11d2-bcac-00a0c922e6eb}';
20603
  GUID_EnableTempo : TGUID = '{45fc707e-1db4-11d2-bcac-00a0c922e6eb}';
20600
 
20604
 
20601
(* Used in SetParam calls for pattern-based tracks.  A nonzero value seeds the random number
20605
(* Used in SetParam calls for pattern-based tracks.  A nonzero value seeds the random number
20602
generator for variation selection; a value of zero reverts to the default behavior of
20606
generator for variation selection; a value of zero reverts to the default behavior of
20603
getting the seed from the system clock.
20607
getting the seed from the system clock.
20604
*)
20608
*)
20605
  GUID_SeedVariations : TGUID = '{65b76fa5-ff37-11d2-814e-00c04fa36e58}';
20609
  GUID_SeedVariations : TGUID = '{65b76fa5-ff37-11d2-814e-00c04fa36e58}';
20606
 
20610
 
20607
(* Global data guids *)
20611
(* Global data guids *)
20608
  GUID_PerfMasterTempo : TGUID = '{d2ac28b0-b39b-11d1-8704-00600893b1bd}';
20612
  GUID_PerfMasterTempo : TGUID = '{d2ac28b0-b39b-11d1-8704-00600893b1bd}';
20609
  GUID_PerfMasterVolume : TGUID = '{d2ac28b1-b39b-11d1-8704-00600893b1bd}';
20613
  GUID_PerfMasterVolume : TGUID = '{d2ac28b1-b39b-11d1-8704-00600893b1bd}';
20610
  GUID_PerfMasterGrooveLevel : TGUID = '{d2ac28b2-b39b-11d1-8704-00600893b1bd}';
20614
  GUID_PerfMasterGrooveLevel : TGUID = '{d2ac28b2-b39b-11d1-8704-00600893b1bd}';
20611
  GUID_PerfAutoDownload : TGUID = '{fb09565b-3631-11d2-bcb8-00a0c922e6eb}';
20615
  GUID_PerfAutoDownload : TGUID = '{fb09565b-3631-11d2-bcb8-00a0c922e6eb}';
20612
 
20616
 
20613
(* GUID for default GM/GS dls collection. *)
20617
(* GUID for default GM/GS dls collection. *)
20614
  GUID_DefaultGMCollection : TGUID = '{f17e8673-c3b4-11d1-870b-00600893b1bd}';
20618
  GUID_DefaultGMCollection : TGUID = '{f17e8673-c3b4-11d1-870b-00600893b1bd}';
20615
 
20619
 
20616
type
20620
type
20617
(* IID's *)
20621
(* IID's *)
20618
  IID_IDirectMusicLoader = IDirectMusicLoader;
20622
  IID_IDirectMusicLoader = IDirectMusicLoader;
20619
  IID_IDirectMusicGetLoader = IDirectMusicGetLoader;
20623
  IID_IDirectMusicGetLoader = IDirectMusicGetLoader;
20620
  IID_IDirectMusicObject = IDirectMusicObject;
20624
  IID_IDirectMusicObject = IDirectMusicObject;
20621
  IID_IDirectMusicSegment = IDirectMusicSegment;
20625
  IID_IDirectMusicSegment = IDirectMusicSegment;
20622
  IID_IDirectMusicSegmentState = IDirectMusicSegmentState;
20626
  IID_IDirectMusicSegmentState = IDirectMusicSegmentState;
20623
  IID_IDirectMusicTrack = IDirectMusicTrack;
20627
  IID_IDirectMusicTrack = IDirectMusicTrack;
20624
  IID_IDirectMusicPerformance = IDirectMusicPerformance;
20628
  IID_IDirectMusicPerformance = IDirectMusicPerformance;
20625
  IID_IDirectMusicTool = IDirectMusicTool;
20629
  IID_IDirectMusicTool = IDirectMusicTool;
20626
  IID_IDirectMusicGraph = IDirectMusicGraph;
20630
  IID_IDirectMusicGraph = IDirectMusicGraph;
20627
  IID_IDirectMusicStyle = IDirectMusicStyle;
20631
  IID_IDirectMusicStyle = IDirectMusicStyle;
20628
  IID_IDirectMusicChordMap = IDirectMusicChordMap;
20632
  IID_IDirectMusicChordMap = IDirectMusicChordMap;
20629
  IID_IDirectMusicComposer = IDirectMusicComposer;
20633
  IID_IDirectMusicComposer = IDirectMusicComposer;
20630
  IID_IDirectMusicBand = IDirectMusicBand;
20634
  IID_IDirectMusicBand = IDirectMusicBand;
20631
 
20635
 
20632
const  
20636
const  
20633
(* Alternate interface IDs, available in DX7 release and after. *)
20637
(* Alternate interface IDs, available in DX7 release and after. *)
20634
  IID_IDirectMusicPerformance2 : TGUID = '{6fc2cae0-bc78-11d2-afa6-00aa0024d8b6}';
20638
  IID_IDirectMusicPerformance2 : TGUID = '{6fc2cae0-bc78-11d2-afa6-00aa0024d8b6}';
20635
  IID_IDirectMusicSegment2 : TGUID = '{d38894d1-c052-11d2-872f-00600893b1bd}';
20639
  IID_IDirectMusicSegment2 : TGUID = '{d38894d1-c052-11d2-872f-00600893b1bd}';
20636
 
20640
 
20637
(************************************************************************
20641
(************************************************************************
20638
*                                                                       *
20642
*                                                                       *
20639
*   dmusicf.h -- This module defines the DirectMusic file formats       *
20643
*   dmusicf.h -- This module defines the DirectMusic file formats       *
20640
*                                                                       *
20644
*                                                                       *
20641
*   Copyright (c) 1998, Microsoft Corp. All rights reserved.            *
20645
*   Copyright (c) 1998, Microsoft Corp. All rights reserved.            *
20642
*                                                                       *
20646
*                                                                       *
20643
************************************************************************)
20647
************************************************************************)
20644
 
20648
 
20645
//type IDirectMusicCollection = interface;
20649
//type IDirectMusicCollection = interface;
20646
 
20650
 
20647
const
20651
const
20648
(* Common chunks *)
20652
(* Common chunks *)
20649
 
20653
 
20650
  DMUS_FOURCC_GUID_CHUNK        : mmioFOURCC = ('g','u','i','d');
20654
  DMUS_FOURCC_GUID_CHUNK        : mmioFOURCC = ('g','u','i','d');
20651
  DMUS_FOURCC_INFO_LIST         : mmioFOURCC = ('I','N','F','O');
20655
  DMUS_FOURCC_INFO_LIST         : mmioFOURCC = ('I','N','F','O');
20652
  DMUS_FOURCC_UNFO_LIST         : mmioFOURCC = ('U','N','F','O');
20656
  DMUS_FOURCC_UNFO_LIST         : mmioFOURCC = ('U','N','F','O');
20653
  DMUS_FOURCC_UNAM_CHUNK        : mmioFOURCC = ('U','N','A','M');
20657
  DMUS_FOURCC_UNAM_CHUNK        : mmioFOURCC = ('U','N','A','M');
20654
  DMUS_FOURCC_UART_CHUNK        : mmioFOURCC = ('U','A','R','T');
20658
  DMUS_FOURCC_UART_CHUNK        : mmioFOURCC = ('U','A','R','T');
20655
  DMUS_FOURCC_UCOP_CHUNK        : mmioFOURCC = ('U','C','O','P');
20659
  DMUS_FOURCC_UCOP_CHUNK        : mmioFOURCC = ('U','C','O','P');
20656
  DMUS_FOURCC_USBJ_CHUNK        : mmioFOURCC = ('U','S','B','J');
20660
  DMUS_FOURCC_USBJ_CHUNK        : mmioFOURCC = ('U','S','B','J');
20657
  DMUS_FOURCC_UCMT_CHUNK        : mmioFOURCC = ('U','C','M','T');
20661
  DMUS_FOURCC_UCMT_CHUNK        : mmioFOURCC = ('U','C','M','T');
20658
  DMUS_FOURCC_CATEGORY_CHUNK    : mmioFOURCC = ('c','a','t','g');
20662
  DMUS_FOURCC_CATEGORY_CHUNK    : mmioFOURCC = ('c','a','t','g');
20659
  DMUS_FOURCC_VERSION_CHUNK     : mmioFOURCC = ('v','e','r','s');
20663
  DMUS_FOURCC_VERSION_CHUNK     : mmioFOURCC = ('v','e','r','s');
20660
 
20664
 
20661
(* The following structures are used by the Tracks, and are the packed structures *)
20665
(* The following structures are used by the Tracks, and are the packed structures *)
20662
(* that are passed to the Tracks inside the IStream. *)
20666
(* that are passed to the Tracks inside the IStream. *)
20663
 
20667
 
20664
type
20668
type
20665
  TDMus_IO_Seq_Item = packed record
20669
  TDMus_IO_Seq_Item = packed record
20666
    mtTime:     TMusic_Time;
20670
    mtTime:     TMusic_Time;
20667
    mtDuration: TMusic_Time;
20671
    mtDuration: TMusic_Time;
20668
    dwPChannel: DWORD;
20672
    dwPChannel: DWORD;
20669
    nOffset:    SmallInt;
20673
    nOffset:    SmallInt;
20670
    bStatus:    BYTE;
20674
    bStatus:    BYTE;
20671
    bByte1:     BYTE;
20675
    bByte1:     BYTE;
20672
    bByte2:     BYTE;
20676
    bByte2:     BYTE;
20673
  end;
20677
  end;
20674
 
20678
 
20675
  TDMus_IO_Curve_Item = packed record
20679
  TDMus_IO_Curve_Item = packed record
20676
    mtStart:          TMusic_Time;
20680
    mtStart:          TMusic_Time;
20677
    mtDuration:       TMusic_Time;
20681
    mtDuration:       TMusic_Time;
20678
    mtResetDuration:  TMusic_Time;
20682
    mtResetDuration:  TMusic_Time;
20679
    dwPChannel:       DWORD;
20683
    dwPChannel:       DWORD;
20680
       nOffset:       SmallInt;
20684
       nOffset:       SmallInt;
20681
       nStartValue:   SmallInt;
20685
       nStartValue:   SmallInt;
20682
       nEndValue:     SmallInt;
20686
       nEndValue:     SmallInt;
20683
       nResetValue:   SmallInt;
20687
       nResetValue:   SmallInt;
20684
    bType:            BYTE;
20688
    bType:            BYTE;
20685
    bCurveShape:      BYTE;
20689
    bCurveShape:      BYTE;
20686
    bCCData:          BYTE;
20690
    bCCData:          BYTE;
20687
    bFlags:           BYTE;
20691
    bFlags:           BYTE;
20688
  end;
20692
  end;
20689
 
20693
 
20690
  TDMus_IO_Tempo_Item = packed record
20694
  TDMus_IO_Tempo_Item = packed record
20691
    lTime:    TMusic_Time;
20695
    lTime:    TMusic_Time;
20692
    dblTempo: double;
20696
    dblTempo: double;
20693
  end;
20697
  end;
20694
 
20698
 
20695
  TDMus_IO_SysEx_Item = packed record
20699
  TDMus_IO_SysEx_Item = packed record
20696
    mtTime:        TMusic_Time;
20700
    mtTime:        TMusic_Time;
20697
    dwPChannel:    DWORD;
20701
    dwPChannel:    DWORD;
20698
    dwSysExLength: DWORD;
20702
    dwSysExLength: DWORD;
20699
  end;
20703
  end;
20700
 
20704
 
20701
  TDMus_IO_TimeSignature_Item = packed record
20705
  TDMus_IO_TimeSignature_Item = packed record
20702
    lTime:            TMusic_Time;
20706
    lTime:            TMusic_Time;
20703
    bBeatsPerMeasure: BYTE;            (* beats per measure (top of time sig) *)
20707
    bBeatsPerMeasure: BYTE;            (* beats per measure (top of time sig) *)
20704
    bBeat:            BYTE;            (* what note receives the beat (bottom of time sig.) *)
20708
    bBeat:            BYTE;            (* what note receives the beat (bottom of time sig.) *)
20705
                                       (* we can assume that 0 means 256th note *)
20709
                                       (* we can assume that 0 means 256th note *)
20706
    wGridsPerBeat:    WORD;            (* grids per beat *)
20710
    wGridsPerBeat:    WORD;            (* grids per beat *)
20707
  end;
20711
  end;
20708
 
20712
 
20709
(* PARAM structures, used by GetParam() and SetParam() *)
20713
(* PARAM structures, used by GetParam() and SetParam() *)
20710
  TDMus_Command_Param = packed record
20714
  TDMus_Command_Param = packed record
20711
    bCommand:     BYTE;
20715
    bCommand:     BYTE;
20712
    bGrooveLevel: BYTE;
20716
    bGrooveLevel: BYTE;
20713
    bGrooveRange: BYTE;
20717
    bGrooveRange: BYTE;
20714
  end;
20718
  end;
20715
 
20719
 
20716
  TDMus_Command_Param_2 = packed record
20720
  TDMus_Command_Param_2 = packed record
20717
    mtTime : TMusic_Time;
20721
    mtTime : TMusic_Time;
20718
    bCommand:     BYTE;
20722
    bCommand:     BYTE;
20719
    bGrooveLevel: BYTE;
20723
    bGrooveLevel: BYTE;
20720
    bGrooveRange: BYTE;
20724
    bGrooveRange: BYTE;
20721
  end;
20725
  end;
20722
 
20726
 
20723
  TDMus_Chord_Param = TDMus_Chord_Key; (* DMUS_CHORD_KEY defined in dmusici.h *)
20727
  TDMus_Chord_Param = TDMus_Chord_Key; (* DMUS_CHORD_KEY defined in dmusici.h *)
20724
 
20728
 
20725
  TDMus_Rhythm_Param = packed record
20729
  TDMus_Rhythm_Param = packed record
20726
    TimeSig:         TDMus_TimeSignature;
20730
    TimeSig:         TDMus_TimeSignature;
20727
    dwRhythmPattern: DWORD;
20731
    dwRhythmPattern: DWORD;
20728
  end;
20732
  end;
20729
 
20733
 
20730
  TDMus_Tempo_Param = packed record
20734
  TDMus_Tempo_Param = packed record
20731
    mtTime:   TMusic_Time;
20735
    mtTime:   TMusic_Time;
20732
    dblTempo: double;
20736
    dblTempo: double;
20733
  end;
20737
  end;
20734
 
20738
 
20735
  TDMus_Mute_Param = packed record
20739
  TDMus_Mute_Param = packed record
20736
    dwPChannel:    DWORD;
20740
    dwPChannel:    DWORD;
20737
    dwPChannelMap: DWORD;
20741
    dwPChannelMap: DWORD;
20738
    fMute:         BOOL;
20742
    fMute:         BOOL;
20739
  end;
20743
  end;
20740
 
20744
 
20741
const
20745
const
20742
(* Style chunks *)
20746
(* Style chunks *)
20743
 
20747
 
20744
  DMUS_FOURCC_STYLE_FORM        : mmioFOURCC = ('D','M','S','T');
20748
  DMUS_FOURCC_STYLE_FORM        : mmioFOURCC = ('D','M','S','T');
20745
  DMUS_FOURCC_STYLE_CHUNK       : mmioFOURCC = ('s','t','y','h');
20749
  DMUS_FOURCC_STYLE_CHUNK       : mmioFOURCC = ('s','t','y','h');
20746
  DMUS_FOURCC_PART_LIST         : mmioFOURCC = ('p','a','r','t');
20750
  DMUS_FOURCC_PART_LIST         : mmioFOURCC = ('p','a','r','t');
20747
  DMUS_FOURCC_PART_CHUNK        : mmioFOURCC = ('p','r','t','h');
20751
  DMUS_FOURCC_PART_CHUNK        : mmioFOURCC = ('p','r','t','h');
20748
  DMUS_FOURCC_NOTE_CHUNK        : mmioFOURCC = ('n','o','t','e');
20752
  DMUS_FOURCC_NOTE_CHUNK        : mmioFOURCC = ('n','o','t','e');
20749
  DMUS_FOURCC_CURVE_CHUNK       : mmioFOURCC = ('c','r','v','e');
20753
  DMUS_FOURCC_CURVE_CHUNK       : mmioFOURCC = ('c','r','v','e');
20750
  DMUS_FOURCC_PATTERN_LIST      : mmioFOURCC = ('p','t','t','n');
20754
  DMUS_FOURCC_PATTERN_LIST      : mmioFOURCC = ('p','t','t','n');
20751
  DMUS_FOURCC_PATTERN_CHUNK     : mmioFOURCC = ('p','t','n','h');
20755
  DMUS_FOURCC_PATTERN_CHUNK     : mmioFOURCC = ('p','t','n','h');
20752
  DMUS_FOURCC_RHYTHM_CHUNK      : mmioFOURCC = ('r','h','t','m');
20756
  DMUS_FOURCC_RHYTHM_CHUNK      : mmioFOURCC = ('r','h','t','m');
20753
  DMUS_FOURCC_PARTREF_LIST      : mmioFOURCC = ('p','r','e','f');
20757
  DMUS_FOURCC_PARTREF_LIST      : mmioFOURCC = ('p','r','e','f');
20754
  DMUS_FOURCC_PARTREF_CHUNK     : mmioFOURCC = ('p','r','f','c');
20758
  DMUS_FOURCC_PARTREF_CHUNK     : mmioFOURCC = ('p','r','f','c');
20755
  DMUS_FOURCC_STYLE_PERS_REF_LIST   : mmioFOURCC = ('p', 'r', 'r', 'f');
20759
  DMUS_FOURCC_STYLE_PERS_REF_LIST   : mmioFOURCC = ('p', 'r', 'r', 'f');
20756
  DMUS_FOURCC_MOTIFSETTINGS_CHUNK   : mmioFOURCC = ('m', 't', 'f', 's');
20760
  DMUS_FOURCC_MOTIFSETTINGS_CHUNK   : mmioFOURCC = ('m', 't', 'f', 's');
20757
 
20761
 
20758
(* Flags used by variations: these make up the DWORDs in dwVariationChoices.               *)
20762
(* Flags used by variations: these make up the DWORDs in dwVariationChoices.               *)
20759
 
20763
 
20760
(* These flags determine the types of chords supported by a given variation in DirectMusic *)
20764
(* These flags determine the types of chords supported by a given variation in DirectMusic *)
20761
(* mode.  The first seven flags (bits 1-7) are set if the variation supports major chords  *)
20765
(* mode.  The first seven flags (bits 1-7) are set if the variation supports major chords  *)
20762
(* rooted in scale positions, so, e.g., if bits 1, 2, and 4 are set, the variation         *)
20766
(* rooted in scale positions, so, e.g., if bits 1, 2, and 4 are set, the variation         *)
20763
(* supports major chords rooted in the tonic, second, and fourth scale positions.  The     *)
20767
(* supports major chords rooted in the tonic, second, and fourth scale positions.  The     *)
20764
(* next seven flags serve the same purpose, but for minor chords, and the following seven  *)
20768
(* next seven flags serve the same purpose, but for minor chords, and the following seven  *)
20765
(* flags serve the same purpose for chords that are not major or minor (e.g., SUS 4        *)
20769
(* flags serve the same purpose for chords that are not major or minor (e.g., SUS 4        *)
20766
(* chords).  Bits 22, 23, and 24 are set if the variation supports chords rooted in the    *)
20770
(* chords).  Bits 22, 23, and 24 are set if the variation supports chords rooted in the    *)
20767
(* scale, chords rooted sharp of scale tones, and chords rooted flat of scale tones,       *)
20771
(* scale, chords rooted sharp of scale tones, and chords rooted flat of scale tones,       *)
20768
(* respectively.  For example, to support a C# minor chord in the scale of C Major,        *)
20772
(* respectively.  For example, to support a C# minor chord in the scale of C Major,        *)
20769
(* bits 8 (for tonic minor) and 24 (for sharp) need to be set.  Bits 25, 26, an 27 handle  *)
20773
(* bits 8 (for tonic minor) and 24 (for sharp) need to be set.  Bits 25, 26, an 27 handle  *)
20770
(* chords that are triads, 6th or 7th chords, and chords with extensions, respectively.    *)
20774
(* chords that are triads, 6th or 7th chords, and chords with extensions, respectively.    *)
20771
(* bits 28 and 29 handle chords that are followed by tonic and dominant chords,            *)
20775
(* bits 28 and 29 handle chords that are followed by tonic and dominant chords,            *)
20772
(* respectively.                                                                           *)
20776
(* respectively.                                                                           *)
20773
  DMUS_VARIATIONF_MAJOR        = $0000007F; (* Seven positions in the scale - major chords. *)
20777
  DMUS_VARIATIONF_MAJOR        = $0000007F; (* Seven positions in the scale - major chords. *)
20774
  DMUS_VARIATIONF_MINOR        = $00003F80; (* Seven positions in the scale - minor chords. *)
20778
  DMUS_VARIATIONF_MINOR        = $00003F80; (* Seven positions in the scale - minor chords. *)
20775
  DMUS_VARIATIONF_OTHER        = $001FC000; (* Seven positions in the scale - other chords. *)
20779
  DMUS_VARIATIONF_OTHER        = $001FC000; (* Seven positions in the scale - other chords. *)
20776
  DMUS_VARIATIONF_ROOT_SCALE   = $00200000; (* Handles chord roots in the scale. *)
20780
  DMUS_VARIATIONF_ROOT_SCALE   = $00200000; (* Handles chord roots in the scale. *)
20777
  DMUS_VARIATIONF_ROOT_FLAT    = $00400000; (* Handles flat chord roots (based on scale notes). *)
20781
  DMUS_VARIATIONF_ROOT_FLAT    = $00400000; (* Handles flat chord roots (based on scale notes). *)
20778
  DMUS_VARIATIONF_ROOT_SHARP   = $00800000; (* Handles sharp chord roots (based on scale notes). *)
20782
  DMUS_VARIATIONF_ROOT_SHARP   = $00800000; (* Handles sharp chord roots (based on scale notes). *)
20779
  DMUS_VARIATIONF_TYPE_TRIAD   = $01000000; (* Handles simple chords - triads. *)
20783
  DMUS_VARIATIONF_TYPE_TRIAD   = $01000000; (* Handles simple chords - triads. *)
20780
  DMUS_VARIATIONF_TYPE_6AND7   = $02000000; (* Handles simple chords - 6 and 7. *)
20784
  DMUS_VARIATIONF_TYPE_6AND7   = $02000000; (* Handles simple chords - 6 and 7. *)
20781
  DMUS_VARIATIONF_TYPE_COMPLEX = $04000000; (* Handles complex chords. *)
20785
  DMUS_VARIATIONF_TYPE_COMPLEX = $04000000; (* Handles complex chords. *)
20782
  DMUS_VARIATIONF_DEST_TO1     = $08000000; (* Handles transitions to 1 chord. *)
20786
  DMUS_VARIATIONF_DEST_TO1     = $08000000; (* Handles transitions to 1 chord. *)
20783
  DMUS_VARIATIONF_DEST_TO5     = $10000000; (* Handles transitions to 5 chord. *)
20787
  DMUS_VARIATIONF_DEST_TO5     = $10000000; (* Handles transitions to 5 chord. *)
20784
 
20788
 
20785
(* The top three bits of the variation flags are the Mode bits.  If all are 0, it's IMA. *)
20789
(* The top three bits of the variation flags are the Mode bits.  If all are 0, it's IMA. *)
20786
(* If the smallest is 1, it's Direct Music. *)
20790
(* If the smallest is 1, it's Direct Music. *)
20787
  DMUS_VARIATIONF_MODES        = $E0000000;
20791
  DMUS_VARIATIONF_MODES        = $E0000000;
20788
  DMUS_VARIATIONF_IMA25_MODE   = $00000000;
20792
  DMUS_VARIATIONF_IMA25_MODE   = $00000000;
20789
  DMUS_VARIATIONF_DMUS_MODE    = $20000000;
20793
  DMUS_VARIATIONF_DMUS_MODE    = $20000000;
20790
 
20794
 
20791
//#pragma pack(2)
20795
//#pragma pack(2)
20792
 
20796
 
20793
type BYTE2 = Word;
20797
type BYTE2 = Word;
20794
 
20798
 
20795
type
20799
type
20796
  TDMus_IO_TimeSig = packed record
20800
  TDMus_IO_TimeSig = packed record
20797
    (* Time signatures define how many beats per measure, which note receives *)
20801
    (* Time signatures define how many beats per measure, which note receives *)
20798
    (* the beat, and the grid resolution. *)
20802
    (* the beat, and the grid resolution. *)
20799
    bBeatsPerMeasure: BYTE2;      (* beats per measure (top of time sig) *)
20803
    bBeatsPerMeasure: BYTE2;      (* beats per measure (top of time sig) *)
20800
    bBeat:            BYTE2;      (* what note receives the beat (bottom of time sig.) *)
20804
    bBeat:            BYTE2;      (* what note receives the beat (bottom of time sig.) *)
20801
                                 (* we can assume that 0 means 256th note *)
20805
                                 (* we can assume that 0 means 256th note *)
20802
    wGridsPerBeat:    WORD;      (* grids per beat *)
20806
    wGridsPerBeat:    WORD;      (* grids per beat *)
20803
  end;
20807
  end;
20804
 
20808
 
20805
  TDMus_IO_Style = packed record
20809
  TDMus_IO_Style = packed record
20806
    timeSig:  TDMus_IO_TimeSig;           (* Styles have a default Time Signature *)
20810
    timeSig:  TDMus_IO_TimeSig;           (* Styles have a default Time Signature *)
20807
    dblTempo: double;
20811
    dblTempo: double;
20808
  end;
20812
  end;
20809
 
20813
 
20810
  TDMus_IO_Version = packed record
20814
  TDMus_IO_Version = packed record
20811
    dwVersionMS: DWORD;                      (* Version # high-order 32 bits *)
20815
    dwVersionMS: DWORD;                      (* Version # high-order 32 bits *)
20812
    dwVersionLS: DWORD;                      (* Version # low-order 32 bits  *)
20816
    dwVersionLS: DWORD;                      (* Version # low-order 32 bits  *)
20813
  end;
20817
  end;
20814
 
20818
 
20815
  TDMus_IO_Pattern = packed record
20819
  TDMus_IO_Pattern = packed record
20816
    timeSig:        TDMus_IO_TimeSig;    (* Patterns can override the Style's Time sig. *)
20820
    timeSig:        TDMus_IO_TimeSig;    (* Patterns can override the Style's Time sig. *)
20817
    bGrooveBottom:  BYTE2;                (* bottom of groove range *)
20821
    bGrooveBottom:  BYTE2;                (* bottom of groove range *)
20818
    bGrooveTop:     BYTE2;                (* top of groove range *)
20822
    bGrooveTop:     BYTE2;                (* top of groove range *)
20819
    wEmbellishment: WORD;                (* Fill, Break, Intro, End, Normal, Motif *)
20823
    wEmbellishment: WORD;                (* Fill, Break, Intro, End, Normal, Motif *)
20820
    wNbrMeasures:   WORD;                (* length in measures *)
20824
    wNbrMeasures:   WORD;                (* length in measures *)
20821
  end;
20825
  end;
20822
 
20826
 
20823
  TDMus_IO_StylePart = packed record
20827
  TDMus_IO_StylePart = packed record
20824
    timeSig:        TDMus_IO_TimeSig;   (* can override pattern's *)
20828
    timeSig:        TDMus_IO_TimeSig;   (* can override pattern's *)
20825
    dwVariationChoices: array [0..31] of DWORD; (* MOAW choice bitfield *)
20829
    dwVariationChoices: array [0..31] of DWORD; (* MOAW choice bitfield *)
20826
    guidPartID:     TGUID;              (* identifies the part *)
20830
    guidPartID:     TGUID;              (* identifies the part *)
20827
    wNbrMeasures:   WORD;               (* length of the Part *)
20831
    wNbrMeasures:   WORD;               (* length of the Part *)
20828
    bPlayModeFlags: BYTE2;               (* see PLAYMODE flags *)
20832
    bPlayModeFlags: BYTE2;               (* see PLAYMODE flags *)
20829
    bInvertUpper:   BYTE2;               (* inversion upper limit *)
20833
    bInvertUpper:   BYTE2;               (* inversion upper limit *)
20830
    bInvertLower:   BYTE2;               (* inversion lower limit *)
20834
    bInvertLower:   BYTE2;               (* inversion lower limit *)
20831
  end;
20835
  end;
20832
 
20836
 
20833
  TDMus_IO_PartRef = packed record
20837
  TDMus_IO_PartRef = packed record
20834
    guidPartID:       TGUID;     (* unique ID for matching up with parts *)
20838
    guidPartID:       TGUID;     (* unique ID for matching up with parts *)
20835
    wLogicalPartID:   WORD;      (* corresponds to port/device/midi channel *)
20839
    wLogicalPartID:   WORD;      (* corresponds to port/device/midi channel *)
20836
    bVariationLockID: BYTE2;      (* parts with the same ID lock variations. *)
20840
    bVariationLockID: BYTE2;      (* parts with the same ID lock variations. *)
20837
                                 (* high bit is used to identify master Part *)
20841
                                 (* high bit is used to identify master Part *)
20838
    bSubChordLevel:   BYTE2;      (* tells which sub chord level this part wants *)
20842
    bSubChordLevel:   BYTE2;      (* tells which sub chord level this part wants *)
20839
    bPriority:        BYTE2;      (* 256 priority levels. Parts with lower priority *)
20843
    bPriority:        BYTE2;      (* 256 priority levels. Parts with lower priority *)
20840
                                 (* aren't played first when a device runs out of *)
20844
                                 (* aren't played first when a device runs out of *)
20841
                                 (* notes *)
20845
                                 (* notes *)
20842
    bRandomVariation: BYTE2;      (* when set, matching variations play in random order *)
20846
    bRandomVariation: BYTE2;      (* when set, matching variations play in random order *)
20843
                                 (* when clear, matching variations play sequentially *)
20847
                                 (* when clear, matching variations play sequentially *)
20844
  end;
20848
  end;
20845
 
20849
 
20846
  TDMus_IO_StyleNote = packed record
20850
  TDMus_IO_StyleNote = packed record
20847
    mtGridStart:    TMusic_Time ;(* when this note occurs *)
20851
    mtGridStart:    TMusic_Time ;(* when this note occurs *)
20848
    dwVariation:    DWORD;       (* variation bits *)
20852
    dwVariation:    DWORD;       (* variation bits *)
20849
    mtDuration:     TMusic_Time; (* how long this note lasts *)
20853
    mtDuration:     TMusic_Time; (* how long this note lasts *)
20850
    nTimeOffset:    SmallInt;    (* offset from mtGridStart *)
20854
    nTimeOffset:    SmallInt;    (* offset from mtGridStart *)
20851
    wMusicValue:    WORD;        (* Position in scale. *)
20855
    wMusicValue:    WORD;        (* Position in scale. *)
20852
    bVelocity:      BYTE2;        (* Note velocity. *)
20856
    bVelocity:      BYTE2;        (* Note velocity. *)
20853
    bTimeRange:     BYTE2;        (* Range to randomize start time. *)
20857
    bTimeRange:     BYTE2;        (* Range to randomize start time. *)
20854
    bDurRange:      BYTE2;        (* Range to randomize duration. *)
20858
    bDurRange:      BYTE2;        (* Range to randomize duration. *)
20855
    bVelRange:      BYTE2;        (* Range to randomize velocity. *)
20859
    bVelRange:      BYTE2;        (* Range to randomize velocity. *)
20856
    bInversionID:   BYTE2;        (* Identifies inversion group to which this note belongs *)
20860
    bInversionID:   BYTE2;        (* Identifies inversion group to which this note belongs *)
20857
    bPlayModeFlags: BYTE2;        (* Can override part *)
20861
    bPlayModeFlags: BYTE2;        (* Can override part *)
20858
  end;
20862
  end;
20859
 
20863
 
20860
  TDMus_IO_StyleCurve = packed record
20864
  TDMus_IO_StyleCurve = packed record
20861
    mtGridStart:     TMusic_Time; (* when this curve occurs *)
20865
    mtGridStart:     TMusic_Time; (* when this curve occurs *)
20862
    dwVariation:     DWORD;       (* variation bits *)
20866
    dwVariation:     DWORD;       (* variation bits *)
20863
    mtDuration:      TMusic_Time; (* how long this curve lasts *)
20867
    mtDuration:      TMusic_Time; (* how long this curve lasts *)
20864
    mtResetDuration: TMusic_Time; (* how long after the end of the curve to reset the curve *)
20868
    mtResetDuration: TMusic_Time; (* how long after the end of the curve to reset the curve *)
20865
    nTimeOffset:     SmallInt;    (* offset from mtGridStart *)
20869
    nTimeOffset:     SmallInt;    (* offset from mtGridStart *)
20866
    nStartValue:     SmallInt;    (* curve's start value *)
20870
    nStartValue:     SmallInt;    (* curve's start value *)
20867
    nEndValue:       SmallInt;    (* curve's end value *)
20871
    nEndValue:       SmallInt;    (* curve's end value *)
20868
    nResetValue:     SmallInt;    (* the value to which to reset the curve *)
20872
    nResetValue:     SmallInt;    (* the value to which to reset the curve *)
20869
    bEventType:      BYTE2;        (* type of curve *)
20873
    bEventType:      BYTE2;        (* type of curve *)
20870
    bCurveShape:     BYTE2;        (* shape of curve *)
20874
    bCurveShape:     BYTE2;        (* shape of curve *)
20871
    bCCData:         BYTE2;        (* CC# *)
20875
    bCCData:         BYTE2;        (* CC# *)
20872
    bFlags:          BYTE2;        (* Bit 1=TRUE means to send nResetValue. Otherwise, don't.
20876
    bFlags:          BYTE2;        (* Bit 1=TRUE means to send nResetValue. Otherwise, don't.
20873
                                    Other bits are reserved. *)
20877
                                    Other bits are reserved. *)
20874
  end;
20878
  end;
20875
 
20879
 
20876
  TDMus_IO_MotifSettings = packed record
20880
  TDMus_IO_MotifSettings = packed record
20877
    dwRepeats:    DWORD;          (* Number of repeats. By default, 0. *)
20881
    dwRepeats:    DWORD;          (* Number of repeats. By default, 0. *)
20878
    mtPlayStart:  TMusic_Time;    (* Start of playback. By default, 0. *)
20882
    mtPlayStart:  TMusic_Time;    (* Start of playback. By default, 0. *)
20879
    mtLoopStart:  TMusic_Time;    (* Start of looping portion. By default, 0. *)
20883
    mtLoopStart:  TMusic_Time;    (* Start of looping portion. By default, 0. *)
20880
    mtLoopEnd:    TMusic_Time;    (* End of loop. Must be greater than mtLoopStart. By default equal to length of motif. *)
20884
    mtLoopEnd:    TMusic_Time;    (* End of loop. Must be greater than mtLoopStart. By default equal to length of motif. *)
20881
    dwResolution: DWORD;          (* Default resolution. *)
20885
    dwResolution: DWORD;          (* Default resolution. *)
20882
  end;
20886
  end;
20883
 
20887
 
20884
//#pragma pack()
20888
//#pragma pack()
20885
 
20889
 
20886
(*
20890
(*
20887
RIFF
20891
RIFF
20888
(
20892
(
20889
    'DMST'          // Style
20893
    'DMST'          // Style
20890
    <styh-ck>       // Style header chunk
20894
    <styh-ck>       // Style header chunk
20891
    <guid-ck>       // Every Style has a GUID
20895
    <guid-ck>       // Every Style has a GUID
20892
    [<UNFO-list>]   // Name, author, copyright info., comments
20896
    [<UNFO-list>]   // Name, author, copyright info., comments
20893
    [<vers-ck>]     // version chunk
20897
    [<vers-ck>]     // version chunk
20894
    <part-list>...  // List of parts in the Style, used by patterns
20898
    <part-list>...  // List of parts in the Style, used by patterns
20895
    <pttn-list>...  // List of patterns in the Style
20899
    <pttn-list>...  // List of patterns in the Style
20896
    <DMBD-form>...  // List of bands in the Style
20900
    <DMBD-form>...  // List of bands in the Style
20897
    [<motf-list>]   // List of motifs in the Style
20901
    [<motf-list>]   // List of motifs in the Style
20898
    [<prrf-list>]   // List of chord map references in the Style
20902
    [<prrf-list>]   // List of chord map references in the Style
20899
)
20903
)
20900
 
20904
 
20901
    // <styh-ck>
20905
    // <styh-ck>
20902
    styh
20906
    styh
20903
    (
20907
    (
20904
        <DMUS_IO_STYLE>
20908
        <DMUS_IO_STYLE>
20905
    )
20909
    )
20906
 
20910
 
20907
    // <guid-ck>
20911
    // <guid-ck>
20908
    guid
20912
    guid
20909
    (
20913
    (
20910
        <GUID>
20914
        <GUID>
20911
    )
20915
    )
20912
 
20916
 
20913
    // <vers-ck>
20917
    // <vers-ck>
20914
    vers
20918
    vers
20915
    (
20919
    (
20916
        <DMUS_IO_VERSION>
20920
        <DMUS_IO_VERSION>
20917
    )
20921
    )
20918
 
20922
 
20919
    // <part-list>
20923
    // <part-list>
20920
    LIST
20924
    LIST
20921
    (
20925
    (
20922
        'part'
20926
        'part'
20923
        <prth-ck>       // Part header chunk
20927
        <prth-ck>       // Part header chunk
20924
        [<UNFO-list>]
20928
        [<UNFO-list>]
20925
        [<note-ck>]     // List of notes in Part
20929
        [<note-ck>]     // List of notes in Part
20926
        [<crve-ck>]     // List of curves in Part
20930
        [<crve-ck>]     // List of curves in Part
20927
    )
20931
    )
20928
 
20932
 
20929
        // <orth-ck>
20933
        // <orth-ck>
20930
        prth
20934
        prth
20931
        (
20935
        (
20932
            <DMUS_IO_STYLEPART>
20936
            <DMUS_IO_STYLEPART>
20933
        )
20937
        )
20934
 
20938
 
20935
        // <note-ck>
20939
        // <note-ck>
20936
        'note'
20940
        'note'
20937
        (
20941
        (
20938
            // sizeof DMUS_IO_STYLENOTE:DWORD
20942
            // sizeof DMUS_IO_STYLENOTE:DWORD
20939
            <DMUS_IO_STYLENOTE>...
20943
            <DMUS_IO_STYLENOTE>...
20940
        )
20944
        )
20941
 
20945
 
20942
        // <crve-ck>
20946
        // <crve-ck>
20943
        'crve'
20947
        'crve'
20944
        (
20948
        (
20945
            // sizeof DMUS_IO_STYLECURVE:DWORD
20949
            // sizeof DMUS_IO_STYLECURVE:DWORD
20946
            <DMUS_IO_STYLECURVE>...
20950
            <DMUS_IO_STYLECURVE>...
20947
        )
20951
        )
20948
 
20952
 
20949
    // <pttn-list>
20953
    // <pttn-list>
20950
    LIST
20954
    LIST
20951
    (
20955
    (
20952
        'pttn'
20956
        'pttn'
20953
        <ptnh-ck>       // Pattern header chunk
20957
        <ptnh-ck>       // Pattern header chunk
20954
        <rhtm-ck>       // List of rhythms for chord matching
20958
        <rhtm-ck>       // List of rhythms for chord matching
20955
        [<UNFO-list>]
20959
        [<UNFO-list>]
20956
        [<mtfs-ck>]     // Motif settings chunk
20960
        [<mtfs-ck>]     // Motif settings chunk
20957
        <pref-list>...  // List of part reference id's
20961
        <pref-list>...  // List of part reference id's
20958
    )
20962
    )
20959
 
20963
 
20960
        // <ptnh-ck>
20964
        // <ptnh-ck>
20961
        ptnh
20965
        ptnh
20962
        (
20966
        (
20963
            <DMUS_IO_PATTERN>
20967
            <DMUS_IO_PATTERN>
20964
        )
20968
        )
20965
 
20969
 
20966
        // <rhtm-ck>
20970
        // <rhtm-ck>
20967
        'rhtm'
20971
        'rhtm'
20968
        (
20972
        (
20969
            // DWORD's representing rhythms for chord matching based on number
20973
            // DWORD's representing rhythms for chord matching based on number
20970
            // of measures in the pattern
20974
            // of measures in the pattern
20971
        )
20975
        )
20972
 
20976
 
20973
        // pref-list
20977
        // pref-list
20974
        LIST
20978
        LIST
20975
        (
20979
        (
20976
            'pref'
20980
            'pref'
20977
            <prfc-ck>   // part ref chunk
20981
            <prfc-ck>   // part ref chunk
20978
        )
20982
        )
20979
 
20983
 
20980
        // <prfc-ck>
20984
        // <prfc-ck>
20981
        prfc
20985
        prfc
20982
        (
20986
        (
20983
            <DMUS_IO_PARTREF>
20987
            <DMUS_IO_PARTREF>
20984
        )
20988
        )
20985
 
20989
 
20986
        // <mtfs-ck>
20990
        // <mtfs-ck>
20987
        mtfs
20991
        mtfs
20988
        (
20992
        (
20989
            <DMUS_IO_MOTIFSETTINGS>
20993
            <DMUS_IO_MOTIFSETTINGS>
20990
        )
20994
        )
20991
 
20995
 
20992
    // <prrf-list>
20996
    // <prrf-list>
20993
    LIST
20997
    LIST
20994
    (
20998
    (
20995
        'prrf'
20999
        'prrf'
20996
        // some number of <DMRF>
21000
        // some number of <DMRF>
20997
    )
21001
    )
20998
*)
21002
*)
20999
 
21003
 
21000
(* Chord and command file formats *)
21004
(* Chord and command file formats *)
21001
const
21005
const
21002
  DMUS_FOURCC_CHORDTRACK_LIST         : mmioFOURCC = ('c','o','r','d');
21006
  DMUS_FOURCC_CHORDTRACK_LIST         : mmioFOURCC = ('c','o','r','d');
21003
  DMUS_FOURCC_CHORDTRACKHEADER_CHUNK  : mmioFOURCC = ('c','r','d','h');
21007
  DMUS_FOURCC_CHORDTRACKHEADER_CHUNK  : mmioFOURCC = ('c','r','d','h');
21004
  DMUS_FOURCC_CHORDTRACKBODY_CHUNK    : mmioFOURCC = ('c','r','d','b');
21008
  DMUS_FOURCC_CHORDTRACKBODY_CHUNK    : mmioFOURCC = ('c','r','d','b');
21005
 
21009
 
21006
  DMUS_FOURCC_COMMANDTRACK_CHUNK      : mmioFOURCC = ('c','m','n','d');
21010
  DMUS_FOURCC_COMMANDTRACK_CHUNK      : mmioFOURCC = ('c','m','n','d');
21007
 
21011
 
21008
type
21012
type
21009
  TDMus_IO_Chord = packed record
21013
  TDMus_IO_Chord = packed record
21010
    wszName: array [0..15] of WCHAR; (* Name of the chord *)
21014
    wszName: array [0..15] of WCHAR; (* Name of the chord *)
21011
    mtTime:      TMusic_Time;    (* Time of this chord *)
21015
    mtTime:      TMusic_Time;    (* Time of this chord *)
21012
    wMeasure:    WORD;           (* Measure this falls on *)
21016
    wMeasure:    WORD;           (* Measure this falls on *)
21013
    bBeat:       BYTE;           (* Beat this falls on *)
21017
    bBeat:       BYTE;           (* Beat this falls on *)
21014
  end;
21018
  end;
21015
 
21019
 
21016
  TDMus_IO_SubChord = packed record
21020
  TDMus_IO_SubChord = packed record
21017
    dwChordPattern:    DWORD;    (* Notes in the subchord *)
21021
    dwChordPattern:    DWORD;    (* Notes in the subchord *)
21018
    dwScalePattern:    DWORD;    (* Notes in the scale *)
21022
    dwScalePattern:    DWORD;    (* Notes in the scale *)
21019
    dwInversionPoints: DWORD;    (* Where inversions can occur *)
21023
    dwInversionPoints: DWORD;    (* Where inversions can occur *)
21020
    dwLevels:          DWORD;    (* Which levels are supported by this subchord *)
21024
    dwLevels:          DWORD;    (* Which levels are supported by this subchord *)
21021
    bChordRoot:        BYTE;     (* Root of the subchord *)
21025
    bChordRoot:        BYTE;     (* Root of the subchord *)
21022
    bScaleRoot:        BYTE;     (* Root of the scale *)
21026
    bScaleRoot:        BYTE;     (* Root of the scale *)
21023
  end;
21027
  end;
21024
 
21028
 
21025
  TDMus_IO_Command = packed record
21029
  TDMus_IO_Command = packed record
21026
    mtTime:       TMusic_Time;   (* Time of this command *)
21030
    mtTime:       TMusic_Time;   (* Time of this command *)
21027
    wMeasure:     WORD;          (* Measure this falls on *)
21031
    wMeasure:     WORD;          (* Measure this falls on *)
21028
    bBeat:        BYTE;          (* Beat this falls on *)
21032
    bBeat:        BYTE;          (* Beat this falls on *)
21029
    bCommand:     BYTE;          (* Command type (see #defines below) *)
21033
    bCommand:     BYTE;          (* Command type (see #defines below) *)
21030
    bGrooveLevel: BYTE;          (* Groove level (0 if command is not a groove) *)
21034
    bGrooveLevel: BYTE;          (* Groove level (0 if command is not a groove) *)
21031
    bGrooveRange: BYTE;          (* Groove range  *)
21035
    bGrooveRange: BYTE;          (* Groove range  *)
21032
  end;
21036
  end;
21033
 
21037
 
21034
(*
21038
(*
21035
 
21039
 
21036
    // <cord-list>
21040
    // <cord-list>
21037
    LIST
21041
    LIST
21038
    (
21042
    (
21039
        'cord'
21043
        'cord'
21040
        <crdh-ck>
21044
        <crdh-ck>
21041
        <crdb-ck>       // Chord body chunk
21045
        <crdb-ck>       // Chord body chunk
21042
    )
21046
    )
21043
 
21047
 
21044
        // <crdh-ck>
21048
        // <crdh-ck>
21045
        crdh
21049
        crdh
21046
        (
21050
        (
21047
            // Scale: dword (upper 8 bits for root, lower 24 for scale)
21051
            // Scale: dword (upper 8 bits for root, lower 24 for scale)
21048
        )
21052
        )
21049
 
21053
 
21050
        // <crdb-ck>
21054
        // <crdb-ck>
21051
        crdb
21055
        crdb
21052
        (
21056
        (
21053
            // sizeof DMUS_IO_CHORD:dword
21057
            // sizeof DMUS_IO_CHORD:dword
21054
            <DMUS_IO_CHORD>
21058
            <DMUS_IO_CHORD>
21055
            // # of DMUS_IO_SUBCHORDS:dword
21059
            // # of DMUS_IO_SUBCHORDS:dword
21056
            // sizeof DMUS_IO_SUBCHORDS:dword
21060
            // sizeof DMUS_IO_SUBCHORDS:dword
21057
            // a number of <DMUS_IO_SUBCHORD>
21061
            // a number of <DMUS_IO_SUBCHORD>
21058
        )
21062
        )
21059
 
21063
 
21060
 
21064
 
21061
    // <cmnd-list>
21065
    // <cmnd-list>
21062
    'cmnd'
21066
    'cmnd'
21063
    (
21067
    (
21064
        //sizeof DMUS_IO_COMMAND: DWORD
21068
        //sizeof DMUS_IO_COMMAND: DWORD
21065
        <DMUS_IO_COMMAND>...
21069
        <DMUS_IO_COMMAND>...
21066
    )
21070
    )
21067
 
21071
 
21068
*)
21072
*)
21069
 
21073
 
21070
(*  File io for DirectMusic Tool and ToolGraph objects
21074
(*  File io for DirectMusic Tool and ToolGraph objects
21071
*)
21075
*)
21072
 
21076
 
21073
(* RIFF ids: *)
21077
(* RIFF ids: *)
21074
const
21078
const
21075
  DMUS_FOURCC_TOOLGRAPH_FORM  : mmioFOURCC = ('D','M','T','G');
21079
  DMUS_FOURCC_TOOLGRAPH_FORM  : mmioFOURCC = ('D','M','T','G');
21076
  DMUS_FOURCC_TOOL_LIST       : mmioFOURCC = ('t','o','l','l');
21080
  DMUS_FOURCC_TOOL_LIST       : mmioFOURCC = ('t','o','l','l');
21077
  DMUS_FOURCC_TOOL_FORM       : mmioFOURCC = ('D','M','T','L');
21081
  DMUS_FOURCC_TOOL_FORM       : mmioFOURCC = ('D','M','T','L');
21078
  DMUS_FOURCC_TOOL_CHUNK      : mmioFOURCC = ('t','o','l','h');
21082
  DMUS_FOURCC_TOOL_CHUNK      : mmioFOURCC = ('t','o','l','h');
21079
 
21083
 
21080
(* io structures: *)
21084
(* io structures: *)
21081
type
21085
type
21082
  TDMus_IO_Tool_Header = packed record
21086
  TDMus_IO_Tool_Header = packed record
21083
    guidClassID:    TGUID;       (* Class id of tool. *)
21087
    guidClassID:    TGUID;       (* Class id of tool. *)
21084
    lIndex:         LongInt;     (* Position in graph. *)
21088
    lIndex:         LongInt;     (* Position in graph. *)
21085
    cPChannels:     DWORD;       (* Number of items in channels array. *)
21089
    cPChannels:     DWORD;       (* Number of items in channels array. *)
21086
    ckid:           TFourCC;     (* chunk ID of tool's data chunk if 0 fccType valid. *)
21090
    ckid:           TFourCC;     (* chunk ID of tool's data chunk if 0 fccType valid. *)
21087
    fccType:        TFourCC;     (* list type if NULL ckid valid. *)
21091
    fccType:        TFourCC;     (* list type if NULL ckid valid. *)
21088
    dwPChannels: array [0..0] of DWORD; (* Array of PChannels, size determined by cPChannels. *)
21092
    dwPChannels: array [0..0] of DWORD; (* Array of PChannels, size determined by cPChannels. *)
21089
  end;
21093
  end;
21090
 
21094
 
21091
(*
21095
(*
21092
RIFF
21096
RIFF
21093
(
21097
(
21094
    'DMTG'          // DirectMusic ToolGraph chunk
21098
    'DMTG'          // DirectMusic ToolGraph chunk
21095
    [<guid-ck>]     // GUID for ToolGraph
21099
    [<guid-ck>]     // GUID for ToolGraph
21096
    [<vers-ck>]     // Optional version info
21100
    [<vers-ck>]     // Optional version info
21097
    [<UNFO-list>]   // Name, author, copyright info., comments
21101
    [<UNFO-list>]   // Name, author, copyright info., comments
21098
    <toll-list>     // List of Tools
21102
    <toll-list>     // List of Tools
21099
)
21103
)
21100
 
21104
 
21101
    // <guid-ck>
21105
    // <guid-ck>
21102
    'guid'
21106
    'guid'
21103
    (
21107
    (
21104
        <GUID>
21108
        <GUID>
21105
    )
21109
    )
21106
 
21110
 
21107
    // <vers-ck>
21111
    // <vers-ck>
21108
    vers
21112
    vers
21109
    (
21113
    (
21110
        <DMUS_IO_VERSION>
21114
        <DMUS_IO_VERSION>
21111
    )
21115
    )
21112
 
21116
 
21113
    // <toll-list>
21117
    // <toll-list>
21114
    LIST
21118
    LIST
21115
    (
21119
    (
21116
        'toll'          // List of tools
21120
        'toll'          // List of tools
21117
        <DMTL-form>...  // Each tool is encapsulated in a RIFF chunk
21121
        <DMTL-form>...  // Each tool is encapsulated in a RIFF chunk
21118
    )
21122
    )
21119
 
21123
 
21120
// <DMTL-form>      // Tools can be embedded in a graph or stored as separate files.
21124
// <DMTL-form>      // Tools can be embedded in a graph or stored as separate files.
21121
RIFF
21125
RIFF
21122
(
21126
(
21123
    'DMTL'
21127
    'DMTL'
21124
    <tolh-ck>
21128
    <tolh-ck>
21125
    [<guid-ck>]     // Optional GUID for tool object instance (not to be confused with Class id in track header)
21129
    [<guid-ck>]     // Optional GUID for tool object instance (not to be confused with Class id in track header)
21126
    [<vers-ck>]     // Optional version info
21130
    [<vers-ck>]     // Optional version info
21127
    [<UNFO-list>]   // Optional name, author, copyright info., comments
21131
    [<UNFO-list>]   // Optional name, author, copyright info., comments
21128
    [<data>]        // Tool data. Must be a RIFF readable chunk.
21132
    [<data>]        // Tool data. Must be a RIFF readable chunk.
21129
)
21133
)
21130
 
21134
 
21131
    // <tolh-ck>            // Tool header chunk
21135
    // <tolh-ck>            // Tool header chunk
21132
    (
21136
    (
21133
        'tolh'
21137
        'tolh'
21134
        <DMUS_IO_TOOL_HEADER>   // Tool header
21138
        <DMUS_IO_TOOL_HEADER>   // Tool header
21135
    )
21139
    )
21136
*)
21140
*)
21137
 
21141
 
21138
(*  File io for DirectMusic Band Track object *)
21142
(*  File io for DirectMusic Band Track object *)
21139
 
21143
 
21140
 
21144
 
21141
(* RIFF ids: *)
21145
(* RIFF ids: *)
21142
const
21146
const
21143
  DMUS_FOURCC_BANDTRACK_FORM  : mmioFOURCC = ('D','M','B','T');
21147
  DMUS_FOURCC_BANDTRACK_FORM  : mmioFOURCC = ('D','M','B','T');
21144
  DMUS_FOURCC_BANDTRACK_CHUNK : mmioFOURCC = ('b','d','t','h');
21148
  DMUS_FOURCC_BANDTRACK_CHUNK : mmioFOURCC = ('b','d','t','h');
21145
  DMUS_FOURCC_BANDS_LIST      : mmioFOURCC = ('l','b','d','l');
21149
  DMUS_FOURCC_BANDS_LIST      : mmioFOURCC = ('l','b','d','l');
21146
  DMUS_FOURCC_BAND_LIST       : mmioFOURCC = ('l','b','n','d');
21150
  DMUS_FOURCC_BAND_LIST       : mmioFOURCC = ('l','b','n','d');
21147
  DMUS_FOURCC_BANDITEM_CHUNK  : mmioFOURCC = ('b','d','i','h');
21151
  DMUS_FOURCC_BANDITEM_CHUNK  : mmioFOURCC = ('b','d','i','h');
21148
 
21152
 
21149
type
21153
type
21150
(*  io structures *)
21154
(*  io structures *)
21151
  TDMus_IO_Band_Track_Header = packed record
21155
  TDMus_IO_Band_Track_Header = packed record
21152
    bAutoDownload: BOOL;    (* Determines if Auto-Download is enabled. *)
21156
    bAutoDownload: BOOL;    (* Determines if Auto-Download is enabled. *)
21153
  end;
21157
  end;
21154
 
21158
 
21155
  TDMus_IO_Band_Item_Header = packed record
21159
  TDMus_IO_Band_Item_Header = packed record
21156
    lBandTime: TMusic_Time;   (* Position in track list. *)
21160
    lBandTime: TMusic_Time;   (* Position in track list. *)
21157
  end;
21161
  end;
21158
 
21162
 
21159
(*
21163
(*
21160
RIFF
21164
RIFF
21161
(
21165
(
21162
    'DMBT'          // DirectMusic Band Track form-type
21166
    'DMBT'          // DirectMusic Band Track form-type
21163
    [<bdth-ck>]     // Band track header
21167
    [<bdth-ck>]     // Band track header
21164
    [<guid-ck>]     // GUID for band track
21168
    [<guid-ck>]     // GUID for band track
21165
    [<vers-ck>]     // Optional version info
21169
    [<vers-ck>]     // Optional version info
21166
    [<UNFO-list>]   // Name, author, copyright info., comments
21170
    [<UNFO-list>]   // Name, author, copyright info., comments
21167
    <lbdl-list>     // List of Band Lists
21171
    <lbdl-list>     // List of Band Lists
21168
)
21172
)
21169
 
21173
 
21170
    // <bnth-ck>
21174
    // <bnth-ck>
21171
    'bdth'
21175
    'bdth'
21172
    (
21176
    (
21173
        <DMUS_IO_BAND_TRACK_HEADER>
21177
        <DMUS_IO_BAND_TRACK_HEADER>
21174
    )
21178
    )
21175
 
21179
 
21176
    // <guid-ck>
21180
    // <guid-ck>
21177
    'guid'
21181
    'guid'
21178
    (
21182
    (
21179
        <GUID>
21183
        <GUID>
21180
    )
21184
    )
21181
 
21185
 
21182
    // <vers-ck>
21186
    // <vers-ck>
21183
    vers
21187
    vers
21184
    (
21188
    (
21185
        <DMUS_IO_VERSION>
21189
        <DMUS_IO_VERSION>
21186
    )
21190
    )
21187
 
21191
 
21188
    // <lbdl-list>
21192
    // <lbdl-list>
21189
    LIST
21193
    LIST
21190
    (
21194
    (
21191
        'lbdl'          // List of bands
21195
        'lbdl'          // List of bands
21192
        <lbnd-list>     // Each band is encapsulated in a list
21196
        <lbnd-list>     // Each band is encapsulated in a list
21193
    )
21197
    )
21194
 
21198
 
21195
        // <lbnd-list>
21199
        // <lbnd-list>
21196
        LIST
21200
        LIST
21197
        (
21201
        (
21198
            'lbnd'
21202
            'lbnd'
21199
            <bdih-ck>
21203
            <bdih-ck>
21200
            <DMBD-form> // Band
21204
            <DMBD-form> // Band
21201
        )
21205
        )
21202
 
21206
 
21203
            // <bdih-ck>            // band item header
21207
            // <bdih-ck>            // band item header
21204
            (
21208
            (
21205
                <DMUS_IO_BAND_ITEM_HEADER>  // Band item header
21209
                <DMUS_IO_BAND_ITEM_HEADER>  // Band item header
21206
            )
21210
            )
21207
*)      
21211
*)      
21208
 
21212
 
21209
 
21213
 
21210
(*  File io for DirectMusic Band object
21214
(*  File io for DirectMusic Band object
21211
*)
21215
*)
21212
 
21216
 
21213
(* RIFF ids: *)
21217
(* RIFF ids: *)
21214
const
21218
const
21215
  DMUS_FOURCC_BAND_FORM           : mmioFOURCC = ('D','M','B','D');
21219
  DMUS_FOURCC_BAND_FORM           : mmioFOURCC = ('D','M','B','D');
21216
  DMUS_FOURCC_INSTRUMENTS_LIST    : mmioFOURCC = ('l','b','i','l');
21220
  DMUS_FOURCC_INSTRUMENTS_LIST    : mmioFOURCC = ('l','b','i','l');
21217
  DMUS_FOURCC_INSTRUMENT_LIST     : mmioFOURCC = ('l','b','i','n');
21221
  DMUS_FOURCC_INSTRUMENT_LIST     : mmioFOURCC = ('l','b','i','n');
21218
  DMUS_FOURCC_INSTRUMENT_CHUNK    : mmioFOURCC = ('b','i','n','s');
21222
  DMUS_FOURCC_INSTRUMENT_CHUNK    : mmioFOURCC = ('b','i','n','s');
21219
 
21223
 
21220
(* Flags for DMUS_IO_INSTRUMENT
21224
(* Flags for DMUS_IO_INSTRUMENT
21221
 *)
21225
 *)
21222
  DMUS_IO_INST_PATCH          = (1 shl 0);        (* dwPatch is valid. *)
21226
  DMUS_IO_INST_PATCH          = (1 shl 0);        (* dwPatch is valid. *)
21223
  DMUS_IO_INST_BANKSELECT     = (1 shl 1);        (* dwPatch contains a valid Bank Select MSB and LSB part *)
21227
  DMUS_IO_INST_BANKSELECT     = (1 shl 1);        (* dwPatch contains a valid Bank Select MSB and LSB part *)
21224
  DMUS_IO_INST_ASSIGN_PATCH   = (1 shl 3);        (* dwAssignPatch is valid *)
21228
  DMUS_IO_INST_ASSIGN_PATCH   = (1 shl 3);        (* dwAssignPatch is valid *)
21225
  DMUS_IO_INST_NOTERANGES     = (1 shl 4);        (* dwNoteRanges is valid *)
21229
  DMUS_IO_INST_NOTERANGES     = (1 shl 4);        (* dwNoteRanges is valid *)
21226
  DMUS_IO_INST_PAN            = (1 shl 5);        (* bPan is valid *)
21230
  DMUS_IO_INST_PAN            = (1 shl 5);        (* bPan is valid *)
21227
  DMUS_IO_INST_VOLUME         = (1 shl 6);        (* bVolume is valid *)
21231
  DMUS_IO_INST_VOLUME         = (1 shl 6);        (* bVolume is valid *)
21228
  DMUS_IO_INST_TRANSPOSE      = (1 shl 7);        (* nTranspose is valid *)
21232
  DMUS_IO_INST_TRANSPOSE      = (1 shl 7);        (* nTranspose is valid *)
21229
  DMUS_IO_INST_GM             = (1 shl 8);        (* Instrument is from GM collection *)
21233
  DMUS_IO_INST_GM             = (1 shl 8);        (* Instrument is from GM collection *)
21230
  DMUS_IO_INST_GS             = (1 shl 9);        (* Instrument is from GS collection *)
21234
  DMUS_IO_INST_GS             = (1 shl 9);        (* Instrument is from GS collection *)
21231
  DMUS_IO_INST_XG             = (1 shl 10);       (* Instrument is from XG collection *)
21235
  DMUS_IO_INST_XG             = (1 shl 10);       (* Instrument is from XG collection *)
21232
  DMUS_IO_INST_CHANNEL_PRIORITY = (1 shl 11);     (* dwChannelPriority is valid *)
21236
  DMUS_IO_INST_CHANNEL_PRIORITY = (1 shl 11);     (* dwChannelPriority is valid *)
21233
  DMUS_IO_INST_USE_DEFAULT_GM_SET = (1 shl 12);   (* Always use the default GM set for this patch,  *)
21237
  DMUS_IO_INST_USE_DEFAULT_GM_SET = (1 shl 12);   (* Always use the default GM set for this patch,  *)
21234
                                                  (* don't rely on the synth caps stating GM or GS in hardware. *)
21238
                                                  (* don't rely on the synth caps stating GM or GS in hardware. *)
21235
type
21239
type
21236
(*  io structures *)
21240
(*  io structures *)
21237
  TDMus_IO_Instruments = packed record
21241
  TDMus_IO_Instruments = packed record
21238
    dwPatch:           DWORD;    (* MSB, LSB and Program change to define instrument *)
21242
    dwPatch:           DWORD;    (* MSB, LSB and Program change to define instrument *)
21239
    dwAssignPatch:     DWORD;    (* MSB, LSB and Program change to assign to instrument when downloading *)
21243
    dwAssignPatch:     DWORD;    (* MSB, LSB and Program change to assign to instrument when downloading *)
21240
    dwNoteRanges: array [0..3] of DWORD;(* 128 bits: one for each MIDI note instrument needs to able to play *)
21244
    dwNoteRanges: array [0..3] of DWORD;(* 128 bits: one for each MIDI note instrument needs to able to play *)
21241
    dwPChannel:        DWORD;    (* PChannel instrument plays on *)
21245
    dwPChannel:        DWORD;    (* PChannel instrument plays on *)
21242
    dwFlags:           DWORD;    (* DMUS_IO_INST_ flags *)
21246
    dwFlags:           DWORD;    (* DMUS_IO_INST_ flags *)
21243
    bPan:              BYTE;     (* Pan for instrument *)
21247
    bPan:              BYTE;     (* Pan for instrument *)
21244
    bVolume:           BYTE;     (* Volume for instrument *)
21248
    bVolume:           BYTE;     (* Volume for instrument *)
21245
    nTranspose:        SmallInt; (* Number of semitones to transpose notes *)
21249
    nTranspose:        SmallInt; (* Number of semitones to transpose notes *)
21246
    dwChannelPriority: DWORD;    (* Channel priority *)
21250
    dwChannelPriority: DWORD;    (* Channel priority *)
21247
  end;
21251
  end;
21248
 
21252
 
21249
(*
21253
(*
21250
// <DMBD-form> bands can be embedded in other forms
21254
// <DMBD-form> bands can be embedded in other forms
21251
RIFF
21255
RIFF
21252
(
21256
(
21253
    'DMBD'          // DirectMusic Band chunk
21257
    'DMBD'          // DirectMusic Band chunk
21254
    [<guid-ck>]     // GUID for band
21258
    [<guid-ck>]     // GUID for band
21255
    [<vers-ck>]     // Optional version info
21259
    [<vers-ck>]     // Optional version info
21256
    [<UNFO-list>]   // Name, author, copyright info., comments
21260
    [<UNFO-list>]   // Name, author, copyright info., comments
21257
    <lbil-list>     // List of Instruments
21261
    <lbil-list>     // List of Instruments
21258
)
21262
)
21259
 
21263
 
21260
    // <guid-ck>
21264
    // <guid-ck>
21261
    'guid'
21265
    'guid'
21262
    (
21266
    (
21263
        <GUID>
21267
        <GUID>
21264
    )
21268
    )
21265
 
21269
 
21266
    // <vers-ck>
21270
    // <vers-ck>
21267
    vers
21271
    vers
21268
    (
21272
    (
21269
        <DMUS_IO_VERSION>
21273
        <DMUS_IO_VERSION>
21270
    )
21274
    )
21271
 
21275
 
21272
    // <lbil-list>
21276
    // <lbil-list>
21273
    LIST
21277
    LIST
21274
    (
21278
    (
21275
        'lbil'          // List of instruments
21279
        'lbil'          // List of instruments
21276
        <lbin-list>     // Each instrument is encapsulated in a list
21280
        <lbin-list>     // Each instrument is encapsulated in a list
21277
    )
21281
    )
21278
 
21282
 
21279
        // <lbin-list>
21283
        // <lbin-list>
21280
        LIST
21284
        LIST
21281
        (
21285
        (
21282
            'lbin'
21286
            'lbin'
21283
            <bins-ck>
21287
            <bins-ck>
21284
            [<DMRF-list>]       // Optional reference to DLS Collection file.
21288
            [<DMRF-list>]       // Optional reference to DLS Collection file.
21285
        )
21289
        )
21286
 
21290
 
21287
            // <bins-ck>            // Instrument chunk
21291
            // <bins-ck>            // Instrument chunk
21288
            (
21292
            (
21289
                'bins'
21293
                'bins'
21290
                <DMUS_IO_INSTRUMENT>    // Instrument header
21294
                <DMUS_IO_INSTRUMENT>    // Instrument header
21291
            )
21295
            )
21292
*)
21296
*)
21293
 
21297
 
21294
(*  File io for DirectMusic Segment object *)
21298
(*  File io for DirectMusic Segment object *)
21295
 
21299
 
21296
(* RIFF ids: *)
21300
(* RIFF ids: *)
21297
const
21301
const
21298
  DMUS_FOURCC_SEGMENT_FORM    : mmioFOURCC = ('D','M','S','G');
21302
  DMUS_FOURCC_SEGMENT_FORM    : mmioFOURCC = ('D','M','S','G');
21299
  DMUS_FOURCC_SEGMENT_CHUNK   : mmioFOURCC = ('s','e','g','h');
21303
  DMUS_FOURCC_SEGMENT_CHUNK   : mmioFOURCC = ('s','e','g','h');
21300
  DMUS_FOURCC_TRACK_LIST      : mmioFOURCC = ('t','r','k','l');
21304
  DMUS_FOURCC_TRACK_LIST      : mmioFOURCC = ('t','r','k','l');
21301
  DMUS_FOURCC_TRACK_FORM      : mmioFOURCC = ('D','M','T','K');
21305
  DMUS_FOURCC_TRACK_FORM      : mmioFOURCC = ('D','M','T','K');
21302
  DMUS_FOURCC_TRACK_CHUNK     : mmioFOURCC = ('t','r','k','h');
21306
  DMUS_FOURCC_TRACK_CHUNK     : mmioFOURCC = ('t','r','k','h');
21303
 
21307
 
21304
(*  io structures:*)
21308
(*  io structures:*)
21305
type
21309
type
21306
  TDMus_IO_Segment_Header = packed record
21310
  TDMus_IO_Segment_Header = packed record
21307
    dwRepeats:    DWORD;         (* Number of repeats. By default, 0. *)
21311
    dwRepeats:    DWORD;         (* Number of repeats. By default, 0. *)
21308
    mtLength:     TMusic_Time;   (* Length, in music time. *)
21312
    mtLength:     TMusic_Time;   (* Length, in music time. *)
21309
    mtPlayStart:  TMusic_Time;   (* Start of playback. By default, 0. *)
21313
    mtPlayStart:  TMusic_Time;   (* Start of playback. By default, 0. *)
21310
    mtLoopStart:  TMusic_Time;   (* Start of looping portion. By default, 0. *)
21314
    mtLoopStart:  TMusic_Time;   (* Start of looping portion. By default, 0. *)
21311
    mtLoopEnd:    TMusic_Time;   (* End of loop. Must be greater than dwPlayStart. By default equal to length. *)
21315
    mtLoopEnd:    TMusic_Time;   (* End of loop. Must be greater than dwPlayStart. By default equal to length. *)
21312
    dwResolution: DWORD;         (* Default resolution. *)
21316
    dwResolution: DWORD;         (* Default resolution. *)
21313
  end;
21317
  end;
21314
 
21318
 
21315
  TDMus_IO_Track_Header = packed record
21319
  TDMus_IO_Track_Header = packed record
21316
    guidClassID: TGUID;          (* Class id of track. *)
21320
    guidClassID: TGUID;          (* Class id of track. *)
21317
    dwPosition:  DWORD;          (* Position in track list. *)
21321
    dwPosition:  DWORD;          (* Position in track list. *)
21318
    dwGroup:     DWORD;          (* Group bits for track. *)
21322
    dwGroup:     DWORD;          (* Group bits for track. *)
21319
    ckid:        TFourCC;        (* chunk ID of track's data chunk if 0 fccType valid. *)
21323
    ckid:        TFourCC;        (* chunk ID of track's data chunk if 0 fccType valid. *)
21320
    fccType:     TFourCC;        (* list type if NULL ckid valid *)
21324
    fccType:     TFourCC;        (* list type if NULL ckid valid *)
21321
  end;
21325
  end;
21322
 
21326
 
21323
(*
21327
(*
21324
RIFF
21328
RIFF
21325
(
21329
(
21326
    'DMSG'          // DirectMusic Segment chunk
21330
    'DMSG'          // DirectMusic Segment chunk
21327
    <segh-ck>       // Segment header chunk
21331
    <segh-ck>       // Segment header chunk
21328
    [<guid-ck>]     // GUID for segment
21332
    [<guid-ck>]     // GUID for segment
21329
    [<vers-ck>]     // Optional version info
21333
    [<vers-ck>]     // Optional version info
21330
    [<UNFO-list>]   // Name, author, copyright info., comments
21334
    [<UNFO-list>]   // Name, author, copyright info., comments
21331
    <trkl-list>     // List of Tracks
21335
    <trkl-list>     // List of Tracks
21332
    [<DMTG-form>]   // Optional ToolGraph
21336
    [<DMTG-form>]   // Optional ToolGraph
21333
)
21337
)
21334
 
21338
 
21335
    // <segh-ck>        
21339
    // <segh-ck>        
21336
    'segh'
21340
    'segh'
21337
    (
21341
    (
21338
        <DMUS_IO_SEGMENT_HEADER>
21342
        <DMUS_IO_SEGMENT_HEADER>
21339
    )
21343
    )
21340
   
21344
   
21341
    // <guid-ck>
21345
    // <guid-ck>
21342
    'guid'
21346
    'guid'
21343
    (
21347
    (
21344
        <GUID>
21348
        <GUID>
21345
    )
21349
    )
21346
 
21350
 
21347
    // <vers-ck>
21351
    // <vers-ck>
21348
    vers
21352
    vers
21349
    (
21353
    (
21350
        <DMUS_IO_VERSION>
21354
        <DMUS_IO_VERSION>
21351
    )
21355
    )
21352
 
21356
 
21353
    // <trkl-list>
21357
    // <trkl-list>
21354
    LIST
21358
    LIST
21355
    (
21359
    (
21356
        'trkl'          // List of tracks
21360
        'trkl'          // List of tracks
21357
        <DMTK-form>...  // Each track is encapsulated in a RIFF chunk
21361
        <DMTK-form>...  // Each track is encapsulated in a RIFF chunk
21358
    )
21362
    )
21359
 
21363
 
21360
// <DMTK-form>      // Tracks can be embedded in a segment or stored as separate files.
21364
// <DMTK-form>      // Tracks can be embedded in a segment or stored as separate files.
21361
RIFF
21365
RIFF
21362
(
21366
(
21363
    'DMTK'
21367
    'DMTK'
21364
    <trkh-ck>
21368
    <trkh-ck>
21365
    [<guid-ck>]     // Optional GUID for track object instance (not to be confused with Class id in track header)
21369
    [<guid-ck>]     // Optional GUID for track object instance (not to be confused with Class id in track header)
21366
    [<vers-ck>]     // Optional version info
21370
    [<vers-ck>]     // Optional version info
21367
    [<UNFO-list>]   // Optional name, author, copyright info., comments
21371
    [<UNFO-list>]   // Optional name, author, copyright info., comments
21368
    [<data>]        // Track data. Must be a RIFF readable chunk.
21372
    [<data>]        // Track data. Must be a RIFF readable chunk.
21369
)
21373
)
21370
 
21374
 
21371
    // <trkh-ck>            // Track header chunk
21375
    // <trkh-ck>            // Track header chunk
21372
    (
21376
    (
21373
        'trkh'
21377
        'trkh'
21374
        <DMUS_IO_TRACK_HEADER>  // Track header
21378
        <DMUS_IO_TRACK_HEADER>  // Track header
21375
    )
21379
    )
21376
*)
21380
*)
21377
 
21381
 
21378
(*  File io for DirectMusic reference chunk.
21382
(*  File io for DirectMusic reference chunk.
21379
    This is used to embed a reference to an object.
21383
    This is used to embed a reference to an object.
21380
*)
21384
*)
21381
 
21385
 
21382
(*  RIFF ids: *)
21386
(*  RIFF ids: *)
21383
const
21387
const
21384
  DMUS_FOURCC_REF_LIST        : mmioFOURCC = ('D','M','R','F');
21388
  DMUS_FOURCC_REF_LIST        : mmioFOURCC = ('D','M','R','F');
21385
  DMUS_FOURCC_REF_CHUNK       : mmioFOURCC = ('r','e','f','h');
21389
  DMUS_FOURCC_REF_CHUNK       : mmioFOURCC = ('r','e','f','h');
21386
  DMUS_FOURCC_DATE_CHUNK      : mmioFOURCC = ('d','a','t','e');
21390
  DMUS_FOURCC_DATE_CHUNK      : mmioFOURCC = ('d','a','t','e');
21387
  DMUS_FOURCC_NAME_CHUNK      : mmioFOURCC = ('n','a','m','e');
21391
  DMUS_FOURCC_NAME_CHUNK      : mmioFOURCC = ('n','a','m','e');
21388
  DMUS_FOURCC_FILE_CHUNK      : mmioFOURCC = ('f','i','l','e');
21392
  DMUS_FOURCC_FILE_CHUNK      : mmioFOURCC = ('f','i','l','e');
21389
 
21393
 
21390
type
21394
type
21391
  TDMus_IO_Reference = packed record
21395
  TDMus_IO_Reference = packed record
21392
    guidClassID: TGUID;      (* Class id is always required. *)
21396
    guidClassID: TGUID;      (* Class id is always required. *)
21393
    dwValidData: DWORD;      (* Flags. *)
21397
    dwValidData: DWORD;      (* Flags. *)
21394
  end;
21398
  end;
21395
 
21399
 
21396
(*
21400
(*
21397
LIST
21401
LIST
21398
(
21402
(
21399
    'DMRF'          // DirectMusic Reference chunk
21403
    'DMRF'          // DirectMusic Reference chunk
21400
    <refh-ck>       // Reference header chunk
21404
    <refh-ck>       // Reference header chunk
21401
    [<guid-ck>]     // Optional object GUID.
21405
    [<guid-ck>]     // Optional object GUID.
21402
    [<date-ck>]     // Optional file date.
21406
    [<date-ck>]     // Optional file date.
21403
    [<name-ck>]     // Optional name.
21407
    [<name-ck>]     // Optional name.
21404
    [<file-ck>]     // Optional file name.
21408
    [<file-ck>]     // Optional file name.
21405
    [<catg-ck>]     // Optional category name.
21409
    [<catg-ck>]     // Optional category name.
21406
    [<vers-ck>]     // Optional version info.
21410
    [<vers-ck>]     // Optional version info.
21407
)
21411
)
21408
 
21412
 
21409
    // <refh-ck>
21413
    // <refh-ck>
21410
    'refh'
21414
    'refh'
21411
    (
21415
    (
21412
        <DMUS_IO_REFERENCE>
21416
        <DMUS_IO_REFERENCE>
21413
    )
21417
    )
21414
 
21418
 
21415
    // <guid-ck>
21419
    // <guid-ck>
21416
    'guid'
21420
    'guid'
21417
    (
21421
    (
21418
        <GUID>
21422
        <GUID>
21419
    )
21423
    )
21420
 
21424
 
21421
    // <date-ck>
21425
    // <date-ck>
21422
    date
21426
    date
21423
    (
21427
    (
21424
        <FILETIME>
21428
        <FILETIME>
21425
    )
21429
    )
21426
 
21430
 
21427
    // <name-ck>
21431
    // <name-ck>
21428
    name
21432
    name
21429
    (
21433
    (
21430
        // Name, stored as NULL terminated string of WCHARs
21434
        // Name, stored as NULL terminated string of WCHARs
21431
    )
21435
    )
21432
 
21436
 
21433
    // <file-ck>
21437
    // <file-ck>
21434
    file
21438
    file
21435
    (
21439
    (
21436
        // File name, stored as NULL terminated string of WCHARs
21440
        // File name, stored as NULL terminated string of WCHARs
21437
    )
21441
    )
21438
 
21442
 
21439
    // <catg-ck>
21443
    // <catg-ck>
21440
    catg
21444
    catg
21441
    (
21445
    (
21442
        // Category name, stored as NULL terminated string of WCHARs
21446
        // Category name, stored as NULL terminated string of WCHARs
21443
    )
21447
    )
21444
 
21448
 
21445
    // <vers-ck>
21449
    // <vers-ck>
21446
    vers
21450
    vers
21447
    (
21451
    (
21448
        <DMUS_IO_VERSION>
21452
        <DMUS_IO_VERSION>
21449
    )
21453
    )
21450
*)
21454
*)
21451
 
21455
 
21452
(* Chord Maps *)
21456
(* Chord Maps *)
21453
const
21457
const
21454
(* runtime chunks *)
21458
(* runtime chunks *)
21455
  DMUS_FOURCC_CHORDMAP_FORM       : mmioFOURCC = ('D','M','P','R');
21459
  DMUS_FOURCC_CHORDMAP_FORM       : mmioFOURCC = ('D','M','P','R');
21456
  DMUS_FOURCC_IOCHORDMAP_CHUNK    : mmioFOURCC = ('p','e','r','h');
21460
  DMUS_FOURCC_IOCHORDMAP_CHUNK    : mmioFOURCC = ('p','e','r','h');
21457
  DMUS_FOURCC_SUBCHORD_CHUNK      : mmioFOURCC = ('c','h','d','t');
21461
  DMUS_FOURCC_SUBCHORD_CHUNK      : mmioFOURCC = ('c','h','d','t');
21458
  DMUS_FOURCC_CHORDENTRY_CHUNK    : mmioFOURCC = ('c','h','e','h');
21462
  DMUS_FOURCC_CHORDENTRY_CHUNK    : mmioFOURCC = ('c','h','e','h');
21459
  DMUS_FOURCC_SUBCHORDID_CHUNK    : mmioFOURCC = ('s','b','c','n');
21463
  DMUS_FOURCC_SUBCHORDID_CHUNK    : mmioFOURCC = ('s','b','c','n');
21460
  DMUS_FOURCC_IONEXTCHORD_CHUNK   : mmioFOURCC = ('n','c','r','d');
21464
  DMUS_FOURCC_IONEXTCHORD_CHUNK   : mmioFOURCC = ('n','c','r','d');
21461
  DMUS_FOURCC_NEXTCHORDSEQ_CHUNK  : mmioFOURCC = ('n','c','s','q');
21465
  DMUS_FOURCC_NEXTCHORDSEQ_CHUNK  : mmioFOURCC = ('n','c','s','q');
21462
  DMUS_FOURCC_IOSIGNPOST_CHUNK    : mmioFOURCC = ('s','p','s','h');
21466
  DMUS_FOURCC_IOSIGNPOST_CHUNK    : mmioFOURCC = ('s','p','s','h');
21463
  DMUS_FOURCC_CHORDNAME_CHUNK     : mmioFOURCC = ('I','N','A','M');
21467
  DMUS_FOURCC_CHORDNAME_CHUNK     : mmioFOURCC = ('I','N','A','M');
21464
 
21468
 
21465
(* runtime list chunks *)
21469
(* runtime list chunks *)
21466
  DMUS_FOURCC_CHORDENTRY_LIST     : mmioFOURCC = ('c','h','o','e');
21470
  DMUS_FOURCC_CHORDENTRY_LIST     : mmioFOURCC = ('c','h','o','e');
21467
  DMUS_FOURCC_CHORDMAP_LIST       : mmioFOURCC = ('c','m','a','p');
21471
  DMUS_FOURCC_CHORDMAP_LIST       : mmioFOURCC = ('c','m','a','p');
21468
  DMUS_FOURCC_CHORD_LIST          : mmioFOURCC = ('c','h','r','d');
21472
  DMUS_FOURCC_CHORD_LIST          : mmioFOURCC = ('c','h','r','d');
21469
  DMUS_FOURCC_CHORDPALETTE_LIST   : mmioFOURCC = ('c','h','p','l');
21473
  DMUS_FOURCC_CHORDPALETTE_LIST   : mmioFOURCC = ('c','h','p','l');
21470
  DMUS_FOURCC_CADENCE_LIST        : mmioFOURCC = ('c','a','d','e');
21474
  DMUS_FOURCC_CADENCE_LIST        : mmioFOURCC = ('c','a','d','e');
21471
  DMUS_FOURCC_SIGNPOSTITEM_LIST   : mmioFOURCC = ('s','p','s','t');
21475
  DMUS_FOURCC_SIGNPOSTITEM_LIST   : mmioFOURCC = ('s','p','s','t');
21472
 
21476
 
21473
  DMUS_FOURCC_SIGNPOST_LIST       : mmioFOURCC = ('s','p','s','q');
21477
  DMUS_FOURCC_SIGNPOST_LIST       : mmioFOURCC = ('s','p','s','q');
21474
 
21478
 
21475
(* values for dwChord field of DMUS_IO_PERS_SIGNPOST *)
21479
(* values for dwChord field of DMUS_IO_PERS_SIGNPOST *)
21476
(* DMUS_SIGNPOSTF_ flags are also used in templates (DMUS_IO_SIGNPOST) *)
21480
(* DMUS_SIGNPOSTF_ flags are also used in templates (DMUS_IO_SIGNPOST) *)
21477
  DMUS_SIGNPOSTF_A       = 1;
21481
  DMUS_SIGNPOSTF_A       = 1;
21478
  DMUS_SIGNPOSTF_B       = 2;
21482
  DMUS_SIGNPOSTF_B       = 2;
21479
  DMUS_SIGNPOSTF_C       = 4;
21483
  DMUS_SIGNPOSTF_C       = 4;
21480
  DMUS_SIGNPOSTF_D       = 8;
21484
  DMUS_SIGNPOSTF_D       = 8;
21481
  DMUS_SIGNPOSTF_E       = $10;
21485
  DMUS_SIGNPOSTF_E       = $10;
21482
  DMUS_SIGNPOSTF_F       = $20;
21486
  DMUS_SIGNPOSTF_F       = $20;
21483
  DMUS_SIGNPOSTF_LETTER  = (DMUS_SIGNPOSTF_A or DMUS_SIGNPOSTF_B or DMUS_SIGNPOSTF_C or DMUS_SIGNPOSTF_D or DMUS_SIGNPOSTF_E or DMUS_SIGNPOSTF_F);
21487
  DMUS_SIGNPOSTF_LETTER  = (DMUS_SIGNPOSTF_A or DMUS_SIGNPOSTF_B or DMUS_SIGNPOSTF_C or DMUS_SIGNPOSTF_D or DMUS_SIGNPOSTF_E or DMUS_SIGNPOSTF_F);
21484
  DMUS_SIGNPOSTF_1       = $100;
21488
  DMUS_SIGNPOSTF_1       = $100;
21485
  DMUS_SIGNPOSTF_2       = $200;
21489
  DMUS_SIGNPOSTF_2       = $200;
21486
  DMUS_SIGNPOSTF_3       = $400;
21490
  DMUS_SIGNPOSTF_3       = $400;
21487
  DMUS_SIGNPOSTF_4       = $800;
21491
  DMUS_SIGNPOSTF_4       = $800;
21488
  DMUS_SIGNPOSTF_5       = $1000;
21492
  DMUS_SIGNPOSTF_5       = $1000;
21489
  DMUS_SIGNPOSTF_6       = $2000;
21493
  DMUS_SIGNPOSTF_6       = $2000;
21490
  DMUS_SIGNPOSTF_7       = $4000;
21494
  DMUS_SIGNPOSTF_7       = $4000;
21491
  DMUS_SIGNPOSTF_ROOT    = (DMUS_SIGNPOSTF_1 or DMUS_SIGNPOSTF_2 or DMUS_SIGNPOSTF_3 or DMUS_SIGNPOSTF_4 or DMUS_SIGNPOSTF_5 or DMUS_SIGNPOSTF_6 or DMUS_SIGNPOSTF_7);
21495
  DMUS_SIGNPOSTF_ROOT    = (DMUS_SIGNPOSTF_1 or DMUS_SIGNPOSTF_2 or DMUS_SIGNPOSTF_3 or DMUS_SIGNPOSTF_4 or DMUS_SIGNPOSTF_5 or DMUS_SIGNPOSTF_6 or DMUS_SIGNPOSTF_7);
21492
  DMUS_SIGNPOSTF_CADENCE = $8000;
21496
  DMUS_SIGNPOSTF_CADENCE = $8000;
21493
 
21497
 
21494
(* values for dwChord field of DMUS_IO_PERS_SIGNPOST *)
21498
(* values for dwChord field of DMUS_IO_PERS_SIGNPOST *)
21495
  DMUS_SPOSTCADENCEF_1 = 2;   (* Use the first cadence chord. *)
21499
  DMUS_SPOSTCADENCEF_1 = 2;   (* Use the first cadence chord. *)
21496
  DMUS_SPOSTCADENCEF_2 = 4;   (* Use the second cadence chord. *)
21500
  DMUS_SPOSTCADENCEF_2 = 4;   (* Use the second cadence chord. *)
21497
 
21501
 
21498
type
21502
type
21499
(* run time data structs *)
21503
(* run time data structs *)
21500
  TDMus_IO_ChordMap = packed record
21504
  TDMus_IO_ChordMap = packed record
21501
    wszLoadName: array [0..19] of WCHAR;
21505
    wszLoadName: array [0..19] of WCHAR;
21502
    dwScalePattern: DWORD;
21506
    dwScalePattern: DWORD;
21503
    dwFlags:        DWORD;
21507
    dwFlags:        DWORD;
21504
  end;
21508
  end;
21505
 
21509
 
21506
  TDMus_IO_ChordMap_SubChord = packed record
21510
  TDMus_IO_ChordMap_SubChord = packed record
21507
    dwChordPattern:  DWORD;
21511
    dwChordPattern:  DWORD;
21508
    dwScalePattern:  DWORD;
21512
    dwScalePattern:  DWORD;
21509
    dwInvertPattern: DWORD;
21513
    dwInvertPattern: DWORD;
21510
    bChordRoot:      BYTE;
21514
    bChordRoot:      BYTE;
21511
    bScaleRoot:      BYTE;
21515
    bScaleRoot:      BYTE;
21512
    wCFlags:         WORD;
21516
    wCFlags:         WORD;
21513
    dwLevels:        DWORD;    (* parts or which subchord levels this chord supports *)
21517
    dwLevels:        DWORD;    (* parts or which subchord levels this chord supports *)
21514
  end;
21518
  end;
21515
 
21519
 
21516
(* Legacy name... *)
21520
(* Legacy name... *)
21517
  TDMus_IO_Pers_SubChord = TDMus_IO_ChordMap_SubChord;
21521
  TDMus_IO_Pers_SubChord = TDMus_IO_ChordMap_SubChord;
21518
 
21522
 
21519
  TDMus_IO_ChordEntry = packed record
21523
  TDMus_IO_ChordEntry = packed record
21520
    dwFlags:       DWORD;
21524
    dwFlags:       DWORD;
21521
    wConnectionID: WORD;     (* replaces runtime "pointer to this" *)
21525
    wConnectionID: WORD;     (* replaces runtime "pointer to this" *)
21522
  end;
21526
  end;
21523
 
21527
 
21524
  TDMus_IO_NextChord = packed record
21528
  TDMus_IO_NextChord = packed record
21525
    dwFlags:       DWORD;
21529
    dwFlags:       DWORD;
21526
    nWeight:       WORD;
21530
    nWeight:       WORD;
21527
    wMinBeats:     WORD;
21531
    wMinBeats:     WORD;
21528
    wMaxBeats:     WORD;
21532
    wMaxBeats:     WORD;
21529
    wConnectionID: WORD;     (* points to an ioChordEntry *)
21533
    wConnectionID: WORD;     (* points to an ioChordEntry *)
21530
  end;
21534
  end;
21531
 
21535
 
21532
  TDMus_IO_ChordMap_SignPost = packed record
21536
  TDMus_IO_ChordMap_SignPost = packed record
21533
    dwChords: DWORD;     (* 1bit per group *)
21537
    dwChords: DWORD;     (* 1bit per group *)
21534
    dwFlags:  DWORD;
21538
    dwFlags:  DWORD;
21535
  end;
21539
  end;
21536
 
21540
 
21537
(* Legacy name... *)
21541
(* Legacy name... *)
21538
  TDMus_IO_Pers_SignPost = TDMus_IO_ChordMap_SignPost;
21542
  TDMus_IO_Pers_SignPost = TDMus_IO_ChordMap_SignPost;
21539
 
21543
 
21540
(*
21544
(*
21541
RIFF
21545
RIFF
21542
(
21546
(
21543
    'DMPR'
21547
    'DMPR'
21544
    <perh-ck>           // Chord map header chunk
21548
    <perh-ck>           // Chord map header chunk
21545
    [<guid-ck>]         // guid chunk
21549
    [<guid-ck>]         // guid chunk
21546
    [<vers-ck>]         // version chunk (two DWORDS)
21550
    [<vers-ck>]         // version chunk (two DWORDS)
21547
    [<UNFO-list>]       // Unfo chunk
21551
    [<UNFO-list>]       // Unfo chunk
21548
    <chdt-ck>           // subchord database
21552
    <chdt-ck>           // subchord database
21549
    <chpl-list>         // chord palette
21553
    <chpl-list>         // chord palette
21550
    <cmap-list>         // chord map
21554
    <cmap-list>         // chord map
21551
    <spsq-list>         // signpost list
21555
    <spsq-list>         // signpost list
21552
 )
21556
 )
21553
 
21557
 
21554
<cmap-list> ::= LIST('cmap' <choe-list> )
21558
<cmap-list> ::= LIST('cmap' <choe-list> )
21555
 
21559
 
21556
<choe-list> ::= LIST('choe'
21560
<choe-list> ::= LIST('choe'
21557
                                <cheh-ck>   // chord entry data
21561
                                <cheh-ck>   // chord entry data
21558
                                <chrd-list> // chord definition
21562
                                <chrd-list> // chord definition
21559
                                <ncsq-ck>   // connecting(next) chords
21563
                                <ncsq-ck>   // connecting(next) chords
21560
                     )
21564
                     )
21561
 
21565
 
21562
<chrd-list> ::= LIST('chrd'
21566
<chrd-list> ::= LIST('chrd'
21563
                                <INAM-ck>   // name of chord in wide char format
21567
                                <INAM-ck>   // name of chord in wide char format
21564
                                <sbcn-ck>   // list of subchords composing chord
21568
                                <sbcn-ck>   // list of subchords composing chord
21565
                    )
21569
                    )
21566
 
21570
 
21567
<chpl-list> ::= LIST('chpl'
21571
<chpl-list> ::= LIST('chpl'
21568
                                <chrd-list> ... // chord definition
21572
                                <chrd-list> ... // chord definition
21569
                    )
21573
                    )
21570
 
21574
 
21571
<spsq-list> ::== LIST('spsq' <spst-list> ... )
21575
<spsq-list> ::== LIST('spsq' <spst-list> ... )
21572
 
21576
 
21573
<spst-list> ::= LIST('spst'
21577
<spst-list> ::= LIST('spst'
21574
                             <spsh-ck>
21578
                             <spsh-ck>
21575
                             <chrd-list>
21579
                             <chrd-list>
21576
                             [<cade-list>]
21580
                             [<cade-list>]
21577
                    )
21581
                    )
21578
 
21582
 
21579
<cade-list> ::= LIST('cade' <chrd-list> ...)
21583
<cade-list> ::= LIST('cade' <chrd-list> ...)
21580
 
21584
 
21581
<perh-ck> ::= perh(<DMUS_IO_CHORDMAP>)
21585
<perh-ck> ::= perh(<DMUS_IO_CHORDMAP>)
21582
 
21586
 
21583
<chdt-ck> ::= chdt(<cbChordSize::WORD>
21587
<chdt-ck> ::= chdt(<cbChordSize::WORD>
21584
                   <DMUS_IO_PERS_SUBCHORD> ... )
21588
                   <DMUS_IO_PERS_SUBCHORD> ... )
21585
 
21589
 
21586
<cheh-ck> ::= cheh(<DMUS_IO_CHORDENTRY>)
21590
<cheh-ck> ::= cheh(<DMUS_IO_CHORDENTRY>)
21587
 
21591
 
21588
<sbcn-ck> ::= sbcn(<cSubChordID:WORD> ...)
21592
<sbcn-ck> ::= sbcn(<cSubChordID:WORD> ...)
21589
 
21593
 
21590
<ncsq-ck> ::= ncsq(<wNextChordSize:WORD>
21594
<ncsq-ck> ::= ncsq(<wNextChordSize:WORD>
21591
                   <DMUS_IO_NEXTCHORD>...)
21595
                   <DMUS_IO_NEXTCHORD>...)
21592
 
21596
 
21593
<spsh-ck> ::= spsh(<DMUS_IO_PERS_SIGNPOST>)
21597
<spsh-ck> ::= spsh(<DMUS_IO_PERS_SIGNPOST>)
21594
 
21598
 
21595
*)
21599
*)
21596
 
21600
 
21597
(* Signpost tracks *)
21601
(* Signpost tracks *)
21598
const
21602
const
21599
  DMUS_FOURCC_SIGNPOST_TRACK_CHUNK    : mmioFOURCC = ( 's', 'g', 'n', 'p' );
21603
  DMUS_FOURCC_SIGNPOST_TRACK_CHUNK    : mmioFOURCC = ( 's', 'g', 'n', 'p' );
21600
 
21604
 
21601
type
21605
type
21602
  TDMus_IO_SignPost = packed record
21606
  TDMus_IO_SignPost = packed record
21603
    mtTime:   TMusic_Time;
21607
    mtTime:   TMusic_Time;
21604
    dwChords: DWORD;
21608
    dwChords: DWORD;
21605
    wMeasure: WORD;
21609
    wMeasure: WORD;
21606
  end;
21610
  end;
21607
 
21611
 
21608
(*
21612
(*
21609
 
21613
 
21610
    // <sgnp-list>
21614
    // <sgnp-list>
21611
    'sgnp'
21615
    'sgnp'
21612
    (
21616
    (
21613
        //sizeof DMUS_IO_SIGNPOST: DWORD
21617
        //sizeof DMUS_IO_SIGNPOST: DWORD
21614
        <DMUS_IO_SIGNPOST>...
21618
        <DMUS_IO_SIGNPOST>...
21615
    )
21619
    )
21616
 
21620
 
21617
*)
21621
*)
21618
 
21622
 
21619
const
21623
const
21620
  DMUS_FOURCC_MUTE_CHUNK  : mmioFOURCC = ('m','u','t','e');
21624
  DMUS_FOURCC_MUTE_CHUNK  : mmioFOURCC = ('m','u','t','e');
21621
 
21625
 
21622
type
21626
type
21623
  TDMus_IO_Mute = packed record
21627
  TDMus_IO_Mute = packed record
21624
    mtTime: TMusic_Time;
21628
    mtTime: TMusic_Time;
21625
    dwPChannel:    DWORD;
21629
    dwPChannel:    DWORD;
21626
    dwPChannelMap: DWORD;
21630
    dwPChannelMap: DWORD;
21627
  end;
21631
  end;
21628
 
21632
 
21629
(*
21633
(*
21630
 
21634
 
21631
    // <mute-list>
21635
    // <mute-list>
21632
    'mute'
21636
    'mute'
21633
    (
21637
    (
21634
        //sizeof DMUS_IO_MUTE:DWORD
21638
        //sizeof DMUS_IO_MUTE:DWORD
21635
        <DMUS_IO_MUTE>...
21639
        <DMUS_IO_MUTE>...
21636
    )
21640
    )
21637
 
21641
 
21638
 
21642
 
21639
*)
21643
*)
21640
 
21644
 
21641
const
21645
const
21642
(* Used for both style and chord map tracks *)
21646
(* Used for both style and chord map tracks *)
21643
 
21647
 
21644
  DMUS_FOURCC_TIME_STAMP_CHUNK   : mmioFOURCC = ('s', 't', 'm', 'p');
21648
  DMUS_FOURCC_TIME_STAMP_CHUNK   : mmioFOURCC = ('s', 't', 'm', 'p');
21645
 
21649
 
21646
(* Style tracks *)
21650
(* Style tracks *)
21647
 
21651
 
21648
  DMUS_FOURCC_STYLE_TRACK_LIST   : mmioFOURCC = ('s', 't', 't', 'r');
21652
  DMUS_FOURCC_STYLE_TRACK_LIST   : mmioFOURCC = ('s', 't', 't', 'r');
21649
  DMUS_FOURCC_STYLE_REF_LIST     : mmioFOURCC = ('s', 't', 'r', 'f');
21653
  DMUS_FOURCC_STYLE_REF_LIST     : mmioFOURCC = ('s', 't', 'r', 'f');
21650
 
21654
 
21651
(*
21655
(*
21652
 
21656
 
21653
    // <sttr-list>
21657
    // <sttr-list>
21654
    LIST('sttr'
21658
    LIST('sttr'
21655
    (
21659
    (
21656
        // some number of <strf-list>
21660
        // some number of <strf-list>
21657
    )
21661
    )
21658
 
21662
 
21659
    // <strf-list>
21663
    // <strf-list>
21660
    LIST('strf'
21664
    LIST('strf'
21661
    (
21665
    (
21662
        <stmp-ck>
21666
        <stmp-ck>
21663
        <DMRF>
21667
        <DMRF>
21664
    )
21668
    )
21665
 
21669
 
21666
    // <stmp-ck> defined in ..\dmcompos\dmcompp.h
21670
    // <stmp-ck> defined in ..\dmcompos\dmcompp.h
21667
 
21671
 
21668
*)
21672
*)
21669
 
21673
 
21670
(* Chord map tracks *)
21674
(* Chord map tracks *)
21671
 
21675
 
21672
  DMUS_FOURCC_PERS_TRACK_LIST : mmioFOURCC = ('p', 'f', 't', 'r');
21676
  DMUS_FOURCC_PERS_TRACK_LIST : mmioFOURCC = ('p', 'f', 't', 'r');
21673
  DMUS_FOURCC_PERS_REF_LIST   : mmioFOURCC = ('p', 'f', 'r', 'f');
21677
  DMUS_FOURCC_PERS_REF_LIST   : mmioFOURCC = ('p', 'f', 'r', 'f');
21674
 
21678
 
21675
(*
21679
(*
21676
 
21680
 
21677
    // <pftr-list>
21681
    // <pftr-list>
21678
    LIST('pftr'
21682
    LIST('pftr'
21679
    (
21683
    (
21680
        // some number of <pfrf-list>
21684
        // some number of <pfrf-list>
21681
    )
21685
    )
21682
 
21686
 
21683
    // <pfrf-list>
21687
    // <pfrf-list>
21684
    LIST('pfrf'
21688
    LIST('pfrf'
21685
    (
21689
    (
21686
        <stmp-ck>
21690
        <stmp-ck>
21687
        <DMRF>
21691
        <DMRF>
21688
    )
21692
    )
21689
 
21693
 
21690
  // <stmp-ck>
21694
  // <stmp-ck>
21691
  'stmp'
21695
  'stmp'
21692
  (
21696
  (
21693
    // time:DWORD
21697
    // time:DWORD
21694
  )
21698
  )
21695
 
21699
 
21696
 
21700
 
21697
 
21701
 
21698
*)
21702
*)
21699
 
21703
 
21700
  DMUS_FOURCC_TEMPO_TRACK    : mmioFOURCC = ('t','e','t','r');
21704
  DMUS_FOURCC_TEMPO_TRACK    : mmioFOURCC = ('t','e','t','r');
21701
 
21705
 
21702
(*
21706
(*
21703
    // tempo list
21707
    // tempo list
21704
    'tetr'
21708
    'tetr'
21705
    (
21709
    (
21706
        // sizeof DMUS_IO_TEMPO_ITEM: DWORD
21710
        // sizeof DMUS_IO_TEMPO_ITEM: DWORD
21707
        <DMUS_IO_TEMPO_ITEM>...
21711
        <DMUS_IO_TEMPO_ITEM>...
21708
    )
21712
    )
21709
  *)
21713
  *)
21710
 
21714
 
21711
  DMUS_FOURCC_SEQ_TRACK      : mmioFOURCC = ('s','e','q','t');
21715
  DMUS_FOURCC_SEQ_TRACK      : mmioFOURCC = ('s','e','q','t');
21712
  DMUS_FOURCC_SEQ_LIST       : mmioFOURCC = ('e','v','t','l');
21716
  DMUS_FOURCC_SEQ_LIST       : mmioFOURCC = ('e','v','t','l');
21713
  DMUS_FOURCC_CURVE_LIST     : mmioFOURCC = ('c','u','r','l');
21717
  DMUS_FOURCC_CURVE_LIST     : mmioFOURCC = ('c','u','r','l');
21714
 
21718
 
21715
(*
21719
(*
21716
    // sequence track
21720
    // sequence track
21717
    'seqt'
21721
    'seqt'
21718
    (
21722
    (
21719
        // sequence list
21723
        // sequence list
21720
        'evtl'
21724
        'evtl'
21721
        (
21725
        (
21722
            // sizeof DMUS_IO_SEQ_ITEM: DWORD
21726
            // sizeof DMUS_IO_SEQ_ITEM: DWORD
21723
            <DMUS_IO_SEQ_ITEM>...
21727
            <DMUS_IO_SEQ_ITEM>...
21724
        )
21728
        )
21725
        // curve list
21729
        // curve list
21726
        'curl'
21730
        'curl'
21727
        (
21731
        (
21728
            // sizeof DMUS_IO_CURVE_ITEM: DWORD
21732
            // sizeof DMUS_IO_CURVE_ITEM: DWORD
21729
            <DMUS_IO_CURVE_ITEM>...
21733
            <DMUS_IO_CURVE_ITEM>...
21730
        )
21734
        )
21731
    )
21735
    )
21732
*)
21736
*)
21733
 
21737
 
21734
  DMUS_FOURCC_SYSEX_TRACK    : mmioFOURCC = ('s','y','e','x');
21738
  DMUS_FOURCC_SYSEX_TRACK    : mmioFOURCC = ('s','y','e','x');
21735
 
21739
 
21736
(*
21740
(*
21737
    // sysex track
21741
    // sysex track
21738
    'syex'
21742
    'syex'
21739
    (
21743
    (
21740
        // list of:
21744
        // list of:
21741
        // {
21745
        // {
21742
        //      <DMUS_IO_SYSEX_ITEM>
21746
        //      <DMUS_IO_SYSEX_ITEM>
21743
        //      sys-ex: data
21747
        //      sys-ex: data
21744
        // }...
21748
        // }...
21745
    )
21749
    )
21746
*)
21750
*)
21747
 
21751
 
21748
  DMUS_FOURCC_TIMESIGNATURE_TRACK : mmioFOURCC = ('t','i','m','s');
21752
  DMUS_FOURCC_TIMESIGNATURE_TRACK : mmioFOURCC = ('t','i','m','s');
21749
 
21753
 
21750
(*
21754
(*
21751
    // time signature track
21755
    // time signature track
21752
    'tims'
21756
    'tims'
21753
    (
21757
    (
21754
        // size of DMUS_IO_TIMESIGNATURE_ITEM : DWORD
21758
        // size of DMUS_IO_TIMESIGNATURE_ITEM : DWORD
21755
        <DMUS_IO_TIMESIGNATURE_ITEM>...
21759
        <DMUS_IO_TIMESIGNATURE_ITEM>...
21756
    )
21760
    )
21757
*)
21761
*)
21758
 
21762
 
21759
(***************************************************************************
21763
(***************************************************************************
21760
*                                                                          *
21764
*                                                                          *
21761
*   DMusBuff.h -- This module defines the buffer format for DirectMusic    *
21765
*   DMusBuff.h -- This module defines the buffer format for DirectMusic    *
21762
*                 Shared file between user mode and kernel mode components *
21766
*                 Shared file between user mode and kernel mode components *
21763
*                                                                          *
21767
*                                                                          *
21764
*   Copyright (c) 1998, Microsoft Corp. All rights reserved.               *
21768
*   Copyright (c) 1998, Microsoft Corp. All rights reserved.               *
21765
*                                                                          *
21769
*                                                                          *
21766
***************************************************************************)
21770
***************************************************************************)
21767
 
21771
 
21768
(* The number of bytes to allocate for an event with 'cb' data bytes.
21772
(* The number of bytes to allocate for an event with 'cb' data bytes.
21769
 *)
21773
 *)
21770
function QWORD_ALIGN(x: DWORD) : DWORD;
21774
function QWORD_ALIGN(x: DWORD) : DWORD;
21771
 
21775
 
21772
function DMUS_EVENT_SIZE(cb: DWORD) : DWORD;
21776
function DMUS_EVENT_SIZE(cb: DWORD) : DWORD;
21773
 
21777
 
21774
 
21778
 
21775
 
21779
 
21776
Implementation
21780
Implementation
21777
 
21781
 
21778
//DirectDraw file
21782
//DirectDraw file
21779
 
21783
 
21780
 
21784
 
21781
{
21785
{
21782
#define GET_WHQL_YEAR( dwWHQLLevel ) \
21786
#define GET_WHQL_YEAR( dwWHQLLevel ) \
21783
    ( (dwWHQLLevel) / 0x10000 )
21787
    ( (dwWHQLLevel) / 0x10000 )
21784
#define GET_WHQL_MONTH( dwWHQLLevel ) \
21788
#define GET_WHQL_MONTH( dwWHQLLevel ) \
21785
    ( ( (dwWHQLLevel) / 0x100 ) & 0x00ff )
21789
    ( ( (dwWHQLLevel) / 0x100 ) & 0x00ff )
21786
#define GET_WHQL_DAY( dwWHQLLevel ) \
21790
#define GET_WHQL_DAY( dwWHQLLevel ) \
21787
    ( (dwWHQLLevel) & 0xff )
21791
    ( (dwWHQLLevel) & 0xff )
21788
}
21792
}
21789
function GET_WHQL_YEAR(dwWHQLLevel: DWORD) : DWORD;
21793
function GET_WHQL_YEAR(dwWHQLLevel: DWORD) : DWORD;
21790
begin
21794
begin
21791
  Result := (dwWHQLLevel) div $10000;
21795
  Result := (dwWHQLLevel) div $10000;
21792
end;
21796
end;
21793
 
21797
 
21794
function GET_WHQL_MONTH(dwWHQLLevel: DWORD) : DWORD;
21798
function GET_WHQL_MONTH(dwWHQLLevel: DWORD) : DWORD;
21795
begin
21799
begin
21796
  Result := ( (dwWHQLLevel) div $100 ) and $00ff;
21800
  Result := ( (dwWHQLLevel) div $100 ) and $00ff;
21797
end;
21801
end;
21798
 
21802
 
21799
function GET_WHQL_DAY(dwWHQLLevel: DWORD) : DWORD;
21803
function GET_WHQL_DAY(dwWHQLLevel: DWORD) : DWORD;
21800
begin
21804
begin
21801
  Result := (dwWHQLLevel) and $ff;
21805
  Result := (dwWHQLLevel) and $ff;
21802
end;
21806
end;
21803
 
21807
 
21804
 
21808
 
21805
function MAKEFOURCC(ch0, ch1, ch2, ch3: Char) : DWORD;
21809
function MAKEFOURCC(ch0, ch1, ch2, ch3: Char) : DWORD;
21806
begin
21810
begin
21807
  Result := DWORD(byte(ch0) shl 0) or
21811
  Result := DWORD(byte(ch0) shl 0) or
21808
            DWORD(byte(ch1) shl 8) or
21812
            DWORD(byte(ch1) shl 8) or
21809
            DWORD(byte(ch2) shl 16) or
21813
            DWORD(byte(ch2) shl 16) or
21810
            DWORD(byte(ch3) shl 24);
21814
            DWORD(byte(ch3) shl 24);
21811
end;
21815
end;
21812
 
21816
 
21813
function DDErrorString(Value: HResult) : string;
21817
function DDErrorString(Value: HResult) : string;
21814
begin
21818
begin
21815
  case Value of
21819
  case Value of
21816
    DD_OK: Result := 'The request completed successfully.';
21820
    DD_OK: Result := 'The request completed successfully.';
21817
    DDERR_ALREADYINITIALIZED: Result := 'This object is already initialized.';
21821
    DDERR_ALREADYINITIALIZED: Result := 'This object is already initialized.';
21818
    DDERR_BLTFASTCANTCLIP: Result := ' if a clipper object is attached to the source surface passed into a BltFast call.';
21822
    DDERR_BLTFASTCANTCLIP: Result := ' if a clipper object is attached to the source surface passed into a BltFast call.';
21819
    DDERR_CANNOTATTACHSURFACE: Result := 'This surface can not be attached to the requested surface.';
21823
    DDERR_CANNOTATTACHSURFACE: Result := 'This surface can not be attached to the requested surface.';
21820
    DDERR_CANNOTDETACHSURFACE: Result := 'This surface can not be detached from the requested surface.';
21824
    DDERR_CANNOTDETACHSURFACE: Result := 'This surface can not be detached from the requested surface.';
21821
    DDERR_CANTCREATEDC: Result := 'Windows can not create any more DCs.';
21825
    DDERR_CANTCREATEDC: Result := 'Windows can not create any more DCs.';
21822
    DDERR_CANTDUPLICATE: Result := 'Cannot duplicate primary & 3D surfaces, or surfaces that are implicitly created.';
21826
    DDERR_CANTDUPLICATE: Result := 'Cannot duplicate primary & 3D surfaces, or surfaces that are implicitly created.';
21823
    DDERR_CLIPPERISUSINGHWND: Result := 'An attempt was made to set a cliplist for a clipper object that is already monitoring an hwnd.';
21827
    DDERR_CLIPPERISUSINGHWND: Result := 'An attempt was made to set a cliplist for a clipper object that is already monitoring an hwnd.';
21824
    DDERR_COLORKEYNOTSET: Result := 'No src color key specified for this operation.';
21828
    DDERR_COLORKEYNOTSET: Result := 'No src color key specified for this operation.';
21825
    DDERR_CURRENTLYNOTAVAIL: Result := 'Support is currently not available.';
21829
    DDERR_CURRENTLYNOTAVAIL: Result := 'Support is currently not available.';
21826
    DDERR_DIRECTDRAWALREADYCREATED: Result := 'A DirectDraw object representing this driver has already been created for this process.';
21830
    DDERR_DIRECTDRAWALREADYCREATED: Result := 'A DirectDraw object representing this driver has already been created for this process.';
21827
    DDERR_EXCEPTION: Result := 'An exception was encountered while performing the requested operation.';
21831
    DDERR_EXCEPTION: Result := 'An exception was encountered while performing the requested operation.';
21828
    DDERR_EXCLUSIVEMODEALREADYSET: Result := 'An attempt was made to set the cooperative level when it was already set to exclusive.';
21832
    DDERR_EXCLUSIVEMODEALREADYSET: Result := 'An attempt was made to set the cooperative level when it was already set to exclusive.';
21829
    DDERR_GENERIC: Result := 'Generic failure.';
21833
    DDERR_GENERIC: Result := 'Generic failure.';
21830
    DDERR_HEIGHTALIGN: Result := 'Height of rectangle provided is not a multiple of reqd alignment.';
21834
    DDERR_HEIGHTALIGN: Result := 'Height of rectangle provided is not a multiple of reqd alignment.';
21831
    DDERR_HWNDALREADYSET: Result := 'The CooperativeLevel HWND has already been set. It can not be reset while the process has surfaces or palettes created.';
21835
    DDERR_HWNDALREADYSET: Result := 'The CooperativeLevel HWND has already been set. It can not be reset while the process has surfaces or palettes created.';
21832
    DDERR_HWNDSUBCLASSED: Result := 'HWND used by DirectDraw CooperativeLevel has been subclassed, this prevents DirectDraw from restoring state.';
21836
    DDERR_HWNDSUBCLASSED: Result := 'HWND used by DirectDraw CooperativeLevel has been subclassed, this prevents DirectDraw from restoring state.';
21833
    DDERR_IMPLICITLYCREATED: Result := 'This surface can not be restored because it is an implicitly created surface.';
21837
    DDERR_IMPLICITLYCREATED: Result := 'This surface can not be restored because it is an implicitly created surface.';
21834
    DDERR_INCOMPATIBLEPRIMARY: Result := 'Unable to match primary surface creation request with existing primary surface.';
21838
    DDERR_INCOMPATIBLEPRIMARY: Result := 'Unable to match primary surface creation request with existing primary surface.';
21835
    DDERR_INVALIDCAPS: Result := 'One or more of the caps bits passed to the callback are incorrect.';
21839
    DDERR_INVALIDCAPS: Result := 'One or more of the caps bits passed to the callback are incorrect.';
21836
    DDERR_INVALIDCLIPLIST: Result := 'DirectDraw does not support the provided cliplist.';
21840
    DDERR_INVALIDCLIPLIST: Result := 'DirectDraw does not support the provided cliplist.';
21837
    DDERR_INVALIDDIRECTDRAWGUID: Result := 'The GUID passed to DirectDrawCreate is not a valid DirectDraw driver identifier.';
21841
    DDERR_INVALIDDIRECTDRAWGUID: Result := 'The GUID passed to DirectDrawCreate is not a valid DirectDraw driver identifier.';
21838
    DDERR_INVALIDMODE: Result := 'DirectDraw does not support the requested mode.';
21842
    DDERR_INVALIDMODE: Result := 'DirectDraw does not support the requested mode.';
21839
    DDERR_INVALIDOBJECT: Result := 'DirectDraw received a pointer that was an invalid DIRECTDRAW object.';
21843
    DDERR_INVALIDOBJECT: Result := 'DirectDraw received a pointer that was an invalid DIRECTDRAW object.';
21840
    DDERR_INVALIDPARAMS: Result := 'One or more of the parameters passed to the function are incorrect.';
21844
    DDERR_INVALIDPARAMS: Result := 'One or more of the parameters passed to the function are incorrect.';
21841
    DDERR_INVALIDPIXELFORMAT: Result := 'The pixel format was invalid as specified.';
21845
    DDERR_INVALIDPIXELFORMAT: Result := 'The pixel format was invalid as specified.';
21842
    DDERR_INVALIDPOSITION: Result := 'Returned when the position of the overlay on the destination is no longer legal for that destination.';
21846
    DDERR_INVALIDPOSITION: Result := 'Returned when the position of the overlay on the destination is no longer legal for that destination.';
21843
    DDERR_INVALIDRECT: Result := 'Rectangle provided was invalid.';
21847
    DDERR_INVALIDRECT: Result := 'Rectangle provided was invalid.';
21844
    DDERR_LOCKEDSURFACES: Result := 'Operation could not be carried out because one or more surfaces are locked.';
21848
    DDERR_LOCKEDSURFACES: Result := 'Operation could not be carried out because one or more surfaces are locked.';
21845
    DDERR_NO3D: Result := 'There is no 3D present.';
21849
    DDERR_NO3D: Result := 'There is no 3D present.';
21846
    DDERR_NOALPHAHW: Result := 'Operation could not be carried out because there is no alpha accleration hardware present or available.';
21850
    DDERR_NOALPHAHW: Result := 'Operation could not be carried out because there is no alpha accleration hardware present or available.';
21847
    DDERR_NOBLTHW: Result := 'No blitter hardware present.';
21851
    DDERR_NOBLTHW: Result := 'No blitter hardware present.';
21848
    DDERR_NOCLIPLIST: Result := 'No cliplist available.';
21852
    DDERR_NOCLIPLIST: Result := 'No cliplist available.';
21849
    DDERR_NOCLIPPERATTACHED: Result := 'No clipper object attached to surface object.';
21853
    DDERR_NOCLIPPERATTACHED: Result := 'No clipper object attached to surface object.';
21850
    DDERR_NOCOLORCONVHW: Result := 'Operation could not be carried out because there is no color conversion hardware present or available.';
21854
    DDERR_NOCOLORCONVHW: Result := 'Operation could not be carried out because there is no color conversion hardware present or available.';
21851
    DDERR_NOCOLORKEY: Result := 'Surface does not currently have a color key';
21855
    DDERR_NOCOLORKEY: Result := 'Surface does not currently have a color key';
21852
    DDERR_NOCOLORKEYHW: Result := 'Operation could not be carried out because there is no hardware support of the destination color key.';
21856
    DDERR_NOCOLORKEYHW: Result := 'Operation could not be carried out because there is no hardware support of the destination color key.';
21853
    DDERR_NOCOOPERATIVELEVELSET: Result := 'Create function called without DirectDraw object method SetCooperativeLevel being called.';
21857
    DDERR_NOCOOPERATIVELEVELSET: Result := 'Create function called without DirectDraw object method SetCooperativeLevel being called.';
21854
    DDERR_NODC: Result := 'No DC was ever created for this surface.';
21858
    DDERR_NODC: Result := 'No DC was ever created for this surface.';
21855
    DDERR_NODDROPSHW: Result := 'No DirectDraw ROP hardware.';
21859
    DDERR_NODDROPSHW: Result := 'No DirectDraw ROP hardware.';
21856
    DDERR_NODIRECTDRAWHW: Result := 'A hardware-only DirectDraw object creation was attempted but the driver did not support any hardware.';
21860
    DDERR_NODIRECTDRAWHW: Result := 'A hardware-only DirectDraw object creation was attempted but the driver did not support any hardware.';
21857
    DDERR_NOEMULATION: Result := 'Software emulation not available.';
21861
    DDERR_NOEMULATION: Result := 'Software emulation not available.';
21858
    DDERR_NOEXCLUSIVEMODE: Result := 'Operation requires the application to have exclusive mode but the application does not have exclusive mode.';
21862
    DDERR_NOEXCLUSIVEMODE: Result := 'Operation requires the application to have exclusive mode but the application does not have exclusive mode.';
21859
    DDERR_NOFLIPHW: Result := 'Flipping visible surfaces is not supported.';
21863
    DDERR_NOFLIPHW: Result := 'Flipping visible surfaces is not supported.';
21860
    DDERR_NOGDI: Result := 'There is no GDI present.';
21864
    DDERR_NOGDI: Result := 'There is no GDI present.';
21861
    DDERR_NOHWND: Result := 'Clipper notification requires an HWND or no HWND has previously been set as the CooperativeLevel HWND.';
21865
    DDERR_NOHWND: Result := 'Clipper notification requires an HWND or no HWND has previously been set as the CooperativeLevel HWND.';
21862
    DDERR_NOMIRRORHW: Result := 'Operation could not be carried out because there is no hardware present or available.';
21866
    DDERR_NOMIRRORHW: Result := 'Operation could not be carried out because there is no hardware present or available.';
21863
    DDERR_NOOVERLAYDEST: Result := 'Returned when GetOverlayPosition is called on an overlay that UpdateOverlay has never been called on to establish a destination.';
21867
    DDERR_NOOVERLAYDEST: Result := 'Returned when GetOverlayPosition is called on an overlay that UpdateOverlay has never been called on to establish a destination.';
21864
    DDERR_NOOVERLAYHW: Result := 'Operation could not be carried out because there is no overlay hardware present or available.';
21868
    DDERR_NOOVERLAYHW: Result := 'Operation could not be carried out because there is no overlay hardware present or available.';
21865
    DDERR_NOPALETTEATTACHED: Result := 'No palette object attached to this surface.';
21869
    DDERR_NOPALETTEATTACHED: Result := 'No palette object attached to this surface.';
21866
    DDERR_NOPALETTEHW: Result := 'No hardware support for 16 or 256 color palettes.';
21870
    DDERR_NOPALETTEHW: Result := 'No hardware support for 16 or 256 color palettes.';
21867
    DDERR_NORASTEROPHW: Result := 'Operation could not be carried out because there is no appropriate raster op hardware present or available.';
21871
    DDERR_NORASTEROPHW: Result := 'Operation could not be carried out because there is no appropriate raster op hardware present or available.';
21868
    DDERR_NOROTATIONHW: Result := 'Operation could not be carried out because there is no rotation hardware present or available.';
21872
    DDERR_NOROTATIONHW: Result := 'Operation could not be carried out because there is no rotation hardware present or available.';
21869
    DDERR_NOSTRETCHHW: Result := 'Operation could not be carried out because there is no hardware support for stretching.';
21873
    DDERR_NOSTRETCHHW: Result := 'Operation could not be carried out because there is no hardware support for stretching.';
21870
    DDERR_NOT4BITCOLOR: Result := 'DirectDrawSurface is not in 4 bit color palette and the requested operation requires 4 bit color palette.';
21874
    DDERR_NOT4BITCOLOR: Result := 'DirectDrawSurface is not in 4 bit color palette and the requested operation requires 4 bit color palette.';
21871
    DDERR_NOT4BITCOLORINDEX: Result := 'DirectDrawSurface is not in 4 bit color index palette and the requested operation requires 4 bit color index palette.';
21875
    DDERR_NOT4BITCOLORINDEX: Result := 'DirectDrawSurface is not in 4 bit color index palette and the requested operation requires 4 bit color index palette.';
21872
    DDERR_NOT8BITCOLOR: Result := 'DirectDrawSurface is not in 8 bit color mode and the requested operation requires 8 bit color.';
21876
    DDERR_NOT8BITCOLOR: Result := 'DirectDrawSurface is not in 8 bit color mode and the requested operation requires 8 bit color.';
21873
    DDERR_NOTAOVERLAYSURFACE: Result := 'Returned when an overlay member is called for a non-overlay surface.';
21877
    DDERR_NOTAOVERLAYSURFACE: Result := 'Returned when an overlay member is called for a non-overlay surface.';
21874
    DDERR_NOTEXTUREHW: Result := 'Operation could not be carried out because there is no texture mapping hardware present or available.';
21878
    DDERR_NOTEXTUREHW: Result := 'Operation could not be carried out because there is no texture mapping hardware present or available.';
21875
    DDERR_NOTFLIPPABLE: Result := 'An attempt has been made to flip a surface that is not flippable.';
21879
    DDERR_NOTFLIPPABLE: Result := 'An attempt has been made to flip a surface that is not flippable.';
21876
    DDERR_NOTFOUND: Result := 'Requested item was not found.';
21880
    DDERR_NOTFOUND: Result := 'Requested item was not found.';
21877
    DDERR_NOTLOCKED: Result := 'Surface was not locked.  An attempt to unlock a surface that was not locked at all, or by this process, has been attempted.';
21881
    DDERR_NOTLOCKED: Result := 'Surface was not locked.  An attempt to unlock a surface that was not locked at all, or by this process, has been attempted.';
21878
    DDERR_NOTPALETTIZED: Result := 'The surface being used is not a palette-based surface.';
21882
    DDERR_NOTPALETTIZED: Result := 'The surface being used is not a palette-based surface.';
21879
    DDERR_NOVSYNCHW: Result := 'Operation could not be carried out because there is no hardware support for vertical blank synchronized operations.';
21883
    DDERR_NOVSYNCHW: Result := 'Operation could not be carried out because there is no hardware support for vertical blank synchronized operations.';
21880
    DDERR_NOZBUFFERHW: Result := 'Operation could not be carried out because there is no hardware support for zbuffer blitting.';
21884
    DDERR_NOZBUFFERHW: Result := 'Operation could not be carried out because there is no hardware support for zbuffer blitting.';
21881
    DDERR_NOZOVERLAYHW: Result := 'Overlay surfaces could not be z layered based on their BltOrder because the hardware does not support z layering of overlays.';
21885
    DDERR_NOZOVERLAYHW: Result := 'Overlay surfaces could not be z layered based on their BltOrder because the hardware does not support z layering of overlays.';
21882
    DDERR_OUTOFCAPS: Result := 'The hardware needed for the requested operation has already been allocated.';
21886
    DDERR_OUTOFCAPS: Result := 'The hardware needed for the requested operation has already been allocated.';
21883
    DDERR_OUTOFMEMORY: Result := 'DirectDraw does not have enough memory to perform the operation.';
21887
    DDERR_OUTOFMEMORY: Result := 'DirectDraw does not have enough memory to perform the operation.';
21884
    DDERR_OUTOFVIDEOMEMORY: Result := 'DirectDraw does not have enough memory to perform the operation.';
21888
    DDERR_OUTOFVIDEOMEMORY: Result := 'DirectDraw does not have enough memory to perform the operation.';
21885
    DDERR_OVERLAYCANTCLIP: Result := 'The hardware does not support clipped overlays.';
21889
    DDERR_OVERLAYCANTCLIP: Result := 'The hardware does not support clipped overlays.';
21886
    DDERR_OVERLAYCOLORKEYONLYONEACTIVE: Result := 'Can only have ony color key active at one time for overlays.';
21890
    DDERR_OVERLAYCOLORKEYONLYONEACTIVE: Result := 'Can only have ony color key active at one time for overlays.';
21887
    DDERR_OVERLAYNOTVISIBLE: Result := 'Returned when GetOverlayPosition is called on a hidden overlay.';
21891
    DDERR_OVERLAYNOTVISIBLE: Result := 'Returned when GetOverlayPosition is called on a hidden overlay.';
21888
    DDERR_PALETTEBUSY: Result := 'Access to this palette is being refused because the palette is already locked by another thread.';
21892
    DDERR_PALETTEBUSY: Result := 'Access to this palette is being refused because the palette is already locked by another thread.';
21889
    DDERR_PRIMARYSURFACEALREADYEXISTS: Result := 'This process already has created a primary surface.';
21893
    DDERR_PRIMARYSURFACEALREADYEXISTS: Result := 'This process already has created a primary surface.';
21890
    DDERR_REGIONTOOSMALL: Result := 'Region passed to Clipper::GetClipList is too small.';
21894
    DDERR_REGIONTOOSMALL: Result := 'Region passed to Clipper::GetClipList is too small.';
21891
    DDERR_SURFACEALREADYATTACHED: Result := 'This surface is already attached to the surface it is being attached to.';
21895
    DDERR_SURFACEALREADYATTACHED: Result := 'This surface is already attached to the surface it is being attached to.';
21892
    DDERR_SURFACEALREADYDEPENDENT: Result := 'This surface is already a dependency of the surface it is being made a dependency of.';
21896
    DDERR_SURFACEALREADYDEPENDENT: Result := 'This surface is already a dependency of the surface it is being made a dependency of.';
21893
    DDERR_SURFACEBUSY: Result := 'Access to this surface is being refused because the surface is already locked by another thread.';
21897
    DDERR_SURFACEBUSY: Result := 'Access to this surface is being refused because the surface is already locked by another thread.';
21894
    DDERR_SURFACEISOBSCURED: Result := 'Access to surface refused because the surface is obscured.';
21898
    DDERR_SURFACEISOBSCURED: Result := 'Access to surface refused because the surface is obscured.';
21895
    DDERR_SURFACELOST: Result := 'Access to this surface is being refused because the surface memory is gone. The DirectDrawSurface object representing this surface should have Restore called on it.';
21899
    DDERR_SURFACELOST: Result := 'Access to this surface is being refused because the surface memory is gone. The DirectDrawSurface object representing this surface should have Restore called on it.';
21896
    DDERR_SURFACENOTATTACHED: Result := 'The requested surface is not attached.';
21900
    DDERR_SURFACENOTATTACHED: Result := 'The requested surface is not attached.';
21897
    DDERR_TOOBIGHEIGHT: Result := 'Height requested by DirectDraw is too large.';
21901
    DDERR_TOOBIGHEIGHT: Result := 'Height requested by DirectDraw is too large.';
21898
    DDERR_TOOBIGSIZE: Result := 'Size requested by DirectDraw is too large, but the individual height and width are OK.';
21902
    DDERR_TOOBIGSIZE: Result := 'Size requested by DirectDraw is too large, but the individual height and width are OK.';
21899
    DDERR_TOOBIGWIDTH: Result := 'Width requested by DirectDraw is too large.';
21903
    DDERR_TOOBIGWIDTH: Result := 'Width requested by DirectDraw is too large.';
21900
    DDERR_UNSUPPORTED: Result := 'Action not supported.';
21904
    DDERR_UNSUPPORTED: Result := 'Action not supported.';
21901
    DDERR_UNSUPPORTEDFORMAT: Result := 'FOURCC format requested is unsupported by DirectDraw.';
21905
    DDERR_UNSUPPORTEDFORMAT: Result := 'FOURCC format requested is unsupported by DirectDraw.';
21902
    DDERR_UNSUPPORTEDMASK: Result := 'Bitmask in the pixel format requested is unsupported by DirectDraw.';
21906
    DDERR_UNSUPPORTEDMASK: Result := 'Bitmask in the pixel format requested is unsupported by DirectDraw.';
21903
    DDERR_VERTICALBLANKINPROGRESS: Result := 'Vertical blank is in progress.';
21907
    DDERR_VERTICALBLANKINPROGRESS: Result := 'Vertical blank is in progress.';
21904
    DDERR_WASSTILLDRAWING: Result := 'Informs DirectDraw that the previous Blt which is transfering information to or from this Surface is incomplete.';
21908
    DDERR_WASSTILLDRAWING: Result := 'Informs DirectDraw that the previous Blt which is transfering information to or from this Surface is incomplete.';
21905
    DDERR_WRONGMODE: Result := 'This surface can not be restored because it was created in a different mode.';
21909
    DDERR_WRONGMODE: Result := 'This surface can not be restored because it was created in a different mode.';
21906
    DDERR_XALIGN: Result := 'Rectangle provided was not horizontally aligned on required boundary.';
21910
    DDERR_XALIGN: Result := 'Rectangle provided was not horizontally aligned on required boundary.';
21907
    // new:
21911
    // new:
21908
    DDERR_OVERLAPPINGRECTS: Result := 'Operation could not be carried out because the source and destination rectangles are on the same surface and overlap each other.';
21912
    DDERR_OVERLAPPINGRECTS: Result := 'Operation could not be carried out because the source and destination rectangles are on the same surface and overlap each other.';
21909
    DDERR_INVALIDSTREAM: Result := 'The specified stream contains invalid data';
21913
    DDERR_INVALIDSTREAM: Result := 'The specified stream contains invalid data';
21910
    DDERR_UNSUPPORTEDMODE: Result := 'The display is currently in an unsupported mode';
21914
    DDERR_UNSUPPORTEDMODE: Result := 'The display is currently in an unsupported mode';
21911
    DDERR_NOMIPMAPHW: Result := 'Operation could not be carried out because there is no mip-map texture mapping hardware present or available.';
21915
    DDERR_NOMIPMAPHW: Result := 'Operation could not be carried out because there is no mip-map texture mapping hardware present or available.';
21912
    DDERR_INVALIDSURFACETYPE: Result := 'The requested action could not be performed because the surface was of the wrong type.';
21916
    DDERR_INVALIDSURFACETYPE: Result := 'The requested action could not be performed because the surface was of the wrong type.';
21913
    DDERR_NOOPTIMIZEHW: Result := 'Device does not support optimized surfaces, therefore no video memory optimized surfaces';
21917
    DDERR_NOOPTIMIZEHW: Result := 'Device does not support optimized surfaces, therefore no video memory optimized surfaces';
21914
    DDERR_NOTLOADED: Result := 'Surface is an optimized surface, but has not yet been allocated any memory';
21918
    DDERR_NOTLOADED: Result := 'Surface is an optimized surface, but has not yet been allocated any memory';
21915
    DDERR_NOFOCUSWINDOW: Result := 'Attempt was made to create or set a device window without first setting the focus window';
21919
    DDERR_NOFOCUSWINDOW: Result := 'Attempt was made to create or set a device window without first setting the focus window';
21916
    DDERR_DCALREADYCREATED: Result := 'A DC has already been returned for this surface. Only one DC can be retrieved per surface.';
21920
    DDERR_DCALREADYCREATED: Result := 'A DC has already been returned for this surface. Only one DC can be retrieved per surface.';
21917
    DDERR_NONONLOCALVIDMEM: Result := 'An attempt was made to allocate non-local video memory from a device that does not support non-local video memory.';
21921
    DDERR_NONONLOCALVIDMEM: Result := 'An attempt was made to allocate non-local video memory from a device that does not support non-local video memory.';
21918
    DDERR_CANTPAGELOCK: Result := 'The attempt to page lock a surface failed.';
21922
    DDERR_CANTPAGELOCK: Result := 'The attempt to page lock a surface failed.';
21919
    DDERR_CANTPAGEUNLOCK: Result := 'The attempt to page unlock a surface failed.';
21923
    DDERR_CANTPAGEUNLOCK: Result := 'The attempt to page unlock a surface failed.';
21920
    DDERR_NOTPAGELOCKED: Result := 'An attempt was made to page unlock a surface with no outstanding page locks.';
21924
    DDERR_NOTPAGELOCKED: Result := 'An attempt was made to page unlock a surface with no outstanding page locks.';
21921
    DDERR_MOREDATA: Result := 'There is more data available than the specified buffer size could hold';
21925
    DDERR_MOREDATA: Result := 'There is more data available than the specified buffer size could hold';
21922
    DDERR_EXPIRED: Result := 'The data has expired and is therefore no longer valid.';
21926
    DDERR_EXPIRED: Result := 'The data has expired and is therefore no longer valid.';
21923
    DDERR_VIDEONOTACTIVE: Result := 'The video port is not active';
21927
    DDERR_VIDEONOTACTIVE: Result := 'The video port is not active';
21924
    DDERR_DEVICEDOESNTOWNSURFACE: Result := 'Surfaces created by one direct draw device cannot be used directly by another direct draw device.';
21928
    DDERR_DEVICEDOESNTOWNSURFACE: Result := 'Surfaces created by one direct draw device cannot be used directly by another direct draw device.';
21925
    DDERR_NOTINITIALIZED: Result := 'An attempt was made to invoke an interface member of a DirectDraw object created by CoCreateInstance() before it was initialized.';
21929
    DDERR_NOTINITIALIZED: Result := 'An attempt was made to invoke an interface member of a DirectDraw object created by CoCreateInstance() before it was initialized.';
21926
    else Result := 'Unrecognized Error';
21930
    else Result := 'Unrecognized Error';
21927
  end;
21931
  end;
21928
end;
21932
end;
21929
 
21933
 
21930
//Direct3D file
21934
//Direct3D file
21931
 
21935
 
21932
function DXFileErrorString(Value: HResult) : string;
21936
function DXFileErrorString(Value: HResult) : string;
21933
begin
21937
begin
21934
  case Value of
21938
  case Value of
21935
    DXFILE_OK: Result := 'Command completed successfully. Equivalent to DD_OK.';
21939
    DXFILE_OK: Result := 'Command completed successfully. Equivalent to DD_OK.';
21936
    DXFILEERR_BADVALUE: Result := 'Parameter is invalid.';
21940
    DXFILEERR_BADVALUE: Result := 'Parameter is invalid.';
21937
    DXFILEERR_BADTYPE: Result := 'Object type is invalid.';
21941
    DXFILEERR_BADTYPE: Result := 'Object type is invalid.';
21938
    DXFILEERR_BADALLOC: Result := 'Memory allocation failed.';
21942
    DXFILEERR_BADALLOC: Result := 'Memory allocation failed.';
21939
    DXFILEERR_NOTFOUND: Result := 'Object could not be found.';
21943
    DXFILEERR_NOTFOUND: Result := 'Object could not be found.';
21940
    DXFILEERR_FILENOTFOUND: Result := 'File could not be found.';
21944
    DXFILEERR_FILENOTFOUND: Result := 'File could not be found.';
21941
    DXFILEERR_RESOURCENOTFOUND: Result := 'Resource could not be found.';
21945
    DXFILEERR_RESOURCENOTFOUND: Result := 'Resource could not be found.';
21942
    DXFILEERR_URLNOTFOUND: Result := 'URL could not be found.';
21946
    DXFILEERR_URLNOTFOUND: Result := 'URL could not be found.';
21943
    DXFILEERR_BADRESOURCE: Result := 'Resource is invalid.';
21947
    DXFILEERR_BADRESOURCE: Result := 'Resource is invalid.';
21944
    DXFILEERR_BADFILETYPE: Result := 'File is not a DirectX file.';
21948
    DXFILEERR_BADFILETYPE: Result := 'File is not a DirectX file.';
21945
    DXFILEERR_BADFILEVERSION: Result := 'File version is not valid.';
21949
    DXFILEERR_BADFILEVERSION: Result := 'File version is not valid.';
21946
    DXFILEERR_BADFILEFLOATSIZE: Result := 'Floating-point size is invalid.';
21950
    DXFILEERR_BADFILEFLOATSIZE: Result := 'Floating-point size is invalid.';
21947
    DXFILEERR_BADFILE: Result := 'File is invalid.';
21951
    DXFILEERR_BADFILE: Result := 'File is invalid.';
21948
    DXFILEERR_PARSEERROR: Result := 'File could not be parsed.';
21952
    DXFILEERR_PARSEERROR: Result := 'File could not be parsed.';
21949
    DXFILEERR_BADARRAYSIZE: Result := 'Array size is invalid.';
21953
    DXFILEERR_BADARRAYSIZE: Result := 'Array size is invalid.';
21950
    DXFILEERR_BADDATAREFERENCE: Result := 'Data reference is invalid.';
21954
    DXFILEERR_BADDATAREFERENCE: Result := 'Data reference is invalid.';
21951
    DXFILEERR_NOMOREOBJECTS: Result := 'All objects have been enumerated.';
21955
    DXFILEERR_NOMOREOBJECTS: Result := 'All objects have been enumerated.';
21952
    DXFILEERR_NOMOREDATA: Result := 'No further data is available.';
21956
    DXFILEERR_NOMOREDATA: Result := 'No further data is available.';
21953
    else Result := 'Unrecognized Error';
21957
    else Result := 'Unrecognized Error';
21954
  end;
21958
  end;
21955
end;
21959
end;
21956
 
21960
 
21957
function D3DFVF_TEXCOORDSIZE3(CoordIndex: DWORD) : DWORD;
21961
function D3DFVF_TEXCOORDSIZE3(CoordIndex: DWORD) : DWORD;
21958
begin
21962
begin
21959
  Result := (D3DFVF_TEXTUREFORMAT3 shl (CoordIndex*2 + 16));
21963
  Result := (D3DFVF_TEXTUREFORMAT3 shl (CoordIndex*2 + 16));
21960
end;
21964
end;
21961
 
21965
 
21962
function D3DFVF_TEXCOORDSIZE2(CoordIndex: DWORD) : DWORD;
21966
function D3DFVF_TEXCOORDSIZE2(CoordIndex: DWORD) : DWORD;
21963
begin
21967
begin
21964
  Result := (D3DFVF_TEXTUREFORMAT2);
21968
  Result := (D3DFVF_TEXTUREFORMAT2);
21965
end;
21969
end;
21966
 
21970
 
21967
function D3DFVF_TEXCOORDSIZE4(CoordIndex: DWORD) : DWORD;
21971
function D3DFVF_TEXCOORDSIZE4(CoordIndex: DWORD) : DWORD;
21968
begin
21972
begin
21969
  Result := (D3DFVF_TEXTUREFORMAT4 shl (CoordIndex*2 + 16));
21973
  Result := (D3DFVF_TEXTUREFORMAT4 shl (CoordIndex*2 + 16));
21970
end;
21974
end;
21971
 
21975
 
21972
function D3DFVF_TEXCOORDSIZE1(CoordIndex: DWORD) : DWORD;
21976
function D3DFVF_TEXCOORDSIZE1(CoordIndex: DWORD) : DWORD;
21973
begin
21977
begin
21974
  Result := (D3DFVF_TEXTUREFORMAT1 shl (CoordIndex*2 + 16));
21978
  Result := (D3DFVF_TEXTUREFORMAT1 shl (CoordIndex*2 + 16));
21975
end;
21979
end;
21976
 
21980
 
21977
 
21981
 
21978
function D3DVal(val: variant) : float;
21982
function D3DVal(val: variant) : float;
21979
begin
21983
begin
21980
  Result := val;
21984
  Result := val;
21981
end;
21985
end;
21982
 
21986
 
21983
function D3DDivide(a,b: double) : float;
21987
function D3DDivide(a,b: double) : float;
21984
begin
21988
begin
21985
  Result := a / b;
21989
  Result := a / b;
21986
end;
21990
end;
21987
 
21991
 
21988
function D3DMultiply(a,b: double) : float;
21992
function D3DMultiply(a,b: double) : float;
21989
begin
21993
begin
21990
  Result := a * b;
21994
  Result := a * b;
21991
end;
21995
end;
21992
 
21996
 
21993
// #define CI_GETALPHA(ci)    ((ci) >> 24)
21997
// #define CI_GETALPHA(ci)    ((ci) >> 24)
21994
function CI_GETALPHA(ci: DWORD) : DWORD;
21998
function CI_GETALPHA(ci: DWORD) : DWORD;
21995
begin
21999
begin
21996
  Result := ci shr 24;
22000
  Result := ci shr 24;
21997
end;
22001
end;
21998
 
22002
 
21999
// #define CI_GETINDEX(ci)    (((ci) >> 8) & 0xffff)
22003
// #define CI_GETINDEX(ci)    (((ci) >> 8) & 0xffff)
22000
function CI_GETINDEX(ci: DWORD) : DWORD;
22004
function CI_GETINDEX(ci: DWORD) : DWORD;
22001
begin
22005
begin
22002
  Result := (ci shr 8) and $ffff;
22006
  Result := (ci shr 8) and $ffff;
22003
end;
22007
end;
22004
 
22008
 
22005
// #define CI_GETFRACTION(ci) ((ci) & 0xff)
22009
// #define CI_GETFRACTION(ci) ((ci) & 0xff)
22006
function CI_GETFRACTION(ci: DWORD) : DWORD;
22010
function CI_GETFRACTION(ci: DWORD) : DWORD;
22007
begin
22011
begin
22008
  Result := ci and $ff;
22012
  Result := ci and $ff;
22009
end;
22013
end;
22010
 
22014
 
22011
// #define CI_ROUNDINDEX(ci)  CI_GETINDEX((ci) + 0x80)
22015
// #define CI_ROUNDINDEX(ci)  CI_GETINDEX((ci) + 0x80)
22012
function CI_ROUNDINDEX(ci: DWORD) : DWORD;
22016
function CI_ROUNDINDEX(ci: DWORD) : DWORD;
22013
begin
22017
begin
22014
  Result := CI_GETINDEX(ci + $80);
22018
  Result := CI_GETINDEX(ci + $80);
22015
end;
22019
end;
22016
 
22020
 
22017
// #define CI_MASKALPHA(ci)   ((ci) & 0xffffff)
22021
// #define CI_MASKALPHA(ci)   ((ci) & 0xffffff)
22018
function CI_MASKALPHA(ci: DWORD) : DWORD;
22022
function CI_MASKALPHA(ci: DWORD) : DWORD;
22019
begin
22023
begin
22020
  Result := ci and $ffffff;
22024
  Result := ci and $ffffff;
22021
end;
22025
end;
22022
 
22026
 
22023
// #define CI_MAKE(a, i, f)    (((a) << 24) | ((i) << 8) | (f))
22027
// #define CI_MAKE(a, i, f)    (((a) << 24) | ((i) << 8) | (f))
22024
function CI_MAKE(a,i,f: DWORD) : DWORD;
22028
function CI_MAKE(a,i,f: DWORD) : DWORD;
22025
begin
22029
begin
22026
  Result := (a shl 24) or (i shl 8) or f;
22030
  Result := (a shl 24) or (i shl 8) or f;
22027
end;
22031
end;
22028
 
22032
 
22029
// #define RGBA_GETALPHA(rgb)      ((rgb) >> 24)
22033
// #define RGBA_GETALPHA(rgb)      ((rgb) >> 24)
22030
function RGBA_GETALPHA(rgb: TD3DColor) : DWORD;
22034
function RGBA_GETALPHA(rgb: TD3DColor) : DWORD;
22031
begin
22035
begin
22032
  Result := rgb shr 24;
22036
  Result := rgb shr 24;
22033
end;
22037
end;
22034
 
22038
 
22035
// #define RGBA_GETRED(rgb)        (((rgb) >> 16) & 0xff)
22039
// #define RGBA_GETRED(rgb)        (((rgb) >> 16) & 0xff)
22036
function RGBA_GETRED(rgb: TD3DColor) : DWORD;
22040
function RGBA_GETRED(rgb: TD3DColor) : DWORD;
22037
begin
22041
begin
22038
  Result := (rgb shr 16) and $ff;
22042
  Result := (rgb shr 16) and $ff;
22039
end;
22043
end;
22040
 
22044
 
22041
// #define RGBA_GETGREEN(rgb)      (((rgb) >> 8) & 0xff)
22045
// #define RGBA_GETGREEN(rgb)      (((rgb) >> 8) & 0xff)
22042
function RGBA_GETGREEN(rgb: TD3DColor) : DWORD;
22046
function RGBA_GETGREEN(rgb: TD3DColor) : DWORD;
22043
begin
22047
begin
22044
  Result := (rgb shr 8) and $ff;
22048
  Result := (rgb shr 8) and $ff;
22045
end;
22049
end;
22046
 
22050
 
22047
// #define RGBA_GETBLUE(rgb)       ((rgb) & 0xff)
22051
// #define RGBA_GETBLUE(rgb)       ((rgb) & 0xff)
22048
function RGBA_GETBLUE(rgb: TD3DColor) : DWORD;
22052
function RGBA_GETBLUE(rgb: TD3DColor) : DWORD;
22049
begin
22053
begin
22050
  Result := rgb and $ff;
22054
  Result := rgb and $ff;
22051
end;
22055
end;
22052
 
22056
 
22053
// #define RGBA_MAKE(r, g, b, a)   ((TD3DColor) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)))
22057
// #define RGBA_MAKE(r, g, b, a)   ((TD3DColor) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)))
22054
function RGBA_MAKE(r, g, b, a: DWORD) : TD3DColor;
22058
function RGBA_MAKE(r, g, b, a: DWORD) : TD3DColor;
22055
begin
22059
begin
22056
  Result := (a shl 24) or (r shl 16) or (g shl 8) or b;
22060
  Result := (a shl 24) or (r shl 16) or (g shl 8) or b;
22057
end;
22061
end;
22058
 
22062
 
22059
// #define D3DRGB(r, g, b) \
22063
// #define D3DRGB(r, g, b) \
22060
//     (0xff000000L | (((long)((r) * 255)) << 16) | (((long)((g) * 255)) << 8) | (long)((b) * 255))
22064
//     (0xff000000L | (((long)((r) * 255)) << 16) | (((long)((g) * 255)) << 8) | (long)((b) * 255))
22061
function D3DRGB(r, g, b: float) : TD3DColor;
22065
function D3DRGB(r, g, b: float) : TD3DColor;
22062
begin
22066
begin
22063
  Result := $ff000000 or (round(r * 255) shl 16)
22067
  Result := $ff000000 or (round(r * 255) shl 16)
22064
                      or (round(g * 255) shl 8)
22068
                      or (round(g * 255) shl 8)
22065
                      or round(b * 255);
22069
                      or round(b * 255);
22066
end;
22070
end;
22067
 
22071
 
22068
// #define D3DRGBA(r, g, b, a) \
22072
// #define D3DRGBA(r, g, b, a) \
22069
//     (  (((long)((a) * 255)) << 24) | (((long)((r) * 255)) << 16) \
22073
//     (  (((long)((a) * 255)) << 24) | (((long)((r) * 255)) << 16) \
22070
//     |   (((long)((g) * 255)) << 8) | (long)((b) * 255) \
22074
//     |   (((long)((g) * 255)) << 8) | (long)((b) * 255) \
22071
//    )
22075
//    )
22072
function D3DRGBA(r, g, b, a: float) : TD3DColor;
22076
function D3DRGBA(r, g, b, a: float) : TD3DColor;
22073
begin
22077
begin
22074
  Result := (round(a * 255) shl 24) or (round(r * 255) shl 16)
22078
  Result := (round(a * 255) shl 24) or (round(r * 255) shl 16)
22075
                                    or (round(g * 255) shl 8)
22079
                                    or (round(g * 255) shl 8)
22076
                                    or round(b * 255);
22080
                                    or round(b * 255);
22077
end;
22081
end;
22078
 
22082
 
22079
// #define RGB_GETRED(rgb)         (((rgb) >> 16) & 0xff)
22083
// #define RGB_GETRED(rgb)         (((rgb) >> 16) & 0xff)
22080
function RGB_GETRED(rgb: TD3DColor) : DWORD;
22084
function RGB_GETRED(rgb: TD3DColor) : DWORD;
22081
begin
22085
begin
22082
  Result := (rgb shr 16) and $ff;
22086
  Result := (rgb shr 16) and $ff;
22083
end;
22087
end;
22084
 
22088
 
22085
// #define RGB_GETGREEN(rgb)       (((rgb) >> 8) & 0xff)
22089
// #define RGB_GETGREEN(rgb)       (((rgb) >> 8) & 0xff)
22086
function RGB_GETGREEN(rgb: TD3DColor) : DWORD;
22090
function RGB_GETGREEN(rgb: TD3DColor) : DWORD;
22087
begin
22091
begin
22088
  Result := (rgb shr 8) and $ff;
22092
  Result := (rgb shr 8) and $ff;
22089
end;
22093
end;
22090
 
22094
 
22091
// #define RGB_GETBLUE(rgb)        ((rgb) & 0xff)
22095
// #define RGB_GETBLUE(rgb)        ((rgb) & 0xff)
22092
function RGB_GETBLUE(rgb: TD3DColor) : DWORD;
22096
function RGB_GETBLUE(rgb: TD3DColor) : DWORD;
22093
begin
22097
begin
22094
  Result := rgb and $ff;
22098
  Result := rgb and $ff;
22095
end;
22099
end;
22096
 
22100
 
22097
// #define RGBA_SETALPHA(rgba, x) (((x) << 24) | ((rgba) & 0x00ffffff))
22101
// #define RGBA_SETALPHA(rgba, x) (((x) << 24) | ((rgba) & 0x00ffffff))
22098
function RGBA_SETALPHA(rgba: TD3DColor; x: DWORD) : TD3DColor;
22102
function RGBA_SETALPHA(rgba: TD3DColor; x: DWORD) : TD3DColor;
22099
begin
22103
begin
22100
  Result := (x shl 24) or (rgba and $00ffffff);
22104
  Result := (x shl 24) or (rgba and $00ffffff);
22101
end;
22105
end;
22102
 
22106
 
22103
// #define RGB_MAKE(r, g, b)       ((TD3DColor) (((r) << 16) | ((g) << 8) | (b)))
22107
// #define RGB_MAKE(r, g, b)       ((TD3DColor) (((r) << 16) | ((g) << 8) | (b)))
22104
function RGB_MAKE(r, g, b: DWORD) : TD3DColor;
22108
function RGB_MAKE(r, g, b: DWORD) : TD3DColor;
22105
begin
22109
begin
22106
  Result := (r shl 16) or (g shl 8) or b;
22110
  Result := (r shl 16) or (g shl 8) or b;
22107
end;
22111
end;
22108
 
22112
 
22109
// #define RGBA_TORGB(rgba)       ((TD3DColor) ((rgba) & 0xffffff))
22113
// #define RGBA_TORGB(rgba)       ((TD3DColor) ((rgba) & 0xffffff))
22110
function RGBA_TORGB(rgba: TD3DColor) : TD3DColor;
22114
function RGBA_TORGB(rgba: TD3DColor) : TD3DColor;
22111
begin
22115
begin
22112
  Result := rgba and $00ffffff;
22116
  Result := rgba and $00ffffff;
22113
end;
22117
end;
22114
 
22118
 
22115
// #define RGB_TORGBA(rgb)        ((TD3DColor) ((rgb) | 0xff000000))
22119
// #define RGB_TORGBA(rgb)        ((TD3DColor) ((rgb) | 0xff000000))
22116
function RGB_TORGBA(rgb: TD3DColor) : TD3DColor;
22120
function RGB_TORGBA(rgb: TD3DColor) : TD3DColor;
22117
begin
22121
begin
22118
  Result := rgb or $ff000000;
22122
  Result := rgb or $ff000000;
22119
end;
22123
end;
22120
 
22124
 
22121
 
22125
 
22122
function D3DSTATE_OVERRIDE(StateType: DWORD) : DWORD;
22126
function D3DSTATE_OVERRIDE(StateType: DWORD) : DWORD;
22123
begin
22127
begin
22124
  Result := StateType + D3DSTATE_OVERRIDE_BIAS;
22128
  Result := StateType + D3DSTATE_OVERRIDE_BIAS;
22125
end;
22129
end;
22126
 
22130
 
22127
function D3DTRIFLAG_STARTFLAT(len: DWORD) : DWORD;
22131
function D3DTRIFLAG_STARTFLAT(len: DWORD) : DWORD;
22128
begin
22132
begin
22129
  if not (len in [1..29]) then len := 0;
22133
  if not (len in [1..29]) then len := 0;
22130
  result := len;
22134
  result := len;
22131
end;
22135
end;
22132
 
22136
 
22133
// #define D3DRENDERSTATE_STIPPLEPATTERN(y) (D3DRENDERSTATE_STIPPLEPATTERN00 + (y))
22137
// #define D3DRENDERSTATE_STIPPLEPATTERN(y) (D3DRENDERSTATE_STIPPLEPATTERN00 + (y))
22134
function D3DRENDERSTATE_STIPPLEPATTERN(y: integer) : TD3DRenderStateType;
22138
function D3DRENDERSTATE_STIPPLEPATTERN(y: integer) : TD3DRenderStateType;
22135
begin
22139
begin
22136
  Result := TD3DRenderStateType(Ord(D3DRENDERSTATE_STIPPLEPATTERN00) + y);
22140
  Result := TD3DRenderStateType(Ord(D3DRENDERSTATE_STIPPLEPATTERN00) + y);
22137
end;
22141
end;
22138
 
22142
 
22139
 
22143
 
22140
 
22144
 
22141
 
22145
 
22142
    // Addition and subtraction
22146
    // Addition and subtraction
22143
function VectorAdd(const v1, v2: TD3DVector) : TD3DVector;
22147
function VectorAdd(const v1, v2: TD3DVector) : TD3DVector;
22144
begin
22148
begin
22145
  result.x := v1.x+v2.x;
22149
  result.x := v1.x+v2.x;
22146
  result.y := v1.y+v2.y;
22150
  result.y := v1.y+v2.y;
22147
  result.z := v1.z+v2.z;
22151
  result.z := v1.z+v2.z;
22148
end;
22152
end;
22149
 
22153
 
22150
function VectorSub(const v1, v2: TD3DVector) : TD3DVector;
22154
function VectorSub(const v1, v2: TD3DVector) : TD3DVector;
22151
begin
22155
begin
22152
  result.x := v1.x-v2.x;
22156
  result.x := v1.x-v2.x;
22153
  result.y := v1.y-v2.y;
22157
  result.y := v1.y-v2.y;
22154
  result.z := v1.z-v2.z;
22158
  result.z := v1.z-v2.z;
22155
end;
22159
end;
22156
 
22160
 
22157
    // Scalar multiplication and division
22161
    // Scalar multiplication and division
22158
function VectorMulS(const v: TD3DVector; s: TD3DValue) : TD3DVector;
22162
function VectorMulS(const v: TD3DVector; s: TD3DValue) : TD3DVector;
22159
begin
22163
begin
22160
  result.x := v.x*s;
22164
  result.x := v.x*s;
22161
  result.y := v.y*s;
22165
  result.y := v.y*s;
22162
  result.z := v.z*s;
22166
  result.z := v.z*s;
22163
end;
22167
end;
22164
 
22168
 
22165
function VectorDivS(const v: TD3DVector; s: TD3DValue) : TD3DVector;
22169
function VectorDivS(const v: TD3DVector; s: TD3DValue) : TD3DVector;
22166
begin
22170
begin
22167
  result.x := v.x/s;
22171
  result.x := v.x/s;
22168
  result.y := v.y/s;
22172
  result.y := v.y/s;
22169
  result.z := v.z/s;
22173
  result.z := v.z/s;
22170
end;
22174
end;
22171
 
22175
 
22172
    // Memberwise multiplication and division
22176
    // Memberwise multiplication and division
22173
function VectorMul(const v1, v2: TD3DVector) : TD3DVector;
22177
function VectorMul(const v1, v2: TD3DVector) : TD3DVector;
22174
begin
22178
begin
22175
  result.x := v1.x*v2.x;
22179
  result.x := v1.x*v2.x;
22176
  result.y := v1.y*v2.y;
22180
  result.y := v1.y*v2.y;
22177
  result.z := v1.z*v2.z;
22181
  result.z := v1.z*v2.z;
22178
end;
22182
end;
22179
 
22183
 
22180
function VectorDiv(const v1, v2: TD3DVector) : TD3DVector;
22184
function VectorDiv(const v1, v2: TD3DVector) : TD3DVector;
22181
begin
22185
begin
22182
  result.x := v1.x/v2.x;
22186
  result.x := v1.x/v2.x;
22183
  result.y := v1.y/v2.y;
22187
  result.y := v1.y/v2.y;
22184
  result.z := v1.z/v2.z;
22188
  result.z := v1.z/v2.z;
22185
end;
22189
end;
22186
 
22190
 
22187
    // Vector dominance
22191
    // Vector dominance
22188
function VectorSmaller(v1, v2: TD3DVector) : boolean;
22192
function VectorSmaller(v1, v2: TD3DVector) : boolean;
22189
begin
22193
begin
22190
  result := (v1.x < v2.x) and (v1.y < v2.y) and (v1.z < v2.z);
22194
  result := (v1.x < v2.x) and (v1.y < v2.y) and (v1.z < v2.z);
22191
end;
22195
end;
22192
 
22196
 
22193
function VectorSmallerEquel(v1, v2: TD3DVector) : boolean;
22197
function VectorSmallerEquel(v1, v2: TD3DVector) : boolean;
22194
begin
22198
begin
22195
  result := (v1.x <= v2.x) and (v1.y <= v2.y) and (v1.z <= v2.z);
22199
  result := (v1.x <= v2.x) and (v1.y <= v2.y) and (v1.z <= v2.z);
22196
end;
22200
end;
22197
 
22201
 
22198
    // Bitwise equality
22202
    // Bitwise equality
22199
function VectorEquel(v1, v2: TD3DVector) : boolean;
22203
function VectorEquel(v1, v2: TD3DVector) : boolean;
22200
begin
22204
begin
22201
  result := (v1.x = v2.x) and (v1.y = v2.y) and (v1.z = v2.z);
22205
  result := (v1.x = v2.x) and (v1.y = v2.y) and (v1.z = v2.z);
22202
end;
22206
end;
22203
 
22207
 
22204
    // Length-related functions
22208
    // Length-related functions
22205
function VectorSquareMagnitude(v: TD3DVector) : TD3DValue;
22209
function VectorSquareMagnitude(v: TD3DVector) : TD3DValue;
22206
begin
22210
begin
22207
  result := (v.x*v.x) + (v.y*v.y) + (v.z*v.z);
22211
  result := (v.x*v.x) + (v.y*v.y) + (v.z*v.z);
22208
end;
22212
end;
22209
 
22213
 
22210
function VectorMagnitude(v: TD3DVector) : TD3DValue;
22214
function VectorMagnitude(v: TD3DVector) : TD3DValue;
22211
begin
22215
begin
22212
  result := sqrt((v.x*v.x) + (v.y*v.y) + (v.z*v.z));
22216
  result := sqrt((v.x*v.x) + (v.y*v.y) + (v.z*v.z));
22213
end;
22217
end;
22214
 
22218
 
22215
    // Returns vector with same direction and unit length
22219
    // Returns vector with same direction and unit length
22216
function VectorNormalize(const v: TD3DVector) : TD3DVector;
22220
function VectorNormalize(const v: TD3DVector) : TD3DVector;
22217
begin
22221
begin
22218
  result := VectorDivS(v,VectorMagnitude(v));
22222
  result := VectorDivS(v,VectorMagnitude(v));
22219
end;
22223
end;
22220
 
22224
 
22221
    // Return min/max component of the input vector
22225
    // Return min/max component of the input vector
22222
function VectorMin(v: TD3DVector) : TD3DValue;
22226
function VectorMin(v: TD3DVector) : TD3DValue;
22223
var
22227
var
22224
  ret : TD3DValue;
22228
  ret : TD3DValue;
22225
begin
22229
begin
22226
  ret := v.x;
22230
  ret := v.x;
22227
  if (v.y < ret) then ret := v.y;
22231
  if (v.y < ret) then ret := v.y;
22228
  if (v.z < ret) then ret := v.z;
22232
  if (v.z < ret) then ret := v.z;
22229
  result := ret;
22233
  result := ret;
22230
end;
22234
end;
22231
 
22235
 
22232
function VectorMax(v: TD3DVector) : TD3DValue;
22236
function VectorMax(v: TD3DVector) : TD3DValue;
22233
var
22237
var
22234
  ret : TD3DValue;
22238
  ret : TD3DValue;
22235
begin
22239
begin
22236
  ret := v.x;
22240
  ret := v.x;
22237
  if (ret < v.y) then ret := v.y;
22241
  if (ret < v.y) then ret := v.y;
22238
  if (ret < v.z) then ret := v.z;
22242
  if (ret < v.z) then ret := v.z;
22239
  result := ret;
22243
  result := ret;
22240
end;
22244
end;
22241
 
22245
 
22242
    // Return memberwise min/max of input vectors
22246
    // Return memberwise min/max of input vectors
22243
function VectorMinimize(const v1, v2: TD3DVector) : TD3DVector;
22247
function VectorMinimize(const v1, v2: TD3DVector) : TD3DVector;
22244
begin
22248
begin
22245
  if v1.x < v2.x then result.x := v1.x else result.x := v2.x;
22249
  if v1.x < v2.x then result.x := v1.x else result.x := v2.x;
22246
  if v1.y < v2.y then result.y := v1.y else result.y := v2.y;
22250
  if v1.y < v2.y then result.y := v1.y else result.y := v2.y;
22247
  if v1.z < v2.z then result.z := v1.z else result.z := v2.z;
22251
  if v1.z < v2.z then result.z := v1.z else result.z := v2.z;
22248
end;
22252
end;
22249
 
22253
 
22250
function VectorMaximize(const v1, v2: TD3DVector) : TD3DVector;
22254
function VectorMaximize(const v1, v2: TD3DVector) : TD3DVector;
22251
begin
22255
begin
22252
  if v1.x > v2.x then result.x := v1.x else result.x := v2.x;
22256
  if v1.x > v2.x then result.x := v1.x else result.x := v2.x;
22253
  if v1.y > v2.y then result.y := v1.y else result.y := v2.y;
22257
  if v1.y > v2.y then result.y := v1.y else result.y := v2.y;
22254
  if v1.z > v2.z then result.z := v1.z else result.z := v2.z;
22258
  if v1.z > v2.z then result.z := v1.z else result.z := v2.z;
22255
end;
22259
end;
22256
 
22260
 
22257
    // Dot and cross product
22261
    // Dot and cross product
22258
function VectorDotProduct(v1, v2: TD3DVector) : TD3DValue;
22262
function VectorDotProduct(v1, v2: TD3DVector) : TD3DValue;
22259
begin
22263
begin
22260
  result := (v1.x*v2.x) + (v1.y * v2.y) + (v1.z*v2.z);
22264
  result := (v1.x*v2.x) + (v1.y * v2.y) + (v1.z*v2.z);
22261
end;
22265
end;
22262
 
22266
 
22263
function VectorCrossProduct(const v1, v2: TD3DVector) : TD3DVector;
22267
function VectorCrossProduct(const v1, v2: TD3DVector) : TD3DVector;
22264
begin
22268
begin
22265
  result.x := (v1.y*v2.z) - (v1.z*v2.y);
22269
  result.x := (v1.y*v2.z) - (v1.z*v2.y);
22266
  result.y := (v1.z*v2.x) - (v1.x*v2.z);
22270
  result.y := (v1.z*v2.x) - (v1.x*v2.z);
22267
  result.z := (v1.x*v2.y) - (v1.y*v2.x);
22271
  result.z := (v1.x*v2.y) - (v1.y*v2.x);
22268
end;
22272
end;
22269
 
22273
 
22270
procedure DisableFPUExceptions;
22274
procedure DisableFPUExceptions;
22271
var
22275
var
22272
  FPUControlWord: WORD;
22276
  FPUControlWord: WORD;
22273
asm
22277
asm
22274
  FSTCW   FPUControlWord;
22278
  FSTCW   FPUControlWord;
22275
  OR      FPUControlWord, $4 + $1; { Divide by zero + invalid operation }
22279
  OR      FPUControlWord, $4 + $1; { Divide by zero + invalid operation }
22276
  FLDCW   FPUControlWord;
22280
  FLDCW   FPUControlWord;
22277
end;
22281
end;
22278
 
22282
 
22279
procedure EnableFPUExceptions;
22283
procedure EnableFPUExceptions;
22280
var
22284
var
22281
  FPUControlWord: WORD;
22285
  FPUControlWord: WORD;
22282
asm
22286
asm
22283
  FSTCW   FPUControlWord;
22287
  FSTCW   FPUControlWord;
22284
  AND     FPUControlWord, $FFFF - $4 - $1; { Divide by zero + invalid operation }
22288
  AND     FPUControlWord, $FFFF - $4 - $1; { Divide by zero + invalid operation }
22285
  FLDCW   FPUControlWord;
22289
  FLDCW   FPUControlWord;
22286
end;
22290
end;
22287
 
22291
 
22288
function D3DErrorString(Value: HResult) : string; //Full description not available yet
22292
function D3DErrorString(Value: HResult) : string; //Full description not available yet
22289
begin
22293
begin
22290
  case Value of
22294
  case Value of
22291
    D3D_OK: Result := 'No error';
22295
    D3D_OK: Result := 'No error';
22292
 
22296
 
22293
    D3DERR_BADMAJORVERSION: Result := 'D3DERR_BADMAJORVERSION';
22297
    D3DERR_BADMAJORVERSION: Result := 'D3DERR_BADMAJORVERSION';
22294
    D3DERR_BADMINORVERSION: Result := 'D3DERR_BADMINORVERSION';
22298
    D3DERR_BADMINORVERSION: Result := 'D3DERR_BADMINORVERSION';
22295
 
22299
 
22296
    D3DERR_INVALID_DEVICE: Result := 'D3DERR_INITFAILED';
22300
    D3DERR_INVALID_DEVICE: Result := 'D3DERR_INITFAILED';
22297
    D3DERR_INITFAILED: Result := 'D3DERR_INITFAILED';
22301
    D3DERR_INITFAILED: Result := 'D3DERR_INITFAILED';
22298
 
22302
 
22299
    D3DERR_DEVICEAGGREGATED: Result := 'D3DERR_DEVICEAGGREGATED';
22303
    D3DERR_DEVICEAGGREGATED: Result := 'D3DERR_DEVICEAGGREGATED';
22300
 
22304
 
22301
    D3DERR_EXECUTE_CREATE_FAILED: Result := 'D3DERR_EXECUTE_CREATE_FAILED';
22305
    D3DERR_EXECUTE_CREATE_FAILED: Result := 'D3DERR_EXECUTE_CREATE_FAILED';
22302
    D3DERR_EXECUTE_DESTROY_FAILED: Result := 'D3DERR_EXECUTE_DESTROY_FAILED';
22306
    D3DERR_EXECUTE_DESTROY_FAILED: Result := 'D3DERR_EXECUTE_DESTROY_FAILED';
22303
    D3DERR_EXECUTE_LOCK_FAILED: Result := 'D3DERR_EXECUTE_LOCK_FAILED';
22307
    D3DERR_EXECUTE_LOCK_FAILED: Result := 'D3DERR_EXECUTE_LOCK_FAILED';
22304
    D3DERR_EXECUTE_UNLOCK_FAILED: Result := 'D3DERR_EXECUTE_UNLOCK_FAILED';
22308
    D3DERR_EXECUTE_UNLOCK_FAILED: Result := 'D3DERR_EXECUTE_UNLOCK_FAILED';
22305
    D3DERR_EXECUTE_LOCKED: Result := 'D3DERR_EXECUTE_LOCKED';
22309
    D3DERR_EXECUTE_LOCKED: Result := 'D3DERR_EXECUTE_LOCKED';
22306
    D3DERR_EXECUTE_NOT_LOCKED: Result := 'D3DERR_EXECUTE_NOT_LOCKED';
22310
    D3DERR_EXECUTE_NOT_LOCKED: Result := 'D3DERR_EXECUTE_NOT_LOCKED';
22307
 
22311
 
22308
    D3DERR_EXECUTE_FAILED: Result := 'D3DERR_EXECUTE_FAILED';
22312
    D3DERR_EXECUTE_FAILED: Result := 'D3DERR_EXECUTE_FAILED';
22309
    D3DERR_EXECUTE_CLIPPED_FAILED: Result := 'D3DERR_EXECUTE_CLIPPED_FAILED';
22313
    D3DERR_EXECUTE_CLIPPED_FAILED: Result := 'D3DERR_EXECUTE_CLIPPED_FAILED';
22310
 
22314
 
22311
    D3DERR_TEXTURE_NO_SUPPORT: Result := 'D3DERR_TEXTURE_NO_SUPPORT';
22315
    D3DERR_TEXTURE_NO_SUPPORT: Result := 'D3DERR_TEXTURE_NO_SUPPORT';
22312
    D3DERR_TEXTURE_CREATE_FAILED: Result := 'D3DERR_TEXTURE_CREATE_FAILED';
22316
    D3DERR_TEXTURE_CREATE_FAILED: Result := 'D3DERR_TEXTURE_CREATE_FAILED';
22313
    D3DERR_TEXTURE_DESTROY_FAILED: Result := 'D3DERR_TEXTURE_DESTROY_FAILED';
22317
    D3DERR_TEXTURE_DESTROY_FAILED: Result := 'D3DERR_TEXTURE_DESTROY_FAILED';
22314
    D3DERR_TEXTURE_LOCK_FAILED: Result := 'D3DERR_TEXTURE_LOCK_FAILED';
22318
    D3DERR_TEXTURE_LOCK_FAILED: Result := 'D3DERR_TEXTURE_LOCK_FAILED';
22315
    D3DERR_TEXTURE_UNLOCK_FAILED: Result := 'D3DERR_TEXTURE_UNLOCK_FAILED';
22319
    D3DERR_TEXTURE_UNLOCK_FAILED: Result := 'D3DERR_TEXTURE_UNLOCK_FAILED';
22316
    D3DERR_TEXTURE_LOAD_FAILED: Result := 'D3DERR_TEXTURE_LOAD_FAILED';
22320
    D3DERR_TEXTURE_LOAD_FAILED: Result := 'D3DERR_TEXTURE_LOAD_FAILED';
22317
    D3DERR_TEXTURE_SWAP_FAILED: Result := 'D3DERR_TEXTURE_SWAP_FAILED';
22321
    D3DERR_TEXTURE_SWAP_FAILED: Result := 'D3DERR_TEXTURE_SWAP_FAILED';
22318
    D3DERR_TEXTURE_LOCKED: Result := 'D3DERR_TEXTURELOCKED';
22322
    D3DERR_TEXTURE_LOCKED: Result := 'D3DERR_TEXTURELOCKED';
22319
    D3DERR_TEXTURE_NOT_LOCKED: Result := 'D3DERR_TEXTURE_NOT_LOCKED';
22323
    D3DERR_TEXTURE_NOT_LOCKED: Result := 'D3DERR_TEXTURE_NOT_LOCKED';
22320
    D3DERR_TEXTURE_GETSURF_FAILED: Result := 'D3DERR_TEXTURE_GETSURF_FAILED';
22324
    D3DERR_TEXTURE_GETSURF_FAILED: Result := 'D3DERR_TEXTURE_GETSURF_FAILED';
22321
 
22325
 
22322
    D3DERR_MATRIX_CREATE_FAILED: Result := 'D3DERR_MATRIX_CREATE_FAILED';
22326
    D3DERR_MATRIX_CREATE_FAILED: Result := 'D3DERR_MATRIX_CREATE_FAILED';
22323
    D3DERR_MATRIX_DESTROY_FAILED: Result := 'D3DERR_MATRIX_DESTROY_FAILED';
22327
    D3DERR_MATRIX_DESTROY_FAILED: Result := 'D3DERR_MATRIX_DESTROY_FAILED';
22324
    D3DERR_MATRIX_SETDATA_FAILED: Result := 'D3DERR_MATRIX_SETDATA_FAILED';
22328
    D3DERR_MATRIX_SETDATA_FAILED: Result := 'D3DERR_MATRIX_SETDATA_FAILED';
22325
    D3DERR_MATRIX_GETDATA_FAILED: Result := 'D3DERR_MATRIX_GETDATA_FAILED';
22329
    D3DERR_MATRIX_GETDATA_FAILED: Result := 'D3DERR_MATRIX_GETDATA_FAILED';
22326
    D3DERR_SETVIEWPORTDATA_FAILED: Result := 'D3DERR_SETVIEWPORTDATA_FAILED';
22330
    D3DERR_SETVIEWPORTDATA_FAILED: Result := 'D3DERR_SETVIEWPORTDATA_FAILED';
22327
 
22331
 
22328
    D3DERR_INVALIDCURRENTVIEWPORT: Result := 'D3DERR_INVALIDCURRENTVIEWPORT';
22332
    D3DERR_INVALIDCURRENTVIEWPORT: Result := 'D3DERR_INVALIDCURRENTVIEWPORT';
22329
    D3DERR_INVALIDPRIMITIVETYPE: Result := 'D3DERR_INVALIDPRIMITIVETYPE';
22333
    D3DERR_INVALIDPRIMITIVETYPE: Result := 'D3DERR_INVALIDPRIMITIVETYPE';
22330
    D3DERR_INVALIDVERTEXTYPE: Result := 'D3DERR_INVALIDVERTEXTYPE';
22334
    D3DERR_INVALIDVERTEXTYPE: Result := 'D3DERR_INVALIDVERTEXTYPE';
22331
    D3DERR_TEXTURE_BADSIZE: Result := 'D3DERR_TEXTURE_BADSIZE';
22335
    D3DERR_TEXTURE_BADSIZE: Result := 'D3DERR_TEXTURE_BADSIZE';
22332
    D3DERR_INVALIDRAMPTEXTURE: Result := 'D3DERR_INVALIDRAMPTEXTURE';
22336
    D3DERR_INVALIDRAMPTEXTURE: Result := 'D3DERR_INVALIDRAMPTEXTURE';
22333
 
22337
 
22334
    D3DERR_MATERIAL_CREATE_FAILED: Result := 'D3DERR_MATERIAL_CREATE_FAILED';
22338
    D3DERR_MATERIAL_CREATE_FAILED: Result := 'D3DERR_MATERIAL_CREATE_FAILED';
22335
    D3DERR_MATERIAL_DESTROY_FAILED: Result := 'D3DERR_MATERIAL_DESTROY_FAILED';
22339
    D3DERR_MATERIAL_DESTROY_FAILED: Result := 'D3DERR_MATERIAL_DESTROY_FAILED';
22336
    D3DERR_MATERIAL_SETDATA_FAILED: Result := 'D3DERR_MATERIAL_SETDATA_FAILED';
22340
    D3DERR_MATERIAL_SETDATA_FAILED: Result := 'D3DERR_MATERIAL_SETDATA_FAILED';
22337
    D3DERR_MATERIAL_GETDATA_FAILED: Result := 'D3DERR_MATERIAL_GETDATA_FAILED';
22341
    D3DERR_MATERIAL_GETDATA_FAILED: Result := 'D3DERR_MATERIAL_GETDATA_FAILED';
22338
 
22342
 
22339
    D3DERR_INVALIDPALETTE: Result := 'D3DERR_INVALIDPALETTE';
22343
    D3DERR_INVALIDPALETTE: Result := 'D3DERR_INVALIDPALETTE';
22340
 
22344
 
22341
    D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY: Result := 'D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY';
22345
    D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY: Result := 'D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY';
22342
    D3DERR_ZBUFF_NEEDS_VIDEOMEMORY: Result := 'D3DERR_ZBUFF_NEEDS_VIDEOMEMORY';
22346
    D3DERR_ZBUFF_NEEDS_VIDEOMEMORY: Result := 'D3DERR_ZBUFF_NEEDS_VIDEOMEMORY';
22343
    D3DERR_SURFACENOTINVIDMEM: Result := 'D3DERR_SURFACENOTINVIDMEM';
22347
    D3DERR_SURFACENOTINVIDMEM: Result := 'D3DERR_SURFACENOTINVIDMEM';
22344
 
22348
 
22345
    D3DERR_LIGHT_SET_FAILED: Result := 'D3DERR_LIGHT_SET_FAILED';
22349
    D3DERR_LIGHT_SET_FAILED: Result := 'D3DERR_LIGHT_SET_FAILED';
22346
    D3DERR_LIGHTHASVIEWPORT: Result := 'D3DERR_LIGHTHASVIEWPORT';
22350
    D3DERR_LIGHTHASVIEWPORT: Result := 'D3DERR_LIGHTHASVIEWPORT';
22347
    D3DERR_LIGHTNOTINTHISVIEWPORT: Result := 'D3DERR_LIGHTNOTINTHISVIEWPORT';
22351
    D3DERR_LIGHTNOTINTHISVIEWPORT: Result := 'D3DERR_LIGHTNOTINTHISVIEWPORT';
22348
 
22352
 
22349
    D3DERR_SCENE_IN_SCENE: Result := 'D3DERR_SCENE_IN_SCENE';
22353
    D3DERR_SCENE_IN_SCENE: Result := 'D3DERR_SCENE_IN_SCENE';
22350
    D3DERR_SCENE_NOT_IN_SCENE: Result := 'D3DERR_SCENE_NOT_IN_SCENE';
22354
    D3DERR_SCENE_NOT_IN_SCENE: Result := 'D3DERR_SCENE_NOT_IN_SCENE';
22351
    D3DERR_SCENE_BEGIN_FAILED: Result := 'D3DERR_SCENE_BEGIN_FAILED';
22355
    D3DERR_SCENE_BEGIN_FAILED: Result := 'D3DERR_SCENE_BEGIN_FAILED';
22352
    D3DERR_SCENE_END_FAILED: Result := 'D3DERR_SCENE_END_FAILED';
22356
    D3DERR_SCENE_END_FAILED: Result := 'D3DERR_SCENE_END_FAILED';
22353
 
22357
 
22354
    D3DERR_INBEGIN: Result := 'D3DERR_INBEGIN';
22358
    D3DERR_INBEGIN: Result := 'D3DERR_INBEGIN';
22355
    D3DERR_NOTINBEGIN: Result := 'D3DERR_NOTINBEGIN';
22359
    D3DERR_NOTINBEGIN: Result := 'D3DERR_NOTINBEGIN';
22356
    D3DERR_NOVIEWPORTS: Result := 'D3DERR_NOVIEWPORTS';
22360
    D3DERR_NOVIEWPORTS: Result := 'D3DERR_NOVIEWPORTS';
22357
    D3DERR_VIEWPORTDATANOTSET: Result := 'D3DERR_VIEWPORTDATANOTSET';
22361
    D3DERR_VIEWPORTDATANOTSET: Result := 'D3DERR_VIEWPORTDATANOTSET';
22358
    D3DERR_VIEWPORTHASNODEVICE: Result := 'D3DERR_VIEWPORTHASNODEVICE';
22362
    D3DERR_VIEWPORTHASNODEVICE: Result := 'D3DERR_VIEWPORTHASNODEVICE';
22359
    D3DERR_NOCURRENTVIEWPORT: Result := 'D3DERR_NOCURRENTVIEWPORT';
22363
    D3DERR_NOCURRENTVIEWPORT: Result := 'D3DERR_NOCURRENTVIEWPORT';
22360
 
22364
 
22361
    D3DERR_INVALIDVERTEXFORMAT: Result := 'D3DERR_INVALIDVERTEXFORMAT';
22365
    D3DERR_INVALIDVERTEXFORMAT: Result := 'D3DERR_INVALIDVERTEXFORMAT';
22362
 
22366
 
22363
    D3DERR_COLORKEYATTACHED: Result := 'D3DERR_COLORKEYATTACHED';
22367
    D3DERR_COLORKEYATTACHED: Result := 'D3DERR_COLORKEYATTACHED';
22364
 
22368
 
22365
    D3DERR_VERTEXBUFFEROPTIMIZED: Result := 'D3DERR_VERTEXBUFFEROPTIMIZED';
22369
    D3DERR_VERTEXBUFFEROPTIMIZED: Result := 'D3DERR_VERTEXBUFFEROPTIMIZED';
22366
    D3DERR_VBUF_CREATE_FAILED: Result := 'D3DERR_VBUF_CREATE_FAILED';
22370
    D3DERR_VBUF_CREATE_FAILED: Result := 'D3DERR_VBUF_CREATE_FAILED';
22367
    D3DERR_VERTEXBUFFERLOCKED: Result := 'D3DERR_VERTEXBUFFERLOCKED';
22371
    D3DERR_VERTEXBUFFERLOCKED: Result := 'D3DERR_VERTEXBUFFERLOCKED';
22368
 
22372
 
22369
    D3DERR_ZBUFFER_NOTPRESENT: Result := 'D3DERR_ZBUFFER_NOTPRESENT';
22373
    D3DERR_ZBUFFER_NOTPRESENT: Result := 'D3DERR_ZBUFFER_NOTPRESENT';
22370
    D3DERR_STENCILBUFFER_NOTPRESENT: Result := 'D3DERR_STENCILBUFFER_NOTPRESENT';
22374
    D3DERR_STENCILBUFFER_NOTPRESENT: Result := 'D3DERR_STENCILBUFFER_NOTPRESENT';
22371
 
22375
 
22372
    D3DERR_WRONGTEXTUREFORMAT: Result := 'D3DERR_WRONGTEXTUREFORMAT';
22376
    D3DERR_WRONGTEXTUREFORMAT: Result := 'D3DERR_WRONGTEXTUREFORMAT';
22373
    D3DERR_UNSUPPORTEDCOLOROPERATION: Result := 'D3DERR_UNSUPPORTEDCOLOROPERATION';
22377
    D3DERR_UNSUPPORTEDCOLOROPERATION: Result := 'D3DERR_UNSUPPORTEDCOLOROPERATION';
22374
    D3DERR_UNSUPPORTEDCOLORARG: Result := 'D3DERR_UNSUPPORTEDCOLORARG';
22378
    D3DERR_UNSUPPORTEDCOLORARG: Result := 'D3DERR_UNSUPPORTEDCOLORARG';
22375
    D3DERR_UNSUPPORTEDALPHAOPERATION: Result := 'D3DERR_UNSUPPORTEDALPHAOPERATION';
22379
    D3DERR_UNSUPPORTEDALPHAOPERATION: Result := 'D3DERR_UNSUPPORTEDALPHAOPERATION';
22376
    D3DERR_UNSUPPORTEDALPHAARG: Result := 'D3DERR_UNSUPPORTEDALPHAARG';
22380
    D3DERR_UNSUPPORTEDALPHAARG: Result := 'D3DERR_UNSUPPORTEDALPHAARG';
22377
    D3DERR_TOOMANYOPERATIONS: Result := 'D3DERR_TOOMANYOPERATIONS';
22381
    D3DERR_TOOMANYOPERATIONS: Result := 'D3DERR_TOOMANYOPERATIONS';
22378
    D3DERR_CONFLICTINGTEXTUREFILTER: Result := 'D3DERR_CONFLICTINGTEXTUREFILTER';
22382
    D3DERR_CONFLICTINGTEXTUREFILTER: Result := 'D3DERR_CONFLICTINGTEXTUREFILTER';
22379
    D3DERR_UNSUPPORTEDFACTORVALUE: Result := 'D3DERR_UNSUPPORTEDFACTORVALUE';
22383
    D3DERR_UNSUPPORTEDFACTORVALUE: Result := 'D3DERR_UNSUPPORTEDFACTORVALUE';
22380
 
22384
 
22381
    D3DERR_CONFLICTINGRENDERSTATE: Result := 'D3DERR_CONFLICTINGRENDERSTATE';
22385
    D3DERR_CONFLICTINGRENDERSTATE: Result := 'D3DERR_CONFLICTINGRENDERSTATE';
22382
    D3DERR_UNSUPPORTEDTEXTUREFILTER: Result := 'D3DERR_UNSUPPORTEDTEXTUREFILTER';
22386
    D3DERR_UNSUPPORTEDTEXTUREFILTER: Result := 'D3DERR_UNSUPPORTEDTEXTUREFILTER';
22383
    D3DERR_TOOMANYPRIMITIVES: Result := 'D3DERR_TOOMANYPRIMITIVES';
22387
    D3DERR_TOOMANYPRIMITIVES: Result := 'D3DERR_TOOMANYPRIMITIVES';
22384
    D3DERR_INVALIDMATRIX: Result := 'D3DERR_INVALIDMATRIX';
22388
    D3DERR_INVALIDMATRIX: Result := 'D3DERR_INVALIDMATRIX';
22385
    D3DERR_TOOMANYVERTICES: Result := 'D3DERR_TOOMANYVERTICES';
22389
    D3DERR_TOOMANYVERTICES: Result := 'D3DERR_TOOMANYVERTICES';
22386
    D3DERR_CONFLICTINGTEXTUREPALETTE: Result := 'D3DERR_CONFLICTINGTEXTUREPALETTE';
22390
    D3DERR_CONFLICTINGTEXTUREPALETTE: Result := 'D3DERR_CONFLICTINGTEXTUREPALETTE';
22387
 
22391
 
22388
    else Result := 'Unrecognized Error';
22392
    else Result := 'Unrecognized Error';
22389
  end;
22393
  end;
22390
end;
22394
end;
22391
{$IFDEF D3DRM}
22395
{$IFDEF D3DRM}
22392
//Direct3DRM file
22396
//Direct3DRM file
22393
 
22397
 
22394
(*==========================================================================;
22398
(*==========================================================================;
22395
 *
22399
 *
22396
 *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
22400
 *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
22397
 *
22401
 *
22398
 *  File:       d3drmdef.h
22402
 *  File:       d3drmdef.h
22399
 *  Content:    Direct3DRM include file
22403
 *  Content:    Direct3DRM include file
22400
 *
22404
 *
22401
 ***************************************************************************)
22405
 ***************************************************************************)
22402
 
22406
 
22403
procedure D3DRMAnimationGetRotateKey
22407
procedure D3DRMAnimationGetRotateKey
22404
    (var rmKey: TD3DRMAnimationKey; var rmQuat: TD3DRMQuaternion);
22408
    (var rmKey: TD3DRMAnimationKey; var rmQuat: TD3DRMQuaternion);
22405
begin
22409
begin
22406
  rmQuat := rmKey.dqRotateKey;
22410
  rmQuat := rmKey.dqRotateKey;
22407
end;
22411
end;
22408
 
22412
 
22409
procedure D3DRMAnimationGetScaleKey
22413
procedure D3DRMAnimationGetScaleKey
22410
    (var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
22414
    (var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
22411
begin
22415
begin
22412
  dvVec := rmKey.dvScaleKey;
22416
  dvVec := rmKey.dvScaleKey;
22413
end;
22417
end;
22414
 
22418
 
22415
procedure D3DRMAnimationGetPositionKey
22419
procedure D3DRMAnimationGetPositionKey
22416
    (var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
22420
    (var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
22417
begin
22421
begin
22418
  dvVec := rmKey.dvPositionKey;
22422
  dvVec := rmKey.dvPositionKey;
22419
end;
22423
end;
22420
 
22424
 
22421
procedure D3DRMAnimatioSetRotateKey
22425
procedure D3DRMAnimatioSetRotateKey
22422
    (var rmKey: TD3DRMAnimationKey; var rmQuat: TD3DRMQuaternion);
22426
    (var rmKey: TD3DRMAnimationKey; var rmQuat: TD3DRMQuaternion);
22423
begin
22427
begin
22424
  rmKey.dqRotateKey := rmQuat;
22428
  rmKey.dqRotateKey := rmQuat;
22425
end;
22429
end;
22426
 
22430
 
22427
procedure D3DRMAnimationSetScaleKey
22431
procedure D3DRMAnimationSetScaleKey
22428
    (var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
22432
    (var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
22429
begin
22433
begin
22430
  rmKey.dvScaleKey := dvVec;
22434
  rmKey.dvScaleKey := dvVec;
22431
end;
22435
end;
22432
 
22436
 
22433
procedure D3DRMAnimationSetPositionKey
22437
procedure D3DRMAnimationSetPositionKey
22434
    (var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
22438
    (var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
22435
begin
22439
begin
22436
  rmKey.dvPositionKey := dvVec;
22440
  rmKey.dvPositionKey := dvVec;
22437
end;
22441
end;
22438
 
22442
 
22439
(*==========================================================================;
22443
(*==========================================================================;
22440
 *
22444
 *
22441
 *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
22445
 *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
22442
 *
22446
 *
22443
 *  File:       d3drm.h
22447
 *  File:       d3drm.h
22444
 *  Content:    Direct3DRM include file
22448
 *  Content:    Direct3DRM include file
22445
 *
22449
 *
22446
 ***************************************************************************)
22450
 ***************************************************************************)
22447
 
22451
 
22448
function D3DRMErrorString(Value: HResult) : string;
22452
function D3DRMErrorString(Value: HResult) : string;
22449
begin
22453
begin
22450
  case Value of
22454
  case Value of
22451
    D3DRM_OK: Result := 'No error. Equivalent to DD_OK.';
22455
    D3DRM_OK: Result := 'No error. Equivalent to DD_OK.';
22452
    D3DRMERR_BADALLOC: Result := 'Out of memory.';
22456
    D3DRMERR_BADALLOC: Result := 'Out of memory.';
22453
    D3DRMERR_BADDEVICE: Result := 'Device is not compatible with renderer.';
22457
    D3DRMERR_BADDEVICE: Result := 'Device is not compatible with renderer.';
22454
    D3DRMERR_BADFILE: Result := 'Data file is corrupt.';
22458
    D3DRMERR_BADFILE: Result := 'Data file is corrupt.';
22455
    D3DRMERR_BADMAJORVERSION: Result := 'Bad DLL major version.';
22459
    D3DRMERR_BADMAJORVERSION: Result := 'Bad DLL major version.';
22456
    D3DRMERR_BADMINORVERSION: Result := 'Bad DLL minor version.';
22460
    D3DRMERR_BADMINORVERSION: Result := 'Bad DLL minor version.';
22457
    D3DRMERR_BADOBJECT: Result := 'Object expected in argument.';
22461
    D3DRMERR_BADOBJECT: Result := 'Object expected in argument.';
22458
    D3DRMERR_BADPMDATA: Result := 'The data in the .x file is corrupted. The conversion to a progressive mesh succeeded but produced an invalid progressive mesh in the .x file.';
22462
    D3DRMERR_BADPMDATA: Result := 'The data in the .x file is corrupted. The conversion to a progressive mesh succeeded but produced an invalid progressive mesh in the .x file.';
22459
    D3DRMERR_BADTYPE: Result := 'Bad argument type passed.';
22463
    D3DRMERR_BADTYPE: Result := 'Bad argument type passed.';
22460
    D3DRMERR_BADVALUE: Result := 'Bad argument value passed.';
22464
    D3DRMERR_BADVALUE: Result := 'Bad argument value passed.';
22461
    D3DRMERR_BOXNOTSET: Result := 'An attempt was made to access a bounding box (for example, with IDirect3DRMFrame3::GetBox) when no bounding box was set on the frame.';
22465
    D3DRMERR_BOXNOTSET: Result := 'An attempt was made to access a bounding box (for example, with IDirect3DRMFrame3::GetBox) when no bounding box was set on the frame.';
22462
    D3DRMERR_CLIENTNOTREGISTERED: Result := 'Client has not been registered. Call IDirect3DRM3::RegisterClient.';
22466
    D3DRMERR_CLIENTNOTREGISTERED: Result := 'Client has not been registered. Call IDirect3DRM3::RegisterClient.';
22463
    D3DRMERR_CONNECTIONLOST: Result := 'Data connection was lost during a load, clone, or duplicate.';
22467
    D3DRMERR_CONNECTIONLOST: Result := 'Data connection was lost during a load, clone, or duplicate.';
22464
    D3DRMERR_ELEMENTINUSE: Result := 'Element can´t be modified or deleted while in use. To empty a submesh, call Empty() against its parent.';
22468
    D3DRMERR_ELEMENTINUSE: Result := 'Element can´t be modified or deleted while in use. To empty a submesh, call Empty() against its parent.';
22465
//    D3DRMERR_ENTRYINUSE: Result := 'Vertex or normal entries are currently in use by a face and cannot be deleted.';
22469
//    D3DRMERR_ENTRYINUSE: Result := 'Vertex or normal entries are currently in use by a face and cannot be deleted.';
22466
    D3DRMERR_FACEUSED: Result := 'Face already used in a mesh.';
22470
    D3DRMERR_FACEUSED: Result := 'Face already used in a mesh.';
22467
    D3DRMERR_FILENOTFOUND: Result := 'File cannot be opened.';
22471
    D3DRMERR_FILENOTFOUND: Result := 'File cannot be opened.';
22468
//    D3DRMERR_INCOMPATIBLEKEY: Result := 'Specified animation key is incompatible. The key cannot be modified.';
22472
//    D3DRMERR_INCOMPATIBLEKEY: Result := 'Specified animation key is incompatible. The key cannot be modified.';
22469
    D3DRMERR_INVALIDLIBRARY: Result := 'Specified libary is invalid.';
22473
    D3DRMERR_INVALIDLIBRARY: Result := 'Specified libary is invalid.';
22470
//    D3DRMERR_INVALIDOBJECT: Result := 'Method received a pointer to an object that is invalid.';
22474
//    D3DRMERR_INVALIDOBJECT: Result := 'Method received a pointer to an object that is invalid.';
22471
//    D3DRMERR_INVALIDPARAMS: Result := 'One of the parameters passed to the method is invalid.';
22475
//    D3DRMERR_INVALIDPARAMS: Result := 'One of the parameters passed to the method is invalid.';
22472
    D3DRMERR_LIBRARYNOTFOUND: Result := 'Specified libary not found.';
22476
    D3DRMERR_LIBRARYNOTFOUND: Result := 'Specified libary not found.';
22473
    D3DRMERR_LOADABORTED: Result := 'Load aborted by user.';
22477
    D3DRMERR_LOADABORTED: Result := 'Load aborted by user.';
22474
    D3DRMERR_NOSUCHKEY: Result := 'Specified animation key does not exist.';
22478
    D3DRMERR_NOSUCHKEY: Result := 'Specified animation key does not exist.';
22475
    D3DRMERR_NOTCREATEDFROMDDS: Result := 'Specified texture was not created from a DirectDraw Surface.';
22479
    D3DRMERR_NOTCREATEDFROMDDS: Result := 'Specified texture was not created from a DirectDraw Surface.';
22476
    D3DRMERR_NOTDONEYET: Result := 'Unimplemented.';
22480
    D3DRMERR_NOTDONEYET: Result := 'Unimplemented.';
22477
    D3DRMERR_NOTENOUGHDATA: Result := 'Not enough data has been loaded to perform the requested operation.';
22481
    D3DRMERR_NOTENOUGHDATA: Result := 'Not enough data has been loaded to perform the requested operation.';
22478
    D3DRMERR_NOTFOUND: Result := 'Object not found in specified place.';
22482
    D3DRMERR_NOTFOUND: Result := 'Object not found in specified place.';
22479
//    D3DRMERR_OUTOFRANGE: Result := 'Specified value is out of range.';
22483
//    D3DRMERR_OUTOFRANGE: Result := 'Specified value is out of range.';
22480
    D3DRMERR_PENDING: Result := 'Data required to supply the requested information has not finished loading.';
22484
    D3DRMERR_PENDING: Result := 'Data required to supply the requested information has not finished loading.';
22481
    D3DRMERR_REQUESTTOOLARGE: Result := 'Attempt was made to set a level of detail in a progressive mesh greater than the maximum available.';
22485
    D3DRMERR_REQUESTTOOLARGE: Result := 'Attempt was made to set a level of detail in a progressive mesh greater than the maximum available.';
22482
    D3DRMERR_REQUESTTOOSMALL: Result := 'Attempt was made to set the minimum rendering detail of a progressive mesh smaller than the detail in the base mesh (the minimum for rendering).';
22486
    D3DRMERR_REQUESTTOOSMALL: Result := 'Attempt was made to set the minimum rendering detail of a progressive mesh smaller than the detail in the base mesh (the minimum for rendering).';
22483
    D3DRMERR_TEXTUREFORMATNOTFOUND: Result := 'Texture format could not be found that meets the specified criteria and that the underlying Immediate Mode device supports.';
22487
    D3DRMERR_TEXTUREFORMATNOTFOUND: Result := 'Texture format could not be found that meets the specified criteria and that the underlying Immediate Mode device supports.';
22484
    D3DRMERR_UNABLETOEXECUTE: Result := 'Unable to carry out procedure.';
22488
    D3DRMERR_UNABLETOEXECUTE: Result := 'Unable to carry out procedure.';
22485
    DDERR_INVALIDOBJECT: Result := 'Received pointer that was an invalid object.';
22489
    DDERR_INVALIDOBJECT: Result := 'Received pointer that was an invalid object.';
22486
    DDERR_INVALIDPARAMS: Result := 'One or more of the parameters passed to the method are incorrect.';
22490
    DDERR_INVALIDPARAMS: Result := 'One or more of the parameters passed to the method are incorrect.';
22487
    DDERR_NOTFOUND: Result := 'The requested item was not found.';
22491
    DDERR_NOTFOUND: Result := 'The requested item was not found.';
22488
    DDERR_NOTINITIALIZED: Result := 'An attempt was made to call an interface method of an object created by CoCreateInstance before the object was initialized.';
22492
    DDERR_NOTINITIALIZED: Result := 'An attempt was made to call an interface method of an object created by CoCreateInstance before the object was initialized.';
22489
    DDERR_OUTOFMEMORY: Result := 'DirectDraw does not have enough memory to perform the operation.';
22493
    DDERR_OUTOFMEMORY: Result := 'DirectDraw does not have enough memory to perform the operation.';
22490
    else Result := 'Unrecognized Error';
22494
    else Result := 'Unrecognized Error';
22491
  end;
22495
  end;
22492
end;
22496
end;
22493
{$ENDIF}
22497
{$ENDIF}
22494
//DirectInput file
22498
//DirectInput file
22495
 
22499
 
22496
 
22500
 
22497
function DIMAKEUSAGEDWORD(UsagePage, Usage: WORD) : DWORD;
22501
function DIMAKEUSAGEDWORD(UsagePage, Usage: WORD) : DWORD;
22498
begin
22502
begin
22499
  Result := Usage or (UsagePage shl 16);
22503
  Result := Usage or (UsagePage shl 16);
22500
end;
22504
end;
22501
 
22505
 
22502
 
22506
 
22503
function DIEFT_GETTYPE(n: variant) : byte;
22507
function DIEFT_GETTYPE(n: variant) : byte;
22504
begin
22508
begin
22505
  Result := byte(n);
22509
  Result := byte(n);
22506
end;
22510
end;
22507
 
22511
 
22508
function GET_DIDEVICE_TYPE(dwDevType: variant) : byte;
22512
function GET_DIDEVICE_TYPE(dwDevType: variant) : byte;
22509
begin
22513
begin
22510
  Result := byte(dwDevType);
22514
  Result := byte(dwDevType);
22511
end;
22515
end;
22512
 
22516
 
22513
function GET_DIDEVICE_SUBTYPE(dwDevType: variant) : byte;
22517
function GET_DIDEVICE_SUBTYPE(dwDevType: variant) : byte;
22514
begin
22518
begin
22515
  Result := hi(word(dwDevType));
22519
  Result := hi(word(dwDevType));
22516
end;
22520
end;
22517
 
22521
 
22518
function DIDFT_MAKEINSTANCE(n: variant) : DWORD;
22522
function DIDFT_MAKEINSTANCE(n: variant) : DWORD;
22519
begin
22523
begin
22520
  Result := word(n) shl 8;
22524
  Result := word(n) shl 8;
22521
end;
22525
end;
22522
 
22526
 
22523
function DIDFT_GETTYPE(n: variant) : byte;
22527
function DIDFT_GETTYPE(n: variant) : byte;
22524
begin
22528
begin
22525
  Result := byte(n);
22529
  Result := byte(n);
22526
end;
22530
end;
22527
 
22531
 
22528
function DIDFT_GETINSTANCE(n: variant) : DWORD;
22532
function DIDFT_GETINSTANCE(n: variant) : DWORD;
22529
begin
22533
begin
22530
  Result := word(n) shr 8;
22534
  Result := word(n) shr 8;
22531
end;
22535
end;
22532
 
22536
 
22533
function DIDFT_ENUMCOLLECTION(n: variant) : DWORD;
22537
function DIDFT_ENUMCOLLECTION(n: variant) : DWORD;
22534
begin
22538
begin
22535
  Result := word(n) shl 8;
22539
  Result := word(n) shl 8;
22536
end;
22540
end;
22537
 
22541
 
22538
function DIJOFS_SLIDER(n: variant) : variant;
22542
function DIJOFS_SLIDER(n: variant) : variant;
22539
begin
22543
begin
22540
  Result := n * 4 + 24;
22544
  Result := n * 4 + 24;
22541
end;
22545
end;
22542
 
22546
 
22543
function DIJOFS_POV(n: variant) : variant;
22547
function DIJOFS_POV(n: variant) : variant;
22544
begin
22548
begin
22545
  Result := n * 4 + 32;
22549
  Result := n * 4 + 32;
22546
end;
22550
end;
22547
 
22551
 
22548
function DIJOFS_BUTTON(n: variant) : variant;
22552
function DIJOFS_BUTTON(n: variant) : variant;
22549
begin
22553
begin
22550
  Result := 48 + n;
22554
  Result := 48 + n;
22551
end;
22555
end;
22552
 
22556
 
22553
function DIErrorString(Value: HResult) : string;
22557
function DIErrorString(Value: HResult) : string;
22554
var
22558
var
22555
  sValue: array[0..255] of char;
22559
  sValue: array[0..255] of char;
22556
begin
22560
begin
22557
  case Value of
22561
  case Value of
22558
    DI_OK: Result := 'The operation completed successfully.';
22562
    DI_OK: Result := 'The operation completed successfully.';
22559
    S_FALSE: Result := '"The operation had no effect." or "The device buffer overflowed and some input was lost." or "The device exists but is not currently attached." or "The change in device properties had no effect."';
22563
    S_FALSE: Result := '"The operation had no effect." or "The device buffer overflowed and some input was lost." or "The device exists but is not currently attached." or "The change in device properties had no effect."';
22560
//    DI_BUFFEROVERFLOW: Result := 'The device buffer overflowed and some input was lost. This value is equal to the S_FALSE standard COM return value.';
22564
//    DI_BUFFEROVERFLOW: Result := 'The device buffer overflowed and some input was lost. This value is equal to the S_FALSE standard COM return value.';
22561
    DI_DOWNLOADSKIPPED: Result := 'The parameters of the effect were successfully updated, but the effect could not be downloaded because the associated device was not acquired in exclusive mode.';
22565
    DI_DOWNLOADSKIPPED: Result := 'The parameters of the effect were successfully updated, but the effect could not be downloaded because the associated device was not acquired in exclusive mode.';
22562
    DI_EFFECTRESTARTED: Result := 'The effect was stopped, the parameters were updated, and the effect was restarted.';
22566
    DI_EFFECTRESTARTED: Result := 'The effect was stopped, the parameters were updated, and the effect was restarted.';
22563
//    DI_NOEFFECT: Result := 'The operation had no effect. This value is equal to the S_FALSE standard COM return value.';
22567
//    DI_NOEFFECT: Result := 'The operation had no effect. This value is equal to the S_FALSE standard COM return value.';
22564
//    DI_NOTATTACHED: Result := 'The device exists but is not currently attached. This value is equal to the S_FALSE standard COM return value.';
22568
//    DI_NOTATTACHED: Result := 'The device exists but is not currently attached. This value is equal to the S_FALSE standard COM return value.';
22565
    DI_POLLEDDEVICE: Result := 'The device is a polled device. As a result, device buffering will not collect any data and event notifications will not be signaled until the IDirectInputDevice2::Poll method is called.';
22569
    DI_POLLEDDEVICE: Result := 'The device is a polled device. As a result, device buffering will not collect any data and event notifications will not be signaled until the IDirectInputDevice2::Poll method is called.';
22566
//    DI_PROPNOEFFECT: Result := 'The change in device properties had no effect. This value is equal to the S_FALSE standard COM return value.';
22570
//    DI_PROPNOEFFECT: Result := 'The change in device properties had no effect. This value is equal to the S_FALSE standard COM return value.';
22567
    DI_TRUNCATED: Result := 'The parameters of the effect were successfully updated, but some of them were beyond the capabilities of the device and were truncated to the nearest supported value.';
22571
    DI_TRUNCATED: Result := 'The parameters of the effect were successfully updated, but some of them were beyond the capabilities of the device and were truncated to the nearest supported value.';
22568
    DI_TRUNCATEDANDRESTARTED: Result := 'Equal to DI_EFFECTRESTARTED | DI_TRUNCATED.';
22572
    DI_TRUNCATEDANDRESTARTED: Result := 'Equal to DI_EFFECTRESTARTED | DI_TRUNCATED.';
22569
    DIERR_ACQUIRED: Result := 'The operation cannot be performed while the device is acquired.';
22573
    DIERR_ACQUIRED: Result := 'The operation cannot be performed while the device is acquired.';
22570
    DIERR_ALREADYINITIALIZED: Result := 'This object is already initialized';
22574
    DIERR_ALREADYINITIALIZED: Result := 'This object is already initialized';
22571
    DIERR_BADDRIVERVER: Result := 'The object could not be created due to an incompatible driver version or mismatched or incomplete driver components.';
22575
    DIERR_BADDRIVERVER: Result := 'The object could not be created due to an incompatible driver version or mismatched or incomplete driver components.';
22572
    DIERR_BETADIRECTINPUTVERSION: Result := 'The application was written for an unsupported prerelease version of DirectInput.';
22576
    DIERR_BETADIRECTINPUTVERSION: Result := 'The application was written for an unsupported prerelease version of DirectInput.';
22573
    DIERR_DEVICEFULL: Result := 'The device is full.';
22577
    DIERR_DEVICEFULL: Result := 'The device is full.';
22574
    DIERR_DEVICENOTREG: Result := 'The device or device instance is not registered with DirectInput. This value is equal to the REGDB_E_CLASSNOTREG standard COM return value.';
22578
    DIERR_DEVICENOTREG: Result := 'The device or device instance is not registered with DirectInput. This value is equal to the REGDB_E_CLASSNOTREG standard COM return value.';
22575
    DIERR_EFFECTPLAYING: Result := 'The parameters were updated in memory but were not downloaded to the device because the device does not support updating an effect while it is still playing.';
22579
    DIERR_EFFECTPLAYING: Result := 'The parameters were updated in memory but were not downloaded to the device because the device does not support updating an effect while it is still playing.';
22576
    DIERR_HASEFFECTS: Result := 'The device cannot be reinitialized because there are still effects attached to it.';
22580
    DIERR_HASEFFECTS: Result := 'The device cannot be reinitialized because there are still effects attached to it.';
22577
    DIERR_GENERIC: Result := 'An undetermined error occurred inside the DirectInput subsystem. This value is equal to the E_FAIL standard COM return value.';
22581
    DIERR_GENERIC: Result := 'An undetermined error occurred inside the DirectInput subsystem. This value is equal to the E_FAIL standard COM return value.';
22578
//    DIERR_HANDLEEXISTS: Result := 'The device already has an event notification associated with it. This value is equal to the E_ACCESSDENIED standard COM return value.';
22582
//    DIERR_HANDLEEXISTS: Result := 'The device already has an event notification associated with it. This value is equal to the E_ACCESSDENIED standard COM return value.';
22579
    DIERR_INCOMPLETEEFFECT: Result := 'The effect could not be downloaded because essential information is missing. For example, no axes have been associated with the effect, or no type-specific information has been supplied.';
22583
    DIERR_INCOMPLETEEFFECT: Result := 'The effect could not be downloaded because essential information is missing. For example, no axes have been associated with the effect, or no type-specific information has been supplied.';
22580
    DIERR_INPUTLOST: Result := 'Access to the input device has been lost. It must be reacquired.';
22584
    DIERR_INPUTLOST: Result := 'Access to the input device has been lost. It must be reacquired.';
22581
    DIERR_INVALIDPARAM: Result := 'An invalid parameter was passed to the returning function, or the object was not in a state that permitted the function to be called. This value is equal to the E_INVALIDARG standard COM return value.';
22585
    DIERR_INVALIDPARAM: Result := 'An invalid parameter was passed to the returning function, or the object was not in a state that permitted the function to be called. This value is equal to the E_INVALIDARG standard COM return value.';
22582
    DIERR_MOREDATA: Result := 'Not all the requested information fitted into the buffer.';
22586
    DIERR_MOREDATA: Result := 'Not all the requested information fitted into the buffer.';
22583
    DIERR_NOAGGREGATION: Result := 'This object does not support aggregation.';
22587
    DIERR_NOAGGREGATION: Result := 'This object does not support aggregation.';
22584
    DIERR_NOINTERFACE: Result := 'The specified interface is not supported by the object. This value is equal to the E_NOINTERFACE standard COM return value.';
22588
    DIERR_NOINTERFACE: Result := 'The specified interface is not supported by the object. This value is equal to the E_NOINTERFACE standard COM return value.';
22585
    DIERR_NOTACQUIRED: Result := 'The operation cannot be performed unless the device is acquired.';
22589
    DIERR_NOTACQUIRED: Result := 'The operation cannot be performed unless the device is acquired.';
22586
    DIERR_NOTBUFFERED: Result := 'The device is not buffered. Set the DIPROP_BUFFERSIZE property to enable buffering.';
22590
    DIERR_NOTBUFFERED: Result := 'The device is not buffered. Set the DIPROP_BUFFERSIZE property to enable buffering.';
22587
    DIERR_NOTDOWNLOADED: Result := 'The effect is not downloaded.';
22591
    DIERR_NOTDOWNLOADED: Result := 'The effect is not downloaded.';
22588
    DIERR_NOTEXCLUSIVEACQUIRED: Result := 'The operation cannot be performed unless the device is acquired in DISCL_EXCLUSIVE mode.';
22592
    DIERR_NOTEXCLUSIVEACQUIRED: Result := 'The operation cannot be performed unless the device is acquired in DISCL_EXCLUSIVE mode.';
22589
    DIERR_NOTFOUND: Result := 'The requested object does not exist.';
22593
    DIERR_NOTFOUND: Result := 'The requested object does not exist.';
22590
    DIERR_NOTINITIALIZED: Result := 'This object has not been initialized.';
22594
    DIERR_NOTINITIALIZED: Result := 'This object has not been initialized.';
22591
//    DIERR_OBJECTNOTFOUND: Result := 'The requested object does not exist.';
22595
//    DIERR_OBJECTNOTFOUND: Result := 'The requested object does not exist.';
22592
    DIERR_OLDDIRECTINPUTVERSION: Result := 'The application requires a newer version of DirectInput.';
22596
    DIERR_OLDDIRECTINPUTVERSION: Result := 'The application requires a newer version of DirectInput.';
22593
    DIERR_OTHERAPPHASPRIO: Result := '"The device already has an event notification associated with it." or "The specified property cannot be changed." or "Another application has a higher priority level, preventing this call from succeeding. "';
22597
    DIERR_OTHERAPPHASPRIO: Result := '"The device already has an event notification associated with it." or "The specified property cannot be changed." or "Another application has a higher priority level, preventing this call from succeeding. "';
22594
    DIERR_OUTOFMEMORY: Result := 'The DirectInput subsystem could not allocate sufficient memory to complete the call. This value is equal to the E_OUTOFMEMORY standard COM return value.';
22598
    DIERR_OUTOFMEMORY: Result := 'The DirectInput subsystem could not allocate sufficient memory to complete the call. This value is equal to the E_OUTOFMEMORY standard COM return value.';
22595
//    DIERR_READONLY: Result := 'The specified property cannot be changed. This value is equal to the E_ACCESSDENIED standard COM return value.';
22599
//    DIERR_READONLY: Result := 'The specified property cannot be changed. This value is equal to the E_ACCESSDENIED standard COM return value.';
22596
    DIERR_UNSUPPORTED: Result := 'The function called is not supported at this time. This value is equal to the E_NOTIMPL standard COM return value.';
22600
    DIERR_UNSUPPORTED: Result := 'The function called is not supported at this time. This value is equal to the E_NOTIMPL standard COM return value.';
22597
    E_PENDING: Result := 'Data is not yet available.';
22601
    E_PENDING: Result := 'Data is not yet available.';
22598
    HResult($800405CC): Result := 'No more memory for effects of this kind (not documented)';
22602
    HResult($800405CC): Result := 'No more memory for effects of this kind (not documented)';
22599
      else Result := 'Unrecognized Error: $' + sValue;
22603
      else Result := 'Unrecognized Error: $' + sValue;
22600
  end;
22604
  end;
22601
end;
22605
end;
22602
 
22606
 
22603
function joyConfigChanged(dwFlags: DWORD) : MMRESULT; external 'WinMM.dll';
22607
function joyConfigChanged(dwFlags: DWORD) : MMRESULT; external 'WinMM.dll';
22604
 
22608
 
22605
procedure Init_c_dfDIKeyboard_Objects;  // XRef: Initialization
22609
procedure Init_c_dfDIKeyboard_Objects;  // XRef: Initialization
22606
var x: Cardinal;
22610
var x: Cardinal;
22607
begin
22611
begin
22608
  for x := 0 to 255 do
22612
  for x := 0 to 255 do
22609
  with _c_dfDIKeyboard_Objects[x] do
22613
  with _c_dfDIKeyboard_Objects[x] do
22610
  begin
22614
  begin
22611
    pGuid := @GUID_Key; dwOfs := x; dwFlags := 0;
22615
    pGuid := @GUID_Key; dwOfs := x; dwFlags := 0;
22612
    dwType := $80000000 or DIDFT_BUTTON or x shl 8;
22616
    dwType := $80000000 or DIDFT_BUTTON or x shl 8;
22613
  end;
22617
  end;
22614
end;
22618
end;
22615
 
22619
 
22616
procedure Init_c_dfDIJoystick2_Objects;  // XRef: Initialization
22620
procedure Init_c_dfDIJoystick2_Objects;  // XRef: Initialization
22617
var x,y, OfVal: Cardinal;
22621
var x,y, OfVal: Cardinal;
22618
begin
22622
begin
22619
  Move(_c_dfDIJoystick_Objects,_c_dfDIJoystick2_Objects,SizeOf(_c_dfDIJoystick_Objects));
22623
  Move(_c_dfDIJoystick_Objects,_c_dfDIJoystick2_Objects,SizeOf(_c_dfDIJoystick_Objects));
22620
  // all those empty "buttons"
22624
  // all those empty "buttons"
22621
  for x := $2C to $8B do
22625
  for x := $2C to $8B do
22622
    Move(_c_dfDIJoystick_Objects[$2B],_c_dfDIJoystick2_Objects[x],SizeOf(TDIObjectDataFormat));
22626
    Move(_c_dfDIJoystick_Objects[$2B],_c_dfDIJoystick2_Objects[x],SizeOf(TDIObjectDataFormat));
22623
  for x := 0 to 2 do
22627
  for x := 0 to 2 do
22624
  begin  // 3 more blocks of X axis..Sliders
22628
  begin  // 3 more blocks of X axis..Sliders
22625
    Move(_c_dfDIJoystick_Objects,_c_dfDIJoystick2_Objects[$8C+8*x],8*SizeOf(TDIObjectDataFormat));
22629
    Move(_c_dfDIJoystick_Objects,_c_dfDIJoystick2_Objects[$8C+8*x],8*SizeOf(TDIObjectDataFormat));
22626
    for y := 0 to 7 do _c_dfDIJoystick2_Objects[$8C+8*x+y].dwFlags := (x+1) shl 8;
22630
    for y := 0 to 7 do _c_dfDIJoystick2_Objects[$8C+8*x+y].dwFlags := (x+1) shl 8;
22627
  end;
22631
  end;
22628
  OfVal := _c_dfDIJoystick2_Objects[$2B].dwOfs+1;
22632
  OfVal := _c_dfDIJoystick2_Objects[$2B].dwOfs+1;
22629
  for x := $2C to $A3 do
22633
  for x := $2C to $A3 do
22630
  begin
22634
  begin
22631
    _c_dfDIJoystick2_Objects[x].dwOfs := OfVal;
22635
    _c_dfDIJoystick2_Objects[x].dwOfs := OfVal;
22632
    if x < $8C then Inc(OfVal) else Inc(OfVal,4);
22636
    if x < $8C then Inc(OfVal) else Inc(OfVal,4);
22633
  end;
22637
  end;
22634
end;
22638
end;
22635
 
22639
 
22636
//DirectPlay file
22640
//DirectPlay file
-
 
22641
{$IFDEF UseDirectPlay} // Daniel Marschall 12.04.2024 Added to avoid Windows showing "This app requires DirectPlay"
22637
 
22642
 
22638
(*==========================================================================;
22643
(*==========================================================================;
22639
 *
22644
 *
22640
 *  Copyright (C) 1994-1997 Microsoft Corporation.  All Rights Reserved.
22645
 *  Copyright (C) 1994-1997 Microsoft Corporation.  All Rights Reserved.
22641
 *
22646
 *
22642
 *  File:       dplay.h
22647
 *  File:       dplay.h
22643
 *  Content:    DirectPlay include file
22648
 *  Content:    DirectPlay include file
22644
 *
22649
 *
22645
 ***************************************************************************)
22650
 ***************************************************************************)
22646
 
22651
 
22647
function DPErrorString(Value: HResult) : string;
22652
function DPErrorString(Value: HResult) : string;
22648
begin
22653
begin
22649
  case Value of
22654
  case Value of
22650
    CLASS_E_NOAGGREGATION: Result := 'A non-NULL value was passed for the pUnkOuter parameter in DirectPlayCreate, DirectPlayLobbyCreate, or IDirectPlayLobby2::Connect.';
22655
    CLASS_E_NOAGGREGATION: Result := 'A non-NULL value was passed for the pUnkOuter parameter in DirectPlayCreate, DirectPlayLobbyCreate, or IDirectPlayLobby2::Connect.';
22651
    DPERR_ACCESSDENIED: Result := 'The session is full or an incorrect password was supplied.';
22656
    DPERR_ACCESSDENIED: Result := 'The session is full or an incorrect password was supplied.';
22652
    DPERR_ACTIVEPLAYERS: Result := 'The requested operation cannot be performed because there are existing active players.';
22657
    DPERR_ACTIVEPLAYERS: Result := 'The requested operation cannot be performed because there are existing active players.';
22653
    DPERR_ALREADYINITIALIZED: Result := 'This object is already initialized.';
22658
    DPERR_ALREADYINITIALIZED: Result := 'This object is already initialized.';
22654
    DPERR_APPNOTSTARTED: Result := 'The application has not been started yet.';
22659
    DPERR_APPNOTSTARTED: Result := 'The application has not been started yet.';
22655
    DPERR_AUTHENTICATIONFAILED: Result := 'The password or credentials supplied could not be authenticated.';
22660
    DPERR_AUTHENTICATIONFAILED: Result := 'The password or credentials supplied could not be authenticated.';
22656
    DPERR_BUFFERTOOLARGE: Result := 'The data buffer is too large to store.';
22661
    DPERR_BUFFERTOOLARGE: Result := 'The data buffer is too large to store.';
22657
    DPERR_BUSY: Result := 'A message cannot be sent because the transmission medium is busy.';
22662
    DPERR_BUSY: Result := 'A message cannot be sent because the transmission medium is busy.';
22658
    DPERR_BUFFERTOOSMALL: Result := 'The supplied buffer is not large enough to contain the requested data.';
22663
    DPERR_BUFFERTOOSMALL: Result := 'The supplied buffer is not large enough to contain the requested data.';
22659
    DPERR_CANTADDPLAYER: Result := 'The player cannot be added to the session.';
22664
    DPERR_CANTADDPLAYER: Result := 'The player cannot be added to the session.';
22660
    DPERR_CANTCREATEGROUP: Result := 'A new group cannot be created.';
22665
    DPERR_CANTCREATEGROUP: Result := 'A new group cannot be created.';
22661
    DPERR_CANTCREATEPLAYER: Result := 'A new player cannot be created.';
22666
    DPERR_CANTCREATEPLAYER: Result := 'A new player cannot be created.';
22662
    DPERR_CANTCREATEPROCESS: Result := 'Cannot start the application.';
22667
    DPERR_CANTCREATEPROCESS: Result := 'Cannot start the application.';
22663
    DPERR_CANTCREATESESSION: Result := 'A new session cannot be created.';
22668
    DPERR_CANTCREATESESSION: Result := 'A new session cannot be created.';
22664
    DPERR_CANTLOADCAPI: Result := 'No credentials were supplied and the CryptoAPI package (CAPI) to use for cryptography services cannot be loaded.';
22669
    DPERR_CANTLOADCAPI: Result := 'No credentials were supplied and the CryptoAPI package (CAPI) to use for cryptography services cannot be loaded.';
22665
    DPERR_CANTLOADSECURITYPACKAGE: Result := 'The software security package cannot be loaded.';
22670
    DPERR_CANTLOADSECURITYPACKAGE: Result := 'The software security package cannot be loaded.';
22666
    DPERR_CANTLOADSSPI: Result := 'No credentials were supplied and the software security package (SSPI) that will prompt for credentials cannot be loaded.';
22671
    DPERR_CANTLOADSSPI: Result := 'No credentials were supplied and the software security package (SSPI) that will prompt for credentials cannot be loaded.';
22667
    DPERR_CAPSNOTAVAILABLEYET: Result := 'The capabilities of the DirectPlay object have not been determined yet. This error will occur if the DirectPlay object is implemented on a connectivity solution that requires polling to determine available bandwidth and latency.';
22672
    DPERR_CAPSNOTAVAILABLEYET: Result := 'The capabilities of the DirectPlay object have not been determined yet. This error will occur if the DirectPlay object is implemented on a connectivity solution that requires polling to determine available bandwidth and latency.';
22668
    DPERR_CONNECTING: Result := 'The method is in the process of connecting to the network. The application should keep calling the method until it returns DP_OK, indicating successful completion, or it returns a different error.';
22673
    DPERR_CONNECTING: Result := 'The method is in the process of connecting to the network. The application should keep calling the method until it returns DP_OK, indicating successful completion, or it returns a different error.';
22669
    DPERR_ENCRYPTIONFAILED: Result := 'The requested information could not be digitally encrypted. Encryption is used for message privacy. This error is only relevant in a secure session.';
22674
    DPERR_ENCRYPTIONFAILED: Result := 'The requested information could not be digitally encrypted. Encryption is used for message privacy. This error is only relevant in a secure session.';
22670
    DPERR_EXCEPTION: Result := 'An exception occurred when processing the request.';
22675
    DPERR_EXCEPTION: Result := 'An exception occurred when processing the request.';
22671
    DPERR_GENERIC: Result := 'An undefined error condition occurred.';
22676
    DPERR_GENERIC: Result := 'An undefined error condition occurred.';
22672
//    DPERR_INVALIDCREDENTIALS: Result := 'The credentials supplied (as to IDirectPlay3::SecureOpen) were not valid.';
22677
//    DPERR_INVALIDCREDENTIALS: Result := 'The credentials supplied (as to IDirectPlay3::SecureOpen) were not valid.';
22673
    DPERR_INVALIDFLAGS: Result := 'The flags passed to this method are invalid.';
22678
    DPERR_INVALIDFLAGS: Result := 'The flags passed to this method are invalid.';
22674
    DPERR_INVALIDGROUP: Result := 'The group ID is not recognized as a valid group ID for this game session.';
22679
    DPERR_INVALIDGROUP: Result := 'The group ID is not recognized as a valid group ID for this game session.';
22675
    DPERR_INVALIDINTERFACE: Result := 'The interface parameter is invalid.';
22680
    DPERR_INVALIDINTERFACE: Result := 'The interface parameter is invalid.';
22676
    DPERR_INVALIDOBJECT: Result := 'The DirectPlay object pointer is invalid.';
22681
    DPERR_INVALIDOBJECT: Result := 'The DirectPlay object pointer is invalid.';
22677
    DPERR_INVALIDPARAMS: Result := 'One or more of the parameters passed to the method are invalid.';
22682
    DPERR_INVALIDPARAMS: Result := 'One or more of the parameters passed to the method are invalid.';
22678
    DPERR_INVALIDPASSWORD: Result := 'An invalid password was supplied when attempting to join a session that requires a password.';
22683
    DPERR_INVALIDPASSWORD: Result := 'An invalid password was supplied when attempting to join a session that requires a password.';
22679
    DPERR_INVALIDPLAYER: Result := 'The player ID is not recognized as a valid player ID for this game session.';
22684
    DPERR_INVALIDPLAYER: Result := 'The player ID is not recognized as a valid player ID for this game session.';
22680
    DPERR_LOGONDENIED: Result := 'The session could not be opened because credentials are required and either no credentials were supplied or the credentials were invalid.';
22685
    DPERR_LOGONDENIED: Result := 'The session could not be opened because credentials are required and either no credentials were supplied or the credentials were invalid.';
22681
    DPERR_NOCAPS: Result := 'The communication link that DirectPlay is attempting to use is not capable of this function.';
22686
    DPERR_NOCAPS: Result := 'The communication link that DirectPlay is attempting to use is not capable of this function.';
22682
    DPERR_NOCONNECTION: Result := 'No communication link was established.';
22687
    DPERR_NOCONNECTION: Result := 'No communication link was established.';
22683
    DPERR_NOINTERFACE: Result := 'The interface is not supported.';
22688
    DPERR_NOINTERFACE: Result := 'The interface is not supported.';
22684
    DPERR_NOMESSAGES: Result := 'There are no messages in the receive queue.';
22689
    DPERR_NOMESSAGES: Result := 'There are no messages in the receive queue.';
22685
    DPERR_NONAMESERVERFOUND: Result := 'No name server (host) could be found or created. A host must exist to create a player.';
22690
    DPERR_NONAMESERVERFOUND: Result := 'No name server (host) could be found or created. A host must exist to create a player.';
22686
    DPERR_NONEWPLAYERS: Result := 'The session is not accepting any new players.';
22691
    DPERR_NONEWPLAYERS: Result := 'The session is not accepting any new players.';
22687
    DPERR_NOPLAYERS: Result := 'There are no active players in the session.';
22692
    DPERR_NOPLAYERS: Result := 'There are no active players in the session.';
22688
    DPERR_NOSESSIONS: Result := 'There are no existing sessions for this game.';
22693
    DPERR_NOSESSIONS: Result := 'There are no existing sessions for this game.';
22689
    DPERR_NOTLOBBIED: Result := 'Returned by the IDirectPlayLobby2::Connect method if the application was not started by using the IDirectPlayLobby2::RunApplication method or if there is no DPLCONNECTION structure currently initialized for this DirectPlayLobby object.';
22694
    DPERR_NOTLOBBIED: Result := 'Returned by the IDirectPlayLobby2::Connect method if the application was not started by using the IDirectPlayLobby2::RunApplication method or if there is no DPLCONNECTION structure currently initialized for this DirectPlayLobby object.';
22690
    DPERR_NOTLOGGEDIN: Result := 'An action cannot be performed because a player or client application is not logged in. Returned by the IDirectPlay3::Send method when the client application tries to send a secure message without being logged in.';
22695
    DPERR_NOTLOGGEDIN: Result := 'An action cannot be performed because a player or client application is not logged in. Returned by the IDirectPlay3::Send method when the client application tries to send a secure message without being logged in.';
22691
    DPERR_OUTOFMEMORY: Result := 'There is insufficient memory to perform the requested operation.';
22696
    DPERR_OUTOFMEMORY: Result := 'There is insufficient memory to perform the requested operation.';
22692
    DPERR_PLAYERLOST: Result := 'A player has lost the connection to the session.';
22697
    DPERR_PLAYERLOST: Result := 'A player has lost the connection to the session.';
22693
    DPERR_SENDTOOBIG: Result := 'The message being sent by the IDirectPlay3::Send method is too large.';
22698
    DPERR_SENDTOOBIG: Result := 'The message being sent by the IDirectPlay3::Send method is too large.';
22694
    DPERR_SESSIONLOST: Result := 'The connection to the session has been lost.';
22699
    DPERR_SESSIONLOST: Result := 'The connection to the session has been lost.';
22695
    DPERR_SIGNFAILED: Result := 'The requested information could not be digitally signed. Digital signatures are used to establish the authenticity of messages.';
22700
    DPERR_SIGNFAILED: Result := 'The requested information could not be digitally signed. Digital signatures are used to establish the authenticity of messages.';
22696
    DPERR_TIMEOUT: Result := 'The operation could not be completed in the specified time.';
22701
    DPERR_TIMEOUT: Result := 'The operation could not be completed in the specified time.';
22697
    DPERR_UNAVAILABLE: Result := 'The requested function is not available at this time.';
22702
    DPERR_UNAVAILABLE: Result := 'The requested function is not available at this time.';
22698
    DPERR_UNINITIALIZED: Result := 'The requested object has not been initialized.';
22703
    DPERR_UNINITIALIZED: Result := 'The requested object has not been initialized.';
22699
    DPERR_UNKNOWNAPPLICATION: Result := 'An unknown application was specified.';
22704
    DPERR_UNKNOWNAPPLICATION: Result := 'An unknown application was specified.';
22700
    DPERR_UNSUPPORTED: Result := 'The function is not available in this implementation. Returned from IDirectPlay3::GetGroupConnectionSettings and IDirectPlay3::SetGroupConnectionSettings if they are called from a session that is not a lobby session.';
22705
    DPERR_UNSUPPORTED: Result := 'The function is not available in this implementation. Returned from IDirectPlay3::GetGroupConnectionSettings and IDirectPlay3::SetGroupConnectionSettings if they are called from a session that is not a lobby session.';
22701
    DPERR_USERCANCEL: Result := 'Can be returned in two ways. 1) The user canceled the connection process during a call to the IDirectPlay3::Open method. 2) The user clicked Cancel in one of the DirectPlay service provider dialog boxes during a call to IDirectPlay3::EnumSessions.';
22706
    DPERR_USERCANCEL: Result := 'Can be returned in two ways. 1) The user canceled the connection process during a call to the IDirectPlay3::Open method. 2) The user clicked Cancel in one of the DirectPlay service provider dialog boxes during a call to IDirectPlay3::EnumSessions.';
22702
    else Result := 'Unrecognized Error';
22707
    else Result := 'Unrecognized Error';
22703
  end;
22708
  end;
22704
end;
22709
end;
-
 
22710
{$ENDIF} // UseDirectPlay
22705
 
22711
 
22706
//DirectSetup file
22712
//DirectSetup file
22707
 
22713
 
22708
(*==========================================================================
22714
(*==========================================================================
22709
 *
22715
 *
22710
 *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
22716
 *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
22711
 *
22717
 *
22712
 *  File:       dsetup.h
22718
 *  File:       dsetup.h
22713
 *  Content:    DirectXSetup, error codes and flags
22719
 *  Content:    DirectXSetup, error codes and flags
22714
 ***************************************************************************)
22720
 ***************************************************************************)
22715
 
22721
 
22716
procedure LoadDSetup;
22722
procedure LoadDSetup;
22717
 
22723
 
22718
  function RegGetStringValue(Hive: HKEY; const KeyName, ValueName: string): string;
22724
  function RegGetStringValue(Hive: HKEY; const KeyName, ValueName: string): string;
22719
  var EnvKey  : HKEY;
22725
  var EnvKey  : HKEY;
22720
      Buf     : array[0..255] of char;
22726
      Buf     : array[0..255] of char;
22721
      BufSize : DWord;
22727
      BufSize : DWord;
22722
      RegType : DWord;
22728
      RegType : DWord;
22723
      rc      : DWord;
22729
      rc      : DWord;
22724
  begin
22730
  begin
22725
    Result := '';
22731
    Result := '';
22726
    BufSize := Sizeof(Buf);
22732
    BufSize := Sizeof(Buf);
22727
    ZeroMemory(@Buf, BufSize);
22733
    ZeroMemory(@Buf, BufSize);
22728
    RegType := REG_SZ;
22734
    RegType := REG_SZ;
22729
    try
22735
    try
22730
      if (RegOpenKeyEx(Hive, PChar(KeyName), 0, KEY_READ, EnvKey) = ERROR_SUCCESS) then
22736
      if (RegOpenKeyEx(Hive, PChar(KeyName), 0, KEY_READ, EnvKey) = ERROR_SUCCESS) then
22731
      begin
22737
      begin
22732
        try
22738
        try
22733
          if (ValueName = '') then rc := RegQueryValueEx(EnvKey, nil, nil, @RegType, @Buf, @BufSize)
22739
          if (ValueName = '') then rc := RegQueryValueEx(EnvKey, nil, nil, @RegType, @Buf, @BufSize)
22734
            else rc := RegQueryValueEx(EnvKey, PChar(ValueName), nil, @RegType, @Buf, @BufSize);
22740
            else rc := RegQueryValueEx(EnvKey, PChar(ValueName), nil, @RegType, @Buf, @BufSize);
22735
          if rc = ERROR_SUCCESS then Result := string(Buf);
22741
          if rc = ERROR_SUCCESS then Result := string(Buf);
22736
        finally
22742
        finally
22737
          RegCloseKey(EnvKey);
22743
          RegCloseKey(EnvKey);
22738
        end;
22744
        end;
22739
      end;
22745
      end;
22740
    finally
22746
    finally
22741
      RegCloseKey(Hive);
22747
      RegCloseKey(Hive);
22742
    end;
22748
    end;
22743
  end;
22749
  end;
22744
 
22750
 
22745
 
22751
 
22746
  function ExistFile(const FileName: string): Boolean;
22752
  function ExistFile(const FileName: string): Boolean;
22747
  var hFile: THandle;
22753
  var hFile: THandle;
22748
  begin
22754
  begin
22749
    hFile := CreateFile(PChar(FileName), 0, 0, nil, OPEN_EXISTING, 0, 0);
22755
    hFile := CreateFile(PChar(FileName), 0, 0, nil, OPEN_EXISTING, 0, 0);
22750
    Result := hFile <> INVALID_HANDLE_VALUE;
22756
    Result := hFile <> INVALID_HANDLE_VALUE;
22751
    if hFile = INVALID_HANDLE_VALUE then CloseHandle(hFile);
22757
    if hFile = INVALID_HANDLE_VALUE then CloseHandle(hFile);
22752
  end;
22758
  end;
22753
 
22759
 
22754
  function GetDSetupDLLPath : string;
22760
  function GetDSetupDLLPath : string;
22755
  begin
22761
  begin
22756
     Result := RegGetStringValue(HKEY_LOCAL_MACHINE,
22762
     Result := RegGetStringValue(HKEY_LOCAL_MACHINE,
22757
                                 'Software\Microsoft\Windows\CurrentVersion\Uninstall\DirectXDrivers',
22763
                                 'Software\Microsoft\Windows\CurrentVersion\Uninstall\DirectXDrivers',
22758
                                 'UninstallString');
22764
                                 'UninstallString');
22759
     if Result <> '' then
22765
     if Result <> '' then
22760
       Result := Copy(Result,1,Length(Result)-Length('dxsetup.exe')) + 'DSetup.dll';
22766
       Result := Copy(Result,1,Length(Result)-Length('dxsetup.exe')) + 'DSetup.dll';
22761
  end;
22767
  end;
22762
 
22768
 
22763
begin
22769
begin
22764
  DSetupDLL := LoadLibrary(PChar(GetDSetupDLLPath));
22770
  DSetupDLL := LoadLibrary(PChar(GetDSetupDLLPath));
22765
 
22771
 
22766
  DirectXSetupA := GetProcAddress(DSetupDLL,'DirectXSetupA');
22772
  DirectXSetupA := GetProcAddress(DSetupDLL,'DirectXSetupA');
22767
  DirectXSetupW := GetProcAddress(DSetupDLL,'DirectXSetupW');
22773
  DirectXSetupW := GetProcAddress(DSetupDLL,'DirectXSetupW');
22768
{$IFDEF UNICODE}
22774
{$IFDEF UNICODE}
22769
  DirectXSetup := DirectXSetupW;
22775
  DirectXSetup := DirectXSetupW;
22770
{$ELSE}
22776
{$ELSE}
22771
  DirectXSetup := DirectXSetupA;
22777
  DirectXSetup := DirectXSetupA;
22772
{$ENDIF}
22778
{$ENDIF}
22773
 
22779
 
22774
  DirectXDeviceDriverSetupA :=
22780
  DirectXDeviceDriverSetupA :=
22775
      GetProcAddress(DSetupDLL,'DirectXDeviceDriverSetupA');
22781
      GetProcAddress(DSetupDLL,'DirectXDeviceDriverSetupA');
22776
  DirectXDeviceDriverSetupW :=
22782
  DirectXDeviceDriverSetupW :=
22777
      GetProcAddress(DSetupDLL,'DirectXDeviceDriverSetupW');
22783
      GetProcAddress(DSetupDLL,'DirectXDeviceDriverSetupW');
22778
{$IFDEF UNICODE}
22784
{$IFDEF UNICODE}
22779
  DirectXDeviceDriverSetup := DirectXDeviceDriverSetupW;
22785
  DirectXDeviceDriverSetup := DirectXDeviceDriverSetupW;
22780
{$ELSE}
22786
{$ELSE}
22781
  DirectXDeviceDriverSetup := DirectXDeviceDriverSetupA;
22787
  DirectXDeviceDriverSetup := DirectXDeviceDriverSetupA;
22782
{$ENDIF}
22788
{$ENDIF}
22783
 
22789
 
22784
  DirectXRegisterApplicationA :=
22790
  DirectXRegisterApplicationA :=
22785
       GetProcAddress(DSetupDLL,'DirectXRegisterApplicationA');
22791
       GetProcAddress(DSetupDLL,'DirectXRegisterApplicationA');
22786
  DirectXRegisterApplicationW :=
22792
  DirectXRegisterApplicationW :=
22787
       GetProcAddress(DSetupDLL,'DirectXRegisterApplicationW');
22793
       GetProcAddress(DSetupDLL,'DirectXRegisterApplicationW');
22788
{$IFDEF UNICODE}
22794
{$IFDEF UNICODE}
22789
  DirectXRegisterApplication := DirectXRegisterApplicationW;
22795
  DirectXRegisterApplication := DirectXRegisterApplicationW;
22790
{$ELSE}
22796
{$ELSE}
22791
  DirectXRegisterApplication := DirectXRegisterApplicationA;
22797
  DirectXRegisterApplication := DirectXRegisterApplicationA;
22792
{$ENDIF}
22798
{$ENDIF}
22793
 
22799
 
22794
  DirectXUnRegisterApplication :=
22800
  DirectXUnRegisterApplication :=
22795
      GetProcAddress(DSetupDLL,'DirectXUnRegisterApplication');
22801
      GetProcAddress(DSetupDLL,'DirectXUnRegisterApplication');
22796
 
22802
 
22797
  DirectXSetupSetCallback :=
22803
  DirectXSetupSetCallback :=
22798
      GetProcAddress(DSetupDLL,'DirectXSetupSetCallback');
22804
      GetProcAddress(DSetupDLL,'DirectXSetupSetCallback');
22799
 
22805
 
22800
  DirectXSetupGetVersion := GetProcAddress(DSetupDLL,'DirectXSetupGetVersion');
22806
  DirectXSetupGetVersion := GetProcAddress(DSetupDLL,'DirectXSetupGetVersion');
22801
 
22807
 
22802
end;
22808
end;
22803
 
22809
 
22804
//DirectSound file
22810
//DirectSound file
22805
 
22811
 
22806
function MAKE_DSHRESULT(code: DWORD) : HResult;
22812
function MAKE_DSHRESULT(code: DWORD) : HResult;
22807
begin
22813
begin
22808
  Result := HResult(1 shl 31) or HResult(_FACDS shl 16)
22814
  Result := HResult(1 shl 31) or HResult(_FACDS shl 16)
22809
      or HResult(code);
22815
      or HResult(code);
22810
end;
22816
end;
22811
 
22817
 
22812
function DSSPEAKER_COMBINED(c, g: variant) : DWORD;
22818
function DSSPEAKER_COMBINED(c, g: variant) : DWORD;
22813
begin
22819
begin
22814
  Result := byte(c) or (byte(g) shl 16)
22820
  Result := byte(c) or (byte(g) shl 16)
22815
end;
22821
end;
22816
 
22822
 
22817
function DSSPEAKER_CONFIG(a: variant) : byte;
22823
function DSSPEAKER_CONFIG(a: variant) : byte;
22818
begin
22824
begin
22819
  Result := byte(a);
22825
  Result := byte(a);
22820
end;
22826
end;
22821
 
22827
 
22822
function DSSPEAKER_GEOMETRY(a: variant) : byte;
22828
function DSSPEAKER_GEOMETRY(a: variant) : byte;
22823
begin
22829
begin
22824
  Result := byte(a shr 16 and $FF);
22830
  Result := byte(a shr 16 and $FF);
22825
end;
22831
end;
22826
 
22832
 
22827
 
22833
 
22828
function DSErrorString(Value: HResult) : string;
22834
function DSErrorString(Value: HResult) : string;
22829
begin
22835
begin
22830
  case Value of
22836
  case Value of
22831
    DS_OK: Result := 'The request completed successfully.';
22837
    DS_OK: Result := 'The request completed successfully.';
22832
    DSERR_ALLOCATED: Result := 'The request failed because resources, such as a priority level, were already in use by another caller.';
22838
    DSERR_ALLOCATED: Result := 'The request failed because resources, such as a priority level, were already in use by another caller.';
22833
    DSERR_ALREADYINITIALIZED: Result := 'The object is already initialized.';
22839
    DSERR_ALREADYINITIALIZED: Result := 'The object is already initialized.';
22834
    DSERR_BADFORMAT: Result := 'The specified wave format is not supported.';
22840
    DSERR_BADFORMAT: Result := 'The specified wave format is not supported.';
22835
    DSERR_BUFFERLOST: Result := 'The buffer memory has been lost and must be restored.';
22841
    DSERR_BUFFERLOST: Result := 'The buffer memory has been lost and must be restored.';
22836
    DSERR_CONTROLUNAVAIL: Result := 'The control (volume, pan, and so forth) requested by the caller is not available.';
22842
    DSERR_CONTROLUNAVAIL: Result := 'The control (volume, pan, and so forth) requested by the caller is not available.';
22837
    DSERR_GENERIC: Result := 'An undetermined error occurred inside the DirectSound subsystem.';
22843
    DSERR_GENERIC: Result := 'An undetermined error occurred inside the DirectSound subsystem.';
22838
    DSERR_INVALIDCALL: Result := 'This function is not valid for the current state of this object.';
22844
    DSERR_INVALIDCALL: Result := 'This function is not valid for the current state of this object.';
22839
    DSERR_INVALIDPARAM: Result := 'An invalid parameter was passed to the returning function.';
22845
    DSERR_INVALIDPARAM: Result := 'An invalid parameter was passed to the returning function.';
22840
    DSERR_NOAGGREGATION: Result := 'The object does not support aggregation.';
22846
    DSERR_NOAGGREGATION: Result := 'The object does not support aggregation.';
22841
    DSERR_NODRIVER: Result := 'No sound driver is available for use.';
22847
    DSERR_NODRIVER: Result := 'No sound driver is available for use.';
22842
    DSERR_NOINTERFACE: Result := 'The requested COM interface is not available.';
22848
    DSERR_NOINTERFACE: Result := 'The requested COM interface is not available.';
22843
    DSERR_OTHERAPPHASPRIO: Result := 'Another application has a higher priority level, preventing this call from succeeding.';
22849
    DSERR_OTHERAPPHASPRIO: Result := 'Another application has a higher priority level, preventing this call from succeeding.';
22844
    DSERR_OUTOFMEMORY: Result := 'The DirectSound subsystem could not allocate sufficient memory to complete the caller´s request.';
22850
    DSERR_OUTOFMEMORY: Result := 'The DirectSound subsystem could not allocate sufficient memory to complete the caller´s request.';
22845
    DSERR_PRIOLEVELNEEDED: Result := 'The caller does not have the priority level required for the function to succeed.';
22851
    DSERR_PRIOLEVELNEEDED: Result := 'The caller does not have the priority level required for the function to succeed.';
22846
    DSERR_UNINITIALIZED: Result := 'The IDirectSound::Initialize method has not been called or has not been called successfully before other methods were called.';
22852
    DSERR_UNINITIALIZED: Result := 'The IDirectSound::Initialize method has not been called or has not been called successfully before other methods were called.';
22847
    DSERR_UNSUPPORTED: Result := 'The function called is not supported at this time.';
22853
    DSERR_UNSUPPORTED: Result := 'The function called is not supported at this time.';
22848
    else Result := 'Unrecognized Error';
22854
    else Result := 'Unrecognized Error';
22849
  end;
22855
  end;
22850
end;
22856
end;
22851
 
22857
 
22852
//DirectMusic file
22858
//DirectMusic file
22853
 
22859
 
22854
function MAKE_HRESULT(sev,fac,code: DWORD) : HResult;
22860
function MAKE_HRESULT(sev,fac,code: DWORD) : HResult;
22855
begin
22861
begin
22856
  Result := (sev shl 31) or (fac shl 16) or code;
22862
  Result := (sev shl 31) or (fac shl 16) or code;
22857
end;
22863
end;
22858
 
22864
 
22859
//function MAKEFOURCC (ch0, ch1, ch2, ch3: Char) : TFourCC;
22865
//function MAKEFOURCC (ch0, ch1, ch2, ch3: Char) : TFourCC;
22860
//type
22866
//type
22861
//  tfcc = array [0..3] of Char;
22867
//  tfcc = array [0..3] of Char;
22862
//begin
22868
//begin
22863
//  tfcc(Result)[0] := ch0;
22869
//  tfcc(Result)[0] := ch0;
22864
//  tfcc(Result)[1] := ch1;
22870
//  tfcc(Result)[1] := ch1;
22865
//  tfcc(Result)[2] := ch2;
22871
//  tfcc(Result)[2] := ch2;
22866
//  tfcc(Result)[3] := ch3;
22872
//  tfcc(Result)[3] := ch3;
22867
//end;
22873
//end;
22868
 
22874
 
22869
function QWORD_ALIGN(x: DWORD) : DWORD;
22875
function QWORD_ALIGN(x: DWORD) : DWORD;
22870
begin
22876
begin
22871
  Result := (x + 7) and (not 7); //  (((x) + 7) & ~7)
22877
  Result := (x + 7) and (not 7); //  (((x) + 7) & ~7)
22872
end;
22878
end;
22873
 
22879
 
22874
function DMUS_EVENT_SIZE(cb: DWORD) : DWORD;
22880
function DMUS_EVENT_SIZE(cb: DWORD) : DWORD;
22875
begin
22881
begin
22876
  Result := QWORD_ALIGN(SizeOf(TDMus_EventHeader) + cb); // QWORD_ALIGN(sizeof(DMUS_EVENTHEADER) + cb)
22882
  Result := QWORD_ALIGN(SizeOf(TDMus_EventHeader) + cb); // QWORD_ALIGN(sizeof(DMUS_EVENTHEADER) + cb)
22877
end;
22883
end;
22878
 
22884
 
22879
function IsNTandDelphiRunning : boolean;
22885
function IsNTandDelphiRunning : boolean;
22880
var
22886
var
22881
  OSVersion  : TOSVersionInfo;
22887
  OSVersion  : TOSVersionInfo;
22882
  AppName    : array[0..255] of char;
22888
  AppName    : array[0..255] of char;
22883
begin
22889
begin
22884
  OSVersion.dwOsVersionInfoSize := sizeof(OSVersion);
22890
  OSVersion.dwOsVersionInfoSize := sizeof(OSVersion);
22885
  GetVersionEx(OSVersion);
22891
  GetVersionEx(OSVersion);
22886
  // Not running in NT or program is not Delphi itself ?
22892
  // Not running in NT or program is not Delphi itself ?
22887
  AppName[0] := #0;
22893
  AppName[0] := #0;
22888
  lstrcat(AppName, PChar(ParamStr(0)));  // ParamStr(0) = Application.ExeName
22894
  lstrcat(AppName, PChar(ParamStr(0)));  // ParamStr(0) = Application.ExeName
22889
  {$IFDEF VER12UP}
22895
  {$IFDEF VER12UP}
22890
  CharUpperBuff(AppName, High(AppName) + 1);
22896
  CharUpperBuff(AppName, High(AppName) + 1);
22891
  {$ELSE}
22897
  {$ELSE}
22892
  CharUpperBuff(AppName, SizeOf(AppName));
22898
  CharUpperBuff(AppName, SizeOf(AppName));
22893
  {$ENDIF}
22899
  {$ENDIF}
22894
  result := ( (OSVersion.dwPlatformID = VER_PLATFORM_WIN32_NT) and
22900
  result := ( (OSVersion.dwPlatformID = VER_PLATFORM_WIN32_NT) and
22895
              (Pos('DELPHI32.EXE', AppName) = Length(AppName) - Length('DELPHI32.EXE') + 1) );
22901
              (Pos('DELPHI32.EXE', AppName) = Length(AppName) - Length('DELPHI32.EXE') + 1) );
22896
end;
22902
end;
22897
 
22903
 
22898
initialization
22904
initialization
22899
begin
22905
begin
22900
  {DirectDraw}
22906
  {DirectDraw}
22901
 
22907
 
22902
  if not IsNTandDelphiRunning then
22908
  if not IsNTandDelphiRunning then
22903
  begin
22909
  begin
22904
    DDrawDLL := LoadLibrary('DDraw.dll');
22910
    DDrawDLL := LoadLibrary('DDraw.dll');
22905
    DirectDrawEnumerateA := GetProcAddress(DDrawDLL,'DirectDrawEnumerateA');
22911
    DirectDrawEnumerateA := GetProcAddress(DDrawDLL,'DirectDrawEnumerateA');
22906
    DirectDrawEnumerateW := GetProcAddress(DDrawDLL,'DirectDrawEnumerateW');
22912
    DirectDrawEnumerateW := GetProcAddress(DDrawDLL,'DirectDrawEnumerateW');
22907
{$IFDEF UNICODE}
22913
{$IFDEF UNICODE}
22908
    DirectDrawEnumerate := DirectDrawEnumerateW;
22914
    DirectDrawEnumerate := DirectDrawEnumerateW;
22909
{$ELSE}
22915
{$ELSE}
22910
    DirectDrawEnumerate := DirectDrawEnumerateA;
22916
    DirectDrawEnumerate := DirectDrawEnumerateA;
22911
{$ENDIF}
22917
{$ENDIF}
22912
 
22918
 
22913
    DirectDrawEnumerateExA := GetProcAddress(DDrawDLL,'DirectDrawEnumerateExA');
22919
    DirectDrawEnumerateExA := GetProcAddress(DDrawDLL,'DirectDrawEnumerateExA');
22914
    DirectDrawEnumerateExW := GetProcAddress(DDrawDLL,'DirectDrawEnumerateExW');
22920
    DirectDrawEnumerateExW := GetProcAddress(DDrawDLL,'DirectDrawEnumerateExW');
22915
{$IFDEF UNICODE}
22921
{$IFDEF UNICODE}
22916
    DirectDrawEnumerateEx := DirectDrawEnumerateExW;
22922
    DirectDrawEnumerateEx := DirectDrawEnumerateExW;
22917
{$ELSE}
22923
{$ELSE}
22918
    DirectDrawEnumerateEx := DirectDrawEnumerateExA;
22924
    DirectDrawEnumerateEx := DirectDrawEnumerateExA;
22919
{$ENDIF}
22925
{$ENDIF}
22920
 
22926
 
22921
    DirectDrawCreate := GetProcAddress(DDrawDLL,'DirectDrawCreate');
22927
    DirectDrawCreate := GetProcAddress(DDrawDLL,'DirectDrawCreate');
22922
    DirectDrawCreateEx := GetProcAddress(DDrawDLL,'DirectDrawCreateEx');
22928
    DirectDrawCreateEx := GetProcAddress(DDrawDLL,'DirectDrawCreateEx');
22923
    DirectDrawCreateClipper := GetProcAddress(DDrawDLL,'DirectDrawCreateClipper');
22929
    DirectDrawCreateClipper := GetProcAddress(DDrawDLL,'DirectDrawCreateClipper');
22924
{$IFDEF WINNT}
22930
{$IFDEF WINNT}
22925
    NtDirectDrawCreate := GetProcAddress(DDrawDLL,'NtDirectDrawCreate');
22931
    NtDirectDrawCreate := GetProcAddress(DDrawDLL,'NtDirectDrawCreate');
22926
{$ENDIF}
22932
{$ENDIF}
22927
  end;
22933
  end;
22928
  {DirectDraw}
22934
  {DirectDraw}
22929
  {Direct3D}
22935
  {Direct3D}
22930
  DisableFPUExceptions;
22936
  DisableFPUExceptions;
22931
  {$IFDEF D3DRM}
22937
  {$IFDEF D3DRM}
22932
  if not IsNTandDelphiRunning then
22938
  if not IsNTandDelphiRunning then
22933
  begin
22939
  begin
22934
    DXFileDLL := LoadLibrary('D3DXOF.DLL');
22940
    DXFileDLL := LoadLibrary('D3DXOF.DLL');
22935
    DirectXFileCreate := GetProcAddress(DXFileDLL,'DirectXFileCreate');
22941
    DirectXFileCreate := GetProcAddress(DXFileDLL,'DirectXFileCreate');
22936
  end;
22942
  end;
22937
  {Direct3D}
22943
  {Direct3D}
22938
  {Direct3DRM}
22944
  {Direct3DRM}
22939
  if not IsNTandDelphiRunning then
22945
  if not IsNTandDelphiRunning then
22940
  begin
22946
  begin
22941
    D3DRMDLL := LoadLibrary('D3DRM.dll');
22947
    D3DRMDLL := LoadLibrary('D3DRM.dll');
22942
    //d3drmdef:
22948
    //d3drmdef:
22943
    D3DRMCreateColorRGB := GetProcAddress(D3DRMDLL,'D3DRMCreateColorRGB');
22949
    D3DRMCreateColorRGB := GetProcAddress(D3DRMDLL,'D3DRMCreateColorRGB');
22944
    D3DRMCreateColorRGBA := GetProcAddress(D3DRMDLL,'D3DRMCreateColorRGBA');
22950
    D3DRMCreateColorRGBA := GetProcAddress(D3DRMDLL,'D3DRMCreateColorRGBA');
22945
    D3DRMColorGetRed := GetProcAddress(D3DRMDLL,'D3DRMColorGetRed');
22951
    D3DRMColorGetRed := GetProcAddress(D3DRMDLL,'D3DRMColorGetRed');
22946
    D3DRMColorGetGreen := GetProcAddress(D3DRMDLL,'D3DRMColorGetGreen');
22952
    D3DRMColorGetGreen := GetProcAddress(D3DRMDLL,'D3DRMColorGetGreen');
22947
    D3DRMColorGetBlue := GetProcAddress(D3DRMDLL,'D3DRMColorGetBlue');
22953
    D3DRMColorGetBlue := GetProcAddress(D3DRMDLL,'D3DRMColorGetBlue');
22948
    D3DRMColorGetAlpha := GetProcAddress(D3DRMDLL,'D3DRMColorGetAlpha');
22954
    D3DRMColorGetAlpha := GetProcAddress(D3DRMDLL,'D3DRMColorGetAlpha');
22949
    D3DRMVectorAdd := GetProcAddress(D3DRMDLL,'D3DRMVectorAdd');
22955
    D3DRMVectorAdd := GetProcAddress(D3DRMDLL,'D3DRMVectorAdd');
22950
    D3DRMVectorSubtract := GetProcAddress(D3DRMDLL,'D3DRMVectorSubtract');
22956
    D3DRMVectorSubtract := GetProcAddress(D3DRMDLL,'D3DRMVectorSubtract');
22951
    D3DRMVectorReflect := GetProcAddress(D3DRMDLL,'D3DRMVectorReflect');
22957
    D3DRMVectorReflect := GetProcAddress(D3DRMDLL,'D3DRMVectorReflect');
22952
    D3DRMVectorCrossProduct := GetProcAddress(D3DRMDLL,'D3DRMVectorCrossProduct');
22958
    D3DRMVectorCrossProduct := GetProcAddress(D3DRMDLL,'D3DRMVectorCrossProduct');
22953
    D3DRMVectorDotProduct := GetProcAddress(D3DRMDLL,'D3DRMVectorDotProduct');
22959
    D3DRMVectorDotProduct := GetProcAddress(D3DRMDLL,'D3DRMVectorDotProduct');
22954
    D3DRMVectorNormalize := GetProcAddress(D3DRMDLL,'D3DRMVectorNormalize');
22960
    D3DRMVectorNormalize := GetProcAddress(D3DRMDLL,'D3DRMVectorNormalize');
22955
    D3DRMVectorModulus := GetProcAddress(D3DRMDLL,'D3DRMVectorModulus');
22961
    D3DRMVectorModulus := GetProcAddress(D3DRMDLL,'D3DRMVectorModulus');
22956
    D3DRMVectorRotate := GetProcAddress(D3DRMDLL,'D3DRMVectorRotate');
22962
    D3DRMVectorRotate := GetProcAddress(D3DRMDLL,'D3DRMVectorRotate');
22957
    D3DRMVectorScale := GetProcAddress(D3DRMDLL,'D3DRMVectorScale');
22963
    D3DRMVectorScale := GetProcAddress(D3DRMDLL,'D3DRMVectorScale');
22958
    D3DRMVectorRandom := GetProcAddress(D3DRMDLL,'D3DRMVectorRandom');
22964
    D3DRMVectorRandom := GetProcAddress(D3DRMDLL,'D3DRMVectorRandom');
22959
    D3DRMQuaternionFromRotation := GetProcAddress(D3DRMDLL,'D3DRMQuaternionFromRotation');
22965
    D3DRMQuaternionFromRotation := GetProcAddress(D3DRMDLL,'D3DRMQuaternionFromRotation');
22960
    D3DRMQuaternionMultiply := GetProcAddress(D3DRMDLL,'D3DRMQuaternionMultiply');
22966
    D3DRMQuaternionMultiply := GetProcAddress(D3DRMDLL,'D3DRMQuaternionMultiply');
22961
    D3DRMQuaternionSlerp := GetProcAddress(D3DRMDLL,'D3DRMQuaternionSlerp');
22967
    D3DRMQuaternionSlerp := GetProcAddress(D3DRMDLL,'D3DRMQuaternionSlerp');
22962
    D3DRMMatrixFromQuaternion := GetProcAddress(D3DRMDLL,'D3DRMMatrixFromQuaternion');
22968
    D3DRMMatrixFromQuaternion := GetProcAddress(D3DRMDLL,'D3DRMMatrixFromQuaternion');
22963
    D3DRMQuaternionFromMatrix := GetProcAddress(D3DRMDLL,'D3DRMQuaternionFromMatrix');
22969
    D3DRMQuaternionFromMatrix := GetProcAddress(D3DRMDLL,'D3DRMQuaternionFromMatrix');
22964
    //d3drm:
22970
    //d3drm:
22965
    Direct3DRMCreate := GetProcAddress(D3DRMDLL,'Direct3DRMCreate');
22971
    Direct3DRMCreate := GetProcAddress(D3DRMDLL,'Direct3DRMCreate');
22966
  end;
22972
  end;
22967
  {$ENDIF}
22973
  {$ENDIF}
22968
  {Direct3DRM}
22974
  {Direct3DRM}
22969
  {DirectInput}
22975
  {DirectInput}
22970
  Init_c_dfDIKeyboard_Objects;  // set kbd GUIDs & flags
22976
  Init_c_dfDIKeyboard_Objects;  // set kbd GUIDs & flags
22971
  Init_c_dfDIJoystick2_Objects;  // construct Joystick2 from Joystick fmt
22977
  Init_c_dfDIJoystick2_Objects;  // construct Joystick2 from Joystick fmt
22972
 
22978
 
22973
  if not IsNTandDelphiRunning then
22979
  if not IsNTandDelphiRunning then
22974
  begin
22980
  begin
22975
    DInputDLL := LoadLibrary('DInput.dll');
22981
    DInputDLL := LoadLibrary('DInput.dll');
22976
 
22982
 
22977
    DirectInputCreateA := GetProcAddress(DInputDLL,'DirectInputCreateA');
22983
    DirectInputCreateA := GetProcAddress(DInputDLL,'DirectInputCreateA');
22978
    DirectInputCreateW := GetProcAddress(DInputDLL,'DirectInputCreateW');
22984
    DirectInputCreateW := GetProcAddress(DInputDLL,'DirectInputCreateW');
22979
    // no A/W version
22985
    // no A/W version
22980
    DirectInputCreateEx := GetProcAddress(DInputDLL,'DirectInputCreateEx');
22986
    DirectInputCreateEx := GetProcAddress(DInputDLL,'DirectInputCreateEx');
22981
{$IFDEF UNICODE}
22987
{$IFDEF UNICODE}
22982
    DirectInputCreate := DirectInputCreateW;
22988
    DirectInputCreate := DirectInputCreateW;
22983
{$ELSE}
22989
{$ELSE}
22984
    DirectInputCreate := DirectInputCreateA;
22990
    DirectInputCreate := DirectInputCreateA;
22985
{$ENDIF}
22991
{$ENDIF}
22986
  end;
22992
  end;
22987
  {DirectInput}
22993
  {DirectInput}
22988
  {DirectPlay}
22994
  {DirectPlay}
-
 
22995
  {$IFDEF UseDirectPlay} // Daniel Marschall 12.04.2024 Added to avoid Windows showing "This app requires DirectPlay"
22989
  if not IsNTandDelphiRunning then
22996
  if not IsNTandDelphiRunning then
22990
  begin
22997
  begin
22991
    DPlayDLL := LoadLibrary('DPlayX.dll');
22998
    DPlayDLL := LoadLibrary('DPlayX.dll');
22992
 
22999
 
22993
    DirectPlayEnumerateA := GetProcAddress(DPlayDLL,'DirectPlayEnumerateA');
23000
    DirectPlayEnumerateA := GetProcAddress(DPlayDLL,'DirectPlayEnumerateA');
22994
    DirectPlayEnumerateW := GetProcAddress(DPlayDLL,'DirectPlayEnumerateW');
23001
    DirectPlayEnumerateW := GetProcAddress(DPlayDLL,'DirectPlayEnumerateW');
22995
  {$IFDEF UNICODE}
23002
  {$IFDEF UNICODE}
22996
    DirectPlayEnumerate := DirectPlayEnumerateW;
23003
    DirectPlayEnumerate := DirectPlayEnumerateW;
22997
  {$ELSE}
23004
  {$ELSE}
22998
    DirectPlayEnumerate := DirectPlayEnumerateA;
23005
    DirectPlayEnumerate := DirectPlayEnumerateA;
22999
  {$ENDIF}
23006
  {$ENDIF}
23000
 
23007
 
23001
    DirectPlayCreate := GetProcAddress(DPlayDLL,'DirectPlayCreate');
23008
    DirectPlayCreate := GetProcAddress(DPlayDLL,'DirectPlayCreate');
23002
 
23009
 
23003
//  File:       dplay.h
23010
//  File:       dplay.h
23004
 
23011
 
23005
    DirectPlayLobbyCreateW := GetProcAddress(DPlayDLL,'DirectPlayLobbyCreateW');
23012
    DirectPlayLobbyCreateW := GetProcAddress(DPlayDLL,'DirectPlayLobbyCreateW');
23006
    DirectPlayLobbyCreateA := GetProcAddress(DPlayDLL,'DirectPlayLobbyCreateA');
23013
    DirectPlayLobbyCreateA := GetProcAddress(DPlayDLL,'DirectPlayLobbyCreateA');
23007
  {$IFDEF UNICODE}
23014
  {$IFDEF UNICODE}
23008
    DirectPlayLobbyCreate := DirectPlayLobbyCreateW;
23015
    DirectPlayLobbyCreate := DirectPlayLobbyCreateW;
23009
  {$ELSE}
23016
  {$ELSE}
23010
    DirectPlayLobbyCreate := DirectPlayLobbyCreateA;
23017
    DirectPlayLobbyCreate := DirectPlayLobbyCreateA;
23011
  {$ENDIF}
23018
  {$ENDIF}
23012
 
23019
 
23013
  end;
23020
  end;
-
 
23021
  {$ENDIF} // UseDirectPlay
23014
  {DirectPlay}
23022
  {DirectPlay}
23015
  {DirectSetup}
23023
  {DirectSetup}
23016
  if not IsNTandDelphiRunning then
23024
  if not IsNTandDelphiRunning then
23017
  begin
23025
  begin
23018
    LoadDSetup;
23026
    LoadDSetup;
23019
  end;
23027
  end;
23020
  {DirectSetup}
23028
  {DirectSetup}
23021
  {DirectSound}
23029
  {DirectSound}
23022
  if not IsNTandDelphiRunning then
23030
  if not IsNTandDelphiRunning then
23023
  begin
23031
  begin
23024
    DSoundDLL := LoadLibrary('DSound.dll');
23032
    DSoundDLL := LoadLibrary('DSound.dll');
23025
    DirectSoundCreate := GetProcAddress(DSoundDLL,'DirectSoundCreate');
23033
    DirectSoundCreate := GetProcAddress(DSoundDLL,'DirectSoundCreate');
23026
 
23034
 
23027
    DirectSoundEnumerateW := GetProcAddress(DSoundDLL,'DirectSoundEnumerateW');
23035
    DirectSoundEnumerateW := GetProcAddress(DSoundDLL,'DirectSoundEnumerateW');
23028
    DirectSoundEnumerateA := GetProcAddress(DSoundDLL,'DirectSoundEnumerateA');
23036
    DirectSoundEnumerateA := GetProcAddress(DSoundDLL,'DirectSoundEnumerateA');
23029
  {$IFDEF UNICODE}
23037
  {$IFDEF UNICODE}
23030
    DirectSoundEnumerate := DirectSoundEnumerateW;
23038
    DirectSoundEnumerate := DirectSoundEnumerateW;
23031
  {$ELSE}
23039
  {$ELSE}
23032
    DirectSoundEnumerate := DirectSoundEnumerateA;
23040
    DirectSoundEnumerate := DirectSoundEnumerateA;
23033
  {$ENDIF}
23041
  {$ENDIF}
23034
 
23042
 
23035
    DirectSoundCaptureCreate :=
23043
    DirectSoundCaptureCreate :=
23036
        GetProcAddress(DSoundDLL,'DirectSoundCaptureCreate');
23044
        GetProcAddress(DSoundDLL,'DirectSoundCaptureCreate');
23037
 
23045
 
23038
    DirectSoundCaptureEnumerateW :=
23046
    DirectSoundCaptureEnumerateW :=
23039
        GetProcAddress(DSoundDLL,'DirectSoundCaptureEnumerateW');
23047
        GetProcAddress(DSoundDLL,'DirectSoundCaptureEnumerateW');
23040
    DirectSoundCaptureEnumerateA :=
23048
    DirectSoundCaptureEnumerateA :=
23041
        GetProcAddress(DSoundDLL,'DirectSoundCaptureEnumerateA');
23049
        GetProcAddress(DSoundDLL,'DirectSoundCaptureEnumerateA');
23042
  {$IFDEF UNICODE}
23050
  {$IFDEF UNICODE}
23043
    DirectSoundCaptureEnumerate := DirectSoundCaptureEnumerateW;
23051
    DirectSoundCaptureEnumerate := DirectSoundCaptureEnumerateW;
23044
  {$ELSE}
23052
  {$ELSE}
23045
    DirectSoundCaptureEnumerate := DirectSoundCaptureEnumerateA;
23053
    DirectSoundCaptureEnumerate := DirectSoundCaptureEnumerateA;
23046
  {$ENDIF}
23054
  {$ENDIF}
23047
  end;
23055
  end;
23048
  {DirectSound}
23056
  {DirectSound}
23049
end;
23057
end;
23050
 
23058
 
23051
finalization
23059
finalization
23052
begin
23060
begin
23053
  {DirectDraw}
23061
  {DirectDraw}
23054
  if DDrawDLL <> 0 then FreeLibrary(DDrawDLL);
23062
  if DDrawDLL <> 0 then FreeLibrary(DDrawDLL);
23055
  {DirectDraw}
23063
  {DirectDraw}
23056
  {Direct3D}
23064
  {Direct3D}
23057
  FreeLibrary(DXFileDLL);
23065
  FreeLibrary(DXFileDLL);
23058
  {Direct3D}
23066
  {Direct3D}
23059
  {Direct3DRM}
23067
  {Direct3DRM}
23060
  {$IFDEF D3DRM}
23068
  {$IFDEF D3DRM}
23061
  if D3DRMDLL <> 0 then FreeLibrary(D3DRMDLL);
23069
  if D3DRMDLL <> 0 then FreeLibrary(D3DRMDLL);
23062
  {$ENDIF}
23070
  {$ENDIF}
23063
  {Direct3DRM}
23071
  {Direct3DRM}
23064
  {DirectInput}
23072
  {DirectInput}
23065
  FreeLibrary(DInputDLL);
23073
  FreeLibrary(DInputDLL);
23066
  {DirectInput}
23074
  {DirectInput}
23067
  {DirectPlay}
23075
  {DirectPlay}
-
 
23076
  {$IFDEF UseDirectPlay} // Daniel Marschall 12.04.2024 Added to avoid Windows showing "This app requires DirectPlay"
23068
  if DPlayDLL <> 0 then FreeLibrary(DPlayDLL);
23077
  if DPlayDLL <> 0 then FreeLibrary(DPlayDLL);
-
 
23078
  {$ENDIF} // UseDirectPlay
23069
  {DirectPlay}
23079
  {DirectPlay}
23070
  {DirectSetup}
23080
  {DirectSetup}
23071
  FreeLibrary(DSetupDLL);
23081
  FreeLibrary(DSetupDLL);
23072
  {DirectSetup}
23082
  {DirectSetup}
23073
  {DirectSound}
23083
  {DirectSound}
23074
  FreeLibrary(DSoundDLL);
23084
  FreeLibrary(DSoundDLL);
23075
  {DirectSound}
23085
  {DirectSound}
23076
end;
23086
end;
23077
 
23087
 
23078
 
23088
 
23079
End.
23089
End.