]> icculus.org git repositories - taylor/freespace2.git/blob - include/vddraw.h
Initial revision
[taylor/freespace2.git] / include / vddraw.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 0x0500
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  * GUIDS used by DirectDraw objects
43  */
44 #if defined( _WIN32 ) && !defined( _NO_COM )
45 DEFINE_GUID( CLSID_DirectDraw,                  0xD7B70EE0,0x4340,0x11CF,0xB0,0x63,0x00,0x20,0xAF,0xC2,0xCD,0x35 );
46 DEFINE_GUID( CLSID_DirectDrawClipper,           0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56 );
47 DEFINE_GUID( IID_IDirectDraw,                   0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
48 DEFINE_GUID( IID_IDirectDraw2,                  0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 );
49 DEFINE_GUID( IID_IDirectDrawSurface,            0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
50 DEFINE_GUID( IID_IDirectDrawSurface2,           0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27 );
51 DEFINE_GUID( IID_IDirectDrawSurface3,           0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB );
52
53 DEFINE_GUID( IID_IDirectDrawPalette,            0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
54 DEFINE_GUID( IID_IDirectDrawClipper,            0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
55 DEFINE_GUID( IID_IDirectDrawColorControl,       0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 );
56
57 #endif
58
59 /*============================================================================
60  *
61  * DirectDraw Structures
62  *
63  * Various structures used to invoke DirectDraw.
64  *
65  *==========================================================================*/
66
67 struct IDirectDraw;
68 struct IDirectDrawSurface;
69 struct IDirectDrawPalette;
70 struct IDirectDrawClipper;
71
72 typedef struct IDirectDraw                      FAR *LPDIRECTDRAW;
73 typedef struct IDirectDraw2                     FAR *LPDIRECTDRAW2;
74 typedef struct IDirectDrawSurface               FAR *LPDIRECTDRAWSURFACE;
75 typedef struct IDirectDrawSurface2              FAR *LPDIRECTDRAWSURFACE2;
76 typedef struct IDirectDrawSurface3              FAR *LPDIRECTDRAWSURFACE3;
77
78 typedef struct IDirectDrawPalette               FAR *LPDIRECTDRAWPALETTE;
79 typedef struct IDirectDrawClipper               FAR *LPDIRECTDRAWCLIPPER;
80 typedef struct IDirectDrawColorControl          FAR *LPDIRECTDRAWCOLORCONTROL;
81
82 typedef struct _DDFXROP                 FAR *LPDDFXROP;
83 typedef struct _DDSURFACEDESC           FAR *LPDDSURFACEDESC;
84 typedef struct _DDCOLORCONTROL          FAR *LPDDCOLORCONTROL;
85
86 /*
87  * API's
88  */
89 #if (defined (WIN32) || defined( _WIN32 ) ) && !defined( _NO_COM )
90 //#if defined( _WIN32 ) && !defined( _NO_ENUM )
91     typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKA)(GUID FAR *, LPSTR, LPSTR, LPVOID);
92     typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKW)(GUID FAR *, LPWSTR, LPWSTR, LPVOID);
93     extern HRESULT WINAPI DirectDrawEnumerateW( LPDDENUMCALLBACKW lpCallback, LPVOID lpContext );
94     extern HRESULT WINAPI DirectDrawEnumerateA( LPDDENUMCALLBACKA lpCallback, LPVOID lpContext );
95     #ifdef UNICODE
96         typedef LPDDENUMCALLBACKW       LPDDENUMCALLBACK;
97         #define DirectDrawEnumerate     DirectDrawEnumerateW
98     #else
99         typedef LPDDENUMCALLBACKA       LPDDENUMCALLBACK;
100         #define DirectDrawEnumerate     DirectDrawEnumerateA
101     #endif
102     extern HRESULT WINAPI DirectDrawCreate( GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter );
103     extern HRESULT WINAPI DirectDrawCreateClipper( DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter );
104 #endif
105
106
107 #define REGSTR_KEY_DDHW_DESCRIPTION     "Description"
108 #define REGSTR_KEY_DDHW_DRIVERNAME      "DriverName"
109 #define REGSTR_PATH_DDHW                "Hardware\\DirectDrawDrivers"
110
111 #define DDCREATE_HARDWAREONLY           0x00000001l
112 #define DDCREATE_EMULATIONONLY          0x00000002l
113
114 #if defined(WINNT) || !defined(WIN32)
115 typedef long HRESULT;
116 #endif
117
118 //#ifndef WINNT
119 typedef HRESULT (FAR PASCAL * LPDDENUMMODESCALLBACK)(LPDDSURFACEDESC, LPVOID);
120 typedef HRESULT (FAR PASCAL * LPDDENUMSURFACESCALLBACK)(LPDIRECTDRAWSURFACE, LPDDSURFACEDESC, LPVOID);
121 //#endif
122 /*
123  * DDCOLORKEY
124  */
125 typedef struct _DDCOLORKEY
126 {
127     DWORD       dwColorSpaceLowValue;   // low boundary of color space that is to
128                                         // be treated as Color Key, inclusive
129     DWORD       dwColorSpaceHighValue;  // high boundary of color space that is
130                                         // to be treated as Color Key, inclusive
131 } DDCOLORKEY;
132
133 typedef DDCOLORKEY FAR* LPDDCOLORKEY;
134
135 /*
136  * DDBLTFX
137  * Used to pass override information to the DIRECTDRAWSURFACE callback Blt.
138  */
139 typedef struct _DDBLTFX
140 {
141     DWORD       dwSize;                         // size of structure
142     DWORD       dwDDFX;                         // FX operations
143     DWORD       dwROP;                          // Win32 raster operations
144     DWORD       dwDDROP;                        // Raster operations new for DirectDraw
145     DWORD       dwRotationAngle;                // Rotation angle for blt
146     DWORD       dwZBufferOpCode;                // ZBuffer compares
147     DWORD       dwZBufferLow;                   // Low limit of Z buffer
148     DWORD       dwZBufferHigh;                  // High limit of Z buffer
149     DWORD       dwZBufferBaseDest;              // Destination base value
150     DWORD       dwZDestConstBitDepth;           // Bit depth used to specify Z constant for destination
151     union
152     {
153         DWORD   dwZDestConst;                   // Constant to use as Z buffer for dest
154         LPDIRECTDRAWSURFACE lpDDSZBufferDest;   // Surface to use as Z buffer for dest
155     };
156     DWORD       dwZSrcConstBitDepth;            // Bit depth used to specify Z constant for source
157     union
158     {
159         DWORD   dwZSrcConst;                    // Constant to use as Z buffer for src
160         LPDIRECTDRAWSURFACE lpDDSZBufferSrc;    // Surface to use as Z buffer for src
161     };
162     DWORD       dwAlphaEdgeBlendBitDepth;       // Bit depth used to specify constant for alpha edge blend
163     DWORD       dwAlphaEdgeBlend;               // Alpha for edge blending
164     DWORD       dwReserved;
165     DWORD       dwAlphaDestConstBitDepth;       // Bit depth used to specify alpha constant for destination
166     union
167     {
168         DWORD   dwAlphaDestConst;               // Constant to use as Alpha Channel
169         LPDIRECTDRAWSURFACE lpDDSAlphaDest;     // Surface to use as Alpha Channel
170     };
171     DWORD       dwAlphaSrcConstBitDepth;        // Bit depth used to specify alpha constant for source
172     union
173     {
174         DWORD   dwAlphaSrcConst;                // Constant to use as Alpha Channel
175         LPDIRECTDRAWSURFACE lpDDSAlphaSrc;      // Surface to use as Alpha Channel
176     };
177     union
178     {
179         DWORD   dwFillColor;                    // color in RGB or Palettized
180         DWORD   dwFillDepth;                    // depth value for z-buffer
181         DWORD   dwFillPixel;                    // pixel value for RGBA or RGBZ
182         LPDIRECTDRAWSURFACE lpDDSPattern;       // Surface to use as pattern
183     };
184     DDCOLORKEY  ddckDestColorkey;               // DestColorkey override
185     DDCOLORKEY  ddckSrcColorkey;                // SrcColorkey override
186 } DDBLTFX;
187
188 typedef DDBLTFX FAR* LPDDBLTFX;
189
190
191 /*
192  * DDSCAPS
193  */
194 typedef struct _DDSCAPS
195 {
196     DWORD       dwCaps;         // capabilities of surface wanted
197 } DDSCAPS;
198
199 typedef DDSCAPS FAR* LPDDSCAPS;
200
201 /*
202  * DDCAPS
203  */
204 #define DD_ROP_SPACE            (256/32)        // space required to store ROP array
205
206 #if DIRECTDRAW_VERSION >= 0x0500
207 /*
208  * This structure is the DDCAPS structure as it was in version 2 and 3 of Direct X.
209  * It is present for back compatability.
210  */
211 typedef struct _DDCAPS_DX3
212 {
213     DWORD       dwSize;                 // size of the DDDRIVERCAPS structure
214     DWORD       dwCaps;                 // driver specific capabilities
215     DWORD       dwCaps2;                // more driver specific capabilites
216     DWORD       dwCKeyCaps;             // color key capabilities of the surface
217     DWORD       dwFXCaps;               // driver specific stretching and effects capabilites
218     DWORD       dwFXAlphaCaps;          // alpha driver specific capabilities
219     DWORD       dwPalCaps;              // palette capabilities
220     DWORD       dwSVCaps;               // stereo vision capabilities
221     DWORD       dwAlphaBltConstBitDepths;       // DDBD_2,4,8
222     DWORD       dwAlphaBltPixelBitDepths;       // DDBD_1,2,4,8
223     DWORD       dwAlphaBltSurfaceBitDepths;     // DDBD_1,2,4,8
224     DWORD       dwAlphaOverlayConstBitDepths;   // DDBD_2,4,8
225     DWORD       dwAlphaOverlayPixelBitDepths;   // DDBD_1,2,4,8
226     DWORD       dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8
227     DWORD       dwZBufferBitDepths;             // DDBD_8,16,24,32
228     DWORD       dwVidMemTotal;          // total amount of video memory
229     DWORD       dwVidMemFree;           // amount of free video memory
230     DWORD       dwMaxVisibleOverlays;   // maximum number of visible overlays
231     DWORD       dwCurrVisibleOverlays;  // current number of visible overlays
232     DWORD       dwNumFourCCCodes;       // number of four cc codes
233     DWORD       dwAlignBoundarySrc;     // source rectangle alignment
234     DWORD       dwAlignSizeSrc;         // source rectangle byte size
235     DWORD       dwAlignBoundaryDest;    // dest rectangle alignment
236     DWORD       dwAlignSizeDest;        // dest rectangle byte size
237     DWORD       dwAlignStrideAlign;     // stride alignment
238     DWORD       dwRops[DD_ROP_SPACE];   // ROPS supported
239     DDSCAPS     ddsCaps;                // DDSCAPS structure has all the general capabilities
240     DWORD       dwMinOverlayStretch;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
241     DWORD       dwMaxOverlayStretch;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
242     DWORD       dwMinLiveVideoStretch;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
243     DWORD       dwMaxLiveVideoStretch;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
244     DWORD       dwMinHwCodecStretch;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
245     DWORD       dwMaxHwCodecStretch;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
246     DWORD       dwReserved1;            // reserved
247     DWORD       dwReserved2;            // reserved
248     DWORD       dwReserved3;            // reserved
249     DWORD       dwSVBCaps;              // driver specific capabilities for System->Vmem blts
250     DWORD       dwSVBCKeyCaps;          // driver color key capabilities for System->Vmem blts
251     DWORD       dwSVBFXCaps;            // driver FX capabilities for System->Vmem blts
252     DWORD       dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts
253     DWORD       dwVSBCaps;              // driver specific capabilities for Vmem->System blts
254     DWORD       dwVSBCKeyCaps;          // driver color key capabilities for Vmem->System blts
255     DWORD       dwVSBFXCaps;            // driver FX capabilities for Vmem->System blts
256     DWORD       dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts
257     DWORD       dwSSBCaps;              // driver specific capabilities for System->System blts
258     DWORD       dwSSBCKeyCaps;          // driver color key capabilities for System->System blts
259     DWORD       dwSSBFXCaps;            // driver FX capabilities for System->System blts
260     DWORD       dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts
261     DWORD       dwReserved4;            // reserved
262     DWORD       dwReserved5;            // reserved
263     DWORD       dwReserved6;            // reserved
264 } DDCAPS_DX3;
265 typedef DDCAPS_DX3 FAR* LPDDCAPS_DX3;
266 #endif /* DIRECTDRAW_VERSION >= 0x0500 */
267
268 typedef struct _DDCAPS
269 {
270 /*  0*/ DWORD   dwSize;                 // size of the DDDRIVERCAPS structure
271 /*  4*/ DWORD   dwCaps;                 // driver specific capabilities
272 /*  8*/ DWORD   dwCaps2;                // more driver specific capabilites
273 /*  c*/ DWORD   dwCKeyCaps;             // color key capabilities of the surface
274 /* 10*/ DWORD   dwFXCaps;               // driver specific stretching and effects capabilites
275 /* 14*/ DWORD   dwFXAlphaCaps;          // alpha driver specific capabilities
276 /* 18*/ DWORD   dwPalCaps;              // palette capabilities
277 /* 1c*/ DWORD   dwSVCaps;               // stereo vision capabilities
278 /* 20*/ DWORD   dwAlphaBltConstBitDepths;       // DDBD_2,4,8
279 /* 24*/ DWORD   dwAlphaBltPixelBitDepths;       // DDBD_1,2,4,8
280 /* 28*/ DWORD   dwAlphaBltSurfaceBitDepths;     // DDBD_1,2,4,8
281 /* 2c*/ DWORD   dwAlphaOverlayConstBitDepths;   // DDBD_2,4,8
282 /* 30*/ DWORD   dwAlphaOverlayPixelBitDepths;   // DDBD_1,2,4,8
283 /* 34*/ DWORD   dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8
284 /* 38*/ DWORD   dwZBufferBitDepths;             // DDBD_8,16,24,32
285 /* 3c*/ DWORD   dwVidMemTotal;          // total amount of video memory
286 /* 40*/ DWORD   dwVidMemFree;           // amount of free video memory
287 /* 44*/ DWORD   dwMaxVisibleOverlays;   // maximum number of visible overlays
288 /* 48*/ DWORD   dwCurrVisibleOverlays;  // current number of visible overlays
289 /* 4c*/ DWORD   dwNumFourCCCodes;       // number of four cc codes
290 /* 50*/ DWORD   dwAlignBoundarySrc;     // source rectangle alignment
291 /* 54*/ DWORD   dwAlignSizeSrc;         // source rectangle byte size
292 /* 58*/ DWORD   dwAlignBoundaryDest;    // dest rectangle alignment
293 /* 5c*/ DWORD   dwAlignSizeDest;        // dest rectangle byte size
294 /* 60*/ DWORD   dwAlignStrideAlign;     // stride alignment
295 /* 64*/ DWORD   dwRops[DD_ROP_SPACE];   // ROPS supported
296 /* 84*/ DDSCAPS ddsCaps;                // DDSCAPS structure has all the general capabilities
297 /* 88*/ DWORD   dwMinOverlayStretch;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
298 /* 8c*/ DWORD   dwMaxOverlayStretch;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
299 /* 90*/ DWORD   dwMinLiveVideoStretch;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
300 /* 94*/ DWORD   dwMaxLiveVideoStretch;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
301 /* 98*/ DWORD   dwMinHwCodecStretch;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
302 /* 9c*/ DWORD   dwMaxHwCodecStretch;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
303 /* a0*/ DWORD   dwReserved1;            // reserved
304 /* a4*/ DWORD   dwReserved2;            // reserved
305 /* a8*/ DWORD   dwReserved3;            // reserved
306 /* ac*/ DWORD   dwSVBCaps;              // driver specific capabilities for System->Vmem blts
307 /* b0*/ DWORD   dwSVBCKeyCaps;          // driver color key capabilities for System->Vmem blts
308 /* b4*/ DWORD   dwSVBFXCaps;            // driver FX capabilities for System->Vmem blts
309 /* b8*/ DWORD   dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts
310 /* d8*/ DWORD   dwVSBCaps;              // driver specific capabilities for Vmem->System blts
311 /* dc*/ DWORD   dwVSBCKeyCaps;          // driver color key capabilities for Vmem->System blts
312 /* e0*/ DWORD   dwVSBFXCaps;            // driver FX capabilities for Vmem->System blts
313 /* e4*/ DWORD   dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts
314 /*104*/ DWORD   dwSSBCaps;              // driver specific capabilities for System->System blts
315 /*108*/ DWORD   dwSSBCKeyCaps;          // driver color key capabilities for System->System blts
316 /*10c*/ DWORD   dwSSBFXCaps;            // driver FX capabilities for System->System blts
317 /*110*/ DWORD   dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts
318 #if       DIRECTDRAW_VERSION >= 0x0500
319 /*130*/ DWORD   dwMaxVideoPorts;        // maximum number of usable video ports
320 /*134*/ DWORD   dwCurrVideoPorts;       // current number of video ports used
321 /*138*/ DWORD   dwSVBCaps2;             // more driver specific capabilities for System->Vmem blts
322 /*13c*/ DWORD   dwNLVBCaps;               // driver specific capabilities for non-local->local vidmem blts
323 /*140*/ DWORD   dwNLVBCaps2;              // more driver specific capabilities non-local->local vidmem blts
324 /*144*/ DWORD   dwNLVBCKeyCaps;           // driver color key capabilities for non-local->local vidmem blts
325 /*148*/ DWORD   dwNLVBFXCaps;             // driver FX capabilities for non-local->local blts
326 /*14c*/ DWORD   dwNLVBRops[DD_ROP_SPACE]; // ROPS supported for non-local->local blts
327 #else  /* DIRECTDRAW_VERSION >= 0x0500 */
328 /*130*/ DWORD   dwReserved4;            // reserved
329 /*134*/ DWORD   dwReserved5;            // reserved
330 /*138*/ DWORD   dwReserved6;            // reserved
331 #endif /* DIRECTDRAW_VERSION >= 0x0500 */
332 } DDCAPS;
333
334 typedef DDCAPS FAR* LPDDCAPS;
335
336
337
338 /*
339  * DDPIXELFORMAT
340  */
341 typedef struct _DDPIXELFORMAT
342 {
343     DWORD       dwSize;                 // size of structure
344     DWORD       dwFlags;                // pixel format flags
345     DWORD       dwFourCC;               // (FOURCC code)
346     union
347     {
348         DWORD   dwRGBBitCount;          // how many bits per pixel
349         DWORD   dwYUVBitCount;          // how many bits per pixel
350         DWORD   dwZBufferBitDepth;      // how many bits for z buffers
351         DWORD   dwAlphaBitDepth;        // how many bits for alpha channels
352     };
353     union
354     {
355         DWORD   dwRBitMask;             // mask for red bit
356         DWORD   dwYBitMask;             // mask for Y bits
357     };
358     union
359     {
360         DWORD   dwGBitMask;             // mask for green bits
361         DWORD   dwUBitMask;             // mask for U bits
362     };
363     union
364     {
365         DWORD   dwBBitMask;             // mask for blue bits
366         DWORD   dwVBitMask;             // mask for V bits
367     };
368     union
369     {
370         DWORD   dwRGBAlphaBitMask;      // mask for alpha channel
371         DWORD   dwYUVAlphaBitMask;      // mask for alpha channel
372         DWORD   dwRGBZBitMask;          // mask for Z channel
373         DWORD   dwYUVZBitMask;          // mask for Z channel
374     };
375 } DDPIXELFORMAT;
376
377 typedef DDPIXELFORMAT FAR* LPDDPIXELFORMAT;
378
379 /*
380  * DDOVERLAYFX
381  */
382 typedef struct _DDOVERLAYFX
383 {
384     DWORD       dwSize;                         // size of structure
385     DWORD       dwAlphaEdgeBlendBitDepth;       // Bit depth used to specify constant for alpha edge blend
386     DWORD       dwAlphaEdgeBlend;               // Constant to use as alpha for edge blend
387     DWORD       dwReserved;
388     DWORD       dwAlphaDestConstBitDepth;       // Bit depth used to specify alpha constant for destination
389     union
390     {
391         DWORD   dwAlphaDestConst;               // Constant to use as alpha channel for dest
392         LPDIRECTDRAWSURFACE lpDDSAlphaDest;     // Surface to use as alpha channel for dest
393     };
394     DWORD       dwAlphaSrcConstBitDepth;        // Bit depth used to specify alpha constant for source
395     union
396     {
397         DWORD   dwAlphaSrcConst;                // Constant to use as alpha channel for src
398         LPDIRECTDRAWSURFACE lpDDSAlphaSrc;      // Surface to use as alpha channel for src
399     };
400     DDCOLORKEY  dckDestColorkey;                // DestColorkey override
401     DDCOLORKEY  dckSrcColorkey;                 // DestColorkey override
402     DWORD       dwDDFX;                         // Overlay FX
403     DWORD       dwFlags;                        // flags
404 } DDOVERLAYFX;
405
406 typedef DDOVERLAYFX FAR *LPDDOVERLAYFX;
407
408 /*
409  * DDBLTBATCH: BltBatch entry structure
410  */
411 typedef struct _DDBLTBATCH
412 {
413     LPRECT              lprDest;
414     LPDIRECTDRAWSURFACE lpDDSSrc;
415     LPRECT              lprSrc;
416     DWORD               dwFlags;
417     LPDDBLTFX           lpDDBltFx;
418 } DDBLTBATCH;
419
420 typedef DDBLTBATCH FAR * LPDDBLTBATCH;
421
422 /*
423  * callbacks
424  */
425 typedef DWORD   (FAR PASCAL *LPCLIPPERCALLBACK)(LPDIRECTDRAWCLIPPER lpDDClipper, HWND hWnd, DWORD code, LPVOID lpContext );
426 #ifdef STREAMING
427 typedef DWORD   (FAR PASCAL *LPSURFACESTREAMINGCALLBACK)(DWORD);
428 #endif
429
430
431 /*
432  * INTERACES FOLLOW:
433  *      IDirectDraw
434  *      IDirectDrawClipper
435  *      IDirectDrawPalette
436  *      IDirectDrawSurface
437  */
438
439 /*
440  * IDirectDraw
441  */
442 #if defined( _WIN32 ) && !defined( _NO_COM )
443 #undef INTERFACE
444 #define INTERFACE IDirectDraw
445 DECLARE_INTERFACE_( IDirectDraw, IUnknown )
446 {
447     /*** IUnknown methods ***/
448     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
449     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
450     STDMETHOD_(ULONG,Release) (THIS) PURE;
451     /*** IDirectDraw methods ***/
452     STDMETHOD(Compact)(THIS) PURE;
453     STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE;
454     STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE;
455     STDMETHOD(CreateSurface)(THIS_  LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE;
456     STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR * ) PURE;
457     STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK ) PURE;
458     STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC, LPVOID,LPDDENUMSURFACESCALLBACK ) PURE;
459     STDMETHOD(FlipToGDISurface)(THIS) PURE;
460     STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE;
461     STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC) PURE;
462     STDMETHOD(GetFourCCCodes)(THIS_  LPDWORD, LPDWORD ) PURE;
463     STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE FAR *) PURE;
464     STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE;
465     STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE;
466     STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE;
467     STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE;
468     STDMETHOD(RestoreDisplayMode)(THIS) PURE;
469     STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE;
470     STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD) PURE;
471     STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE;
472 };
473
474 #if !defined(__cplusplus) || defined(CINTERFACE)
475 #define IDirectDraw_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
476 #define IDirectDraw_AddRef(p)                       (p)->lpVtbl->AddRef(p)
477 #define IDirectDraw_Release(p)                      (p)->lpVtbl->Release(p)
478 #define IDirectDraw_Compact(p)                      (p)->lpVtbl->Compact(p)
479 #define IDirectDraw_CreateClipper(p, a, b, c)       (p)->lpVtbl->CreateClipper(p, a, b, c)
480 #define IDirectDraw_CreatePalette(p, a, b, c, d)    (p)->lpVtbl->CreatePalette(p, a, b, c, d)
481 #define IDirectDraw_CreateSurface(p, a, b, c)       (p)->lpVtbl->CreateSurface(p, a, b, c)
482 #define IDirectDraw_DuplicateSurface(p, a, b)       (p)->lpVtbl->DuplicateSurface(p, a, b)
483 #define IDirectDraw_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d)
484 #define IDirectDraw_EnumSurfaces(p, a, b, c, d)     (p)->lpVtbl->EnumSurfaces(p, a, b, c, d)
485 #define IDirectDraw_FlipToGDISurface(p)             (p)->lpVtbl->FlipToGDISurface(p)
486 #define IDirectDraw_GetCaps(p, a, b)                (p)->lpVtbl->GetCaps(p, a, b)
487 #define IDirectDraw_GetDisplayMode(p, a)            (p)->lpVtbl->GetDisplayMode(p, a)
488 #define IDirectDraw_GetFourCCCodes(p, a, b)         (p)->lpVtbl->GetFourCCCodes(p, a, b)
489 #define IDirectDraw_GetGDISurface(p, a)             (p)->lpVtbl->GetGDISurface(p, a)
490 #define IDirectDraw_GetMonitorFrequency(p, a)       (p)->lpVtbl->GetMonitorFrequency(p, a)
491 #define IDirectDraw_GetScanLine(p, a)               (p)->lpVtbl->GetScanLine(p, a)
492 #define IDirectDraw_GetVerticalBlankStatus(p, a)    (p)->lpVtbl->GetVerticalBlankStatus(p, a)
493 #define IDirectDraw_Initialize(p, a)                (p)->lpVtbl->Initialize(p, a)
494 #define IDirectDraw_RestoreDisplayMode(p)           (p)->lpVtbl->RestoreDisplayMode(p)
495 #define IDirectDraw_SetCooperativeLevel(p, a, b)    (p)->lpVtbl->SetCooperativeLevel(p, a, b)
496 #define IDirectDraw_SetDisplayMode(p, a, b, c)      (p)->lpVtbl->SetDisplayMode(p, a, b, c)
497 #define IDirectDraw_WaitForVerticalBlank(p, a, b)   (p)->lpVtbl->WaitForVerticalBlank(p, a, b)
498 #else
499 #define IDirectDraw_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
500 #define IDirectDraw_AddRef(p)                       (p)->AddRef()
501 #define IDirectDraw_Release(p)                      (p)->Release()
502 #define IDirectDraw_Compact(p)                      (p)->Compact()
503 #define IDirectDraw_CreateClipper(p, a, b, c)       (p)->CreateClipper(a, b, c)
504 #define IDirectDraw_CreatePalette(p, a, b, c, d)    (p)->CreatePalette(a, b, c, d)
505 #define IDirectDraw_CreateSurface(p, a, b, c)       (p)->CreateSurface(a, b, c)
506 #define IDirectDraw_DuplicateSurface(p, a, b)       (p)->DuplicateSurface(a, b)
507 #define IDirectDraw_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d)
508 #define IDirectDraw_EnumSurfaces(p, a, b, c, d)     (p)->EnumSurfaces(a, b, c, d)
509 #define IDirectDraw_FlipToGDISurface(p)             (p)->FlipToGDISurface()
510 #define IDirectDraw_GetCaps(p, a, b)                (p)->GetCaps(a, b)
511 #define IDirectDraw_GetDisplayMode(p, a)            (p)->GetDisplayMode(a)
512 #define IDirectDraw_GetFourCCCodes(p, a, b)         (p)->GetFourCCCodes(a, b)
513 #define IDirectDraw_GetGDISurface(p, a)             (p)->GetGDISurface(a)
514 #define IDirectDraw_GetMonitorFrequency(p, a)       (p)->GetMonitorFrequency(a)
515 #define IDirectDraw_GetScanLine(p, a)               (p)->GetScanLine(a)
516 #define IDirectDraw_GetVerticalBlankStatus(p, a)    (p)->GetVerticalBlankStatus(a)
517 #define IDirectDraw_Initialize(p, a)                (p)->Initialize(a)
518 #define IDirectDraw_RestoreDisplayMode(p)           (p)->RestoreDisplayMode()
519 #define IDirectDraw_SetCooperativeLevel(p, a, b)    (p)->SetCooperativeLevel(a, b)
520 #define IDirectDraw_SetDisplayMode(p, a, b, c)      (p)->SetDisplayMode(a, b, c)
521 #define IDirectDraw_WaitForVerticalBlank(p, a, b)   (p)->WaitForVerticalBlank(a, b)
522 #endif
523
524 #endif
525
526 #if defined( _WIN32 ) && !defined( _NO_COM )
527 #undef INTERFACE
528 #define INTERFACE IDirectDraw2
529 DECLARE_INTERFACE_( IDirectDraw2, IUnknown )
530 {
531     /*** IUnknown methods ***/
532     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
533     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
534     STDMETHOD_(ULONG,Release) (THIS) PURE;
535     /*** IDirectDraw methods ***/
536     STDMETHOD(Compact)(THIS) PURE;
537     STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE;
538     STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE;
539     STDMETHOD(CreateSurface)(THIS_  LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE;
540     STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR * ) PURE;
541     STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK ) PURE;
542     STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC, LPVOID,LPDDENUMSURFACESCALLBACK ) PURE;
543     STDMETHOD(FlipToGDISurface)(THIS) PURE;
544     STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE;
545     STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC) PURE;
546     STDMETHOD(GetFourCCCodes)(THIS_  LPDWORD, LPDWORD ) PURE;
547     STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE FAR *) PURE;
548     STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE;
549     STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE;
550     STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE;
551     STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE;
552     STDMETHOD(RestoreDisplayMode)(THIS) PURE;
553     STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE;
554     STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE;
555     STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE;
556     /*** Added in the v2 interface ***/
557     STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS, LPDWORD, LPDWORD) PURE;
558 };
559 #if !defined(__cplusplus) || defined(CINTERFACE)
560 #define IDirectDraw2_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
561 #define IDirectDraw2_AddRef(p)                       (p)->lpVtbl->AddRef(p)
562 #define IDirectDraw2_Release(p)                      (p)->lpVtbl->Release(p)
563 #define IDirectDraw2_Compact(p)                      (p)->lpVtbl->Compact(p)
564 #define IDirectDraw2_CreateClipper(p, a, b, c)       (p)->lpVtbl->CreateClipper(p, a, b, c)
565 #define IDirectDraw2_CreatePalette(p, a, b, c, d)    (p)->lpVtbl->CreatePalette(p, a, b, c, d)
566 #define IDirectDraw2_CreateSurface(p, a, b, c)       (p)->lpVtbl->CreateSurface(p, a, b, c)
567 #define IDirectDraw2_DuplicateSurface(p, a, b)       (p)->lpVtbl->DuplicateSurface(p, a, b)
568 #define IDirectDraw2_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d)
569 #define IDirectDraw2_EnumSurfaces(p, a, b, c, d)     (p)->lpVtbl->EnumSurfaces(p, a, b, c, d)
570 #define IDirectDraw2_FlipToGDISurface(p)             (p)->lpVtbl->FlipToGDISurface(p)
571 #define IDirectDraw2_GetCaps(p, a, b)                (p)->lpVtbl->GetCaps(p, a, b)
572 #define IDirectDraw2_GetDisplayMode(p, a)            (p)->lpVtbl->GetDisplayMode(p, a)
573 #define IDirectDraw2_GetFourCCCodes(p, a, b)         (p)->lpVtbl->GetFourCCCodes(p, a, b)
574 #define IDirectDraw2_GetGDISurface(p, a)             (p)->lpVtbl->GetGDISurface(p, a)
575 #define IDirectDraw2_GetMonitorFrequency(p, a)       (p)->lpVtbl->GetMonitorFrequency(p, a)
576 #define IDirectDraw2_GetScanLine(p, a)               (p)->lpVtbl->GetScanLine(p, a)
577 #define IDirectDraw2_GetVerticalBlankStatus(p, a)    (p)->lpVtbl->GetVerticalBlankStatus(p, a)
578 #define IDirectDraw2_Initialize(p, a)                (p)->lpVtbl->Initialize(p, a)
579 #define IDirectDraw2_RestoreDisplayMode(p)           (p)->lpVtbl->RestoreDisplayMode(p)
580 #define IDirectDraw2_SetCooperativeLevel(p, a, b)    (p)->lpVtbl->SetCooperativeLevel(p, a, b)
581 #define IDirectDraw2_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e)
582 #define IDirectDraw2_WaitForVerticalBlank(p, a, b)   (p)->lpVtbl->WaitForVerticalBlank(p, a, b)
583 #define IDirectDraw2_GetAvailableVidMem(p, a, b, c)  (p)->lpVtbl->GetAvailableVidMem(p, a, b, c)
584 #else
585 #define IDirectDraw2_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
586 #define IDirectDraw2_AddRef(p)                       (p)->AddRef()
587 #define IDirectDraw2_Release(p)                      (p)->Release()
588 #define IDirectDraw2_Compact(p)                      (p)->Compact()
589 #define IDirectDraw2_CreateClipper(p, a, b, c)       (p)->CreateClipper(a, b, c)
590 #define IDirectDraw2_CreatePalette(p, a, b, c, d)    (p)->CreatePalette(a, b, c, d)
591 #define IDirectDraw2_CreateSurface(p, a, b, c)       (p)->CreateSurface(a, b, c)
592 #define IDirectDraw2_DuplicateSurface(p, a, b)       (p)->DuplicateSurface(a, b)
593 #define IDirectDraw2_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d)
594 #define IDirectDraw2_EnumSurfaces(p, a, b, c, d)     (p)->EnumSurfaces(a, b, c, d)
595 #define IDirectDraw2_FlipToGDISurface(p)             (p)->FlipToGDISurface()
596 #define IDirectDraw2_GetCaps(p, a, b)                (p)->GetCaps(a, b)
597 #define IDirectDraw2_GetDisplayMode(p, a)            (p)->GetDisplayMode(a)
598 #define IDirectDraw2_GetFourCCCodes(p, a, b)         (p)->GetFourCCCodes(a, b)
599 #define IDirectDraw2_GetGDISurface(p, a)             (p)->GetGDISurface(a)
600 #define IDirectDraw2_GetMonitorFrequency(p, a)       (p)->GetMonitorFrequency(a)
601 #define IDirectDraw2_GetScanLine(p, a)               (p)->GetScanLine(a)
602 #define IDirectDraw2_GetVerticalBlankStatus(p, a)    (p)->GetVerticalBlankStatus(a)
603 #define IDirectDraw2_Initialize(p, a)                (p)->Initialize(a)
604 #define IDirectDraw2_RestoreDisplayMode(p)           (p)->RestoreDisplayMode()
605 #define IDirectDraw2_SetCooperativeLevel(p, a, b)    (p)->SetCooperativeLevel(a, b)
606 #define IDirectDraw2_SetDisplayMode(p, a, b, c, d, e) (p)->SetDisplayMode(a, b, c, d, e)
607 #define IDirectDraw2_WaitForVerticalBlank(p, a, b)   (p)->WaitForVerticalBlank(a, b)
608 #define IDirectDraw2_GetAvailableVidMem(p, a, b, c)  (p)->GetAvailableVidMem(a, b, c)
609 #endif
610
611 #endif
612
613 /*
614  * IDirectDrawPalette
615  */
616 #if defined( _WIN32 ) && !defined( _NO_COM )
617 #undef INTERFACE
618 #define INTERFACE IDirectDrawPalette
619 DECLARE_INTERFACE_( IDirectDrawPalette, IUnknown )
620 {
621     /*** IUnknown methods ***/
622     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
623     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
624     STDMETHOD_(ULONG,Release) (THIS) PURE;
625     /*** IDirectDrawPalette methods ***/
626     STDMETHOD(GetCaps)(THIS_ LPDWORD) PURE;
627     STDMETHOD(GetEntries)(THIS_ DWORD,DWORD,DWORD,LPPALETTEENTRY) PURE;
628     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, DWORD, LPPALETTEENTRY) PURE;
629     STDMETHOD(SetEntries)(THIS_ DWORD,DWORD,DWORD,LPPALETTEENTRY) PURE;
630 };
631
632 #if !defined(__cplusplus) || defined(CINTERFACE)
633 #define IDirectDrawPalette_QueryInterface(p, a, b)      (p)->lpVtbl->QueryInterface(p, a, b)
634 #define IDirectDrawPalette_AddRef(p)                    (p)->lpVtbl->AddRef(p)
635 #define IDirectDrawPalette_Release(p)                   (p)->lpVtbl->Release(p)
636 #define IDirectDrawPalette_GetCaps(p, a)                (p)->lpVtbl->GetCaps(p, a)
637 #define IDirectDrawPalette_GetEntries(p, a, b, c, d)    (p)->lpVtbl->GetEntries(p, a, b, c, d)
638 #define IDirectDrawPalette_Initialize(p, a, b, c)       (p)->lpVtbl->Initialize(p, a, b, c)
639 #define IDirectDrawPalette_SetEntries(p, a, b, c, d)    (p)->lpVtbl->SetEntries(p, a, b, c, d)
640 #else
641 #define IDirectDrawPalette_QueryInterface(p, a, b)      (p)->QueryInterface(a, b)
642 #define IDirectDrawPalette_AddRef(p)                    (p)->AddRef()
643 #define IDirectDrawPalette_Release(p)                   (p)->Release()
644 #define IDirectDrawPalette_GetCaps(p, a)                (p)->GetCaps(a)
645 #define IDirectDrawPalette_GetEntries(p, a, b, c, d)    (p)->GetEntries(a, b, c, d)
646 #define IDirectDrawPalette_Initialize(p, a, b, c)       (p)->Initialize(a, b, c)
647 #define IDirectDrawPalette_SetEntries(p, a, b, c, d)    (p)->SetEntries(a, b, c, d)
648 #endif
649
650 #endif
651
652 /*
653  * IDirectDrawClipper
654  */
655 #if defined( _WIN32 ) && !defined( _NO_COM )
656 #undef INTERFACE
657 #define INTERFACE IDirectDrawClipper
658 DECLARE_INTERFACE_( IDirectDrawClipper, IUnknown )
659 {
660     /*** IUnknown methods ***/
661     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
662     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
663     STDMETHOD_(ULONG,Release) (THIS) PURE;
664     /*** IDirectDrawClipper methods ***/
665     STDMETHOD(GetClipList)(THIS_ LPRECT, LPRGNDATA, LPDWORD) PURE;
666     STDMETHOD(GetHWnd)(THIS_ HWND FAR *) PURE;
667     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, DWORD) PURE;
668     STDMETHOD(IsClipListChanged)(THIS_ BOOL FAR *) PURE;
669     STDMETHOD(SetClipList)(THIS_ LPRGNDATA,DWORD) PURE;
670     STDMETHOD(SetHWnd)(THIS_ DWORD, HWND ) PURE;
671 };
672
673 #if !defined(__cplusplus) || defined(CINTERFACE)
674 #define IDirectDrawClipper_QueryInterface(p, a, b)  (p)->lpVtbl->QueryInterface(p, a, b)
675 #define IDirectDrawClipper_AddRef(p)                (p)->lpVtbl->AddRef(p)
676 #define IDirectDrawClipper_Release(p)               (p)->lpVtbl->Release(p)
677 #define IDirectDrawClipper_GetClipList(p, a, b, c)  (p)->lpVtbl->GetClipList(p, a, b, c)
678 #define IDirectDrawClipper_GetHWnd(p, a)            (p)->lpVtbl->GetHWnd(p, a)
679 #define IDirectDrawClipper_Initialize(p, a, b)      (p)->lpVtbl->Initialize(p, a, b)
680 #define IDirectDrawClipper_IsClipListChanged(p, a)  (p)->lpVtbl->IsClipListChanged(p, a)
681 #define IDirectDrawClipper_SetClipList(p, a, b)     (p)->lpVtbl->SetClipList(p, a, b)
682 #define IDirectDrawClipper_SetHWnd(p, a, b)         (p)->lpVtbl->SetHWnd(p, a, b)
683 #else
684 #define IDirectDrawClipper_QueryInterface(p, a, b)  (p)->QueryInterface(a, b)
685 #define IDirectDrawClipper_AddRef(p)                (p)->AddRef()
686 #define IDirectDrawClipper_Release(p)               (p)->Release()
687 #define IDirectDrawClipper_GetClipList(p, a, b, c)  (p)->GetClipList(a, b, c)
688 #define IDirectDrawClipper_GetHWnd(p, a)            (p)->GetHWnd(a)
689 #define IDirectDrawClipper_Initialize(p, a, b)      (p)->Initialize(a, b)
690 #define IDirectDrawClipper_IsClipListChanged(p, a)  (p)->IsClipListChanged(a)
691 #define IDirectDrawClipper_SetClipList(p, a, b)     (p)->SetClipList(a, b)
692 #define IDirectDrawClipper_SetHWnd(p, a, b)         (p)->SetHWnd(a, b)
693 #endif
694
695 #endif
696
697 /*
698  * IDirectDrawSurface and related interfaces
699  */
700 #if defined( _WIN32 ) && !defined( _NO_COM )
701 #undef INTERFACE
702 #define INTERFACE IDirectDrawSurface
703 DECLARE_INTERFACE_( IDirectDrawSurface, IUnknown )
704 {
705     /*** IUnknown methods ***/
706     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
707     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
708     STDMETHOD_(ULONG,Release) (THIS) PURE;
709     /*** IDirectDrawSurface methods ***/
710     STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE) PURE;
711     STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE;
712     STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE, LPRECT,DWORD, LPDDBLTFX) PURE;
713     STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE;
714     STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE, LPRECT,DWORD) PURE;
715     STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE) PURE;
716     STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
717     STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
718     STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE;
719     STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE FAR *) PURE;
720     STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE;
721     STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE;
722     STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE;
723     STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
724     STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE;
725     STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE;
726     STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE;
727     STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE;
728     STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE;
729     STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE;
730     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE;
731     STDMETHOD(IsLost)(THIS) PURE;
732     STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE;
733     STDMETHOD(ReleaseDC)(THIS_ HDC) PURE;
734     STDMETHOD(Restore)(THIS) PURE;
735     STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE;
736     STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
737     STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE;
738     STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE;
739     STDMETHOD(Unlock)(THIS_ LPVOID) PURE;
740     STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE,LPRECT,DWORD, LPDDOVERLAYFX) PURE;
741     STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE;
742     STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE) PURE;
743 };
744
745 #if !defined(__cplusplus) || defined(CINTERFACE)
746 #define IDirectDrawSurface_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
747 #define IDirectDrawSurface_AddRef(p)                    (p)->lpVtbl->AddRef(p)
748 #define IDirectDrawSurface_Release(p)                   (p)->lpVtbl->Release(p)
749 #define IDirectDrawSurface_AddAttachedSurface(p,a)      (p)->lpVtbl->AddAttachedSurface(p,a)
750 #define IDirectDrawSurface_AddOverlayDirtyRect(p,a)     (p)->lpVtbl->AddOverlayDirtyRect(p,a)
751 #define IDirectDrawSurface_Blt(p,a,b,c,d,e)             (p)->lpVtbl->Blt(p,a,b,c,d,e)
752 #define IDirectDrawSurface_BltBatch(p,a,b,c)            (p)->lpVtbl->BltBatch(p,a,b,c)
753 #define IDirectDrawSurface_BltFast(p,a,b,c,d,e)         (p)->lpVtbl->BltFast(p,a,b,c,d,e)
754 #define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b)
755 #define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b)  (p)->lpVtbl->EnumAttachedSurfaces(p,a,b)
756 #define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c)  (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c)
757 #define IDirectDrawSurface_Flip(p,a,b)                  (p)->lpVtbl->Flip(p,a,b)
758 #define IDirectDrawSurface_GetAttachedSurface(p,a,b)    (p)->lpVtbl->GetAttachedSurface(p,a,b)
759 #define IDirectDrawSurface_GetBltStatus(p,a)            (p)->lpVtbl->GetBltStatus(p,a)
760 #define IDirectDrawSurface_GetCaps(p,b)                 (p)->lpVtbl->GetCaps(p,b)
761 #define IDirectDrawSurface_GetClipper(p,a)              (p)->lpVtbl->GetClipper(p,a)
762 #define IDirectDrawSurface_GetColorKey(p,a,b)           (p)->lpVtbl->GetColorKey(p,a,b)
763 #define IDirectDrawSurface_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
764 #define IDirectDrawSurface_GetFlipStatus(p,a)           (p)->lpVtbl->GetFlipStatus(p,a)
765 #define IDirectDrawSurface_GetOverlayPosition(p,a,b)    (p)->lpVtbl->GetOverlayPosition(p,a,b)
766 #define IDirectDrawSurface_GetPalette(p,a)              (p)->lpVtbl->GetPalette(p,a)
767 #define IDirectDrawSurface_GetPixelFormat(p,a)          (p)->lpVtbl->GetPixelFormat(p,a)
768 #define IDirectDrawSurface_GetSurfaceDesc(p,a)          (p)->lpVtbl->GetSurfaceDesc(p,a)
769 #define IDirectDrawSurface_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
770 #define IDirectDrawSurface_IsLost(p)                    (p)->lpVtbl->IsLost(p)
771 #define IDirectDrawSurface_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
772 #define IDirectDrawSurface_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
773 #define IDirectDrawSurface_Restore(p)                   (p)->lpVtbl->Restore(p)
774 #define IDirectDrawSurface_SetClipper(p,a)              (p)->lpVtbl->SetClipper(p,a)
775 #define IDirectDrawSurface_SetColorKey(p,a,b)           (p)->lpVtbl->SetColorKey(p,a,b)
776 #define IDirectDrawSurface_SetOverlayPosition(p,a,b)    (p)->lpVtbl->SetOverlayPosition(p,a,b)
777 #define IDirectDrawSurface_SetPalette(p,a)              (p)->lpVtbl->SetPalette(p,a)
778 #define IDirectDrawSurface_Unlock(p,b)                  (p)->lpVtbl->Unlock(p,b)
779 #define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e)   (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e)
780 #define IDirectDrawSurface_UpdateOverlayDisplay(p,a)    (p)->lpVtbl->UpdateOverlayDisplay(p,a)
781 #define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b)   (p)->lpVtbl->UpdateOverlayZOrder(p,a,b)
782 #else
783 #define IDirectDrawSurface_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
784 #define IDirectDrawSurface_AddRef(p)                    (p)->AddRef()
785 #define IDirectDrawSurface_Release(p)                   (p)->Release()
786 #define IDirectDrawSurface_AddAttachedSurface(p,a)      (p)->AddAttachedSurface(a)
787 #define IDirectDrawSurface_AddOverlayDirtyRect(p,a)     (p)->AddOverlayDirtyRect(a)
788 #define IDirectDrawSurface_Blt(p,a,b,c,d,e)             (p)->Blt(a,b,c,d,e)
789 #define IDirectDrawSurface_BltBatch(p,a,b,c)            (p)->BltBatch(a,b,c)
790 #define IDirectDrawSurface_BltFast(p,a,b,c,d,e)         (p)->BltFast(a,b,c,d,e)
791 #define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b)
792 #define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b)  (p)->EnumAttachedSurfaces(a,b)
793 #define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c)  (p)->EnumOverlayZOrders(a,b,c)
794 #define IDirectDrawSurface_Flip(p,a,b)                  (p)->Flip(a,b)
795 #define IDirectDrawSurface_GetAttachedSurface(p,a,b)    (p)->GetAttachedSurface(a,b)
796 #define IDirectDrawSurface_GetBltStatus(p,a)            (p)->GetBltStatus(a)
797 #define IDirectDrawSurface_GetCaps(p,b)                 (p)->GetCaps(b)
798 #define IDirectDrawSurface_GetClipper(p,a)              (p)->GetClipper(a)
799 #define IDirectDrawSurface_GetColorKey(p,a,b)           (p)->GetColorKey(a,b)
800 #define IDirectDrawSurface_GetDC(p,a)                   (p)->GetDC(a)
801 #define IDirectDrawSurface_GetFlipStatus(p,a)           (p)->GetFlipStatus(a)
802 #define IDirectDrawSurface_GetOverlayPosition(p,a,b)    (p)->GetOverlayPosition(a,b)
803 #define IDirectDrawSurface_GetPalette(p,a)              (p)->GetPalette(a)
804 #define IDirectDrawSurface_GetPixelFormat(p,a)          (p)->GetPixelFormat(a)
805 #define IDirectDrawSurface_GetSurfaceDesc(p,a)          (p)->GetSurfaceDesc(a)
806 #define IDirectDrawSurface_Initialize(p,a,b)            (p)->Initialize(a,b)
807 #define IDirectDrawSurface_IsLost(p)                    (p)->IsLost()
808 #define IDirectDrawSurface_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
809 #define IDirectDrawSurface_ReleaseDC(p,a)               (p)->ReleaseDC(a)
810 #define IDirectDrawSurface_Restore(p)                   (p)->Restore()
811 #define IDirectDrawSurface_SetClipper(p,a)              (p)->SetClipper(a)
812 #define IDirectDrawSurface_SetColorKey(p,a,b)           (p)->SetColorKey(a,b)
813 #define IDirectDrawSurface_SetOverlayPosition(p,a,b)    (p)->SetOverlayPosition(a,b)
814 #define IDirectDrawSurface_SetPalette(p,a)              (p)->SetPalette(a)
815 #define IDirectDrawSurface_Unlock(p,b)                  (p)->Unlock(b)
816 #define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e)   (p)->UpdateOverlay(a,b,c,d,e)
817 #define IDirectDrawSurface_UpdateOverlayDisplay(p,a)    (p)->UpdateOverlayDisplay(a)
818 #define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b)   (p)->UpdateOverlayZOrder(a,b)
819 #endif
820
821 /*
822  * IDirectDrawSurface2 and related interfaces
823  */
824 #undef INTERFACE
825 #define INTERFACE IDirectDrawSurface2
826 DECLARE_INTERFACE_( IDirectDrawSurface2, IUnknown )
827 {
828     /*** IUnknown methods ***/
829     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
830     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
831     STDMETHOD_(ULONG,Release) (THIS) PURE;
832     /*** IDirectDrawSurface methods ***/
833     STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE2) PURE;
834     STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE;
835     STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE2, LPRECT,DWORD, LPDDBLTFX) PURE;
836     STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE;
837     STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE2, LPRECT,DWORD) PURE;
838     STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE2) PURE;
839     STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
840     STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
841     STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE2, DWORD) PURE;
842     STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE2 FAR *) PURE;
843     STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE;
844     STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE;
845     STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE;
846     STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
847     STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE;
848     STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE;
849     STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE;
850     STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE;
851     STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE;
852     STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE;
853     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE;
854     STDMETHOD(IsLost)(THIS) PURE;
855     STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE;
856     STDMETHOD(ReleaseDC)(THIS_ HDC) PURE;
857     STDMETHOD(Restore)(THIS) PURE;
858     STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE;
859     STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
860     STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE;
861     STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE;
862     STDMETHOD(Unlock)(THIS_ LPVOID) PURE;
863     STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE2,LPRECT,DWORD, LPDDOVERLAYFX) PURE;
864     STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE;
865     STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE2) PURE;
866     /*** Added in the v2 interface ***/
867     STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE;
868     STDMETHOD(PageLock)(THIS_ DWORD) PURE;
869     STDMETHOD(PageUnlock)(THIS_ DWORD) PURE;
870 };
871
872 #if !defined(__cplusplus) || defined(CINTERFACE)
873 #define IDirectDrawSurface2_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
874 #define IDirectDrawSurface2_AddRef(p)                    (p)->lpVtbl->AddRef(p)
875 #define IDirectDrawSurface2_Release(p)                   (p)->lpVtbl->Release(p)
876 #define IDirectDrawSurface2_AddAttachedSurface(p,a)      (p)->lpVtbl->AddAttachedSurface(p,a)
877 #define IDirectDrawSurface2_AddOverlayDirtyRect(p,a)     (p)->lpVtbl->AddOverlayDirtyRect(p,a)
878 #define IDirectDrawSurface2_Blt(p,a,b,c,d,e)             (p)->lpVtbl->Blt(p,a,b,c,d,e)
879 #define IDirectDrawSurface2_BltBatch(p,a,b,c)            (p)->lpVtbl->BltBatch(p,a,b,c)
880 #define IDirectDrawSurface2_BltFast(p,a,b,c,d,e)         (p)->lpVtbl->BltFast(p,a,b,c,d,e)
881 #define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b)
882 #define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b)  (p)->lpVtbl->EnumAttachedSurfaces(p,a,b)
883 #define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c)  (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c)
884 #define IDirectDrawSurface2_Flip(p,a,b)                  (p)->lpVtbl->Flip(p,a,b)
885 #define IDirectDrawSurface2_GetAttachedSurface(p,a,b)    (p)->lpVtbl->GetAttachedSurface(p,a,b)
886 #define IDirectDrawSurface2_GetBltStatus(p,a)            (p)->lpVtbl->GetBltStatus(p,a)
887 #define IDirectDrawSurface2_GetCaps(p,b)                 (p)->lpVtbl->GetCaps(p,b)
888 #define IDirectDrawSurface2_GetClipper(p,a)              (p)->lpVtbl->GetClipper(p,a)
889 #define IDirectDrawSurface2_GetColorKey(p,a,b)           (p)->lpVtbl->GetColorKey(p,a,b)
890 #define IDirectDrawSurface2_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
891 #define IDirectDrawSurface2_GetFlipStatus(p,a)           (p)->lpVtbl->GetFlipStatus(p,a)
892 #define IDirectDrawSurface2_GetOverlayPosition(p,a,b)    (p)->lpVtbl->GetOverlayPosition(p,a,b)
893 #define IDirectDrawSurface2_GetPalette(p,a)              (p)->lpVtbl->GetPalette(p,a)
894 #define IDirectDrawSurface2_GetPixelFormat(p,a)          (p)->lpVtbl->GetPixelFormat(p,a)
895 #define IDirectDrawSurface2_GetSurfaceDesc(p,a)          (p)->lpVtbl->GetSurfaceDesc(p,a)
896 #define IDirectDrawSurface2_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
897 #define IDirectDrawSurface2_IsLost(p)                    (p)->lpVtbl->IsLost(p)
898 #define IDirectDrawSurface2_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
899 #define IDirectDrawSurface2_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
900 #define IDirectDrawSurface2_Restore(p)                   (p)->lpVtbl->Restore(p)
901 #define IDirectDrawSurface2_SetClipper(p,a)              (p)->lpVtbl->SetClipper(p,a)
902 #define IDirectDrawSurface2_SetColorKey(p,a,b)           (p)->lpVtbl->SetColorKey(p,a,b)
903 #define IDirectDrawSurface2_SetOverlayPosition(p,a,b)    (p)->lpVtbl->SetOverlayPosition(p,a,b)
904 #define IDirectDrawSurface2_SetPalette(p,a)              (p)->lpVtbl->SetPalette(p,a)
905 #define IDirectDrawSurface2_Unlock(p,b)                  (p)->lpVtbl->Unlock(p,b)
906 #define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e)   (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e)
907 #define IDirectDrawSurface2_UpdateOverlayDisplay(p,a)    (p)->lpVtbl->UpdateOverlayDisplay(p,a)
908 #define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b)   (p)->lpVtbl->UpdateOverlayZOrder(p,a,b)
909 #define IDirectDrawSurface2_GetDDInterface(p,a)          (p)->lpVtbl->GetDDInterface(p,a)
910 #define IDirectDrawSurface2_PageLock(p,a)                (p)->lpVtbl->PageLock(p,a)
911 #define IDirectDrawSurface2_PageUnlock(p,a)              (p)->lpVtbl->PageUnlock(p,a)
912 #else
913 #define IDirectDrawSurface2_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
914 #define IDirectDrawSurface2_AddRef(p)                    (p)->AddRef()
915 #define IDirectDrawSurface2_Release(p)                   (p)->Release()
916 #define IDirectDrawSurface2_AddAttachedSurface(p,a)      (p)->AddAttachedSurface(a)
917 #define IDirectDrawSurface2_AddOverlayDirtyRect(p,a)     (p)->AddOverlayDirtyRect(a)
918 #define IDirectDrawSurface2_Blt(p,a,b,c,d,e)             (p)->Blt(a,b,c,d,e)
919 #define IDirectDrawSurface2_BltBatch(p,a,b,c)            (p)->BltBatch(a,b,c)
920 #define IDirectDrawSurface2_BltFast(p,a,b,c,d,e)         (p)->BltFast(a,b,c,d,e)
921 #define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b)
922 #define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b)  (p)->EnumAttachedSurfaces(a,b)
923 #define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c)  (p)->EnumOverlayZOrders(a,b,c)
924 #define IDirectDrawSurface2_Flip(p,a,b)                  (p)->Flip(a,b)
925 #define IDirectDrawSurface2_GetAttachedSurface(p,a,b)    (p)->GetAttachedSurface(a,b)
926 #define IDirectDrawSurface2_GetBltStatus(p,a)            (p)->GetBltStatus(a)
927 #define IDirectDrawSurface2_GetCaps(p,b)                 (p)->GetCaps(b)
928 #define IDirectDrawSurface2_GetClipper(p,a)              (p)->GetClipper(a)
929 #define IDirectDrawSurface2_GetColorKey(p,a,b)           (p)->GetColorKey(a,b)
930 #define IDirectDrawSurface2_GetDC(p,a)                   (p)->GetDC(a)
931 #define IDirectDrawSurface2_GetFlipStatus(p,a)           (p)->GetFlipStatus(a)
932 #define IDirectDrawSurface2_GetOverlayPosition(p,a,b)    (p)->GetOverlayPosition(a,b)
933 #define IDirectDrawSurface2_GetPalette(p,a)              (p)->GetPalette(a)
934 #define IDirectDrawSurface2_GetPixelFormat(p,a)          (p)->GetPixelFormat(a)
935 #define IDirectDrawSurface2_GetSurfaceDesc(p,a)          (p)->GetSurfaceDesc(a)
936 #define IDirectDrawSurface2_Initialize(p,a,b)            (p)->Initialize(a,b)
937 #define IDirectDrawSurface2_IsLost(p)                    (p)->IsLost()
938 #define IDirectDrawSurface2_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
939 #define IDirectDrawSurface2_ReleaseDC(p,a)               (p)->ReleaseDC(a)
940 #define IDirectDrawSurface2_Restore(p)                   (p)->Restore()
941 #define IDirectDrawSurface2_SetClipper(p,a)              (p)->SetClipper(a)
942 #define IDirectDrawSurface2_SetColorKey(p,a,b)           (p)->SetColorKey(a,b)
943 #define IDirectDrawSurface2_SetOverlayPosition(p,a,b)    (p)->SetOverlayPosition(a,b)
944 #define IDirectDrawSurface2_SetPalette(p,a)              (p)->SetPalette(a)
945 #define IDirectDrawSurface2_Unlock(p,b)                  (p)->Unlock(b)
946 #define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e)   (p)->UpdateOverlay(a,b,c,d,e)
947 #define IDirectDrawSurface2_UpdateOverlayDisplay(p,a)    (p)->UpdateOverlayDisplay(a)
948 #define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b)   (p)->UpdateOverlayZOrder(a,b)
949 #define IDirectDrawSurface2_GetDDInterface(p,a)          (p)->GetDDInterface(a)
950 #define IDirectDrawSurface2_PageLock(p,a)                (p)->PageLock(a)
951 #define IDirectDrawSurface2_PageUnlock(p,a)              (p)->PageUnlock(a)
952 #endif
953
954 /*
955  * IDirectDrawSurface3 and related interfaces
956  */
957 #undef INTERFACE
958 #define INTERFACE IDirectDrawSurface3
959 DECLARE_INTERFACE_( IDirectDrawSurface3, IUnknown )
960 {
961     /*** IUnknown methods ***/
962     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
963     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
964     STDMETHOD_(ULONG,Release) (THIS) PURE;
965     /*** IDirectDrawSurface methods ***/
966     STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE3) PURE;
967     STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE;
968     STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE3, LPRECT,DWORD, LPDDBLTFX) PURE;
969     STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE;
970     STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE3, LPRECT,DWORD) PURE;
971     STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE3) PURE;
972     STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
973     STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
974     STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE3, DWORD) PURE;
975     STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE3 FAR *) PURE;
976     STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE;
977     STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE;
978     STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE;
979     STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
980     STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE;
981     STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE;
982     STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE;
983     STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE;
984     STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE;
985     STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE;
986     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE;
987     STDMETHOD(IsLost)(THIS) PURE;
988     STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE;
989     STDMETHOD(ReleaseDC)(THIS_ HDC) PURE;
990     STDMETHOD(Restore)(THIS) PURE;
991     STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE;
992     STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
993     STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE;
994     STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE;
995     STDMETHOD(Unlock)(THIS_ LPVOID) PURE;
996     STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE3,LPRECT,DWORD, LPDDOVERLAYFX) PURE;
997     STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE;
998     STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE3) PURE;
999     /*** Added in the v2 interface ***/
1000     STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE;
1001     STDMETHOD(PageLock)(THIS_ DWORD) PURE;
1002     STDMETHOD(PageUnlock)(THIS_ DWORD) PURE;
1003     /*** Added in the V3 interface ***/
1004     STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC, DWORD) PURE;
1005 };
1006
1007 #if !defined(__cplusplus) || defined(CINTERFACE)
1008 #define IDirectDrawSurface3_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
1009 #define IDirectDrawSurface3_AddRef(p)                    (p)->lpVtbl->AddRef(p)
1010 #define IDirectDrawSurface3_Release(p)                   (p)->lpVtbl->Release(p)
1011 #define IDirectDrawSurface3_AddAttachedSurface(p,a)      (p)->lpVtbl->AddAttachedSurface(p,a)
1012 #define IDirectDrawSurface3_AddOverlayDirtyRect(p,a)     (p)->lpVtbl->AddOverlayDirtyRect(p,a)
1013 #define IDirectDrawSurface3_Blt(p,a,b,c,d,e)             (p)->lpVtbl->Blt(p,a,b,c,d,e)
1014 #define IDirectDrawSurface3_BltBatch(p,a,b,c)            (p)->lpVtbl->BltBatch(p,a,b,c)
1015 #define IDirectDrawSurface3_BltFast(p,a,b,c,d,e)         (p)->lpVtbl->BltFast(p,a,b,c,d,e)
1016 #define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b)
1017 #define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b)  (p)->lpVtbl->EnumAttachedSurfaces(p,a,b)
1018 #define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c)  (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c)
1019 #define IDirectDrawSurface3_Flip(p,a,b)                  (p)->lpVtbl->Flip(p,a,b)
1020 #define IDirectDrawSurface3_GetAttachedSurface(p,a,b)    (p)->lpVtbl->GetAttachedSurface(p,a,b)
1021 #define IDirectDrawSurface3_GetBltStatus(p,a)            (p)->lpVtbl->GetBltStatus(p,a)
1022 #define IDirectDrawSurface3_GetCaps(p,b)                 (p)->lpVtbl->GetCaps(p,b)
1023 #define IDirectDrawSurface3_GetClipper(p,a)              (p)->lpVtbl->GetClipper(p,a)
1024 #define IDirectDrawSurface3_GetColorKey(p,a,b)           (p)->lpVtbl->GetColorKey(p,a,b)
1025 #define IDirectDrawSurface3_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
1026 #define IDirectDrawSurface3_GetFlipStatus(p,a)           (p)->lpVtbl->GetFlipStatus(p,a)
1027 #define IDirectDrawSurface3_GetOverlayPosition(p,a,b)    (p)->lpVtbl->GetOverlayPosition(p,a,b)
1028 #define IDirectDrawSurface3_GetPalette(p,a)              (p)->lpVtbl->GetPalette(p,a)
1029 #define IDirectDrawSurface3_GetPixelFormat(p,a)          (p)->lpVtbl->GetPixelFormat(p,a)
1030 #define IDirectDrawSurface3_GetSurfaceDesc(p,a)          (p)->lpVtbl->GetSurfaceDesc(p,a)
1031 #define IDirectDrawSurface3_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
1032 #define IDirectDrawSurface3_IsLost(p)                    (p)->lpVtbl->IsLost(p)
1033 #define IDirectDrawSurface3_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
1034 #define IDirectDrawSurface3_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
1035 #define IDirectDrawSurface3_Restore(p)                   (p)->lpVtbl->Restore(p)
1036 #define IDirectDrawSurface3_SetClipper(p,a)              (p)->lpVtbl->SetClipper(p,a)
1037 #define IDirectDrawSurface3_SetColorKey(p,a,b)           (p)->lpVtbl->SetColorKey(p,a,b)
1038 #define IDirectDrawSurface3_SetOverlayPosition(p,a,b)    (p)->lpVtbl->SetOverlayPosition(p,a,b)
1039 #define IDirectDrawSurface3_SetPalette(p,a)              (p)->lpVtbl->SetPalette(p,a)
1040 #define IDirectDrawSurface3_Unlock(p,b)                  (p)->lpVtbl->Unlock(p,b)
1041 #define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e)   (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e)
1042 #define IDirectDrawSurface3_UpdateOverlayDisplay(p,a)    (p)->lpVtbl->UpdateOverlayDisplay(p,a)
1043 #define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b)   (p)->lpVtbl->UpdateOverlayZOrder(p,a,b)
1044 #define IDirectDrawSurface3_GetDDInterface(p,a)          (p)->lpVtbl->GetDDInterface(p,a)
1045 #define IDirectDrawSurface3_PageLock(p,a)                (p)->lpVtbl->PageLock(p,a)
1046 #define IDirectDrawSurface3_PageUnlock(p,a)              (p)->lpVtbl->PageUnlock(p,a)
1047 #define IDirectDrawSurface3_SetSurfaceDesc(p,a,b)        (p)->lpVtbl->SetSurfaceDesc(p,a,b)
1048 #else
1049 #define IDirectDrawSurface3_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
1050 #define IDirectDrawSurface3_AddRef(p)                    (p)->AddRef()
1051 #define IDirectDrawSurface3_Release(p)                   (p)->Release()
1052 #define IDirectDrawSurface3_AddAttachedSurface(p,a)      (p)->AddAttachedSurface(a)
1053 #define IDirectDrawSurface3_AddOverlayDirtyRect(p,a)     (p)->AddOverlayDirtyRect(a)
1054 #define IDirectDrawSurface3_Blt(p,a,b,c,d,e)             (p)->Blt(a,b,c,d,e)
1055 #define IDirectDrawSurface3_BltBatch(p,a,b,c)            (p)->BltBatch(a,b,c)
1056 #define IDirectDrawSurface3_BltFast(p,a,b,c,d,e)         (p)->BltFast(a,b,c,d,e)
1057 #define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b)
1058 #define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b)  (p)->EnumAttachedSurfaces(a,b)
1059 #define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c)  (p)->EnumOverlayZOrders(a,b,c)
1060 #define IDirectDrawSurface3_Flip(p,a,b)                  (p)->Flip(a,b)
1061 #define IDirectDrawSurface3_GetAttachedSurface(p,a,b)    (p)->GetAttachedSurface(a,b)
1062 #define IDirectDrawSurface3_GetBltStatus(p,a)            (p)->GetBltStatus(a)
1063 #define IDirectDrawSurface3_GetCaps(p,b)                 (p)->GetCaps(b)
1064 #define IDirectDrawSurface3_GetClipper(p,a)              (p)->GetClipper(a)
1065 #define IDirectDrawSurface3_GetColorKey(p,a,b)           (p)->GetColorKey(a,b)
1066 #define IDirectDrawSurface3_GetDC(p,a)                   (p)->GetDC(a)
1067 #define IDirectDrawSurface3_GetFlipStatus(p,a)           (p)->GetFlipStatus(a)
1068 #define IDirectDrawSurface3_GetOverlayPosition(p,a,b)    (p)->GetOverlayPosition(a,b)
1069 #define IDirectDrawSurface3_GetPalette(p,a)              (p)->GetPalette(a)
1070 #define IDirectDrawSurface3_GetPixelFormat(p,a)          (p)->GetPixelFormat(a)
1071 #define IDirectDrawSurface3_GetSurfaceDesc(p,a)          (p)->GetSurfaceDesc(a)
1072 #define IDirectDrawSurface3_Initialize(p,a,b)            (p)->Initialize(a,b)
1073 #define IDirectDrawSurface3_IsLost(p)                    (p)->IsLost()
1074 #define IDirectDrawSurface3_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
1075 #define IDirectDrawSurface3_ReleaseDC(p,a)               (p)->ReleaseDC(a)
1076 #define IDirectDrawSurface3_Restore(p)                   (p)->Restore()
1077 #define IDirectDrawSurface3_SetClipper(p,a)              (p)->SetClipper(a)
1078 #define IDirectDrawSurface3_SetColorKey(p,a,b)           (p)->SetColorKey(a,b)
1079 #define IDirectDrawSurface3_SetOverlayPosition(p,a,b)    (p)->SetOverlayPosition(a,b)
1080 #define IDirectDrawSurface3_SetPalette(p,a)              (p)->SetPalette(a)
1081 #define IDirectDrawSurface3_Unlock(p,b)                  (p)->Unlock(b)
1082 #define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e)   (p)->UpdateOverlay(a,b,c,d,e)
1083 #define IDirectDrawSurface3_UpdateOverlayDisplay(p,a)    (p)->UpdateOverlayDisplay(a)
1084 #define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b)   (p)->UpdateOverlayZOrder(a,b)
1085 #define IDirectDrawSurface3_GetDDInterface(p,a)          (p)->GetDDInterface(a)
1086 #define IDirectDrawSurface3_PageLock(p,a)                (p)->PageLock(a)
1087 #define IDirectDrawSurface3_PageUnlock(p,a)              (p)->PageUnlock(a)
1088 #define IDirectDrawSurface3_SetSurfaceDesc(p,a,b)        (p)->SetSurfaceDesc(a,b)
1089 #endif
1090
1091 /*
1092  * IDirectDrawColorControl
1093  */
1094 #if defined( _WIN32 ) && !defined( _NO_COM )
1095 #undef INTERFACE
1096 #define INTERFACE IDirectDrawColorControl
1097 DECLARE_INTERFACE_( IDirectDrawColorControl, IUnknown )
1098 {
1099     /*** IUnknown methods ***/
1100     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
1101     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
1102     STDMETHOD_(ULONG,Release) (THIS) PURE;
1103     /*** IDirectDrawColorControl methods ***/
1104     STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL) PURE;
1105     STDMETHOD(SetColorControls)(THIS_ LPDDCOLORCONTROL) PURE;
1106 };
1107
1108 #if !defined(__cplusplus) || defined(CINTERFACE)
1109 #define IDirectDrawColorControl_QueryInterface(p, a, b)  (p)->lpVtbl->QueryInterface(p, a, b)
1110 #define IDirectDrawColorControl_AddRef(p)                (p)->lpVtbl->AddRef(p)
1111 #define IDirectDrawColorControl_Release(p)               (p)->lpVtbl->Release(p)
1112 #define IDirectDrawColorControl_GetColorControls(p, a)   (p)->lpVtbl->GetColorControls(p, a)
1113 #define IDirectDrawColorControl_SetColorControls(p, a)   (p)->lpVtbl->SetColorControls(p, a)
1114 #else
1115 #define IDirectDrawColorControl_QueryInterface(p, a, b)  (p)->QueryInterface(a, b)
1116 #define IDirectDrawColorControl_AddRef(p)                (p)->AddRef()
1117 #define IDirectDrawColorControl_Release(p)               (p)->Release()
1118 #define IDirectDrawColorControl_GetColorControls(p, a)   (p)->GetColorControls(a)
1119 #define IDirectDrawColorControl_SetColorControls(p, a)   (p)->SetColorControls(a)
1120 #endif
1121
1122 #endif
1123
1124
1125
1126 #endif
1127
1128
1129 /*
1130  * DDSURFACEDESC
1131  */
1132 typedef struct _DDSURFACEDESC
1133 {
1134     DWORD               dwSize;                 // size of the DDSURFACEDESC structure
1135     DWORD               dwFlags;                // determines what fields are valid
1136     DWORD               dwHeight;               // height of surface to be created
1137     DWORD               dwWidth;                // width of input surface
1138     union
1139     {
1140         LONG            lPitch;                 // distance to start of next line (return value only)
1141         DWORD           dwLinearSize;           // Formless late-allocated optimized surface size
1142     };
1143     DWORD               dwBackBufferCount;      // number of back buffers requested
1144     union
1145     {
1146         DWORD           dwMipMapCount;          // number of mip-map levels requested
1147         DWORD           dwZBufferBitDepth;      // depth of Z buffer requested
1148         DWORD           dwRefreshRate;          // refresh rate (used when display mode is described)
1149     };
1150     DWORD               dwAlphaBitDepth;        // depth of alpha buffer requested
1151     DWORD               dwReserved;             // reserved
1152     LPVOID              lpSurface;              // pointer to the associated surface memory
1153     DDCOLORKEY          ddckCKDestOverlay;      // color key for destination overlay use
1154     DDCOLORKEY          ddckCKDestBlt;          // color key for destination blt use
1155     DDCOLORKEY          ddckCKSrcOverlay;       // color key for source overlay use
1156     DDCOLORKEY          ddckCKSrcBlt;           // color key for source blt use
1157     DDPIXELFORMAT       ddpfPixelFormat;        // pixel format description of the surface
1158     DDSCAPS             ddsCaps;                // direct draw surface capabilities
1159 } DDSURFACEDESC;
1160
1161 /*
1162  * ddsCaps field is valid.
1163  */
1164 #define DDSD_CAPS               0x00000001l     // default
1165
1166 /*
1167  * dwHeight field is valid.
1168  */
1169 #define DDSD_HEIGHT             0x00000002l
1170
1171 /*
1172  * dwWidth field is valid.
1173  */
1174 #define DDSD_WIDTH              0x00000004l
1175
1176 /*
1177  * lPitch is valid.
1178  */
1179 #define DDSD_PITCH              0x00000008l
1180
1181 /*
1182  * dwBackBufferCount is valid.
1183  */
1184 #define DDSD_BACKBUFFERCOUNT    0x00000020l
1185
1186 /*
1187  * dwZBufferBitDepth is valid.
1188  */
1189 #define DDSD_ZBUFFERBITDEPTH    0x00000040l
1190
1191 /*
1192  * dwAlphaBitDepth is valid.
1193  */
1194 #define DDSD_ALPHABITDEPTH      0x00000080l
1195
1196
1197 /*
1198  * lpSurface is valid.
1199  */
1200 #define DDSD_LPSURFACE          0x00000800l
1201
1202 /*
1203  * ddpfPixelFormat is valid.
1204  */
1205 #define DDSD_PIXELFORMAT        0x00001000l
1206
1207 /*
1208  * ddckCKDestOverlay is valid.
1209  */
1210 #define DDSD_CKDESTOVERLAY      0x00002000l
1211
1212 /*
1213  * ddckCKDestBlt is valid.
1214  */
1215 #define DDSD_CKDESTBLT          0x00004000l
1216
1217 /*
1218  * ddckCKSrcOverlay is valid.
1219  */
1220 #define DDSD_CKSRCOVERLAY       0x00008000l
1221
1222 /*
1223  * ddckCKSrcBlt is valid.
1224  */
1225 #define DDSD_CKSRCBLT           0x00010000l
1226
1227 /*
1228  * dwMipMapCount is valid.
1229  */
1230 #define DDSD_MIPMAPCOUNT        0x00020000l
1231
1232  /*
1233   * dwRefreshRate is valid
1234   */
1235 #define DDSD_REFRESHRATE        0x00040000l
1236
1237 /*
1238  * dwLinearSize is valid
1239  */
1240 #define DDSD_LINEARSIZE         0x00080000l
1241
1242 /*
1243  * All input fields are valid.
1244  */
1245 #define DDSD_ALL                0x000ff9eel
1246
1247
1248 /*
1249  * DDCOLORCONTROL
1250  */
1251 typedef struct _DDCOLORCONTROL
1252 {
1253     DWORD               dwSize;
1254     DWORD               dwFlags;
1255     LONG                lBrightness;
1256     LONG                lContrast;
1257     LONG                lHue;
1258     LONG                lSaturation;
1259     LONG                lSharpness;
1260     LONG                lGamma;
1261     LONG                lColorEnable;
1262     DWORD               dwReserved1;
1263 } DDCOLORCONTROL;
1264
1265
1266 /*
1267  * lBrightness field is valid.
1268  */
1269 #define DDCOLOR_BRIGHTNESS              0x00000001l
1270
1271 /*
1272  * lContrast field is valid.
1273  */
1274 #define DDCOLOR_CONTRAST                0x00000002l
1275
1276 /*
1277  * lHue field is valid.
1278  */
1279 #define DDCOLOR_HUE                     0x00000004l
1280
1281 /*
1282  * lSaturation field is valid.
1283  */
1284 #define DDCOLOR_SATURATION              0x00000008l
1285
1286 /*
1287  * lSharpness field is valid.
1288  */
1289 #define DDCOLOR_SHARPNESS               0x00000010l
1290
1291 /*
1292  * lGamma field is valid.
1293  */
1294 #define DDCOLOR_GAMMA                   0x00000020l
1295
1296 /*
1297  * lColorEnable field is valid.
1298  */
1299 #define DDCOLOR_COLORENABLE             0x00000040l
1300
1301
1302
1303 /*============================================================================
1304  *
1305  * Direct Draw Capability Flags
1306  *
1307  * These flags are used to describe the capabilities of a given Surface.
1308  * All flags are bit flags.
1309  *
1310  *==========================================================================*/
1311
1312 /****************************************************************************
1313  *
1314  * DIRECTDRAWSURFACE CAPABILITY FLAGS
1315  *
1316  ****************************************************************************/
1317
1318 /*
1319  * This bit is reserved. It should not be specified.
1320  */
1321 #define DDSCAPS_RESERVED1                       0x00000001l
1322
1323 /*
1324  * Indicates that this surface contains alpha-only information.
1325  * (To determine if a surface is RGBA/YUVA, the pixel format must be
1326  * interrogated.)
1327  */
1328 #define DDSCAPS_ALPHA                           0x00000002l
1329
1330 /*
1331  * Indicates that this surface is a backbuffer.  It is generally
1332  * set by CreateSurface when the DDSCAPS_FLIP capability bit is set.
1333  * It indicates that this surface is THE back buffer of a surface
1334  * flipping structure.  DirectDraw supports N surfaces in a
1335  * surface flipping structure.  Only the surface that immediately
1336  * precedeces the DDSCAPS_FRONTBUFFER has this capability bit set.
1337  * The other surfaces are identified as back buffers by the presence
1338  * of the DDSCAPS_FLIP capability, their attachment order, and the
1339  * absence of the DDSCAPS_FRONTBUFFER and DDSCAPS_BACKBUFFER
1340  * capabilities.  The bit is sent to CreateSurface when a standalone
1341  * back buffer is being created.  This surface could be attached to
1342  * a front buffer and/or back buffers to form a flipping surface
1343  * structure after the CreateSurface call.  See AddAttachments for
1344  * a detailed description of the behaviors in this case.
1345  */
1346 #define DDSCAPS_BACKBUFFER                      0x00000004l
1347
1348 /*
1349  * Indicates a complex surface structure is being described.  A
1350  * complex surface structure results in the creation of more than
1351  * one surface.  The additional surfaces are attached to the root
1352  * surface.  The complex structure can only be destroyed by
1353  * destroying the root.
1354  */
1355 #define DDSCAPS_COMPLEX                         0x00000008l
1356
1357 /*
1358  * Indicates that this surface is a part of a surface flipping structure.
1359  * When it is passed to CreateSurface the DDSCAPS_FRONTBUFFER and
1360  * DDSCAP_BACKBUFFER bits are not set.  They are set by CreateSurface
1361  * on the resulting creations.  The dwBackBufferCount field in the
1362  * DDSURFACEDESC structure must be set to at least 1 in order for
1363  * the CreateSurface call to succeed.  The DDSCAPS_COMPLEX capability
1364  * must always be set with creating multiple surfaces through CreateSurface.
1365  */
1366 #define DDSCAPS_FLIP                            0x00000010l
1367
1368 /*
1369  * Indicates that this surface is THE front buffer of a surface flipping
1370  * structure.  It is generally set by CreateSurface when the DDSCAPS_FLIP
1371  * capability bit is set.
1372  * If this capability is sent to CreateSurface then a standalonw front buffer
1373  * is created.  This surface will not have the DDSCAPS_FLIP capability.
1374  * It can be attached to other back buffers to form a flipping structure.
1375  * See AddAttachments for a detailed description of the behaviors in this
1376  * case.
1377  */
1378 #define DDSCAPS_FRONTBUFFER                     0x00000020l
1379
1380 /*
1381  * Indicates that this surface is any offscreen surface that is not an overlay,
1382  * texture, zbuffer, front buffer, back buffer, or alpha surface.  It is used
1383  * to identify plain vanilla surfaces.
1384  */
1385 #define DDSCAPS_OFFSCREENPLAIN                  0x00000040l
1386
1387 /*
1388  * Indicates that this surface is an overlay.  It may or may not be directly visible
1389  * depending on whether or not it is currently being overlayed onto the primary
1390  * surface.  DDSCAPS_VISIBLE can be used to determine whether or not it is being
1391  * overlayed at the moment.
1392  */
1393 #define DDSCAPS_OVERLAY                         0x00000080l
1394
1395 /*
1396  * Indicates that unique DirectDrawPalette objects can be created and
1397  * attached to this surface.
1398  */
1399 #define DDSCAPS_PALETTE                         0x00000100l
1400
1401 /*
1402  * Indicates that this surface is the primary surface.  The primary
1403  * surface represents what the user is seeing at the moment.
1404  */
1405 #define DDSCAPS_PRIMARYSURFACE                  0x00000200l
1406
1407 /*
1408  * Indicates that this surface is the primary surface for the left eye.
1409  * The primary surface for the left eye represents what the user is seeing
1410  * at the moment with the users left eye.  When this surface is created the
1411  * DDSCAPS_PRIMARYSURFACE represents what the user is seeing with the users
1412  * right eye.
1413  */
1414 #define DDSCAPS_PRIMARYSURFACELEFT              0x00000400l
1415
1416 /*
1417  * Indicates that this surface memory was allocated in system memory
1418  */
1419 #define DDSCAPS_SYSTEMMEMORY                    0x00000800l
1420
1421 /*
1422  * Indicates that this surface can be used as a 3D texture.  It does not
1423  * indicate whether or not the surface is being used for that purpose.
1424  */
1425 #define DDSCAPS_TEXTURE                         0x00001000l
1426
1427 /*
1428  * Indicates that a surface may be a destination for 3D rendering.  This
1429  * bit must be set in order to query for a Direct3D Device Interface
1430  * from this surface.
1431  */
1432 #define DDSCAPS_3DDEVICE                        0x00002000l
1433
1434 /*
1435  * Indicates that this surface exists in video memory.
1436  */
1437 #define DDSCAPS_VIDEOMEMORY                     0x00004000l
1438
1439 /*
1440  * Indicates that changes made to this surface are immediately visible.
1441  * It is always set for the primary surface and is set for overlays while
1442  * they are being overlayed and texture maps while they are being textured.
1443  */
1444 #define DDSCAPS_VISIBLE                         0x00008000l
1445
1446 /*
1447  * Indicates that only writes are permitted to the surface.  Read accesses
1448  * from the surface may or may not generate a protection fault, but the
1449  * results of a read from this surface will not be meaningful.  READ ONLY.
1450  */
1451 #define DDSCAPS_WRITEONLY                       0x00010000l
1452
1453 /*
1454  * Indicates that this surface is a z buffer. A z buffer does not contain
1455  * displayable information.  Instead it contains bit depth information that is
1456  * used to determine which pixels are visible and which are obscured.
1457  */
1458 #define DDSCAPS_ZBUFFER                         0x00020000l
1459
1460 /*
1461  * Indicates surface will have a DC associated long term
1462  */
1463 #define DDSCAPS_OWNDC                           0x00040000l
1464
1465 /*
1466  * Indicates surface should be able to receive live video
1467  */
1468 #define DDSCAPS_LIVEVIDEO                       0x00080000l
1469
1470 /*
1471  * Indicates surface should be able to have a stream decompressed
1472  * to it by the hardware.
1473  */
1474 #define DDSCAPS_HWCODEC                         0x00100000l
1475
1476 /*
1477  * Surface is a ModeX surface.
1478  *
1479  */
1480 #define DDSCAPS_MODEX                           0x00200000l
1481
1482 /*
1483  * Indicates surface is one level of a mip-map. This surface will
1484  * be attached to other DDSCAPS_MIPMAP surfaces to form the mip-map.
1485  * This can be done explicitly, by creating a number of surfaces and
1486  * attaching them with AddAttachedSurface or by implicitly by CreateSurface.
1487  * If this bit is set then DDSCAPS_TEXTURE must also be set.
1488  */
1489 #define DDSCAPS_MIPMAP                          0x00400000l
1490
1491 /*
1492  * This bit is reserved. It should not be specified.
1493  */
1494 #define DDSCAPS_RESERVED2                       0x00800000l
1495
1496
1497 /*
1498  * Indicates that memory for the surface is not allocated until the surface
1499  * is loaded (via the Direct3D texture Load() function).
1500  */
1501 #define DDSCAPS_ALLOCONLOAD                     0x04000000l
1502
1503 /*
1504  * Indicates that the surface will recieve data from a video port.
1505  */
1506 #define DDSCAPS_VIDEOPORT                       0x08000000l
1507
1508 /*
1509  * Indicates that a video memory surface is resident in true, local video
1510  * memory rather than non-local video memory. If this flag is specified then
1511  * so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with
1512  * DDSCAPS_NONLOCALVIDMEM.
1513  */
1514 #define DDSCAPS_LOCALVIDMEM                     0x10000000l
1515
1516 /*
1517  * Indicates that a video memory surface is resident in non-local video
1518  * memory rather than true, local video memory. If this flag is specified
1519  * then so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with
1520  * DDSCAPS_LOCALVIDMEM.
1521  */
1522 #define DDSCAPS_NONLOCALVIDMEM                  0x20000000l
1523
1524 /*
1525  * Indicates that this surface is a standard VGA mode surface, and not a
1526  * ModeX surface. (This flag will never be set in combination with the
1527  * DDSCAPS_MODEX flag).
1528  */
1529 #define DDSCAPS_STANDARDVGAMODE                 0x40000000l
1530
1531 /*
1532  * Indicates that this surface will be an optimized surface. This flag is
1533  * currently only valid in conjunction with the DDSCAPS_TEXTURE flag. The surface
1534  * will be created without any underlying video memory until loaded.
1535  */
1536 #define DDSCAPS_OPTIMIZED                       0x80000000l
1537
1538
1539
1540  /****************************************************************************
1541  *
1542  * DIRECTDRAW DRIVER CAPABILITY FLAGS
1543  *
1544  ****************************************************************************/
1545
1546 /*
1547  * Display hardware has 3D acceleration.
1548  */
1549 #define DDCAPS_3D                       0x00000001l
1550
1551 /*
1552  * Indicates that DirectDraw will support only dest rectangles that are aligned
1553  * on DIRECTDRAWCAPS.dwAlignBoundaryDest boundaries of the surface, respectively.
1554  * READ ONLY.
1555  */
1556 #define DDCAPS_ALIGNBOUNDARYDEST        0x00000002l
1557
1558 /*
1559  * Indicates that DirectDraw will support only source rectangles  whose sizes in
1560  * BYTEs are DIRECTDRAWCAPS.dwAlignSizeDest multiples, respectively.  READ ONLY.
1561  */
1562 #define DDCAPS_ALIGNSIZEDEST            0x00000004l
1563 /*
1564  * Indicates that DirectDraw will support only source rectangles that are aligned
1565  * on DIRECTDRAWCAPS.dwAlignBoundarySrc boundaries of the surface, respectively.
1566  * READ ONLY.
1567  */
1568 #define DDCAPS_ALIGNBOUNDARYSRC         0x00000008l
1569
1570 /*
1571  * Indicates that DirectDraw will support only source rectangles  whose sizes in
1572  * BYTEs are DIRECTDRAWCAPS.dwAlignSizeSrc multiples, respectively.  READ ONLY.
1573  */
1574 #define DDCAPS_ALIGNSIZESRC             0x00000010l
1575
1576 /*
1577  * Indicates that DirectDraw will create video memory surfaces that have a stride
1578  * alignment equal to DIRECTDRAWCAPS.dwAlignStride.  READ ONLY.
1579  */
1580 #define DDCAPS_ALIGNSTRIDE              0x00000020l
1581
1582 /*
1583  * Display hardware is capable of blt operations.
1584  */
1585 #define DDCAPS_BLT                      0x00000040l
1586
1587 /*
1588  * Display hardware is capable of asynchronous blt operations.
1589  */
1590 #define DDCAPS_BLTQUEUE                 0x00000080l
1591
1592 /*
1593  * Display hardware is capable of color space conversions during the blt operation.
1594  */
1595 #define DDCAPS_BLTFOURCC                0x00000100l
1596
1597 /*
1598  * Display hardware is capable of stretching during blt operations.
1599  */
1600 #define DDCAPS_BLTSTRETCH               0x00000200l
1601
1602 /*
1603  * Display hardware is shared with GDI.
1604  */
1605 #define DDCAPS_GDI                      0x00000400l
1606
1607 /*
1608  * Display hardware can overlay.
1609  */
1610 #define DDCAPS_OVERLAY                  0x00000800l
1611
1612 /*
1613  * Set if display hardware supports overlays but can not clip them.
1614  */
1615 #define DDCAPS_OVERLAYCANTCLIP          0x00001000l
1616
1617 /*
1618  * Indicates that overlay hardware is capable of color space conversions during
1619  * the overlay operation.
1620  */
1621 #define DDCAPS_OVERLAYFOURCC            0x00002000l
1622
1623 /*
1624  * Indicates that stretching can be done by the overlay hardware.
1625  */
1626 #define DDCAPS_OVERLAYSTRETCH           0x00004000l
1627
1628 /*
1629  * Indicates that unique DirectDrawPalettes can be created for DirectDrawSurfaces
1630  * other than the primary surface.
1631  */
1632 #define DDCAPS_PALETTE                  0x00008000l
1633
1634 /*
1635  * Indicates that palette changes can be syncd with the veritcal refresh.
1636  */
1637 #define DDCAPS_PALETTEVSYNC             0x00010000l
1638
1639 /*
1640  * Display hardware can return the current scan line.
1641  */
1642 #define DDCAPS_READSCANLINE             0x00020000l
1643
1644 /*
1645  * Display hardware has stereo vision capabilities.  DDSCAPS_PRIMARYSURFACELEFT
1646  * can be created.
1647  */
1648 #define DDCAPS_STEREOVIEW               0x00040000l
1649
1650 /*
1651  * Display hardware is capable of generating a vertical blank interrupt.
1652  */
1653 #define DDCAPS_VBI                      0x00080000l
1654
1655 /*
1656  * Supports the use of z buffers with blt operations.
1657  */
1658 #define DDCAPS_ZBLTS                    0x00100000l
1659
1660 /*
1661  * Supports Z Ordering of overlays.
1662  */
1663 #define DDCAPS_ZOVERLAYS                0x00200000l
1664
1665 /*
1666  * Supports color key
1667  */
1668 #define DDCAPS_COLORKEY                 0x00400000l
1669
1670 /*
1671  * Supports alpha surfaces
1672  */
1673 #define DDCAPS_ALPHA                    0x00800000l
1674
1675 /*
1676  * colorkey is hardware assisted(DDCAPS_COLORKEY will also be set)
1677  */
1678 #define DDCAPS_COLORKEYHWASSIST         0x01000000l
1679
1680 /*
1681  * no hardware support at all
1682  */
1683 #define DDCAPS_NOHARDWARE               0x02000000l
1684
1685 /*
1686  * Display hardware is capable of color fill with bltter
1687  */
1688 #define DDCAPS_BLTCOLORFILL             0x04000000l
1689
1690 /*
1691  * Display hardware is bank switched, and potentially very slow at
1692  * random access to VRAM.
1693  */
1694 #define DDCAPS_BANKSWITCHED             0x08000000l
1695
1696 /*
1697  * Display hardware is capable of depth filling Z-buffers with bltter
1698  */
1699 #define DDCAPS_BLTDEPTHFILL             0x10000000l
1700
1701 /*
1702  * Display hardware is capable of clipping while bltting.
1703  */
1704 #define DDCAPS_CANCLIP                  0x20000000l
1705
1706 /*
1707  * Display hardware is capable of clipping while stretch bltting.
1708  */
1709 #define DDCAPS_CANCLIPSTRETCHED         0x40000000l
1710
1711 /*
1712  * Display hardware is capable of bltting to or from system memory
1713  */
1714 #define DDCAPS_CANBLTSYSMEM             0x80000000l
1715
1716
1717  /****************************************************************************
1718  *
1719  * MORE DIRECTDRAW DRIVER CAPABILITY FLAGS (dwCaps2)
1720  *
1721  ****************************************************************************/
1722
1723 /*
1724  * Display hardware is certified
1725  */
1726 #define DDCAPS2_CERTIFIED               0x00000001l
1727
1728 /*
1729  * Driver cannot interleave 2D operations (lock and blt) to surfaces with
1730  * Direct3D rendering operations between calls to BeginScene() and EndScene()
1731  */
1732 #define DDCAPS2_NO2DDURING3DSCENE       0x00000002l
1733
1734 /*
1735  * Display hardware contains a video port
1736  */
1737 #define DDCAPS2_VIDEOPORT               0x00000004l
1738
1739 /*
1740  * The overlay can be automatically flipped according to the video port
1741  * VSYNCs, providing automatic doubled buffered display of video port
1742  * data using an overlay
1743  */
1744 #define DDCAPS2_AUTOFLIPOVERLAY         0x00000008l
1745
1746 /*
1747  * Overlay can display each field of interlaced data individually while
1748  * it is interleaved in memory without causing jittery artifacts.
1749  */
1750 #define DDCAPS2_CANBOBINTERLEAVED       0x00000010l
1751
1752 /*
1753  * Overlay can display each field of interlaced data individually while
1754  * it is not interleaved in memory without causing jittery artifacts.
1755  */
1756 #define DDCAPS2_CANBOBNONINTERLEAVED    0x00000020l
1757
1758 /*
1759  * The overlay surface contains color controls (brightness, sharpness, etc.)
1760  */
1761 #define DDCAPS2_COLORCONTROLOVERLAY     0x00000040l
1762
1763 /*
1764  * The primary surface contains color controls (gamma, etc.)
1765  */
1766 #define DDCAPS2_COLORCONTROLPRIMARY     0x00000080l
1767
1768 /*
1769  * RGBZ -> RGB supported for 16:16 RGB:Z
1770  */
1771 #define DDCAPS2_CANDROPZ16BIT           0x00000100l
1772
1773 /*
1774  * Driver supports non-local video memory.
1775  */
1776 #define DDCAPS2_NONLOCALVIDMEM          0x00000200l
1777
1778 /*
1779  * Dirver supports non-local video memory but has different capabilities for
1780  * non-local video memory surfaces. If this bit is set then so must
1781  * DDCAPS2_NONLOCALVIDMEM.
1782  */
1783 #define DDCAPS2_NONLOCALVIDMEMCAPS      0x00000400l
1784
1785 /*
1786  * Driver neither requires nor prefers surfaces to be pagelocked when performing
1787  * blts involving system memory surfaces
1788  */
1789 #define DDCAPS2_NOPAGELOCKREQUIRED      0x00000800l
1790
1791 /*
1792  * Driver can create surfaces which are wider than the primary surface
1793  */
1794 #define DDCAPS2_WIDESURFACES            0x00001000l
1795
1796 /*
1797  * Driver supports bob using software without using a video port
1798  */
1799 #define DDCAPS2_CANFLIPODDEVEN          0x00002000l
1800
1801 /****************************************************************************
1802  *
1803  * DIRECTDRAW FX ALPHA CAPABILITY FLAGS
1804  *
1805  ****************************************************************************/
1806
1807 /*
1808  * Supports alpha blending around the edge of a source color keyed surface.
1809  * For Blt.
1810  */
1811 #define DDFXALPHACAPS_BLTALPHAEDGEBLEND         0x00000001l
1812
1813 /*
1814  * Supports alpha information in the pixel format.  The bit depth of alpha
1815  * information in the pixel format can be 1,2,4, or 8.  The alpha value becomes
1816  * more opaque as the alpha value increases.  (0 is transparent.)
1817  * For Blt.
1818  */
1819 #define DDFXALPHACAPS_BLTALPHAPIXELS            0x00000002l
1820
1821 /*
1822  * Supports alpha information in the pixel format.  The bit depth of alpha
1823  * information in the pixel format can be 1,2,4, or 8.  The alpha value
1824  * becomes more transparent as the alpha value increases.  (0 is opaque.)
1825  * This flag can only be set if DDCAPS_ALPHA is set.
1826  * For Blt.
1827  */
1828 #define DDFXALPHACAPS_BLTALPHAPIXELSNEG         0x00000004l
1829
1830 /*
1831  * Supports alpha only surfaces.  The bit depth of an alpha only surface can be
1832  * 1,2,4, or 8.  The alpha value becomes more opaque as the alpha value increases.
1833  * (0 is transparent.)
1834  * For Blt.
1835  */
1836 #define DDFXALPHACAPS_BLTALPHASURFACES          0x00000008l
1837
1838 /*
1839  * The depth of the alpha channel data can range can be 1,2,4, or 8.
1840  * The NEG suffix indicates that this alpha channel becomes more transparent
1841  * as the alpha value increases. (0 is opaque.)  This flag can only be set if
1842  * DDCAPS_ALPHA is set.
1843  * For Blt.
1844  */
1845 #define DDFXALPHACAPS_BLTALPHASURFACESNEG       0x00000010l
1846
1847 /*
1848  * Supports alpha blending around the edge of a source color keyed surface.
1849  * For Overlays.
1850  */
1851 #define DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND     0x00000020l
1852
1853 /*
1854  * Supports alpha information in the pixel format.  The bit depth of alpha
1855  * information in the pixel format can be 1,2,4, or 8.  The alpha value becomes
1856  * more opaque as the alpha value increases.  (0 is transparent.)
1857  * For Overlays.
1858  */
1859 #define DDFXALPHACAPS_OVERLAYALPHAPIXELS        0x00000040l
1860
1861 /*
1862  * Supports alpha information in the pixel format.  The bit depth of alpha
1863  * information in the pixel format can be 1,2,4, or 8.  The alpha value
1864  * becomes more transparent as the alpha value increases.  (0 is opaque.)
1865  * This flag can only be set if DDCAPS_ALPHA is set.
1866  * For Overlays.
1867  */
1868 #define DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG     0x00000080l
1869
1870 /*
1871  * Supports alpha only surfaces.  The bit depth of an alpha only surface can be
1872  * 1,2,4, or 8.  The alpha value becomes more opaque as the alpha value increases.
1873  * (0 is transparent.)
1874  * For Overlays.
1875  */
1876 #define DDFXALPHACAPS_OVERLAYALPHASURFACES      0x00000100l
1877
1878 /*
1879  * The depth of the alpha channel data can range can be 1,2,4, or 8.
1880  * The NEG suffix indicates that this alpha channel becomes more transparent
1881  * as the alpha value increases. (0 is opaque.)  This flag can only be set if
1882  * DDCAPS_ALPHA is set.
1883  * For Overlays.
1884  */
1885 #define DDFXALPHACAPS_OVERLAYALPHASURFACESNEG   0x00000200l
1886
1887 /****************************************************************************
1888  *
1889  * DIRECTDRAW FX CAPABILITY FLAGS
1890  *
1891  ****************************************************************************/
1892
1893 /*
1894  * Uses arithmetic operations to stretch and shrink surfaces during blt
1895  * rather than pixel doubling techniques.  Along the Y axis.
1896  */
1897 #define DDFXCAPS_BLTARITHSTRETCHY       0x00000020l
1898
1899 /*
1900  * Uses arithmetic operations to stretch during blt
1901  * rather than pixel doubling techniques.  Along the Y axis. Only
1902  * works for x1, x2, etc.
1903  */
1904 #define DDFXCAPS_BLTARITHSTRETCHYN      0x00000010l
1905
1906 /*
1907  * Supports mirroring left to right in blt.
1908  */
1909 #define DDFXCAPS_BLTMIRRORLEFTRIGHT     0x00000040l
1910
1911 /*
1912  * Supports mirroring top to bottom in blt.
1913  */
1914 #define DDFXCAPS_BLTMIRRORUPDOWN        0x00000080l
1915
1916 /*
1917  * Supports arbitrary rotation for blts.
1918  */
1919 #define DDFXCAPS_BLTROTATION            0x00000100l
1920
1921 /*
1922  * Supports 90 degree rotations for blts.
1923  */
1924 #define DDFXCAPS_BLTROTATION90          0x00000200l
1925
1926 /*
1927  * DirectDraw supports arbitrary shrinking of a surface along the
1928  * x axis (horizontal direction) for blts.
1929  */
1930 #define DDFXCAPS_BLTSHRINKX             0x00000400l
1931
1932 /*
1933  * DirectDraw supports integer shrinking (1x,2x,) of a surface
1934  * along the x axis (horizontal direction) for blts.
1935  */
1936 #define DDFXCAPS_BLTSHRINKXN            0x00000800l
1937
1938 /*
1939  * DirectDraw supports arbitrary shrinking of a surface along the
1940  * y axis (horizontal direction) for blts.
1941  */
1942 #define DDFXCAPS_BLTSHRINKY             0x00001000l
1943
1944 /*
1945  * DirectDraw supports integer shrinking (1x,2x,) of a surface
1946  * along the y axis (vertical direction) for blts.
1947  */
1948 #define DDFXCAPS_BLTSHRINKYN            0x00002000l
1949
1950 /*
1951  * DirectDraw supports arbitrary stretching of a surface along the
1952  * x axis (horizontal direction) for blts.
1953  */
1954 #define DDFXCAPS_BLTSTRETCHX            0x00004000l
1955
1956 /*
1957  * DirectDraw supports integer stretching (1x,2x,) of a surface
1958  * along the x axis (horizontal direction) for blts.
1959  */
1960 #define DDFXCAPS_BLTSTRETCHXN           0x00008000l
1961
1962 /*
1963  * DirectDraw supports arbitrary stretching of a surface along the
1964  * y axis (horizontal direction) for blts.
1965  */
1966 #define DDFXCAPS_BLTSTRETCHY            0x00010000l
1967
1968 /*
1969  * DirectDraw supports integer stretching (1x,2x,) of a surface
1970  * along the y axis (vertical direction) for blts.
1971  */
1972 #define DDFXCAPS_BLTSTRETCHYN           0x00020000l
1973
1974 /*
1975  * Uses arithmetic operations to stretch and shrink surfaces during
1976  * overlay rather than pixel doubling techniques.  Along the Y axis
1977  * for overlays.
1978  */
1979 #define DDFXCAPS_OVERLAYARITHSTRETCHY   0x00040000l
1980
1981 /*
1982  * Uses arithmetic operations to stretch surfaces during
1983  * overlay rather than pixel doubling techniques.  Along the Y axis
1984  * for overlays. Only works for x1, x2, etc.
1985  */
1986 #define DDFXCAPS_OVERLAYARITHSTRETCHYN  0x00000008l
1987
1988 /*
1989  * DirectDraw supports arbitrary shrinking of a surface along the
1990  * x axis (horizontal direction) for overlays.
1991  */
1992 #define DDFXCAPS_OVERLAYSHRINKX         0x00080000l
1993
1994 /*
1995  * DirectDraw supports integer shrinking (1x,2x,) of a surface
1996  * along the x axis (horizontal direction) for overlays.
1997  */
1998 #define DDFXCAPS_OVERLAYSHRINKXN        0x00100000l
1999
2000 /*
2001  * DirectDraw supports arbitrary shrinking of a surface along the
2002  * y axis (horizontal direction) for overlays.
2003  */
2004 #define DDFXCAPS_OVERLAYSHRINKY         0x00200000l
2005
2006 /*
2007  * DirectDraw supports integer shrinking (1x,2x,) of a surface
2008  * along the y axis (vertical direction) for overlays.
2009  */
2010 #define DDFXCAPS_OVERLAYSHRINKYN        0x00400000l
2011
2012 /*
2013  * DirectDraw supports arbitrary stretching of a surface along the
2014  * x axis (horizontal direction) for overlays.
2015  */
2016 #define DDFXCAPS_OVERLAYSTRETCHX        0x00800000l
2017
2018 /*
2019  * DirectDraw supports integer stretching (1x,2x,) of a surface
2020  * along the x axis (horizontal direction) for overlays.
2021  */
2022 #define DDFXCAPS_OVERLAYSTRETCHXN       0x01000000l
2023
2024 /*
2025  * DirectDraw supports arbitrary stretching of a surface along the
2026  * y axis (horizontal direction) for overlays.
2027  */
2028 #define DDFXCAPS_OVERLAYSTRETCHY        0x02000000l
2029
2030 /*
2031  * DirectDraw supports integer stretching (1x,2x,) of a surface
2032  * along the y axis (vertical direction) for overlays.
2033  */
2034 #define DDFXCAPS_OVERLAYSTRETCHYN       0x04000000l
2035
2036 /*
2037  * DirectDraw supports mirroring of overlays across the vertical axis
2038  */
2039 #define DDFXCAPS_OVERLAYMIRRORLEFTRIGHT 0x08000000l
2040
2041 /*
2042  * DirectDraw supports mirroring of overlays across the horizontal axis
2043  */
2044 #define DDFXCAPS_OVERLAYMIRRORUPDOWN    0x10000000l
2045
2046 /****************************************************************************
2047  *
2048  * DIRECTDRAW STEREO VIEW CAPABILITIES
2049  *
2050  ****************************************************************************/
2051
2052 /*
2053  * The stereo view is accomplished via enigma encoding.
2054  */
2055 #define DDSVCAPS_ENIGMA                 0x00000001l
2056
2057 /*
2058  * The stereo view is accomplished via high frequency flickering.
2059  */
2060 #define DDSVCAPS_FLICKER                0x00000002l
2061
2062 /*
2063  * The stereo view is accomplished via red and blue filters applied
2064  * to the left and right eyes.  All images must adapt their colorspaces
2065  * for this process.
2066  */
2067 #define DDSVCAPS_REDBLUE                0x00000004l
2068
2069 /*
2070  * The stereo view is accomplished with split screen technology.
2071  */
2072 #define DDSVCAPS_SPLIT                  0x00000008l
2073
2074 /****************************************************************************
2075  *
2076  * DIRECTDRAWPALETTE CAPABILITIES
2077  *
2078  ****************************************************************************/
2079
2080 /*
2081  * Index is 4 bits.  There are sixteen color entries in the palette table.
2082  */
2083 #define DDPCAPS_4BIT                    0x00000001l
2084
2085 /*
2086  * Index is onto a 8 bit color index.  This field is only valid with the
2087  * DDPCAPS_1BIT, DDPCAPS_2BIT or DDPCAPS_4BIT capability and the target
2088  * surface is in 8bpp. Each color entry is one byte long and is an index
2089  * into destination surface's 8bpp palette.
2090  */
2091 #define DDPCAPS_8BITENTRIES             0x00000002l
2092
2093 /*
2094  * Index is 8 bits.  There are 256 color entries in the palette table.
2095  */
2096 #define DDPCAPS_8BIT                    0x00000004l
2097
2098 /*
2099  * Indicates that this DIRECTDRAWPALETTE should use the palette color array
2100  * passed into the lpDDColorArray parameter to initialize the DIRECTDRAWPALETTE
2101  * object.
2102  */
2103 #define DDPCAPS_INITIALIZE              0x00000008l
2104
2105 /*
2106  * This palette is the one attached to the primary surface.  Changing this
2107  * table has immediate effect on the display unless DDPSETPAL_VSYNC is specified
2108  * and supported.
2109  */
2110 #define DDPCAPS_PRIMARYSURFACE          0x00000010l
2111
2112 /*
2113  * This palette is the one attached to the primary surface left.  Changing
2114  * this table has immediate effect on the display for the left eye unless
2115  * DDPSETPAL_VSYNC is specified and supported.
2116  */
2117 #define DDPCAPS_PRIMARYSURFACELEFT      0x00000020l
2118
2119 /*
2120  * This palette can have all 256 entries defined
2121  */
2122 #define DDPCAPS_ALLOW256                0x00000040l
2123
2124 /*
2125  * This palette can have modifications to it synced with the monitors
2126  * refresh rate.
2127  */
2128 #define DDPCAPS_VSYNC                   0x00000080l
2129
2130 /*
2131  * Index is 1 bit.  There are two color entries in the palette table.
2132  */
2133 #define DDPCAPS_1BIT                    0x00000100l
2134
2135 /*
2136  * Index is 2 bit.  There are four color entries in the palette table.
2137  */
2138 #define DDPCAPS_2BIT                    0x00000200l
2139
2140
2141 /****************************************************************************
2142  *
2143  * DIRECTDRAWPALETTE SETENTRY CONSTANTS
2144  *
2145  ****************************************************************************/
2146
2147
2148 /****************************************************************************
2149  *
2150  * DIRECTDRAWPALETTE GETENTRY CONSTANTS
2151  *
2152  ****************************************************************************/
2153
2154 /* 0 is the only legal value */
2155
2156 /****************************************************************************
2157  *
2158  * DIRECTDRAWSURFACE SETPALETTE CONSTANTS
2159  *
2160  ****************************************************************************/
2161
2162
2163 /****************************************************************************
2164  *
2165  * DIRECTDRAW BITDEPTH CONSTANTS
2166  *
2167  * NOTE:  These are only used to indicate supported bit depths.   These
2168  * are flags only, they are not to be used as an actual bit depth.   The
2169  * absolute numbers 1, 2, 4, 8, 16, 24 and 32 are used to indicate actual
2170  * bit depths in a surface or for changing the display mode.
2171  *
2172  ****************************************************************************/
2173
2174 /*
2175  * 1 bit per pixel.
2176  */
2177 #define DDBD_1                  0x00004000l
2178
2179 /*
2180  * 2 bits per pixel.
2181  */
2182 #define DDBD_2                  0x00002000l
2183
2184 /*
2185  * 4 bits per pixel.
2186  */
2187 #define DDBD_4                  0x00001000l
2188
2189 /*
2190  * 8 bits per pixel.
2191  */
2192 #define DDBD_8                  0x00000800l
2193
2194 /*
2195  * 16 bits per pixel.
2196  */
2197 #define DDBD_16                 0x00000400l
2198
2199 /*
2200  * 24 bits per pixel.
2201  */
2202 #define DDBD_24                 0X00000200l
2203
2204 /*
2205  * 32 bits per pixel.
2206  */
2207 #define DDBD_32                 0x00000100l
2208
2209 /****************************************************************************
2210  *
2211  * DIRECTDRAWSURFACE SET/GET COLOR KEY FLAGS
2212  *
2213  ****************************************************************************/
2214
2215 /*
2216  * Set if the structure contains a color space.  Not set if the structure
2217  * contains a single color key.
2218  */
2219 #define DDCKEY_COLORSPACE       0x00000001l
2220
2221 /*
2222  * Set if the structure specifies a color key or color space which is to be
2223  * used as a destination color key for blt operations.
2224  */
2225 #define DDCKEY_DESTBLT          0x00000002l
2226
2227 /*
2228  * Set if the structure specifies a color key or color space which is to be
2229  * used as a destination color key for overlay operations.
2230  */
2231 #define DDCKEY_DESTOVERLAY      0x00000004l
2232
2233 /*
2234  * Set if the structure specifies a color key or color space which is to be
2235  * used as a source color key for blt operations.
2236  */
2237 #define DDCKEY_SRCBLT           0x00000008l
2238
2239 /*
2240  * Set if the structure specifies a color key or color space which is to be
2241  * used as a source color key for overlay operations.
2242  */
2243 #define DDCKEY_SRCOVERLAY       0x00000010l
2244
2245
2246 /****************************************************************************
2247  *
2248  * DIRECTDRAW COLOR KEY CAPABILITY FLAGS
2249  *
2250  ****************************************************************************/
2251
2252 /*
2253  * Supports transparent blting using a color key to identify the replaceable
2254  * bits of the destination surface for RGB colors.
2255  */
2256 #define DDCKEYCAPS_DESTBLT                      0x00000001l
2257
2258 /*
2259  * Supports transparent blting using a color space to identify the replaceable
2260  * bits of the destination surface for RGB colors.
2261  */
2262 #define DDCKEYCAPS_DESTBLTCLRSPACE              0x00000002l
2263
2264 /*
2265  * Supports transparent blting using a color space to identify the replaceable
2266  * bits of the destination surface for YUV colors.
2267  */
2268 #define DDCKEYCAPS_DESTBLTCLRSPACEYUV           0x00000004l
2269
2270 /*
2271  * Supports transparent blting using a color key to identify the replaceable
2272  * bits of the destination surface for YUV colors.
2273  */
2274 #define DDCKEYCAPS_DESTBLTYUV                   0x00000008l
2275
2276 /*
2277  * Supports overlaying using colorkeying of the replaceable bits of the surface
2278  * being overlayed for RGB colors.
2279  */
2280 #define DDCKEYCAPS_DESTOVERLAY                  0x00000010l
2281
2282 /*
2283  * Supports a color space as the color key for the destination for RGB colors.
2284  */
2285 #define DDCKEYCAPS_DESTOVERLAYCLRSPACE          0x00000020l
2286
2287 /*
2288  * Supports a color space as the color key for the destination for YUV colors.
2289  */
2290 #define DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV       0x00000040l
2291
2292 /*
2293  * Supports only one active destination color key value for visible overlay
2294  * surfaces.
2295  */
2296 #define DDCKEYCAPS_DESTOVERLAYONEACTIVE         0x00000080l
2297
2298 /*
2299  * Supports overlaying using colorkeying of the replaceable bits of the
2300  * surface being overlayed for YUV colors.
2301  */
2302 #define DDCKEYCAPS_DESTOVERLAYYUV               0x00000100l
2303
2304 /*
2305  * Supports transparent blting using the color key for the source with
2306  * this surface for RGB colors.
2307  */
2308 #define DDCKEYCAPS_SRCBLT                       0x00000200l
2309
2310 /*
2311  * Supports transparent blting using a color space for the source with
2312  * this surface for RGB colors.
2313  */
2314 #define DDCKEYCAPS_SRCBLTCLRSPACE               0x00000400l
2315
2316 /*
2317  * Supports transparent blting using a color space for the source with
2318  * this surface for YUV colors.
2319  */
2320 #define DDCKEYCAPS_SRCBLTCLRSPACEYUV            0x00000800l
2321
2322 /*
2323  * Supports transparent blting using the color key for the source with
2324  * this surface for YUV colors.
2325  */
2326 #define DDCKEYCAPS_SRCBLTYUV                    0x00001000l
2327
2328 /*
2329  * Supports overlays using the color key for the source with this
2330  * overlay surface for RGB colors.
2331  */
2332 #define DDCKEYCAPS_SRCOVERLAY                   0x00002000l
2333
2334 /*
2335  * Supports overlays using a color space as the source color key for
2336  * the overlay surface for RGB colors.
2337  */
2338 #define DDCKEYCAPS_SRCOVERLAYCLRSPACE           0x00004000l
2339
2340 /*
2341  * Supports overlays using a color space as the source color key for
2342  * the overlay surface for YUV colors.
2343  */
2344 #define DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV        0x00008000l
2345
2346 /*
2347  * Supports only one active source color key value for visible
2348  * overlay surfaces.
2349  */
2350 #define DDCKEYCAPS_SRCOVERLAYONEACTIVE          0x00010000l
2351
2352 /*
2353  * Supports overlays using the color key for the source with this
2354  * overlay surface for YUV colors.
2355  */
2356 #define DDCKEYCAPS_SRCOVERLAYYUV                0x00020000l
2357
2358 /*
2359  * there are no bandwidth trade-offs for using colorkey with an overlay
2360  */
2361 #define DDCKEYCAPS_NOCOSTOVERLAY                0x00040000l
2362
2363
2364 /****************************************************************************
2365  *
2366  * DIRECTDRAW PIXELFORMAT FLAGS
2367  *
2368  ****************************************************************************/
2369
2370 /*
2371  * The surface has alpha channel information in the pixel format.
2372  */
2373 #define DDPF_ALPHAPIXELS                        0x00000001l
2374
2375 /*
2376  * The pixel format contains alpha only information
2377  */
2378 #define DDPF_ALPHA                              0x00000002l
2379
2380 /*
2381  * The FourCC code is valid.
2382  */
2383 #define DDPF_FOURCC                             0x00000004l
2384
2385 /*
2386  * The surface is 4-bit color indexed.
2387  */
2388 #define DDPF_PALETTEINDEXED4                    0x00000008l
2389
2390 /*
2391  * The surface is indexed into a palette which stores indices
2392  * into the destination surface's 8-bit palette.
2393  */
2394 #define DDPF_PALETTEINDEXEDTO8                  0x00000010l
2395
2396 /*
2397  * The surface is 8-bit color indexed.
2398  */
2399 #define DDPF_PALETTEINDEXED8                    0x00000020l
2400
2401 /*
2402  * The RGB data in the pixel format structure is valid.
2403  */
2404 #define DDPF_RGB                                0x00000040l
2405
2406 /*
2407  * The surface will accept pixel data in the format specified
2408  * and compress it during the write.
2409  */
2410 #define DDPF_COMPRESSED                         0x00000080l
2411
2412 /*
2413  * The surface will accept RGB data and translate it during
2414  * the write to YUV data.  The format of the data to be written
2415  * will be contained in the pixel format structure.  The DDPF_RGB
2416  * flag will be set.
2417  */
2418 #define DDPF_RGBTOYUV                           0x00000100l
2419
2420 /*
2421  * pixel format is YUV - YUV data in pixel format struct is valid
2422  */
2423 #define DDPF_YUV                                0x00000200l
2424
2425 /*
2426  * pixel format is a z buffer only surface
2427  */
2428 #define DDPF_ZBUFFER                            0x00000400l
2429
2430 /*
2431  * The surface is 1-bit color indexed.
2432  */
2433 #define DDPF_PALETTEINDEXED1                    0x00000800l
2434
2435 /*
2436  * The surface is 2-bit color indexed.
2437  */
2438 #define DDPF_PALETTEINDEXED2                    0x00001000l
2439
2440 /*
2441  * The surface contains Z information in the pixels
2442  */
2443 #define DDPF_ZPIXELS                            0x00002000l
2444
2445 /*===========================================================================
2446  *
2447  *
2448  * DIRECTDRAW CALLBACK FLAGS
2449  *
2450  *
2451  *==========================================================================*/
2452
2453 /****************************************************************************
2454  *
2455  * DIRECTDRAW ENUMSURFACES FLAGS
2456  *
2457  ****************************************************************************/
2458
2459 /*
2460  * Enumerate all of the surfaces that meet the search criterion.
2461  */
2462 #define DDENUMSURFACES_ALL                      0x00000001l
2463
2464 /*
2465  * A search hit is a surface that matches the surface description.
2466  */
2467 #define DDENUMSURFACES_MATCH                    0x00000002l
2468
2469 /*
2470  * A search hit is a surface that does not match the surface description.
2471  */
2472 #define DDENUMSURFACES_NOMATCH                  0x00000004l
2473
2474 /*
2475  * Enumerate the first surface that can be created which meets the search criterion.
2476  */
2477 #define DDENUMSURFACES_CANBECREATED             0x00000008l
2478
2479 /*
2480  * Enumerate the surfaces that already exist that meet the search criterion.
2481  */
2482 #define DDENUMSURFACES_DOESEXIST                0x00000010l
2483
2484
2485 /****************************************************************************
2486  *
2487  * DIRECTDRAW SETDISPLAYMODE FLAGS
2488  *
2489  ****************************************************************************/
2490
2491 /*
2492  * The desired mode is a standard VGA mode
2493  */
2494 #define DDSDM_STANDARDVGAMODE                   0x00000001l
2495
2496
2497
2498 /****************************************************************************
2499  *
2500  * DIRECTDRAW ENUMDISPLAYMODES FLAGS
2501  *
2502  ****************************************************************************/
2503
2504 /*
2505  * Enumerate Modes with different refresh rates.  EnumDisplayModes guarantees
2506  * that a particular mode will be enumerated only once.  This flag specifies whether
2507  * the refresh rate is taken into account when determining if a mode is unique.
2508  */
2509 #define DDEDM_REFRESHRATES                      0x00000001l
2510
2511 /*
2512  * Enumerate VGA modes. Specify this flag if you wish to enumerate supported VGA
2513  * modes such as mode 0x13 in addition to the usual ModeX modes (which are always
2514  * enumerated if the application has previously called SetCooperativeLevel with the
2515  * DDSCL_ALLOWMODEX flag set).
2516  */
2517 #define DDEDM_STANDARDVGAMODES                  0x00000002L
2518
2519
2520 /****************************************************************************
2521  *
2522  * DIRECTDRAW SETCOOPERATIVELEVEL FLAGS
2523  *
2524  ****************************************************************************/
2525
2526 /*
2527  * Exclusive mode owner will be responsible for the entire primary surface.
2528  * GDI can be ignored. used with DD
2529  */
2530 #define DDSCL_FULLSCREEN                        0x00000001l
2531
2532 /*
2533  * allow CTRL_ALT_DEL to work while in fullscreen exclusive mode
2534  */
2535 #define DDSCL_ALLOWREBOOT                       0x00000002l
2536
2537 /*
2538  * prevents DDRAW from modifying the application window.
2539  * prevents DDRAW from minimize/restore the application window on activation.
2540  */
2541 #define DDSCL_NOWINDOWCHANGES                   0x00000004l
2542
2543 /*
2544  * app wants to work as a regular Windows application
2545  */
2546 #define DDSCL_NORMAL                            0x00000008l
2547
2548 /*
2549  * app wants exclusive access
2550  */
2551 #define DDSCL_EXCLUSIVE                         0x00000010l
2552
2553
2554 /*
2555  * app can deal with non-windows display modes
2556  */
2557 #define DDSCL_ALLOWMODEX                        0x00000040l
2558
2559
2560 /****************************************************************************
2561  *
2562  * DIRECTDRAW BLT FLAGS
2563  *
2564  ****************************************************************************/
2565
2566 /*
2567  * Use the alpha information in the pixel format or the alpha channel surface
2568  * attached to the destination surface as the alpha channel for this blt.
2569  */
2570 #define DDBLT_ALPHADEST                         0x00000001l
2571
2572 /*
2573  * Use the dwConstAlphaDest field in the DDBLTFX structure as the alpha channel
2574  * for the destination surface for this blt.
2575  */
2576 #define DDBLT_ALPHADESTCONSTOVERRIDE            0x00000002l
2577
2578 /*
2579  * The NEG suffix indicates that the destination surface becomes more
2580  * transparent as the alpha value increases. (0 is opaque)
2581  */
2582 #define DDBLT_ALPHADESTNEG                      0x00000004l
2583
2584 /*
2585  * Use the lpDDSAlphaDest field in the DDBLTFX structure as the alpha
2586  * channel for the destination for this blt.
2587  */
2588 #define DDBLT_ALPHADESTSURFACEOVERRIDE          0x00000008l
2589
2590 /*
2591  * Use the dwAlphaEdgeBlend field in the DDBLTFX structure as the alpha channel
2592  * for the edges of the image that border the color key colors.
2593  */
2594 #define DDBLT_ALPHAEDGEBLEND                    0x00000010l
2595
2596 /*
2597  * Use the alpha information in the pixel format or the alpha channel surface
2598  * attached to the source surface as the alpha channel for this blt.
2599  */
2600 #define DDBLT_ALPHASRC                          0x00000020l
2601
2602 /*
2603  * Use the dwConstAlphaSrc field in the DDBLTFX structure as the alpha channel
2604  * for the source for this blt.
2605  */
2606 #define DDBLT_ALPHASRCCONSTOVERRIDE             0x00000040l
2607
2608 /*
2609  * The NEG suffix indicates that the source surface becomes more transparent
2610  * as the alpha value increases. (0 is opaque)
2611  */
2612 #define DDBLT_ALPHASRCNEG                       0x00000080l
2613
2614 /*
2615  * Use the lpDDSAlphaSrc field in the DDBLTFX structure as the alpha channel
2616  * for the source for this blt.
2617  */
2618 #define DDBLT_ALPHASRCSURFACEOVERRIDE           0x00000100l
2619
2620 /*
2621  * Do this blt asynchronously through the FIFO in the order received.  If
2622  * there is no room in the hardware FIFO fail the call.
2623  */
2624 #define DDBLT_ASYNC                             0x00000200l
2625
2626 /*
2627  * Uses the dwFillColor field in the DDBLTFX structure as the RGB color
2628  * to fill the destination rectangle on the destination surface with.
2629  */
2630 #define DDBLT_COLORFILL                         0x00000400l
2631
2632 /*
2633  * Uses the dwDDFX field in the DDBLTFX structure to specify the effects
2634  * to use for the blt.
2635  */
2636 #define DDBLT_DDFX                              0x00000800l
2637
2638 /*
2639  * Uses the dwDDROPS field in the DDBLTFX structure to specify the ROPS
2640  * that are not part of the Win32 API.
2641  */
2642 #define DDBLT_DDROPS                            0x00001000l
2643
2644 /*
2645  * Use the color key associated with the destination surface.
2646  */
2647 #define DDBLT_KEYDEST                           0x00002000l
2648
2649 /*
2650  * Use the dckDestColorkey field in the DDBLTFX structure as the color key
2651  * for the destination surface.
2652  */
2653 #define DDBLT_KEYDESTOVERRIDE                   0x00004000l
2654
2655 /*
2656  * Use the color key associated with the source surface.
2657  */
2658 #define DDBLT_KEYSRC                            0x00008000l
2659
2660 /*
2661  * Use the dckSrcColorkey field in the DDBLTFX structure as the color key
2662  * for the source surface.
2663  */
2664 #define DDBLT_KEYSRCOVERRIDE                    0x00010000l
2665
2666 /*
2667  * Use the dwROP field in the DDBLTFX structure for the raster operation
2668  * for this blt.  These ROPs are the same as the ones defined in the Win32 API.
2669  */
2670 #define DDBLT_ROP                               0x00020000l
2671
2672 /*
2673  * Use the dwRotationAngle field in the DDBLTFX structure as the angle
2674  * (specified in 1/100th of a degree) to rotate the surface.
2675  */
2676 #define DDBLT_ROTATIONANGLE                     0x00040000l
2677
2678 /*
2679  * Z-buffered blt using the z-buffers attached to the source and destination
2680  * surfaces and the dwZBufferOpCode field in the DDBLTFX structure as the
2681  * z-buffer opcode.
2682  */
2683 #define DDBLT_ZBUFFER                           0x00080000l
2684
2685 /*
2686  * Z-buffered blt using the dwConstDest Zfield and the dwZBufferOpCode field
2687  * in the DDBLTFX structure as the z-buffer and z-buffer opcode respectively
2688  * for the destination.
2689  */
2690 #define DDBLT_ZBUFFERDESTCONSTOVERRIDE          0x00100000l
2691
2692 /*
2693  * Z-buffered blt using the lpDDSDestZBuffer field and the dwZBufferOpCode
2694  * field in the DDBLTFX structure as the z-buffer and z-buffer opcode
2695  * respectively for the destination.
2696  */
2697 #define DDBLT_ZBUFFERDESTOVERRIDE               0x00200000l
2698
2699 /*
2700  * Z-buffered blt using the dwConstSrcZ field and the dwZBufferOpCode field
2701  * in the DDBLTFX structure as the z-buffer and z-buffer opcode respectively
2702  * for the source.
2703  */
2704 #define DDBLT_ZBUFFERSRCCONSTOVERRIDE           0x00400000l
2705
2706 /*
2707  * Z-buffered blt using the lpDDSSrcZBuffer field and the dwZBufferOpCode
2708  * field in the DDBLTFX structure as the z-buffer and z-buffer opcode
2709  * respectively for the source.
2710  */
2711 #define DDBLT_ZBUFFERSRCOVERRIDE                0x00800000l
2712
2713 /*
2714  * wait until the device is ready to handle the blt
2715  * this will cause blt to not return DDERR_WASSTILLDRAWING
2716  */
2717 #define DDBLT_WAIT                              0x01000000l
2718
2719 /*
2720  * Uses the dwFillDepth field in the DDBLTFX structure as the depth value
2721  * to fill the destination rectangle on the destination Z-buffer surface
2722  * with.
2723  */
2724 #define DDBLT_DEPTHFILL                         0x02000000l
2725
2726
2727
2728 /****************************************************************************
2729  *
2730  * BLTFAST FLAGS
2731  *
2732  ****************************************************************************/
2733
2734 #define DDBLTFAST_NOCOLORKEY                    0x00000000
2735 #define DDBLTFAST_SRCCOLORKEY                   0x00000001
2736 #define DDBLTFAST_DESTCOLORKEY                  0x00000002
2737 #define DDBLTFAST_WAIT                          0x00000010
2738
2739 /****************************************************************************
2740  *
2741  * FLIP FLAGS
2742  *
2743  ****************************************************************************/
2744
2745 #define DDFLIP_WAIT                          0x00000001l
2746
2747 /*
2748  * Indicates that the target surface contains the even field of video data.
2749  * This flag is only valid with an overlay surface.
2750  */
2751 #define DDFLIP_EVEN                          0x00000002l
2752
2753 /*
2754  * Indicates that the target surface contains the odd field of video data.
2755  * This flag is only valid with an overlay surface.
2756  */
2757 #define DDFLIP_ODD                           0x00000004l
2758
2759
2760
2761 /****************************************************************************
2762  *
2763  * DIRECTDRAW SURFACE OVERLAY FLAGS
2764  *
2765  ****************************************************************************/
2766
2767 /*
2768  * Use the alpha information in the pixel format or the alpha channel surface
2769  * attached to the destination surface as the alpha channel for the
2770  * destination overlay.
2771  */
2772 #define DDOVER_ALPHADEST                        0x00000001l
2773
2774 /*
2775  * Use the dwConstAlphaDest field in the DDOVERLAYFX structure as the
2776  * destination alpha channel for this overlay.
2777  */
2778 #define DDOVER_ALPHADESTCONSTOVERRIDE           0x00000002l
2779
2780 /*
2781  * The NEG suffix indicates that the destination surface becomes more
2782  * transparent as the alpha value increases.
2783  */
2784 #define DDOVER_ALPHADESTNEG                     0x00000004l
2785
2786 /*
2787  * Use the lpDDSAlphaDest field in the DDOVERLAYFX structure as the alpha
2788  * channel destination for this overlay.
2789  */
2790 #define DDOVER_ALPHADESTSURFACEOVERRIDE         0x00000008l
2791
2792 /*
2793  * Use the dwAlphaEdgeBlend field in the DDOVERLAYFX structure as the alpha
2794  * channel for the edges of the image that border the color key colors.
2795  */
2796 #define DDOVER_ALPHAEDGEBLEND                   0x00000010l
2797
2798 /*
2799  * Use the alpha information in the pixel format or the alpha channel surface
2800  * attached to the source surface as the source alpha channel for this overlay.
2801  */
2802 #define DDOVER_ALPHASRC                         0x00000020l
2803
2804 /*
2805  * Use the dwConstAlphaSrc field in the DDOVERLAYFX structure as the source
2806  * alpha channel for this overlay.
2807  */
2808 #define DDOVER_ALPHASRCCONSTOVERRIDE            0x00000040l
2809
2810 /*
2811  * The NEG suffix indicates that the source surface becomes more transparent
2812  * as the alpha value increases.
2813  */
2814 #define DDOVER_ALPHASRCNEG                      0x00000080l
2815
2816 /*
2817  * Use the lpDDSAlphaSrc field in the DDOVERLAYFX structure as the alpha channel
2818  * source for this overlay.
2819  */
2820 #define DDOVER_ALPHASRCSURFACEOVERRIDE          0x00000100l
2821
2822 /*
2823  * Turn this overlay off.
2824  */
2825 #define DDOVER_HIDE                             0x00000200l
2826
2827 /*
2828  * Use the color key associated with the destination surface.
2829  */
2830 #define DDOVER_KEYDEST                          0x00000400l
2831
2832 /*
2833  * Use the dckDestColorkey field in the DDOVERLAYFX structure as the color key
2834  * for the destination surface
2835  */
2836 #define DDOVER_KEYDESTOVERRIDE                  0x00000800l
2837
2838 /*
2839  * Use the color key associated with the source surface.
2840  */
2841 #define DDOVER_KEYSRC                           0x00001000l
2842
2843 /*
2844  * Use the dckSrcColorkey field in the DDOVERLAYFX structure as the color key
2845  * for the source surface.
2846  */
2847 #define DDOVER_KEYSRCOVERRIDE                   0x00002000l
2848
2849 /*
2850  * Turn this overlay on.
2851  */
2852 #define DDOVER_SHOW                             0x00004000l
2853
2854 /*
2855  * Add a dirty rect to an emulated overlayed surface.
2856  */
2857 #define DDOVER_ADDDIRTYRECT                     0x00008000l
2858
2859 /*
2860  * Redraw all dirty rects on an emulated overlayed surface.
2861  */
2862 #define DDOVER_REFRESHDIRTYRECTS                0x00010000l
2863
2864 /*
2865  * Redraw the entire surface on an emulated overlayed surface.
2866  */
2867 #define DDOVER_REFRESHALL                      0x00020000l
2868
2869
2870 /*
2871  * Use the overlay FX flags to define special overlay FX
2872  */
2873 #define DDOVER_DDFX                             0x00080000l
2874
2875 /*
2876  * Autoflip the overlay when ever the video port autoflips
2877  */
2878 #define DDOVER_AUTOFLIP                         0x00100000l
2879
2880 /*
2881  * Display each field of video port data individually without
2882  * causing any jittery artifacts
2883  */
2884 #define DDOVER_BOB                              0x00200000l
2885
2886 /*
2887  * Indicates that bob/weave decisions should not be overridden by other
2888  * interfaces.
2889  */
2890 #define DDOVER_OVERRIDEBOBWEAVE                 0x00400000l
2891
2892 /*
2893  * Indicates that the surface memory is composed of interleaved fields.
2894  */
2895 #define DDOVER_INTERLEAVED                      0x00800000l
2896
2897
2898 /****************************************************************************
2899  *
2900  * DIRECTDRAWSURFACE LOCK FLAGS
2901  *
2902  ****************************************************************************/
2903
2904 /*
2905  * The default.  Set to indicate that Lock should return a valid memory pointer
2906  * to the top of the specified rectangle.  If no rectangle is specified then a
2907  * pointer to the top of the surface is returned.
2908  */
2909 #define DDLOCK_SURFACEMEMORYPTR                 0x00000000L     // default
2910
2911 /*
2912  * Set to indicate that Lock should wait until it can obtain a valid memory
2913  * pointer before returning.  If this bit is set, Lock will never return
2914  * DDERR_WASSTILLDRAWING.
2915  */
2916 #define DDLOCK_WAIT                             0x00000001L
2917
2918 /*
2919  * Set if an event handle is being passed to Lock.  Lock will trigger the event
2920  * when it can return the surface memory pointer requested.
2921  */
2922 #define DDLOCK_EVENT                            0x00000002L
2923
2924 /*
2925  * Indicates that the surface being locked will only be read from.
2926  */
2927 #define DDLOCK_READONLY                         0x00000010L
2928
2929 /*
2930  * Indicates that the surface being locked will only be written to
2931  */
2932 #define DDLOCK_WRITEONLY                        0x00000020L
2933
2934
2935 /*
2936  * Indicates that a system wide lock should not be taken when this surface
2937  * is locked. This has several advantages (cursor responsiveness, ability
2938  * to call more Windows functions, easier debugging) when locking video
2939  * memory surfaces. However, an application specifying this flag must
2940  * comply with a number of conditions documented in the help file.
2941  * Furthermore, this flag cannot be specified when locking the primary.
2942  */
2943 #define DDLOCK_NOSYSLOCK                        0x00000800L
2944
2945
2946 /****************************************************************************
2947  *
2948  * DIRECTDRAWSURFACE PAGELOCK FLAGS
2949  *
2950  ****************************************************************************/
2951
2952 /*
2953  * No flags defined at present
2954  */
2955
2956
2957 /****************************************************************************
2958  *
2959  * DIRECTDRAWSURFACE PAGEUNLOCK FLAGS
2960  *
2961  ****************************************************************************/
2962
2963 /*
2964  * No flags defined at present
2965  */
2966
2967
2968 /****************************************************************************
2969  *
2970  * DIRECTDRAWSURFACE BLT FX FLAGS
2971  *
2972  ****************************************************************************/
2973
2974 /*
2975  * If stretching, use arithmetic stretching along the Y axis for this blt.
2976  */
2977 #define DDBLTFX_ARITHSTRETCHY                   0x00000001l
2978
2979 /*
2980  * Do this blt mirroring the surface left to right.  Spin the
2981  * surface around its y-axis.
2982  */
2983 #define DDBLTFX_MIRRORLEFTRIGHT                 0x00000002l
2984
2985 /*
2986  * Do this blt mirroring the surface up and down.  Spin the surface
2987  * around its x-axis.
2988  */
2989 #define DDBLTFX_MIRRORUPDOWN                    0x00000004l
2990
2991 /*
2992  * Schedule this blt to avoid tearing.
2993  */
2994 #define DDBLTFX_NOTEARING                       0x00000008l
2995
2996 /*
2997  * Do this blt rotating the surface one hundred and eighty degrees.
2998  */
2999 #define DDBLTFX_ROTATE180                       0x00000010l
3000
3001 /*
3002  * Do this blt rotating the surface two hundred and seventy degrees.
3003  */
3004 #define DDBLTFX_ROTATE270                       0x00000020l
3005
3006 /*
3007  * Do this blt rotating the surface ninety degrees.
3008  */
3009 #define DDBLTFX_ROTATE90                        0x00000040l
3010
3011 /*
3012  * Do this z blt using dwZBufferLow and dwZBufferHigh as  range values
3013  * specified to limit the bits copied from the source surface.
3014  */
3015 #define DDBLTFX_ZBUFFERRANGE                    0x00000080l
3016
3017 /*
3018  * Do this z blt adding the dwZBufferBaseDest to each of the sources z values
3019  * before comparing it with the desting z values.
3020  */
3021 #define DDBLTFX_ZBUFFERBASEDEST                 0x00000100l
3022
3023 /****************************************************************************
3024  *
3025  * DIRECTDRAWSURFACE OVERLAY FX FLAGS
3026  *
3027  ****************************************************************************/
3028
3029 /*
3030  * If stretching, use arithmetic stretching along the Y axis for this overlay.
3031  */
3032 #define DDOVERFX_ARITHSTRETCHY                  0x00000001l
3033
3034 /*
3035  * Mirror the overlay across the vertical axis
3036  */
3037 #define DDOVERFX_MIRRORLEFTRIGHT                0x00000002l
3038
3039 /*
3040  * Mirror the overlay across the horizontal axis
3041  */
3042 #define DDOVERFX_MIRRORUPDOWN                   0x00000004l
3043
3044 /****************************************************************************
3045  *
3046  * DIRECTDRAW WAITFORVERTICALBLANK FLAGS
3047  *
3048  ****************************************************************************/
3049
3050 /*
3051  * return when the vertical blank interval begins
3052  */
3053 #define DDWAITVB_BLOCKBEGIN                     0x00000001l
3054
3055 /*
3056  * set up an event to trigger when the vertical blank begins
3057  */
3058 #define DDWAITVB_BLOCKBEGINEVENT                0x00000002l
3059
3060 /*
3061  * return when the vertical blank interval ends and display begins
3062  */
3063 #define DDWAITVB_BLOCKEND                       0x00000004l
3064
3065 /****************************************************************************
3066  *
3067  * DIRECTDRAW GETFLIPSTATUS FLAGS
3068  *
3069  ****************************************************************************/
3070
3071 /*
3072  * is it OK to flip now?
3073  */
3074 #define DDGFS_CANFLIP                   0x00000001l
3075
3076 /*
3077  * is the last flip finished?
3078  */
3079 #define DDGFS_ISFLIPDONE                0x00000002l
3080
3081 /****************************************************************************
3082  *
3083  * DIRECTDRAW GETBLTSTATUS FLAGS
3084  *
3085  ****************************************************************************/
3086
3087 /*
3088  * is it OK to blt now?
3089  */
3090 #define DDGBS_CANBLT                    0x00000001l
3091
3092 /*
3093  * is the blt to the surface finished?
3094  */
3095 #define DDGBS_ISBLTDONE                 0x00000002l
3096
3097
3098 /****************************************************************************
3099  *
3100  * DIRECTDRAW ENUMOVERLAYZORDER FLAGS
3101  *
3102  ****************************************************************************/
3103
3104 /*
3105  * Enumerate overlays back to front.
3106  */
3107 #define DDENUMOVERLAYZ_BACKTOFRONT      0x00000000l
3108
3109 /*
3110  * Enumerate overlays front to back
3111  */
3112 #define DDENUMOVERLAYZ_FRONTTOBACK      0x00000001l
3113
3114 /****************************************************************************
3115  *
3116  * DIRECTDRAW UPDATEOVERLAYZORDER FLAGS
3117  *
3118  ****************************************************************************/
3119
3120 /*
3121  * Send overlay to front
3122  */
3123 #define DDOVERZ_SENDTOFRONT             0x00000000l
3124
3125 /*
3126  * Send overlay to back
3127  */
3128 #define DDOVERZ_SENDTOBACK              0x00000001l
3129
3130 /*
3131  * Move Overlay forward
3132  */
3133 #define DDOVERZ_MOVEFORWARD             0x00000002l
3134
3135 /*
3136  * Move Overlay backward
3137  */
3138 #define DDOVERZ_MOVEBACKWARD            0x00000003l
3139
3140 /*
3141  * Move Overlay in front of relative surface
3142  */
3143 #define DDOVERZ_INSERTINFRONTOF         0x00000004l
3144
3145 /*
3146  * Move Overlay in back of relative surface
3147  */
3148 #define DDOVERZ_INSERTINBACKOF          0x00000005l
3149
3150 /*===========================================================================
3151  *
3152  *
3153  * DIRECTDRAW RETURN CODES
3154  *
3155  * The return values from DirectDraw Commands and Surface that return an HRESULT
3156  * are codes from DirectDraw concerning the results of the action
3157  * requested by DirectDraw.
3158  *
3159  *==========================================================================*/
3160
3161 /*
3162  * Status is OK
3163  *
3164  * Issued by: DirectDraw Commands and all callbacks
3165  */
3166 #define DD_OK                                   0
3167
3168 /****************************************************************************
3169  *
3170  * DIRECTDRAW ENUMCALLBACK RETURN VALUES
3171  *
3172  * EnumCallback returns are used to control the flow of the DIRECTDRAW and
3173  * DIRECTDRAWSURFACE object enumerations.   They can only be returned by
3174  * enumeration callback routines.
3175  *
3176  ****************************************************************************/
3177
3178 /*
3179  * stop the enumeration
3180  */
3181 #define DDENUMRET_CANCEL                        0
3182
3183 /*
3184  * continue the enumeration
3185  */
3186 #define DDENUMRET_OK                            1
3187
3188 /****************************************************************************
3189  *
3190  * DIRECTDRAW ERRORS
3191  *
3192  * Errors are represented by negative values and cannot be combined.
3193  *
3194  ****************************************************************************/
3195
3196 /*
3197  * This object is already initialized
3198  */
3199 #define DDERR_ALREADYINITIALIZED                MAKE_DDHRESULT( 5 )
3200
3201 /*
3202  * This surface can not be attached to the requested surface.
3203  */
3204 #define DDERR_CANNOTATTACHSURFACE               MAKE_DDHRESULT( 10 )
3205
3206 /*
3207  * This surface can not be detached from the requested surface.
3208  */
3209 #define DDERR_CANNOTDETACHSURFACE               MAKE_DDHRESULT( 20 )
3210
3211 /*
3212  * Support is currently not available.
3213  */
3214 #define DDERR_CURRENTLYNOTAVAIL                 MAKE_DDHRESULT( 40 )
3215
3216 /*
3217  * An exception was encountered while performing the requested operation
3218  */
3219 #define DDERR_EXCEPTION                         MAKE_DDHRESULT( 55 )
3220
3221 /*
3222  * Generic failure.
3223  */
3224 #define DDERR_GENERIC                           E_FAIL
3225
3226 /*
3227  * Height of rectangle provided is not a multiple of reqd alignment
3228  */
3229 #define DDERR_HEIGHTALIGN                       MAKE_DDHRESULT( 90 )
3230
3231 /*
3232  * Unable to match primary surface creation request with existing
3233  * primary surface.
3234  */
3235 #define DDERR_INCOMPATIBLEPRIMARY               MAKE_DDHRESULT( 95 )
3236
3237 /*
3238  * One or more of the caps bits passed to the callback are incorrect.
3239  */
3240 #define DDERR_INVALIDCAPS                       MAKE_DDHRESULT( 100 )
3241
3242 /*
3243  * DirectDraw does not support provided Cliplist.
3244  */
3245 #define DDERR_INVALIDCLIPLIST                   MAKE_DDHRESULT( 110 )
3246
3247 /*
3248  * DirectDraw does not support the requested mode
3249  */
3250 #define DDERR_INVALIDMODE                       MAKE_DDHRESULT( 120 )
3251
3252 /*
3253  * DirectDraw received a pointer that was an invalid DIRECTDRAW object.
3254  */
3255 #define DDERR_INVALIDOBJECT                     MAKE_DDHRESULT( 130 )
3256
3257 /*
3258  * One or more of the parameters passed to the callback function are
3259  * incorrect.
3260  */
3261 #define DDERR_INVALIDPARAMS                     E_INVALIDARG
3262
3263 /*
3264  * pixel format was invalid as specified
3265  */
3266 #define DDERR_INVALIDPIXELFORMAT                MAKE_DDHRESULT( 145 )
3267
3268 /*
3269  * Rectangle provided was invalid.
3270  */
3271 #define DDERR_INVALIDRECT                       MAKE_DDHRESULT( 150 )
3272
3273 /*
3274  * Operation could not be carried out because one or more surfaces are locked
3275  */
3276 #define DDERR_LOCKEDSURFACES                    MAKE_DDHRESULT( 160 )
3277
3278 /*
3279  * There is no 3D present.
3280  */
3281 #define DDERR_NO3D                              MAKE_DDHRESULT( 170 )
3282
3283 /*
3284  * Operation could not be carried out because there is no alpha accleration
3285  * hardware present or available.
3286  */
3287 #define DDERR_NOALPHAHW                         MAKE_DDHRESULT( 180 )
3288
3289
3290 /*
3291  * no clip list available
3292  */
3293 #define DDERR_NOCLIPLIST                        MAKE_DDHRESULT( 205 )
3294
3295 /*
3296  * Operation could not be carried out because there is no color conversion
3297  * hardware present or available.
3298  */
3299 #define DDERR_NOCOLORCONVHW                     MAKE_DDHRESULT( 210 )
3300
3301 /*
3302  * Create function called without DirectDraw object method SetCooperativeLevel
3303  * being called.
3304  */
3305 #define DDERR_NOCOOPERATIVELEVELSET             MAKE_DDHRESULT( 212 )
3306
3307 /*
3308  * Surface doesn't currently have a color key
3309  */
3310 #define DDERR_NOCOLORKEY                        MAKE_DDHRESULT( 215 )
3311
3312 /*
3313  * Operation could not be carried out because there is no hardware support
3314  * of the dest color key.
3315  */
3316 #define DDERR_NOCOLORKEYHW                      MAKE_DDHRESULT( 220 )
3317
3318 /*
3319  * No DirectDraw support possible with current display driver
3320  */
3321 #define DDERR_NODIRECTDRAWSUPPORT               MAKE_DDHRESULT( 222 )
3322
3323 /*
3324  * Operation requires the application to have exclusive mode but the
3325  * application does not have exclusive mode.
3326  */
3327 #define DDERR_NOEXCLUSIVEMODE                   MAKE_DDHRESULT( 225 )
3328
3329 /*
3330  * Flipping visible surfaces is not supported.
3331  */
3332 #define DDERR_NOFLIPHW                          MAKE_DDHRESULT( 230 )
3333
3334 /*
3335  * There is no GDI present.
3336  */
3337 #define DDERR_NOGDI                             MAKE_DDHRESULT( 240 )
3338
3339 /*
3340  * Operation could not be carried out because there is no hardware present
3341  * or available.
3342  */
3343 #define DDERR_NOMIRRORHW                        MAKE_DDHRESULT( 250 )
3344
3345 /*
3346  * Requested item was not found
3347  */
3348 #define DDERR_NOTFOUND                          MAKE_DDHRESULT( 255 )
3349
3350 /*
3351  * Operation could not be carried out because there is no overlay hardware
3352  * present or available.
3353  */
3354 #define DDERR_NOOVERLAYHW                       MAKE_DDHRESULT( 260 )
3355
3356 /*
3357  * Operation could not be carried out because there is no appropriate raster
3358  * op hardware present or available.
3359  */
3360 #define DDERR_NORASTEROPHW                      MAKE_DDHRESULT( 280 )
3361
3362 /*
3363  * Operation could not be carried out because there is no rotation hardware
3364  * present or available.
3365  */
3366 #define DDERR_NOROTATIONHW                      MAKE_DDHRESULT( 290 )
3367
3368 /*
3369  * Operation could not be carried out because there is no hardware support
3370  * for stretching
3371  */
3372 #define DDERR_NOSTRETCHHW                       MAKE_DDHRESULT( 310 )
3373
3374 /*
3375  * DirectDrawSurface is not in 4 bit color palette and the requested operation
3376  * requires 4 bit color palette.
3377  */
3378 #define DDERR_NOT4BITCOLOR                      MAKE_DDHRESULT( 316 )
3379
3380 /*
3381  * DirectDrawSurface is not in 4 bit color index palette and the requested
3382  * operation requires 4 bit color index palette.
3383  */
3384 #define DDERR_NOT4BITCOLORINDEX                 MAKE_DDHRESULT( 317 )
3385
3386 /*
3387  * DirectDraw Surface is not in 8 bit color mode and the requested operation
3388  * requires 8 bit color.
3389  */
3390 #define DDERR_NOT8BITCOLOR                      MAKE_DDHRESULT( 320 )
3391
3392 /*
3393  * Operation could not be carried out because there is no texture mapping
3394  * hardware present or available.
3395  */
3396 #define DDERR_NOTEXTUREHW                       MAKE_DDHRESULT( 330 )
3397
3398 /*
3399  * Operation could not be carried out because there is no hardware support
3400  * for vertical blank synchronized operations.
3401  */
3402 #define DDERR_NOVSYNCHW                         MAKE_DDHRESULT( 335 )
3403
3404 /*
3405  * Operation could not be carried out because there is no hardware support
3406  * for zbuffer blting.
3407  */
3408 #define DDERR_NOZBUFFERHW                       MAKE_DDHRESULT( 340 )
3409
3410 /*
3411  * Overlay surfaces could not be z layered based on their BltOrder because
3412  * the hardware does not support z layering of overlays.
3413  */
3414 #define DDERR_NOZOVERLAYHW                      MAKE_DDHRESULT( 350 )
3415
3416 /*
3417  * The hardware needed for the requested operation has already been
3418  * allocated.
3419  */
3420 #define DDERR_OUTOFCAPS                         MAKE_DDHRESULT( 360 )
3421
3422 /*
3423  * DirectDraw does not have enough memory to perform the operation.
3424  */
3425 #define DDERR_OUTOFMEMORY                       E_OUTOFMEMORY
3426
3427 /*
3428  * DirectDraw does not have enough memory to perform the operation.
3429  */
3430 #define DDERR_OUTOFVIDEOMEMORY                  MAKE_DDHRESULT( 380 )
3431
3432 /*
3433  * hardware does not support clipped overlays
3434  */
3435 #define DDERR_OVERLAYCANTCLIP                   MAKE_DDHRESULT( 382 )
3436
3437 /*
3438  * Can only have ony color key active at one time for overlays
3439  */
3440 #define DDERR_OVERLAYCOLORKEYONLYONEACTIVE      MAKE_DDHRESULT( 384 )
3441
3442 /*
3443  * Access to this palette is being refused because the palette is already
3444  * locked by another thread.
3445  */
3446 #define DDERR_PALETTEBUSY                       MAKE_DDHRESULT( 387 )
3447
3448 /*
3449  * No src color key specified for this operation.
3450  */
3451 #define DDERR_COLORKEYNOTSET                    MAKE_DDHRESULT( 400 )
3452
3453 /*
3454  * This surface is already attached to the surface it is being attached to.
3455  */
3456 #define DDERR_SURFACEALREADYATTACHED            MAKE_DDHRESULT( 410 )
3457
3458 /*
3459  * This surface is already a dependency of the surface it is being made a
3460  * dependency of.
3461  */
3462 #define DDERR_SURFACEALREADYDEPENDENT           MAKE_DDHRESULT( 420 )
3463
3464 /*
3465  * Access to this surface is being refused because the surface is already
3466  * locked by another thread.
3467  */
3468 #define DDERR_SURFACEBUSY                       MAKE_DDHRESULT( 430 )
3469
3470 /*
3471  * Access to this surface is being refused because no driver exists
3472  * which can supply a pointer to the surface.
3473  * This is most likely to happen when attempting to lock the primary
3474  * surface when no DCI provider is present.
3475  * Will also happen on attempts to lock an optimized surface.
3476  */
3477 #define DDERR_CANTLOCKSURFACE                   MAKE_DDHRESULT( 435 )
3478
3479 /*
3480  * Access to Surface refused because Surface is obscured.
3481  */
3482 #define DDERR_SURFACEISOBSCURED                 MAKE_DDHRESULT( 440 )
3483
3484 /*
3485  * Access to this surface is being refused because the surface is gone.
3486  * The DIRECTDRAWSURFACE object representing this surface should
3487  * have Restore called on it.
3488  */
3489 #define DDERR_SURFACELOST                       MAKE_DDHRESULT( 450 )
3490
3491 /*
3492  * The requested surface is not attached.
3493  */
3494 #define DDERR_SURFACENOTATTACHED                MAKE_DDHRESULT( 460 )
3495
3496 /*
3497  * Height requested by DirectDraw is too large.
3498  */
3499 #define DDERR_TOOBIGHEIGHT                      MAKE_DDHRESULT( 470 )
3500
3501 /*
3502  * Size requested by DirectDraw is too large --  The individual height and
3503  * width are OK.
3504  */
3505 #define DDERR_TOOBIGSIZE                        MAKE_DDHRESULT( 480 )
3506
3507 /*
3508  * Width requested by DirectDraw is too large.
3509  */
3510 #define DDERR_TOOBIGWIDTH                       MAKE_DDHRESULT( 490 )
3511
3512 /*
3513  * Action not supported.
3514  */
3515 #define DDERR_UNSUPPORTED                       E_NOTIMPL
3516
3517 /*
3518  * FOURCC format requested is unsupported by DirectDraw
3519  */
3520 #define DDERR_UNSUPPORTEDFORMAT                 MAKE_DDHRESULT( 510 )
3521
3522 /*
3523  * Bitmask in the pixel format requested is unsupported by DirectDraw
3524  */
3525 #define DDERR_UNSUPPORTEDMASK                   MAKE_DDHRESULT( 520 )
3526
3527 /*
3528  * vertical blank is in progress
3529  */
3530 #define DDERR_VERTICALBLANKINPROGRESS           MAKE_DDHRESULT( 537 )
3531
3532 /*
3533  * Informs DirectDraw that the previous Blt which is transfering information
3534  * to or from this Surface is incomplete.
3535  */
3536 #define DDERR_WASSTILLDRAWING                   MAKE_DDHRESULT( 540 )
3537
3538
3539 /*
3540  * Rectangle provided was not horizontally aligned on reqd. boundary
3541  */
3542 #define DDERR_XALIGN                            MAKE_DDHRESULT( 560 )
3543
3544 /*
3545  * The GUID passed to DirectDrawCreate is not a valid DirectDraw driver
3546  * identifier.
3547  */
3548 #define DDERR_INVALIDDIRECTDRAWGUID             MAKE_DDHRESULT( 561 )
3549
3550 /*
3551  * A DirectDraw object representing this driver has already been created
3552  * for this process.
3553  */
3554 #define DDERR_DIRECTDRAWALREADYCREATED          MAKE_DDHRESULT( 562 )
3555
3556 /*
3557  * A hardware only DirectDraw object creation was attempted but the driver
3558  * did not support any hardware.
3559  */
3560 #define DDERR_NODIRECTDRAWHW                    MAKE_DDHRESULT( 563 )
3561
3562 /*
3563  * this process already has created a primary surface
3564  */
3565 #define DDERR_PRIMARYSURFACEALREADYEXISTS       MAKE_DDHRESULT( 564 )
3566
3567 /*
3568  * software emulation not available.
3569  */
3570 #define DDERR_NOEMULATION                       MAKE_DDHRESULT( 565 )
3571
3572 /*
3573  * region passed to Clipper::GetClipList is too small.
3574  */
3575 #define DDERR_REGIONTOOSMALL                    MAKE_DDHRESULT( 566 )
3576
3577 /*
3578  * an attempt was made to set a clip list for a clipper objec that
3579  * is already monitoring an hwnd.
3580  */
3581 #define DDERR_CLIPPERISUSINGHWND                MAKE_DDHRESULT( 567 )
3582
3583 /*
3584  * No clipper object attached to surface object
3585  */
3586 #define DDERR_NOCLIPPERATTACHED                 MAKE_DDHRESULT( 568 )
3587
3588 /*
3589  * Clipper notification requires an HWND or
3590  * no HWND has previously been set as the CooperativeLevel HWND.
3591  */
3592 #define DDERR_NOHWND                            MAKE_DDHRESULT( 569 )
3593
3594 /*
3595  * HWND used by DirectDraw CooperativeLevel has been subclassed,
3596  * this prevents DirectDraw from restoring state.
3597  */
3598 #define DDERR_HWNDSUBCLASSED                    MAKE_DDHRESULT( 570 )
3599
3600 /*
3601  * The CooperativeLevel HWND has already been set.
3602  * It can not be reset while the process has surfaces or palettes created.
3603  */
3604 #define DDERR_HWNDALREADYSET                    MAKE_DDHRESULT( 571 )
3605
3606 /*
3607  * No palette object attached to this surface.
3608  */
3609 #define DDERR_NOPALETTEATTACHED                 MAKE_DDHRESULT( 572 )
3610
3611 /*
3612  * No hardware support for 16 or 256 color palettes.
3613  */
3614 #define DDERR_NOPALETTEHW                       MAKE_DDHRESULT( 573 )
3615
3616 /*
3617  * If a clipper object is attached to the source surface passed into a
3618  * BltFast call.
3619  */
3620 #define DDERR_BLTFASTCANTCLIP                   MAKE_DDHRESULT( 574 )
3621
3622 /*
3623  * No blter.
3624  */
3625 #define DDERR_NOBLTHW                           MAKE_DDHRESULT( 575 )
3626
3627 /*
3628  * No DirectDraw ROP hardware.
3629  */
3630 #define DDERR_NODDROPSHW                        MAKE_DDHRESULT( 576 )
3631
3632 /*
3633  * returned when GetOverlayPosition is called on a hidden overlay
3634  */
3635 #define DDERR_OVERLAYNOTVISIBLE                 MAKE_DDHRESULT( 577 )
3636
3637 /*
3638  * returned when GetOverlayPosition is called on a overlay that UpdateOverlay
3639  * has never been called on to establish a destionation.
3640  */
3641 #define DDERR_NOOVERLAYDEST                     MAKE_DDHRESULT( 578 )
3642
3643 /*
3644  * returned when the position of the overlay on the destionation is no longer
3645  * legal for that destionation.
3646  */
3647 #define DDERR_INVALIDPOSITION                   MAKE_DDHRESULT( 579 )
3648
3649 /*
3650  * returned when an overlay member is called for a non-overlay surface
3651  */
3652 #define DDERR_NOTAOVERLAYSURFACE                MAKE_DDHRESULT( 580 )
3653
3654 /*
3655  * An attempt was made to set the cooperative level when it was already
3656  * set to exclusive.
3657  */
3658 #define DDERR_EXCLUSIVEMODEALREADYSET           MAKE_DDHRESULT( 581 )
3659
3660 /*
3661  * An attempt has been made to flip a surface that is not flippable.
3662  */
3663 #define DDERR_NOTFLIPPABLE                      MAKE_DDHRESULT( 582 )
3664
3665 /*
3666  * Can't duplicate primary & 3D surfaces, or surfaces that are implicitly
3667  * created.
3668  */
3669 #define DDERR_CANTDUPLICATE                     MAKE_DDHRESULT( 583 )
3670
3671 /*
3672  * Surface was not locked.  An attempt to unlock a surface that was not
3673  * locked at all, or by this process, has been attempted.
3674  */
3675 #define DDERR_NOTLOCKED                         MAKE_DDHRESULT( 584 )
3676
3677 /*
3678  * Windows can not create any more DCs
3679  */
3680 #define DDERR_CANTCREATEDC                      MAKE_DDHRESULT( 585 )
3681
3682 /*
3683  * No DC was ever created for this surface.
3684  */
3685 #define DDERR_NODC                              MAKE_DDHRESULT( 586 )
3686
3687 /*
3688  * This surface can not be restored because it was created in a different
3689  * mode.
3690  */
3691 #define DDERR_WRONGMODE                         MAKE_DDHRESULT( 587 )
3692
3693 /*
3694  * This surface can not be restored because it is an implicitly created
3695  * surface.
3696  */
3697 #define DDERR_IMPLICITLYCREATED                 MAKE_DDHRESULT( 588 )
3698
3699 /*
3700  * The surface being used is not a palette-based surface
3701  */
3702 #define DDERR_NOTPALETTIZED                     MAKE_DDHRESULT( 589 )
3703
3704
3705 /*
3706  * The display is currently in an unsupported mode
3707  */
3708 #define DDERR_UNSUPPORTEDMODE                   MAKE_DDHRESULT( 590 )
3709
3710 /*
3711  * Operation could not be carried out because there is no mip-map
3712  * texture mapping hardware present or available.
3713  */
3714 #define DDERR_NOMIPMAPHW                        MAKE_DDHRESULT( 591 )
3715
3716 /*
3717  * The requested action could not be performed because the surface was of
3718  * the wrong type.
3719  */
3720 #define DDERR_INVALIDSURFACETYPE                MAKE_DDHRESULT( 592 )
3721
3722
3723
3724 /*
3725  * Device does not support optimized surfaces, therefore no video memory optimized surfaces
3726  */
3727 #define DDERR_NOOPTIMIZEHW                      MAKE_DDHRESULT( 600 )
3728
3729 /*
3730  * Surface is an optimized surface, but has not yet been allocated any memory
3731  */
3732 #define DDERR_NOTLOADED                         MAKE_DDHRESULT( 601 )
3733
3734 /*
3735  * A DC has already been returned for this surface. Only one DC can be
3736  * retrieved per surface.
3737  */
3738 #define DDERR_DCALREADYCREATED                  MAKE_DDHRESULT( 620 )
3739
3740 /*
3741  * An attempt was made to allocate non-local video memory from a device
3742  * that does not support non-local video memory.
3743  */
3744 #define DDERR_NONONLOCALVIDMEM                  MAKE_DDHRESULT( 630 )
3745
3746 /*
3747  * The attempt to page lock a surface failed.
3748  */
3749 #define DDERR_CANTPAGELOCK                      MAKE_DDHRESULT( 640 )
3750
3751 /*
3752  * The attempt to page unlock a surface failed.
3753  */
3754 #define DDERR_CANTPAGEUNLOCK                    MAKE_DDHRESULT( 660 )
3755
3756 /*
3757  * An attempt was made to page unlock a surface with no outstanding page locks.
3758  */
3759 #define DDERR_NOTPAGELOCKED                     MAKE_DDHRESULT( 680 )
3760
3761 /*
3762  * There is more data available than the specified buffer size could hold
3763  */
3764 #define DDERR_MOREDATA                          MAKE_DDHRESULT( 690 )
3765
3766 /*
3767  * The video port is not active
3768  */
3769 #define DDERR_VIDEONOTACTIVE                    MAKE_DDHRESULT( 695 )
3770
3771 /*
3772  * Surfaces created by one direct draw device cannot be used directly by
3773  * another direct draw device.
3774  */
3775 #define DDERR_DEVICEDOESNTOWNSURFACE            MAKE_DDHRESULT( 699 )
3776
3777
3778 /*
3779  * An attempt was made to invoke an interface member of a DirectDraw object
3780  * created by CoCreateInstance() before it was initialized.
3781  */
3782 #define DDERR_NOTINITIALIZED                    CO_E_NOTINITIALIZED
3783
3784 /* Alpha bit depth constants */
3785
3786
3787 #ifdef __cplusplus
3788 };
3789 #endif
3790
3791 #endif
3792