add DX3 headers
[xonotic/xonotic.git] / misc / builddeps / dp.win32 / include / ddraw.h
1 /*==========================================================================;
2  *
3  *  Copyright (C) 1994-1997 Microsoft Corporation.  All Rights Reserved.
4  *
5  *  File:       ddraw.h
6  *  Content:    DirectDraw include file
7  *
8  ***************************************************************************/
9
10 #ifndef __DDRAW_INCLUDED__
11 #define __DDRAW_INCLUDED__
12
13 /*
14  * If you wish an application built against the newest version of DirectDraw
15  * to run against an older DirectDraw run time then define DIRECTDRAW_VERSION
16  * to be the earlies version of DirectDraw you wish to run against. For,
17  * example if you wish an application to run against a DX 3 runtime define
18  * DIRECTDRAW_VERSION to be 0x0300.
19  */
20 #ifndef   DIRECTDRAW_VERSION
21 #define   DIRECTDRAW_VERSION 0x0600
22 #endif /* DIRECTDRAW_VERSION */
23
24 #if defined( _WIN32 )  && !defined( _NO_COM )
25 #define COM_NO_WINDOWS_H
26 #include <objbase.h>
27 #else
28 #define IUnknown            void
29 #if !defined( NT_BUILD_ENVIRONMENT ) && !defined(WINNT)
30         #define CO_E_NOTINITIALIZED 0x800401F0L
31 #endif
32 #endif
33
34 #define _FACDD  0x876
35 #define MAKE_DDHRESULT( code )  MAKE_HRESULT( 1, _FACDD, code )
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 //
42 // For compilers that don't support nameless unions, do a
43 //
44 // #define NONAMELESSUNION
45 //
46 // before #include <ddraw.h>
47 //
48 #ifndef DUMMYUNIONNAMEN
49 #if defined(__cplusplus) || !defined(NONAMELESSUNION)
50 #define DUMMYUNIONNAMEN(n)
51 #else
52 #define DUMMYUNIONNAMEN(n)      u##n
53 #endif
54 #endif
55
56 #ifndef MAKEFOURCC
57     #define MAKEFOURCC(ch0, ch1, ch2, ch3)                              \
58                 ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) |   \
59                 ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
60 #endif //defined(MAKEFOURCC)
61
62 /*
63  * FOURCC codes for DX compressed-texture pixel formats
64  */
65 #define FOURCC_DXT1  (MAKEFOURCC('D','X','T','1'))
66 #define FOURCC_DXT2  (MAKEFOURCC('D','X','T','2'))
67 #define FOURCC_DXT3  (MAKEFOURCC('D','X','T','3'))
68 #define FOURCC_DXT4  (MAKEFOURCC('D','X','T','4'))
69 #define FOURCC_DXT5  (MAKEFOURCC('D','X','T','5'))
70
71 /*
72  * GUIDS used by DirectDraw objects
73  */
74 #if defined( _WIN32 ) && !defined( _NO_COM )
75
76 DEFINE_GUID( CLSID_DirectDraw,                  0xD7B70EE0,0x4340,0x11CF,0xB0,0x63,0x00,0x20,0xAF,0xC2,0xCD,0x35 );
77 DEFINE_GUID( CLSID_DirectDrawClipper,           0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56 );
78 DEFINE_GUID( IID_IDirectDraw,                   0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
79 DEFINE_GUID( IID_IDirectDraw2,                  0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 );
80 DEFINE_GUID( IID_IDirectDraw4,                  0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
81 DEFINE_GUID( IID_IDirectDrawSurface,            0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
82 DEFINE_GUID( IID_IDirectDrawSurface2,           0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27 );
83 DEFINE_GUID( IID_IDirectDrawSurface3,           0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB );
84 DEFINE_GUID( IID_IDirectDrawSurface4,           0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B );
85
86 DEFINE_GUID( IID_IDirectDrawPalette,            0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
87 DEFINE_GUID( IID_IDirectDrawClipper,            0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
88 DEFINE_GUID( IID_IDirectDrawColorControl,       0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 );
89 DEFINE_GUID( IID_IDirectDrawGammaControl,       0x69C11C3E,0xB46B,0x11D1,0xAD,0x7A,0x00,0xC0,0x4F,0xC2,0x9B,0x4E );
90
91 #endif
92
93 /*============================================================================
94  *
95  * DirectDraw Structures
96  *
97  * Various structures used to invoke DirectDraw.
98  *
99  *==========================================================================*/
100
101 struct IDirectDraw;
102 struct IDirectDrawSurface;
103 struct IDirectDrawPalette;
104 struct IDirectDrawClipper;
105
106 typedef struct IDirectDraw              FAR *LPDIRECTDRAW;
107 typedef struct IDirectDraw2             FAR *LPDIRECTDRAW2;
108 typedef struct IDirectDraw4             FAR *LPDIRECTDRAW4;
109 typedef struct IDirectDrawSurface       FAR *LPDIRECTDRAWSURFACE;
110 typedef struct IDirectDrawSurface2      FAR *LPDIRECTDRAWSURFACE2;
111 typedef struct IDirectDrawSurface3      FAR *LPDIRECTDRAWSURFACE3;
112 typedef struct IDirectDrawSurface4      FAR *LPDIRECTDRAWSURFACE4;
113
114 typedef struct IDirectDrawPalette               FAR *LPDIRECTDRAWPALETTE;
115 typedef struct IDirectDrawClipper               FAR *LPDIRECTDRAWCLIPPER;
116 typedef struct IDirectDrawColorControl          FAR *LPDIRECTDRAWCOLORCONTROL;
117 typedef struct IDirectDrawGammaControl          FAR *LPDIRECTDRAWGAMMACONTROL;
118
119 typedef struct _DDFXROP                 FAR *LPDDFXROP;
120 typedef struct _DDSURFACEDESC           FAR *LPDDSURFACEDESC;
121 typedef struct _DDSURFACEDESC2          FAR *LPDDSURFACEDESC2;
122 typedef struct _DDCOLORCONTROL          FAR *LPDDCOLORCONTROL;
123
124 /*
125  * API's
126  */
127 #if (defined (WIN32) || defined( _WIN32 ) ) && !defined( _NO_COM )
128 //#if defined( _WIN32 ) && !defined( _NO_ENUM )
129     typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKA)(GUID FAR *, LPSTR, LPSTR, LPVOID);
130     typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKW)(GUID FAR *, LPWSTR, LPWSTR, LPVOID);
131     extern HRESULT WINAPI DirectDrawEnumerateW( LPDDENUMCALLBACKW lpCallback, LPVOID lpContext );
132     extern HRESULT WINAPI DirectDrawEnumerateA( LPDDENUMCALLBACKA lpCallback, LPVOID lpContext );
133     /*
134      * Protect against old SDKs
135      */
136     #ifndef SM_CMONITORS
137         #define HMONITOR    HANDLE
138     #endif
139     typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKEXA)(GUID FAR *, LPSTR, LPSTR, LPVOID, HMONITOR);
140     typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKEXW)(GUID FAR *, LPWSTR, LPWSTR, LPVOID, HMONITOR);
141     extern HRESULT WINAPI DirectDrawEnumerateExW( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags);
142     extern HRESULT WINAPI DirectDrawEnumerateExA( LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags);
143     typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXA)( LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags);
144     typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXW)( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags);
145
146     #ifdef UNICODE
147         typedef LPDDENUMCALLBACKW           LPDDENUMCALLBACK;
148         #define DirectDrawEnumerate         DirectDrawEnumerateW
149         typedef LPDDENUMCALLBACKEXW         LPDDENUMCALLBACKEX;
150         typedef LPDIRECTDRAWENUMERATEEXW        LPDIRECTDRAWENUMERATEEX;
151         #define DirectDrawEnumerateEx       DirectDrawEnumerateExW
152     #else
153         typedef LPDDENUMCALLBACKA           LPDDENUMCALLBACK;
154         #define DirectDrawEnumerate         DirectDrawEnumerateA
155         typedef LPDDENUMCALLBACKEXA         LPDDENUMCALLBACKEX;
156         typedef LPDIRECTDRAWENUMERATEEXA        LPDIRECTDRAWENUMERATEEX;
157         #define DirectDrawEnumerateEx       DirectDrawEnumerateExA
158     #endif
159     extern HRESULT WINAPI DirectDrawCreate( GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter );
160     extern HRESULT WINAPI DirectDrawCreateClipper( DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter );
161 #endif
162 /*
163  * Flags for DirectDrawEnumerateEx
164  * DirectDrawEnumerateEx supercedes DirectDrawEnumerate. You must use GetProcAddress to
165  * obtain a function pointer (of type LPDIRECTDRAWENUMERATEEX) to DirectDrawEnumerateEx.
166  * By default, only the primary display device is enumerated.
167  * DirectDrawEnumerate is equivalent to DirectDrawEnumerate(,,DDENUM_NONDISPLAYDEVICES)
168  */
169
170 /*
171  * This flag causes enumeration of any GDI display devices which are part of
172  * the Windows Desktop
173  */
174 #define DDENUM_ATTACHEDSECONDARYDEVICES     0x00000001L
175
176 /*
177  * This flag causes enumeration of any GDI display devices which are not
178  * part of the Windows Desktop
179  */
180 #define DDENUM_DETACHEDSECONDARYDEVICES     0x00000002L
181
182 /*
183  * This flag causes enumeration of non-display devices
184  */
185 #define DDENUM_NONDISPLAYDEVICES            0x00000004L
186
187
188 #define REGSTR_KEY_DDHW_DESCRIPTION     "Description"
189 #define REGSTR_KEY_DDHW_DRIVERNAME      "DriverName"
190 #define REGSTR_PATH_DDHW                "Hardware\\DirectDrawDrivers"
191
192 #define DDCREATE_HARDWAREONLY           0x00000001l
193 #define DDCREATE_EMULATIONONLY          0x00000002l
194
195 #if defined(WINNT) || !defined(WIN32)
196 typedef long HRESULT;
197 #endif
198
199 //#ifndef WINNT
200 typedef HRESULT (FAR PASCAL * LPDDENUMMODESCALLBACK)(LPDDSURFACEDESC, LPVOID);
201 typedef HRESULT (FAR PASCAL * LPDDENUMMODESCALLBACK2)(LPDDSURFACEDESC2, LPVOID);
202 typedef HRESULT (FAR PASCAL * LPDDENUMSURFACESCALLBACK)(LPDIRECTDRAWSURFACE, LPDDSURFACEDESC, LPVOID);
203 typedef HRESULT (FAR PASCAL * LPDDENUMSURFACESCALLBACK2)(LPDIRECTDRAWSURFACE4, LPDDSURFACEDESC2, LPVOID);
204 //#endif
205
206 /*
207  * Generic pixel format with 8-bit RGB and alpha components
208  */
209 typedef struct _DDRGBA
210 {
211     BYTE red;
212     BYTE green;
213     BYTE blue;
214     BYTE alpha;
215 } DDRGBA;
216
217 typedef DDRGBA FAR *LPDDRGBA;
218
219 /*
220  * DDCOLORKEY
221  */
222 typedef struct _DDCOLORKEY
223 {
224     DWORD       dwColorSpaceLowValue;   // low boundary of color space that is to
225                                         // be treated as Color Key, inclusive
226     DWORD       dwColorSpaceHighValue;  // high boundary of color space that is
227                                         // to be treated as Color Key, inclusive
228 } DDCOLORKEY;
229
230 typedef DDCOLORKEY FAR* LPDDCOLORKEY;
231
232 /*
233  * DDBLTFX
234  * Used to pass override information to the DIRECTDRAWSURFACE callback Blt.
235  */
236 typedef struct _DDBLTFX
237 {
238     DWORD       dwSize;                         // size of structure
239     DWORD       dwDDFX;                         // FX operations
240     DWORD       dwROP;                          // Win32 raster operations
241     DWORD       dwDDROP;                        // Raster operations new for DirectDraw
242     DWORD       dwRotationAngle;                // Rotation angle for blt
243     DWORD       dwZBufferOpCode;                // ZBuffer compares
244     DWORD       dwZBufferLow;                   // Low limit of Z buffer
245     DWORD       dwZBufferHigh;                  // High limit of Z buffer
246     DWORD       dwZBufferBaseDest;              // Destination base value
247     DWORD       dwZDestConstBitDepth;           // Bit depth used to specify Z constant for destination
248     union
249     {
250         DWORD   dwZDestConst;                   // Constant to use as Z buffer for dest
251         LPDIRECTDRAWSURFACE lpDDSZBufferDest;   // Surface to use as Z buffer for dest
252     } DUMMYUNIONNAMEN(1);
253     DWORD       dwZSrcConstBitDepth;            // Bit depth used to specify Z constant for source
254     union
255     {
256         DWORD   dwZSrcConst;                    // Constant to use as Z buffer for src
257         LPDIRECTDRAWSURFACE lpDDSZBufferSrc;    // Surface to use as Z buffer for src
258     } DUMMYUNIONNAMEN(2);
259     DWORD       dwAlphaEdgeBlendBitDepth;       // Bit depth used to specify constant for alpha edge blend
260     DWORD       dwAlphaEdgeBlend;               // Alpha for edge blending
261     DWORD       dwReserved;
262     DWORD       dwAlphaDestConstBitDepth;       // Bit depth used to specify alpha constant for destination
263     union
264     {
265         DWORD   dwAlphaDestConst;               // Constant to use as Alpha Channel
266         LPDIRECTDRAWSURFACE lpDDSAlphaDest;     // Surface to use as Alpha Channel
267     } DUMMYUNIONNAMEN(3);
268     DWORD       dwAlphaSrcConstBitDepth;        // Bit depth used to specify alpha constant for source
269     union
270     {
271         DWORD   dwAlphaSrcConst;                // Constant to use as Alpha Channel
272         LPDIRECTDRAWSURFACE lpDDSAlphaSrc;      // Surface to use as Alpha Channel
273     } DUMMYUNIONNAMEN(4);
274     union
275     {
276         DWORD   dwFillColor;                    // color in RGB or Palettized
277         DWORD   dwFillDepth;                    // depth value for z-buffer
278         DWORD   dwFillPixel;                    // pixel value for RGBA or RGBZ
279         LPDIRECTDRAWSURFACE lpDDSPattern;       // Surface to use as pattern
280     } DUMMYUNIONNAMEN(5);
281     DDCOLORKEY  ddckDestColorkey;               // DestColorkey override
282     DDCOLORKEY  ddckSrcColorkey;                // SrcColorkey override
283 } DDBLTFX;
284
285 typedef DDBLTFX FAR* LPDDBLTFX;
286
287
288 /*
289  * DDSCAPS
290  */
291 typedef struct _DDSCAPS
292 {
293     DWORD       dwCaps;         // capabilities of surface wanted
294 } DDSCAPS;
295
296 typedef DDSCAPS FAR* LPDDSCAPS;
297
298
299 /*
300  * DDOSCAPS
301  */
302 typedef struct _DDOSCAPS
303 {
304     DWORD       dwCaps;         // capabilities of surface wanted
305 } DDOSCAPS;
306
307 typedef DDOSCAPS FAR* LPDDOSCAPS;
308
309 /*
310  * This structure is used internally by DirectDraw.
311  */
312 typedef struct _DDSCAPSEX
313 {
314     DWORD       dwCaps2;
315     DWORD       dwCaps3;
316     DWORD       dwCaps4;
317 } DDSCAPSEX, FAR * LPDDSCAPSEX;
318
319 /*
320  * DDSCAPS2
321  */
322 typedef struct _DDSCAPS2
323 {
324     DWORD       dwCaps;         // capabilities of surface wanted
325     DWORD       dwCaps2;
326     DWORD       dwCaps3;
327     DWORD       dwCaps4;
328 } DDSCAPS2;
329
330 typedef DDSCAPS2 FAR* LPDDSCAPS2;
331
332 /*
333  * DDCAPS
334  */
335 #define DD_ROP_SPACE            (256/32)        // space required to store ROP array
336
337 /*
338  * This structure is the DDCAPS structure as it was in version 2 and 3 of Direct X.
339  * It is present for back compatability.
340  */
341 typedef struct _DDCAPS_DX3
342 {
343     DWORD       dwSize;                 // size of the DDDRIVERCAPS structure
344     DWORD       dwCaps;                 // driver specific capabilities
345     DWORD       dwCaps2;                // more driver specific capabilites
346     DWORD       dwCKeyCaps;             // color key capabilities of the surface
347     DWORD       dwFXCaps;               // driver specific stretching and effects capabilites
348     DWORD       dwFXAlphaCaps;          // alpha driver specific capabilities
349     DWORD       dwPalCaps;              // palette capabilities
350     DWORD       dwSVCaps;               // stereo vision capabilities
351     DWORD       dwAlphaBltConstBitDepths;       // DDBD_2,4,8
352     DWORD       dwAlphaBltPixelBitDepths;       // DDBD_1,2,4,8
353     DWORD       dwAlphaBltSurfaceBitDepths;     // DDBD_1,2,4,8
354     DWORD       dwAlphaOverlayConstBitDepths;   // DDBD_2,4,8
355     DWORD       dwAlphaOverlayPixelBitDepths;   // DDBD_1,2,4,8
356     DWORD       dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8
357     DWORD       dwZBufferBitDepths;             // DDBD_8,16,24,32
358     DWORD       dwVidMemTotal;          // total amount of video memory
359     DWORD       dwVidMemFree;           // amount of free video memory
360     DWORD       dwMaxVisibleOverlays;   // maximum number of visible overlays
361     DWORD       dwCurrVisibleOverlays;  // current number of visible overlays
362     DWORD       dwNumFourCCCodes;       // number of four cc codes
363     DWORD       dwAlignBoundarySrc;     // source rectangle alignment
364     DWORD       dwAlignSizeSrc;         // source rectangle byte size
365     DWORD       dwAlignBoundaryDest;    // dest rectangle alignment
366     DWORD       dwAlignSizeDest;        // dest rectangle byte size
367     DWORD       dwAlignStrideAlign;     // stride alignment
368     DWORD       dwRops[DD_ROP_SPACE];   // ROPS supported
369     DDSCAPS     ddsCaps;                // DDSCAPS structure has all the general capabilities
370     DWORD       dwMinOverlayStretch;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
371     DWORD       dwMaxOverlayStretch;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
372     DWORD       dwMinLiveVideoStretch;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
373     DWORD       dwMaxLiveVideoStretch;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
374     DWORD       dwMinHwCodecStretch;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
375     DWORD       dwMaxHwCodecStretch;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
376     DWORD       dwReserved1;            // reserved
377     DWORD       dwReserved2;            // reserved
378     DWORD       dwReserved3;            // reserved
379     DWORD       dwSVBCaps;              // driver specific capabilities for System->Vmem blts
380     DWORD       dwSVBCKeyCaps;          // driver color key capabilities for System->Vmem blts
381     DWORD       dwSVBFXCaps;            // driver FX capabilities for System->Vmem blts
382     DWORD       dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts
383     DWORD       dwVSBCaps;              // driver specific capabilities for Vmem->System blts
384     DWORD       dwVSBCKeyCaps;          // driver color key capabilities for Vmem->System blts
385     DWORD       dwVSBFXCaps;            // driver FX capabilities for Vmem->System blts
386     DWORD       dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts
387     DWORD       dwSSBCaps;              // driver specific capabilities for System->System blts
388     DWORD       dwSSBCKeyCaps;          // driver color key capabilities for System->System blts
389     DWORD       dwSSBFXCaps;            // driver FX capabilities for System->System blts
390     DWORD       dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts
391     DWORD       dwReserved4;            // reserved
392     DWORD       dwReserved5;            // reserved
393     DWORD       dwReserved6;            // reserved
394 } DDCAPS_DX3;
395 typedef DDCAPS_DX3 FAR* LPDDCAPS_DX3;
396
397 /*
398  * This structure is the DDCAPS structure as it was in version 5 of Direct X.
399  * It is present for back compatability.
400  */
401 typedef struct _DDCAPS_DX5
402 {
403 /*  0*/ DWORD   dwSize;                 // size of the DDDRIVERCAPS structure
404 /*  4*/ DWORD   dwCaps;                 // driver specific capabilities
405 /*  8*/ DWORD   dwCaps2;                // more driver specific capabilites
406 /*  c*/ DWORD   dwCKeyCaps;             // color key capabilities of the surface
407 /* 10*/ DWORD   dwFXCaps;               // driver specific stretching and effects capabilites
408 /* 14*/ DWORD   dwFXAlphaCaps;          // alpha driver specific capabilities
409 /* 18*/ DWORD   dwPalCaps;              // palette capabilities
410 /* 1c*/ DWORD   dwSVCaps;               // stereo vision capabilities
411 /* 20*/ DWORD   dwAlphaBltConstBitDepths;       // DDBD_2,4,8
412 /* 24*/ DWORD   dwAlphaBltPixelBitDepths;       // DDBD_1,2,4,8
413 /* 28*/ DWORD   dwAlphaBltSurfaceBitDepths;     // DDBD_1,2,4,8
414 /* 2c*/ DWORD   dwAlphaOverlayConstBitDepths;   // DDBD_2,4,8
415 /* 30*/ DWORD   dwAlphaOverlayPixelBitDepths;   // DDBD_1,2,4,8
416 /* 34*/ DWORD   dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8
417 /* 38*/ DWORD   dwZBufferBitDepths;             // DDBD_8,16,24,32
418 /* 3c*/ DWORD   dwVidMemTotal;          // total amount of video memory
419 /* 40*/ DWORD   dwVidMemFree;           // amount of free video memory
420 /* 44*/ DWORD   dwMaxVisibleOverlays;   // maximum number of visible overlays
421 /* 48*/ DWORD   dwCurrVisibleOverlays;  // current number of visible overlays
422 /* 4c*/ DWORD   dwNumFourCCCodes;       // number of four cc codes
423 /* 50*/ DWORD   dwAlignBoundarySrc;     // source rectangle alignment
424 /* 54*/ DWORD   dwAlignSizeSrc;         // source rectangle byte size
425 /* 58*/ DWORD   dwAlignBoundaryDest;    // dest rectangle alignment
426 /* 5c*/ DWORD   dwAlignSizeDest;        // dest rectangle byte size
427 /* 60*/ DWORD   dwAlignStrideAlign;     // stride alignment
428 /* 64*/ DWORD   dwRops[DD_ROP_SPACE];   // ROPS supported
429 /* 84*/ DDSCAPS ddsCaps;                // DDSCAPS structure has all the general capabilities
430 /* 88*/ DWORD   dwMinOverlayStretch;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
431 /* 8c*/ DWORD   dwMaxOverlayStretch;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
432 /* 90*/ DWORD   dwMinLiveVideoStretch;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
433 /* 94*/ DWORD   dwMaxLiveVideoStretch;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
434 /* 98*/ DWORD   dwMinHwCodecStretch;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
435 /* 9c*/ DWORD   dwMaxHwCodecStretch;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
436 /* a0*/ DWORD   dwReserved1;            // reserved
437 /* a4*/ DWORD   dwReserved2;            // reserved
438 /* a8*/ DWORD   dwReserved3;            // reserved
439 /* ac*/ DWORD   dwSVBCaps;              // driver specific capabilities for System->Vmem blts
440 /* b0*/ DWORD   dwSVBCKeyCaps;          // driver color key capabilities for System->Vmem blts
441 /* b4*/ DWORD   dwSVBFXCaps;            // driver FX capabilities for System->Vmem blts
442 /* b8*/ DWORD   dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts
443 /* d8*/ DWORD   dwVSBCaps;              // driver specific capabilities for Vmem->System blts
444 /* dc*/ DWORD   dwVSBCKeyCaps;          // driver color key capabilities for Vmem->System blts
445 /* e0*/ DWORD   dwVSBFXCaps;            // driver FX capabilities for Vmem->System blts
446 /* e4*/ DWORD   dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts
447 /*104*/ DWORD   dwSSBCaps;              // driver specific capabilities for System->System blts
448 /*108*/ DWORD   dwSSBCKeyCaps;          // driver color key capabilities for System->System blts
449 /*10c*/ DWORD   dwSSBFXCaps;            // driver FX capabilities for System->System blts
450 /*110*/ DWORD   dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts
451 // Members added for DX5:
452 /*130*/ DWORD   dwMaxVideoPorts;        // maximum number of usable video ports
453 /*134*/ DWORD   dwCurrVideoPorts;       // current number of video ports used
454 /*138*/ DWORD   dwSVBCaps2;             // more driver specific capabilities for System->Vmem blts
455 /*13c*/ DWORD   dwNLVBCaps;               // driver specific capabilities for non-local->local vidmem blts
456 /*140*/ DWORD   dwNLVBCaps2;              // more driver specific capabilities non-local->local vidmem blts
457 /*144*/ DWORD   dwNLVBCKeyCaps;           // driver color key capabilities for non-local->local vidmem blts
458 /*148*/ DWORD   dwNLVBFXCaps;             // driver FX capabilities for non-local->local blts
459 /*14c*/ DWORD   dwNLVBRops[DD_ROP_SPACE]; // ROPS supported for non-local->local blts
460 } DDCAPS_DX5;
461 typedef DDCAPS_DX5 FAR* LPDDCAPS_DX5;
462
463 typedef struct _DDCAPS_DX6
464 {
465 /*  0*/ DWORD   dwSize;                 // size of the DDDRIVERCAPS structure
466 /*  4*/ DWORD   dwCaps;                 // driver specific capabilities
467 /*  8*/ DWORD   dwCaps2;                // more driver specific capabilites
468 /*  c*/ DWORD   dwCKeyCaps;             // color key capabilities of the surface
469 /* 10*/ DWORD   dwFXCaps;               // driver specific stretching and effects capabilites
470 /* 14*/ DWORD   dwFXAlphaCaps;          // alpha caps
471 /* 18*/ DWORD   dwPalCaps;              // palette capabilities
472 /* 1c*/ DWORD   dwSVCaps;               // stereo vision capabilities
473 /* 20*/ DWORD   dwAlphaBltConstBitDepths;       // DDBD_2,4,8
474 /* 24*/ DWORD   dwAlphaBltPixelBitDepths;       // DDBD_1,2,4,8
475 /* 28*/ DWORD   dwAlphaBltSurfaceBitDepths;     // DDBD_1,2,4,8
476 /* 2c*/ DWORD   dwAlphaOverlayConstBitDepths;   // DDBD_2,4,8
477 /* 30*/ DWORD   dwAlphaOverlayPixelBitDepths;   // DDBD_1,2,4,8
478 /* 34*/ DWORD   dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8
479 /* 38*/ DWORD   dwZBufferBitDepths;             // DDBD_8,16,24,32
480 /* 3c*/ DWORD   dwVidMemTotal;          // total amount of video memory
481 /* 40*/ DWORD   dwVidMemFree;           // amount of free video memory
482 /* 44*/ DWORD   dwMaxVisibleOverlays;   // maximum number of visible overlays
483 /* 48*/ DWORD   dwCurrVisibleOverlays;  // current number of visible overlays
484 /* 4c*/ DWORD   dwNumFourCCCodes;       // number of four cc codes
485 /* 50*/ DWORD   dwAlignBoundarySrc;     // source rectangle alignment
486 /* 54*/ DWORD   dwAlignSizeSrc;         // source rectangle byte size
487 /* 58*/ DWORD   dwAlignBoundaryDest;    // dest rectangle alignment
488 /* 5c*/ DWORD   dwAlignSizeDest;        // dest rectangle byte size
489 /* 60*/ DWORD   dwAlignStrideAlign;     // stride alignment
490 /* 64*/ DWORD   dwRops[DD_ROP_SPACE];   // ROPS supported
491 /* 84*/ DDSCAPS ddsOldCaps;             // Was DDSCAPS  ddsCaps. ddsCaps is of type DDSCAPS2 for DX6
492 /* 88*/ DWORD   dwMinOverlayStretch;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
493 /* 8c*/ DWORD   dwMaxOverlayStretch;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
494 /* 90*/ DWORD   dwMinLiveVideoStretch;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
495 /* 94*/ DWORD   dwMaxLiveVideoStretch;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
496 /* 98*/ DWORD   dwMinHwCodecStretch;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
497 /* 9c*/ DWORD   dwMaxHwCodecStretch;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
498 /* a0*/ DWORD   dwReserved1;            // reserved
499 /* a4*/ DWORD   dwReserved2;            // reserved
500 /* a8*/ DWORD   dwReserved3;            // reserved
501 /* ac*/ DWORD   dwSVBCaps;              // driver specific capabilities for System->Vmem blts
502 /* b0*/ DWORD   dwSVBCKeyCaps;          // driver color key capabilities for System->Vmem blts
503 /* b4*/ DWORD   dwSVBFXCaps;            // driver FX capabilities for System->Vmem blts
504 /* b8*/ DWORD   dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts
505 /* d8*/ DWORD   dwVSBCaps;              // driver specific capabilities for Vmem->System blts
506 /* dc*/ DWORD   dwVSBCKeyCaps;          // driver color key capabilities for Vmem->System blts
507 /* e0*/ DWORD   dwVSBFXCaps;            // driver FX capabilities for Vmem->System blts
508 /* e4*/ DWORD   dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts
509 /*104*/ DWORD   dwSSBCaps;              // driver specific capabilities for System->System blts
510 /*108*/ DWORD   dwSSBCKeyCaps;          // driver color key capabilities for System->System blts
511 /*10c*/ DWORD   dwSSBFXCaps;            // driver FX capabilities for System->System blts
512 /*110*/ DWORD   dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts
513 /*130*/ DWORD   dwMaxVideoPorts;        // maximum number of usable video ports
514 /*134*/ DWORD   dwCurrVideoPorts;       // current number of video ports used
515 /*138*/ DWORD   dwSVBCaps2;             // more driver specific capabilities for System->Vmem blts
516 /*13c*/ DWORD   dwNLVBCaps;               // driver specific capabilities for non-local->local vidmem blts
517 /*140*/ DWORD   dwNLVBCaps2;              // more driver specific capabilities non-local->local vidmem blts
518 /*144*/ DWORD   dwNLVBCKeyCaps;           // driver color key capabilities for non-local->local vidmem blts
519 /*148*/ DWORD   dwNLVBFXCaps;             // driver FX capabilities for non-local->local blts
520 /*14c*/ DWORD   dwNLVBRops[DD_ROP_SPACE]; // ROPS supported for non-local->local blts
521 // Members added for DX6 release
522 /*16c*/ DDSCAPS2 ddsCaps;               // Surface Caps
523 } DDCAPS_DX6;
524 typedef DDCAPS_DX6 FAR* LPDDCAPS_DX6;
525
526
527 #if DIRECTDRAW_VERSION <= 0x300
528     typedef DDCAPS_DX3 DDCAPS;
529 #elif DIRECTDRAW_VERSION <= 0x500
530     typedef DDCAPS_DX5 DDCAPS;
531 #else
532     typedef DDCAPS_DX6 DDCAPS;
533 #endif
534
535 typedef DDCAPS FAR* LPDDCAPS;
536
537
538
539 /*
540  * DDPIXELFORMAT
541  */
542 typedef struct _DDPIXELFORMAT
543 {
544     DWORD       dwSize;                 // size of structure
545     DWORD       dwFlags;                // pixel format flags
546     DWORD       dwFourCC;               // (FOURCC code)
547     union
548     {
549         DWORD   dwRGBBitCount;          // how many bits per pixel
550         DWORD   dwYUVBitCount;          // how many bits per pixel
551         DWORD   dwZBufferBitDepth;      // how many total bits/pixel in z buffer (including any stencil bits)
552         DWORD   dwAlphaBitDepth;        // how many bits for alpha channels
553         DWORD   dwLuminanceBitCount;    // how many bits per pixel
554         DWORD   dwBumpBitCount;         // how many bits per "buxel", total
555     } DUMMYUNIONNAMEN(1);
556     union
557     {
558         DWORD   dwRBitMask;             // mask for red bit
559         DWORD   dwYBitMask;             // mask for Y bits
560         DWORD   dwStencilBitDepth;      // how many stencil bits (note: dwZBufferBitDepth-dwStencilBitDepth is total Z-only bits)
561         DWORD   dwLuminanceBitMask;     // mask for luminance bits
562         DWORD   dwBumpDuBitMask;        // mask for bump map U delta bits
563     } DUMMYUNIONNAMEN(2);
564     union
565     {
566         DWORD   dwGBitMask;             // mask for green bits
567         DWORD   dwUBitMask;             // mask for U bits
568         DWORD   dwZBitMask;             // mask for Z bits
569         DWORD   dwBumpDvBitMask;        // mask for bump map V delta bits
570     } DUMMYUNIONNAMEN(3);
571     union
572     {
573         DWORD   dwBBitMask;             // mask for blue bits
574         DWORD   dwVBitMask;             // mask for V bits
575         DWORD   dwStencilBitMask;       // mask for stencil bits
576         DWORD   dwBumpLuminanceBitMask; // mask for luminance in bump map
577     } DUMMYUNIONNAMEN(4);
578     union
579     {
580         DWORD   dwRGBAlphaBitMask;      // mask for alpha channel
581         DWORD   dwYUVAlphaBitMask;      // mask for alpha channel
582         DWORD   dwLuminanceAlphaBitMask;// mask for alpha channel
583         DWORD   dwRGBZBitMask;          // mask for Z channel
584         DWORD   dwYUVZBitMask;          // mask for Z channel
585     } DUMMYUNIONNAMEN(5);
586 } DDPIXELFORMAT;
587
588 typedef DDPIXELFORMAT FAR* LPDDPIXELFORMAT;
589
590 /*
591  * DDOVERLAYFX
592  */
593 typedef struct _DDOVERLAYFX
594 {
595     DWORD       dwSize;                         // size of structure
596     DWORD       dwAlphaEdgeBlendBitDepth;       // Bit depth used to specify constant for alpha edge blend
597     DWORD       dwAlphaEdgeBlend;               // Constant to use as alpha for edge blend
598     DWORD       dwReserved;
599     DWORD       dwAlphaDestConstBitDepth;       // Bit depth used to specify alpha constant for destination
600     union
601     {
602         DWORD   dwAlphaDestConst;               // Constant to use as alpha channel for dest
603         LPDIRECTDRAWSURFACE lpDDSAlphaDest;     // Surface to use as alpha channel for dest
604     } DUMMYUNIONNAMEN(1);
605     DWORD       dwAlphaSrcConstBitDepth;        // Bit depth used to specify alpha constant for source
606     union
607     {
608         DWORD   dwAlphaSrcConst;                // Constant to use as alpha channel for src
609         LPDIRECTDRAWSURFACE lpDDSAlphaSrc;      // Surface to use as alpha channel for src
610     } DUMMYUNIONNAMEN(2);
611     DDCOLORKEY  dckDestColorkey;                // DestColorkey override
612     DDCOLORKEY  dckSrcColorkey;                 // DestColorkey override
613     DWORD       dwDDFX;                         // Overlay FX
614     DWORD       dwFlags;                        // flags
615 } DDOVERLAYFX;
616
617 typedef DDOVERLAYFX FAR *LPDDOVERLAYFX;
618
619
620 /*
621  * DDBLTBATCH: BltBatch entry structure
622  */
623 typedef struct _DDBLTBATCH
624 {
625     LPRECT              lprDest;
626     LPDIRECTDRAWSURFACE lpDDSSrc;
627     LPRECT              lprSrc;
628     DWORD               dwFlags;
629     LPDDBLTFX           lpDDBltFx;
630 } DDBLTBATCH;
631
632 typedef DDBLTBATCH FAR * LPDDBLTBATCH;
633
634
635 /*
636  * DDGAMMARAMP
637  */
638 typedef struct _DDGAMMARAMP
639 {
640     WORD                red[256];
641     WORD                green[256];
642     WORD                blue[256];
643 } DDGAMMARAMP;
644 typedef DDGAMMARAMP FAR * LPDDGAMMARAMP;
645
646 /*
647  *  This is the structure within which DirectDraw returns data about the current graphics driver and chipset
648  */
649
650 #define MAX_DDDEVICEID_STRING           512
651
652 typedef struct tagDDDEVICEIDENTIFIER
653 {
654     /*
655      * These elements are for presentation to the user only. They should not be used to identify particular
656      * drivers, since this is unreliable and many different strings may be associated with the same
657      * device, and the same driver from different vendors.
658      */
659     char    szDriver[MAX_DDDEVICEID_STRING];
660     char    szDescription[MAX_DDDEVICEID_STRING];
661
662     /*
663      * This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons
664      * on the whole 64 bits. Caution should be exercised if you use this element to identify problematic
665      * drivers. It is recommended that guidDeviceIdentifier is used for this purpose.
666      *
667      * This version has the form:
668      *  wProduct = HIWORD(liDriverVersion.HighPart)
669      *  wVersion = LOWORD(liDriverVersion.HighPart)
670      *  wSubVersion = HIWORD(liDriverVersion.LowPart)
671      *  wBuild = LOWORD(liDriverVersion.LowPart)
672      */
673 #ifdef _WIN32
674     LARGE_INTEGER liDriverVersion;      /* Defined for applications and other 32 bit components */
675 #else
676     DWORD   dwDriverVersionLowPart;     /* Defined for 16 bit driver components */
677     DWORD   dwDriverVersionHighPart;
678 #endif
679
680
681     /*
682      * These elements can be used to identify particular chipsets. Use with extreme caution. 
683      *   dwVendorId     Identifies the manufacturer. May be zero if unknown.
684      *   dwDeviceId     Identifies the type of chipset. May be zero if unknown.
685      *   dwSubSysId     Identifies the subsystem, typically this means the particular board. May be zero if unknown.
686      *   dwRevision     Identifies the revision level of the chipset. May be zero if unknown.
687      */
688     DWORD   dwVendorId;
689     DWORD   dwDeviceId;
690     DWORD   dwSubSysId;
691     DWORD   dwRevision;
692
693     /*
694      * This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the
695      * driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to
696      * reprofile the graphics subsystem.
697      * This element can also be used to identify particular problematic drivers.
698      */
699     GUID    guidDeviceIdentifier;
700 } DDDEVICEIDENTIFIER, * LPDDDEVICEIDENTIFIER;
701
702 /*
703  * Flags for the IDirectDraw4::GetDeviceIdentifier method
704  */
705
706 /*
707  * This flag causes GetDeviceIdentifier to return information about the host (typically 2D) adapter in a system equipped
708  * with a stacked secondary 3D adapter. Such an adapter appears to the application as if it were part of the
709  * host adapter, but is typically physcially located on a separate card. The stacked secondary's information is
710  * returned when GetDeviceIdentifier's dwFlags field is zero, since this most accurately reflects the qualities
711  * of the DirectDraw object involved.
712  */
713 #define DDGDI_GETHOSTIDENTIFIER         0x00000001L
714
715
716
717 /*
718  * callbacks
719  */
720 typedef DWORD   (FAR PASCAL *LPCLIPPERCALLBACK)(LPDIRECTDRAWCLIPPER lpDDClipper, HWND hWnd, DWORD code, LPVOID lpContext );
721 #ifdef STREAMING
722 typedef DWORD   (FAR PASCAL *LPSURFACESTREAMINGCALLBACK)(DWORD);
723 #endif
724
725
726 /*
727  * INTERACES FOLLOW:
728  *      IDirectDraw
729  *      IDirectDrawClipper
730  *      IDirectDrawPalette
731  *      IDirectDrawSurface
732  */
733
734 /*
735  * IDirectDraw
736  */
737 #if defined( _WIN32 ) && !defined( _NO_COM )
738 #undef INTERFACE
739 #define INTERFACE IDirectDraw
740 DECLARE_INTERFACE_( IDirectDraw, IUnknown )
741 {
742     /*** IUnknown methods ***/
743     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
744     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
745     STDMETHOD_(ULONG,Release) (THIS) PURE;
746     /*** IDirectDraw methods ***/
747     STDMETHOD(Compact)(THIS) PURE;
748     STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE;
749     STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE;
750     STDMETHOD(CreateSurface)(THIS_  LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE;
751     STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR * ) PURE;
752     STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK ) PURE;
753     STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC, LPVOID,LPDDENUMSURFACESCALLBACK ) PURE;
754     STDMETHOD(FlipToGDISurface)(THIS) PURE;
755     STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE;
756     STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC) PURE;
757     STDMETHOD(GetFourCCCodes)(THIS_  LPDWORD, LPDWORD ) PURE;
758     STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE FAR *) PURE;
759     STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE;
760     STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE;
761     STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE;
762     STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE;
763     STDMETHOD(RestoreDisplayMode)(THIS) PURE;
764     STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE;
765     STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD) PURE;
766     STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE;
767 };
768
769 #if !defined(__cplusplus) || defined(CINTERFACE)
770 #define IDirectDraw_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
771 #define IDirectDraw_AddRef(p)                       (p)->lpVtbl->AddRef(p)
772 #define IDirectDraw_Release(p)                      (p)->lpVtbl->Release(p)
773 #define IDirectDraw_Compact(p)                      (p)->lpVtbl->Compact(p)
774 #define IDirectDraw_CreateClipper(p, a, b, c)       (p)->lpVtbl->CreateClipper(p, a, b, c)
775 #define IDirectDraw_CreatePalette(p, a, b, c, d)    (p)->lpVtbl->CreatePalette(p, a, b, c, d)
776 #define IDirectDraw_CreateSurface(p, a, b, c)       (p)->lpVtbl->CreateSurface(p, a, b, c)
777 #define IDirectDraw_DuplicateSurface(p, a, b)       (p)->lpVtbl->DuplicateSurface(p, a, b)
778 #define IDirectDraw_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d)
779 #define IDirectDraw_EnumSurfaces(p, a, b, c, d)     (p)->lpVtbl->EnumSurfaces(p, a, b, c, d)
780 #define IDirectDraw_FlipToGDISurface(p)             (p)->lpVtbl->FlipToGDISurface(p)
781 #define IDirectDraw_GetCaps(p, a, b)                (p)->lpVtbl->GetCaps(p, a, b)
782 #define IDirectDraw_GetDisplayMode(p, a)            (p)->lpVtbl->GetDisplayMode(p, a)
783 #define IDirectDraw_GetFourCCCodes(p, a, b)         (p)->lpVtbl->GetFourCCCodes(p, a, b)
784 #define IDirectDraw_GetGDISurface(p, a)             (p)->lpVtbl->GetGDISurface(p, a)
785 #define IDirectDraw_GetMonitorFrequency(p, a)       (p)->lpVtbl->GetMonitorFrequency(p, a)
786 #define IDirectDraw_GetScanLine(p, a)               (p)->lpVtbl->GetScanLine(p, a)
787 #define IDirectDraw_GetVerticalBlankStatus(p, a)    (p)->lpVtbl->GetVerticalBlankStatus(p, a)
788 #define IDirectDraw_Initialize(p, a)                (p)->lpVtbl->Initialize(p, a)
789 #define IDirectDraw_RestoreDisplayMode(p)           (p)->lpVtbl->RestoreDisplayMode(p)
790 #define IDirectDraw_SetCooperativeLevel(p, a, b)    (p)->lpVtbl->SetCooperativeLevel(p, a, b)
791 #define IDirectDraw_SetDisplayMode(p, a, b, c)      (p)->lpVtbl->SetDisplayMode(p, a, b, c)
792 #define IDirectDraw_WaitForVerticalBlank(p, a, b)   (p)->lpVtbl->WaitForVerticalBlank(p, a, b)
793 #else
794 #define IDirectDraw_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
795 #define IDirectDraw_AddRef(p)                       (p)->AddRef()
796 #define IDirectDraw_Release(p)                      (p)->Release()
797 #define IDirectDraw_Compact(p)                      (p)->Compact()
798 #define IDirectDraw_CreateClipper(p, a, b, c)       (p)->CreateClipper(a, b, c)
799 #define IDirectDraw_CreatePalette(p, a, b, c, d)    (p)->CreatePalette(a, b, c, d)
800 #define IDirectDraw_CreateSurface(p, a, b, c)       (p)->CreateSurface(a, b, c)
801 #define IDirectDraw_DuplicateSurface(p, a, b)       (p)->DuplicateSurface(a, b)
802 #define IDirectDraw_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d)
803 #define IDirectDraw_EnumSurfaces(p, a, b, c, d)     (p)->EnumSurfaces(a, b, c, d)
804 #define IDirectDraw_FlipToGDISurface(p)             (p)->FlipToGDISurface()
805 #define IDirectDraw_GetCaps(p, a, b)                (p)->GetCaps(a, b)
806 #define IDirectDraw_GetDisplayMode(p, a)            (p)->GetDisplayMode(a)
807 #define IDirectDraw_GetFourCCCodes(p, a, b)         (p)->GetFourCCCodes(a, b)
808 #define IDirectDraw_GetGDISurface(p, a)             (p)->GetGDISurface(a)
809 #define IDirectDraw_GetMonitorFrequency(p, a)       (p)->GetMonitorFrequency(a)
810 #define IDirectDraw_GetScanLine(p, a)               (p)->GetScanLine(a)
811 #define IDirectDraw_GetVerticalBlankStatus(p, a)    (p)->GetVerticalBlankStatus(a)
812 #define IDirectDraw_Initialize(p, a)                (p)->Initialize(a)
813 #define IDirectDraw_RestoreDisplayMode(p)           (p)->RestoreDisplayMode()
814 #define IDirectDraw_SetCooperativeLevel(p, a, b)    (p)->SetCooperativeLevel(a, b)
815 #define IDirectDraw_SetDisplayMode(p, a, b, c)      (p)->SetDisplayMode(a, b, c)
816 #define IDirectDraw_WaitForVerticalBlank(p, a, b)   (p)->WaitForVerticalBlank(a, b)
817 #endif
818
819 #endif
820
821 #if defined( _WIN32 ) && !defined( _NO_COM )
822 #undef INTERFACE
823 #define INTERFACE IDirectDraw2
824 DECLARE_INTERFACE_( IDirectDraw2, IUnknown )
825 {
826     /*** IUnknown methods ***/
827     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
828     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
829     STDMETHOD_(ULONG,Release) (THIS) PURE;
830     /*** IDirectDraw methods ***/
831     STDMETHOD(Compact)(THIS) PURE;
832     STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE;
833     STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE;
834     STDMETHOD(CreateSurface)(THIS_  LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE;
835     STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR * ) PURE;
836     STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK ) PURE;
837     STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC, LPVOID,LPDDENUMSURFACESCALLBACK ) PURE;
838     STDMETHOD(FlipToGDISurface)(THIS) PURE;
839     STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE;
840     STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC) PURE;
841     STDMETHOD(GetFourCCCodes)(THIS_  LPDWORD, LPDWORD ) PURE;
842     STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE FAR *) PURE;
843     STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE;
844     STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE;
845     STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE;
846     STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE;
847     STDMETHOD(RestoreDisplayMode)(THIS) PURE;
848     STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE;
849     STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE;
850     STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE;
851     /*** Added in the v2 interface ***/
852     STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS, LPDWORD, LPDWORD) PURE;
853 };
854 #if !defined(__cplusplus) || defined(CINTERFACE)
855 #define IDirectDraw2_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
856 #define IDirectDraw2_AddRef(p)                       (p)->lpVtbl->AddRef(p)
857 #define IDirectDraw2_Release(p)                      (p)->lpVtbl->Release(p)
858 #define IDirectDraw2_Compact(p)                      (p)->lpVtbl->Compact(p)
859 #define IDirectDraw2_CreateClipper(p, a, b, c)       (p)->lpVtbl->CreateClipper(p, a, b, c)
860 #define IDirectDraw2_CreatePalette(p, a, b, c, d)    (p)->lpVtbl->CreatePalette(p, a, b, c, d)
861 #define IDirectDraw2_CreateSurface(p, a, b, c)       (p)->lpVtbl->CreateSurface(p, a, b, c)
862 #define IDirectDraw2_DuplicateSurface(p, a, b)       (p)->lpVtbl->DuplicateSurface(p, a, b)
863 #define IDirectDraw2_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d)
864 #define IDirectDraw2_EnumSurfaces(p, a, b, c, d)     (p)->lpVtbl->EnumSurfaces(p, a, b, c, d)
865 #define IDirectDraw2_FlipToGDISurface(p)             (p)->lpVtbl->FlipToGDISurface(p)
866 #define IDirectDraw2_GetCaps(p, a, b)                (p)->lpVtbl->GetCaps(p, a, b)
867 #define IDirectDraw2_GetDisplayMode(p, a)            (p)->lpVtbl->GetDisplayMode(p, a)
868 #define IDirectDraw2_GetFourCCCodes(p, a, b)         (p)->lpVtbl->GetFourCCCodes(p, a, b)
869 #define IDirectDraw2_GetGDISurface(p, a)             (p)->lpVtbl->GetGDISurface(p, a)
870 #define IDirectDraw2_GetMonitorFrequency(p, a)       (p)->lpVtbl->GetMonitorFrequency(p, a)
871 #define IDirectDraw2_GetScanLine(p, a)               (p)->lpVtbl->GetScanLine(p, a)
872 #define IDirectDraw2_GetVerticalBlankStatus(p, a)    (p)->lpVtbl->GetVerticalBlankStatus(p, a)
873 #define IDirectDraw2_Initialize(p, a)                (p)->lpVtbl->Initialize(p, a)
874 #define IDirectDraw2_RestoreDisplayMode(p)           (p)->lpVtbl->RestoreDisplayMode(p)
875 #define IDirectDraw2_SetCooperativeLevel(p, a, b)    (p)->lpVtbl->SetCooperativeLevel(p, a, b)
876 #define IDirectDraw2_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e)
877 #define IDirectDraw2_WaitForVerticalBlank(p, a, b)   (p)->lpVtbl->WaitForVerticalBlank(p, a, b)
878 #define IDirectDraw2_GetAvailableVidMem(p, a, b, c)  (p)->lpVtbl->GetAvailableVidMem(p, a, b, c)
879 #else
880 #define IDirectDraw2_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
881 #define IDirectDraw2_AddRef(p)                       (p)->AddRef()
882 #define IDirectDraw2_Release(p)                      (p)->Release()
883 #define IDirectDraw2_Compact(p)                      (p)->Compact()
884 #define IDirectDraw2_CreateClipper(p, a, b, c)       (p)->CreateClipper(a, b, c)
885 #define IDirectDraw2_CreatePalette(p, a, b, c, d)    (p)->CreatePalette(a, b, c, d)
886 #define IDirectDraw2_CreateSurface(p, a, b, c)       (p)->CreateSurface(a, b, c)
887 #define IDirectDraw2_DuplicateSurface(p, a, b)       (p)->DuplicateSurface(a, b)
888 #define IDirectDraw2_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d)
889 #define IDirectDraw2_EnumSurfaces(p, a, b, c, d)     (p)->EnumSurfaces(a, b, c, d)
890 #define IDirectDraw2_FlipToGDISurface(p)             (p)->FlipToGDISurface()
891 #define IDirectDraw2_GetCaps(p, a, b)                (p)->GetCaps(a, b)
892 #define IDirectDraw2_GetDisplayMode(p, a)            (p)->GetDisplayMode(a)
893 #define IDirectDraw2_GetFourCCCodes(p, a, b)         (p)->GetFourCCCodes(a, b)
894 #define IDirectDraw2_GetGDISurface(p, a)             (p)->GetGDISurface(a)
895 #define IDirectDraw2_GetMonitorFrequency(p, a)       (p)->GetMonitorFrequency(a)
896 #define IDirectDraw2_GetScanLine(p, a)               (p)->GetScanLine(a)
897 #define IDirectDraw2_GetVerticalBlankStatus(p, a)    (p)->GetVerticalBlankStatus(a)
898 #define IDirectDraw2_Initialize(p, a)                (p)->Initialize(a)
899 #define IDirectDraw2_RestoreDisplayMode(p)           (p)->RestoreDisplayMode()
900 #define IDirectDraw2_SetCooperativeLevel(p, a, b)    (p)->SetCooperativeLevel(a, b)
901 #define IDirectDraw2_SetDisplayMode(p, a, b, c, d, e) (p)->SetDisplayMode(a, b, c, d, e)
902 #define IDirectDraw2_WaitForVerticalBlank(p, a, b)   (p)->WaitForVerticalBlank(a, b)
903 #define IDirectDraw2_GetAvailableVidMem(p, a, b, c)  (p)->GetAvailableVidMem(a, b, c)
904 #endif
905
906 #endif
907
908 #if defined( _WIN32 ) && !defined( _NO_COM )
909 #undef INTERFACE
910 #define INTERFACE IDirectDraw4
911 DECLARE_INTERFACE_( IDirectDraw4, IUnknown )
912 {
913     /*** IUnknown methods ***/
914     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
915     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
916     STDMETHOD_(ULONG,Release) (THIS) PURE;
917     /*** IDirectDraw methods ***/
918     STDMETHOD(Compact)(THIS) PURE;
919     STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE;
920     STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE;
921     STDMETHOD(CreateSurface)(THIS_  LPDDSURFACEDESC2, LPDIRECTDRAWSURFACE4 FAR *, IUnknown FAR *) PURE;
922     STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE4, LPDIRECTDRAWSURFACE4 FAR * ) PURE;
923     STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC2, LPVOID, LPDDENUMMODESCALLBACK2 ) PURE;
924     STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC2, LPVOID,LPDDENUMSURFACESCALLBACK2 ) PURE;
925     STDMETHOD(FlipToGDISurface)(THIS) PURE;
926     STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE;
927     STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC2) PURE;
928     STDMETHOD(GetFourCCCodes)(THIS_  LPDWORD, LPDWORD ) PURE;
929     STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE4 FAR *) PURE;
930     STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE;
931     STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE;
932     STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE;
933     STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE;
934     STDMETHOD(RestoreDisplayMode)(THIS) PURE;
935     STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE;
936     STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE;
937     STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE;
938     /*** Added in the v2 interface ***/
939     STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2, LPDWORD, LPDWORD) PURE;
940     /*** Added in the V4 Interface ***/
941     STDMETHOD(GetSurfaceFromDC) (THIS_ HDC, LPDIRECTDRAWSURFACE4 *) PURE;
942     STDMETHOD(RestoreAllSurfaces)(THIS) PURE;
943     STDMETHOD(TestCooperativeLevel)(THIS) PURE;
944     STDMETHOD(GetDeviceIdentifier)(THIS_ LPDDDEVICEIDENTIFIER, DWORD ) PURE;
945 };
946 #if !defined(__cplusplus) || defined(CINTERFACE)
947 #define IDirectDraw4_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
948 #define IDirectDraw4_AddRef(p)                       (p)->lpVtbl->AddRef(p)
949 #define IDirectDraw4_Release(p)                      (p)->lpVtbl->Release(p)
950 #define IDirectDraw4_Compact(p)                      (p)->lpVtbl->Compact(p)
951 #define IDirectDraw4_CreateClipper(p, a, b, c)       (p)->lpVtbl->CreateClipper(p, a, b, c)
952 #define IDirectDraw4_CreatePalette(p, a, b, c, d)    (p)->lpVtbl->CreatePalette(p, a, b, c, d)
953 #define IDirectDraw4_CreateSurface(p, a, b, c)       (p)->lpVtbl->CreateSurface(p, a, b, c)
954 #define IDirectDraw4_DuplicateSurface(p, a, b)       (p)->lpVtbl->DuplicateSurface(p, a, b)
955 #define IDirectDraw4_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d)
956 #define IDirectDraw4_EnumSurfaces(p, a, b, c, d)     (p)->lpVtbl->EnumSurfaces(p, a, b, c, d)
957 #define IDirectDraw4_FlipToGDISurface(p)             (p)->lpVtbl->FlipToGDISurface(p)
958 #define IDirectDraw4_GetCaps(p, a, b)                (p)->lpVtbl->GetCaps(p, a, b)
959 #define IDirectDraw4_GetDisplayMode(p, a)            (p)->lpVtbl->GetDisplayMode(p, a)
960 #define IDirectDraw4_GetFourCCCodes(p, a, b)         (p)->lpVtbl->GetFourCCCodes(p, a, b)
961 #define IDirectDraw4_GetGDISurface(p, a)             (p)->lpVtbl->GetGDISurface(p, a)
962 #define IDirectDraw4_GetMonitorFrequency(p, a)       (p)->lpVtbl->GetMonitorFrequency(p, a)
963 #define IDirectDraw4_GetScanLine(p, a)               (p)->lpVtbl->GetScanLine(p, a)
964 #define IDirectDraw4_GetVerticalBlankStatus(p, a)    (p)->lpVtbl->GetVerticalBlankStatus(p, a)
965 #define IDirectDraw4_Initialize(p, a)                (p)->lpVtbl->Initialize(p, a)
966 #define IDirectDraw4_RestoreDisplayMode(p)           (p)->lpVtbl->RestoreDisplayMode(p)
967 #define IDirectDraw4_SetCooperativeLevel(p, a, b)    (p)->lpVtbl->SetCooperativeLevel(p, a, b)
968 #define IDirectDraw4_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e)
969 #define IDirectDraw4_WaitForVerticalBlank(p, a, b)   (p)->lpVtbl->WaitForVerticalBlank(p, a, b)
970 #define IDirectDraw4_GetAvailableVidMem(p, a, b, c)  (p)->lpVtbl->GetAvailableVidMem(p, a, b, c)
971 #define IDirectDraw4_GetSurfaceFromDC(p, a, b)       (p)->lpVtbl->GetSurfaceFromDC(p, a, b)
972 #define IDirectDraw4_RestoreAllSurfaces(p)           (p)->lpVtbl->RestoreAllSurfaces(p)
973 #define IDirectDraw4_TestCooperativeLevel(p)         (p)->lpVtbl->TestCooperativeLevel(p)
974 #define IDirectDraw4_GetDeviceIdentifier(p,a,b)      (p)->lpVtbl->GetDeviceIdentifier(p,a,b)
975 #else
976 #define IDirectDraw4_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
977 #define IDirectDraw4_AddRef(p)                       (p)->AddRef()
978 #define IDirectDraw4_Release(p)                      (p)->Release()
979 #define IDirectDraw4_Compact(p)                      (p)->Compact()
980 #define IDirectDraw4_CreateClipper(p, a, b, c)       (p)->CreateClipper(a, b, c)
981 #define IDirectDraw4_CreatePalette(p, a, b, c, d)    (p)->CreatePalette(a, b, c, d)
982 #define IDirectDraw4_CreateSurface(p, a, b, c)       (p)->CreateSurface(a, b, c)
983 #define IDirectDraw4_DuplicateSurface(p, a, b)       (p)->DuplicateSurface(a, b)
984 #define IDirectDraw4_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d)
985 #define IDirectDraw4_EnumSurfaces(p, a, b, c, d)     (p)->EnumSurfaces(a, b, c, d)
986 #define IDirectDraw4_FlipToGDISurface(p)             (p)->FlipToGDISurface()
987 #define IDirectDraw4_GetCaps(p, a, b)                (p)->GetCaps(a, b)
988 #define IDirectDraw4_GetDisplayMode(p, a)            (p)->GetDisplayMode(a)
989 #define IDirectDraw4_GetFourCCCodes(p, a, b)         (p)->GetFourCCCodes(a, b)
990 #define IDirectDraw4_GetGDISurface(p, a)             (p)->GetGDISurface(a)
991 #define IDirectDraw4_GetMonitorFrequency(p, a)       (p)->GetMonitorFrequency(a)
992 #define IDirectDraw4_GetScanLine(p, a)               (p)->GetScanLine(a)
993 #define IDirectDraw4_GetVerticalBlankStatus(p, a)    (p)->GetVerticalBlankStatus(a)
994 #define IDirectDraw4_Initialize(p, a)                (p)->Initialize(a)
995 #define IDirectDraw4_RestoreDisplayMode(p)           (p)->RestoreDisplayMode()
996 #define IDirectDraw4_SetCooperativeLevel(p, a, b)    (p)->SetCooperativeLevel(a, b)
997 #define IDirectDraw4_SetDisplayMode(p, a, b, c, d, e) (p)->SetDisplayMode(a, b, c, d, e)
998 #define IDirectDraw4_WaitForVerticalBlank(p, a, b)   (p)->WaitForVerticalBlank(a, b)
999 #define IDirectDraw4_GetAvailableVidMem(p, a, b, c)  (p)->GetAvailableVidMem(a, b, c)
1000 #define IDirectDraw4_GetSurfaceFromDC(p, a, b)       (p)->GetSurfaceFromDC(a, b)
1001 #define IDirectDraw4_RestoreAllSurfaces(p)           (p)->RestoreAllSurfaces()
1002 #define IDirectDraw4_TestCooperativeLevel(p)         (p)->TestCooperativeLevel()
1003 #define IDirectDraw4_GetDeviceIdentifier(p,a,b)      (p)->GetDeviceIdentifier(a,b)
1004 #endif
1005
1006 #endif
1007
1008
1009 /*
1010  * IDirectDrawPalette
1011  */
1012 #if defined( _WIN32 ) && !defined( _NO_COM )
1013 #undef INTERFACE
1014 #define INTERFACE IDirectDrawPalette
1015 DECLARE_INTERFACE_( IDirectDrawPalette, IUnknown )
1016 {
1017     /*** IUnknown methods ***/
1018     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
1019     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
1020     STDMETHOD_(ULONG,Release) (THIS) PURE;
1021     /*** IDirectDrawPalette methods ***/
1022     STDMETHOD(GetCaps)(THIS_ LPDWORD) PURE;
1023     STDMETHOD(GetEntries)(THIS_ DWORD,DWORD,DWORD,LPPALETTEENTRY) PURE;
1024     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, DWORD, LPPALETTEENTRY) PURE;
1025     STDMETHOD(SetEntries)(THIS_ DWORD,DWORD,DWORD,LPPALETTEENTRY) PURE;
1026 };
1027
1028 #if !defined(__cplusplus) || defined(CINTERFACE)
1029 #define IDirectDrawPalette_QueryInterface(p, a, b)      (p)->lpVtbl->QueryInterface(p, a, b)
1030 #define IDirectDrawPalette_AddRef(p)                    (p)->lpVtbl->AddRef(p)
1031 #define IDirectDrawPalette_Release(p)                   (p)->lpVtbl->Release(p)
1032 #define IDirectDrawPalette_GetCaps(p, a)                (p)->lpVtbl->GetCaps(p, a)
1033 #define IDirectDrawPalette_GetEntries(p, a, b, c, d)    (p)->lpVtbl->GetEntries(p, a, b, c, d)
1034 #define IDirectDrawPalette_Initialize(p, a, b, c)       (p)->lpVtbl->Initialize(p, a, b, c)
1035 #define IDirectDrawPalette_SetEntries(p, a, b, c, d)    (p)->lpVtbl->SetEntries(p, a, b, c, d)
1036 #else
1037 #define IDirectDrawPalette_QueryInterface(p, a, b)      (p)->QueryInterface(a, b)
1038 #define IDirectDrawPalette_AddRef(p)                    (p)->AddRef()
1039 #define IDirectDrawPalette_Release(p)                   (p)->Release()
1040 #define IDirectDrawPalette_GetCaps(p, a)                (p)->GetCaps(a)
1041 #define IDirectDrawPalette_GetEntries(p, a, b, c, d)    (p)->GetEntries(a, b, c, d)
1042 #define IDirectDrawPalette_Initialize(p, a, b, c)       (p)->Initialize(a, b, c)
1043 #define IDirectDrawPalette_SetEntries(p, a, b, c, d)    (p)->SetEntries(a, b, c, d)
1044 #endif
1045
1046 #endif
1047
1048
1049
1050 /*
1051  * IDirectDrawClipper
1052  */
1053 #if defined( _WIN32 ) && !defined( _NO_COM )
1054 #undef INTERFACE
1055 #define INTERFACE IDirectDrawClipper
1056 DECLARE_INTERFACE_( IDirectDrawClipper, IUnknown )
1057 {
1058     /*** IUnknown methods ***/
1059     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
1060     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
1061     STDMETHOD_(ULONG,Release) (THIS) PURE;
1062     /*** IDirectDrawClipper methods ***/
1063     STDMETHOD(GetClipList)(THIS_ LPRECT, LPRGNDATA, LPDWORD) PURE;
1064     STDMETHOD(GetHWnd)(THIS_ HWND FAR *) PURE;
1065     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, DWORD) PURE;
1066     STDMETHOD(IsClipListChanged)(THIS_ BOOL FAR *) PURE;
1067     STDMETHOD(SetClipList)(THIS_ LPRGNDATA,DWORD) PURE;
1068     STDMETHOD(SetHWnd)(THIS_ DWORD, HWND ) PURE;
1069 };
1070
1071 #if !defined(__cplusplus) || defined(CINTERFACE)
1072 #define IDirectDrawClipper_QueryInterface(p, a, b)  (p)->lpVtbl->QueryInterface(p, a, b)
1073 #define IDirectDrawClipper_AddRef(p)                (p)->lpVtbl->AddRef(p)
1074 #define IDirectDrawClipper_Release(p)               (p)->lpVtbl->Release(p)
1075 #define IDirectDrawClipper_GetClipList(p, a, b, c)  (p)->lpVtbl->GetClipList(p, a, b, c)
1076 #define IDirectDrawClipper_GetHWnd(p, a)            (p)->lpVtbl->GetHWnd(p, a)
1077 #define IDirectDrawClipper_Initialize(p, a, b)      (p)->lpVtbl->Initialize(p, a, b)
1078 #define IDirectDrawClipper_IsClipListChanged(p, a)  (p)->lpVtbl->IsClipListChanged(p, a)
1079 #define IDirectDrawClipper_SetClipList(p, a, b)     (p)->lpVtbl->SetClipList(p, a, b)
1080 #define IDirectDrawClipper_SetHWnd(p, a, b)         (p)->lpVtbl->SetHWnd(p, a, b)
1081 #else
1082 #define IDirectDrawClipper_QueryInterface(p, a, b)  (p)->QueryInterface(a, b)
1083 #define IDirectDrawClipper_AddRef(p)                (p)->AddRef()
1084 #define IDirectDrawClipper_Release(p)               (p)->Release()
1085 #define IDirectDrawClipper_GetClipList(p, a, b, c)  (p)->GetClipList(a, b, c)
1086 #define IDirectDrawClipper_GetHWnd(p, a)            (p)->GetHWnd(a)
1087 #define IDirectDrawClipper_Initialize(p, a, b)      (p)->Initialize(a, b)
1088 #define IDirectDrawClipper_IsClipListChanged(p, a)  (p)->IsClipListChanged(a)
1089 #define IDirectDrawClipper_SetClipList(p, a, b)     (p)->SetClipList(a, b)
1090 #define IDirectDrawClipper_SetHWnd(p, a, b)         (p)->SetHWnd(a, b)
1091 #endif
1092
1093 #endif
1094
1095 /*
1096  * IDirectDrawSurface and related interfaces
1097  */
1098 #if defined( _WIN32 ) && !defined( _NO_COM )
1099 #undef INTERFACE
1100 #define INTERFACE IDirectDrawSurface
1101 DECLARE_INTERFACE_( IDirectDrawSurface, IUnknown )
1102 {
1103     /*** IUnknown methods ***/
1104     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
1105     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
1106     STDMETHOD_(ULONG,Release) (THIS) PURE;
1107     /*** IDirectDrawSurface methods ***/
1108     STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE) PURE;
1109     STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE;
1110     STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE, LPRECT,DWORD, LPDDBLTFX) PURE;
1111     STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE;
1112     STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE, LPRECT,DWORD) PURE;
1113     STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE) PURE;
1114     STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
1115     STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
1116     STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE;
1117     STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE FAR *) PURE;
1118     STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE;
1119     STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE;
1120     STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE;
1121     STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
1122     STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE;
1123     STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE;
1124     STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE;
1125     STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE;
1126     STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE;
1127     STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE;
1128     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE;
1129     STDMETHOD(IsLost)(THIS) PURE;
1130     STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE;
1131     STDMETHOD(ReleaseDC)(THIS_ HDC) PURE;
1132     STDMETHOD(Restore)(THIS) PURE;
1133     STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE;
1134     STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
1135     STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE;
1136     STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE;
1137     STDMETHOD(Unlock)(THIS_ LPVOID) PURE;
1138     STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE,LPRECT,DWORD, LPDDOVERLAYFX) PURE;
1139     STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE;
1140     STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE) PURE;
1141 };
1142
1143 #if !defined(__cplusplus) || defined(CINTERFACE)
1144 #define IDirectDrawSurface_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
1145 #define IDirectDrawSurface_AddRef(p)                    (p)->lpVtbl->AddRef(p)
1146 #define IDirectDrawSurface_Release(p)                   (p)->lpVtbl->Release(p)
1147 #define IDirectDrawSurface_AddAttachedSurface(p,a)      (p)->lpVtbl->AddAttachedSurface(p,a)
1148 #define IDirectDrawSurface_AddOverlayDirtyRect(p,a)     (p)->lpVtbl->AddOverlayDirtyRect(p,a)
1149 #define IDirectDrawSurface_Blt(p,a,b,c,d,e)             (p)->lpVtbl->Blt(p,a,b,c,d,e)
1150 #define IDirectDrawSurface_BltBatch(p,a,b,c)            (p)->lpVtbl->BltBatch(p,a,b,c)
1151 #define IDirectDrawSurface_BltFast(p,a,b,c,d,e)         (p)->lpVtbl->BltFast(p,a,b,c,d,e)
1152 #define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b)
1153 #define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b)  (p)->lpVtbl->EnumAttachedSurfaces(p,a,b)
1154 #define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c)  (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c)
1155 #define IDirectDrawSurface_Flip(p,a,b)                  (p)->lpVtbl->Flip(p,a,b)
1156 #define IDirectDrawSurface_GetAttachedSurface(p,a,b)    (p)->lpVtbl->GetAttachedSurface(p,a,b)
1157 #define IDirectDrawSurface_GetBltStatus(p,a)            (p)->lpVtbl->GetBltStatus(p,a)
1158 #define IDirectDrawSurface_GetCaps(p,b)                 (p)->lpVtbl->GetCaps(p,b)
1159 #define IDirectDrawSurface_GetClipper(p,a)              (p)->lpVtbl->GetClipper(p,a)
1160 #define IDirectDrawSurface_GetColorKey(p,a,b)           (p)->lpVtbl->GetColorKey(p,a,b)
1161 #define IDirectDrawSurface_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
1162 #define IDirectDrawSurface_GetFlipStatus(p,a)           (p)->lpVtbl->GetFlipStatus(p,a)
1163 #define IDirectDrawSurface_GetOverlayPosition(p,a,b)    (p)->lpVtbl->GetOverlayPosition(p,a,b)
1164 #define IDirectDrawSurface_GetPalette(p,a)              (p)->lpVtbl->GetPalette(p,a)
1165 #define IDirectDrawSurface_GetPixelFormat(p,a)          (p)->lpVtbl->GetPixelFormat(p,a)
1166 #define IDirectDrawSurface_GetSurfaceDesc(p,a)          (p)->lpVtbl->GetSurfaceDesc(p,a)
1167 #define IDirectDrawSurface_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
1168 #define IDirectDrawSurface_IsLost(p)                    (p)->lpVtbl->IsLost(p)
1169 #define IDirectDrawSurface_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
1170 #define IDirectDrawSurface_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
1171 #define IDirectDrawSurface_Restore(p)                   (p)->lpVtbl->Restore(p)
1172 #define IDirectDrawSurface_SetClipper(p,a)              (p)->lpVtbl->SetClipper(p,a)
1173 #define IDirectDrawSurface_SetColorKey(p,a,b)           (p)->lpVtbl->SetColorKey(p,a,b)
1174 #define IDirectDrawSurface_SetOverlayPosition(p,a,b)    (p)->lpVtbl->SetOverlayPosition(p,a,b)
1175 #define IDirectDrawSurface_SetPalette(p,a)              (p)->lpVtbl->SetPalette(p,a)
1176 #define IDirectDrawSurface_Unlock(p,b)                  (p)->lpVtbl->Unlock(p,b)
1177 #define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e)   (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e)
1178 #define IDirectDrawSurface_UpdateOverlayDisplay(p,a)    (p)->lpVtbl->UpdateOverlayDisplay(p,a)
1179 #define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b)   (p)->lpVtbl->UpdateOverlayZOrder(p,a,b)
1180 #else
1181 #define IDirectDrawSurface_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
1182 #define IDirectDrawSurface_AddRef(p)                    (p)->AddRef()
1183 #define IDirectDrawSurface_Release(p)                   (p)->Release()
1184 #define IDirectDrawSurface_AddAttachedSurface(p,a)      (p)->AddAttachedSurface(a)
1185 #define IDirectDrawSurface_AddOverlayDirtyRect(p,a)     (p)->AddOverlayDirtyRect(a)
1186 #define IDirectDrawSurface_Blt(p,a,b,c,d,e)             (p)->Blt(a,b,c,d,e)
1187 #define IDirectDrawSurface_BltBatch(p,a,b,c)            (p)->BltBatch(a,b,c)
1188 #define IDirectDrawSurface_BltFast(p,a,b,c,d,e)         (p)->BltFast(a,b,c,d,e)
1189 #define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b)
1190 #define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b)  (p)->EnumAttachedSurfaces(a,b)
1191 #define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c)  (p)->EnumOverlayZOrders(a,b,c)
1192 #define IDirectDrawSurface_Flip(p,a,b)                  (p)->Flip(a,b)
1193 #define IDirectDrawSurface_GetAttachedSurface(p,a,b)    (p)->GetAttachedSurface(a,b)
1194 #define IDirectDrawSurface_GetBltStatus(p,a)            (p)->GetBltStatus(a)
1195 #define IDirectDrawSurface_GetCaps(p,b)                 (p)->GetCaps(b)
1196 #define IDirectDrawSurface_GetClipper(p,a)              (p)->GetClipper(a)
1197 #define IDirectDrawSurface_GetColorKey(p,a,b)           (p)->GetColorKey(a,b)
1198 #define IDirectDrawSurface_GetDC(p,a)                   (p)->GetDC(a)
1199 #define IDirectDrawSurface_GetFlipStatus(p,a)           (p)->GetFlipStatus(a)
1200 #define IDirectDrawSurface_GetOverlayPosition(p,a,b)    (p)->GetOverlayPosition(a,b)
1201 #define IDirectDrawSurface_GetPalette(p,a)              (p)->GetPalette(a)
1202 #define IDirectDrawSurface_GetPixelFormat(p,a)          (p)->GetPixelFormat(a)
1203 #define IDirectDrawSurface_GetSurfaceDesc(p,a)          (p)->GetSurfaceDesc(a)
1204 #define IDirectDrawSurface_Initialize(p,a,b)            (p)->Initialize(a,b)
1205 #define IDirectDrawSurface_IsLost(p)                    (p)->IsLost()
1206 #define IDirectDrawSurface_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
1207 #define IDirectDrawSurface_ReleaseDC(p,a)               (p)->ReleaseDC(a)
1208 #define IDirectDrawSurface_Restore(p)                   (p)->Restore()
1209 #define IDirectDrawSurface_SetClipper(p,a)              (p)->SetClipper(a)
1210 #define IDirectDrawSurface_SetColorKey(p,a,b)           (p)->SetColorKey(a,b)
1211 #define IDirectDrawSurface_SetOverlayPosition(p,a,b)    (p)->SetOverlayPosition(a,b)
1212 #define IDirectDrawSurface_SetPalette(p,a)              (p)->SetPalette(a)
1213 #define IDirectDrawSurface_Unlock(p,b)                  (p)->Unlock(b)
1214 #define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e)   (p)->UpdateOverlay(a,b,c,d,e)
1215 #define IDirectDrawSurface_UpdateOverlayDisplay(p,a)    (p)->UpdateOverlayDisplay(a)
1216 #define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b)   (p)->UpdateOverlayZOrder(a,b)
1217 #endif
1218
1219 /*
1220  * IDirectDrawSurface2 and related interfaces
1221  */
1222 #undef INTERFACE
1223 #define INTERFACE IDirectDrawSurface2
1224 DECLARE_INTERFACE_( IDirectDrawSurface2, IUnknown )
1225 {
1226     /*** IUnknown methods ***/
1227     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
1228     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
1229     STDMETHOD_(ULONG,Release) (THIS) PURE;
1230     /*** IDirectDrawSurface methods ***/
1231     STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE2) PURE;
1232     STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE;
1233     STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE2, LPRECT,DWORD, LPDDBLTFX) PURE;
1234     STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE;
1235     STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE2, LPRECT,DWORD) PURE;
1236     STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE2) PURE;
1237     STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
1238     STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
1239     STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE2, DWORD) PURE;
1240     STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE2 FAR *) PURE;
1241     STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE;
1242     STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE;
1243     STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE;
1244     STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
1245     STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE;
1246     STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE;
1247     STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE;
1248     STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE;
1249     STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE;
1250     STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE;
1251     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE;
1252     STDMETHOD(IsLost)(THIS) PURE;
1253     STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE;
1254     STDMETHOD(ReleaseDC)(THIS_ HDC) PURE;
1255     STDMETHOD(Restore)(THIS) PURE;
1256     STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE;
1257     STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
1258     STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE;
1259     STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE;
1260     STDMETHOD(Unlock)(THIS_ LPVOID) PURE;
1261     STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE2,LPRECT,DWORD, LPDDOVERLAYFX) PURE;
1262     STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE;
1263     STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE2) PURE;
1264     /*** Added in the v2 interface ***/
1265     STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE;
1266     STDMETHOD(PageLock)(THIS_ DWORD) PURE;
1267     STDMETHOD(PageUnlock)(THIS_ DWORD) PURE;
1268 };
1269
1270 #if !defined(__cplusplus) || defined(CINTERFACE)
1271 #define IDirectDrawSurface2_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
1272 #define IDirectDrawSurface2_AddRef(p)                    (p)->lpVtbl->AddRef(p)
1273 #define IDirectDrawSurface2_Release(p)                   (p)->lpVtbl->Release(p)
1274 #define IDirectDrawSurface2_AddAttachedSurface(p,a)      (p)->lpVtbl->AddAttachedSurface(p,a)
1275 #define IDirectDrawSurface2_AddOverlayDirtyRect(p,a)     (p)->lpVtbl->AddOverlayDirtyRect(p,a)
1276 #define IDirectDrawSurface2_Blt(p,a,b,c,d,e)             (p)->lpVtbl->Blt(p,a,b,c,d,e)
1277 #define IDirectDrawSurface2_BltBatch(p,a,b,c)            (p)->lpVtbl->BltBatch(p,a,b,c)
1278 #define IDirectDrawSurface2_BltFast(p,a,b,c,d,e)         (p)->lpVtbl->BltFast(p,a,b,c,d,e)
1279 #define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b)
1280 #define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b)  (p)->lpVtbl->EnumAttachedSurfaces(p,a,b)
1281 #define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c)  (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c)
1282 #define IDirectDrawSurface2_Flip(p,a,b)                  (p)->lpVtbl->Flip(p,a,b)
1283 #define IDirectDrawSurface2_GetAttachedSurface(p,a,b)    (p)->lpVtbl->GetAttachedSurface(p,a,b)
1284 #define IDirectDrawSurface2_GetBltStatus(p,a)            (p)->lpVtbl->GetBltStatus(p,a)
1285 #define IDirectDrawSurface2_GetCaps(p,b)                 (p)->lpVtbl->GetCaps(p,b)
1286 #define IDirectDrawSurface2_GetClipper(p,a)              (p)->lpVtbl->GetClipper(p,a)
1287 #define IDirectDrawSurface2_GetColorKey(p,a,b)           (p)->lpVtbl->GetColorKey(p,a,b)
1288 #define IDirectDrawSurface2_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
1289 #define IDirectDrawSurface2_GetFlipStatus(p,a)           (p)->lpVtbl->GetFlipStatus(p,a)
1290 #define IDirectDrawSurface2_GetOverlayPosition(p,a,b)    (p)->lpVtbl->GetOverlayPosition(p,a,b)
1291 #define IDirectDrawSurface2_GetPalette(p,a)              (p)->lpVtbl->GetPalette(p,a)
1292 #define IDirectDrawSurface2_GetPixelFormat(p,a)          (p)->lpVtbl->GetPixelFormat(p,a)
1293 #define IDirectDrawSurface2_GetSurfaceDesc(p,a)          (p)->lpVtbl->GetSurfaceDesc(p,a)
1294 #define IDirectDrawSurface2_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
1295 #define IDirectDrawSurface2_IsLost(p)                    (p)->lpVtbl->IsLost(p)
1296 #define IDirectDrawSurface2_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
1297 #define IDirectDrawSurface2_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
1298 #define IDirectDrawSurface2_Restore(p)                   (p)->lpVtbl->Restore(p)
1299 #define IDirectDrawSurface2_SetClipper(p,a)              (p)->lpVtbl->SetClipper(p,a)
1300 #define IDirectDrawSurface2_SetColorKey(p,a,b)           (p)->lpVtbl->SetColorKey(p,a,b)
1301 #define IDirectDrawSurface2_SetOverlayPosition(p,a,b)    (p)->lpVtbl->SetOverlayPosition(p,a,b)
1302 #define IDirectDrawSurface2_SetPalette(p,a)              (p)->lpVtbl->SetPalette(p,a)
1303 #define IDirectDrawSurface2_Unlock(p,b)                  (p)->lpVtbl->Unlock(p,b)
1304 #define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e)   (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e)
1305 #define IDirectDrawSurface2_UpdateOverlayDisplay(p,a)    (p)->lpVtbl->UpdateOverlayDisplay(p,a)
1306 #define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b)   (p)->lpVtbl->UpdateOverlayZOrder(p,a,b)
1307 #define IDirectDrawSurface2_GetDDInterface(p,a)          (p)->lpVtbl->GetDDInterface(p,a)
1308 #define IDirectDrawSurface2_PageLock(p,a)                (p)->lpVtbl->PageLock(p,a)
1309 #define IDirectDrawSurface2_PageUnlock(p,a)              (p)->lpVtbl->PageUnlock(p,a)
1310 #else
1311 #define IDirectDrawSurface2_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
1312 #define IDirectDrawSurface2_AddRef(p)                    (p)->AddRef()
1313 #define IDirectDrawSurface2_Release(p)                   (p)->Release()
1314 #define IDirectDrawSurface2_AddAttachedSurface(p,a)      (p)->AddAttachedSurface(a)
1315 #define IDirectDrawSurface2_AddOverlayDirtyRect(p,a)     (p)->AddOverlayDirtyRect(a)
1316 #define IDirectDrawSurface2_Blt(p,a,b,c,d,e)             (p)->Blt(a,b,c,d,e)
1317 #define IDirectDrawSurface2_BltBatch(p,a,b,c)            (p)->BltBatch(a,b,c)
1318 #define IDirectDrawSurface2_BltFast(p,a,b,c,d,e)         (p)->BltFast(a,b,c,d,e)
1319 #define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b)
1320 #define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b)  (p)->EnumAttachedSurfaces(a,b)
1321 #define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c)  (p)->EnumOverlayZOrders(a,b,c)
1322 #define IDirectDrawSurface2_Flip(p,a,b)                  (p)->Flip(a,b)
1323 #define IDirectDrawSurface2_GetAttachedSurface(p,a,b)    (p)->GetAttachedSurface(a,b)
1324 #define IDirectDrawSurface2_GetBltStatus(p,a)            (p)->GetBltStatus(a)
1325 #define IDirectDrawSurface2_GetCaps(p,b)                 (p)->GetCaps(b)
1326 #define IDirectDrawSurface2_GetClipper(p,a)              (p)->GetClipper(a)
1327 #define IDirectDrawSurface2_GetColorKey(p,a,b)           (p)->GetColorKey(a,b)
1328 #define IDirectDrawSurface2_GetDC(p,a)                   (p)->GetDC(a)
1329 #define IDirectDrawSurface2_GetFlipStatus(p,a)           (p)->GetFlipStatus(a)
1330 #define IDirectDrawSurface2_GetOverlayPosition(p,a,b)    (p)->GetOverlayPosition(a,b)
1331 #define IDirectDrawSurface2_GetPalette(p,a)              (p)->GetPalette(a)
1332 #define IDirectDrawSurface2_GetPixelFormat(p,a)          (p)->GetPixelFormat(a)
1333 #define IDirectDrawSurface2_GetSurfaceDesc(p,a)          (p)->GetSurfaceDesc(a)
1334 #define IDirectDrawSurface2_Initialize(p,a,b)            (p)->Initialize(a,b)
1335 #define IDirectDrawSurface2_IsLost(p)                    (p)->IsLost()
1336 #define IDirectDrawSurface2_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
1337 #define IDirectDrawSurface2_ReleaseDC(p,a)               (p)->ReleaseDC(a)
1338 #define IDirectDrawSurface2_Restore(p)                   (p)->Restore()
1339 #define IDirectDrawSurface2_SetClipper(p,a)              (p)->SetClipper(a)
1340 #define IDirectDrawSurface2_SetColorKey(p,a,b)           (p)->SetColorKey(a,b)
1341 #define IDirectDrawSurface2_SetOverlayPosition(p,a,b)    (p)->SetOverlayPosition(a,b)
1342 #define IDirectDrawSurface2_SetPalette(p,a)              (p)->SetPalette(a)
1343 #define IDirectDrawSurface2_Unlock(p,b)                  (p)->Unlock(b)
1344 #define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e)   (p)->UpdateOverlay(a,b,c,d,e)
1345 #define IDirectDrawSurface2_UpdateOverlayDisplay(p,a)    (p)->UpdateOverlayDisplay(a)
1346 #define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b)   (p)->UpdateOverlayZOrder(a,b)
1347 #define IDirectDrawSurface2_GetDDInterface(p,a)          (p)->GetDDInterface(a)
1348 #define IDirectDrawSurface2_PageLock(p,a)                (p)->PageLock(a)
1349 #define IDirectDrawSurface2_PageUnlock(p,a)              (p)->PageUnlock(a)
1350 #endif
1351
1352 /*
1353  * IDirectDrawSurface3 and related interfaces
1354  */
1355 #undef INTERFACE
1356 #define INTERFACE IDirectDrawSurface3
1357 DECLARE_INTERFACE_( IDirectDrawSurface3, IUnknown )
1358 {
1359     /*** IUnknown methods ***/
1360     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
1361     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
1362     STDMETHOD_(ULONG,Release) (THIS) PURE;
1363     /*** IDirectDrawSurface methods ***/
1364     STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE3) PURE;
1365     STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE;
1366     STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE3, LPRECT,DWORD, LPDDBLTFX) PURE;
1367     STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE;
1368     STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE3, LPRECT,DWORD) PURE;
1369     STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE3) PURE;
1370     STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
1371     STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
1372     STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE3, DWORD) PURE;
1373     STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE3 FAR *) PURE;
1374     STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE;
1375     STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE;
1376     STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE;
1377     STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
1378     STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE;
1379     STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE;
1380     STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE;
1381     STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE;
1382     STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE;
1383     STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE;
1384     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE;
1385     STDMETHOD(IsLost)(THIS) PURE;
1386     STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE;
1387     STDMETHOD(ReleaseDC)(THIS_ HDC) PURE;
1388     STDMETHOD(Restore)(THIS) PURE;
1389     STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE;
1390     STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
1391     STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE;
1392     STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE;
1393     STDMETHOD(Unlock)(THIS_ LPVOID) PURE;
1394     STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE3,LPRECT,DWORD, LPDDOVERLAYFX) PURE;
1395     STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE;
1396     STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE3) PURE;
1397     /*** Added in the v2 interface ***/
1398     STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE;
1399     STDMETHOD(PageLock)(THIS_ DWORD) PURE;
1400     STDMETHOD(PageUnlock)(THIS_ DWORD) PURE;
1401     /*** Added in the V3 interface ***/
1402     STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC, DWORD) PURE;
1403 };
1404
1405 #if !defined(__cplusplus) || defined(CINTERFACE)
1406 #define IDirectDrawSurface3_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
1407 #define IDirectDrawSurface3_AddRef(p)                    (p)->lpVtbl->AddRef(p)
1408 #define IDirectDrawSurface3_Release(p)                   (p)->lpVtbl->Release(p)
1409 #define IDirectDrawSurface3_AddAttachedSurface(p,a)      (p)->lpVtbl->AddAttachedSurface(p,a)
1410 #define IDirectDrawSurface3_AddOverlayDirtyRect(p,a)     (p)->lpVtbl->AddOverlayDirtyRect(p,a)
1411 #define IDirectDrawSurface3_Blt(p,a,b,c,d,e)             (p)->lpVtbl->Blt(p,a,b,c,d,e)
1412 #define IDirectDrawSurface3_BltBatch(p,a,b,c)            (p)->lpVtbl->BltBatch(p,a,b,c)
1413 #define IDirectDrawSurface3_BltFast(p,a,b,c,d,e)         (p)->lpVtbl->BltFast(p,a,b,c,d,e)
1414 #define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b)
1415 #define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b)  (p)->lpVtbl->EnumAttachedSurfaces(p,a,b)
1416 #define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c)  (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c)
1417 #define IDirectDrawSurface3_Flip(p,a,b)                  (p)->lpVtbl->Flip(p,a,b)
1418 #define IDirectDrawSurface3_GetAttachedSurface(p,a,b)    (p)->lpVtbl->GetAttachedSurface(p,a,b)
1419 #define IDirectDrawSurface3_GetBltStatus(p,a)            (p)->lpVtbl->GetBltStatus(p,a)
1420 #define IDirectDrawSurface3_GetCaps(p,b)                 (p)->lpVtbl->GetCaps(p,b)
1421 #define IDirectDrawSurface3_GetClipper(p,a)              (p)->lpVtbl->GetClipper(p,a)
1422 #define IDirectDrawSurface3_GetColorKey(p,a,b)           (p)->lpVtbl->GetColorKey(p,a,b)
1423 #define IDirectDrawSurface3_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
1424 #define IDirectDrawSurface3_GetFlipStatus(p,a)           (p)->lpVtbl->GetFlipStatus(p,a)
1425 #define IDirectDrawSurface3_GetOverlayPosition(p,a,b)    (p)->lpVtbl->GetOverlayPosition(p,a,b)
1426 #define IDirectDrawSurface3_GetPalette(p,a)              (p)->lpVtbl->GetPalette(p,a)
1427 #define IDirectDrawSurface3_GetPixelFormat(p,a)          (p)->lpVtbl->GetPixelFormat(p,a)
1428 #define IDirectDrawSurface3_GetSurfaceDesc(p,a)          (p)->lpVtbl->GetSurfaceDesc(p,a)
1429 #define IDirectDrawSurface3_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
1430 #define IDirectDrawSurface3_IsLost(p)                    (p)->lpVtbl->IsLost(p)
1431 #define IDirectDrawSurface3_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
1432 #define IDirectDrawSurface3_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
1433 #define IDirectDrawSurface3_Restore(p)                   (p)->lpVtbl->Restore(p)
1434 #define IDirectDrawSurface3_SetClipper(p,a)              (p)->lpVtbl->SetClipper(p,a)
1435 #define IDirectDrawSurface3_SetColorKey(p,a,b)           (p)->lpVtbl->SetColorKey(p,a,b)
1436 #define IDirectDrawSurface3_SetOverlayPosition(p,a,b)    (p)->lpVtbl->SetOverlayPosition(p,a,b)
1437 #define IDirectDrawSurface3_SetPalette(p,a)              (p)->lpVtbl->SetPalette(p,a)
1438 #define IDirectDrawSurface3_Unlock(p,b)                  (p)->lpVtbl->Unlock(p,b)
1439 #define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e)   (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e)
1440 #define IDirectDrawSurface3_UpdateOverlayDisplay(p,a)    (p)->lpVtbl->UpdateOverlayDisplay(p,a)
1441 #define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b)   (p)->lpVtbl->UpdateOverlayZOrder(p,a,b)
1442 #define IDirectDrawSurface3_GetDDInterface(p,a)          (p)->lpVtbl->GetDDInterface(p,a)
1443 #define IDirectDrawSurface3_PageLock(p,a)                (p)->lpVtbl->PageLock(p,a)
1444 #define IDirectDrawSurface3_PageUnlock(p,a)              (p)->lpVtbl->PageUnlock(p,a)
1445 #define IDirectDrawSurface3_SetSurfaceDesc(p,a,b)        (p)->lpVtbl->SetSurfaceDesc(p,a,b)
1446 #else
1447 #define IDirectDrawSurface3_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
1448 #define IDirectDrawSurface3_AddRef(p)                    (p)->AddRef()
1449 #define IDirectDrawSurface3_Release(p)                   (p)->Release()
1450 #define IDirectDrawSurface3_AddAttachedSurface(p,a)      (p)->AddAttachedSurface(a)
1451 #define IDirectDrawSurface3_AddOverlayDirtyRect(p,a)     (p)->AddOverlayDirtyRect(a)
1452 #define IDirectDrawSurface3_Blt(p,a,b,c,d,e)             (p)->Blt(a,b,c,d,e)
1453 #define IDirectDrawSurface3_BltBatch(p,a,b,c)            (p)->BltBatch(a,b,c)
1454 #define IDirectDrawSurface3_BltFast(p,a,b,c,d,e)         (p)->BltFast(a,b,c,d,e)
1455 #define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b)
1456 #define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b)  (p)->EnumAttachedSurfaces(a,b)
1457 #define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c)  (p)->EnumOverlayZOrders(a,b,c)
1458 #define IDirectDrawSurface3_Flip(p,a,b)                  (p)->Flip(a,b)
1459 #define IDirectDrawSurface3_GetAttachedSurface(p,a,b)    (p)->GetAttachedSurface(a,b)
1460 #define IDirectDrawSurface3_GetBltStatus(p,a)            (p)->GetBltStatus(a)
1461 #define IDirectDrawSurface3_GetCaps(p,b)                 (p)->GetCaps(b)
1462 #define IDirectDrawSurface3_GetClipper(p,a)              (p)->GetClipper(a)
1463 #define IDirectDrawSurface3_GetColorKey(p,a,b)           (p)->GetColorKey(a,b)
1464 #define IDirectDrawSurface3_GetDC(p,a)                   (p)->GetDC(a)
1465 #define IDirectDrawSurface3_GetFlipStatus(p,a)           (p)->GetFlipStatus(a)
1466 #define IDirectDrawSurface3_GetOverlayPosition(p,a,b)    (p)->GetOverlayPosition(a,b)
1467 #define IDirectDrawSurface3_GetPalette(p,a)              (p)->GetPalette(a)
1468 #define IDirectDrawSurface3_GetPixelFormat(p,a)          (p)->GetPixelFormat(a)
1469 #define IDirectDrawSurface3_GetSurfaceDesc(p,a)          (p)->GetSurfaceDesc(a)
1470 #define IDirectDrawSurface3_Initialize(p,a,b)            (p)->Initialize(a,b)
1471 #define IDirectDrawSurface3_IsLost(p)                    (p)->IsLost()
1472 #define IDirectDrawSurface3_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
1473 #define IDirectDrawSurface3_ReleaseDC(p,a)               (p)->ReleaseDC(a)
1474 #define IDirectDrawSurface3_Restore(p)                   (p)->Restore()
1475 #define IDirectDrawSurface3_SetClipper(p,a)              (p)->SetClipper(a)
1476 #define IDirectDrawSurface3_SetColorKey(p,a,b)           (p)->SetColorKey(a,b)
1477 #define IDirectDrawSurface3_SetOverlayPosition(p,a,b)    (p)->SetOverlayPosition(a,b)
1478 #define IDirectDrawSurface3_SetPalette(p,a)              (p)->SetPalette(a)
1479 #define IDirectDrawSurface3_Unlock(p,b)                  (p)->Unlock(b)
1480 #define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e)   (p)->UpdateOverlay(a,b,c,d,e)
1481 #define IDirectDrawSurface3_UpdateOverlayDisplay(p,a)    (p)->UpdateOverlayDisplay(a)
1482 #define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b)   (p)->UpdateOverlayZOrder(a,b)
1483 #define IDirectDrawSurface3_GetDDInterface(p,a)          (p)->GetDDInterface(a)
1484 #define IDirectDrawSurface3_PageLock(p,a)                (p)->PageLock(a)
1485 #define IDirectDrawSurface3_PageUnlock(p,a)              (p)->PageUnlock(a)
1486 #define IDirectDrawSurface3_SetSurfaceDesc(p,a,b)        (p)->SetSurfaceDesc(a,b)
1487 #endif
1488
1489 /*
1490  * IDirectDrawSurface4 and related interfaces
1491  */
1492 #undef INTERFACE
1493 #define INTERFACE IDirectDrawSurface4
1494 DECLARE_INTERFACE_( IDirectDrawSurface4, IUnknown )
1495 {
1496     /*** IUnknown methods ***/
1497     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
1498     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
1499     STDMETHOD_(ULONG,Release) (THIS) PURE;
1500     /*** IDirectDrawSurface methods ***/
1501     STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE4) PURE;
1502     STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE;
1503     STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE4, LPRECT,DWORD, LPDDBLTFX) PURE;
1504     STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE;
1505     STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE4, LPRECT,DWORD) PURE;
1506     STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE4) PURE;
1507     STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK2) PURE;
1508     STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK2) PURE;
1509     STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE4, DWORD) PURE;
1510     STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS2, LPDIRECTDRAWSURFACE4 FAR *) PURE;
1511     STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE;
1512     STDMETHOD(GetCaps)(THIS_ LPDDSCAPS2) PURE;
1513     STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE;
1514     STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
1515     STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE;
1516     STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE;
1517     STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE;
1518     STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE;
1519     STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE;
1520     STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC2) PURE;
1521     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC2) PURE;
1522     STDMETHOD(IsLost)(THIS) PURE;
1523     STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC2,DWORD,HANDLE) PURE;
1524     STDMETHOD(ReleaseDC)(THIS_ HDC) PURE;
1525     STDMETHOD(Restore)(THIS) PURE;
1526     STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE;
1527     STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
1528     STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE;
1529     STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE;
1530     STDMETHOD(Unlock)(THIS_ LPRECT) PURE;
1531     STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE4,LPRECT,DWORD, LPDDOVERLAYFX) PURE;
1532     STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE;
1533     STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE4) PURE;
1534     /*** Added in the v2 interface ***/
1535     STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE;
1536     STDMETHOD(PageLock)(THIS_ DWORD) PURE;
1537     STDMETHOD(PageUnlock)(THIS_ DWORD) PURE;
1538     /*** Added in the v3 interface ***/
1539     STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC2, DWORD) PURE;
1540     /*** Added in the v4 interface ***/
1541     STDMETHOD(SetPrivateData)(THIS_ REFGUID, LPVOID, DWORD, DWORD) PURE;
1542     STDMETHOD(GetPrivateData)(THIS_ REFGUID, LPVOID, LPDWORD) PURE;
1543     STDMETHOD(FreePrivateData)(THIS_ REFGUID) PURE;
1544     STDMETHOD(GetUniquenessValue)(THIS_ LPDWORD) PURE;
1545     STDMETHOD(ChangeUniquenessValue)(THIS) PURE;
1546 };
1547
1548 #if !defined(__cplusplus) || defined(CINTERFACE)
1549 #define IDirectDrawSurface4_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
1550 #define IDirectDrawSurface4_AddRef(p)                    (p)->lpVtbl->AddRef(p)
1551 #define IDirectDrawSurface4_Release(p)                   (p)->lpVtbl->Release(p)
1552 #define IDirectDrawSurface4_AddAttachedSurface(p,a)      (p)->lpVtbl->AddAttachedSurface(p,a)
1553 #define IDirectDrawSurface4_AddOverlayDirtyRect(p,a)     (p)->lpVtbl->AddOverlayDirtyRect(p,a)
1554 #define IDirectDrawSurface4_Blt(p,a,b,c,d,e)             (p)->lpVtbl->Blt(p,a,b,c,d,e)
1555 #define IDirectDrawSurface4_BltBatch(p,a,b,c)            (p)->lpVtbl->BltBatch(p,a,b,c)
1556 #define IDirectDrawSurface4_BltFast(p,a,b,c,d,e)         (p)->lpVtbl->BltFast(p,a,b,c,d,e)
1557 #define IDirectDrawSurface4_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b)
1558 #define IDirectDrawSurface4_EnumAttachedSurfaces(p,a,b)  (p)->lpVtbl->EnumAttachedSurfaces(p,a,b)
1559 #define IDirectDrawSurface4_EnumOverlayZOrders(p,a,b,c)  (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c)
1560 #define IDirectDrawSurface4_Flip(p,a,b)                  (p)->lpVtbl->Flip(p,a,b)
1561 #define IDirectDrawSurface4_GetAttachedSurface(p,a,b)    (p)->lpVtbl->GetAttachedSurface(p,a,b)
1562 #define IDirectDrawSurface4_GetBltStatus(p,a)            (p)->lpVtbl->GetBltStatus(p,a)
1563 #define IDirectDrawSurface4_GetCaps(p,b)                 (p)->lpVtbl->GetCaps(p,b)
1564 #define IDirectDrawSurface4_GetClipper(p,a)              (p)->lpVtbl->GetClipper(p,a)
1565 #define IDirectDrawSurface4_GetColorKey(p,a,b)           (p)->lpVtbl->GetColorKey(p,a,b)
1566 #define IDirectDrawSurface4_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
1567 #define IDirectDrawSurface4_GetFlipStatus(p,a)           (p)->lpVtbl->GetFlipStatus(p,a)
1568 #define IDirectDrawSurface4_GetOverlayPosition(p,a,b)    (p)->lpVtbl->GetOverlayPosition(p,a,b)
1569 #define IDirectDrawSurface4_GetPalette(p,a)              (p)->lpVtbl->GetPalette(p,a)
1570 #define IDirectDrawSurface4_GetPixelFormat(p,a)          (p)->lpVtbl->GetPixelFormat(p,a)
1571 #define IDirectDrawSurface4_GetSurfaceDesc(p,a)          (p)->lpVtbl->GetSurfaceDesc(p,a)
1572 #define IDirectDrawSurface4_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
1573 #define IDirectDrawSurface4_IsLost(p)                    (p)->lpVtbl->IsLost(p)
1574 #define IDirectDrawSurface4_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
1575 #define IDirectDrawSurface4_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
1576 #define IDirectDrawSurface4_Restore(p)                   (p)->lpVtbl->Restore(p)
1577 #define IDirectDrawSurface4_SetClipper(p,a)              (p)->lpVtbl->SetClipper(p,a)
1578 #define IDirectDrawSurface4_SetColorKey(p,a,b)           (p)->lpVtbl->SetColorKey(p,a,b)
1579 #define IDirectDrawSurface4_SetOverlayPosition(p,a,b)    (p)->lpVtbl->SetOverlayPosition(p,a,b)
1580 #define IDirectDrawSurface4_SetPalette(p,a)              (p)->lpVtbl->SetPalette(p,a)
1581 #define IDirectDrawSurface4_Unlock(p,b)                  (p)->lpVtbl->Unlock(p,b)
1582 #define IDirectDrawSurface4_UpdateOverlay(p,a,b,c,d,e)   (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e)
1583 #define IDirectDrawSurface4_UpdateOverlayDisplay(p,a)    (p)->lpVtbl->UpdateOverlayDisplay(p,a)
1584 #define IDirectDrawSurface4_UpdateOverlayZOrder(p,a,b)   (p)->lpVtbl->UpdateOverlayZOrder(p,a,b)
1585 #define IDirectDrawSurface4_GetDDInterface(p,a)          (p)->lpVtbl->GetDDInterface(p,a)
1586 #define IDirectDrawSurface4_PageLock(p,a)                (p)->lpVtbl->PageLock(p,a)
1587 #define IDirectDrawSurface4_PageUnlock(p,a)              (p)->lpVtbl->PageUnlock(p,a)
1588 #define IDirectDrawSurface4_SetSurfaceDesc(p,a,b)        (p)->lpVtbl->SetSurfaceDesc(p,a,b)
1589 #define IDirectDrawSurface4_SetPrivateData(p,a,b,c,d)    (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
1590 #define IDirectDrawSurface4_GetPrivateData(p,a,b,c)      (p)->lpVtbl->GetPrivateData(p,a,b,c)
1591 #define IDirectDrawSurface4_FreePrivateData(p,a)         (p)->lpVtbl->FreePrivateData(p,a)
1592 #define IDirectDrawSurface4_GetUniquenessValue(p, a)     (p)->lpVtbl->GetUniquenessValue(p, a)
1593 #define IDirectDrawSurface4_ChangeUniquenessValue(p)     (p)->lpVtbl->ChangeUniquenessValue(p)
1594 #else
1595 #define IDirectDrawSurface4_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
1596 #define IDirectDrawSurface4_AddRef(p)                    (p)->AddRef()
1597 #define IDirectDrawSurface4_Release(p)                   (p)->Release()
1598 #define IDirectDrawSurface4_AddAttachedSurface(p,a)      (p)->AddAttachedSurface(a)
1599 #define IDirectDrawSurface4_AddOverlayDirtyRect(p,a)     (p)->AddOverlayDirtyRect(a)
1600 #define IDirectDrawSurface4_Blt(p,a,b,c,d,e)             (p)->Blt(a,b,c,d,e)
1601 #define IDirectDrawSurface4_BltBatch(p,a,b,c)            (p)->BltBatch(a,b,c)
1602 #define IDirectDrawSurface4_BltFast(p,a,b,c,d,e)         (p)->BltFast(a,b,c,d,e)
1603 #define IDirectDrawSurface4_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b)
1604 #define IDirectDrawSurface4_EnumAttachedSurfaces(p,a,b)  (p)->EnumAttachedSurfaces(a,b)
1605 #define IDirectDrawSurface4_EnumOverlayZOrders(p,a,b,c)  (p)->EnumOverlayZOrders(a,b,c)
1606 #define IDirectDrawSurface4_Flip(p,a,b)                  (p)->Flip(a,b)
1607 #define IDirectDrawSurface4_GetAttachedSurface(p,a,b)    (p)->GetAttachedSurface(a,b)
1608 #define IDirectDrawSurface4_GetBltStatus(p,a)            (p)->GetBltStatus(a)
1609 #define IDirectDrawSurface4_GetCaps(p,b)                 (p)->GetCaps(b)
1610 #define IDirectDrawSurface4_GetClipper(p,a)              (p)->GetClipper(a)
1611 #define IDirectDrawSurface4_GetColorKey(p,a,b)           (p)->GetColorKey(a,b)
1612 #define IDirectDrawSurface4_GetDC(p,a)                   (p)->GetDC(a)
1613 #define IDirectDrawSurface4_GetFlipStatus(p,a)           (p)->GetFlipStatus(a)
1614 #define IDirectDrawSurface4_GetOverlayPosition(p,a,b)    (p)->GetOverlayPosition(a,b)
1615 #define IDirectDrawSurface4_GetPalette(p,a)              (p)->GetPalette(a)
1616 #define IDirectDrawSurface4_GetPixelFormat(p,a)          (p)->GetPixelFormat(a)
1617 #define IDirectDrawSurface4_GetSurfaceDesc(p,a)          (p)->GetSurfaceDesc(a)
1618 #define IDirectDrawSurface4_Initialize(p,a,b)            (p)->Initialize(a,b)
1619 #define IDirectDrawSurface4_IsLost(p)                    (p)->IsLost()
1620 #define IDirectDrawSurface4_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
1621 #define IDirectDrawSurface4_ReleaseDC(p,a)               (p)->ReleaseDC(a)
1622 #define IDirectDrawSurface4_Restore(p)                   (p)->Restore()
1623 #define IDirectDrawSurface4_SetClipper(p,a)              (p)->SetClipper(a)
1624 #define IDirectDrawSurface4_SetColorKey(p,a,b)           (p)->SetColorKey(a,b)
1625 #define IDirectDrawSurface4_SetOverlayPosition(p,a,b)    (p)->SetOverlayPosition(a,b)
1626 #define IDirectDrawSurface4_SetPalette(p,a)              (p)->SetPalette(a)
1627 #define IDirectDrawSurface4_Unlock(p,b)                  (p)->Unlock(b)
1628 #define IDirectDrawSurface4_UpdateOverlay(p,a,b,c,d,e)   (p)->UpdateOverlay(a,b,c,d,e)
1629 #define IDirectDrawSurface4_UpdateOverlayDisplay(p,a)    (p)->UpdateOverlayDisplay(a)
1630 #define IDirectDrawSurface4_UpdateOverlayZOrder(p,a,b)   (p)->UpdateOverlayZOrder(a,b)
1631 #define IDirectDrawSurface4_GetDDInterface(p,a)          (p)->GetDDInterface(a)
1632 #define IDirectDrawSurface4_PageLock(p,a)                (p)->PageLock(a)
1633 #define IDirectDrawSurface4_PageUnlock(p,a)              (p)->PageUnlock(a)
1634 #define IDirectDrawSurface4_SetSurfaceDesc(p,a,b)        (p)->SetSurfaceDesc(a,b)
1635 #define IDirectDrawSurface4_SetPrivateData(p,a,b,c,d)    (p)->SetPrivateData(a,b,c,d)
1636 #define IDirectDrawSurface4_GetPrivateData(p,a,b,c)      (p)->GetPrivateData(a,b,c)
1637 #define IDirectDrawSurface4_FreePrivateData(p,a)         (p)->FreePrivateData(a)
1638 #define IDirectDrawSurface4_GetUniquenessValue(p, a)     (p)->GetUniquenessValue(a)
1639 #define IDirectDrawSurface4_ChangeUniquenessValue(p)     (p)->ChangeUniquenessValue()
1640 #endif
1641
1642
1643
1644 /*
1645  * IDirectDrawColorControl
1646  */
1647 #if defined( _WIN32 ) && !defined( _NO_COM )
1648 #undef INTERFACE
1649 #define INTERFACE IDirectDrawColorControl
1650 DECLARE_INTERFACE_( IDirectDrawColorControl, IUnknown )
1651 {
1652     /*** IUnknown methods ***/
1653     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
1654     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
1655     STDMETHOD_(ULONG,Release) (THIS) PURE;
1656     /*** IDirectDrawColorControl methods ***/
1657     STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL) PURE;
1658     STDMETHOD(SetColorControls)(THIS_ LPDDCOLORCONTROL) PURE;
1659 };
1660
1661 #if !defined(__cplusplus) || defined(CINTERFACE)
1662 #define IDirectDrawColorControl_QueryInterface(p, a, b)  (p)->lpVtbl->QueryInterface(p, a, b)
1663 #define IDirectDrawColorControl_AddRef(p)                (p)->lpVtbl->AddRef(p)
1664 #define IDirectDrawColorControl_Release(p)               (p)->lpVtbl->Release(p)
1665 #define IDirectDrawColorControl_GetColorControls(p, a)   (p)->lpVtbl->GetColorControls(p, a)
1666 #define IDirectDrawColorControl_SetColorControls(p, a)   (p)->lpVtbl->SetColorControls(p, a)
1667 #else
1668 #define IDirectDrawColorControl_QueryInterface(p, a, b)  (p)->QueryInterface(a, b)
1669 #define IDirectDrawColorControl_AddRef(p)                (p)->AddRef()
1670 #define IDirectDrawColorControl_Release(p)               (p)->Release()
1671 #define IDirectDrawColorControl_GetColorControls(p, a)   (p)->GetColorControls(a)
1672 #define IDirectDrawColorControl_SetColorControls(p, a)   (p)->SetColorControls(a)
1673 #endif
1674
1675 #endif
1676
1677
1678 /*
1679  * IDirectDrawGammaControl
1680  */
1681 #if defined( _WIN32 ) && !defined( _NO_COM )
1682 #undef INTERFACE
1683 #define INTERFACE IDirectDrawGammaControl
1684 DECLARE_INTERFACE_( IDirectDrawGammaControl, IUnknown )
1685 {
1686     /*** IUnknown methods ***/
1687     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
1688     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
1689     STDMETHOD_(ULONG,Release) (THIS) PURE;
1690     /*** IDirectDrawColorControl methods ***/
1691     STDMETHOD(GetGammaRamp)(THIS_ DWORD, LPDDGAMMARAMP) PURE;
1692     STDMETHOD(SetGammaRamp)(THIS_ DWORD, LPDDGAMMARAMP) PURE;
1693 };
1694
1695 #if !defined(__cplusplus) || defined(CINTERFACE)
1696 #define IDirectDrawGammaControl_QueryInterface(p, a, b)  (p)->lpVtbl->QueryInterface(p, a, b)
1697 #define IDirectDrawGammaControl_AddRef(p)                (p)->lpVtbl->AddRef(p)
1698 #define IDirectDrawGammaControl_Release(p)               (p)->lpVtbl->Release(p)
1699 #define IDirectDrawGammaControl_GetGammaRamp(p, a, b)    (p)->lpVtbl->GetGammaRamp(p, a, b)
1700 #define IDirectDrawGammaControl_SetGammaRamp(p, a, b)    (p)->lpVtbl->SetGammaRamp(p, a, b)
1701 #else
1702 #define IDirectDrawGammaControl_QueryInterface(p, a, b)  (p)->QueryInterface(a, b)
1703 #define IDirectDrawGammaControl_AddRef(p)                (p)->AddRef()
1704 #define IDirectDrawGammaControl_Release(p)               (p)->Release()
1705 #define IDirectDrawGammaControl_GetGammaRamp(p, a, b)    (p)->GetGammaRamp(a, b)
1706 #define IDirectDrawGammaControl_SetGammaRamp(p, a, b)    (p)->SetGammaRamp(a, b)
1707 #endif
1708
1709 #endif
1710
1711
1712
1713 #endif
1714
1715
1716 /*
1717  * DDSURFACEDESC
1718  */
1719 typedef struct _DDSURFACEDESC
1720 {
1721     DWORD               dwSize;                 // size of the DDSURFACEDESC structure
1722     DWORD               dwFlags;                // determines what fields are valid
1723     DWORD               dwHeight;               // height of surface to be created
1724     DWORD               dwWidth;                // width of input surface
1725     union
1726     {
1727         LONG            lPitch;                 // distance to start of next line (return value only)
1728         DWORD           dwLinearSize;           // Formless late-allocated optimized surface size
1729     } DUMMYUNIONNAMEN(1);
1730     DWORD               dwBackBufferCount;      // number of back buffers requested
1731     union
1732     {
1733         DWORD           dwMipMapCount;          // number of mip-map levels requested
1734         DWORD           dwZBufferBitDepth;      // depth of Z buffer requested
1735         DWORD           dwRefreshRate;          // refresh rate (used when display mode is described)
1736     } DUMMYUNIONNAMEN(2);
1737     DWORD               dwAlphaBitDepth;        // depth of alpha buffer requested
1738     DWORD               dwReserved;             // reserved
1739     LPVOID              lpSurface;              // pointer to the associated surface memory
1740     DDCOLORKEY          ddckCKDestOverlay;      // color key for destination overlay use
1741     DDCOLORKEY          ddckCKDestBlt;          // color key for destination blt use
1742     DDCOLORKEY          ddckCKSrcOverlay;       // color key for source overlay use
1743     DDCOLORKEY          ddckCKSrcBlt;           // color key for source blt use
1744     DDPIXELFORMAT       ddpfPixelFormat;        // pixel format description of the surface
1745     DDSCAPS             ddsCaps;                // direct draw surface capabilities
1746 } DDSURFACEDESC;
1747
1748 /*
1749  * DDSURFACEDESC2
1750  */
1751 typedef struct _DDSURFACEDESC2
1752 {
1753     DWORD               dwSize;                 // size of the DDSURFACEDESC structure
1754     DWORD               dwFlags;                // determines what fields are valid
1755     DWORD               dwHeight;               // height of surface to be created
1756     DWORD               dwWidth;                // width of input surface
1757     union
1758     {
1759         LONG            lPitch;                 // distance to start of next line (return value only)
1760         DWORD           dwLinearSize;           // Formless late-allocated optimized surface size
1761     } DUMMYUNIONNAMEN(1);
1762     DWORD               dwBackBufferCount;      // number of back buffers requested
1763     union
1764     {
1765         DWORD           dwMipMapCount;          // number of mip-map levels requestde
1766                                                 // dwZBufferBitDepth removed, use ddpfPixelFormat one instead
1767         DWORD           dwRefreshRate;          // refresh rate (used when display mode is described)
1768     } DUMMYUNIONNAMEN(2);
1769     DWORD               dwAlphaBitDepth;        // depth of alpha buffer requested
1770     DWORD               dwReserved;             // reserved
1771     LPVOID              lpSurface;              // pointer to the associated surface memory
1772     DDCOLORKEY          ddckCKDestOverlay;      // color key for destination overlay use
1773     DDCOLORKEY          ddckCKDestBlt;          // color key for destination blt use
1774     DDCOLORKEY          ddckCKSrcOverlay;       // color key for source overlay use
1775     DDCOLORKEY          ddckCKSrcBlt;           // color key for source blt use
1776     DDPIXELFORMAT       ddpfPixelFormat;        // pixel format description of the surface
1777     DDSCAPS2            ddsCaps;                // direct draw surface capabilities
1778     DWORD               dwTextureStage;         // stage in multitexture cascade
1779 } DDSURFACEDESC2;
1780
1781 /*
1782  * ddsCaps field is valid.
1783  */
1784 #define DDSD_CAPS               0x00000001l     // default
1785
1786 /*
1787  * dwHeight field is valid.
1788  */
1789 #define DDSD_HEIGHT             0x00000002l
1790
1791 /*
1792  * dwWidth field is valid.
1793  */
1794 #define DDSD_WIDTH              0x00000004l
1795
1796 /*
1797  * lPitch is valid.
1798  */
1799 #define DDSD_PITCH              0x00000008l
1800
1801 /*
1802  * dwBackBufferCount is valid.
1803  */
1804 #define DDSD_BACKBUFFERCOUNT    0x00000020l
1805
1806 /*
1807  * dwZBufferBitDepth is valid.  (shouldnt be used in DDSURFACEDESC2)
1808  */
1809 #define DDSD_ZBUFFERBITDEPTH    0x00000040l
1810
1811 /*
1812  * dwAlphaBitDepth is valid.
1813  */
1814 #define DDSD_ALPHABITDEPTH      0x00000080l
1815
1816
1817 /*
1818  * lpSurface is valid.
1819  */
1820 #define DDSD_LPSURFACE          0x00000800l
1821
1822 /*
1823  * ddpfPixelFormat is valid.
1824  */
1825 #define DDSD_PIXELFORMAT        0x00001000l
1826
1827 /*
1828  * ddckCKDestOverlay is valid.
1829  */
1830 #define DDSD_CKDESTOVERLAY      0x00002000l
1831
1832 /*
1833  * ddckCKDestBlt is valid.
1834  */
1835 #define DDSD_CKDESTBLT          0x00004000l
1836
1837 /*
1838  * ddckCKSrcOverlay is valid.
1839  */
1840 #define DDSD_CKSRCOVERLAY       0x00008000l
1841
1842 /*
1843  * ddckCKSrcBlt is valid.
1844  */
1845 #define DDSD_CKSRCBLT           0x00010000l
1846
1847 /*
1848  * dwMipMapCount is valid.
1849  */
1850 #define DDSD_MIPMAPCOUNT        0x00020000l
1851
1852  /*
1853   * dwRefreshRate is valid
1854   */
1855 #define DDSD_REFRESHRATE        0x00040000l
1856
1857 /*
1858  * dwLinearSize is valid
1859  */
1860 #define DDSD_LINEARSIZE         0x00080000l
1861
1862 /*
1863  * dwTextureStage is valid
1864  */
1865 #define DDSD_TEXTURESTAGE       0x00100000l
1866 /*
1867  * All input fields are valid.
1868  */
1869 #define DDSD_ALL                0x001ff9eel
1870
1871
1872 /*
1873  * DDOPTSURFACEDESC
1874  */
1875 typedef struct _DDOPTSURFACEDESC
1876 {
1877     DWORD       dwSize;             // size of the DDOPTSURFACEDESC structure
1878     DWORD       dwFlags;            // determines what fields are valid
1879     DDSCAPS2    ddSCaps;            // Common caps like: Memory type
1880     DDOSCAPS    ddOSCaps;           // Common caps like: Memory type
1881     GUID        guid;               // Compression technique GUID
1882     DWORD       dwCompressionRatio; // Compression ratio
1883 } DDOPTSURFACEDESC;
1884
1885 /*
1886  * guid field is valid.
1887  */
1888 #define DDOSD_GUID                  0x00000001l
1889
1890 /*
1891  * dwCompressionRatio field is valid.
1892  */
1893 #define DDOSD_COMPRESSION_RATIO     0x00000002l
1894
1895 /*
1896  * ddSCaps field is valid.
1897  */
1898 #define DDOSD_SCAPS                 0x00000004l
1899
1900 /*
1901  * ddOSCaps field is valid.
1902  */
1903 #define DDOSD_OSCAPS                0x00000008l
1904
1905 /*
1906  * All input fields are valid.
1907  */
1908 #define DDOSD_ALL                   0x0000000fl
1909
1910 /*
1911  * The surface's optimized pixelformat is compressed
1912  */
1913 #define DDOSDCAPS_OPTCOMPRESSED                 0x00000001l
1914
1915 /*
1916  * The surface's optimized pixelformat is reordered
1917  */
1918 #define DDOSDCAPS_OPTREORDERED                  0x00000002l
1919
1920 /*
1921  * The opt surface is a monolithic mipmap
1922  */
1923 #define DDOSDCAPS_MONOLITHICMIPMAP              0x00000004l
1924
1925 /*
1926  * The valid Surf caps:
1927  * #define DDSCAPS_SYSTEMMEMORY                 0x00000800l
1928  * #define DDSCAPS_VIDEOMEMORY          0x00004000l
1929  * #define DDSCAPS_LOCALVIDMEM          0x10000000l
1930  * #define DDSCAPS_NONLOCALVIDMEM       0x20000000l
1931  */
1932 #define DDOSDCAPS_VALIDSCAPS            0x30004800l
1933
1934 /*
1935  * The valid OptSurf caps
1936  */
1937 #define DDOSDCAPS_VALIDOSCAPS           0x00000007l
1938
1939
1940 /*
1941  * DDCOLORCONTROL
1942  */
1943 typedef struct _DDCOLORCONTROL
1944 {
1945     DWORD               dwSize;
1946     DWORD               dwFlags;
1947     LONG                lBrightness;
1948     LONG                lContrast;
1949     LONG                lHue;
1950     LONG                lSaturation;
1951     LONG                lSharpness;
1952     LONG                lGamma;
1953     LONG                lColorEnable;
1954     DWORD               dwReserved1;
1955 } DDCOLORCONTROL;
1956
1957
1958 /*
1959  * lBrightness field is valid.
1960  */
1961 #define DDCOLOR_BRIGHTNESS              0x00000001l
1962
1963 /*
1964  * lContrast field is valid.
1965  */
1966 #define DDCOLOR_CONTRAST                0x00000002l
1967
1968 /*
1969  * lHue field is valid.
1970  */
1971 #define DDCOLOR_HUE                     0x00000004l
1972
1973 /*
1974  * lSaturation field is valid.
1975  */
1976 #define DDCOLOR_SATURATION              0x00000008l
1977
1978 /*
1979  * lSharpness field is valid.
1980  */
1981 #define DDCOLOR_SHARPNESS               0x00000010l
1982
1983 /*
1984  * lGamma field is valid.
1985  */
1986 #define DDCOLOR_GAMMA                   0x00000020l
1987
1988 /*
1989  * lColorEnable field is valid.
1990  */
1991 #define DDCOLOR_COLORENABLE             0x00000040l
1992
1993
1994
1995 /*============================================================================
1996  *
1997  * Direct Draw Capability Flags
1998  *
1999  * These flags are used to describe the capabilities of a given Surface.
2000  * All flags are bit flags.
2001  *
2002  *==========================================================================*/
2003
2004 /****************************************************************************
2005  *
2006  * DIRECTDRAWSURFACE CAPABILITY FLAGS
2007  *
2008  ****************************************************************************/
2009
2010 /*
2011  * This bit is reserved. It should not be specified.
2012  */
2013 #define DDSCAPS_RESERVED1                       0x00000001l
2014
2015 /*
2016  * Indicates that this surface contains alpha-only information.
2017  * (To determine if a surface is RGBA/YUVA, the pixel format must be
2018  * interrogated.)
2019  */
2020 #define DDSCAPS_ALPHA                           0x00000002l
2021
2022 /*
2023  * Indicates that this surface is a backbuffer.  It is generally
2024  * set by CreateSurface when the DDSCAPS_FLIP capability bit is set.
2025  * It indicates that this surface is THE back buffer of a surface
2026  * flipping structure.  DirectDraw supports N surfaces in a
2027  * surface flipping structure.  Only the surface that immediately
2028  * precedeces the DDSCAPS_FRONTBUFFER has this capability bit set.
2029  * The other surfaces are identified as back buffers by the presence
2030  * of the DDSCAPS_FLIP capability, their attachment order, and the
2031  * absence of the DDSCAPS_FRONTBUFFER and DDSCAPS_BACKBUFFER
2032  * capabilities.  The bit is sent to CreateSurface when a standalone
2033  * back buffer is being created.  This surface could be attached to
2034  * a front buffer and/or back buffers to form a flipping surface
2035  * structure after the CreateSurface call.  See AddAttachments for
2036  * a detailed description of the behaviors in this case.
2037  */
2038 #define DDSCAPS_BACKBUFFER                      0x00000004l
2039
2040 /*
2041  * Indicates a complex surface structure is being described.  A
2042  * complex surface structure results in the creation of more than
2043  * one surface.  The additional surfaces are attached to the root
2044  * surface.  The complex structure can only be destroyed by
2045  * destroying the root.
2046  */
2047 #define DDSCAPS_COMPLEX                         0x00000008l
2048
2049 /*
2050  * Indicates that this surface is a part of a surface flipping structure.
2051  * When it is passed to CreateSurface the DDSCAPS_FRONTBUFFER and
2052  * DDSCAP_BACKBUFFER bits are not set.  They are set by CreateSurface
2053  * on the resulting creations.  The dwBackBufferCount field in the
2054  * DDSURFACEDESC structure must be set to at least 1 in order for
2055  * the CreateSurface call to succeed.  The DDSCAPS_COMPLEX capability
2056  * must always be set with creating multiple surfaces through CreateSurface.
2057  */
2058 #define DDSCAPS_FLIP                            0x00000010l
2059
2060 /*
2061  * Indicates that this surface is THE front buffer of a surface flipping
2062  * structure.  It is generally set by CreateSurface when the DDSCAPS_FLIP
2063  * capability bit is set.
2064  * If this capability is sent to CreateSurface then a standalonw front buffer
2065  * is created.  This surface will not have the DDSCAPS_FLIP capability.
2066  * It can be attached to other back buffers to form a flipping structure.
2067  * See AddAttachments for a detailed description of the behaviors in this
2068  * case.
2069  */
2070 #define DDSCAPS_FRONTBUFFER                     0x00000020l
2071
2072 /*
2073  * Indicates that this surface is any offscreen surface that is not an overlay,
2074  * texture, zbuffer, front buffer, back buffer, or alpha surface.  It is used
2075  * to identify plain vanilla surfaces.
2076  */
2077 #define DDSCAPS_OFFSCREENPLAIN                  0x00000040l
2078
2079 /*
2080  * Indicates that this surface is an overlay.  It may or may not be directly visible
2081  * depending on whether or not it is currently being overlayed onto the primary
2082  * surface.  DDSCAPS_VISIBLE can be used to determine whether or not it is being
2083  * overlayed at the moment.
2084  */
2085 #define DDSCAPS_OVERLAY                         0x00000080l
2086
2087 /*
2088  * Indicates that unique DirectDrawPalette objects can be created and
2089  * attached to this surface.
2090  */
2091 #define DDSCAPS_PALETTE                         0x00000100l
2092
2093 /*
2094  * Indicates that this surface is the primary surface.  The primary
2095  * surface represents what the user is seeing at the moment.
2096  */
2097 #define DDSCAPS_PRIMARYSURFACE                  0x00000200l
2098
2099 /*
2100  * Indicates that this surface is the primary surface for the left eye.
2101  * The primary surface for the left eye represents what the user is seeing
2102  * at the moment with the users left eye.  When this surface is created the
2103  * DDSCAPS_PRIMARYSURFACE represents what the user is seeing with the users
2104  * right eye.
2105  */
2106 #define DDSCAPS_PRIMARYSURFACELEFT              0x00000400l
2107
2108 /*
2109  * Indicates that this surface memory was allocated in system memory
2110  */
2111 #define DDSCAPS_SYSTEMMEMORY                    0x00000800l
2112
2113 /*
2114  * Indicates that this surface can be used as a 3D texture.  It does not
2115  * indicate whether or not the surface is being used for that purpose.
2116  */
2117 #define DDSCAPS_TEXTURE                         0x00001000l
2118
2119 /*
2120  * Indicates that a surface may be a destination for 3D rendering.  This
2121  * bit must be set in order to query for a Direct3D Device Interface
2122  * from this surface.
2123  */
2124 #define DDSCAPS_3DDEVICE                        0x00002000l
2125
2126 /*
2127  * Indicates that this surface exists in video memory.
2128  */
2129 #define DDSCAPS_VIDEOMEMORY                     0x00004000l
2130
2131 /*
2132  * Indicates that changes made to this surface are immediately visible.
2133  * It is always set for the primary surface and is set for overlays while
2134  * they are being overlayed and texture maps while they are being textured.
2135  */
2136 #define DDSCAPS_VISIBLE                         0x00008000l
2137
2138 /*
2139  * Indicates that only writes are permitted to the surface.  Read accesses
2140  * from the surface may or may not generate a protection fault, but the
2141  * results of a read from this surface will not be meaningful.  READ ONLY.
2142  */
2143 #define DDSCAPS_WRITEONLY                       0x00010000l
2144
2145 /*
2146  * Indicates that this surface is a z buffer. A z buffer does not contain
2147  * displayable information.  Instead it contains bit depth information that is
2148  * used to determine which pixels are visible and which are obscured.
2149  */
2150 #define DDSCAPS_ZBUFFER                         0x00020000l
2151
2152 /*
2153  * Indicates surface will have a DC associated long term
2154  */
2155 #define DDSCAPS_OWNDC                           0x00040000l
2156
2157 /*
2158  * Indicates surface should be able to receive live video
2159  */
2160 #define DDSCAPS_LIVEVIDEO                       0x00080000l
2161
2162 /*
2163  * Indicates surface should be able to have a stream decompressed
2164  * to it by the hardware.
2165  */
2166 #define DDSCAPS_HWCODEC                         0x00100000l
2167
2168 /*
2169  * Surface is a ModeX surface.
2170  *
2171  */
2172 #define DDSCAPS_MODEX                           0x00200000l
2173
2174 /*
2175  * Indicates surface is one level of a mip-map. This surface will
2176  * be attached to other DDSCAPS_MIPMAP surfaces to form the mip-map.
2177  * This can be done explicitly, by creating a number of surfaces and
2178  * attaching them with AddAttachedSurface or by implicitly by CreateSurface.
2179  * If this bit is set then DDSCAPS_TEXTURE must also be set.
2180  */
2181 #define DDSCAPS_MIPMAP                          0x00400000l
2182
2183 /*
2184  * This bit is reserved. It should not be specified.
2185  */
2186 #define DDSCAPS_RESERVED2                       0x00800000l
2187
2188
2189 /*
2190  * Indicates that memory for the surface is not allocated until the surface
2191  * is loaded (via the Direct3D texture Load() function).
2192  */
2193 #define DDSCAPS_ALLOCONLOAD                     0x04000000l
2194
2195 /*
2196  * Indicates that the surface will recieve data from a video port.
2197  */
2198 #define DDSCAPS_VIDEOPORT                       0x08000000l
2199
2200 /*
2201  * Indicates that a video memory surface is resident in true, local video
2202  * memory rather than non-local video memory. If this flag is specified then
2203  * so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with
2204  * DDSCAPS_NONLOCALVIDMEM.
2205  */
2206 #define DDSCAPS_LOCALVIDMEM                     0x10000000l
2207
2208 /*
2209  * Indicates that a video memory surface is resident in non-local video
2210  * memory rather than true, local video memory. If this flag is specified
2211  * then so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with
2212  * DDSCAPS_LOCALVIDMEM.
2213  */
2214 #define DDSCAPS_NONLOCALVIDMEM                  0x20000000l
2215
2216 /*
2217  * Indicates that this surface is a standard VGA mode surface, and not a
2218  * ModeX surface. (This flag will never be set in combination with the
2219  * DDSCAPS_MODEX flag).
2220  */
2221 #define DDSCAPS_STANDARDVGAMODE                 0x40000000l
2222
2223 /*
2224  * Indicates that this surface will be an optimized surface. This flag is
2225  * currently only valid in conjunction with the DDSCAPS_TEXTURE flag. The surface
2226  * will be created without any underlying video memory until loaded.
2227  */
2228 #define DDSCAPS_OPTIMIZED                       0x80000000l
2229
2230
2231
2232
2233 /*
2234  * Indicates that this surface will receive data from a video port using
2235  * the de-interlacing hardware.  This allows the driver to allocate memory
2236  * for any extra buffers that may be required.  The DDSCAPS_VIDEOPORT and
2237  * DDSCAPS_OVERLAY flags must also be set.
2238  */
2239 #define DDSCAPS2_HARDWAREDEINTERLACE            0x00000002L
2240
2241 /*
2242  * Indicates to the driver that this surface will be locked very frequently
2243  * (for procedural textures, dynamic lightmaps, etc). Surfaces with this cap
2244  * set must also have DDSCAPS_TEXTURE. This cap cannot be used with
2245  * DDSCAPS2_HINTSTATIC and DDSCAPS2_OPAQUE.
2246  */
2247 #define DDSCAPS2_HINTDYNAMIC                    0x00000004L
2248
2249 /*
2250  * Indicates to the driver that this surface can be re-ordered/retiled on
2251  * load. This operation will not change the size of the texture. It is
2252  * relatively fast and symmetrical, since the application may lock these
2253  * bits (although it will take a performance hit when doing so). Surfaces
2254  * with this cap set must also have DDSCAPS_TEXTURE. This cap cannot be
2255  * used with DDSCAPS2_HINTDYNAMIC and DDSCAPS2_OPAQUE.
2256  */
2257 #define DDSCAPS2_HINTSTATIC                     0x00000008L
2258
2259 /*
2260  * Indicates that the client would like this texture surface to be managed by the
2261  * DirectDraw/Direct3D runtime. Surfaces with this cap set must also have
2262  * DDSCAPS_TEXTURE set.
2263  */
2264 #define DDSCAPS2_TEXTUREMANAGE                  0x00000010L
2265
2266 /*
2267  * These bits are reserved for internal use */
2268 #define DDSCAPS2_RESERVED1                      0x00000020L
2269 #define DDSCAPS2_RESERVED2                      0x00000040L
2270
2271 /*
2272  * Indicates to the driver that this surface will never be locked again.
2273  * The driver is free to optimize this surface via retiling and actual compression.
2274  * All calls to Lock() or Blts from this surface will fail. Surfaces with this
2275  * cap set must also have DDSCAPS_TEXTURE. This cap cannot be used with
2276  * DDSCAPS2_HINTDYNAMIC and DDSCAPS2_HINTSTATIC.
2277  */
2278 #define DDSCAPS2_OPAQUE                         0x00000080L
2279
2280 /*
2281  * Applications should set this bit at CreateSurface time to indicate that they
2282  * intend to use antialiasing. Only valid if DDSCAPS_3DDEVICE is also set.
2283  */
2284 #define DDSCAPS2_HINTANTIALIASING               0x00000100L
2285
2286
2287
2288
2289  /****************************************************************************
2290  *
2291  * DIRECTDRAW DRIVER CAPABILITY FLAGS
2292  *
2293  ****************************************************************************/
2294
2295 /*
2296  * Display hardware has 3D acceleration.
2297  */
2298 #define DDCAPS_3D                       0x00000001l
2299
2300 /*
2301  * Indicates that DirectDraw will support only dest rectangles that are aligned
2302  * on DIRECTDRAWCAPS.dwAlignBoundaryDest boundaries of the surface, respectively.
2303  * READ ONLY.
2304  */
2305 #define DDCAPS_ALIGNBOUNDARYDEST        0x00000002l
2306
2307 /*
2308  * Indicates that DirectDraw will support only source rectangles  whose sizes in
2309  * BYTEs are DIRECTDRAWCAPS.dwAlignSizeDest multiples, respectively.  READ ONLY.
2310  */
2311 #define DDCAPS_ALIGNSIZEDEST            0x00000004l
2312 /*
2313  * Indicates that DirectDraw will support only source rectangles that are aligned
2314  * on DIRECTDRAWCAPS.dwAlignBoundarySrc boundaries of the surface, respectively.
2315  * READ ONLY.
2316  */
2317 #define DDCAPS_ALIGNBOUNDARYSRC         0x00000008l
2318
2319 /*
2320  * Indicates that DirectDraw will support only source rectangles  whose sizes in
2321  * BYTEs are DIRECTDRAWCAPS.dwAlignSizeSrc multiples, respectively.  READ ONLY.
2322  */
2323 #define DDCAPS_ALIGNSIZESRC             0x00000010l
2324
2325 /*
2326  * Indicates that DirectDraw will create video memory surfaces that have a stride
2327  * alignment equal to DIRECTDRAWCAPS.dwAlignStride.  READ ONLY.
2328  */
2329 #define DDCAPS_ALIGNSTRIDE              0x00000020l
2330
2331 /*
2332  * Display hardware is capable of blt operations.
2333  */
2334 #define DDCAPS_BLT                      0x00000040l
2335
2336 /*
2337  * Display hardware is capable of asynchronous blt operations.
2338  */
2339 #define DDCAPS_BLTQUEUE                 0x00000080l
2340
2341 /*
2342  * Display hardware is capable of color space conversions during the blt operation.
2343  */
2344 #define DDCAPS_BLTFOURCC                0x00000100l
2345
2346 /*
2347  * Display hardware is capable of stretching during blt operations.
2348  */
2349 #define DDCAPS_BLTSTRETCH               0x00000200l
2350
2351 /*
2352  * Display hardware is shared with GDI.
2353  */
2354 #define DDCAPS_GDI                      0x00000400l
2355
2356 /*
2357  * Display hardware can overlay.
2358  */
2359 #define DDCAPS_OVERLAY                  0x00000800l
2360
2361 /*
2362  * Set if display hardware supports overlays but can not clip them.
2363  */
2364 #define DDCAPS_OVERLAYCANTCLIP          0x00001000l
2365
2366 /*
2367  * Indicates that overlay hardware is capable of color space conversions during
2368  * the overlay operation.
2369  */
2370 #define DDCAPS_OVERLAYFOURCC            0x00002000l
2371
2372 /*
2373  * Indicates that stretching can be done by the overlay hardware.
2374  */
2375 #define DDCAPS_OVERLAYSTRETCH           0x00004000l
2376
2377 /*
2378  * Indicates that unique DirectDrawPalettes can be created for DirectDrawSurfaces
2379  * other than the primary surface.
2380  */
2381 #define DDCAPS_PALETTE                  0x00008000l
2382
2383 /*
2384  * Indicates that palette changes can be syncd with the veritcal refresh.
2385  */
2386 #define DDCAPS_PALETTEVSYNC             0x00010000l
2387
2388 /*
2389  * Display hardware can return the current scan line.
2390  */
2391 #define DDCAPS_READSCANLINE             0x00020000l
2392
2393 /*
2394  * Display hardware has stereo vision capabilities.  DDSCAPS_PRIMARYSURFACELEFT
2395  * can be created.
2396  */
2397 #define DDCAPS_STEREOVIEW               0x00040000l
2398
2399 /*
2400  * Display hardware is capable of generating a vertical blank interrupt.
2401  */
2402 #define DDCAPS_VBI                      0x00080000l
2403
2404 /*
2405  * Supports the use of z buffers with blt operations.
2406  */
2407 #define DDCAPS_ZBLTS                    0x00100000l
2408
2409 /*
2410  * Supports Z Ordering of overlays.
2411  */
2412 #define DDCAPS_ZOVERLAYS                0x00200000l
2413
2414 /*
2415  * Supports color key
2416  */
2417 #define DDCAPS_COLORKEY                 0x00400000l
2418
2419 /*
2420  * Supports alpha surfaces
2421  */
2422 #define DDCAPS_ALPHA                    0x00800000l
2423
2424 /*
2425  * colorkey is hardware assisted(DDCAPS_COLORKEY will also be set)
2426  */
2427 #define DDCAPS_COLORKEYHWASSIST         0x01000000l
2428
2429 /*
2430  * no hardware support at all
2431  */
2432 #define DDCAPS_NOHARDWARE               0x02000000l
2433
2434 /*
2435  * Display hardware is capable of color fill with bltter
2436  */
2437 #define DDCAPS_BLTCOLORFILL             0x04000000l
2438
2439 /*
2440  * Display hardware is bank switched, and potentially very slow at
2441  * random access to VRAM.
2442  */
2443 #define DDCAPS_BANKSWITCHED             0x08000000l
2444
2445 /*
2446  * Display hardware is capable of depth filling Z-buffers with bltter
2447  */
2448 #define DDCAPS_BLTDEPTHFILL             0x10000000l
2449
2450 /*
2451  * Display hardware is capable of clipping while bltting.
2452  */
2453 #define DDCAPS_CANCLIP                  0x20000000l
2454
2455 /*
2456  * Display hardware is capable of clipping while stretch bltting.
2457  */
2458 #define DDCAPS_CANCLIPSTRETCHED         0x40000000l
2459
2460 /*
2461  * Display hardware is capable of bltting to or from system memory
2462  */
2463 #define DDCAPS_CANBLTSYSMEM             0x80000000l
2464
2465
2466  /****************************************************************************
2467  *
2468  * MORE DIRECTDRAW DRIVER CAPABILITY FLAGS (dwCaps2)
2469  *
2470  ****************************************************************************/
2471
2472 /*
2473  * Display hardware is certified
2474  */
2475 #define DDCAPS2_CERTIFIED              0x00000001l
2476
2477 /*
2478  * Driver cannot interleave 2D operations (lock and blt) to surfaces with
2479  * Direct3D rendering operations between calls to BeginScene() and EndScene()
2480  */
2481 #define DDCAPS2_NO2DDURING3DSCENE       0x00000002l
2482
2483 /*
2484  * Display hardware contains a video port
2485  */
2486 #define DDCAPS2_VIDEOPORT               0x00000004l
2487
2488 /*
2489  * The overlay can be automatically flipped according to the video port
2490  * VSYNCs, providing automatic doubled buffered display of video port
2491  * data using an overlay
2492  */
2493 #define DDCAPS2_AUTOFLIPOVERLAY         0x00000008l
2494
2495 /*
2496  * Overlay can display each field of interlaced data individually while
2497  * it is interleaved in memory without causing jittery artifacts.
2498  */
2499 #define DDCAPS2_CANBOBINTERLEAVED       0x00000010l
2500
2501 /*
2502  * Overlay can display each field of interlaced data individually while
2503  * it is not interleaved in memory without causing jittery artifacts.
2504  */
2505 #define DDCAPS2_CANBOBNONINTERLEAVED    0x00000020l
2506
2507 /*
2508  * The overlay surface contains color controls (brightness, sharpness, etc.)
2509  */
2510 #define DDCAPS2_COLORCONTROLOVERLAY     0x00000040l
2511
2512 /*
2513  * The primary surface contains color controls (gamma, etc.)
2514  */
2515 #define DDCAPS2_COLORCONTROLPRIMARY     0x00000080l
2516
2517 /*
2518  * RGBZ -> RGB supported for 16:16 RGB:Z
2519  */
2520 #define DDCAPS2_CANDROPZ16BIT           0x00000100l
2521
2522 /*
2523  * Driver supports non-local video memory.
2524  */
2525 #define DDCAPS2_NONLOCALVIDMEM          0x00000200l
2526
2527 /*
2528  * Dirver supports non-local video memory but has different capabilities for
2529  * non-local video memory surfaces. If this bit is set then so must
2530  * DDCAPS2_NONLOCALVIDMEM.
2531  */
2532 #define DDCAPS2_NONLOCALVIDMEMCAPS      0x00000400l
2533
2534 /*
2535  * Driver neither requires nor prefers surfaces to be pagelocked when performing
2536  * blts involving system memory surfaces
2537  */
2538 #define DDCAPS2_NOPAGELOCKREQUIRED      0x00000800l
2539
2540 /*
2541  * Driver can create surfaces which are wider than the primary surface
2542  */
2543 #define DDCAPS2_WIDESURFACES            0x00001000l
2544
2545 /*
2546  * Driver supports bob without using a video port by handling the
2547  * DDFLIP_ODD and DDFLIP_EVEN flags specified in Flip.
2548  */
2549 #define DDCAPS2_CANFLIPODDEVEN          0x00002000l
2550
2551 /*
2552  * Driver supports bob using hardware
2553  */
2554 #define DDCAPS2_CANBOBHARDWARE          0x00004000l
2555
2556 /*
2557  * Driver supports bltting any FOURCC surface to another surface of the same FOURCC
2558  */
2559 #define DDCAPS2_COPYFOURCC              0x00008000l
2560
2561
2562 /*
2563  * Driver supports loadable gamma ramps for the primary surface
2564  */
2565 #define DDCAPS2_PRIMARYGAMMA            0x00020000l
2566
2567 /*
2568  * Driver can render in windowed mode.
2569  */
2570 #define DDCAPS2_CANRENDERWINDOWED       0x00080000l
2571
2572 /*
2573  * A calibrator is available to adjust the gamma ramp according to the
2574  * physical display properties so that the result will be identical on
2575  * all calibrated systems.
2576  */
2577 #define DDCAPS2_CANCALIBRATEGAMMA       0x00100000l
2578
2579 /*
2580  * Indicates that the driver will respond to DDFLIP_INTERVALn flags
2581  */
2582 #define DDCAPS2_FLIPINTERVAL            0x00200000l
2583
2584 /*
2585  * Indicates that the driver will respond to DDFLIP_NOVSYNC
2586  */
2587 #define DDCAPS2_FLIPNOVSYNC             0x00400000l
2588
2589
2590 /****************************************************************************
2591  *
2592  * DIRECTDRAW FX ALPHA CAPABILITY FLAGS
2593  *
2594  ****************************************************************************/
2595
2596 /*
2597  * Supports alpha blending around the edge of a source color keyed surface.
2598  * For Blt.
2599  */
2600 #define DDFXALPHACAPS_BLTALPHAEDGEBLEND         0x00000001l
2601
2602 /*
2603  * Supports alpha information in the pixel format.  The bit depth of alpha
2604  * information in the pixel format can be 1,2,4, or 8.  The alpha value becomes
2605  * more opaque as the alpha value increases.  (0 is transparent.)
2606  * For Blt.
2607  */
2608 #define DDFXALPHACAPS_BLTALPHAPIXELS            0x00000002l
2609
2610 /*
2611  * Supports alpha information in the pixel format.  The bit depth of alpha
2612  * information in the pixel format can be 1,2,4, or 8.  The alpha value
2613  * becomes more transparent as the alpha value increases.  (0 is opaque.)
2614  * This flag can only be set if DDCAPS_ALPHA is set.
2615  * For Blt.
2616  */
2617 #define DDFXALPHACAPS_BLTALPHAPIXELSNEG         0x00000004l
2618
2619 /*
2620  * Supports alpha only surfaces.  The bit depth of an alpha only surface can be
2621  * 1,2,4, or 8.  The alpha value becomes more opaque as the alpha value increases.
2622  * (0 is transparent.)
2623  * For Blt.
2624  */
2625 #define DDFXALPHACAPS_BLTALPHASURFACES          0x00000008l
2626
2627 /*
2628  * The depth of the alpha channel data can range can be 1,2,4, or 8.
2629  * The NEG suffix indicates that this alpha channel becomes more transparent
2630  * as the alpha value increases. (0 is opaque.)  This flag can only be set if
2631  * DDCAPS_ALPHA is set.
2632  * For Blt.
2633  */
2634 #define DDFXALPHACAPS_BLTALPHASURFACESNEG       0x00000010l
2635
2636 /*
2637  * Supports alpha blending around the edge of a source color keyed surface.
2638  * For Overlays.
2639  */
2640 #define DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND     0x00000020l
2641
2642 /*
2643  * Supports alpha information in the pixel format.  The bit depth of alpha
2644  * information in the pixel format can be 1,2,4, or 8.  The alpha value becomes
2645  * more opaque as the alpha value increases.  (0 is transparent.)
2646  * For Overlays.
2647  */
2648 #define DDFXALPHACAPS_OVERLAYALPHAPIXELS        0x00000040l
2649
2650 /*
2651  * Supports alpha information in the pixel format.  The bit depth of alpha
2652  * information in the pixel format can be 1,2,4, or 8.  The alpha value
2653  * becomes more transparent as the alpha value increases.  (0 is opaque.)
2654  * This flag can only be set if DDCAPS_ALPHA is set.
2655  * For Overlays.
2656  */
2657 #define DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG     0x00000080l
2658
2659 /*
2660  * Supports alpha only surfaces.  The bit depth of an alpha only surface can be
2661  * 1,2,4, or 8.  The alpha value becomes more opaque as the alpha value increases.
2662  * (0 is transparent.)
2663  * For Overlays.
2664  */
2665 #define DDFXALPHACAPS_OVERLAYALPHASURFACES      0x00000100l
2666
2667 /*
2668  * The depth of the alpha channel data can range can be 1,2,4, or 8.
2669  * The NEG suffix indicates that this alpha channel becomes more transparent
2670  * as the alpha value increases. (0 is opaque.)  This flag can only be set if
2671  * DDCAPS_ALPHA is set.
2672  * For Overlays.
2673  */
2674 #define DDFXALPHACAPS_OVERLAYALPHASURFACESNEG   0x00000200l
2675
2676 #if DIRECTDRAW_VERSION < 0x0600
2677 #endif  //DIRECTDRAW_VERSION
2678
2679
2680
2681
2682 /****************************************************************************
2683  *
2684  * DIRECTDRAW FX CAPABILITY FLAGS
2685  *
2686  ****************************************************************************/
2687
2688 /*
2689  * Uses arithmetic operations to stretch and shrink surfaces during blt
2690  * rather than pixel doubling techniques.  Along the Y axis.
2691  */
2692 #define DDFXCAPS_BLTARITHSTRETCHY       0x00000020l
2693
2694 /*
2695  * Uses arithmetic operations to stretch during blt
2696  * rather than pixel doubling techniques.  Along the Y axis. Only
2697  * works for x1, x2, etc.
2698  */
2699 #define DDFXCAPS_BLTARITHSTRETCHYN      0x00000010l
2700
2701 /*
2702  * Supports mirroring left to right in blt.
2703  */
2704 #define DDFXCAPS_BLTMIRRORLEFTRIGHT     0x00000040l
2705
2706 /*
2707  * Supports mirroring top to bottom in blt.
2708  */
2709 #define DDFXCAPS_BLTMIRRORUPDOWN        0x00000080l
2710
2711 /*
2712  * Supports arbitrary rotation for blts.
2713  */
2714 #define DDFXCAPS_BLTROTATION            0x00000100l
2715
2716 /*
2717  * Supports 90 degree rotations for blts.
2718  */
2719 #define DDFXCAPS_BLTROTATION90          0x00000200l
2720
2721 /*
2722  * DirectDraw supports arbitrary shrinking of a surface along the
2723  * x axis (horizontal direction) for blts.
2724  */
2725 #define DDFXCAPS_BLTSHRINKX             0x00000400l
2726
2727 /*
2728  * DirectDraw supports integer shrinking (1x,2x,) of a surface
2729  * along the x axis (horizontal direction) for blts.
2730  */
2731 #define DDFXCAPS_BLTSHRINKXN            0x00000800l
2732
2733 /*
2734  * DirectDraw supports arbitrary shrinking of a surface along the
2735  * y axis (horizontal direction) for blts.
2736  */
2737 #define DDFXCAPS_BLTSHRINKY             0x00001000l
2738
2739 /*
2740  * DirectDraw supports integer shrinking (1x,2x,) of a surface
2741  * along the y axis (vertical direction) for blts.
2742  */
2743 #define DDFXCAPS_BLTSHRINKYN            0x00002000l
2744
2745 /*
2746  * DirectDraw supports arbitrary stretching of a surface along the
2747  * x axis (horizontal direction) for blts.
2748  */
2749 #define DDFXCAPS_BLTSTRETCHX            0x00004000l
2750
2751 /*
2752  * DirectDraw supports integer stretching (1x,2x,) of a surface
2753  * along the x axis (horizontal direction) for blts.
2754  */
2755 #define DDFXCAPS_BLTSTRETCHXN           0x00008000l
2756
2757 /*
2758  * DirectDraw supports arbitrary stretching of a surface along the
2759  * y axis (horizontal direction) for blts.
2760  */
2761 #define DDFXCAPS_BLTSTRETCHY            0x00010000l
2762
2763 /*
2764  * DirectDraw supports integer stretching (1x,2x,) of a surface
2765  * along the y axis (vertical direction) for blts.
2766  */
2767 #define DDFXCAPS_BLTSTRETCHYN           0x00020000l
2768
2769 /*
2770  * Uses arithmetic operations to stretch and shrink surfaces during
2771  * overlay rather than pixel doubling techniques.  Along the Y axis
2772  * for overlays.
2773  */
2774 #define DDFXCAPS_OVERLAYARITHSTRETCHY   0x00040000l
2775
2776 /*
2777  * Uses arithmetic operations to stretch surfaces during
2778  * overlay rather than pixel doubling techniques.  Along the Y axis
2779  * for overlays. Only works for x1, x2, etc.
2780  */
2781 #define DDFXCAPS_OVERLAYARITHSTRETCHYN  0x00000008l
2782
2783 /*
2784  * DirectDraw supports arbitrary shrinking of a surface along the
2785  * x axis (horizontal direction) for overlays.
2786  */
2787 #define DDFXCAPS_OVERLAYSHRINKX         0x00080000l
2788
2789 /*
2790  * DirectDraw supports integer shrinking (1x,2x,) of a surface
2791  * along the x axis (horizontal direction) for overlays.
2792  */
2793 #define DDFXCAPS_OVERLAYSHRINKXN        0x00100000l
2794
2795 /*
2796  * DirectDraw supports arbitrary shrinking of a surface along the
2797  * y axis (horizontal direction) for overlays.
2798  */
2799 #define DDFXCAPS_OVERLAYSHRINKY         0x00200000l
2800
2801 /*
2802  * DirectDraw supports integer shrinking (1x,2x,) of a surface
2803  * along the y axis (vertical direction) for overlays.
2804  */
2805 #define DDFXCAPS_OVERLAYSHRINKYN        0x00400000l
2806
2807 /*
2808  * DirectDraw supports arbitrary stretching of a surface along the
2809  * x axis (horizontal direction) for overlays.
2810  */
2811 #define DDFXCAPS_OVERLAYSTRETCHX        0x00800000l
2812
2813 /*
2814  * DirectDraw supports integer stretching (1x,2x,) of a surface
2815  * along the x axis (horizontal direction) for overlays.
2816  */
2817 #define DDFXCAPS_OVERLAYSTRETCHXN       0x01000000l
2818
2819 /*
2820  * DirectDraw supports arbitrary stretching of a surface along the
2821  * y axis (horizontal direction) for overlays.
2822  */
2823 #define DDFXCAPS_OVERLAYSTRETCHY        0x02000000l
2824
2825 /*
2826  * DirectDraw supports integer stretching (1x,2x,) of a surface
2827  * along the y axis (vertical direction) for overlays.
2828  */
2829 #define DDFXCAPS_OVERLAYSTRETCHYN       0x04000000l
2830
2831 /*
2832  * DirectDraw supports mirroring of overlays across the vertical axis
2833  */
2834 #define DDFXCAPS_OVERLAYMIRRORLEFTRIGHT 0x08000000l
2835
2836 /*
2837  * DirectDraw supports mirroring of overlays across the horizontal axis
2838  */
2839 #define DDFXCAPS_OVERLAYMIRRORUPDOWN    0x10000000l
2840
2841 /*
2842  * Driver can do alpha blending for blits.
2843  */
2844 #define DDFXCAPS_BLTALPHA               0x00000001l
2845
2846 /*
2847  * Driver can do geometric transformations (or warps) for blits.
2848  */
2849 #define DDFXCAPS_BLTTRANSFORM           0x00000002l
2850
2851 /*
2852  * Driver can do surface-reconstruction filtering for warped blits.
2853  */
2854 #define DDFXCAPS_BLTFILTER              DDFXCAPS_BLTARITHSTRETCHY
2855
2856 /*
2857  * Driver can do alpha blending for overlays.
2858  */
2859 #define DDFXCAPS_OVERLAYALPHA           0x00000004l
2860
2861 /*
2862  * Driver can do geometric transformations (or warps) for overlays.
2863  */
2864 #define DDFXCAPS_OVERLAYTRANSFORM       0x20000000l
2865
2866 /*
2867  * Driver can do surface-reconstruction filtering for warped overlays.
2868  */
2869 #define DDFXCAPS_OVERLAYFILTER          DDFXCAPS_OVERLAYARITHSTRETCHY
2870
2871
2872 /****************************************************************************
2873  *
2874  * DIRECTDRAW STEREO VIEW CAPABILITIES
2875  *
2876  ****************************************************************************/
2877
2878 /*
2879  * The stereo view is accomplished via enigma encoding.
2880  */
2881 #define DDSVCAPS_ENIGMA                 0x00000001l
2882
2883 /*
2884  * The stereo view is accomplished via high frequency flickering.
2885  */
2886 #define DDSVCAPS_FLICKER                0x00000002l
2887
2888 /*
2889  * The stereo view is accomplished via red and blue filters applied
2890  * to the left and right eyes.  All images must adapt their colorspaces
2891  * for this process.
2892  */
2893 #define DDSVCAPS_REDBLUE                0x00000004l
2894
2895 /*
2896  * The stereo view is accomplished with split screen technology.
2897  */
2898 #define DDSVCAPS_SPLIT                  0x00000008l
2899
2900 /****************************************************************************
2901  *
2902  * DIRECTDRAWPALETTE CAPABILITIES
2903  *
2904  ****************************************************************************/
2905
2906 /*
2907  * Index is 4 bits.  There are sixteen color entries in the palette table.
2908  */
2909 #define DDPCAPS_4BIT                    0x00000001l
2910
2911 /*
2912  * Index is onto a 8 bit color index.  This field is only valid with the
2913  * DDPCAPS_1BIT, DDPCAPS_2BIT or DDPCAPS_4BIT capability and the target
2914  * surface is in 8bpp. Each color entry is one byte long and is an index
2915  * into destination surface's 8bpp palette.
2916  */
2917 #define DDPCAPS_8BITENTRIES             0x00000002l
2918
2919 /*
2920  * Index is 8 bits.  There are 256 color entries in the palette table.
2921  */
2922 #define DDPCAPS_8BIT                    0x00000004l
2923
2924 /*
2925  * Indicates that this DIRECTDRAWPALETTE should use the palette color array
2926  * passed into the lpDDColorArray parameter to initialize the DIRECTDRAWPALETTE
2927  * object.
2928  */
2929 #define DDPCAPS_INITIALIZE              0x00000008l
2930
2931 /*
2932  * This palette is the one attached to the primary surface.  Changing this
2933  * table has immediate effect on the display unless DDPSETPAL_VSYNC is specified
2934  * and supported.
2935  */
2936 #define DDPCAPS_PRIMARYSURFACE          0x00000010l
2937
2938 /*
2939  * This palette is the one attached to the primary surface left.  Changing
2940  * this table has immediate effect on the display for the left eye unless
2941  * DDPSETPAL_VSYNC is specified and supported.
2942  */
2943 #define DDPCAPS_PRIMARYSURFACELEFT      0x00000020l
2944
2945 /*
2946  * This palette can have all 256 entries defined
2947  */
2948 #define DDPCAPS_ALLOW256                0x00000040l
2949
2950 /*
2951  * This palette can have modifications to it synced with the monitors
2952  * refresh rate.
2953  */
2954 #define DDPCAPS_VSYNC                   0x00000080l
2955
2956 /*
2957  * Index is 1 bit.  There are two color entries in the palette table.
2958  */
2959 #define DDPCAPS_1BIT                    0x00000100l
2960
2961 /*
2962  * Index is 2 bit.  There are four color entries in the palette table.
2963  */
2964 #define DDPCAPS_2BIT                    0x00000200l
2965
2966 /*
2967  * The peFlags member of PALETTEENTRY denotes an 8 bit alpha value
2968  */
2969 #define DDPCAPS_ALPHA                   0x00000400l
2970
2971
2972 /****************************************************************************
2973  *
2974  * DIRECTDRAWPALETTE SETENTRY CONSTANTS
2975  *
2976  ****************************************************************************/
2977
2978
2979 /****************************************************************************
2980  *
2981  * DIRECTDRAWPALETTE GETENTRY CONSTANTS
2982  *
2983  ****************************************************************************/
2984
2985 /* 0 is the only legal value */
2986
2987 /****************************************************************************
2988  *
2989  * DIRECTDRAWSURFACE SETPRIVATEDATA CONSTANTS
2990  *
2991  ****************************************************************************/
2992
2993 /*
2994  * The passed pointer is an IUnknown ptr. The cbData argument to SetPrivateData
2995  * must be set to sizeof(IUnknown*). DirectDraw will call AddRef through this
2996  * pointer and Release when the private data is destroyed. This includes when
2997  * the surface or palette is destroyed before such priovate data is destroyed.
2998  */
2999 #define DDSPD_IUNKNOWNPOINTER           0x00000001L
3000
3001 /*
3002  * Private data is only valid for the current state of the object,
3003  * as determined by the uniqueness value.
3004  */
3005 #define DDSPD_VOLATILE                  0x00000002L
3006
3007
3008 /****************************************************************************
3009  *
3010  * DIRECTDRAWSURFACE SETPALETTE CONSTANTS
3011  *
3012  ****************************************************************************/
3013
3014
3015 /****************************************************************************
3016  *
3017  * DIRECTDRAW BITDEPTH CONSTANTS
3018  *
3019  * NOTE:  These are only used to indicate supported bit depths.   These
3020  * are flags only, they are not to be used as an actual bit depth.   The
3021  * absolute numbers 1, 2, 4, 8, 16, 24 and 32 are used to indicate actual
3022  * bit depths in a surface or for changing the display mode.
3023  *
3024  ****************************************************************************/
3025
3026 /*
3027  * 1 bit per pixel.
3028  */
3029 #define DDBD_1                  0x00004000l
3030
3031 /*
3032  * 2 bits per pixel.
3033  */
3034 #define DDBD_2                  0x00002000l
3035
3036 /*
3037  * 4 bits per pixel.
3038  */
3039 #define DDBD_4                  0x00001000l
3040
3041 /*
3042  * 8 bits per pixel.
3043  */
3044 #define DDBD_8                  0x00000800l
3045
3046 /*
3047  * 16 bits per pixel.
3048  */
3049 #define DDBD_16                 0x00000400l
3050
3051 /*
3052  * 24 bits per pixel.
3053  */
3054 #define DDBD_24                 0X00000200l
3055
3056 /*
3057  * 32 bits per pixel.
3058  */
3059 #define DDBD_32                 0x00000100l
3060
3061 /****************************************************************************
3062  *
3063  * DIRECTDRAWSURFACE SET/GET COLOR KEY FLAGS
3064  *
3065  ****************************************************************************/
3066
3067 /*
3068  * Set if the structure contains a color space.  Not set if the structure
3069  * contains a single color key.
3070  */
3071 #define DDCKEY_COLORSPACE       0x00000001l
3072
3073 /*
3074  * Set if the structure specifies a color key or color space which is to be
3075  * used as a destination color key for blt operations.
3076  */
3077 #define DDCKEY_DESTBLT          0x00000002l
3078
3079 /*
3080  * Set if the structure specifies a color key or color space which is to be
3081  * used as a destination color key for overlay operations.
3082  */
3083 #define DDCKEY_DESTOVERLAY      0x00000004l
3084
3085 /*
3086  * Set if the structure specifies a color key or color space which is to be
3087  * used as a source color key for blt operations.
3088  */
3089 #define DDCKEY_SRCBLT           0x00000008l
3090
3091 /*
3092  * Set if the structure specifies a color key or color space which is to be
3093  * used as a source color key for overlay operations.
3094  */
3095 #define DDCKEY_SRCOVERLAY       0x00000010l
3096
3097
3098 /****************************************************************************
3099  *
3100  * DIRECTDRAW COLOR KEY CAPABILITY FLAGS
3101  *
3102  ****************************************************************************/
3103
3104 /*
3105  * Supports transparent blting using a color key to identify the replaceable
3106  * bits of the destination surface for RGB colors.
3107  */
3108 #define DDCKEYCAPS_DESTBLT                      0x00000001l
3109
3110 /*
3111  * Supports transparent blting using a color space to identify the replaceable
3112  * bits of the destination surface for RGB colors.
3113  */
3114 #define DDCKEYCAPS_DESTBLTCLRSPACE              0x00000002l
3115
3116 /*
3117  * Supports transparent blting using a color space to identify the replaceable
3118  * bits of the destination surface for YUV colors.
3119  */
3120 #define DDCKEYCAPS_DESTBLTCLRSPACEYUV           0x00000004l
3121
3122 /*
3123  * Supports transparent blting using a color key to identify the replaceable
3124  * bits of the destination surface for YUV colors.
3125  */
3126 #define DDCKEYCAPS_DESTBLTYUV                   0x00000008l
3127
3128 /*
3129  * Supports overlaying using colorkeying of the replaceable bits of the surface
3130  * being overlayed for RGB colors.
3131  */
3132 #define DDCKEYCAPS_DESTOVERLAY                  0x00000010l
3133
3134 /*
3135  * Supports a color space as the color key for the destination for RGB colors.
3136  */
3137 #define DDCKEYCAPS_DESTOVERLAYCLRSPACE          0x00000020l
3138
3139 /*
3140  * Supports a color space as the color key for the destination for YUV colors.
3141  */
3142 #define DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV       0x00000040l
3143
3144 /*
3145  * Supports only one active destination color key value for visible overlay
3146  * surfaces.
3147  */
3148 #define DDCKEYCAPS_DESTOVERLAYONEACTIVE         0x00000080l
3149
3150 /*
3151  * Supports overlaying using colorkeying of the replaceable bits of the
3152  * surface being overlayed for YUV colors.
3153  */
3154 #define DDCKEYCAPS_DESTOVERLAYYUV               0x00000100l
3155
3156 /*
3157  * Supports transparent blting using the color key for the source with
3158  * this surface for RGB colors.
3159  */
3160 #define DDCKEYCAPS_SRCBLT                       0x00000200l
3161
3162 /*
3163  * Supports transparent blting using a color space for the source with
3164  * this surface for RGB colors.
3165  */
3166 #define DDCKEYCAPS_SRCBLTCLRSPACE               0x00000400l
3167
3168 /*
3169  * Supports transparent blting using a color space for the source with
3170  * this surface for YUV colors.
3171  */
3172 #define DDCKEYCAPS_SRCBLTCLRSPACEYUV            0x00000800l
3173
3174 /*
3175  * Supports transparent blting using the color key for the source with
3176  * this surface for YUV colors.
3177  */
3178 #define DDCKEYCAPS_SRCBLTYUV                    0x00001000l
3179
3180 /*
3181  * Supports overlays using the color key for the source with this
3182  * overlay surface for RGB colors.
3183  */
3184 #define DDCKEYCAPS_SRCOVERLAY                   0x00002000l
3185
3186 /*
3187  * Supports overlays using a color space as the source color key for
3188  * the overlay surface for RGB colors.
3189  */
3190 #define DDCKEYCAPS_SRCOVERLAYCLRSPACE           0x00004000l
3191
3192 /*
3193  * Supports overlays using a color space as the source color key for
3194  * the overlay surface for YUV colors.
3195  */
3196 #define DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV        0x00008000l
3197
3198 /*
3199  * Supports only one active source color key value for visible
3200  * overlay surfaces.
3201  */
3202 #define DDCKEYCAPS_SRCOVERLAYONEACTIVE          0x00010000l
3203
3204 /*
3205  * Supports overlays using the color key for the source with this
3206  * overlay surface for YUV colors.
3207  */
3208 #define DDCKEYCAPS_SRCOVERLAYYUV                0x00020000l
3209
3210 /*
3211  * there are no bandwidth trade-offs for using colorkey with an overlay
3212  */
3213 #define DDCKEYCAPS_NOCOSTOVERLAY                0x00040000l
3214
3215
3216 /****************************************************************************
3217  *
3218  * DIRECTDRAW PIXELFORMAT FLAGS
3219  *
3220  ****************************************************************************/
3221
3222 /*
3223  * The surface has alpha channel information in the pixel format.
3224  */
3225 #define DDPF_ALPHAPIXELS                        0x00000001l
3226
3227 /*
3228  * The pixel format contains alpha only information
3229  */
3230 #define DDPF_ALPHA                              0x00000002l
3231
3232 /*
3233  * The FourCC code is valid.
3234  */
3235 #define DDPF_FOURCC                             0x00000004l
3236
3237 /*
3238  * The surface is 4-bit color indexed.
3239  */
3240 #define DDPF_PALETTEINDEXED4                    0x00000008l
3241
3242 /*
3243  * The surface is indexed into a palette which stores indices
3244  * into the destination surface's 8-bit palette.
3245  */
3246 #define DDPF_PALETTEINDEXEDTO8                  0x00000010l
3247
3248 /*
3249  * The surface is 8-bit color indexed.
3250  */
3251 #define DDPF_PALETTEINDEXED8                    0x00000020l
3252
3253 /*
3254  * The RGB data in the pixel format structure is valid.
3255  */
3256 #define DDPF_RGB                                0x00000040l
3257
3258 /*
3259  * The surface will accept pixel data in the format specified
3260  * and compress it during the write.
3261  */
3262 #define DDPF_COMPRESSED                         0x00000080l
3263
3264 /*
3265  * The surface will accept RGB data and translate it during
3266  * the write to YUV data.  The format of the data to be written