CnC_Remastered_Collection

Command and Conquer: Red Alert
Log | Files | Refs | README | LICENSE

DDRAW.H (107764B)


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