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