]> git.xonotic.org Git - xonotic/xonotic.git/blob - misc/builddeps/dp.win64/include/ddraw.h
dp.win64 build dependencies beginning (lacks SDL still)
[xonotic/xonotic.git] / misc / builddeps / dp.win64 / 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
3267  * will be contained in the pixel format structure.  The DDPF_RGB
3268  * flag will be set.
3269  */
3270 #define DDPF_RGBTOYUV                           0x00000100l
3271
3272 /*
3273  * pixel format is YUV - YUV data in pixel format struct is valid
3274  */
3275 #define DDPF_YUV                                0x00000200l
3276
3277 /*
3278  * pixel format is a z buffer only surface
3279  */
3280 #define DDPF_ZBUFFER                            0x00000400l
3281
3282 /*
3283  * The surface is 1-bit color indexed.
3284  */
3285 #define DDPF_PALETTEINDEXED1                    0x00000800l
3286
3287 /*
3288  * The surface is 2-bit color indexed.
3289  */
3290 #define DDPF_PALETTEINDEXED2                    0x00001000l
3291
3292 /*
3293  * The surface contains Z information in the pixels
3294  */
3295 #define DDPF_ZPIXELS                            0x00002000l
3296
3297 /*
3298  * The surface contains stencil information along with Z
3299  */
3300 #define DDPF_STENCILBUFFER                      0x00004000l
3301
3302 /*
3303  * Premultiplied alpha format -- the color components have been
3304  * premultiplied by the alpha component.
3305  */
3306 #define DDPF_ALPHAPREMULT                       0x00008000l
3307
3308
3309 /*
3310  * Luminance data in the pixel format is valid.
3311  * Use this flag for luminance-only or luminance+alpha surfaces,
3312  * the bit depth is then ddpf.dwLuminanceBitCount.
3313  */
3314 #define DDPF_LUMINANCE                          0x00020000l
3315
3316 /*
3317  * Luminance data in the pixel format is valid.
3318  * Use this flag when hanging luminance off bumpmap surfaces,
3319  * the bit mask for the luminance portion of the pixel is then
3320  * ddpf.dwBumpLuminanceBitMask
3321  */
3322 #define DDPF_BUMPLUMINANCE                      0x00040000l
3323
3324 /*
3325  * Bump map dUdV data in the pixel format is valid.
3326  */
3327 #define DDPF_BUMPDUDV                           0x00080000l
3328
3329 /*===========================================================================
3330  *
3331  *
3332  * DIRECTDRAW CALLBACK FLAGS
3333  *
3334  *
3335  *==========================================================================*/
3336
3337 /****************************************************************************
3338  *
3339  * DIRECTDRAW ENUMSURFACES FLAGS
3340  *
3341  ****************************************************************************/
3342
3343 /*
3344  * Enumerate all of the surfaces that meet the search criterion.
3345  */
3346 #define DDENUMSURFACES_ALL                      0x00000001l
3347
3348 /*
3349  * A search hit is a surface that matches the surface description.
3350  */
3351 #define DDENUMSURFACES_MATCH                    0x00000002l
3352
3353 /*
3354  * A search hit is a surface that does not match the surface description.
3355  */
3356 #define DDENUMSURFACES_NOMATCH                  0x00000004l
3357
3358 /*
3359  * Enumerate the first surface that can be created which meets the search criterion.
3360  */
3361 #define DDENUMSURFACES_CANBECREATED             0x00000008l
3362
3363 /*
3364  * Enumerate the surfaces that already exist that meet the search criterion.
3365  */
3366 #define DDENUMSURFACES_DOESEXIST                0x00000010l
3367
3368
3369 /****************************************************************************
3370  *
3371  * DIRECTDRAW SETDISPLAYMODE FLAGS
3372  *
3373  ****************************************************************************/
3374
3375 /*
3376  * The desired mode is a standard VGA mode
3377  */
3378 #define DDSDM_STANDARDVGAMODE                   0x00000001l
3379
3380
3381
3382 /****************************************************************************
3383  *
3384  * DIRECTDRAW ENUMDISPLAYMODES FLAGS
3385  *
3386  ****************************************************************************/
3387
3388 /*
3389  * Enumerate Modes with different refresh rates.  EnumDisplayModes guarantees
3390  * that a particular mode will be enumerated only once.  This flag specifies whether
3391  * the refresh rate is taken into account when determining if a mode is unique.
3392  */
3393 #define DDEDM_REFRESHRATES                      0x00000001l
3394
3395 /*
3396  * Enumerate VGA modes. Specify this flag if you wish to enumerate supported VGA
3397  * modes such as mode 0x13 in addition to the usual ModeX modes (which are always
3398  * enumerated if the application has previously called SetCooperativeLevel with the
3399  * DDSCL_ALLOWMODEX flag set).
3400  */
3401 #define DDEDM_STANDARDVGAMODES                  0x00000002L
3402
3403
3404 /****************************************************************************
3405  *
3406  * DIRECTDRAW SETCOOPERATIVELEVEL FLAGS
3407  *
3408  ****************************************************************************/
3409
3410 /*
3411  * Exclusive mode owner will be responsible for the entire primary surface.
3412  * GDI can be ignored. used with DD
3413  */
3414 #define DDSCL_FULLSCREEN                        0x00000001l
3415
3416 /*
3417  * allow CTRL_ALT_DEL to work while in fullscreen exclusive mode
3418  */
3419 #define DDSCL_ALLOWREBOOT                       0x00000002l
3420
3421 /*
3422  * prevents DDRAW from modifying the application window.
3423  * prevents DDRAW from minimize/restore the application window on activation.
3424  */
3425 #define DDSCL_NOWINDOWCHANGES                   0x00000004l
3426
3427 /*
3428  * app wants to work as a regular Windows application
3429  */
3430 #define DDSCL_NORMAL                            0x00000008l
3431
3432 /*
3433  * app wants exclusive access
3434  */
3435 #define DDSCL_EXCLUSIVE                         0x00000010l
3436
3437
3438 /*
3439  * app can deal with non-windows display modes
3440  */
3441 #define DDSCL_ALLOWMODEX                        0x00000040l
3442
3443 /*
3444  * this window will receive the focus messages
3445  */
3446 #define DDSCL_SETFOCUSWINDOW                    0x00000080l
3447
3448 /*
3449  * this window is associated with the DDRAW object and will
3450  * cover the screen in fullscreen mode
3451  */
3452 #define DDSCL_SETDEVICEWINDOW                   0x00000100l
3453
3454 /*
3455  * app wants DDRAW to create a window to be associated with the
3456  * DDRAW object
3457  */
3458 #define DDSCL_CREATEDEVICEWINDOW                0x00000200l
3459
3460 /*
3461  * App explicitly asks DDRAW/D3D to be multithread safe. This makes D3D
3462  * take the global crtisec more frequently.
3463  */
3464 #define DDSCL_MULTITHREADED                     0x00000400l
3465
3466 /*
3467  * App hints that it would like to keep the FPU set up for optimal Direct3D
3468  * performance (single precision and exceptions disabled) so Direct3D
3469  * does not need to explicitly set the FPU each time
3470  */
3471 #define DDSCL_FPUSETUP                          0x00000800l
3472
3473
3474 /****************************************************************************
3475  *
3476  * DIRECTDRAW BLT FLAGS
3477  *
3478  ****************************************************************************/
3479
3480 /*
3481  * Use the alpha information in the pixel format or the alpha channel surface
3482  * attached to the destination surface as the alpha channel for this blt.
3483  */
3484 #define DDBLT_ALPHADEST                         0x00000001l
3485
3486 /*
3487  * Use the dwConstAlphaDest field in the DDBLTFX structure as the alpha channel
3488  * for the destination surface for this blt.
3489  */
3490 #define DDBLT_ALPHADESTCONSTOVERRIDE            0x00000002l
3491
3492 /*
3493  * The NEG suffix indicates that the destination surface becomes more
3494  * transparent as the alpha value increases. (0 is opaque)
3495  */
3496 #define DDBLT_ALPHADESTNEG                      0x00000004l
3497
3498 /*
3499  * Use the lpDDSAlphaDest field in the DDBLTFX structure as the alpha
3500  * channel for the destination for this blt.
3501  */
3502 #define DDBLT_ALPHADESTSURFACEOVERRIDE          0x00000008l
3503
3504 /*
3505  * Use the dwAlphaEdgeBlend field in the DDBLTFX structure as the alpha channel
3506  * for the edges of the image that border the color key colors.
3507  */
3508 #define DDBLT_ALPHAEDGEBLEND                    0x00000010l
3509
3510 /*
3511  * Use the alpha information in the pixel format or the alpha channel surface
3512  * attached to the source surface as the alpha channel for this blt.
3513  */
3514 #define DDBLT_ALPHASRC                          0x00000020l
3515
3516 /*
3517  * Use the dwConstAlphaSrc field in the DDBLTFX structure as the alpha channel
3518  * for the source for this blt.
3519  */
3520 #define DDBLT_ALPHASRCCONSTOVERRIDE             0x00000040l
3521
3522 /*
3523  * The NEG suffix indicates that the source surface becomes more transparent
3524  * as the alpha value increases. (0 is opaque)
3525  */
3526 #define DDBLT_ALPHASRCNEG                       0x00000080l
3527
3528 /*
3529  * Use the lpDDSAlphaSrc field in the DDBLTFX structure as the alpha channel
3530  * for the source for this blt.
3531  */
3532 #define DDBLT_ALPHASRCSURFACEOVERRIDE           0x00000100l
3533
3534 /*
3535  * Do this blt asynchronously through the FIFO in the order received.  If
3536  * there is no room in the hardware FIFO fail the call.
3537  */
3538 #define DDBLT_ASYNC                             0x00000200l
3539
3540 /*
3541  * Uses the dwFillColor field in the DDBLTFX structure as the RGB color
3542  * to fill the destination rectangle on the destination surface with.
3543  */
3544 #define DDBLT_COLORFILL                         0x00000400l
3545
3546 /*
3547  * Uses the dwDDFX field in the DDBLTFX structure to specify the effects
3548  * to use for the blt.
3549  */
3550 #define DDBLT_DDFX                              0x00000800l
3551
3552 /*
3553  * Uses the dwDDROPS field in the DDBLTFX structure to specify the ROPS
3554  * that are not part of the Win32 API.
3555  */
3556 #define DDBLT_DDROPS                            0x00001000l
3557
3558 /*
3559  * Use the color key associated with the destination surface.
3560  */
3561 #define DDBLT_KEYDEST                           0x00002000l
3562
3563 /*
3564  * Use the dckDestColorkey field in the DDBLTFX structure as the color key
3565  * for the destination surface.
3566  */
3567 #define DDBLT_KEYDESTOVERRIDE                   0x00004000l
3568
3569 /*
3570  * Use the color key associated with the source surface.
3571  */
3572 #define DDBLT_KEYSRC                            0x00008000l
3573
3574 /*
3575  * Use the dckSrcColorkey field in the DDBLTFX structure as the color key
3576  * for the source surface.
3577  */
3578 #define DDBLT_KEYSRCOVERRIDE                    0x00010000l
3579
3580 /*
3581  * Use the dwROP field in the DDBLTFX structure for the raster operation
3582  * for this blt.  These ROPs are the same as the ones defined in the Win32 API.
3583  */
3584 #define DDBLT_ROP                               0x00020000l
3585
3586 /*
3587  * Use the dwRotationAngle field in the DDBLTFX structure as the angle
3588  * (specified in 1/100th of a degree) to rotate the surface.
3589  */
3590 #define DDBLT_ROTATIONANGLE                     0x00040000l
3591
3592 /*
3593  * Z-buffered blt using the z-buffers attached to the source and destination
3594  * surfaces and the dwZBufferOpCode field in the DDBLTFX structure as the
3595  * z-buffer opcode.
3596  */
3597 #define DDBLT_ZBUFFER                           0x00080000l
3598
3599 /*
3600  * Z-buffered blt using the dwConstDest Zfield and the dwZBufferOpCode field
3601  * in the DDBLTFX structure as the z-buffer and z-buffer opcode respectively
3602  * for the destination.
3603  */
3604 #define DDBLT_ZBUFFERDESTCONSTOVERRIDE          0x00100000l
3605
3606 /*
3607  * Z-buffered blt using the lpDDSDestZBuffer field and the dwZBufferOpCode
3608  * field in the DDBLTFX structure as the z-buffer and z-buffer opcode
3609  * respectively for the destination.
3610  */
3611 #define DDBLT_ZBUFFERDESTOVERRIDE               0x00200000l
3612
3613 /*
3614  * Z-buffered blt using the dwConstSrcZ field and the dwZBufferOpCode field
3615  * in the DDBLTFX structure as the z-buffer and z-buffer opcode respectively
3616  * for the source.
3617  */
3618 #define DDBLT_ZBUFFERSRCCONSTOVERRIDE           0x00400000l
3619
3620 /*
3621  * Z-buffered blt using the lpDDSSrcZBuffer field and the dwZBufferOpCode
3622  * field in the DDBLTFX structure as the z-buffer and z-buffer opcode
3623  * respectively for the source.
3624  */
3625 #define DDBLT_ZBUFFERSRCOVERRIDE                0x00800000l
3626
3627 /*
3628  * wait until the device is ready to handle the blt
3629  * this will cause blt to not return DDERR_WASSTILLDRAWING
3630  */
3631 #define DDBLT_WAIT                              0x01000000l
3632
3633 /*
3634  * Uses the dwFillDepth field in the DDBLTFX structure as the depth value
3635  * to fill the destination rectangle on the destination Z-buffer surface
3636  * with.
3637  */
3638 #define DDBLT_DEPTHFILL                         0x02000000l
3639
3640
3641 /****************************************************************************
3642  *
3643  * BLTFAST FLAGS
3644  *
3645  ****************************************************************************/
3646
3647 #define DDBLTFAST_NOCOLORKEY                    0x00000000
3648 #define DDBLTFAST_SRCCOLORKEY                   0x00000001
3649 #define DDBLTFAST_DESTCOLORKEY                  0x00000002
3650 #define DDBLTFAST_WAIT                          0x00000010
3651
3652
3653
3654
3655 /****************************************************************************
3656  *
3657  * FLIP FLAGS
3658  *
3659  ****************************************************************************/
3660
3661 #define DDFLIP_WAIT                          0x00000001L
3662
3663 /*
3664  * Indicates that the target surface contains the even field of video data.
3665  * This flag is only valid with an overlay surface.
3666  */
3667 #define DDFLIP_EVEN                          0x00000002L
3668
3669 /*
3670  * Indicates that the target surface contains the odd field of video data.
3671  * This flag is only valid with an overlay surface.
3672  */
3673 #define DDFLIP_ODD                           0x00000004L
3674
3675 /*
3676  * Causes DirectDraw to perform the physical flip immediately and return
3677  * to the application. Typically, what was the front buffer but is now the back
3678  * buffer will still be visible (depending on timing) until the next vertical 
3679  * retrace. Subsequent operations involving the two flipped surfaces will
3680  * not check to see if the physical flip has finished (i.e. will not return
3681  * DDERR_WASSTILLDRAWING for that reason (but may for other reasons)).
3682  * This allows an application to perform Flips at a higher frequency than the
3683  * monitor refresh rate, but may introduce visible artifacts.
3684  * Only effective if DDCAPS2_FLIPNOVSYNC is set. If that bit is not set, 
3685  * DDFLIP_NOVSYNC has no effect.
3686  */
3687 #define DDFLIP_NOVSYNC                       0x00000008L
3688
3689
3690 /*
3691  * Flip Interval Flags. These flags indicate how many vertical retraces to wait between
3692  * each flip. The default is one. DirectDraw will return DDERR_WASSTILLDRAWING for each
3693  * surface involved in the flip until the specified number of vertical retraces has
3694  * ocurred. Only effective if DDCAPS2_FLIPINTERVAL is set. If that bit is not set, 
3695  * DDFLIP_INTERVALn has no effect.
3696  */
3697
3698 /*
3699  * DirectDraw will flip on every other vertical sync
3700  */
3701 #define DDFLIP_INTERVAL2                     0x02000000L
3702
3703
3704 /*
3705  * DirectDraw will flip on every third vertical sync
3706  */
3707 #define DDFLIP_INTERVAL3                     0x03000000L
3708
3709
3710 /*
3711  * DirectDraw will flip on every fourth vertical sync
3712  */
3713 #define DDFLIP_INTERVAL4                     0x04000000L
3714
3715
3716
3717 /****************************************************************************
3718  *
3719  * DIRECTDRAW SURFACE OVERLAY FLAGS
3720  *
3721  ****************************************************************************/
3722
3723 /*
3724  * Use the alpha information in the pixel format or the alpha channel surface
3725  * attached to the destination surface as the alpha channel for the
3726  * destination overlay.
3727  */
3728 #define DDOVER_ALPHADEST                        0x00000001l
3729
3730 /*
3731  * Use the dwConstAlphaDest field in the DDOVERLAYFX structure as the
3732  * destination alpha channel for this overlay.
3733  */
3734 #define DDOVER_ALPHADESTCONSTOVERRIDE           0x00000002l
3735
3736 /*
3737  * The NEG suffix indicates that the destination surface becomes more
3738  * transparent as the alpha value increases.
3739  */
3740 #define DDOVER_ALPHADESTNEG                     0x00000004l
3741
3742 /*
3743  * Use the lpDDSAlphaDest field in the DDOVERLAYFX structure as the alpha
3744  * channel destination for this overlay.
3745  */
3746 #define DDOVER_ALPHADESTSURFACEOVERRIDE         0x00000008l
3747
3748 /*
3749  * Use the dwAlphaEdgeBlend field in the DDOVERLAYFX structure as the alpha
3750  * channel for the edges of the image that border the color key colors.
3751  */
3752 #define DDOVER_ALPHAEDGEBLEND                   0x00000010l
3753
3754 /*
3755  * Use the alpha information in the pixel format or the alpha channel surface
3756  * attached to the source surface as the source alpha channel for this overlay.
3757  */
3758 #define DDOVER_ALPHASRC                         0x00000020l
3759
3760 /*
3761  * Use the dwConstAlphaSrc field in the DDOVERLAYFX structure as the source
3762  * alpha channel for this overlay.
3763  */
3764 #define DDOVER_ALPHASRCCONSTOVERRIDE            0x00000040l
3765
3766 /*
3767  * The NEG suffix indicates that the source surface becomes more transparent
3768  * as the alpha value increases.
3769  */
3770 #define DDOVER_ALPHASRCNEG                      0x00000080l
3771
3772 /*
3773  * Use the lpDDSAlphaSrc field in the DDOVERLAYFX structure as the alpha channel
3774  * source for this overlay.
3775  */
3776 #define DDOVER_ALPHASRCSURFACEOVERRIDE          0x00000100l
3777
3778 /*
3779  * Turn this overlay off.
3780  */
3781 #define DDOVER_HIDE                             0x00000200l
3782
3783 /*
3784  * Use the color key associated with the destination surface.
3785  */
3786 #define DDOVER_KEYDEST                          0x00000400l
3787
3788 /*
3789  * Use the dckDestColorkey field in the DDOVERLAYFX structure as the color key
3790  * for the destination surface
3791  */
3792 #define DDOVER_KEYDESTOVERRIDE                  0x00000800l
3793
3794 /*
3795  * Use the color key associated with the source surface.
3796  */
3797 #define DDOVER_KEYSRC                           0x00001000l
3798
3799 /*
3800  * Use the dckSrcColorkey field in the DDOVERLAYFX structure as the color key
3801  * for the source surface.
3802  */
3803 #define DDOVER_KEYSRCOVERRIDE                   0x00002000l
3804
3805 /*
3806  * Turn this overlay on.
3807  */
3808 #define DDOVER_SHOW                             0x00004000l
3809
3810 /*
3811  * Add a dirty rect to an emulated overlayed surface.
3812  */
3813 #define DDOVER_ADDDIRTYRECT                     0x00008000l
3814
3815 /*
3816  * Redraw all dirty rects on an emulated overlayed surface.
3817  */
3818 #define DDOVER_REFRESHDIRTYRECTS                0x00010000l
3819
3820 /*
3821  * Redraw the entire surface on an emulated overlayed surface.
3822  */
3823 #define DDOVER_REFRESHALL                      0x00020000l
3824
3825
3826 /*
3827  * Use the overlay FX flags to define special overlay FX
3828  */
3829 #define DDOVER_DDFX                             0x00080000l
3830
3831 /*
3832  * Autoflip the overlay when ever the video port autoflips
3833  */
3834 #define DDOVER_AUTOFLIP                         0x00100000l
3835
3836 /*
3837  * Display each field of video port data individually without
3838  * causing any jittery artifacts
3839  */
3840 #define DDOVER_BOB                              0x00200000l
3841
3842 /*
3843  * Indicates that bob/weave decisions should not be overridden by other
3844  * interfaces.
3845  */
3846 #define DDOVER_OVERRIDEBOBWEAVE                 0x00400000l
3847
3848 /*
3849  * Indicates that the surface memory is composed of interleaved fields.
3850  */
3851 #define DDOVER_INTERLEAVED                      0x00800000l
3852
3853 /*
3854  * Indicates that bob will be performed using hardware rather than
3855  * software or emulated.
3856  */
3857 #define DDOVER_BOBHARDWARE                      0x01000000l
3858
3859
3860
3861
3862
3863
3864
3865
3866 /****************************************************************************
3867  *
3868  * DIRECTDRAWSURFACE LOCK FLAGS
3869  *
3870  ****************************************************************************/
3871
3872 /*
3873  * The default.  Set to indicate that Lock should return a valid memory pointer
3874  * to the top of the specified rectangle.  If no rectangle is specified then a
3875  * pointer to the top of the surface is returned.
3876  */
3877 #define DDLOCK_SURFACEMEMORYPTR                 0x00000000L     // default
3878
3879 /*
3880  * Set to indicate that Lock should wait until it can obtain a valid memory
3881  * pointer before returning.  If this bit is set, Lock will never return
3882  * DDERR_WASSTILLDRAWING.
3883  */
3884 #define DDLOCK_WAIT                             0x00000001L
3885
3886 /*
3887  * Set if an event handle is being passed to Lock.  Lock will trigger the event
3888  * when it can return the surface memory pointer requested.
3889  */
3890 #define DDLOCK_EVENT                            0x00000002L
3891
3892 /*
3893  * Indicates that the surface being locked will only be read from.
3894  */
3895 #define DDLOCK_READONLY                         0x00000010L
3896
3897 /*
3898  * Indicates that the surface being locked will only be written to
3899  */
3900 #define DDLOCK_WRITEONLY                        0x00000020L
3901
3902
3903 /*
3904  * Indicates that a system wide lock should not be taken when this surface
3905  * is locked. This has several advantages (cursor responsiveness, ability
3906  * to call more Windows functions, easier debugging) when locking video
3907  * memory surfaces. However, an application specifying this flag must
3908  * comply with a number of conditions documented in the help file.
3909  * Furthermore, this flag cannot be specified when locking the primary.
3910  */
3911 #define DDLOCK_NOSYSLOCK                        0x00000800L
3912
3913
3914 /****************************************************************************
3915  *
3916  * DIRECTDRAWSURFACE PAGELOCK FLAGS
3917  *
3918  ****************************************************************************/
3919
3920 /*
3921  * No flags defined at present
3922  */
3923
3924
3925 /****************************************************************************
3926  *
3927  * DIRECTDRAWSURFACE PAGEUNLOCK FLAGS
3928  *
3929  ****************************************************************************/
3930
3931 /*
3932  * No flags defined at present
3933  */
3934
3935
3936 /****************************************************************************
3937  *
3938  * DIRECTDRAWSURFACE BLT FX FLAGS
3939  *
3940  ****************************************************************************/
3941
3942 /*
3943  * If stretching, use arithmetic stretching along the Y axis for this blt.
3944  */
3945 #define DDBLTFX_ARITHSTRETCHY                   0x00000001l
3946
3947 /*
3948  * Do this blt mirroring the surface left to right.  Spin the
3949  * surface around its y-axis.
3950  */
3951 #define DDBLTFX_MIRRORLEFTRIGHT                 0x00000002l
3952
3953 /*
3954  * Do this blt mirroring the surface up and down.  Spin the surface
3955  * around its x-axis.
3956  */
3957 #define DDBLTFX_MIRRORUPDOWN                    0x00000004l
3958
3959 /*
3960  * Schedule this blt to avoid tearing.
3961  */
3962 #define DDBLTFX_NOTEARING                       0x00000008l
3963
3964 /*
3965  * Do this blt rotating the surface one hundred and eighty degrees.
3966  */
3967 #define DDBLTFX_ROTATE180                       0x00000010l
3968
3969 /*
3970  * Do this blt rotating the surface two hundred and seventy degrees.
3971  */
3972 #define DDBLTFX_ROTATE270                       0x00000020l
3973
3974 /*
3975  * Do this blt rotating the surface ninety degrees.
3976  */
3977 #define DDBLTFX_ROTATE90                        0x00000040l
3978
3979 /*
3980  * Do this z blt using dwZBufferLow and dwZBufferHigh as  range values
3981  * specified to limit the bits copied from the source surface.
3982  */
3983 #define DDBLTFX_ZBUFFERRANGE                    0x00000080l
3984
3985 /*
3986  * Do this z blt adding the dwZBufferBaseDest to each of the sources z values
3987  * before comparing it with the desting z values.
3988  */
3989 #define DDBLTFX_ZBUFFERBASEDEST                 0x00000100l
3990
3991 /****************************************************************************
3992  *
3993  * DIRECTDRAWSURFACE OVERLAY FX FLAGS
3994  *
3995  ****************************************************************************/
3996
3997 /*
3998  * If stretching, use arithmetic stretching along the Y axis for this overlay.
3999  */
4000 #define DDOVERFX_ARITHSTRETCHY                  0x00000001l
4001
4002 /*
4003  * Mirror the overlay across the vertical axis
4004  */
4005 #define DDOVERFX_MIRRORLEFTRIGHT                0x00000002l
4006
4007 /*
4008  * Mirror the overlay across the horizontal axis
4009  */
4010 #define DDOVERFX_MIRRORUPDOWN                   0x00000004l
4011
4012 /****************************************************************************
4013  *
4014  * Flags for dwDDFX member of DDSPRITEFX structure
4015  *
4016  ****************************************************************************/
4017 /*
4018  * Use affine transformation matrix in fTransform member.
4019  */
4020 #define DDSPRITEFX_AFFINETRANSFORM              0x00000001l
4021
4022 /*
4023  * Use RGBA scaling factors in ddrgbaScaleFactors member.
4024  */
4025 #define DDSPRITEFX_RGBASCALING                  0x00000002l
4026
4027 /*
4028  * Degrade RGBA scaling factors to accommodate driver's capabilities.
4029  */
4030 #define DDSPRITEFX_DEGRADERGBASCALING           0x00000004l
4031
4032 /*
4033  * Do bilinear filtering of stretched or warped sprite.
4034  */
4035 #define DDSPRITEFX_BILINEARFILTER               0x00000008l
4036
4037 /*
4038  * Do "blur" filtering of stretched or warped sprite.
4039  */
4040 #define DDSPRITEFX_BLURFILTER                   0x00000010l
4041
4042 /*
4043  * Do "flat" filtering of stretched or warped sprite.
4044  */
4045 #define DDSPRITEFX_FLATFILTER                   0x00000020l
4046
4047 /*
4048  * Degrade filtering operation to accommodate driver's capabilities.
4049  */
4050 #define DDSPRITEFX_DEGRADEFILTER                0x00000040l
4051
4052
4053 /****************************************************************************
4054  *
4055  * DIRECTDRAW WAITFORVERTICALBLANK FLAGS
4056  *
4057  ****************************************************************************/
4058
4059 /*
4060  * return when the vertical blank interval begins
4061  */
4062 #define DDWAITVB_BLOCKBEGIN                     0x00000001l
4063
4064 /*
4065  * set up an event to trigger when the vertical blank begins
4066  */
4067 #define DDWAITVB_BLOCKBEGINEVENT                0x00000002l
4068
4069 /*
4070  * return when the vertical blank interval ends and display begins
4071  */
4072 #define DDWAITVB_BLOCKEND                       0x00000004l
4073
4074 /****************************************************************************
4075  *
4076  * DIRECTDRAW GETFLIPSTATUS FLAGS
4077  *
4078  ****************************************************************************/
4079
4080 /*
4081  * is it OK to flip now?
4082  */
4083 #define DDGFS_CANFLIP                   0x00000001l
4084
4085 /*
4086  * is the last flip finished?
4087  */
4088 #define DDGFS_ISFLIPDONE                0x00000002l
4089
4090 /****************************************************************************
4091  *
4092  * DIRECTDRAW GETBLTSTATUS FLAGS
4093  *
4094  ****************************************************************************/
4095
4096 /*
4097  * is it OK to blt now?
4098  */
4099 #define DDGBS_CANBLT                    0x00000001l
4100
4101 /*
4102  * is the blt to the surface finished?
4103  */
4104 #define DDGBS_ISBLTDONE                 0x00000002l
4105
4106
4107 /****************************************************************************
4108  *
4109  * DIRECTDRAW ENUMOVERLAYZORDER FLAGS
4110  *
4111  ****************************************************************************/
4112
4113 /*
4114  * Enumerate overlays back to front.
4115  */
4116 #define DDENUMOVERLAYZ_BACKTOFRONT      0x00000000l
4117
4118 /*
4119  * Enumerate overlays front to back
4120  */
4121 #define DDENUMOVERLAYZ_FRONTTOBACK      0x00000001l
4122
4123 /****************************************************************************
4124  *
4125  * DIRECTDRAW UPDATEOVERLAYZORDER FLAGS
4126  *
4127  ****************************************************************************/
4128
4129 /*
4130  * Send overlay to front
4131  */
4132 #define DDOVERZ_SENDTOFRONT             0x00000000l
4133
4134 /*
4135  * Send overlay to back
4136  */
4137 #define DDOVERZ_SENDTOBACK              0x00000001l
4138
4139 /*
4140  * Move Overlay forward
4141  */
4142 #define DDOVERZ_MOVEFORWARD             0x00000002l
4143
4144 /*
4145  * Move Overlay backward
4146  */
4147 #define DDOVERZ_MOVEBACKWARD            0x00000003l
4148
4149 /*
4150  * Move Overlay in front of relative surface
4151  */
4152 #define DDOVERZ_INSERTINFRONTOF         0x00000004l
4153
4154 /*
4155  * Move Overlay in back of relative surface
4156  */
4157 #define DDOVERZ_INSERTINBACKOF          0x00000005l
4158
4159
4160
4161 /****************************************************************************
4162  *
4163  * DIRECTDRAW SETGAMMARAMP FLAGS
4164  *
4165  ****************************************************************************/
4166
4167 /*
4168  * Request calibrator to adjust the gamma ramp according to the physical
4169  * properties of the display so that the result should appear identical
4170  * on all systems.
4171  */
4172 #define DDSGR_CALIBRATE                        0x00000001L
4173
4174
4175 /*===========================================================================
4176  *
4177  *
4178  * DIRECTDRAW RETURN CODES
4179  *
4180  * The return values from DirectDraw Commands and Surface that return an HRESULT
4181  * are codes from DirectDraw concerning the results of the action
4182  * requested by DirectDraw.
4183  *
4184  *==========================================================================*/
4185
4186 /*
4187  * Status is OK
4188  *
4189  * Issued by: DirectDraw Commands and all callbacks
4190  */
4191 #define DD_OK                                   0
4192 #define DD_FALSE                                S_FALSE
4193
4194 /****************************************************************************
4195  *
4196  * DIRECTDRAW ENUMCALLBACK RETURN VALUES
4197  *
4198  * EnumCallback returns are used to control the flow of the DIRECTDRAW and
4199  * DIRECTDRAWSURFACE object enumerations.   They can only be returned by
4200  * enumeration callback routines.
4201  *
4202  ****************************************************************************/
4203
4204 /*
4205  * stop the enumeration
4206  */
4207 #define DDENUMRET_CANCEL                        0
4208
4209 /*
4210  * continue the enumeration
4211  */
4212 #define DDENUMRET_OK                            1
4213
4214 /****************************************************************************
4215  *
4216  * DIRECTDRAW ERRORS
4217  *
4218  * Errors are represented by negative values and cannot be combined.
4219  *
4220  ****************************************************************************/
4221
4222 /*
4223  * This object is already initialized
4224  */
4225 #define DDERR_ALREADYINITIALIZED                MAKE_DDHRESULT( 5 )
4226
4227 /*
4228  * This surface can not be attached to the requested surface.
4229  */
4230 #define DDERR_CANNOTATTACHSURFACE               MAKE_DDHRESULT( 10 )
4231
4232 /*
4233  * This surface can not be detached from the requested surface.
4234  */
4235 #define DDERR_CANNOTDETACHSURFACE               MAKE_DDHRESULT( 20 )
4236
4237 /*
4238  * Support is currently not available.
4239  */
4240 #define DDERR_CURRENTLYNOTAVAIL                 MAKE_DDHRESULT( 40 )
4241
4242 /*
4243  * An exception was encountered while performing the requested operation
4244  */
4245 #define DDERR_EXCEPTION                         MAKE_DDHRESULT( 55 )
4246
4247 /*
4248  * Generic failure.
4249  */
4250 #define DDERR_GENERIC                           E_FAIL
4251
4252 /*
4253  * Height of rectangle provided is not a multiple of reqd alignment
4254  */
4255 #define DDERR_HEIGHTALIGN                       MAKE_DDHRESULT( 90 )
4256
4257 /*
4258  * Unable to match primary surface creation request with existing
4259  * primary surface.
4260  */
4261 #define DDERR_INCOMPATIBLEPRIMARY               MAKE_DDHRESULT( 95 )
4262
4263 /*
4264  * One or more of the caps bits passed to the callback are incorrect.
4265  */
4266 #define DDERR_INVALIDCAPS                       MAKE_DDHRESULT( 100 )
4267
4268 /*
4269  * DirectDraw does not support provided Cliplist.
4270  */
4271 #define DDERR_INVALIDCLIPLIST                   MAKE_DDHRESULT( 110 )
4272
4273 /*
4274  * DirectDraw does not support the requested mode
4275  */
4276 #define DDERR_INVALIDMODE                       MAKE_DDHRESULT( 120 )
4277
4278 /*
4279  * DirectDraw received a pointer that was an invalid DIRECTDRAW object.
4280  */
4281 #define DDERR_INVALIDOBJECT                     MAKE_DDHRESULT( 130 )
4282
4283 /*
4284  * One or more of the parameters passed to the callback function are
4285  * incorrect.
4286  */
4287 #define DDERR_INVALIDPARAMS                     E_INVALIDARG
4288
4289 /*
4290  * pixel format was invalid as specified
4291  */
4292 #define DDERR_INVALIDPIXELFORMAT                MAKE_DDHRESULT( 145 )
4293
4294 /*
4295  * Rectangle provided was invalid.
4296  */
4297 #define DDERR_INVALIDRECT                       MAKE_DDHRESULT( 150 )
4298
4299 /*
4300  * Operation could not be carried out because one or more surfaces are locked
4301  */
4302 #define DDERR_LOCKEDSURFACES                    MAKE_DDHRESULT( 160 )
4303
4304 /*
4305  * There is no 3D present.
4306  */
4307 #define DDERR_NO3D                              MAKE_DDHRESULT( 170 )
4308
4309 /*
4310  * Operation could not be carried out because there is no alpha accleration
4311  * hardware present or available.
4312  */
4313 #define DDERR_NOALPHAHW                         MAKE_DDHRESULT( 180 )
4314
4315
4316 /*
4317  * no clip list available
4318  */
4319 #define DDERR_NOCLIPLIST                        MAKE_DDHRESULT( 205 )
4320
4321 /*
4322  * Operation could not be carried out because there is no color conversion
4323  * hardware present or available.
4324  */
4325 #define DDERR_NOCOLORCONVHW                     MAKE_DDHRESULT( 210 )
4326
4327 /*
4328  * Create function called without DirectDraw object method SetCooperativeLevel
4329  * being called.
4330  */
4331 #define DDERR_NOCOOPERATIVELEVELSET             MAKE_DDHRESULT( 212 )
4332
4333 /*
4334  * Surface doesn't currently have a color key
4335  */
4336 #define DDERR_NOCOLORKEY                        MAKE_DDHRESULT( 215 )
4337
4338 /*
4339  * Operation could not be carried out because there is no hardware support
4340  * of the dest color key.
4341  */
4342 #define DDERR_NOCOLORKEYHW                      MAKE_DDHRESULT( 220 )
4343
4344 /*
4345  * No DirectDraw support possible with current display driver
4346  */
4347 #define DDERR_NODIRECTDRAWSUPPORT               MAKE_DDHRESULT( 222 )
4348
4349 /*
4350  * Operation requires the application to have exclusive mode but the
4351  * application does not have exclusive mode.
4352  */
4353 #define DDERR_NOEXCLUSIVEMODE                   MAKE_DDHRESULT( 225 )
4354
4355 /*
4356  * Flipping visible surfaces is not supported.
4357  */
4358 #define DDERR_NOFLIPHW                          MAKE_DDHRESULT( 230 )
4359
4360 /*
4361  * There is no GDI present.
4362  */
4363 #define DDERR_NOGDI                             MAKE_DDHRESULT( 240 )
4364
4365 /*
4366  * Operation could not be carried out because there is no hardware present
4367  * or available.
4368  */
4369 #define DDERR_NOMIRRORHW                        MAKE_DDHRESULT( 250 )
4370
4371 /*
4372  * Requested item was not found
4373  */
4374 #define DDERR_NOTFOUND                          MAKE_DDHRESULT( 255 )
4375
4376 /*
4377  * Operation could not be carried out because there is no overlay hardware
4378  * present or available.
4379  */
4380 #define DDERR_NOOVERLAYHW                       MAKE_DDHRESULT( 260 )
4381
4382 /*
4383  * Operation could not be carried out because the source and destination
4384  * rectangles are on the same surface and overlap each other.
4385  */
4386 #define DDERR_OVERLAPPINGRECTS                  MAKE_DDHRESULT( 270 )
4387
4388 /*
4389  * Operation could not be carried out because there is no appropriate raster
4390  * op hardware present or available.
4391  */
4392 #define DDERR_NORASTEROPHW                      MAKE_DDHRESULT( 280 )
4393
4394 /*
4395  * Operation could not be carried out because there is no rotation hardware
4396  * present or available.
4397  */
4398 #define DDERR_NOROTATIONHW                      MAKE_DDHRESULT( 290 )
4399
4400 /*
4401  * Operation could not be carried out because there is no hardware support
4402  * for stretching
4403  */
4404 #define DDERR_NOSTRETCHHW                       MAKE_DDHRESULT( 310 )
4405
4406 /*
4407  * DirectDrawSurface is not in 4 bit color palette and the requested operation
4408  * requires 4 bit color palette.
4409  */
4410 #define DDERR_NOT4BITCOLOR                      MAKE_DDHRESULT( 316 )
4411
4412 /*
4413  * DirectDrawSurface is not in 4 bit color index palette and the requested
4414  * operation requires 4 bit color index palette.
4415  */
4416 #define DDERR_NOT4BITCOLORINDEX                 MAKE_DDHRESULT( 317 )
4417
4418 /*
4419  * DirectDraw Surface is not in 8 bit color mode and the requested operation
4420  * requires 8 bit color.
4421  */
4422 #define DDERR_NOT8BITCOLOR                      MAKE_DDHRESULT( 320 )
4423
4424 /*
4425  * Operation could not be carried out because there is no texture mapping
4426  * hardware present or available.
4427  */
4428 #define DDERR_NOTEXTUREHW                       MAKE_DDHRESULT( 330 )
4429
4430 /*
4431  * Operation could not be carried out because there is no hardware support
4432  * for vertical blank synchronized operations.
4433  */
4434 #define DDERR_NOVSYNCHW                         MAKE_DDHRESULT( 335 )
4435
4436 /*
4437  * Operation could not be carried out because there is no hardware support
4438  * for zbuffer blting.
4439  */
4440 #define DDERR_NOZBUFFERHW                       MAKE_DDHRESULT( 340 )
4441
4442 /*
4443  * Overlay surfaces could not be z layered based on their BltOrder because
4444  * the hardware does not support z layering of overlays.
4445  */
4446 #define DDERR_NOZOVERLAYHW                      MAKE_DDHRESULT( 350 )
4447
4448 /*
4449  * The hardware needed for the requested operation has already been
4450  * allocated.
4451  */
4452 #define DDERR_OUTOFCAPS                         MAKE_DDHRESULT( 360 )
4453
4454 /*
4455  * DirectDraw does not have enough memory to perform the operation.
4456  */
4457 #define DDERR_OUTOFMEMORY                       E_OUTOFMEMORY
4458
4459 /*
4460  * DirectDraw does not have enough memory to perform the operation.
4461  */
4462 #define DDERR_OUTOFVIDEOMEMORY                  MAKE_DDHRESULT( 380 )
4463
4464 /*
4465  * hardware does not support clipped overlays
4466  */
4467 #define DDERR_OVERLAYCANTCLIP                   MAKE_DDHRESULT( 382 )
4468
4469 /*
4470  * Can only have ony color key active at one time for overlays
4471  */
4472 #define DDERR_OVERLAYCOLORKEYONLYONEACTIVE      MAKE_DDHRESULT( 384 )
4473
4474 /*
4475  * Access to this palette is being refused because the palette is already
4476  * locked by another thread.
4477  */
4478 #define DDERR_PALETTEBUSY                       MAKE_DDHRESULT( 387 )
4479
4480 /*
4481  * No src color key specified for this operation.
4482  */
4483 #define DDERR_COLORKEYNOTSET                    MAKE_DDHRESULT( 400 )
4484
4485 /*
4486  * This surface is already attached to the surface it is being attached to.
4487  */
4488 #define DDERR_SURFACEALREADYATTACHED            MAKE_DDHRESULT( 410 )
4489
4490 /*
4491  * This surface is already a dependency of the surface it is being made a
4492  * dependency of.
4493  */
4494 #define DDERR_SURFACEALREADYDEPENDENT           MAKE_DDHRESULT( 420 )
4495
4496 /*
4497  * Access to this surface is being refused because the surface is already
4498  * locked by another thread.
4499  */
4500 #define DDERR_SURFACEBUSY                       MAKE_DDHRESULT( 430 )
4501
4502 /*
4503  * Access to this surface is being refused because no driver exists
4504  * which can supply a pointer to the surface.
4505  * This is most likely to happen when attempting to lock the primary
4506  * surface when no DCI provider is present.
4507  * Will also happen on attempts to lock an optimized surface.
4508  */
4509 #define DDERR_CANTLOCKSURFACE                   MAKE_DDHRESULT( 435 )
4510
4511 /*
4512  * Access to Surface refused because Surface is obscured.
4513  */
4514 #define DDERR_SURFACEISOBSCURED                 MAKE_DDHRESULT( 440 )
4515
4516 /*
4517  * Access to this surface is being refused because the surface is gone.
4518  * The DIRECTDRAWSURFACE object representing this surface should
4519  * have Restore called on it.
4520  */
4521 #define DDERR_SURFACELOST                       MAKE_DDHRESULT( 450 )
4522
4523 /*
4524  * The requested surface is not attached.
4525  */
4526 #define DDERR_SURFACENOTATTACHED                MAKE_DDHRESULT( 460 )
4527
4528 /*
4529  * Height requested by DirectDraw is too large.
4530  */
4531 #define DDERR_TOOBIGHEIGHT                      MAKE_DDHRESULT( 470 )
4532
4533 /*
4534  * Size requested by DirectDraw is too large --  The individual height and
4535  * width are OK.
4536  */
4537 #define DDERR_TOOBIGSIZE                        MAKE_DDHRESULT( 480 )
4538
4539 /*
4540  * Width requested by DirectDraw is too large.
4541  */
4542 #define DDERR_TOOBIGWIDTH                       MAKE_DDHRESULT( 490 )
4543
4544 /*
4545  * Action not supported.
4546  */
4547 #define DDERR_UNSUPPORTED                       E_NOTIMPL
4548
4549 /*
4550  * FOURCC format requested is unsupported by DirectDraw
4551  */
4552 #define DDERR_UNSUPPORTEDFORMAT                 MAKE_DDHRESULT( 510 )
4553
4554 /*
4555  * Bitmask in the pixel format requested is unsupported by DirectDraw
4556  */
4557 #define DDERR_UNSUPPORTEDMASK                   MAKE_DDHRESULT( 520 )
4558
4559 /*
4560  * The specified stream contains invalid data
4561  */
4562 #define DDERR_INVALIDSTREAM                     MAKE_DDHRESULT( 521 )
4563
4564 /*
4565  * vertical blank is in progress
4566  */
4567 #define DDERR_VERTICALBLANKINPROGRESS           MAKE_DDHRESULT( 537 )
4568
4569 /*
4570  * Informs DirectDraw that the previous Blt which is transfering information
4571  * to or from this Surface is incomplete.
4572  */
4573 #define DDERR_WASSTILLDRAWING                   MAKE_DDHRESULT( 540 )
4574
4575
4576 /*
4577  * Rectangle provided was not horizontally aligned on reqd. boundary
4578  */
4579 #define DDERR_XALIGN                            MAKE_DDHRESULT( 560 )
4580
4581 /*
4582  * The GUID passed to DirectDrawCreate is not a valid DirectDraw driver
4583  * identifier.
4584  */
4585 #define DDERR_INVALIDDIRECTDRAWGUID             MAKE_DDHRESULT( 561 )
4586
4587 /*
4588  * A DirectDraw object representing this driver has already been created
4589  * for this process.
4590  */
4591 #define DDERR_DIRECTDRAWALREADYCREATED          MAKE_DDHRESULT( 562 )
4592
4593 /*
4594  * A hardware only DirectDraw object creation was attempted but the driver
4595  * did not support any hardware.
4596  */
4597 #define DDERR_NODIRECTDRAWHW                    MAKE_DDHRESULT( 563 )
4598
4599 /*
4600  * this process already has created a primary surface
4601  */
4602 #define DDERR_PRIMARYSURFACEALREADYEXISTS       MAKE_DDHRESULT( 564 )
4603
4604 /*
4605  * software emulation not available.
4606  */
4607 #define DDERR_NOEMULATION                       MAKE_DDHRESULT( 565 )
4608
4609 /*
4610  * region passed to Clipper::GetClipList is too small.
4611  */
4612 #define DDERR_REGIONTOOSMALL                    MAKE_DDHRESULT( 566 )
4613
4614 /*
4615  * an attempt was made to set a clip list for a clipper objec that
4616  * is already monitoring an hwnd.
4617  */
4618 #define DDERR_CLIPPERISUSINGHWND                MAKE_DDHRESULT( 567 )
4619
4620 /*
4621  * No clipper object attached to surface object
4622  */
4623 #define DDERR_NOCLIPPERATTACHED                 MAKE_DDHRESULT( 568 )
4624
4625 /*
4626  * Clipper notification requires an HWND or
4627  * no HWND has previously been set as the CooperativeLevel HWND.
4628  */
4629 #define DDERR_NOHWND                            MAKE_DDHRESULT( 569 )
4630
4631 /*
4632  * HWND used by DirectDraw CooperativeLevel has been subclassed,
4633  * this prevents DirectDraw from restoring state.
4634  */
4635 #define DDERR_HWNDSUBCLASSED                    MAKE_DDHRESULT( 570 )
4636
4637 /*
4638  * The CooperativeLevel HWND has already been set.
4639  * It can not be reset while the process has surfaces or palettes created.
4640  */
4641 #define DDERR_HWNDALREADYSET                    MAKE_DDHRESULT( 571 )
4642
4643 /*
4644  * No palette object attached to this surface.
4645  */
4646 #define DDERR_NOPALETTEATTACHED                 MAKE_DDHRESULT( 572 )
4647
4648 /*
4649  * No hardware support for 16 or 256 color palettes.
4650  */
4651 #define DDERR_NOPALETTEHW                       MAKE_DDHRESULT( 573 )
4652
4653 /*
4654  * If a clipper object is attached to the source surface passed into a
4655  * BltFast call.
4656  */
4657 #define DDERR_BLTFASTCANTCLIP                   MAKE_DDHRESULT( 574 )
4658
4659 /*
4660  * No blter.
4661  */
4662 #define DDERR_NOBLTHW                           MAKE_DDHRESULT( 575 )
4663
4664 /*
4665  * No DirectDraw ROP hardware.
4666  */
4667 #define DDERR_NODDROPSHW                        MAKE_DDHRESULT( 576 )
4668
4669 /*
4670  * returned when GetOverlayPosition is called on a hidden overlay
4671  */
4672 #define DDERR_OVERLAYNOTVISIBLE                 MAKE_DDHRESULT( 577 )
4673
4674 /*
4675  * returned when GetOverlayPosition is called on a overlay that UpdateOverlay
4676  * has never been called on to establish a destionation.
4677  */
4678 #define DDERR_NOOVERLAYDEST                     MAKE_DDHRESULT( 578 )
4679
4680 /*
4681  * returned when the position of the overlay on the destionation is no longer
4682  * legal for that destionation.
4683  */
4684 #define DDERR_INVALIDPOSITION                   MAKE_DDHRESULT( 579 )
4685
4686 /*
4687  * returned when an overlay member is called for a non-overlay surface
4688  */
4689 #define DDERR_NOTAOVERLAYSURFACE                MAKE_DDHRESULT( 580 )
4690
4691 /*
4692  * An attempt was made to set the cooperative level when it was already
4693  * set to exclusive.
4694  */
4695 #define DDERR_EXCLUSIVEMODEALREADYSET           MAKE_DDHRESULT( 581 )
4696
4697 /*
4698  * An attempt has been made to flip a surface that is not flippable.
4699  */
4700 #define DDERR_NOTFLIPPABLE                      MAKE_DDHRESULT( 582 )
4701
4702 /*
4703  * Can't duplicate primary & 3D surfaces, or surfaces that are implicitly
4704  * created.
4705  */
4706 #define DDERR_CANTDUPLICATE                     MAKE_DDHRESULT( 583 )
4707
4708 /*
4709  * Surface was not locked.  An attempt to unlock a surface that was not
4710  * locked at all, or by this process, has been attempted.
4711  */
4712 #define DDERR_NOTLOCKED                         MAKE_DDHRESULT( 584 )
4713
4714 /*
4715  * Windows can not create any more DCs, or a DC was requested for a paltte-indexed
4716  * surface when the surface had no palette AND the display mode was not palette-indexed
4717  * (in this case DirectDraw cannot select a proper palette into the DC)
4718  */
4719 #define DDERR_CANTCREATEDC                      MAKE_DDHRESULT( 585 )
4720
4721 /*
4722  * No DC was ever created for this surface.
4723  */
4724 #define DDERR_NODC                              MAKE_DDHRESULT( 586 )
4725
4726 /*
4727  * This surface can not be restored because it was created in a different
4728  * mode.
4729  */
4730 #define DDERR_WRONGMODE                         MAKE_DDHRESULT( 587 )
4731
4732 /*
4733  * This surface can not be restored because it is an implicitly created
4734  * surface.
4735  */
4736 #define DDERR_IMPLICITLYCREATED                 MAKE_DDHRESULT( 588 )
4737
4738 /*
4739  * The surface being used is not a palette-based surface
4740  */
4741 #define DDERR_NOTPALETTIZED                     MAKE_DDHRESULT( 589 )
4742
4743
4744 /*
4745  * The display is currently in an unsupported mode
4746  */
4747 #define DDERR_UNSUPPORTEDMODE                   MAKE_DDHRESULT( 590 )
4748
4749 /*
4750  * Operation could not be carried out because there is no mip-map
4751  * texture mapping hardware present or available.
4752  */
4753 #define DDERR_NOMIPMAPHW                        MAKE_DDHRESULT( 591 )
4754
4755 /*
4756  * The requested action could not be performed because the surface was of
4757  * the wrong type.
4758  */
4759 #define DDERR_INVALIDSURFACETYPE                MAKE_DDHRESULT( 592 )
4760
4761
4762
4763 /*
4764  * Device does not support optimized surfaces, therefore no video memory optimized surfaces
4765  */
4766 #define DDERR_NOOPTIMIZEHW                      MAKE_DDHRESULT( 600 )
4767
4768 /*
4769  * Surface is an optimized surface, but has not yet been allocated any memory
4770  */
4771 #define DDERR_NOTLOADED                         MAKE_DDHRESULT( 601 )
4772
4773 /*
4774  * Attempt was made to create or set a device window without first setting
4775  * the focus window
4776  */
4777 #define DDERR_NOFOCUSWINDOW                     MAKE_DDHRESULT( 602 )
4778
4779 /*
4780  * A DC has already been returned for this surface. Only one DC can be
4781  * retrieved per surface.
4782  */
4783 #define DDERR_DCALREADYCREATED                  MAKE_DDHRESULT( 620 )
4784
4785 /*
4786  * An attempt was made to allocate non-local video memory from a device
4787  * that does not support non-local video memory.
4788  */
4789 #define DDERR_NONONLOCALVIDMEM                  MAKE_DDHRESULT( 630 )
4790
4791 /*
4792  * The attempt to page lock a surface failed.
4793  */
4794 #define DDERR_CANTPAGELOCK                      MAKE_DDHRESULT( 640 )
4795
4796
4797 /*
4798  * The attempt to page unlock a surface failed.
4799  */
4800 #define DDERR_CANTPAGEUNLOCK                    MAKE_DDHRESULT( 660 )
4801
4802 /*
4803  * An attempt was made to page unlock a surface with no outstanding page locks.
4804  */
4805 #define DDERR_NOTPAGELOCKED                     MAKE_DDHRESULT( 680 )
4806
4807 /*
4808  * There is more data available than the specified buffer size could hold
4809  */
4810 #define DDERR_MOREDATA                          MAKE_DDHRESULT( 690 )
4811
4812 /*
4813  * The data has expired and is therefore no longer valid.
4814  */
4815 #define DDERR_EXPIRED                           MAKE_DDHRESULT( 691 )
4816
4817 /*
4818  * The video port is not active
4819  */
4820 #define DDERR_VIDEONOTACTIVE                    MAKE_DDHRESULT( 695 )
4821
4822 /*
4823  * Surfaces created by one direct draw device cannot be used directly by
4824  * another direct draw device.
4825  */
4826 #define DDERR_DEVICEDOESNTOWNSURFACE            MAKE_DDHRESULT( 699 )
4827
4828
4829 /*
4830  * An attempt was made to invoke an interface member of a DirectDraw object
4831  * created by CoCreateInstance() before it was initialized.
4832  */
4833 #define DDERR_NOTINITIALIZED                    CO_E_NOTINITIALIZED
4834
4835
4836 /* Alpha bit depth constants */
4837
4838
4839 #ifdef __cplusplus
4840 };
4841 #endif
4842
4843 #endif
4844