home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / Emulation_Include_Files / ddraw.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  142.0 KB  |  3,757 lines

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