~ubuntu-branches/ubuntu/lucid/fpc/lucid-proposed

« back to all changes in this revision

Viewing changes to fpcsrc/packages/ptc/src/win32/directx/directdr.pp

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-10-09 23:29:00 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20081009232900-553f61m37jkp6upv
Tags: 2.2.2-4
[ Torsten Werner ]
* Update ABI version in fpc-depends automatically.
* Remove empty directories from binary package fpc-source.

[ Mazen Neifer ]
* Removed leading path when calling update-alternatives to remove a Linitian
  error.
* Fixed clean target.
* Improved description of packages. (Closes: #498882)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{
 
2
    Free Pascal port of the OpenPTC C++ library.
 
3
    Copyright (C) 2001-2003  Nikolay Nikolov (nickysn@users.sourceforge.net)
 
4
    Original C++ version by Glenn Fiedler (ptc@gaffer.org)
 
5
 
 
6
    This library is free software; you can redistribute it and/or
 
7
    modify it under the terms of the GNU Lesser General Public
 
8
    License as published by the Free Software Foundation; either
 
9
    version 2.1 of the License, or (at your option) any later version.
 
10
 
 
11
    This library is distributed in the hope that it will be useful,
 
12
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
    Lesser General Public License for more details.
 
15
 
 
16
    You should have received a copy of the GNU Lesser General Public
 
17
    License along with this library; if not, write to the Free Software
 
18
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
19
}
 
20
 
 
21
{$MACRO ON}
 
22
{$DEFINE DXCall:=StdCall}
 
23
{$PACKRECORDS 1}
 
24
 
 
25
Unit DirectDraw;
 
26
 
 
27
Interface
 
28
 
 
29
Uses
 
30
  Windows;
 
31
 
 
32
Type
 
33
  LPGUID = ^GUID;
 
34
  GUID = Packed Record
 
35
    Data1 : DWord;
 
36
    Data2 : Word;
 
37
    Data3 : Word;
 
38
    Data4 : Array[0..7] Of Byte;
 
39
  End;
 
40
 
 
41
{;
 
42
; FOURCC codes for DX compressed-texture pixel formats
 
43
;
 
44
 
 
45
FOURCC_DXT1                     = '1TXD'
 
46
FOURCC_DXT2                     = '2TXD'
 
47
FOURCC_DXT3                     = '3TXD'
 
48
FOURCC_DXT4                     = '4TXD'
 
49
FOURCC_DXT5                     = '5TXD'
 
50
 
 
51
;
 
52
; GUIDS used by DirectDraw objects
 
53
;
 
54
 
 
55
macro   Define_CLSID_DirectDraw
 
56
public  CLSID_DirectDraw
 
57
CLSID_DirectDraw        GUID <0D7B70EE0h,04340h,011CFh,\
 
58
                        0B0h,063h,000h,020h,0AFh,0C2h,0CDh,035h>
 
59
endm
 
60
 
 
61
macro   Define_CLSID_DirectDrawClipper
 
62
public  CLSID_DirectDrawClipper
 
63
CLSID_DirectDrawClipper GUID <0593817A0h,07DB3h,011CFh,\
 
64
                        0A2h,0DEh,000h,0AAh,000h,0b9h,033h,056h>
 
65
endm
 
66
 
 
67
macro   Define_IID_IDirectDraw
 
68
public  IID_IDirectDraw
 
69
IID_IDirectDraw         GUID <06C14DB80h,0A733h,011CEh,\
 
70
                        0A5h,021h,000h,020h,0AFh,00Bh,0E5h,060h>
 
71
endm
 
72
 
 
73
macro   Define_IID_IDirectDraw2
 
74
public  IID_IDirectDraw2
 
75
IID_IDirectDraw2        GUID <0B3A6F3E0h,02B43h,011CFh,\
 
76
                        0A2h,0DEh,000h,0AAh,000h,0B9h,033h,056h>
 
77
endm
 
78
 
 
79
macro   Define_IID_IDirectDraw4
 
80
public  IID_IDirectDraw4
 
81
IID_IDirectDraw4        GUID <09c59509ah,039bdh,011d1h,\
 
82
                        08ch,04ah,000h,0c0h,04fh,0d9h,030h,0c5h>
 
83
endm
 
84
 
 
85
macro   Define_IID_IDirectDrawSurface
 
86
public  IID_IDirectDrawSurface
 
87
IID_IDirectDrawSurface  GUID <06C14DB81h,0A733h,011CEh,\
 
88
                        0A5h,021h,000h,020h,0AFh,00Bh,0E5h,060h>
 
89
endm
 
90
 
 
91
macro   Define_IID_IDirectDrawSurface2
 
92
public  IID_IDirectDrawSurface2
 
93
IID_IDirectDrawSurface2 GUID <057805885h,06eech,011cfh,\
 
94
                        094h,041h,0a8h,023h,003h,0c1h,00eh,027h>
 
95
endm
 
96
 
 
97
macro   Define_IID_IDirectDrawSurface3
 
98
public  IID_IDirectDrawSurface3
 
99
IID_IDirectDrawSurface3 GUID <0DA044E00h,069B2h,011D0h,\
 
100
                        0A1h,0D5h,000h,0AAh,000h,0B8h,0DFh,0BBh>
 
101
endm
 
102
 
 
103
macro   Define_IID_IDirectDrawSurface4
 
104
public  IID_IDirectDrawSurface4
 
105
IID_IDirectDrawSurface4 GUID <00B2B8630h,0AD35h,011D0h,\
 
106
                        08Eh,0A6h,000h,060h,097h,097h,0EAh,05Bh>
 
107
endm
 
108
 
 
109
macro   Define_IID_IDirectDrawPalette
 
110
public  IID_IDirectDrawPalette
 
111
IID_IDirectDrawPalette  GUID <06C14DB84h,0A733h,011CEh,\
 
112
                        0A5h,021h,000h,020h,0AFh,00Bh,0E5h,060h>
 
113
endm
 
114
 
 
115
macro   Define_IID_IDirectDrawClipper
 
116
public  IID_IDirectDrawClipper
 
117
IID_IDirectDrawClipper  GUID <06C14DB85h,0A733h,011CEh,\
 
118
                        0A5h,021h,000h,020h,0AFh,00Bh,0E5h,060h>
 
119
endm
 
120
 
 
121
macro   Define_IID_IDirectDrawColorControl
 
122
public  IID_IDirectDrawColorControl
 
123
IID_IDirectDrawColorControl GUID <04B9F0EE0h,00D7Eh,011D0h,\
 
124
                        09Bh,006h,000h,0A0h,0C9h,003h,0A3h,0B8h>
 
125
endm
 
126
 
 
127
macro   Define_IID_IDirectDrawGammaControl
 
128
public  IID_IDirectDrawGammaControl
 
129
IID_IDirectDrawGammaControl GUID <069C11C3Eh,0B46Bh,011D1h,\
 
130
                            0ADh,07Ah,000h,0C0h,04Fh,0C2h,09Bh,04Eh>
 
131
endm}
 
132
 
 
133
Const
 
134
  CO_E_NOTINITIALIZED = $800401F0;
 
135
  _FACDD = $0876;
 
136
 
 
137
{
 
138
 Flags for DirectDrawEnumerateEx
 
139
 DirectDrawEnumerateEx supercedes DirectDrawEnumerate. You must use GetProcAddress to
 
140
 obtain a function pointer (of type LPDIRECTDRAWENUMERATEEX) to DirectDrawEnumerateEx.
 
141
 By default, only the primary display device is enumerated.
 
142
 DirectDrawEnumerate is equivalent to DirectDrawEnumerate(,,DDENUM_NONDISPLAYDEVICES)
 
143
}
 
144
 
 
145
  DDENUM_ATTACHEDSECONDARYDEVICES = $00000001;
 
146
  DDENUM_DETACHEDSECONDARYDEVICES = $00000002;
 
147
  DDENUM_NONDISPLAYDEVICES        = $00000004;
 
148
 
 
149
{REGSTR_KEY_DDHW_DESCRIPTION    equ <'Description', 0>
 
150
REGSTR_KEY_DDHW_DRIVERNAME      equ <'DriverName', 0>
 
151
REGSTR_PATH_DDHW                equ <'Hardware\DirectDrawDrivers', 0>}
 
152
 
 
153
  DDCREATE_HARDWAREONLY  = $00000001;
 
154
  DDCREATE_EMULATIONONLY = $00000002;
 
155
 
 
156
{proctype DDENUMMODESCALLBACK :dword, :dword
 
157
proctype DDENUMMODESCALLBACK2 :dword, :dword
 
158
proctype DDENUMSURFACESCALLBACK :dword, :dword, :dword
 
159
proctype DDENUMSURFACESCALLBACK2 :dword, :dword, :dword}
 
160
 
 
161
  DD_ROP_SPACE = (256 Div 32); {space required to store ROP array}
 
162
 
 
163
  DDSD_CAPS            = $00000001;    {default}
 
164
  DDSD_HEIGHT          = $00000002;
 
165
  DDSD_WIDTH           = $00000004;
 
166
  DDSD_PITCH           = $00000008;
 
167
  DDSD_BACKBUFFERCOUNT = $00000020;
 
168
  DDSD_ZBUFFERBITDEPTH = $00000040;
 
169
  DDSD_ALPHABITDEPTH   = $00000080;
 
170
  DDSD_LPSURFACE       = $00000800;
 
171
  DDSD_PIXELFORMAT     = $00001000;
 
172
  DDSD_CKDESTOVERLAY   = $00002000;
 
173
  DDSD_CKDESTBLT       = $00004000;
 
174
  DDSD_CKSRCOVERLAY    = $00008000;
 
175
  DDSD_CKSRCBLT        = $00010000;
 
176
  DDSD_MIPMAPCOUNT     = $00020000;
 
177
  DDSD_REFRESHRATE     = $00040000;
 
178
  DDSD_LINEARSIZE      = $00080000;
 
179
  DDSD_TEXTURESTAGE    = $00100000;
 
180
  DDSD_ALL             = $001ff9ee;
 
181
 
 
182
  DDOSD_GUID                 = $00000001;
 
183
  DDOSD_COMPRESSION_RATIO    = $00000002;
 
184
  DDOSD_SCAPS                = $00000004;
 
185
  DDOSD_OSCAPS               = $00000008;
 
186
  DDOSD_ALL                  = $0000000f;
 
187
  DDOSDCAPS_OPTCOMPRESSED    = $00000001;
 
188
  DDOSDCAPS_OPTREORDERED     = $00000002;
 
189
  DDOSDCAPS_MONOLITHICMIPMAP = $00000004;
 
190
  DDOSDCAPS_VALIDSCAPS       = $30004800;
 
191
  DDOSDCAPS_VALIDOSCAPS      = $00000007;
 
192
 
 
193
  DDCOLOR_BRIGHTNESS  = $00000001;
 
194
  DDCOLOR_CONTRAST    = $00000002;
 
195
  DDCOLOR_HUE         = $00000004;
 
196
  DDCOLOR_SATURATION  = $00000008;
 
197
  DDCOLOR_SHARPNESS   = $00000010;
 
198
  DDCOLOR_GAMMA       = $00000020;
 
199
  DDCOLOR_COLORENABLE = $00000040;
 
200
 
 
201
{============================================================================
 
202
 
 
203
  Direct Draw Capability Flags
 
204
 
 
205
  These flags are used to describe the capabilities of a given Surface.
 
206
  All flags are bit flags.
 
207
 
 
208
 ==========================================================================}
 
209
 
 
210
{***************************************************************************
 
211
 *
 
212
 * DIRECTDRAWSURFACE CAPABILITY FLAGS
 
213
 *
 
214
 ***************************************************************************}
 
215
 
 
216
 
 
217
  DDSCAPS_RESERVED1          = $00000001;
 
218
  DDSCAPS_ALPHA              = $00000002;
 
219
  DDSCAPS_BACKBUFFER         = $00000004;
 
220
  DDSCAPS_COMPLEX            = $00000008;
 
221
  DDSCAPS_FLIP               = $00000010;
 
222
  DDSCAPS_FRONTBUFFER        = $00000020;
 
223
  DDSCAPS_OFFSCREENPLAIN     = $00000040;
 
224
  DDSCAPS_OVERLAY            = $00000080;
 
225
  DDSCAPS_PALETTE            = $00000100;
 
226
  DDSCAPS_PRIMARYSURFACE     = $00000200;
 
227
  DDSCAPS_PRIMARYSURFACELEFT = $00000400;
 
228
  DDSCAPS_SYSTEMMEMORY       = $00000800;
 
229
  DDSCAPS_TEXTURE            = $00001000;
 
230
  DDSCAPS_3DDEVICE           = $00002000;
 
231
  DDSCAPS_VIDEOMEMORY        = $00004000;
 
232
  DDSCAPS_VISIBLE            = $00008000;
 
233
  DDSCAPS_WRITEONLY          = $00010000;
 
234
  DDSCAPS_ZBUFFER            = $00020000;
 
235
  DDSCAPS_OWNDC              = $00040000;
 
236
  DDSCAPS_LIVEVIDEO          = $00080000;
 
237
  DDSCAPS_HWCODEC            = $00100000;
 
238
  DDSCAPS_MODEX              = $00200000;
 
239
  DDSCAPS_MIPMAP             = $00400000;
 
240
  DDSCAPS_RESERVED2          = $00800000;
 
241
  DDSCAPS_ALLOCONLOAD        = $04000000;
 
242
  DDSCAPS_VIDEOPORT          = $08000000;
 
243
  DDSCAPS_LOCALVIDMEM        = $10000000;
 
244
  DDSCAPS_NONLOCALVIDMEM     = $20000000;
 
245
  DDSCAPS_STANDARDVGAMODE    = $40000000;
 
246
  DDSCAPS_OPTIMIZED          = $80000000;
 
247
 
 
248
  DDSCAPS2_HARDWAREDEINTERLACE = $00000002;
 
249
  DDSCAPS2_HINTDYNAMIC         = $00000004;
 
250
  DDSCAPS2_HINTSTATIC          = $00000008;
 
251
  DDSCAPS2_TEXTUREMANAGE       = $00000010;
 
252
  DDSCAPS2_RESERVED1           = $00000020;
 
253
  DDSCAPS2_RESERVED2           = $00000040;
 
254
  DDSCAPS2_OPAQUE              = $00000080;
 
255
  DDSCAPS2_HINTANTIALIASING    = $00000100;
 
256
 
 
257
{***************************************************************************
 
258
 *
 
259
 * DIRECTDRAW DRIVER CAPABILITY FLAGS
 
260
 *
 
261
 ***************************************************************************}
 
262
 
 
263
  DDCAPS_3D                = $00000001;
 
264
  DDCAPS_ALIGNBOUNDARYDEST = $00000002;
 
265
  DDCAPS_ALIGNSIZEDEST     = $00000004;
 
266
  DDCAPS_ALIGNBOUNDARYSRC  = $00000008;
 
267
  DDCAPS_ALIGNSIZESRC      = $00000010;
 
268
  DDCAPS_ALIGNSTRIDE       = $00000020;
 
269
  DDCAPS_BLT               = $00000040;
 
270
  DDCAPS_BLTQUEUE          = $00000080;
 
271
  DDCAPS_BLTFOURCC         = $00000100;
 
272
  DDCAPS_BLTSTRETCH        = $00000200;
 
273
  DDCAPS_GDI               = $00000400;
 
274
  DDCAPS_OVERLAY           = $00000800;
 
275
  DDCAPS_OVERLAYCANTCLIP   = $00001000;
 
276
  DDCAPS_OVERLAYFOURCC     = $00002000;
 
277
  DDCAPS_OVERLAYSTRETCH    = $00004000;
 
278
  DDCAPS_PALETTE           = $00008000;
 
279
  DDCAPS_PALETTEVSYNC      = $00010000;
 
280
  DDCAPS_READSCANLINE      = $00020000;
 
281
  DDCAPS_STEREOVIEW        = $00040000;
 
282
  DDCAPS_VBI               = $00080000;
 
283
  DDCAPS_ZBLTS             = $00100000;
 
284
  DDCAPS_ZOVERLAYS         = $00200000;
 
285
  DDCAPS_COLORKEY          = $00400000;
 
286
  DDCAPS_ALPHA             = $00800000;
 
287
  DDCAPS_COLORKEYHWASSIST  = $01000000;
 
288
  DDCAPS_NOHARDWARE        = $02000000;
 
289
  DDCAPS_BLTCOLORFILL      = $04000000;
 
290
  DDCAPS_BANKSWITCHED      = $08000000;
 
291
  DDCAPS_BLTDEPTHFILL      = $10000000;
 
292
  DDCAPS_CANCLIP           = $20000000;
 
293
  DDCAPS_CANCLIPSTRETCHED  = $40000000;
 
294
  DDCAPS_CANBLTSYSMEM      = $80000000;
 
295
 
 
296
{***************************************************************************
 
297
 *
 
298
 * MORE DIRECTDRAW DRIVER CAPABILITY FLAGS (dwCaps2)
 
299
 *
 
300
 ***************************************************************************}
 
301
 
 
302
  DDCAPS2_CERTIFIED            = $00000001;
 
303
  DDCAPS2_NO2DDURING3DSCENE    = $00000002;
 
304
  DDCAPS2_VIDEOPORT            = $00000004;
 
305
  DDCAPS2_AUTOFLIPOVERLAY      = $00000008;
 
306
  DDCAPS2_CANBOBINTERLEAVED    = $00000010;
 
307
  DDCAPS2_CANBOBNONINTERLEAVED = $00000020;
 
308
  DDCAPS2_COLORCONTROLOVERLAY  = $00000040;
 
309
  DDCAPS2_COLORCONTROLPRIMARY  = $00000080;
 
310
  DDCAPS2_CANDROPZ16BIT        = $00000100;
 
311
  DDCAPS2_NONLOCALVIDMEM       = $00000200;
 
312
  DDCAPS2_NONLOCALVIDMEMCAPS   = $00000400;
 
313
  DDCAPS2_NOPAGELOCKREQUIRED   = $00000800;
 
314
  DDCAPS2_WIDESURFACES         = $00001000;
 
315
  DDCAPS2_CANFLIPODDEVEN       = $00002000;
 
316
  DDCAPS2_CANBOBHARDWARE       = $00004000;
 
317
  DDCAPS2_COPYFOURCC           = $00008000;
 
318
  DDCAPS2_PRIMARYGAMMA         = $00020000;
 
319
  DDCAPS2_CANRENDERWINDOWED    = $00080000;
 
320
  DDCAPS2_CANCALIBRATEGAMMA    = $00100000;
 
321
  DDCAPS2_FLIPINTERVAL         = $00200000;
 
322
  DDCAPS2_FLIPNOVSYNC          = $00400000;
 
323
 
 
324
{***************************************************************************
 
325
 *
 
326
 * DIRECTDRAW FX ALPHA CAPABILITY FLAGS
 
327
 *
 
328
 ***************************************************************************}
 
329
 
 
330
  DDFXALPHACAPS_BLTALPHAEDGEBLEND       = $00000001;
 
331
  DDFXALPHACAPS_BLTALPHAPIXELS          = $00000002;
 
332
  DDFXALPHACAPS_BLTALPHAPIXELSNEG       = $00000004;
 
333
  DDFXALPHACAPS_BLTALPHASURFACES        = $00000008;
 
334
  DDFXALPHACAPS_BLTALPHASURFACESNEG     = $00000010;
 
335
  DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND   = $00000020;
 
336
  DDFXALPHACAPS_OVERLAYALPHAPIXELS      = $00000040;
 
337
  DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG   = $00000080;
 
338
  DDFXALPHACAPS_OVERLAYALPHASURFACES    = $00000100;
 
339
  DDFXALPHACAPS_OVERLAYALPHASURFACESNEG = $00000200;
 
340
 
 
341
{***************************************************************************
 
342
 *
 
343
 * DIRECTDRAW FX CAPABILITY FLAGS
 
344
 *
 
345
 ***************************************************************************}
 
346
 
 
347
  DDFXCAPS_BLTARITHSTRETCHY       = $00000020;
 
348
  DDFXCAPS_BLTARITHSTRETCHYN      = $00000010;
 
349
  DDFXCAPS_BLTMIRRORLEFTRIGHT     = $00000040;
 
350
  DDFXCAPS_BLTMIRRORUPDOWN        = $00000080;
 
351
  DDFXCAPS_BLTROTATION            = $00000100;
 
352
  DDFXCAPS_BLTROTATION90          = $00000200;
 
353
  DDFXCAPS_BLTSHRINKX             = $00000400;
 
354
  DDFXCAPS_BLTSHRINKXN            = $00000800;
 
355
  DDFXCAPS_BLTSHRINKY             = $00001000;
 
356
  DDFXCAPS_BLTSHRINKYN            = $00002000;
 
357
  DDFXCAPS_BLTSTRETCHX            = $00004000;
 
358
  DDFXCAPS_BLTSTRETCHXN           = $00008000;
 
359
  DDFXCAPS_BLTSTRETCHY            = $00010000;
 
360
  DDFXCAPS_BLTSTRETCHYN           = $00020000;
 
361
  DDFXCAPS_OVERLAYARITHSTRETCHY   = $00040000;
 
362
  DDFXCAPS_OVERLAYARITHSTRETCHYN  = $00000008;
 
363
  DDFXCAPS_OVERLAYSHRINKX         = $00080000;
 
364
  DDFXCAPS_OVERLAYSHRINKXN        = $00100000;
 
365
  DDFXCAPS_OVERLAYSHRINKY         = $00200000;
 
366
  DDFXCAPS_OVERLAYSHRINKYN        = $00400000;
 
367
  DDFXCAPS_OVERLAYSTRETCHX        = $00800000;
 
368
  DDFXCAPS_OVERLAYSTRETCHXN       = $01000000;
 
369
  DDFXCAPS_OVERLAYSTRETCHY        = $02000000;
 
370
  DDFXCAPS_OVERLAYSTRETCHYN       = $04000000;
 
371
  DDFXCAPS_OVERLAYMIRRORLEFTRIGHT = $08000000;
 
372
  DDFXCAPS_OVERLAYMIRRORUPDOWN    = $10000000;
 
373
  DDFXCAPS_BLTALPHA               = $00000001;
 
374
  DDFXCAPS_BLTTRANSFORM           = $00000002;
 
375
  DDFXCAPS_BLTFILTER              = DDFXCAPS_BLTARITHSTRETCHY;
 
376
  DDFXCAPS_OVERLAYALPHA           = $00000004;
 
377
  DDFXCAPS_OVERLAYTRANSFORM       = $20000000;
 
378
  DDFXCAPS_OVERLAYFILTER          = DDFXCAPS_OVERLAYARITHSTRETCHY;
 
379
 
 
380
{***************************************************************************
 
381
 *
 
382
 * DIRECTDRAW STEREO VIEW CAPABILITIES
 
383
 *
 
384
 ***************************************************************************}
 
385
 
 
386
  DDSVCAPS_ENIGMA  = $00000001;
 
387
  DDSVCAPS_FLICKER = $00000002;
 
388
  DDSVCAPS_REDBLUE = $00000004;
 
389
  DDSVCAPS_SPLIT   = $00000008;
 
390
 
 
391
{***************************************************************************
 
392
 *
 
393
 * DIRECTDRAWPALETTE CAPABILITIES
 
394
 *
 
395
 ***************************************************************************}
 
396
 
 
397
  DDPCAPS_4BIT               = $00000001;
 
398
  DDPCAPS_8BITENTRIES        = $00000002;
 
399
  DDPCAPS_8BIT               = $00000004;
 
400
  DDPCAPS_INITIALIZE         = $00000008;
 
401
  DDPCAPS_PRIMARYSURFACE     = $00000010;
 
402
  DDPCAPS_PRIMARYSURFACELEFT = $00000020;
 
403
  DDPCAPS_ALLOW256           = $00000040;
 
404
  DDPCAPS_VSYNC              = $00000080;
 
405
  DDPCAPS_1BIT               = $00000100;
 
406
  DDPCAPS_2BIT               = $00000200;
 
407
  DDPCAPS_ALPHA              = $00000400;
 
408
 
 
409
{***************************************************************************
 
410
 *
 
411
 * DIRECTDRAWSURFACE SETPRIVATEDATA CONSTANTS
 
412
 *
 
413
 ***************************************************************************}
 
414
 
 
415
  DDSPD_IUNKNOWNPOINTER = $00000001;
 
416
  DDSPD_VOLATILE        = $00000002;
 
417
 
 
418
{***************************************************************************
 
419
 *
 
420
 * DIRECTDRAW BITDEPTH CONSTANTS
 
421
 *
 
422
 * NOTE:  These are only used to indicate supported bit depths.   These
 
423
 * are flags only, they are not to be used as an actual bit depth.   The
 
424
 * absolute numbers 1, 2, 4, 8, 16, 24 and 32 are used to indicate actual
 
425
 * bit depths in a surface or for changing the display mode.
 
426
 *
 
427
 ***************************************************************************}
 
428
 
 
429
  DDBD_1  = $00004000;
 
430
  DDBD_2  = $00002000;
 
431
  DDBD_4  = $00001000;
 
432
  DDBD_8  = $00000800;
 
433
  DDBD_16 = $00000400;
 
434
  DDBD_24 = $00000200;
 
435
  DDBD_32 = $00000100;
 
436
 
 
437
{***************************************************************************
 
438
 *
 
439
 * DIRECTDRAWSURFACE SET/GET COLOR KEY FLAGS
 
440
 *
 
441
 ***************************************************************************}
 
442
 
 
443
  DDCKEY_COLORSPACE  = $00000001;
 
444
  DDCKEY_DESTBLT     = $00000002;
 
445
  DDCKEY_DESTOVERLAY = $00000004;
 
446
  DDCKEY_SRCBLT      = $00000008;
 
447
  DDCKEY_SRCOVERLAY  = $00000010;
 
448
 
 
449
{***************************************************************************
 
450
 *
 
451
 * DIRECTDRAW COLOR KEY CAPABILITY FLAGS
 
452
 *
 
453
 ***************************************************************************}
 
454
 
 
455
DDCKEYCAPS_DESTBLT                = $00000001;
 
456
DDCKEYCAPS_DESTBLTCLRSPACE        = $00000002;
 
457
DDCKEYCAPS_DESTBLTCLRSPACEYUV     = $00000004;
 
458
DDCKEYCAPS_DESTBLTYUV             = $00000008;
 
459
DDCKEYCAPS_DESTOVERLAY            = $00000010;
 
460
DDCKEYCAPS_DESTOVERLAYCLRSPACE    = $00000020;
 
461
DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV = $00000040;
 
462
DDCKEYCAPS_DESTOVERLAYONEACTIVE   = $00000080;
 
463
DDCKEYCAPS_DESTOVERLAYYUV         = $00000100;
 
464
DDCKEYCAPS_SRCBLT                 = $00000200;
 
465
DDCKEYCAPS_SRCBLTCLRSPACE         = $00000400;
 
466
DDCKEYCAPS_SRCBLTCLRSPACEYUV      = $00000800;
 
467
DDCKEYCAPS_SRCBLTYUV              = $00001000;
 
468
DDCKEYCAPS_SRCOVERLAY             = $00002000;
 
469
DDCKEYCAPS_SRCOVERLAYCLRSPACE     = $00004000;
 
470
DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV  = $00008000;
 
471
DDCKEYCAPS_SRCOVERLAYONEACTIVE    = $00010000;
 
472
DDCKEYCAPS_SRCOVERLAYYUV          = $00020000;
 
473
DDCKEYCAPS_NOCOSTOVERLAY          = $00040000;
 
474
 
 
475
{***************************************************************************
 
476
 *
 
477
 * DIRECTDRAW PIXELFORMAT FLAGS
 
478
 *
 
479
 ***************************************************************************}
 
480
 
 
481
  DDPF_ALPHAPIXELS       = $00000001;
 
482
  DDPF_ALPHA             = $00000002;
 
483
  DDPF_FOURCC            = $00000004;
 
484
  DDPF_PALETTEINDEXED4   = $00000008;
 
485
  DDPF_PALETTEINDEXEDTO8 = $00000010;
 
486
  DDPF_PALETTEINDEXED8   = $00000020;
 
487
  DDPF_RGB               = $00000040;
 
488
  DDPF_COMPRESSED        = $00000080;
 
489
  DDPF_RGBTOYUV          = $00000100;
 
490
  DDPF_YUV               = $00000200;
 
491
  DDPF_ZBUFFER           = $00000400;
 
492
  DDPF_PALETTEINDEXED1   = $00000800;
 
493
  DDPF_PALETTEINDEXED2   = $00001000;
 
494
  DDPF_ZPIXELS           = $00002000;
 
495
  DDPF_STENCILBUFFER     = $00004000;
 
496
  DDPF_ALPHAPREMULT      = $00008000;
 
497
  DDPF_LUMINANCE         = $00020000;
 
498
  DDPF_BUMPLUMINANCE     = $00040000;
 
499
  DDPF_BUMPDUDV          = $00080000;
 
500
 
 
501
{===========================================================================
 
502
 
 
503
 
 
504
  DIRECTDRAW CALLBACK FLAGS
 
505
 
 
506
 
 
507
 ===========================================================================}
 
508
 
 
509
{***************************************************************************
 
510
 *
 
511
 * DIRECTDRAW ENUMSURFACES FLAGS
 
512
 *
 
513
 ***************************************************************************}
 
514
 
 
515
  DDENUMSURFACES_ALL          = $00000001;
 
516
  DDENUMSURFACES_MATCH        = $00000002;
 
517
  DDENUMSURFACES_NOMATCH      = $00000004;
 
518
  DDENUMSURFACES_CANBECREATED = $00000008;
 
519
  DDENUMSURFACES_DOESEXIST    = $00000010;
 
520
 
 
521
{***************************************************************************
 
522
 *
 
523
 * DIRECTDRAW SETDISPLAYMODE FLAGS
 
524
 *
 
525
 ***************************************************************************}
 
526
 
 
527
  DDSDM_STANDARDVGAMODE = $00000001;
 
528
 
 
529
 
 
530
{***************************************************************************
 
531
 *
 
532
 * DIRECTDRAW ENUMDISPLAYMODES FLAGS
 
533
 *
 
534
 ***************************************************************************}
 
535
 
 
536
DDEDM_REFRESHRATES = $00000001;
 
537
DDEDM_STANDARDVGAMODES = $00000002;
 
538
 
 
539
{***************************************************************************
 
540
 *
 
541
 * DIRECTDRAW SETCOOPERATIVELEVEL FLAGS
 
542
 *
 
543
 ***************************************************************************}
 
544
 
 
545
  DDSCL_FULLSCREEN         = $00000001;
 
546
  DDSCL_ALLOWREBOOT        = $00000002;
 
547
  DDSCL_NOWINDOWCHANGES    = $00000004;
 
548
  DDSCL_NORMAL             = $00000008;
 
549
  DDSCL_EXCLUSIVE          = $00000010;
 
550
  DDSCL_ALLOWMODEX         = $00000040;
 
551
  DDSCL_SETFOCUSWINDOW     = $00000080;
 
552
  DDSCL_SETDEVICEWINDOW    = $00000100;
 
553
  DDSCL_CREATEDEVICEWINDOW = $00000200;
 
554
  DDSCL_MULTITHREADED      = $00000400;
 
555
  DDSCL_FPUSETUP           = $00000800;
 
556
 
 
557
{***************************************************************************
 
558
 *
 
559
 * DIRECTDRAW BLT FLAGS
 
560
 *
 
561
 ***************************************************************************}
 
562
 
 
563
  DDBLT_ALPHADEST                = $00000001;
 
564
  DDBLT_ALPHADESTCONSTOVERRIDE   = $00000002;
 
565
  DDBLT_ALPHADESTNEG             = $00000004;
 
566
  DDBLT_ALPHADESTSURFACEOVERRIDE = $00000008;
 
567
  DDBLT_ALPHAEDGEBLEND           = $00000010;
 
568
  DDBLT_ALPHASRC                 = $00000020;
 
569
  DDBLT_ALPHASRCCONSTOVERRIDE    = $00000040;
 
570
  DDBLT_ALPHASRCNEG              = $00000080;
 
571
  DDBLT_ALPHASRCSURFACEOVERRIDE  = $00000100;
 
572
  DDBLT_ASYNC                    = $00000200;
 
573
  DDBLT_COLORFILL                = $00000400;
 
574
  DDBLT_DDFX                     = $00000800;
 
575
  DDBLT_DDROPS                   = $00001000;
 
576
  DDBLT_KEYDEST                  = $00002000;
 
577
  DDBLT_KEYDESTOVERRIDE          = $00004000;
 
578
  DDBLT_KEYSRC                   = $00008000;
 
579
  DDBLT_KEYSRCOVERRIDE           = $00010000;
 
580
  DDBLT_ROP                      = $00020000;
 
581
  DDBLT_ROTATIONANGLE            = $00040000;
 
582
  DDBLT_ZBUFFER                  = $00080000;
 
583
  DDBLT_ZBUFFERDESTCONSTOVERRIDE = $00100000;
 
584
  DDBLT_ZBUFFERDESTOVERRIDE      = $00200000;
 
585
  DDBLT_ZBUFFERSRCCONSTOVERRIDE  = $00400000;
 
586
  DDBLT_ZBUFFERSRCOVERRIDE       = $00800000;
 
587
  DDBLT_WAIT                     = $01000000;
 
588
  DDBLT_DEPTHFILL                = $02000000;
 
589
 
 
590
{***************************************************************************
 
591
 *
 
592
 * BLTFAST FLAGS
 
593
 *
 
594
 ***************************************************************************}
 
595
 
 
596
  DDBLTFAST_NOCOLORKEY   = $00000000;
 
597
  DDBLTFAST_SRCCOLORKEY  = $00000001;
 
598
  DDBLTFAST_DESTCOLORKEY = $00000002;
 
599
  DDBLTFAST_WAIT         = $00000010;
 
600
 
 
601
{***************************************************************************
 
602
 *
 
603
 * FLIP FLAGS
 
604
 *
 
605
 ***************************************************************************}
 
606
 
 
607
  DDFLIP_WAIT      = $00000001;
 
608
  DDFLIP_EVEN      = $00000002;
 
609
  DDFLIP_ODD       = $00000004;
 
610
  DDFLIP_NOVSYNC   = $00000008;
 
611
  DDFLIP_INTERVAL2 = $02000000;
 
612
  DDFLIP_INTERVAL3 = $03000000;
 
613
  DDFLIP_INTERVAL4 = $04000000;
 
614
 
 
615
{***************************************************************************
 
616
 *
 
617
 * DIRECTDRAW SURFACE OVERLAY FLAGS
 
618
 *
 
619
 ***************************************************************************}
 
620
 
 
621
  DDOVER_ALPHADEST                = $00000001;
 
622
  DDOVER_ALPHADESTCONSTOVERRIDE   = $00000002;
 
623
  DDOVER_ALPHADESTNEG             = $00000004;
 
624
  DDOVER_ALPHADESTSURFACEOVERRIDE = $00000008;
 
625
  DDOVER_ALPHAEDGEBLEND           = $00000010;
 
626
  DDOVER_ALPHASRC                 = $00000020;
 
627
  DDOVER_ALPHASRCCONSTOVERRIDE    = $00000040;
 
628
  DDOVER_ALPHASRCNEG              = $00000080;
 
629
  DDOVER_ALPHASRCSURFACEOVERRIDE  = $00000100;
 
630
  DDOVER_HIDE                     = $00000200;
 
631
  DDOVER_KEYDEST                  = $00000400;
 
632
  DDOVER_KEYDESTOVERRIDE          = $00000800;
 
633
  DDOVER_KEYSRC                   = $00001000;
 
634
  DDOVER_KEYSRCOVERRIDE           = $00002000;
 
635
  DDOVER_SHOW                     = $00004000;
 
636
  DDOVER_ADDDIRTYRECT             = $00008000;
 
637
  DDOVER_REFRESHDIRTYRECTS        = $00010000;
 
638
  DDOVER_REFRESHALL               = $00020000;
 
639
  DDOVER_DDFX                     = $00080000;
 
640
  DDOVER_AUTOFLIP                 = $00100000;
 
641
  DDOVER_BOB                      = $00200000;
 
642
  DDOVER_OVERRIDEBOBWEAVE         = $00400000;
 
643
  DDOVER_INTERLEAVED              = $00800000;
 
644
  DDOVER_BOBHARDWARE              = $01000000;
 
645
 
 
646
{***************************************************************************
 
647
 *
 
648
 * DIRECTDRAWSURFACE LOCK FLAGS
 
649
 *
 
650
 ***************************************************************************}
 
651
 
 
652
  DDLOCK_SURFACEMEMORYPTR = $00000000;    {default}
 
653
  DDLOCK_WAIT             = $00000001;
 
654
  DDLOCK_EVENT            = $00000002;
 
655
  DDLOCK_READONLY         = $00000010;
 
656
  DDLOCK_WRITEONLY        = $00000020;
 
657
  DDLOCK_NOSYSLOCK        = $00000800;
 
658
 
 
659
{***************************************************************************
 
660
 *
 
661
 * DIRECTDRAWSURFACE BLT FX FLAGS
 
662
 *
 
663
 ***************************************************************************}
 
664
 
 
665
DDBLTFX_ARITHSTRETCHY   = $00000001;
 
666
DDBLTFX_MIRRORLEFTRIGHT = $00000002;
 
667
DDBLTFX_MIRRORUPDOWN    = $00000004;
 
668
DDBLTFX_NOTEARING       = $00000008;
 
669
DDBLTFX_ROTATE180       = $00000010;
 
670
DDBLTFX_ROTATE270       = $00000020;
 
671
DDBLTFX_ROTATE90        = $00000040;
 
672
DDBLTFX_ZBUFFERRANGE    = $00000080;
 
673
DDBLTFX_ZBUFFERBASEDEST = $00000100;
 
674
 
 
675
{***************************************************************************
 
676
 *
 
677
 * DIRECTDRAWSURFACE OVERLAY FX FLAGS
 
678
 *
 
679
 ***************************************************************************}
 
680
 
 
681
  DDOVERFX_ARITHSTRETCHY   = $00000001;
 
682
  DDOVERFX_MIRRORLEFTRIGHT = $00000002;
 
683
  DDOVERFX_MIRRORUPDOWN    = $00000004;
 
684
 
 
685
{***************************************************************************
 
686
 *
 
687
 * Flags for dwDDFX member of DDSPRITEFX structure
 
688
 *
 
689
 ***************************************************************************}
 
690
 
 
691
  DDSPRITEFX_AFFINETRANSFORM    = $00000001;
 
692
  DDSPRITEFX_RGBASCALING        = $00000002;
 
693
  DDSPRITEFX_DEGRADERGBASCALING = $00000004;
 
694
  DDSPRITEFX_BILINEARFILTER     = $00000008;
 
695
  DDSPRITEFX_BLURFILTER         = $00000010;
 
696
  DDSPRITEFX_FLATFILTER         = $00000020;
 
697
  DDSPRITEFX_DEGRADEFILTER      = $00000040;
 
698
 
 
699
{***************************************************************************
 
700
 *
 
701
 * DIRECTDRAW WAITFORVERTICALBLANK FLAGS
 
702
 *
 
703
 ***************************************************************************}
 
704
 
 
705
  DDWAITVB_BLOCKBEGIN      = $00000001;
 
706
  DDWAITVB_BLOCKBEGINEVENT = $00000002;
 
707
  DDWAITVB_BLOCKEND        = $00000004;
 
708
 
 
709
{***************************************************************************
 
710
 *
 
711
 * DIRECTDRAW GETFLIPSTATUS FLAGS
 
712
 *
 
713
 ***************************************************************************}
 
714
 
 
715
  DDGFS_CANFLIP    = $00000001;
 
716
  DDGFS_ISFLIPDONE = $00000002;
 
717
 
 
718
{***************************************************************************
 
719
 *
 
720
 * DIRECTDRAW GETBLTSTATUS FLAGS
 
721
 *
 
722
 ***************************************************************************}
 
723
 
 
724
  DDGBS_CANBLT    = $00000001;
 
725
  DDGBS_ISBLTDONE = $00000002;
 
726
 
 
727
{***************************************************************************
 
728
 *
 
729
 * DIRECTDRAW ENUMOVERLAYZORDER FLAGS
 
730
 *
 
731
 ***************************************************************************}
 
732
 
 
733
  DDENUMOVERLAYZ_BACKTOFRONT = $00000000;
 
734
  DDENUMOVERLAYZ_FRONTTOBACK = $00000001;
 
735
 
 
736
{***************************************************************************
 
737
 *
 
738
 * DIRECTDRAW UPDATEOVERLAYZORDER FLAGS
 
739
 *
 
740
 ***************************************************************************}
 
741
 
 
742
  DDOVERZ_SENDTOFRONT     = $00000000;
 
743
  DDOVERZ_SENDTOBACK      = $00000001;
 
744
  DDOVERZ_MOVEFORWARD     = $00000002;
 
745
  DDOVERZ_MOVEBACKWARD    = $00000003;
 
746
  DDOVERZ_INSERTINFRONTOF = $00000004;
 
747
  DDOVERZ_INSERTINBACKOF  = $00000005;
 
748
 
 
749
 
 
750
{***************************************************************************
 
751
 *
 
752
 * DIRECTDRAW SETGAMMARAMP FLAGS
 
753
 *
 
754
 ***************************************************************************}
 
755
 
 
756
  DDSGR_CALIBRATE = $00000001;
 
757
 
 
758
 
 
759
{===========================================================================
 
760
 
 
761
 
 
762
  DIRECTDRAW RETURN CODES
 
763
 
 
764
  The return values from DirectDraw Commands and Surface that return an HRESULT
 
765
  are codes from DirectDraw concerning the results of the action
 
766
  requested by DirectDraw.
 
767
 
 
768
 ===========================================================================}
 
769
 
 
770
  DD_OK    = 0;
 
771
  DD_FALSE = S_FALSE;
 
772
 
 
773
{***************************************************************************
 
774
 *
 
775
 * DIRECTDRAW ENUMCALLBACK RETURN VALUES
 
776
 *
 
777
 * EnumCallback returns are used to control the flow of the DIRECTDRAW and
 
778
 * DIRECTDRAWSURFACE object enumerations.   They can only be returned by
 
779
 * enumeration callback routines.
 
780
 *
 
781
 ***************************************************************************}
 
782
 
 
783
  DDENUMRET_CANCEL = 0;
 
784
  DDENUMRET_OK     = 1;
 
785
 
 
786
{***************************************************************************
 
787
 *
 
788
 * DIRECTDRAW ERRORS
 
789
 *
 
790
 * Errors are represented by negative values and cannot be combined.
 
791
 *
 
792
 ***************************************************************************}
 
793
 
 
794
  DDERR_ALREADYINITIALIZED           = ($80000000 + (_FACDD Shl 16) + 5);
 
795
  DDERR_CANNOTATTACHSURFACE          = ($80000000 + (_FACDD Shl 16) + 10);
 
796
  DDERR_CANNOTDETACHSURFACE          = ($80000000 + (_FACDD Shl 16) + 20);
 
797
  DDERR_CURRENTLYNOTAVAIL            = ($80000000 + (_FACDD Shl 16) + 40);
 
798
  DDERR_EXCEPTION                    = ($80000000 + (_FACDD Shl 16) + 55);
 
799
  DDERR_GENERIC                      = E_FAIL;
 
800
  DDERR_HEIGHTALIGN                  = ($80000000 + (_FACDD Shl 16) + 90);
 
801
  DDERR_INCOMPATIBLEPRIMARY          = ($80000000 + (_FACDD Shl 16) + 95);
 
802
  DDERR_INVALIDCAPS                  = ($80000000 + (_FACDD Shl 16) + 100);
 
803
  DDERR_INVALIDCLIPLIST              = ($80000000 + (_FACDD Shl 16) + 110);
 
804
  DDERR_INVALIDMODE                  = ($80000000 + (_FACDD Shl 16) + 120);
 
805
  DDERR_INVALIDOBJECT                = ($80000000 + (_FACDD Shl 16) + 130);
 
806
  DDERR_INVALIDPARAMS                = E_INVALIDARG;
 
807
  DDERR_INVALIDPIXELFORMAT           = ($80000000 + (_FACDD Shl 16) + 145);
 
808
  DDERR_INVALIDRECT                  = ($80000000 + (_FACDD Shl 16) + 150);
 
809
  DDERR_LOCKEDSURFACES               = ($80000000 + (_FACDD Shl 16) + 160);
 
810
  DDERR_NO3D                         = ($80000000 + (_FACDD Shl 16) + 170);
 
811
  DDERR_NOALPHAHW                    = ($80000000 + (_FACDD Shl 16) + 180);
 
812
  DDERR_NOCLIPLIST                   = ($80000000 + (_FACDD Shl 16) + 205);
 
813
  DDERR_NOCOLORCONVHW                = ($80000000 + (_FACDD Shl 16) + 210);
 
814
  DDERR_NOCOOPERATIVELEVELSET        = ($80000000 + (_FACDD Shl 16) + 212);
 
815
  DDERR_NOCOLORKEY                   = ($80000000 + (_FACDD Shl 16) + 215);
 
816
  DDERR_NOCOLORKEYHW                 = ($80000000 + (_FACDD Shl 16) + 220);
 
817
  DDERR_NODIRECTDRAWSUPPORT          = ($80000000 + (_FACDD Shl 16) + 222);
 
818
  DDERR_NOEXCLUSIVEMODE              = ($80000000 + (_FACDD Shl 16) + 225);
 
819
  DDERR_NOFLIPHW                     = ($80000000 + (_FACDD Shl 16) + 230);
 
820
  DDERR_NOGDI                        = ($80000000 + (_FACDD Shl 16) + 240);
 
821
  DDERR_NOMIRRORHW                   = ($80000000 + (_FACDD Shl 16) + 250);
 
822
  DDERR_NOTFOUND                     = ($80000000 + (_FACDD Shl 16) + 255);
 
823
  DDERR_NOOVERLAYHW                  = ($80000000 + (_FACDD Shl 16) + 260);
 
824
  DDERR_OVERLAPPINGRECTS             = ($80000000 + (_FACDD Shl 16) + 270);
 
825
  DDERR_NORASTEROPHW                 = ($80000000 + (_FACDD Shl 16) + 280);
 
826
  DDERR_NOROTATIONHW                 = ($80000000 + (_FACDD Shl 16) + 290);
 
827
  DDERR_NOSTRETCHHW                  = ($80000000 + (_FACDD Shl 16) + 310);
 
828
  DDERR_NOT4BITCOLOR                 = ($80000000 + (_FACDD Shl 16) + 316);
 
829
  DDERR_NOT4BITCOLORINDEX            = ($80000000 + (_FACDD Shl 16) + 317);
 
830
  DDERR_NOT8BITCOLOR                 = ($80000000 + (_FACDD Shl 16) + 320);
 
831
  DDERR_NOTEXTUREHW                  = ($80000000 + (_FACDD Shl 16) + 330);
 
832
  DDERR_NOVSYNCHW                    = ($80000000 + (_FACDD Shl 16) + 335);
 
833
  DDERR_NOZBUFFERHW                  = ($80000000 + (_FACDD Shl 16) + 340);
 
834
  DDERR_NOZOVERLAYHW                 = ($80000000 + (_FACDD Shl 16) + 350);
 
835
  DDERR_OUTOFCAPS                    = ($80000000 + (_FACDD Shl 16) + 360);
 
836
  DDERR_OUTOFMEMORY                  = E_OUTOFMEMORY;
 
837
  DDERR_OUTOFVIDEOMEMORY             = ($80000000 + (_FACDD Shl 16) + 380);
 
838
  DDERR_OVERLAYCANTCLIP              = ($80000000 + (_FACDD Shl 16) + 382);
 
839
  DDERR_OVERLAYCOLORKEYONLYONEACTIVE = ($80000000 + (_FACDD Shl 16) + 384);
 
840
  DDERR_PALETTEBUSY                  = ($80000000 + (_FACDD Shl 16) + 387);
 
841
  DDERR_COLORKEYNOTSET               = ($80000000 + (_FACDD Shl 16) + 400);
 
842
  DDERR_SURFACEALREADYATTACHED       = ($80000000 + (_FACDD Shl 16) + 410);
 
843
  DDERR_SURFACEALREADYDEPENDENT      = ($80000000 + (_FACDD Shl 16) + 420);
 
844
  DDERR_SURFACEBUSY                  = ($80000000 + (_FACDD Shl 16) + 430);
 
845
  DDERR_CANTLOCKSURFACE              = ($80000000 + (_FACDD Shl 16) + 435);
 
846
  DDERR_SURFACEISOBSCURED            = ($80000000 + (_FACDD Shl 16) + 440);
 
847
  DDERR_SURFACELOST                  = ($80000000 + (_FACDD Shl 16) + 450);
 
848
  DDERR_SURFACENOTATTACHED           = ($80000000 + (_FACDD Shl 16) + 460);
 
849
  DDERR_TOOBIGHEIGHT                 = ($80000000 + (_FACDD Shl 16) + 470);
 
850
  DDERR_TOOBIGSIZE                   = ($80000000 + (_FACDD Shl 16) + 480);
 
851
  DDERR_TOOBIGWIDTH                  = ($80000000 + (_FACDD Shl 16) + 490);
 
852
  DDERR_UNSUPPORTED                  = E_NOTIMPL;
 
853
  DDERR_UNSUPPORTEDFORMAT            = ($80000000 + (_FACDD Shl 16) + 510);
 
854
  DDERR_UNSUPPORTEDMASK              = ($80000000 + (_FACDD Shl 16) + 520);
 
855
  DDERR_INVALIDSTREAM                = ($80000000 + (_FACDD Shl 16) + 521);
 
856
  DDERR_VERTICALBLANKINPROGRESS      = ($80000000 + (_FACDD Shl 16) + 537);
 
857
  DDERR_WASSTILLDRAWING              = ($80000000 + (_FACDD Shl 16) + 540);
 
858
  DDERR_XALIGN                       = ($80000000 + (_FACDD Shl 16) + 560);
 
859
  DDERR_INVALIDDIRECTDRAWGUID        = ($80000000 + (_FACDD Shl 16) + 561);
 
860
  DDERR_DIRECTDRAWALREADYCREATED     = ($80000000 + (_FACDD Shl 16) + 562);
 
861
  DDERR_NODIRECTDRAWHW               = ($80000000 + (_FACDD Shl 16) + 563);
 
862
  DDERR_PRIMARYSURFACEALREADYEXISTS  = ($80000000 + (_FACDD Shl 16) + 564);
 
863
  DDERR_NOEMULATION                  = ($80000000 + (_FACDD Shl 16) + 565);
 
864
  DDERR_REGIONTOOSMALL               = ($80000000 + (_FACDD Shl 16) + 566);
 
865
  DDERR_CLIPPERISUSINGHWND           = ($80000000 + (_FACDD Shl 16) + 567);
 
866
  DDERR_NOCLIPPERATTACHED            = ($80000000 + (_FACDD Shl 16) + 568);
 
867
  DDERR_NOHWND                       = ($80000000 + (_FACDD Shl 16) + 569);
 
868
  DDERR_HWNDSUBCLASSED               = ($80000000 + (_FACDD Shl 16) + 570);
 
869
  DDERR_HWNDALREADYSET               = ($80000000 + (_FACDD Shl 16) + 571);
 
870
  DDERR_NOPALETTEATTACHED            = ($80000000 + (_FACDD Shl 16) + 572);
 
871
  DDERR_NOPALETTEHW                  = ($80000000 + (_FACDD Shl 16) + 573);
 
872
  DDERR_BLTFASTCANTCLIP              = ($80000000 + (_FACDD Shl 16) + 574);
 
873
  DDERR_NOBLTHW                      = ($80000000 + (_FACDD Shl 16) + 575);
 
874
  DDERR_NODDROPSHW                   = ($80000000 + (_FACDD Shl 16) + 576);
 
875
  DDERR_OVERLAYNOTVISIBLE            = ($80000000 + (_FACDD Shl 16) + 577);
 
876
  DDERR_NOOVERLAYDEST                = ($80000000 + (_FACDD Shl 16) + 578);
 
877
  DDERR_INVALIDPOSITION              = ($80000000 + (_FACDD Shl 16) + 579);
 
878
  DDERR_NOTAOVERLAYSURFACE           = ($80000000 + (_FACDD Shl 16) + 580);
 
879
  DDERR_EXCLUSIVEMODEALREADYSET      = ($80000000 + (_FACDD Shl 16) + 581);
 
880
  DDERR_NOTFLIPPABLE                 = ($80000000 + (_FACDD Shl 16) + 582);
 
881
  DDERR_CANTDUPLICATE                = ($80000000 + (_FACDD Shl 16) + 583);
 
882
  DDERR_NOTLOCKED                    = ($80000000 + (_FACDD Shl 16) + 584);
 
883
  DDERR_CANTCREATEDC                 = ($80000000 + (_FACDD Shl 16) + 585);
 
884
  DDERR_NODC                         = ($80000000 + (_FACDD Shl 16) + 586);
 
885
  DDERR_WRONGMODE                    = ($80000000 + (_FACDD Shl 16) + 587);
 
886
  DDERR_IMPLICITLYCREATED            = ($80000000 + (_FACDD Shl 16) + 588);
 
887
  DDERR_NOTPALETTIZED                = ($80000000 + (_FACDD Shl 16) + 589);
 
888
  DDERR_UNSUPPORTEDMODE              = ($80000000 + (_FACDD Shl 16) + 590);
 
889
  DDERR_NOMIPMAPHW                   = ($80000000 + (_FACDD Shl 16) + 591);
 
890
  DDERR_INVALIDSURFACETYPE           = ($80000000 + (_FACDD Shl 16) + 592);
 
891
  DDERR_NOOPTIMIZEHW                 = ($80000000 + (_FACDD Shl 16) + 600);
 
892
  DDERR_NOTLOADED                    = ($80000000 + (_FACDD Shl 16) + 601);
 
893
  DDERR_NOFOCUSWINDOW                = ($80000000 + (_FACDD Shl 16) + 602);
 
894
  DDERR_DCALREADYCREATED             = ($80000000 + (_FACDD Shl 16) + 620);
 
895
  DDERR_NONONLOCALVIDMEM             = ($80000000 + (_FACDD Shl 16) + 630);
 
896
  DDERR_CANTPAGELOCK                 = ($80000000 + (_FACDD Shl 16) + 640);
 
897
  DDERR_CANTPAGEUNLOCK               = ($80000000 + (_FACDD Shl 16) + 660);
 
898
  DDERR_NOTPAGELOCKED                = ($80000000 + (_FACDD Shl 16) + 680);
 
899
  DDERR_MOREDATA                     = ($80000000 + (_FACDD Shl 16) + 690);
 
900
  DDERR_EXPIRED                      = ($80000000 + (_FACDD Shl 16) + 691);
 
901
  DDERR_VIDEONOTACTIVE               = ($80000000 + (_FACDD Shl 16) + 695);
 
902
  DDERR_DEVICEDOESNTOWNSURFACE       = ($80000000 + (_FACDD Shl 16) + 699);
 
903
  DDERR_NOTINITIALIZED               = CO_E_NOTINITIALIZED;
 
904
 
 
905
Type
 
906
  PHWND = ^HWND;
 
907
  PHDC = ^HDC;
 
908
  LPLPDIRECTDRAW = ^LPDIRECTDRAW;
 
909
  LPDIRECTDRAW = ^IDIRECTDRAW;
 
910
  LPLPDIRECTDRAWSURFACE = ^LPDIRECTDRAWSURFACE;
 
911
  LPDIRECTDRAWSURFACE = ^IDirectDrawSurface;
 
912
  LPLPDIRECTDRAWCLIPPER = ^LPDIRECTDRAWCLIPPER;
 
913
  LPDIRECTDRAWCLIPPER = ^IDirectDrawClipper;
 
914
  LPLPDIRECTDRAWPALETTE = ^LPDIRECTDRAWPALETTE;
 
915
  LPDIRECTDRAWPALETTE = ^IDirectDrawPalette;
 
916
 
 
917
  LPDIRECTDRAW2 = LPDIRECTDRAW;
 
918
 
 
919
  LPLPVOID = ^LPVOID;
 
920
  LPVOID = Pointer;
 
921
  LPDWORD = ^DWord;
 
922
 
 
923
{
 
924
  Generic pixel format with 8-bit RGB and alpha components
 
925
}
 
926
  LPDDRGBA = ^DDRGBA;
 
927
  DDRGBA = Record
 
928
    red, green, blue, alpha : Byte;
 
929
  End;
 
930
 
 
931
  LPDDCOLORKEY = ^DDCOLORKEY;
 
932
  DDCOLORKEY = Record
 
933
    dwColorSpaceLowValue : DWord;
 
934
    dwColorSpaceHighValue : DWord;
 
935
  End;
 
936
  LPDDBLTFX = ^DDBLTFX;
 
937
  DDBLTFX = Record
 
938
    dwSize : DWord;
 
939
    dwDDFX : DWord;
 
940
    dwROP : DWord;
 
941
    dwDDROP : DWord;
 
942
    dwRotationAngle : DWord;
 
943
    dwZBufferOpCode : DWord;
 
944
    dwZBufferLow : DWord;
 
945
    dwZBufferHigh : DWord;
 
946
    dwZBufferBaseDest : DWord;
 
947
    dwZDestConstBitDepth : DWord;
 
948
    dwZDestConst : DWord; {union w/: lpDDSZBufferDest : LPDIRECTDRAWSURFACE}
 
949
    dwZSrcConstBitDepth : DWord;
 
950
    dwZSrcConst : DWord; {union w/: lpDDSZBufferSrc : LPDIRECTDRAWSURFACE}
 
951
    dwAlphaEdgeBlendBitDepth : DWord;
 
952
    dwAlphaEdgeBlend : DWord;
 
953
    dwReserved : DWord;
 
954
    dwAlphaDestConstBitDepth : DWord;
 
955
    dwAlphaDestConst : DWord; {union w/: lpDDSAlphaDest : LPDIRECTDRAWSURFACE}
 
956
    dwAlphaSrcConstBitDepth : DWord;
 
957
    dwAlphaSrcConst : DWord; {union w/: lpDDSAlphaSrc : LPDIRECTDRAWSURFACE}
 
958
    dwFillColor : DWord;
 
959
      {union w/: dwFillDepth : DWord}
 
960
      {union w/: lpDDSPattern : LPDIRECTDRAWSURFACE}
 
961
    ddckDestColorKey : DDCOLORKEY;
 
962
    ddckSrcColorKey : DDCOLORKEY;
 
963
  End;
 
964
  LPDDPIXELFORMAT = ^DDPIXELFORMAT;
 
965
  DDPIXELFORMAT = Record
 
966
    dwSize : DWord;
 
967
    dwFlags : DWord;
 
968
    dwFourCC : DWord;
 
969
    dwRGBBitCount : DWord;
 
970
    { union w/:
 
971
       dwYUVBitCount : DWord;
 
972
       dwZBufferBitDepth : DWord;
 
973
       dwAlphaBitDepth : DWord;
 
974
    }
 
975
    dwRBitMask : DWord;
 
976
    { union w/: dwYBitMask : DWord;}
 
977
    dwGBitMask : DWord;
 
978
    { union w/: dwUBitMask : DWord;}
 
979
    dwBBitMask : DWord;
 
980
    { union w/: dwVBitMask : DWord;}
 
981
    dwRGBAlphaBitMask : DWord;
 
982
    { union w/: dwYUVAlphaBitMask : DWord;}
 
983
  End;
 
984
  LPDDSCAPS = ^DDSCAPS;
 
985
  DDSCAPS = Record
 
986
    dwCaps : DWord;
 
987
  End;
 
988
  LPDDOSCAPS = ^DDOSCAPS;
 
989
  DDOSCAPS = Record
 
990
    dwCaps : DWord;
 
991
  End;
 
992
 
 
993
{ This structure is used internally by DirectDraw.}
 
994
  LPDDSCAPSEX = ^DDSCAPSEX;
 
995
  DDSCAPSEX = Record
 
996
    dwCaps2 : DWord;
 
997
    dwCaps3 : DWord;
 
998
    dwCaps4 : DWord;
 
999
  End;
 
1000
 
 
1001
  LPDDSCAPS2 = ^DDSCAPS2;
 
1002
  DDSCAPS2 = Record
 
1003
    dwCaps : DWord;
 
1004
    dwCaps2 : DWord;
 
1005
    dwCaps3 : DWord;
 
1006
    dwCaps4 : DWord;
 
1007
  End;
 
1008
 
 
1009
{This structure is the DDCAPS structure as it was in version 2 and 3 of Direct X.
 
1010
 It is present for back compatability.}
 
1011
  DDCAPS_DX3 = Record
 
1012
{dwSize                 dd ?            ; size of the DDDRIVERCAPS structure
 
1013
        dwCaps                  dd ?            ; driver specific capabilities
 
1014
        dwCaps2                 dd ?            ; more driver specific capabilites
 
1015
        dwCKeyCaps              dd ?            ; color key capabilities of the surface
 
1016
        dwFXCaps                dd ?            ; driver specific stretching and effects capabilites
 
1017
        dwFXAlphaCaps           dd ?            ; alpha driver specific capabilities
 
1018
        dwPalCaps               dd ?            ; palette capabilities
 
1019
        dwSVCaps                dd ?            ; stereo vision capabilities
 
1020
        dwAlphaBltConstBitDepths dd ?           ; DDBD_2,4,8
 
1021
        dwAlphaBltPixelBitDepths dd ?           ; DDBD_1,2,4,8
 
1022
        dwAlphaBltSurfaceBitDepths dd ?         ; DDBD_1,2,4,8
 
1023
        dwAlphaOverlayConstBitDepths dd ?       ; DDBD_2,4,8
 
1024
        dwAlphaOverlayPixelBitDepths dd ?       ; DDBD_1,2,4,8
 
1025
        dwAlphaOverlaySurfaceBitDepths dd ?     ; DDBD_1,2,4,8
 
1026
        dwZBufferBitDepths      dd ?            ; DDBD_8,16,24,32
 
1027
        dwVidMemTotal           dd ?            ; total amount of video memory
 
1028
        dwVidMemFree            dd ?            ; amount of free video memory
 
1029
        dwMaxVisibleOverlays    dd ?            ; maximum number of visible overlays
 
1030
        dwCurrVisibleOverlays   dd ?            ; current number of visible overlays
 
1031
        dwNumFourCCCodes        dd ?            ; number of four cc codes
 
1032
        dwAlignBoundarySrc      dd ?            ; source rectangle alignment
 
1033
        dwAlignSizeSrc          dd ?            ; source rectangle byte size
 
1034
        dwAlignBoundaryDest     dd ?            ; dest rectangle alignment
 
1035
        dwAlignSizeDest         dd ?            ; dest rectangle byte size
 
1036
        dwAlignStrideAlign      dd ?            ; stride alignment
 
1037
        dwRops                  dd DD_ROP_SPACE dup (?) ; ROPS supported
 
1038
        ddsCaps                 DDSCAPS ?       ; DDSCAPS structure has all the general capabilities
 
1039
        dwMinOverlayStretch     dd ?            ; minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
 
1040
        dwMaxOverlayStretch     dd ?            ; maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
 
1041
        dwMinLiveVideoStretch   dd ?            ; minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
 
1042
        dwMaxLiveVideoStretch   dd ?            ; maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
 
1043
        dwMinHwCodecStretch     dd ?            ; minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
 
1044
        dwMaxHwCodecStretch     dd ?            ; maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
 
1045
        dwReserved1             dd ?            ; reserved
 
1046
        dwReserved2             dd ?            ; reserved
 
1047
        dwReserved3             dd ?            ; reserved
 
1048
        dwSVBCaps               dd ?            ; driver specific capabilities for System->Vmem blts
 
1049
        dwSVBCKeyCaps           dd ?            ; driver color key capabilities for System->Vmem blts
 
1050
        dwSVBFXCaps             dd ?            ; driver FX capabilities for System->Vmem blts
 
1051
        dwSVBRops               dd DD_ROP_SPACE dup (?) ; ROPS supported for System->Vmem blts
 
1052
        dwVSBCaps               dd ?            ; driver specific capabilities for Vmem->System blts
 
1053
        dwVSBCKeyCaps           dd ?            ; driver color key capabilities for Vmem->System blts
 
1054
        dwVSBFXCaps             dd ?            ; driver FX capabilities for Vmem->System blts
 
1055
        dwVSBRops               dd DD_ROP_SPACE dup (?) ; ROPS supported for Vmem->System blts
 
1056
        dwSSBCaps               dd ?            ; driver specific capabilities for System->System blts
 
1057
        dwSSBCKeyCaps           dd ?            ; driver color key capabilities for System->System blts
 
1058
        dwSSBFXCaps             dd ?            ; driver FX capabilities for System->System blts
 
1059
        dwSSBRops               dd DD_ROP_SPACE dup (?) ; ROPS supported for System->System blts
 
1060
        dwReserved4             dd ?            ; reserved
 
1061
        dwReserved5             dd ?            ; reserved
 
1062
        dwReserved6             dd ?            ; reserved}
 
1063
  End;
 
1064
 
 
1065
{This structure is the DDCAPS structure as it was in version 5 of Direct X.
 
1066
 It is present for back compatability.}
 
1067
  DDCAPS_DX5 = Record
 
1068
{dwSize                 dd ?            ; size of the DDDRIVERCAPS structure ;  4
 
1069
        dwCaps                  dd ?            ; driver specific capabilities ;  8
 
1070
        dwCaps2                 dd ?            ; more driver specific capabilites ;  c
 
1071
        dwCKeyCaps              dd ?            ; color key capabilities of the surface ; 10
 
1072
        dwFXCaps                dd ?            ; driver specific stretching and effects capabilites ; 14
 
1073
        dwFXAlphaCaps           dd ?            ; alpha driver specific capabilities ; 18
 
1074
        dwPalCaps               dd ?            ; palette capabilities ; 1c
 
1075
        dwSVCaps                dd ?            ; stereo vision capabilities ; 20
 
1076
        dwAlphaBltConstBitDepths dd ?           ; DDBD_2,4,8 ; 24
 
1077
        dwAlphaBltPixelBitDepths dd ?           ; DDBD_1,2,4,8 ; 28
 
1078
        dwAlphaBltSurfaceBitDepths dd ?         ; DDBD_1,2,4,8 ; 2c
 
1079
        dwAlphaOverlayConstBitDepths dd ?       ; DDBD_2,4,8 ; 30
 
1080
        dwAlphaOverlayPixelBitDepths dd ?       ; DDBD_1,2,4,8 ; 34
 
1081
        dwAlphaOverlaySurfaceBitDepths dd ?     ; DDBD_1,2,4,8 ; 38
 
1082
        dwZBufferBitDepths      dd ?            ; DDBD_8,16,24,32 ; 3c
 
1083
        dwVidMemTotal           dd ?            ; total amount of video memory ; 40
 
1084
        dwVidMemFree            dd ?            ; amount of free video memory ; 44
 
1085
        dwMaxVisibleOverlays    dd ?            ; maximum number of visible overlays ; 48
 
1086
        dwCurrVisibleOverlays   dd ?            ; current number of visible overlays ; 4c
 
1087
        dwNumFourCCCodes        dd ?            ; number of four cc codes ; 50
 
1088
        dwAlignBoundarySrc      dd ?            ; source rectangle alignment ; 54
 
1089
        dwAlignSizeSrc          dd ?            ; source rectangle byte size ; 58
 
1090
        dwAlignBoundaryDest     dd ?            ; dest rectangle alignment ; 5c
 
1091
        dwAlignSizeDest         dd ?            ; dest rectangle byte size ; 60
 
1092
        dwAlignStrideAlign      dd ?            ; stride alignment ; 64
 
1093
        dwRops                  dd DD_ROP_SPACE dup (?) ; ROPS supported ; 84
 
1094
        ddsCaps                 DDSCAPS ?       ; DDSCAPS structure has all the general capabilities ; 88
 
1095
        dwMinOverlayStretch     dd ?            ; minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 ; 8c
 
1096
        dwMaxOverlayStretch     dd ?            ; maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 ; 90
 
1097
        dwMinLiveVideoStretch   dd ?            ; minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 ; 94
 
1098
        dwMaxLiveVideoStretch   dd ?            ; maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 ; 98
 
1099
        dwMinHwCodecStretch     dd ?            ; minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 ; 9c
 
1100
        dwMaxHwCodecStretch     dd ?            ; maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 ; a0
 
1101
        dwReserved1             dd ?            ; reserved ; a4
 
1102
        dwReserved2             dd ?            ; reserved ; a8
 
1103
        dwReserved3             dd ?            ; reserved ; ac
 
1104
        dwSVBCaps               dd ?            ; driver specific capabilities for System->Vmem blts ; b0
 
1105
        dwSVBCKeyCaps           dd ?            ; driver color key capabilities for System->Vmem blts ; b4
 
1106
        dwSVBFXCaps             dd ?            ; driver FX capabilities for System->Vmem blts ; b8
 
1107
        dwSVBRops               dd DD_ROP_SPACE dup (?) ; ROPS supported for System->Vmem blts ; d8
 
1108
        dwVSBCaps               dd ?            ; driver specific capabilities for Vmem->System blts ; dc
 
1109
        dwVSBCKeyCaps           dd ?            ; driver color key capabilities for Vmem->System blts ; e0
 
1110
        dwVSBFXCaps             dd ?            ; driver FX capabilities for Vmem->System blts ; e4
 
1111
        dwVSBRops               dd DD_ROP_SPACE dup (?) ; ROPS supported for Vmem->System blts ;104
 
1112
        dwSSBCaps               dd ?            ; driver specific capabilities for System->System blts ;108
 
1113
        dwSSBCKeyCaps           dd ?            ; driver color key capabilities for System->System blts ;10c
 
1114
        dwSSBFXCaps             dd ?            ; driver FX capabilities for System->System blts ;110
 
1115
        dwSSBRops               dd DD_ROP_SPACE dup (?) ; ROPS supported for System->System blts ; Members added for DX5: ;130
 
1116
        dwMaxVideoPorts         dd ?            ; maximum number of usable video ports ;134
 
1117
        dwCurrVideoPorts        dd ?            ; current number of video ports used ;138
 
1118
        dwSVBCaps2              dd ?            ; more driver specific capabilities for System->Vmem blts ;13c
 
1119
        dwNLVBCaps              dd ?            ; driver specific capabilities for non-local->local vidmem blts ;140
 
1120
        dwNLVBCaps2             dd ?            ; more driver specific capabilities non-local->local vidmem blts ;144
 
1121
        dwNLVBCKeyCaps          dd ?            ; driver color key capabilities for non-local->local vidmem blts ;148
 
1122
        dwNLVBFXCaps            dd ?            ; driver FX capabilities for non-local->local blts ;14c
 
1123
        dwNLVBRops              dd DD_ROP_SPACE dup (?) ; ROPS supported for non-local->local blts}
 
1124
  End;
 
1125
 
 
1126
  DDCAPS_DX6 = Record
 
1127
{dwSize                 dd ?            ; size of the DDDRIVERCAPS structure ;  4
 
1128
        dwCaps                  dd ?            ; driver specific capabilities ;  8
 
1129
        dwCaps2                 dd ?            ; more driver specific capabilites ;  c
 
1130
        dwCKeyCaps              dd ?            ; color key capabilities of the surface ; 10
 
1131
        dwFXCaps                dd ?            ; driver specific stretching and effects capabilites ; 14
 
1132
        dwFXAlphaCaps           dd ?            ; alpha caps ; 18
 
1133
        dwPalCaps               dd ?            ; palette capabilities ; 1c
 
1134
        dwSVCaps                dd ?            ; stereo vision capabilities ; 20
 
1135
        dwAlphaBltConstBitDepths dd ?           ; DDBD_2,4,8 ; 24
 
1136
        dwAlphaBltPixelBitDepths dd ?           ; DDBD_1,2,4,8 ; 28
 
1137
        dwAlphaBltSurfaceBitDepths dd ?         ; DDBD_1,2,4,8 ; 2c
 
1138
        dwAlphaOverlayConstBitDepths dd ?       ; DDBD_2,4,8 ; 30
 
1139
        dwAlphaOverlayPixelBitDepths dd ?       ; DDBD_1,2,4,8 ; 34
 
1140
        dwAlphaOverlaySurfaceBitDepths dd ?     ; DDBD_1,2,4,8 ; 38
 
1141
        dwZBufferBitDepths      dd ?            ; DDBD_8,16,24,32 ; 3c
 
1142
        dwVidMemTotal           dd ?            ; total amount of video memory ; 40
 
1143
        dwVidMemFree            dd ?            ; amount of free video memory ; 44
 
1144
        dwMaxVisibleOverlays    dd ?            ; maximum number of visible overlays ; 48
 
1145
        dwCurrVisibleOverlays   dd ?            ; current number of visible overlays ; 4c
 
1146
        dwNumFourCCCodes        dd ?            ; number of four cc codes ; 50
 
1147
        dwAlignBoundarySrc      dd ?            ; source rectangle alignment ; 54
 
1148
        dwAlignSizeSrc          dd ?            ; source rectangle byte size ; 58
 
1149
        dwAlignBoundaryDest     dd ?            ; dest rectangle alignment ; 5c
 
1150
        dwAlignSizeDest         dd ?            ; dest rectangle byte size ; 60
 
1151
        dwAlignStrideAlign      dd ?            ; stride alignment ; 64
 
1152
        dwRops                  dd DD_ROP_SPACE dup (?) ; ROPS supported ; 84
 
1153
        ddsOldCaps              DDSCAPS ?       ; Was DDSCAPS   ddsCaps. ddsCaps is of type DDSCAPS2 for DX6 ; 88
 
1154
        dwMinOverlayStretch     dd ?            ; minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 ; 8c
 
1155
        dwMaxOverlayStretch     dd ?            ; maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 ; 90
 
1156
        dwMinLiveVideoStretch   dd ?            ; minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 ; 94
 
1157
        dwMaxLiveVideoStretch   dd ?            ; maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 ; 98
 
1158
        dwMinHwCodecStretch     dd ?            ; minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 ; 9c
 
1159
        dwMaxHwCodecStretch     dd ?            ; maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 ; a0
 
1160
        dwReserved1             dd ?            ; reserved ; a4
 
1161
        dwReserved2             dd ?            ; reserved ; a8
 
1162
        dwReserved3             dd ?            ; reserved ; ac
 
1163
        dwSVBCaps               dd ?            ; driver specific capabilities for System->Vmem blts ; b0
 
1164
        dwSVBCKeyCaps           dd ?            ; driver color key capabilities for System->Vmem blts ; b4
 
1165
        dwSVBFXCaps             dd ?            ; driver FX capabilities for System->Vmem blts ; b8
 
1166
        dwSVBRops               dd DD_ROP_SPACE dup (?) ; ROPS supported for System->Vmem blts ; d8
 
1167
        dwVSBCaps               dd ?            ; driver specific capabilities for Vmem->System blts ; dc
 
1168
        dwVSBCKeyCaps           dd ?            ; driver color key capabilities for Vmem->System blts ; e0
 
1169
        dwVSBFXCaps             dd ?            ; driver FX capabilities for Vmem->System blts ; e4
 
1170
        dwVSBRops               dd DD_ROP_SPACE dup (?) ; ROPS supported for Vmem->System blts ;104
 
1171
        dwSSBCaps               dd ?            ; driver specific capabilities for System->System blts ;108
 
1172
        dwSSBCKeyCaps           dd ?            ; driver color key capabilities for System->System blts ;10c
 
1173
        dwSSBFXCaps             dd ?            ; driver FX capabilities for System->System blts ;110
 
1174
        dwSSBRops               dd DD_ROP_SPACE dup (?) ; ROPS supported for System->System blts ;130
 
1175
        dwMaxVideoPorts         dd ?            ; maximum number of usable video ports ;134
 
1176
        dwCurrVideoPorts        dd ?            ; current number of video ports used ;138
 
1177
        dwSVBCaps2              dd ?            ; more driver specific capabilities for System->Vmem blts ;13c
 
1178
        dwNLVBCaps              dd ?            ; driver specific capabilities for non-local->local vidmem blts ;140
 
1179
        dwNLVBCaps2             dd ?            ; more driver specific capabilities non-local->local vidmem blts ;144
 
1180
        dwNLVBCKeyCaps          dd ?            ; driver color key capabilities for non-local->local vidmem blts ;148
 
1181
        dwNLVBFXCaps            dd ?            ; driver FX capabilities for non-local->local blts ;14c
 
1182
        dwNLVBRops              dd DD_ROP_SPACE dup (?) ; ROPS supported for non-local->local blts ; Members added for DX6 release ;16c
 
1183
        ddsCaps                 DDSCAPS2 ?      ; Surface Caps}
 
1184
  End;
 
1185
  LPDDCAPS = ^DDCAPS;
 
1186
  DDCAPS = DDCAPS_DX6;
 
1187
  {DDCAPS = DDCAPS_DX5;}
 
1188
  {DDCAPS = DDCAPS_DX3;}
 
1189
 
 
1190
  LPDDSURFACEDESC = ^DDSURFACEDESC;
 
1191
  DDSURFACEDESC = Record
 
1192
    dwSize : DWord;
 
1193
    dwFlags : DWord;
 
1194
    dwHeight : DWord;
 
1195
    dwWidth : DWord;
 
1196
    lPitch : LongInt;
 
1197
    dwBackBufferCount : DWord;
 
1198
    dwMipMapCount : DWord;
 
1199
      { union w/:
 
1200
        dwZBufferBitDepth : DWord;
 
1201
        dwRefreshRate : DWord;
 
1202
      }
 
1203
    dwAlphaBitDepth : DWord;
 
1204
    dwReserved : DWord;
 
1205
    lpSurface : LPVOID;
 
1206
    ddckCKDestOverlay : DDCOLORKEY;
 
1207
    ddckCKDestBlt : DDCOLORKEY;
 
1208
 
 
1209
    ddckCKSrcOverlay : DDCOLORKEY;
 
1210
    ddckCKSrcBlt : DDCOLORKEY;
 
1211
    ddpfPixelFormat : DDPIXELFORMAT;
 
1212
    ddsCaps : DDSCAPS;
 
1213
  End;
 
1214
  LPDDOVERLAYFX = ^DDOVERLAYFX;
 
1215
  DDOVERLAYFX = Record
 
1216
    dwSize : DWord;
 
1217
    dwAlphaEdgeBlendBitDepth : DWord;
 
1218
    dwAlphaEdgeBlend : DWord;
 
1219
    dwReserved : DWord;
 
1220
    dwAlphaDestConstBitDepth : DWord;
 
1221
    dwAlphaDestConst : DWord;
 
1222
      {union w/: lpDDSAlphaDest : LPDIRECTDRAWSURFACE;}
 
1223
    dwAlphaSrcConstBitDepth : DWord;
 
1224
    dwAlphaSrcConst : DWord;
 
1225
      {union w/: lpDDSAlphaSrc : LPDIRECTDRAWSURFACE;}
 
1226
    dckDestColorkey : DDCOLORKEY;
 
1227
    dckSrcColorkey : DDCOLORKEY;
 
1228
 
 
1229
    dwDDFX : DWord;
 
1230
    dwFlags : DWord;
 
1231
  End;
 
1232
  LPDDBLTBATCH = ^DDBLTBATCH;
 
1233
  DDBLTBATCH = Record
 
1234
    lprDest : LPRECT;
 
1235
    lpDDSSrc : LPDIRECTDRAWSURFACE;
 
1236
    lprSrc : LPRECT;
 
1237
    dwFlags : DWord;
 
1238
    lpDDBltFx : LPDDBLTFX;
 
1239
  End;
 
1240
  LPDDGAMMARAMP = ^DDGAMMARAMP;
 
1241
  DDGAMMARAMP = Record
 
1242
    red : Array[0..255] Of Word;
 
1243
    green : Array[0..255] Of Word;
 
1244
    blue : Array[0..255] Of Word;
 
1245
  End;
 
1246
{;
 
1247
; This is the structure within which DirectDraw returns data about the current graphics driver and chipset
 
1248
;
 
1249
 
 
1250
MAX_DDDEVICEID_STRING           = 512
 
1251
 
 
1252
 
 
1253
struc   DDDEVICEIDENTIFIER
 
1254
        szDriver                db MAX_DDDEVICEID_STRING dup (?)
 
1255
        szDescription           db MAX_DDDEVICEID_STRING dup (?)
 
1256
label   liDriverVersion         qword
 
1257
        dwDriverVersionLowPart  dd ?
 
1258
        dwDriverVersionHighPart dd ?
 
1259
        dwVendorId              dd ?
 
1260
        dwDeviceId              dd ?
 
1261
        dwSubSysId              dd ?
 
1262
        dwRevision              dd ?
 
1263
        guidDeviceIdentifier    GUID ?
 
1264
ends}
 
1265
{;
 
1266
; Flags for the IDirectDraw4::GetDeviceIdentifier method
 
1267
;
 
1268
 
 
1269
DDGDI_GETHOSTIDENTIFIER         = 000000001h
 
1270
 
 
1271
proctype CLIPPERCALLBACK :dword, :dword, :dword, :dword
 
1272
proctype SURFACESTREAMINGCALLBACK :dword}
 
1273
(*  LPDDCAPS = ^DDCAPS;
 
1274
  DDCAPS = Record
 
1275
    dwSize : DWord;
 
1276
    {todo...}
 
1277
  End;*)
 
1278
 
 
1279
  LPDDCOLORCONTROL = ^DDCOLORCONTROL;
 
1280
  DDCOLORCONTROL = Record
 
1281
    dwSize : DWord;
 
1282
    dwFlags : DWord;
 
1283
    lBrightness : LongInt;
 
1284
    lContrast : LongInt;
 
1285
    lHue : LongInt;
 
1286
    lSaturation : LongInt;
 
1287
    lSharpness : LongInt;
 
1288
    lGamma : LongInt;
 
1289
    lColorEnable : LongInt;
 
1290
    dwReserved1 : DWord;
 
1291
  End;
 
1292
 
 
1293
  LPDDENUMCALLBACK = Pointer; {CDecl; (maybe)     NO CDECL! STDCALL!}
 
1294
  LPDDENUMMODESCALLBACK = Pointer; {CDecl; !!!        NO CDECL! STDCALL! todo:check DX SDK}
 
1295
  LPDDENUMSURFACESCALLBACK = Pointer; {CDecl; (maybe)     NO CDECL! STDCALL!}
 
1296
  {
 
1297
  BOOL WINAPI lpCallback(GUID FAR * lpGUID, LPSTR lpDriverDescription, LPSTR lpDriverName, LPVOID lpContext);
 
1298
  HRESULT WINAPI lpEnumModesCallback(LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext);
 
1299
  HRESULT WINAPI lpEnumSurfacesCallback(LPDIRECTDRAWSURFACE2 lpDDSurface, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext);
 
1300
  HRESULT WINAPI lpfnCallback(LPDIRECTDRAWSURFACE lpDDSurface, LPVOID lpContext);
 
1301
  }
 
1302
 
 
1303
 
 
1304
{
 
1305
; INTERFACES FOLLOW:
 
1306
;     IDirectDraw
 
1307
;     IDirectDrawClipper
 
1308
;     IDirectDrawPalette
 
1309
;     IDirectDrawSurface
 
1310
;
 
1311
 
 
1312
;
 
1313
; IDirectDraw
 
1314
;
 
1315
 
 
1316
struc   IDirectDraw
 
1317
;** IUnknown methods **
 
1318
        QueryInterface          dd ?       0
 
1319
        AddRef                  dd ?       1
 
1320
        Release                 dd ?       2
 
1321
;** IDirectDraw methods **
 
1322
        Compact                 dd ?       3
 
1323
        CreateClipper           dd ?       4
 
1324
        CreatePalette           dd ?       5
 
1325
        CreateSurface           dd ?       6
 
1326
        DuplicateSurface        dd ?       7
 
1327
        EnumDisplayModes        dd ?       8
 
1328
        EnumSurfaces            dd ?       9
 
1329
        FlipToGDISurface        dd ?       10
 
1330
        GetCaps                 dd ?       11
 
1331
        GetDisplayMode          dd ?       12
 
1332
        GetFourCCCodes          dd ?       13
 
1333
        GetGDISurface           dd ?       14
 
1334
        GetMonitorFrequency     dd ?       15
 
1335
        GetScanLine             dd ?       16
 
1336
        GetVerticalBlankStatus  dd ?       17
 
1337
        Initialize              dd ?       18
 
1338
        RestoreDisplayMode      dd ?       19
 
1339
        SetCooperativeLevel     dd ?       20
 
1340
        SetDisplayMode          dd ?       21
 
1341
        WaitForVerticalBlank    dd ?       22
 
1342
;** IDirectDraw2 methods **
 
1343
        GetAvailableVidMem      dd ?       23
 
1344
;** IDirectDraw4 methods **
 
1345
        GetSurfaceFromDC        dd ?       24
 
1346
        RestoreAllSurfaces      dd ?       25
 
1347
        TestCooperativeLevel    dd ?       26
 
1348
        GetDeviceIdentifier     dd ?       27
 
1349
ends
 
1350
 
 
1351
typedef IDirectDraw2            IDirectDraw
 
1352
typedef IDirectDraw4            IDirectDraw}
 
1353
  IDirectDraw = Record
 
1354
    lpVtbl : ^IDirectDrawVtbl;
 
1355
  End;
 
1356
  IDirectDraw2 = IDirectDraw;
 
1357
  IDirectDraw4 = IDirectDraw;
 
1358
  IDirectDrawVtbl = Record
 
1359
    QueryInterface : Function(obj : LPDIRECTDRAW; sht : LPGUID; lplpGUZ : LPLPVOID) : DWord; DXCall;
 
1360
    AddRef : Function(obj : LPDIRECTDRAW) : DWord; DXCall;
 
1361
    Release : Function(obj : LPDIRECTDRAW) : DWord; DXCall;
 
1362
    Compact : Function(obj : LPDIRECTDRAW) : HResult; DXCall;
 
1363
    CreateClipper : Function(obj : LPDIRECTDRAW;
 
1364
                 dwFlags : DWord; lplpDDClipper : LPLPDIRECTDRAWCLIPPER;
 
1365
                 pUnkOther : Pointer) : HResult; DXCall;
 
1366
    CreatePalette : Function(obj : LPDIRECTDRAW;
 
1367
                 dwFlags : DWord; lpColorTable : LPPALETTEENTRY;
 
1368
                 lplpDDPalette : LPLPDIRECTDRAWPALETTE;
 
1369
                 pUnkOther : Pointer) : HResult; DXCall;
 
1370
    CreateSurface : Function(obj : LPDIRECTDRAW;
 
1371
                 lpDDSurfaceDesc : LPDDSURFACEDESC;
 
1372
                 lplpDDSurface : LPLPDIRECTDRAWSURFACE;
 
1373
                 pUnkOther : Pointer) : HResult; DXCall;
 
1374
    DuplicateSurface : Function(obj : LPDIRECTDRAW;
 
1375
                 lpDDSurface : LPDIRECTDRAWSURFACE;
 
1376
                 lplpDupDDSurface : LPLPDIRECTDRAWSURFACE) : HResult; DXCall;
 
1377
    EnumDisplayModes : Function(obj : LPDIRECTDRAW;
 
1378
                 dwFlags : DWord; lpDDSurfaceDesc : LPDDSURFACEDESC;
 
1379
                 lpContext : LPVOID;
 
1380
                 lpEnumModesCallback : LPDDENUMMODESCALLBACK) : HResult; DXCall;
 
1381
    EnumSurfaces : Function(obj : LPDIRECTDRAW;
 
1382
                 dwFlags : DWord; lpDDSD : LPDDSURFACEDESC;
 
1383
                 lpContext : LPVOID;
 
1384
                 lpEnumSurfacesCallback : LPDDENUMSURFACESCALLBACK) : HResult; DXCall;
 
1385
{    dummy1, dummy2 : DWord;}
 
1386
    FlipToGDISurface : Function(obj : LPDIRECTDRAW) : HResult; DXCall;
 
1387
    GetCaps : Function(obj : LPDIRECTDRAW; lpDDDriverCaps : LPDDCAPS;
 
1388
                 lpDDHELCaps : LPDDCAPS) : HResult; DXCall;
 
1389
    GetDisplayMode : Function(obj : LPDIRECTDRAW;
 
1390
                 lpDDSurfaceDesc : LPDDSURFACEDESC) : HResult; DXCall;
 
1391
    GetFourCCCodes : Function(obj : LPDIRECTDRAW;
 
1392
                 lpNumCodes : LPDWORD; lpCodes : LPDWORD) : HResult; DXCall;
 
1393
    GetGDISurface : Function(obj : LPDIRECTDRAW;
 
1394
                 lplpGDIDDSSurface : LPLPDIRECTDRAWSURFACE) : HResult; DXCall;
 
1395
    GetMonitorFrequency : Function(obj : LPDIRECTDRAW;
 
1396
                 lpdwFrequency : LPDWORD) : HResult; DXCall;
 
1397
    GetScanLine : Function(obj : LPDIRECTDRAW;
 
1398
                 lpdwScanLine : LPDWORD) : HResult; DXCall;
 
1399
    GetVerticalBlankStatus : Function(obj : LPDIRECTDRAW;
 
1400
                 lpbIsInVB : LPBOOL) : HResult; DXCall;
 
1401
    {Function DirectDraw_Initialize(obj : LPDIRECTDRAW) : HResult; DXCall;}
 
1402
    Initialize : DWord;
 
1403
    RestoreDisplayMode : Function(obj : LPDIRECTDRAW) : HResult; DXCall;
 
1404
    SetCooperativeLevel : Function(obj : LPDIRECTDRAW;
 
1405
                 hWnd : HWND; dwFlags : DWord) : HResult; DXCall;
 
1406
    SetDisplayMode : Function(obj : LPDIRECTDRAW;
 
1407
                 dwWidth, dwHeight, dwBPP, dwRefreshRate, dwFlags : DWord) : HResult; DXCall;
 
1408
    WaitForVerticalBlank : Function(obj : LPDIRECTDRAW;
 
1409
                 dwFlags : DWord; hEvent : HANDLE) : HResult; DXCall;
 
1410
    GetAvailableVidMem : Function(obj : LPDIRECTDRAW;
 
1411
                 lpDDSCaps : LPDDSCAPS; lpdwTotal : LPDWORD; lpdwFree : LPDWORD) : HResult; DXCall;
 
1412
  End;
 
1413
 
 
1414
(*Function DirectDraw_AddRef(obj : LPDIRECTDRAW) : DWord;
 
1415
Function DirectDraw_Release(obj : LPDIRECTDRAW) : DWord;
 
1416
Function DirectDraw_Compact(obj : LPDIRECTDRAW) : HResult;
 
1417
Function DirectDraw_CreateClipper(obj : LPDIRECTDRAW;
 
1418
             dwFlags : DWord; lplpDDClipper : LPLPDIRECTDRAWCLIPPER;
 
1419
             pUnkOther : Pointer) : HResult;
 
1420
Function DirectDraw_CreatePalette(obj : LPDIRECTDRAW;
 
1421
             dwFlags : DWord; lpColorTable : LPPALETTEENTRY;
 
1422
             lplpDDPalette : LPLPDIRECTDRAWPALETTE;
 
1423
             pUnkOther : Pointer) : HResult;
 
1424
Function DirectDraw_CreateSurface(obj : LPDIRECTDRAW;
 
1425
             lpDDSurfaceDesc : LPDDSURFACEDESC;
 
1426
             lplpDDSurface : LPLPDIRECTDRAWSURFACE;
 
1427
             pUnkOther : Pointer) : HResult;
 
1428
Function DirectDraw_DuplicateSurface(obj : LPDIRECTDRAW;
 
1429
             lpDDSurface : LPDIRECTDRAWSURFACE;
 
1430
             lplpDupDDSurface : LPLPDIRECTDRAWSURFACE) : HResult;
 
1431
Function DirectDraw_EnumDisplayModes(obj : LPDIRECTDRAW;
 
1432
             dwFlags : DWord; lpDDSurfaceDesc : LPDDSURFACEDESC;
 
1433
             lpContext : LPVOID;
 
1434
             lpEnumModesCallback : LPDDENUMMODESCALLBACK) : HResult;
 
1435
Function DirectDraw_EnumSurfaces(obj : LPDIRECTDRAW;
 
1436
             dwFlags : DWord; lpDDSD : LPDDSURFACEDESC;
 
1437
             lpContext : LPVOID;
 
1438
             lpEnumSurfacesCallback : LPDDENUMSURFACESCALLBACK) : HResult;
 
1439
Function DirectDraw_FlipToGDISurface(obj : LPDIRECTDRAW) : HResult;
 
1440
Function DirectDraw_GetCaps(obj : LPDIRECTDRAW; lpDDDriverCaps : LPDDCAPS;
 
1441
             lpDDHELCaps : LPDDCAPS) : HResult;
 
1442
Function DirectDraw_GetDisplayMode(obj : LPDIRECTDRAW;
 
1443
             lpDDSurfaceDesc : LPDDSURFACEDESC) : HResult;
 
1444
Function DirectDraw_GetFourCCCodes(obj : LPDIRECTDRAW;
 
1445
             lpNumCodes : LPDWORD; lpCodes : LPDWORD) : HResult;
 
1446
Function DirectDraw_GetGDISurface(obj : LPDIRECTDRAW;
 
1447
             lplpGDIDDSSurface : LPLPDIRECTDRAWSURFACE) : HResult;
 
1448
Function DirectDraw_GetMonitorFrequency(obj : LPDIRECTDRAW;
 
1449
             lpdwFrequency : LPDWORD) : HResult;
 
1450
Function DirectDraw_GetScanLine(obj : LPDIRECTDRAW;
 
1451
             lpdwScanLine : LPDWORD) : HResult;
 
1452
Function DirectDraw_GetVerticalBlankStatus(obj : LPDIRECTDRAW;
 
1453
             lpbIsInVB : LPBOOL) : HResult;
 
1454
{Function DirectDraw_Initialize(obj : LPDIRECTDRAW) : HResult;}
 
1455
Function DirectDraw_RestoreDisplayMode(obj : LPDIRECTDRAW) : HResult;
 
1456
Function DirectDraw_SetCooperativeLevel(obj : LPDIRECTDRAW;
 
1457
             hWnd : HWND; dwFlags : DWord) : HResult;
 
1458
Function DirectDraw_SetDisplayMode(obj : LPDIRECTDRAW;
 
1459
             dwWidth, dwHeight, dwBPP, dwRefreshRate, dwFlags : DWord) : HResult;
 
1460
Function DirectDraw_WaitForVerticalBlank(obj : LPDIRECTDRAW;
 
1461
             dwFlags : DWord; hEvent : HANDLE) : HResult;
 
1462
Function DirectDraw_GetAvailableVidMem(obj : LPDIRECTDRAW;
 
1463
             lpDDSCaps : LPDDSCAPS; lpdwTotal : LPDWORD; lpdwFree : LPDWORD) : HResult;*)
 
1464
 
 
1465
 
 
1466
  IDirectDrawPalette = Record
 
1467
    lpVtbl : ^IDirectDrawPaletteVtbl;
 
1468
  End;
 
1469
  IDirectDrawPaletteVtbl = Record
 
1470
    q : Pointer;
 
1471
    AddRef : Function(obj : LPDIRECTDRAWPALETTE) : DWord; DXCall;
 
1472
    Release : Function(obj : LPDIRECTDRAWPALETTE) : DWord; DXCall;
 
1473
    GetCaps : Function(obj : LPDIRECTDRAWPALETTE;
 
1474
                lpdwCaps : LPDWORD) : HRESULT; DXCall;
 
1475
    GetEntries : Function(obj : LPDIRECTDRAWPALETTE;
 
1476
                   dwFlags, dwBase, dwNumEntries : DWord;
 
1477
                   lpEntries : LPPALETTEENTRY) : HRESULT; DXCall;
 
1478
    Initialize : Function(obj : LPDIRECTDRAWPALETTE;
 
1479
                   lpDD : LPDIRECTDRAW; dwFlags : DWord;
 
1480
                   lpDDColorTable : LPPALETTEENTRY) : HRESULT; DXCall;
 
1481
    SetEntries : Function(obj : LPDIRECTDRAWPALETTE;
 
1482
                   dwFlags, dwStartingEntry, dwCount : DWord;
 
1483
                   lpEntries : LPPALETTEENTRY) : HRESULT; DXCall;
 
1484
  End;
 
1485
 
 
1486
{
 
1487
;
 
1488
; IDirectDrawPalette
 
1489
;
 
1490
 
 
1491
struc   IDirectDrawPalette
 
1492
;** IUnknown methods **
 
1493
        QueryInterface          dd ?
 
1494
        AddRef                  dd ?
 
1495
        Release                 dd ?
 
1496
;** IDirectDrawPalette methods **
 
1497
        GetCaps                 dd ?
 
1498
        GetEntries              dd ?
 
1499
        Initialize              dd ?
 
1500
        SetEntries              dd ?
 
1501
ends}
 
1502
 
 
1503
  IDirectDrawClipper = Record
 
1504
    lpVtbl : ^IDirectDrawClipperVtbl;
 
1505
  End;
 
1506
  IDirectDrawClipperVtbl = Record
 
1507
    q : Pointer;
 
1508
    AddRef : Function(obj : LPDIRECTDRAWCLIPPER) : DWord; DXCall;
 
1509
    Release : Function(obj : LPDIRECTDRAWCLIPPER) : DWord; DXCall;
 
1510
    GetClipList : Function(obj : LPDIRECTDRAWCLIPPER;
 
1511
                    lpRect : LPRECT; lpClipList : LPRGNDATA;
 
1512
                    lpdwSize : LPDWORD) : HRESULT; DXCall;
 
1513
    GetHWnd : Function(obj : LPDIRECTDRAWCLIPPER;
 
1514
                lphWnd : PHWND) : HRESULT; DXCall;
 
1515
    Initialize : Function(obj : LPDIRECTDRAWCLIPPER;
 
1516
                   lpDD : LPDIRECTDRAW; dwFlags : DWord) : HRESULT; DXCall;
 
1517
    IsClipListChanged : Function(obj : LPDIRECTDRAWCLIPPER;
 
1518
                          lpbChanged : PBoolean) : HRESULT; DXCall;
 
1519
    SetClipList : Function(obj : LPDIRECTDRAWCLIPPER;
 
1520
                    lpClipList : LPRGNDATA;
 
1521
                    dwFlags : DWord) : HRESULT; DXCall;
 
1522
    SetHWnd : Function(obj : LPDIRECTDRAWCLIPPER;
 
1523
                dwFlags : DWord; hWnd : HWND) : HRESULT; DXCall;
 
1524
  End;
 
1525
 
 
1526
{;
 
1527
; IDirectDrawClipper
 
1528
;
 
1529
 
 
1530
struc   IDirectDrawClipper
 
1531
;** IUnknown methods **
 
1532
        QueryInterface          dd ?
 
1533
        AddRef                  dd ?
 
1534
        Release                 dd ?
 
1535
;** IDirectDrawClipper methods **
 
1536
        GetClipList             dd ?
 
1537
        GetHWnd                 dd ?
 
1538
        Initialize              dd ?
 
1539
        IsClipListChanged       dd ?
 
1540
        SetClipList             dd ?
 
1541
        SetHWnd                 dd ?
 
1542
ends}
 
1543
 
 
1544
  IDirectDrawSurface = Record
 
1545
    lpVtbl : ^IDirectDrawSurfaceVtbl;
 
1546
  End;
 
1547
  IDirectDrawSurface2 = IDirectDrawSurface;
 
1548
  IDirectDrawSurface3 = IDirectDrawSurface;
 
1549
  IDirectDrawSurface4 = IDirectDrawSurface;
 
1550
  IDirectDrawSurfaceVtbl = Record
 
1551
    q : Pointer;
 
1552
    AddRef : Function(obj : LPDIRECTDRAWSURFACE) : DWord; DXCall;
 
1553
    Release : Function(obj : LPDIRECTDRAWSURFACE) : DWord; DXCall;
 
1554
    AddAttachedSurface : Function(obj : LPDIRECTDRAWSURFACE;
 
1555
                           lpDDSAttachedSurface : LPDIRECTDRAWSURFACE{2}) : HRESULT; DXCall;
 
1556
    AddOverlayDirtyRect : Function(obj : LPDIRECTDRAWSURFACE;
 
1557
                            lpRect : LPRECT) : HRESULT; DXCall;
 
1558
    Blt : Function(obj : LPDIRECTDRAWSURFACE; lpDestRect : LPRECT;
 
1559
            lpDDSrcSurface : LPDIRECTDRAWSURFACE{2}; lpSrcRect : LPRECT;
 
1560
            dwFlags : DWord; lpDDBltFx : LPDDBLTFX) : HRESULT; DXCall;
 
1561
    BltBatch : Function(obj : LPDIRECTDRAWSURFACE;
 
1562
                 lpDDBltBatch : LPDDBLTBATCH; dwCount, dwFlags : DWord) : HRESULT; DXCall;
 
1563
    BltFast : Function(obj : LPDIRECTDRAWSURFACE; dwX, dwY : DWord;
 
1564
                lpDDSrcSurface : LPDIRECTDRAWSURFACE{2}; lpSrcRect : LPRECT;
 
1565
                dwTrans : DWord) : HRESULT; DXCall;
 
1566
    DeleteAttachedSurface : Function(obj : LPDIRECTDRAWSURFACE;
 
1567
                              dwFlags : DWord;
 
1568
                              lpDDSAttachedSurface : LPDIRECTDRAWSURFACE{2}) : HRESULT; DXCall;
 
1569
    EnumAttachedSurfaces : Function(obj : LPDIRECTDRAWSURFACE;
 
1570
                             lpContext : LPVOID;
 
1571
                             lpEnumSurfacesCallback : LPDDENUMSURFACESCALLBACK) : HRESULT; DXCall;
 
1572
    EnumOverlayZOrders : Function(obj : LPDIRECTDRAWSURFACE;
 
1573
                           dwFlags : DWord; lpContext : LPVOID;
 
1574
                           lpfnCallback : LPDDENUMSURFACESCALLBACK) : HRESULT; DXCall;
 
1575
    Flip : Function(obj : LPDIRECTDRAWSURFACE;
 
1576
             lpDDSurfaceTargetOverride : LPDIRECTDRAWSURFACE{2};
 
1577
             dwFlags : DWord) : HRESULT; DXCall;
 
1578
    GetAttachedSurface : Function(obj : LPDIRECTDRAWSURFACE;
 
1579
                           lpDDSCaps : LPDDSCAPS;
 
1580
                           lplpDDAttachedSurface : LPLPDIRECTDRAWSURFACE{2}) : HRESULT; DXCall;
 
1581
    GetBltStatus : Function(obj : LPDIRECTDRAWSURFACE;
 
1582
                     dwFlags : DWord) : HRESULT; DXCall;
 
1583
    GetCaps : Function(obj : LPDIRECTDRAWSURFACE;
 
1584
                lpDDSCaps : LPDDSCAPS) : HRESULT; DXCall;
 
1585
    GetClipper : Function(obj : LPDIRECTDRAWSURFACE;
 
1586
                   lplpDDClipper : LPLPDIRECTDRAWCLIPPER) : HRESULT; DXCall;
 
1587
    GetColorKey : Function(obj : LPDIRECTDRAWSURFACE;
 
1588
                    dwFlags : DWord; lpDDColorKey : LPDDCOLORKEY) : HRESULT; DXCall;
 
1589
    GetDC : Function(obj : LPDIRECTDRAWSURFACE;
 
1590
              lphDC : PHDC) : HRESULT; DXCall;
 
1591
    GetFlipStatus : Function(obj : LPDIRECTDRAWSURFACE;
 
1592
                      dwFlags : DWord) : HRESULT; DXCall;
 
1593
    GetOverlayPosition : Function(obj : LPDIRECTDRAWSURFACE;
 
1594
                           lplX, lplY : LPDWORD) : HRESULT; DXCall;
 
1595
    GetPalette : Function(obj : LPDIRECTDRAWSURFACE;
 
1596
                   lplpDDPalette : LPLPDIRECTDRAWPALETTE) : HRESULT; DXCall;
 
1597
    GetPixelFormat : Function(obj : LPDIRECTDRAWSURFACE;
 
1598
                       lpDDPixelFormat : LPDDPIXELFORMAT) : HRESULT; DXCall;
 
1599
    GetSurfaceDesc : Function(obj : LPDIRECTDRAWSURFACE;
 
1600
                       lpDDSurfaceDesc : LPDDSURFACEDESC) : HRESULT; DXCall;
 
1601
    Initialize : Function(obj : LPDIRECTDRAWSURFACE;
 
1602
                   lpDD : LPDIRECTDRAW;
 
1603
                   lpDDSurfaceDesc : LPDDSURFACEDESC) : HRESULT; DXCall;
 
1604
    IsLost : Function(obj : LPDIRECTDRAWSURFACE) : HRESULT; DXCall;
 
1605
    Lock : Function(obj : LPDIRECTDRAWSURFACE;
 
1606
             lpDestRect : LPRECT; lpDDSurfaceDesc : LPDDSURFACEDESC;
 
1607
             dwFlags : DWord; hEvent : HANDLE) : HRESULT; DXCall;
 
1608
    ReleaseDC : Function(obj : LPDIRECTDRAWSURFACE;
 
1609
                  hDC : HDC) : HRESULT; DXCall;
 
1610
    Restore : Function(obj : LPDIRECTDRAWSURFACE) : HRESULT; DXCall;
 
1611
    SetClipper : Function(obj : LPDIRECTDRAWSURFACE;
 
1612
                   lpDDClipper : LPDIRECTDRAWCLIPPER) : HRESULT; DXCall;
 
1613
    SetColorKey : Function(obj : LPDIRECTDRAWSURFACE;
 
1614
                    dwFlags : DWord; lpDDColorKey : LPDDCOLORKEY) : HRESULT; DXCall;
 
1615
    SetOverlayPosition : Function(obj : LPDIRECTDRAWSURFACE;
 
1616
                           lX, lY : LongInt) : HRESULT; DXCall;
 
1617
    SetPalette : Function(obj : LPDIRECTDRAWSURFACE;
 
1618
                   lpDDPalette : LPDIRECTDRAWPALETTE) : HRESULT; DXCall;
 
1619
    Unlock : Function(obj : LPDIRECTDRAWSURFACE;
 
1620
               lpSurfaceData : LPVOID) : HRESULT; DXCall;
 
1621
    UpdateOverlay : Function(obj : LPDIRECTDRAWSURFACE;
 
1622
                      lpSrcRect : LPRECT; lpDDDestSurface : LPDIRECTDRAWSURFACE{2};
 
1623
                      lpDestRect : LPRECT; dwFlags : DWord;
 
1624
                      lpDDOverlayFx : LPDDOVERLAYFX) : HRESULT; DXCall;
 
1625
    UpdateOverlayDisplay : Function(obj : LPDIRECTDRAWSURFACE;
 
1626
                             dwFlags : DWord) : HRESULT; DXCall;
 
1627
    UpdateOverlayZOrder : Function(obj : LPDIRECTDRAWSURFACE;
 
1628
                            dwFlags : DWord;
 
1629
                            lpDDSReference : LPDIRECTDRAWSURFACE{2}) : HRESULT; DXCall;
 
1630
    {v2}
 
1631
    GetDDInterface : Function(obj : LPDIRECTDRAWSURFACE;
 
1632
                       lplpDD : LPLPVOID) : HRESULT; DXCall;
 
1633
    PageLock : Function(obj : LPDIRECTDRAWSURFACE;
 
1634
                 dwFlags : DWord) : HRESULT; DXCall;
 
1635
    PageUnlock : Function(obj : LPDIRECTDRAWSURFACE;
 
1636
                   dwFlags : DWord) : HRESULT; DXCall;
 
1637
    {v3}
 
1638
{    SetSurfaceDesc}
 
1639
    {v4}
 
1640
{    SetPrivateData
 
1641
    GetPrivateData
 
1642
    FreePrivateData
 
1643
    GetUniquenessValue
 
1644
    ChangeUniquenessValue}
 
1645
  End;
 
1646
{;
 
1647
; IDirectDrawSurface and related interfaces
 
1648
;
 
1649
 
 
1650
struc   IDirectDrawSurface
 
1651
;** IUnknown methods **
 
1652
        QueryInterface          dd ?
 
1653
        AddRef                  dd ?
 
1654
        Release                 dd ?
 
1655
;** IDirectDrawSurface methods **
 
1656
        AddAttachedSurface      dd ?
 
1657
        AddOverlayDirtyRect     dd ?
 
1658
        Blt                     dd ?
 
1659
        BltBatch                dd ?
 
1660
        BltFast                 dd ?
 
1661
        DeleteAttachedSurface   dd ?
 
1662
        EnumAttachedSurfaces    dd ?
 
1663
        EnumOverlayZOrders      dd ?
 
1664
        Flip                    dd ?
 
1665
        GetAttachedSurface      dd ?
 
1666
        GetBltStatus            dd ?
 
1667
        GetCaps                 dd ?
 
1668
        GetClipper              dd ?
 
1669
        GetColorKey             dd ?
 
1670
        GetDC                   dd ?
 
1671
        GetFlipStatus           dd ?
 
1672
        GetOverlayPosition      dd ?
 
1673
        GetPalette              dd ?
 
1674
        GetPixelFormat          dd ?
 
1675
        GetSurfaceDesc          dd ?
 
1676
        Initialize              dd ?
 
1677
        IsLost                  dd ?
 
1678
        _Lock                   dd ?
 
1679
        ReleaseDC               dd ?
 
1680
        Restore                 dd ?
 
1681
        SetClipper              dd ?
 
1682
        SetColorKey             dd ?
 
1683
        SetOverlayPosition      dd ?
 
1684
        SetPalette              dd ?
 
1685
        Unlock                  dd ?
 
1686
        UpdateOverlay           dd ?
 
1687
        UpdateOverlayDisplay    dd ?
 
1688
        UpdateOverlayZOrder     dd ?
 
1689
;** Added in the v2 interface **
 
1690
        GetDDInterface          dd ?
 
1691
        PageLock                dd ?
 
1692
        PageUnlock              dd ?
 
1693
;** Added in the v3 interface **
 
1694
        SetSurfaceDesc          dd ?
 
1695
;** Added in the v4 interface **
 
1696
        SetPrivateData          dd ?
 
1697
        GetPrivateData          dd ?
 
1698
        FreePrivateData         dd ?
 
1699
        GetUniquenessValue      dd ?
 
1700
        ChangeUniquenessValue   dd ?
 
1701
ends
 
1702
 
 
1703
typedef IDirectDrawSurface2     IDirectDrawSurface
 
1704
typedef IDirectDrawSurface3     IDirectDrawSurface
 
1705
typedef IDirectDrawSurface4     IDirectDrawSurface
 
1706
}
 
1707
 
 
1708
{
 
1709
;
 
1710
; IDirectDrawColorControl
 
1711
;
 
1712
 
 
1713
struc   IDirectDrawColorControl
 
1714
;** IUnknown methods **
 
1715
        QueryInterface          dd ?
 
1716
        AddRef                  dd ?
 
1717
        Release                 dd ?
 
1718
;** IDirectDrawColorControl methods **
 
1719
        GetColorControls        dd ?
 
1720
        SetColorControls        dd ?
 
1721
ends
 
1722
 
 
1723
;
 
1724
; IDirectDrawGammaControl
 
1725
;
 
1726
 
 
1727
struc   IDirectDrawGammaControl
 
1728
;** IUnknown methods **
 
1729
        QueryInterface          dd ?
 
1730
        AddRef                  dd ?
 
1731
        Release                 dd ?
 
1732
;** IDirectDrawColorControl methods **
 
1733
        GetGammaRamp            dd ?
 
1734
        SetGammaRamp            dd ?
 
1735
ends}
 
1736
 
 
1737
  TDirectDrawCreate = Function(lpGUID : Pointer; lplpDD : LPLPDIRECTDRAW; pUnkOuter : Pointer{IUnknown FAR *}) : HRESULT; DXCall;
 
1738
  TDirectDrawCreateClipper = Function(dwFlags : DWord; lplpDDClipper : LPLPDIRECTDRAWCLIPPER; pUnkOuter : Pointer{IUnknown FAR *}) : HRESULT; DXCall;
 
1739
  TDirectDrawEnumerate = Function(lpCallback : LPDDENUMCALLBACK; lpContext : LPVOID) : HRESULT; DXCall; {DirectDrawEnumerateA}
 
1740
  TDirectDrawEnumerateEx = Function(A, B, C : DWord) : HRESULT; DXCall; {DirectDrawEnumerateExA}
 
1741
 
 
1742
Var
 
1743
  DirectDrawCreate : TDirectDrawCreate;
 
1744
  DirectDrawCreateClipper : TDirectDrawCreateClipper;
 
1745
  DirectDrawEnumerate : TDirectDrawEnumerate;
 
1746
  DirectDrawEnumerateEx : TDirectDrawEnumerateEx;
 
1747
 
 
1748
Implementation
 
1749
 
 
1750
Begin
 
1751
  DirectDrawCreate := Nil;
 
1752
  DirectDrawCreateClipper := Nil;
 
1753
  DirectDrawEnumerate := Nil;
 
1754
  DirectDrawEnumerateEx := Nil;
 
1755
End.