ddraw.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:236k
源码类别:

模拟服务器

开发平台:

C/C++

  1. /*==========================================================================;
  2.  *
  3.  *  Copyright (C) Microsoft Corporation.  All Rights Reserved.
  4.  *
  5.  *  File:       ddraw.h
  6.  *  Content:    DirectDraw include file
  7.  *
  8.  ***************************************************************************/
  9. #ifndef __DDRAW_INCLUDED__
  10. #define __DDRAW_INCLUDED__
  11. //Disable the nameless union warning when building internally
  12. #undef ENABLE_NAMELESS_UNION_PRAGMA
  13. #ifdef DIRECTX_REDIST
  14. #define ENABLE_NAMELESS_UNION_PRAGMA
  15. #endif
  16. #ifdef ENABLE_NAMELESS_UNION_PRAGMA
  17. #pragma warning(disable:4201)
  18. #endif
  19. /*
  20.  * If you wish an application built against the newest version of DirectDraw
  21.  * to run against an older DirectDraw run time then define DIRECTDRAW_VERSION
  22.  * to be the earlies version of DirectDraw you wish to run against. For,
  23.  * example if you wish an application to run against a DX 3 runtime define
  24.  * DIRECTDRAW_VERSION to be 0x0300.
  25.  */
  26. #ifndef   DIRECTDRAW_VERSION
  27. #define   DIRECTDRAW_VERSION 0x0700
  28. #endif /* DIRECTDRAW_VERSION */
  29. #if defined( _WIN32 )  && !defined( _NO_COM )
  30. #define COM_NO_WINDOWS_H
  31. #include <objbase.h>
  32. #else
  33. #define IUnknown            void
  34. #if !defined( NT_BUILD_ENVIRONMENT ) && !defined(WINNT)
  35.         #define CO_E_NOTINITIALIZED 0x800401F0L
  36. #endif
  37. #endif
  38. #define _FACDD  0x876
  39. #define MAKE_DDHRESULT( code )  MAKE_HRESULT( 1, _FACDD, code )
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. //
  44. // For compilers that don't support nameless unions, do a
  45. //
  46. // #define NONAMELESSUNION
  47. //
  48. // before #include <ddraw.h>
  49. //
  50. #ifndef DUMMYUNIONNAMEN
  51. #if defined(__cplusplus) || !defined(NONAMELESSUNION)
  52. #define DUMMYUNIONNAMEN(n)
  53. #else
  54. #define DUMMYUNIONNAMEN(n)      u##n
  55. #endif
  56. #endif
  57. #ifndef MAKEFOURCC
  58.     #define MAKEFOURCC(ch0, ch1, ch2, ch3)                              
  59.                 ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) |   
  60.                 ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
  61. #endif //defined(MAKEFOURCC)
  62. /*
  63.  * FOURCC codes for DX compressed-texture pixel formats
  64.  */
  65. #define FOURCC_DXT1  (MAKEFOURCC('D','X','T','1'))
  66. #define FOURCC_DXT2  (MAKEFOURCC('D','X','T','2'))
  67. #define FOURCC_DXT3  (MAKEFOURCC('D','X','T','3'))
  68. #define FOURCC_DXT4  (MAKEFOURCC('D','X','T','4'))
  69. #define FOURCC_DXT5  (MAKEFOURCC('D','X','T','5'))
  70. /*
  71.  * GUIDS used by DirectDraw objects
  72.  */
  73. #if defined( _WIN32 ) && !defined( _NO_COM )
  74. DEFINE_GUID( CLSID_DirectDraw,                  0xD7B70EE0,0x4340,0x11CF,0xB0,0x63,0x00,0x20,0xAF,0xC2,0xCD,0x35 );
  75. DEFINE_GUID( CLSID_DirectDraw7,                 0x3c305196,0x50db,0x11d3,0x9c,0xfe,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
  76. DEFINE_GUID( CLSID_DirectDrawClipper,           0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56 );
  77. DEFINE_GUID( IID_IDirectDraw,                   0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
  78. DEFINE_GUID( IID_IDirectDraw2,                  0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 );
  79. DEFINE_GUID( IID_IDirectDraw4,                  0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
  80. DEFINE_GUID( IID_IDirectDraw7,                  0x15e65ec0,0x3b9c,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b );
  81. DEFINE_GUID( IID_IDirectDrawSurface,            0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
  82. DEFINE_GUID( IID_IDirectDrawSurface2,           0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27 );
  83. DEFINE_GUID( IID_IDirectDrawSurface3,           0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB );
  84. DEFINE_GUID( IID_IDirectDrawSurface4,           0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B );
  85. DEFINE_GUID( IID_IDirectDrawSurface7,           0x06675a80,0x3b9b,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b );
  86. DEFINE_GUID( IID_IDirectDrawPalette,            0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
  87. DEFINE_GUID( IID_IDirectDrawClipper,            0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
  88. DEFINE_GUID( IID_IDirectDrawColorControl,       0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 );
  89. DEFINE_GUID( IID_IDirectDrawGammaControl,       0x69C11C3E,0xB46B,0x11D1,0xAD,0x7A,0x00,0xC0,0x4F,0xC2,0x9B,0x4E );
  90. #endif
  91. /*============================================================================
  92.  *
  93.  * DirectDraw Structures
  94.  *
  95.  * Various structures used to invoke DirectDraw.
  96.  *
  97.  *==========================================================================*/
  98. struct IDirectDraw;
  99. struct IDirectDrawSurface;
  100. struct IDirectDrawPalette;
  101. struct IDirectDrawClipper;
  102. typedef struct IDirectDraw              FAR *LPDIRECTDRAW;
  103. typedef struct IDirectDraw2             FAR *LPDIRECTDRAW2;
  104. typedef struct IDirectDraw4             FAR *LPDIRECTDRAW4;
  105. typedef struct IDirectDraw7             FAR *LPDIRECTDRAW7;
  106. typedef struct IDirectDrawSurface       FAR *LPDIRECTDRAWSURFACE;
  107. typedef struct IDirectDrawSurface2      FAR *LPDIRECTDRAWSURFACE2;
  108. typedef struct IDirectDrawSurface3      FAR *LPDIRECTDRAWSURFACE3;
  109. typedef struct IDirectDrawSurface4      FAR *LPDIRECTDRAWSURFACE4;
  110. typedef struct IDirectDrawSurface7      FAR *LPDIRECTDRAWSURFACE7;
  111. typedef struct IDirectDrawPalette               FAR *LPDIRECTDRAWPALETTE;
  112. typedef struct IDirectDrawClipper               FAR *LPDIRECTDRAWCLIPPER;
  113. typedef struct IDirectDrawColorControl          FAR *LPDIRECTDRAWCOLORCONTROL;
  114. typedef struct IDirectDrawGammaControl          FAR *LPDIRECTDRAWGAMMACONTROL;
  115. typedef struct _DDFXROP                 FAR *LPDDFXROP;
  116. typedef struct _DDSURFACEDESC           FAR *LPDDSURFACEDESC;
  117. typedef struct _DDSURFACEDESC2          FAR *LPDDSURFACEDESC2;
  118. typedef struct _DDCOLORCONTROL          FAR *LPDDCOLORCONTROL;
  119. /*
  120.  * API's
  121.  */
  122. #if (defined (WIN32) || defined( _WIN32 ) ) && !defined( _NO_COM )
  123. //#if defined( _WIN32 ) && !defined( _NO_ENUM )
  124.     typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKA)(GUID FAR *, LPSTR, LPSTR, LPVOID);
  125.     typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKW)(GUID FAR *, LPWSTR, LPWSTR, LPVOID);
  126.     extern HRESULT WINAPI DirectDrawEnumerateW( LPDDENUMCALLBACKW lpCallback, LPVOID lpContext );
  127.     extern HRESULT WINAPI DirectDrawEnumerateA( LPDDENUMCALLBACKA lpCallback, LPVOID lpContext );
  128.     /*
  129.      * Protect against old SDKs
  130.      */
  131.     #if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500)
  132.         #define HMONITOR_DECLARED
  133.         DECLARE_HANDLE(HMONITOR);
  134.     #endif
  135.     typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKEXA)(GUID FAR *, LPSTR, LPSTR, LPVOID, HMONITOR);
  136.     typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKEXW)(GUID FAR *, LPWSTR, LPWSTR, LPVOID, HMONITOR);
  137.     extern HRESULT WINAPI DirectDrawEnumerateExW( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags);
  138.     extern HRESULT WINAPI DirectDrawEnumerateExA( LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags);
  139.     typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXA)( LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags);
  140.     typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXW)( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags);
  141.     #ifdef UNICODE
  142.         typedef LPDDENUMCALLBACKW           LPDDENUMCALLBACK;
  143.         #define DirectDrawEnumerate         DirectDrawEnumerateW
  144.         typedef LPDDENUMCALLBACKEXW         LPDDENUMCALLBACKEX;
  145.         typedef LPDIRECTDRAWENUMERATEEXW        LPDIRECTDRAWENUMERATEEX;
  146.         #define DirectDrawEnumerateEx       DirectDrawEnumerateExW
  147.     #else
  148.         typedef LPDDENUMCALLBACKA           LPDDENUMCALLBACK;
  149.         #define DirectDrawEnumerate         DirectDrawEnumerateA
  150.         typedef LPDDENUMCALLBACKEXA         LPDDENUMCALLBACKEX;
  151.         typedef LPDIRECTDRAWENUMERATEEXA        LPDIRECTDRAWENUMERATEEX;
  152.         #define DirectDrawEnumerateEx       DirectDrawEnumerateExA
  153.     #endif
  154.     extern HRESULT WINAPI DirectDrawCreate( GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter );
  155.     extern HRESULT WINAPI DirectDrawCreateEx( GUID FAR * lpGuid, LPVOID  *lplpDD, REFIID  iid,IUnknown FAR *pUnkOuter );
  156.     extern HRESULT WINAPI DirectDrawCreateClipper( DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter );
  157. #endif
  158. /*
  159.  * Flags for DirectDrawEnumerateEx
  160.  * DirectDrawEnumerateEx supercedes DirectDrawEnumerate. You must use GetProcAddress to
  161.  * obtain a function pointer (of type LPDIRECTDRAWENUMERATEEX) to DirectDrawEnumerateEx.
  162.  * By default, only the primary display device is enumerated.
  163.  * DirectDrawEnumerate is equivalent to DirectDrawEnumerate(,,DDENUM_NONDISPLAYDEVICES)
  164.  */
  165. /*
  166.  * This flag causes enumeration of any GDI display devices which are part of
  167.  * the Windows Desktop
  168.  */
  169. #define DDENUM_ATTACHEDSECONDARYDEVICES     0x00000001L
  170. /*
  171.  * This flag causes enumeration of any GDI display devices which are not
  172.  * part of the Windows Desktop
  173.  */
  174. #define DDENUM_DETACHEDSECONDARYDEVICES     0x00000002L
  175. /*
  176.  * This flag causes enumeration of non-display devices
  177.  */
  178. #define DDENUM_NONDISPLAYDEVICES            0x00000004L
  179. #define REGSTR_KEY_DDHW_DESCRIPTION     "Description"
  180. #define REGSTR_KEY_DDHW_DRIVERNAME      "DriverName"
  181. #define REGSTR_PATH_DDHW                "Hardware\DirectDrawDrivers"
  182. #define DDCREATE_HARDWAREONLY           0x00000001l
  183. #define DDCREATE_EMULATIONONLY          0x00000002l
  184. #if defined(WINNT) || !defined(WIN32)
  185. typedef long HRESULT;
  186. #endif
  187. //#ifndef WINNT
  188. typedef HRESULT (FAR PASCAL * LPDDENUMMODESCALLBACK)(LPDDSURFACEDESC, LPVOID);
  189. typedef HRESULT (FAR PASCAL * LPDDENUMMODESCALLBACK2)(LPDDSURFACEDESC2, LPVOID);
  190. typedef HRESULT (FAR PASCAL * LPDDENUMSURFACESCALLBACK)(LPDIRECTDRAWSURFACE, LPDDSURFACEDESC, LPVOID);
  191. typedef HRESULT (FAR PASCAL * LPDDENUMSURFACESCALLBACK2)(LPDIRECTDRAWSURFACE4, LPDDSURFACEDESC2, LPVOID);
  192. typedef HRESULT (FAR PASCAL * LPDDENUMSURFACESCALLBACK7)(LPDIRECTDRAWSURFACE7, LPDDSURFACEDESC2, LPVOID);
  193. //#endif
  194. /*
  195.  * Generic pixel format with 8-bit RGB and alpha components
  196.  */
  197. typedef struct _DDARGB
  198. {
  199.     BYTE blue;
  200.     BYTE green;
  201.     BYTE red;
  202.     BYTE alpha;
  203. } DDARGB;
  204. typedef DDARGB FAR *LPDDARGB;
  205. /*
  206.  * This version of the structure remains for backwards source compatibility.
  207.  * The DDARGB structure is the one that should be used for all DirectDraw APIs.
  208.  */
  209. typedef struct _DDRGBA
  210. {
  211.     BYTE red;
  212.     BYTE green;
  213.     BYTE blue;
  214.     BYTE alpha;
  215. } DDRGBA;
  216. typedef DDRGBA FAR *LPDDRGBA;
  217. /*
  218.  * DDCOLORKEY
  219.  */
  220. typedef struct _DDCOLORKEY
  221. {
  222.     DWORD       dwColorSpaceLowValue;   // low boundary of color space that is to
  223.                                         // be treated as Color Key, inclusive
  224.     DWORD       dwColorSpaceHighValue;  // high boundary of color space that is
  225.                                         // to be treated as Color Key, inclusive
  226. } DDCOLORKEY;
  227. typedef DDCOLORKEY FAR* LPDDCOLORKEY;
  228. /*
  229.  * DDBLTFX
  230.  * Used to pass override information to the DIRECTDRAWSURFACE callback Blt.
  231.  */
  232. typedef struct _DDBLTFX
  233. {
  234.     DWORD       dwSize;                         // size of structure
  235.     DWORD       dwDDFX;                         // FX operations
  236.     DWORD       dwROP;                          // Win32 raster operations
  237.     DWORD       dwDDROP;                        // Raster operations new for DirectDraw
  238.     DWORD       dwRotationAngle;                // Rotation angle for blt
  239.     DWORD       dwZBufferOpCode;                // ZBuffer compares
  240.     DWORD       dwZBufferLow;                   // Low limit of Z buffer
  241.     DWORD       dwZBufferHigh;                  // High limit of Z buffer
  242.     DWORD       dwZBufferBaseDest;              // Destination base value
  243.     DWORD       dwZDestConstBitDepth;           // Bit depth used to specify Z constant for destination
  244.     union
  245.     {
  246.         DWORD   dwZDestConst;                   // Constant to use as Z buffer for dest
  247.         LPDIRECTDRAWSURFACE lpDDSZBufferDest;   // Surface to use as Z buffer for dest
  248.     } DUMMYUNIONNAMEN(1);
  249.     DWORD       dwZSrcConstBitDepth;            // Bit depth used to specify Z constant for source
  250.     union
  251.     {
  252.         DWORD   dwZSrcConst;                    // Constant to use as Z buffer for src
  253.         LPDIRECTDRAWSURFACE lpDDSZBufferSrc;    // Surface to use as Z buffer for src
  254.     } DUMMYUNIONNAMEN(2);
  255.     DWORD       dwAlphaEdgeBlendBitDepth;       // Bit depth used to specify constant for alpha edge blend
  256.     DWORD       dwAlphaEdgeBlend;               // Alpha for edge blending
  257.     DWORD       dwReserved;
  258.     DWORD       dwAlphaDestConstBitDepth;       // Bit depth used to specify alpha constant for destination
  259.     union
  260.     {
  261.         DWORD   dwAlphaDestConst;               // Constant to use as Alpha Channel
  262.         LPDIRECTDRAWSURFACE lpDDSAlphaDest;     // Surface to use as Alpha Channel
  263.     } DUMMYUNIONNAMEN(3);
  264.     DWORD       dwAlphaSrcConstBitDepth;        // Bit depth used to specify alpha constant for source
  265.     union
  266.     {
  267.         DWORD   dwAlphaSrcConst;                // Constant to use as Alpha Channel
  268.         LPDIRECTDRAWSURFACE lpDDSAlphaSrc;      // Surface to use as Alpha Channel
  269.     } DUMMYUNIONNAMEN(4);
  270.     union
  271.     {
  272.         DWORD   dwFillColor;                    // color in RGB or Palettized
  273.         DWORD   dwFillDepth;                    // depth value for z-buffer
  274.         DWORD   dwFillPixel;                    // pixel value for RGBA or RGBZ
  275.         LPDIRECTDRAWSURFACE lpDDSPattern;       // Surface to use as pattern
  276.     } DUMMYUNIONNAMEN(5);
  277.     DDCOLORKEY  ddckDestColorkey;               // DestColorkey override
  278.     DDCOLORKEY  ddckSrcColorkey;                // SrcColorkey override
  279. } DDBLTFX;
  280. typedef DDBLTFX FAR* LPDDBLTFX;
  281. /*
  282.  * DDSCAPS
  283.  */
  284. typedef struct _DDSCAPS
  285. {
  286.     DWORD       dwCaps;         // capabilities of surface wanted
  287. } DDSCAPS;
  288. typedef DDSCAPS FAR* LPDDSCAPS;
  289. /*
  290.  * DDOSCAPS
  291.  */
  292. typedef struct _DDOSCAPS
  293. {
  294.     DWORD       dwCaps;         // capabilities of surface wanted
  295. } DDOSCAPS;
  296. typedef DDOSCAPS FAR* LPDDOSCAPS;
  297. /*
  298.  * This structure is used internally by DirectDraw.
  299.  */
  300. typedef struct _DDSCAPSEX
  301. {
  302.     DWORD       dwCaps2;
  303.     DWORD       dwCaps3;
  304.     union
  305.     {
  306.         DWORD       dwCaps4;
  307.         DWORD       dwVolumeDepth;
  308.     } DUMMYUNIONNAMEN(1);
  309. } DDSCAPSEX, FAR * LPDDSCAPSEX;
  310. /*
  311.  * DDSCAPS2
  312.  */
  313. typedef struct _DDSCAPS2
  314. {
  315.     DWORD       dwCaps;         // capabilities of surface wanted
  316.     DWORD       dwCaps2;
  317.     DWORD       dwCaps3;
  318.     union
  319.     {
  320.         DWORD       dwCaps4;
  321.         DWORD       dwVolumeDepth;
  322.     } DUMMYUNIONNAMEN(1);
  323. } DDSCAPS2;
  324. typedef DDSCAPS2 FAR* LPDDSCAPS2;
  325. /*
  326.  * DDCAPS
  327.  */
  328. #define DD_ROP_SPACE            (256/32)        // space required to store ROP array
  329. /*
  330.  * NOTE: Our choosen structure number scheme is to append a single digit to
  331.  * the end of the structure giving the version that structure is associated
  332.  * with.
  333.  */
  334. /*
  335.  * This structure represents the DDCAPS structure released in DirectDraw 1.0.  It is used internally
  336.  * by DirectDraw to interpret caps passed into ddraw by drivers written prior to the release of DirectDraw 2.0.
  337.  * New applications should use the DDCAPS structure defined below.
  338.  */
  339. typedef struct _DDCAPS_DX1
  340. {
  341.     DWORD       dwSize;                 // size of the DDDRIVERCAPS structure
  342.     DWORD       dwCaps;                 // driver specific capabilities
  343.     DWORD       dwCaps2;                // more driver specific capabilites
  344.     DWORD       dwCKeyCaps;             // color key capabilities of the surface
  345.     DWORD       dwFXCaps;               // driver specific stretching and effects capabilites
  346.     DWORD       dwFXAlphaCaps;          // alpha driver specific capabilities
  347.     DWORD       dwPalCaps;              // palette capabilities
  348.     DWORD       dwSVCaps;               // stereo vision capabilities
  349.     DWORD       dwAlphaBltConstBitDepths;       // DDBD_2,4,8
  350.     DWORD       dwAlphaBltPixelBitDepths;       // DDBD_1,2,4,8
  351.     DWORD       dwAlphaBltSurfaceBitDepths;     // DDBD_1,2,4,8
  352.     DWORD       dwAlphaOverlayConstBitDepths;   // DDBD_2,4,8
  353.     DWORD       dwAlphaOverlayPixelBitDepths;   // DDBD_1,2,4,8
  354.     DWORD       dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8
  355.     DWORD       dwZBufferBitDepths;             // DDBD_8,16,24,32
  356.     DWORD       dwVidMemTotal;          // total amount of video memory
  357.     DWORD       dwVidMemFree;           // amount of free video memory
  358.     DWORD       dwMaxVisibleOverlays;   // maximum number of visible overlays
  359.     DWORD       dwCurrVisibleOverlays;  // current number of visible overlays
  360.     DWORD       dwNumFourCCCodes;       // number of four cc codes
  361.     DWORD       dwAlignBoundarySrc;     // source rectangle alignment
  362.     DWORD       dwAlignSizeSrc;         // source rectangle byte size
  363.     DWORD       dwAlignBoundaryDest;    // dest rectangle alignment
  364.     DWORD       dwAlignSizeDest;        // dest rectangle byte size
  365.     DWORD       dwAlignStrideAlign;     // stride alignment
  366.     DWORD       dwRops[DD_ROP_SPACE];   // ROPS supported
  367.     DDSCAPS     ddsCaps;                // DDSCAPS structure has all the general capabilities
  368.     DWORD       dwMinOverlayStretch;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  369.     DWORD       dwMaxOverlayStretch;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  370.     DWORD       dwMinLiveVideoStretch;  // OBSOLETE! This field remains for compatability reasons only
  371.     DWORD       dwMaxLiveVideoStretch;  // OBSOLETE! This field remains for compatability reasons only
  372.     DWORD       dwMinHwCodecStretch;    // OBSOLETE! This field remains for compatability reasons only
  373.     DWORD       dwMaxHwCodecStretch;    // OBSOLETE! This field remains for compatability reasons only
  374.     DWORD       dwReserved1;            // reserved
  375.     DWORD       dwReserved2;            // reserved
  376.     DWORD       dwReserved3;            // reserved
  377. } DDCAPS_DX1;
  378. typedef DDCAPS_DX1 FAR* LPDDCAPS_DX1;
  379. /*
  380.  * This structure is the DDCAPS structure as it was in version 2 and 3 of Direct X.
  381.  * It is present for back compatability.
  382.  */
  383. typedef struct _DDCAPS_DX3
  384. {
  385.     DWORD       dwSize;                 // size of the DDDRIVERCAPS structure
  386.     DWORD       dwCaps;                 // driver specific capabilities
  387.     DWORD       dwCaps2;                // more driver specific capabilites
  388.     DWORD       dwCKeyCaps;             // color key capabilities of the surface
  389.     DWORD       dwFXCaps;               // driver specific stretching and effects capabilites
  390.     DWORD       dwFXAlphaCaps;          // alpha driver specific capabilities
  391.     DWORD       dwPalCaps;              // palette capabilities
  392.     DWORD       dwSVCaps;               // stereo vision capabilities
  393.     DWORD       dwAlphaBltConstBitDepths;       // DDBD_2,4,8
  394.     DWORD       dwAlphaBltPixelBitDepths;       // DDBD_1,2,4,8
  395.     DWORD       dwAlphaBltSurfaceBitDepths;     // DDBD_1,2,4,8
  396.     DWORD       dwAlphaOverlayConstBitDepths;   // DDBD_2,4,8
  397.     DWORD       dwAlphaOverlayPixelBitDepths;   // DDBD_1,2,4,8
  398.     DWORD       dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8
  399.     DWORD       dwZBufferBitDepths;             // DDBD_8,16,24,32
  400.     DWORD       dwVidMemTotal;          // total amount of video memory
  401.     DWORD       dwVidMemFree;           // amount of free video memory
  402.     DWORD       dwMaxVisibleOverlays;   // maximum number of visible overlays
  403.     DWORD       dwCurrVisibleOverlays;  // current number of visible overlays
  404.     DWORD       dwNumFourCCCodes;       // number of four cc codes
  405.     DWORD       dwAlignBoundarySrc;     // source rectangle alignment
  406.     DWORD       dwAlignSizeSrc;         // source rectangle byte size
  407.     DWORD       dwAlignBoundaryDest;    // dest rectangle alignment
  408.     DWORD       dwAlignSizeDest;        // dest rectangle byte size
  409.     DWORD       dwAlignStrideAlign;     // stride alignment
  410.     DWORD       dwRops[DD_ROP_SPACE];   // ROPS supported
  411.     DDSCAPS     ddsCaps;                // DDSCAPS structure has all the general capabilities
  412.     DWORD       dwMinOverlayStretch;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  413.     DWORD       dwMaxOverlayStretch;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  414.     DWORD       dwMinLiveVideoStretch;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  415.     DWORD       dwMaxLiveVideoStretch;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  416.     DWORD       dwMinHwCodecStretch;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  417.     DWORD       dwMaxHwCodecStretch;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  418.     DWORD       dwReserved1;            // reserved
  419.     DWORD       dwReserved2;            // reserved
  420.     DWORD       dwReserved3;            // reserved
  421.     DWORD       dwSVBCaps;              // driver specific capabilities for System->Vmem blts
  422.     DWORD       dwSVBCKeyCaps;          // driver color key capabilities for System->Vmem blts
  423.     DWORD       dwSVBFXCaps;            // driver FX capabilities for System->Vmem blts
  424.     DWORD       dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts
  425.     DWORD       dwVSBCaps;              // driver specific capabilities for Vmem->System blts
  426.     DWORD       dwVSBCKeyCaps;          // driver color key capabilities for Vmem->System blts
  427.     DWORD       dwVSBFXCaps;            // driver FX capabilities for Vmem->System blts
  428.     DWORD       dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts
  429.     DWORD       dwSSBCaps;              // driver specific capabilities for System->System blts
  430.     DWORD       dwSSBCKeyCaps;          // driver color key capabilities for System->System blts
  431.     DWORD       dwSSBFXCaps;            // driver FX capabilities for System->System blts
  432.     DWORD       dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts
  433.     DWORD       dwReserved4;            // reserved
  434.     DWORD       dwReserved5;            // reserved
  435.     DWORD       dwReserved6;            // reserved
  436. } DDCAPS_DX3;
  437. typedef DDCAPS_DX3 FAR* LPDDCAPS_DX3;
  438. /*
  439.  * This structure is the DDCAPS structure as it was in version 5 of Direct X.
  440.  * It is present for back compatability.
  441.  */
  442. typedef struct _DDCAPS_DX5
  443. {
  444. /*  0*/ DWORD   dwSize;                 // size of the DDDRIVERCAPS structure
  445. /*  4*/ DWORD   dwCaps;                 // driver specific capabilities
  446. /*  8*/ DWORD   dwCaps2;                // more driver specific capabilites
  447. /*  c*/ DWORD   dwCKeyCaps;             // color key capabilities of the surface
  448. /* 10*/ DWORD   dwFXCaps;               // driver specific stretching and effects capabilites
  449. /* 14*/ DWORD   dwFXAlphaCaps;          // alpha driver specific capabilities
  450. /* 18*/ DWORD   dwPalCaps;              // palette capabilities
  451. /* 1c*/ DWORD   dwSVCaps;               // stereo vision capabilities
  452. /* 20*/ DWORD   dwAlphaBltConstBitDepths;       // DDBD_2,4,8
  453. /* 24*/ DWORD   dwAlphaBltPixelBitDepths;       // DDBD_1,2,4,8
  454. /* 28*/ DWORD   dwAlphaBltSurfaceBitDepths;     // DDBD_1,2,4,8
  455. /* 2c*/ DWORD   dwAlphaOverlayConstBitDepths;   // DDBD_2,4,8
  456. /* 30*/ DWORD   dwAlphaOverlayPixelBitDepths;   // DDBD_1,2,4,8
  457. /* 34*/ DWORD   dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8
  458. /* 38*/ DWORD   dwZBufferBitDepths;             // DDBD_8,16,24,32
  459. /* 3c*/ DWORD   dwVidMemTotal;          // total amount of video memory
  460. /* 40*/ DWORD   dwVidMemFree;           // amount of free video memory
  461. /* 44*/ DWORD   dwMaxVisibleOverlays;   // maximum number of visible overlays
  462. /* 48*/ DWORD   dwCurrVisibleOverlays;  // current number of visible overlays
  463. /* 4c*/ DWORD   dwNumFourCCCodes;       // number of four cc codes
  464. /* 50*/ DWORD   dwAlignBoundarySrc;     // source rectangle alignment
  465. /* 54*/ DWORD   dwAlignSizeSrc;         // source rectangle byte size
  466. /* 58*/ DWORD   dwAlignBoundaryDest;    // dest rectangle alignment
  467. /* 5c*/ DWORD   dwAlignSizeDest;        // dest rectangle byte size
  468. /* 60*/ DWORD   dwAlignStrideAlign;     // stride alignment
  469. /* 64*/ DWORD   dwRops[DD_ROP_SPACE];   // ROPS supported
  470. /* 84*/ DDSCAPS ddsCaps;                // DDSCAPS structure has all the general capabilities
  471. /* 88*/ DWORD   dwMinOverlayStretch;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  472. /* 8c*/ DWORD   dwMaxOverlayStretch;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  473. /* 90*/ DWORD   dwMinLiveVideoStretch;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  474. /* 94*/ DWORD   dwMaxLiveVideoStretch;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  475. /* 98*/ DWORD   dwMinHwCodecStretch;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  476. /* 9c*/ DWORD   dwMaxHwCodecStretch;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  477. /* a0*/ DWORD   dwReserved1;            // reserved
  478. /* a4*/ DWORD   dwReserved2;            // reserved
  479. /* a8*/ DWORD   dwReserved3;            // reserved
  480. /* ac*/ DWORD   dwSVBCaps;              // driver specific capabilities for System->Vmem blts
  481. /* b0*/ DWORD   dwSVBCKeyCaps;          // driver color key capabilities for System->Vmem blts
  482. /* b4*/ DWORD   dwSVBFXCaps;            // driver FX capabilities for System->Vmem blts
  483. /* b8*/ DWORD   dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts
  484. /* d8*/ DWORD   dwVSBCaps;              // driver specific capabilities for Vmem->System blts
  485. /* dc*/ DWORD   dwVSBCKeyCaps;          // driver color key capabilities for Vmem->System blts
  486. /* e0*/ DWORD   dwVSBFXCaps;            // driver FX capabilities for Vmem->System blts
  487. /* e4*/ DWORD   dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts
  488. /*104*/ DWORD   dwSSBCaps;              // driver specific capabilities for System->System blts
  489. /*108*/ DWORD   dwSSBCKeyCaps;          // driver color key capabilities for System->System blts
  490. /*10c*/ DWORD   dwSSBFXCaps;            // driver FX capabilities for System->System blts
  491. /*110*/ DWORD   dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts
  492. // Members added for DX5:
  493. /*130*/ DWORD   dwMaxVideoPorts;        // maximum number of usable video ports
  494. /*134*/ DWORD   dwCurrVideoPorts;       // current number of video ports used
  495. /*138*/ DWORD   dwSVBCaps2;             // more driver specific capabilities for System->Vmem blts
  496. /*13c*/ DWORD   dwNLVBCaps;               // driver specific capabilities for non-local->local vidmem blts
  497. /*140*/ DWORD   dwNLVBCaps2;              // more driver specific capabilities non-local->local vidmem blts
  498. /*144*/ DWORD   dwNLVBCKeyCaps;           // driver color key capabilities for non-local->local vidmem blts
  499. /*148*/ DWORD   dwNLVBFXCaps;             // driver FX capabilities for non-local->local blts
  500. /*14c*/ DWORD   dwNLVBRops[DD_ROP_SPACE]; // ROPS supported for non-local->local blts
  501. } DDCAPS_DX5;
  502. typedef DDCAPS_DX5 FAR* LPDDCAPS_DX5;
  503. typedef struct _DDCAPS_DX6
  504. {
  505. /*  0*/ DWORD   dwSize;                 // size of the DDDRIVERCAPS structure
  506. /*  4*/ DWORD   dwCaps;                 // driver specific capabilities
  507. /*  8*/ DWORD   dwCaps2;                // more driver specific capabilites
  508. /*  c*/ DWORD   dwCKeyCaps;             // color key capabilities of the surface
  509. /* 10*/ DWORD   dwFXCaps;               // driver specific stretching and effects capabilites
  510. /* 14*/ DWORD   dwFXAlphaCaps;          // alpha caps
  511. /* 18*/ DWORD   dwPalCaps;              // palette capabilities
  512. /* 1c*/ DWORD   dwSVCaps;               // stereo vision capabilities
  513. /* 20*/ DWORD   dwAlphaBltConstBitDepths;       // DDBD_2,4,8
  514. /* 24*/ DWORD   dwAlphaBltPixelBitDepths;       // DDBD_1,2,4,8
  515. /* 28*/ DWORD   dwAlphaBltSurfaceBitDepths;     // DDBD_1,2,4,8
  516. /* 2c*/ DWORD   dwAlphaOverlayConstBitDepths;   // DDBD_2,4,8
  517. /* 30*/ DWORD   dwAlphaOverlayPixelBitDepths;   // DDBD_1,2,4,8
  518. /* 34*/ DWORD   dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8
  519. /* 38*/ DWORD   dwZBufferBitDepths;             // DDBD_8,16,24,32
  520. /* 3c*/ DWORD   dwVidMemTotal;          // total amount of video memory
  521. /* 40*/ DWORD   dwVidMemFree;           // amount of free video memory
  522. /* 44*/ DWORD   dwMaxVisibleOverlays;   // maximum number of visible overlays
  523. /* 48*/ DWORD   dwCurrVisibleOverlays;  // current number of visible overlays
  524. /* 4c*/ DWORD   dwNumFourCCCodes;       // number of four cc codes
  525. /* 50*/ DWORD   dwAlignBoundarySrc;     // source rectangle alignment
  526. /* 54*/ DWORD   dwAlignSizeSrc;         // source rectangle byte size
  527. /* 58*/ DWORD   dwAlignBoundaryDest;    // dest rectangle alignment
  528. /* 5c*/ DWORD   dwAlignSizeDest;        // dest rectangle byte size
  529. /* 60*/ DWORD   dwAlignStrideAlign;     // stride alignment
  530. /* 64*/ DWORD   dwRops[DD_ROP_SPACE];   // ROPS supported
  531. /* 84*/ DDSCAPS ddsOldCaps;             // Was DDSCAPS  ddsCaps. ddsCaps is of type DDSCAPS2 for DX6
  532. /* 88*/ DWORD   dwMinOverlayStretch;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  533. /* 8c*/ DWORD   dwMaxOverlayStretch;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  534. /* 90*/ DWORD   dwMinLiveVideoStretch;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  535. /* 94*/ DWORD   dwMaxLiveVideoStretch;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  536. /* 98*/ DWORD   dwMinHwCodecStretch;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  537. /* 9c*/ DWORD   dwMaxHwCodecStretch;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  538. /* a0*/ DWORD   dwReserved1;            // reserved
  539. /* a4*/ DWORD   dwReserved2;            // reserved
  540. /* a8*/ DWORD   dwReserved3;            // reserved
  541. /* ac*/ DWORD   dwSVBCaps;              // driver specific capabilities for System->Vmem blts
  542. /* b0*/ DWORD   dwSVBCKeyCaps;          // driver color key capabilities for System->Vmem blts
  543. /* b4*/ DWORD   dwSVBFXCaps;            // driver FX capabilities for System->Vmem blts
  544. /* b8*/ DWORD   dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts
  545. /* d8*/ DWORD   dwVSBCaps;              // driver specific capabilities for Vmem->System blts
  546. /* dc*/ DWORD   dwVSBCKeyCaps;          // driver color key capabilities for Vmem->System blts
  547. /* e0*/ DWORD   dwVSBFXCaps;            // driver FX capabilities for Vmem->System blts
  548. /* e4*/ DWORD   dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts
  549. /*104*/ DWORD   dwSSBCaps;              // driver specific capabilities for System->System blts
  550. /*108*/ DWORD   dwSSBCKeyCaps;          // driver color key capabilities for System->System blts
  551. /*10c*/ DWORD   dwSSBFXCaps;            // driver FX capabilities for System->System blts
  552. /*110*/ DWORD   dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts
  553. /*130*/ DWORD   dwMaxVideoPorts;        // maximum number of usable video ports
  554. /*134*/ DWORD   dwCurrVideoPorts;       // current number of video ports used
  555. /*138*/ DWORD   dwSVBCaps2;             // more driver specific capabilities for System->Vmem blts
  556. /*13c*/ DWORD   dwNLVBCaps;               // driver specific capabilities for non-local->local vidmem blts
  557. /*140*/ DWORD   dwNLVBCaps2;              // more driver specific capabilities non-local->local vidmem blts
  558. /*144*/ DWORD   dwNLVBCKeyCaps;           // driver color key capabilities for non-local->local vidmem blts
  559. /*148*/ DWORD   dwNLVBFXCaps;             // driver FX capabilities for non-local->local blts
  560. /*14c*/ DWORD   dwNLVBRops[DD_ROP_SPACE]; // ROPS supported for non-local->local blts
  561. // Members added for DX6 release
  562. /*16c*/ DDSCAPS2 ddsCaps;               // Surface Caps
  563. } DDCAPS_DX6;
  564. typedef DDCAPS_DX6 FAR* LPDDCAPS_DX6;
  565. typedef struct _DDCAPS_DX7
  566. {
  567. /*  0*/ DWORD   dwSize;                 // size of the DDDRIVERCAPS structure
  568. /*  4*/ DWORD   dwCaps;                 // driver specific capabilities
  569. /*  8*/ DWORD   dwCaps2;                // more driver specific capabilites
  570. /*  c*/ DWORD   dwCKeyCaps;             // color key capabilities of the surface
  571. /* 10*/ DWORD   dwFXCaps;               // driver specific stretching and effects capabilites
  572. /* 14*/ DWORD   dwFXAlphaCaps;          // alpha driver specific capabilities
  573. /* 18*/ DWORD   dwPalCaps;              // palette capabilities
  574. /* 1c*/ DWORD   dwSVCaps;               // stereo vision capabilities
  575. /* 20*/ DWORD   dwAlphaBltConstBitDepths;       // DDBD_2,4,8
  576. /* 24*/ DWORD   dwAlphaBltPixelBitDepths;       // DDBD_1,2,4,8
  577. /* 28*/ DWORD   dwAlphaBltSurfaceBitDepths;     // DDBD_1,2,4,8
  578. /* 2c*/ DWORD   dwAlphaOverlayConstBitDepths;   // DDBD_2,4,8
  579. /* 30*/ DWORD   dwAlphaOverlayPixelBitDepths;   // DDBD_1,2,4,8
  580. /* 34*/ DWORD   dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8
  581. /* 38*/ DWORD   dwZBufferBitDepths;             // DDBD_8,16,24,32
  582. /* 3c*/ DWORD   dwVidMemTotal;          // total amount of video memory
  583. /* 40*/ DWORD   dwVidMemFree;           // amount of free video memory
  584. /* 44*/ DWORD   dwMaxVisibleOverlays;   // maximum number of visible overlays
  585. /* 48*/ DWORD   dwCurrVisibleOverlays;  // current number of visible overlays
  586. /* 4c*/ DWORD   dwNumFourCCCodes;       // number of four cc codes
  587. /* 50*/ DWORD   dwAlignBoundarySrc;     // source rectangle alignment
  588. /* 54*/ DWORD   dwAlignSizeSrc;         // source rectangle byte size
  589. /* 58*/ DWORD   dwAlignBoundaryDest;    // dest rectangle alignment
  590. /* 5c*/ DWORD   dwAlignSizeDest;        // dest rectangle byte size
  591. /* 60*/ DWORD   dwAlignStrideAlign;     // stride alignment
  592. /* 64*/ DWORD   dwRops[DD_ROP_SPACE];   // ROPS supported
  593. /* 84*/ DDSCAPS ddsOldCaps;             // Was DDSCAPS  ddsCaps. ddsCaps is of type DDSCAPS2 for DX6
  594. /* 88*/ DWORD   dwMinOverlayStretch;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  595. /* 8c*/ DWORD   dwMaxOverlayStretch;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  596. /* 90*/ DWORD   dwMinLiveVideoStretch;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  597. /* 94*/ DWORD   dwMaxLiveVideoStretch;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  598. /* 98*/ DWORD   dwMinHwCodecStretch;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  599. /* 9c*/ DWORD   dwMaxHwCodecStretch;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  600. /* a0*/ DWORD   dwReserved1;            // reserved
  601. /* a4*/ DWORD   dwReserved2;            // reserved
  602. /* a8*/ DWORD   dwReserved3;            // reserved
  603. /* ac*/ DWORD   dwSVBCaps;              // driver specific capabilities for System->Vmem blts
  604. /* b0*/ DWORD   dwSVBCKeyCaps;          // driver color key capabilities for System->Vmem blts
  605. /* b4*/ DWORD   dwSVBFXCaps;            // driver FX capabilities for System->Vmem blts
  606. /* b8*/ DWORD   dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts
  607. /* d8*/ DWORD   dwVSBCaps;              // driver specific capabilities for Vmem->System blts
  608. /* dc*/ DWORD   dwVSBCKeyCaps;          // driver color key capabilities for Vmem->System blts
  609. /* e0*/ DWORD   dwVSBFXCaps;            // driver FX capabilities for Vmem->System blts
  610. /* e4*/ DWORD   dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts
  611. /*104*/ DWORD   dwSSBCaps;              // driver specific capabilities for System->System blts
  612. /*108*/ DWORD   dwSSBCKeyCaps;          // driver color key capabilities for System->System blts
  613. /*10c*/ DWORD   dwSSBFXCaps;            // driver FX capabilities for System->System blts
  614. /*110*/ DWORD   dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts
  615. /*130*/ DWORD   dwMaxVideoPorts;        // maximum number of usable video ports
  616. /*134*/ DWORD   dwCurrVideoPorts;       // current number of video ports used
  617. /*138*/ DWORD   dwSVBCaps2;             // more driver specific capabilities for System->Vmem blts
  618. /*13c*/ DWORD   dwNLVBCaps;               // driver specific capabilities for non-local->local vidmem blts
  619. /*140*/ DWORD   dwNLVBCaps2;              // more driver specific capabilities non-local->local vidmem blts
  620. /*144*/ DWORD   dwNLVBCKeyCaps;           // driver color key capabilities for non-local->local vidmem blts
  621. /*148*/ DWORD   dwNLVBFXCaps;             // driver FX capabilities for non-local->local blts
  622. /*14c*/ DWORD   dwNLVBRops[DD_ROP_SPACE]; // ROPS supported for non-local->local blts
  623. // Members added for DX6 release
  624. /*16c*/ DDSCAPS2 ddsCaps;               // Surface Caps
  625. } DDCAPS_DX7;
  626. typedef DDCAPS_DX7 FAR* LPDDCAPS_DX7;
  627. #if DIRECTDRAW_VERSION <= 0x300
  628.     typedef DDCAPS_DX3 DDCAPS;
  629. #elif DIRECTDRAW_VERSION <= 0x500
  630.     typedef DDCAPS_DX5 DDCAPS;
  631. #elif DIRECTDRAW_VERSION <= 0x600
  632.     typedef DDCAPS_DX6 DDCAPS;
  633. #else
  634.     typedef DDCAPS_DX7 DDCAPS;
  635. #endif
  636. typedef DDCAPS FAR* LPDDCAPS;
  637. /*
  638.  * DDPIXELFORMAT
  639.  */
  640. typedef struct _DDPIXELFORMAT
  641. {
  642.     DWORD       dwSize;                 // size of structure
  643.     DWORD       dwFlags;                // pixel format flags
  644.     DWORD       dwFourCC;               // (FOURCC code)
  645.     union
  646.     {
  647.         DWORD   dwRGBBitCount;          // how many bits per pixel
  648.         DWORD   dwYUVBitCount;          // how many bits per pixel
  649.         DWORD   dwZBufferBitDepth;      // how many total bits/pixel in z buffer (including any stencil bits)
  650.         DWORD   dwAlphaBitDepth;        // how many bits for alpha channels
  651.         DWORD   dwLuminanceBitCount;    // how many bits per pixel
  652.         DWORD   dwBumpBitCount;         // how many bits per "buxel", total
  653.         DWORD   dwPrivateFormatBitCount;// Bits per pixel of private driver formats. Only valid in texture
  654.                                         // format list and if DDPF_D3DFORMAT is set
  655.     } DUMMYUNIONNAMEN(1);
  656.     union
  657.     {
  658.         DWORD   dwRBitMask;             // mask for red bit
  659.         DWORD   dwYBitMask;             // mask for Y bits
  660.         DWORD   dwStencilBitDepth;      // how many stencil bits (note: dwZBufferBitDepth-dwStencilBitDepth is total Z-only bits)
  661.         DWORD   dwLuminanceBitMask;     // mask for luminance bits
  662.         DWORD   dwBumpDuBitMask;        // mask for bump map U delta bits
  663.         DWORD   dwOperations;           // DDPF_D3DFORMAT Operations
  664.     } DUMMYUNIONNAMEN(2);
  665.     union
  666.     {
  667.         DWORD   dwGBitMask;             // mask for green bits
  668.         DWORD   dwUBitMask;             // mask for U bits
  669.         DWORD   dwZBitMask;             // mask for Z bits
  670.         DWORD   dwBumpDvBitMask;        // mask for bump map V delta bits
  671.         struct
  672.         {
  673.             WORD    wFlipMSTypes;       // Multisample methods supported via flip for this D3DFORMAT
  674.             WORD    wBltMSTypes;        // Multisample methods supported via blt for this D3DFORMAT
  675.         } MultiSampleCaps;
  676.     } DUMMYUNIONNAMEN(3);
  677.     union
  678.     {
  679.         DWORD   dwBBitMask;             // mask for blue bits
  680.         DWORD   dwVBitMask;             // mask for V bits
  681.         DWORD   dwStencilBitMask;       // mask for stencil bits
  682.         DWORD   dwBumpLuminanceBitMask; // mask for luminance in bump map
  683.     } DUMMYUNIONNAMEN(4);
  684.     union
  685.     {
  686.         DWORD   dwRGBAlphaBitMask;      // mask for alpha channel
  687.         DWORD   dwYUVAlphaBitMask;      // mask for alpha channel
  688.         DWORD   dwLuminanceAlphaBitMask;// mask for alpha channel
  689.         DWORD   dwRGBZBitMask;          // mask for Z channel
  690.         DWORD   dwYUVZBitMask;          // mask for Z channel
  691.     } DUMMYUNIONNAMEN(5);
  692. } DDPIXELFORMAT;
  693. typedef DDPIXELFORMAT FAR* LPDDPIXELFORMAT;
  694. /*
  695.  * DDOVERLAYFX
  696.  */
  697. typedef struct _DDOVERLAYFX
  698. {
  699.     DWORD       dwSize;                         // size of structure
  700.     DWORD       dwAlphaEdgeBlendBitDepth;       // Bit depth used to specify constant for alpha edge blend
  701.     DWORD       dwAlphaEdgeBlend;               // Constant to use as alpha for edge blend
  702.     DWORD       dwReserved;
  703.     DWORD       dwAlphaDestConstBitDepth;       // Bit depth used to specify alpha constant for destination
  704.     union
  705.     {
  706.         DWORD   dwAlphaDestConst;               // Constant to use as alpha channel for dest
  707.         LPDIRECTDRAWSURFACE lpDDSAlphaDest;     // Surface to use as alpha channel for dest
  708.     } DUMMYUNIONNAMEN(1);
  709.     DWORD       dwAlphaSrcConstBitDepth;        // Bit depth used to specify alpha constant for source
  710.     union
  711.     {
  712.         DWORD   dwAlphaSrcConst;                // Constant to use as alpha channel for src
  713.         LPDIRECTDRAWSURFACE lpDDSAlphaSrc;      // Surface to use as alpha channel for src
  714.     } DUMMYUNIONNAMEN(2);
  715.     DDCOLORKEY  dckDestColorkey;                // DestColorkey override
  716.     DDCOLORKEY  dckSrcColorkey;                 // DestColorkey override
  717.     DWORD       dwDDFX;                         // Overlay FX
  718.     DWORD       dwFlags;                        // flags
  719. } DDOVERLAYFX;
  720. typedef DDOVERLAYFX FAR *LPDDOVERLAYFX;
  721. /*
  722.  * DDBLTBATCH: BltBatch entry structure
  723.  */
  724. typedef struct _DDBLTBATCH
  725. {
  726.     LPRECT              lprDest;
  727.     LPDIRECTDRAWSURFACE lpDDSSrc;
  728.     LPRECT              lprSrc;
  729.     DWORD               dwFlags;
  730.     LPDDBLTFX           lpDDBltFx;
  731. } DDBLTBATCH;
  732. typedef DDBLTBATCH FAR * LPDDBLTBATCH;
  733. /*
  734.  * DDGAMMARAMP
  735.  */
  736. typedef struct _DDGAMMARAMP
  737. {
  738.     WORD                red[256];
  739.     WORD                green[256];
  740.     WORD                blue[256];
  741. } DDGAMMARAMP;
  742. typedef DDGAMMARAMP FAR * LPDDGAMMARAMP;
  743. /*
  744.  *  This is the structure within which DirectDraw returns data about the current graphics driver and chipset
  745.  */
  746. #define MAX_DDDEVICEID_STRING           512
  747. typedef struct tagDDDEVICEIDENTIFIER
  748. {
  749.     /*
  750.      * These elements are for presentation to the user only. They should not be used to identify particular
  751.      * drivers, since this is unreliable and many different strings may be associated with the same
  752.      * device, and the same driver from different vendors.
  753.      */
  754.     char    szDriver[MAX_DDDEVICEID_STRING];
  755.     char    szDescription[MAX_DDDEVICEID_STRING];
  756.     /*
  757.      * This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons
  758.      * on the whole 64 bits. Caution should be exercised if you use this element to identify problematic
  759.      * drivers. It is recommended that guidDeviceIdentifier is used for this purpose.
  760.      *
  761.      * This version has the form:
  762.      *  wProduct = HIWORD(liDriverVersion.HighPart)
  763.      *  wVersion = LOWORD(liDriverVersion.HighPart)
  764.      *  wSubVersion = HIWORD(liDriverVersion.LowPart)
  765.      *  wBuild = LOWORD(liDriverVersion.LowPart)
  766.      */
  767. #ifdef _WIN32
  768.     LARGE_INTEGER liDriverVersion;      /* Defined for applications and other 32 bit components */
  769. #else
  770.     DWORD   dwDriverVersionLowPart;     /* Defined for 16 bit driver components */
  771.     DWORD   dwDriverVersionHighPart;
  772. #endif
  773.     /*
  774.      * These elements can be used to identify particular chipsets. Use with extreme caution.
  775.      *   dwVendorId     Identifies the manufacturer. May be zero if unknown.
  776.      *   dwDeviceId     Identifies the type of chipset. May be zero if unknown.
  777.      *   dwSubSysId     Identifies the subsystem, typically this means the particular board. May be zero if unknown.
  778.      *   dwRevision     Identifies the revision level of the chipset. May be zero if unknown.
  779.      */
  780.     DWORD   dwVendorId;
  781.     DWORD   dwDeviceId;
  782.     DWORD   dwSubSysId;
  783.     DWORD   dwRevision;
  784.     /*
  785.      * This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the
  786.      * driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to
  787.      * reprofile the graphics subsystem.
  788.      * This element can also be used to identify particular problematic drivers.
  789.      */
  790.     GUID    guidDeviceIdentifier;
  791. } DDDEVICEIDENTIFIER, * LPDDDEVICEIDENTIFIER;
  792. typedef struct tagDDDEVICEIDENTIFIER2
  793. {
  794.     /*
  795.      * These elements are for presentation to the user only. They should not be used to identify particular
  796.      * drivers, since this is unreliable and many different strings may be associated with the same
  797.      * device, and the same driver from different vendors.
  798.      */
  799.     char    szDriver[MAX_DDDEVICEID_STRING];
  800.     char    szDescription[MAX_DDDEVICEID_STRING];
  801.     /*
  802.      * This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons
  803.      * on the whole 64 bits. Caution should be exercised if you use this element to identify problematic
  804.      * drivers. It is recommended that guidDeviceIdentifier is used for this purpose.
  805.      *
  806.      * This version has the form:
  807.      *  wProduct = HIWORD(liDriverVersion.HighPart)
  808.      *  wVersion = LOWORD(liDriverVersion.HighPart)
  809.      *  wSubVersion = HIWORD(liDriverVersion.LowPart)
  810.      *  wBuild = LOWORD(liDriverVersion.LowPart)
  811.      */
  812. #ifdef _WIN32
  813.     LARGE_INTEGER liDriverVersion;      /* Defined for applications and other 32 bit components */
  814. #else
  815.     DWORD   dwDriverVersionLowPart;     /* Defined for 16 bit driver components */
  816.     DWORD   dwDriverVersionHighPart;
  817. #endif
  818.     /*
  819.      * These elements can be used to identify particular chipsets. Use with extreme caution.
  820.      *   dwVendorId     Identifies the manufacturer. May be zero if unknown.
  821.      *   dwDeviceId     Identifies the type of chipset. May be zero if unknown.
  822.      *   dwSubSysId     Identifies the subsystem, typically this means the particular board. May be zero if unknown.
  823.      *   dwRevision     Identifies the revision level of the chipset. May be zero if unknown.
  824.      */
  825.     DWORD   dwVendorId;
  826.     DWORD   dwDeviceId;
  827.     DWORD   dwSubSysId;
  828.     DWORD   dwRevision;
  829.     /*
  830.      * This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the
  831.      * driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to
  832.      * reprofile the graphics subsystem.
  833.      * This element can also be used to identify particular problematic drivers.
  834.      */
  835.     GUID    guidDeviceIdentifier;
  836.     /*
  837.      * This element is used to determine the Windows Hardware Quality Lab (WHQL)
  838.      * certification level for this driver/device pair.
  839.      */
  840.     DWORD   dwWHQLLevel;
  841. } DDDEVICEIDENTIFIER2, * LPDDDEVICEIDENTIFIER2;
  842. /*
  843.  * Flags for the IDirectDraw4::GetDeviceIdentifier method
  844.  */
  845. /*
  846.  * This flag causes GetDeviceIdentifier to return information about the host (typically 2D) adapter in a system equipped
  847.  * with a stacked secondary 3D adapter. Such an adapter appears to the application as if it were part of the
  848.  * host adapter, but is typically physcially located on a separate card. The stacked secondary's information is
  849.  * returned when GetDeviceIdentifier's dwFlags field is zero, since this most accurately reflects the qualities
  850.  * of the DirectDraw object involved.
  851.  */
  852. #define DDGDI_GETHOSTIDENTIFIER         0x00000001L
  853. /*
  854.  * Macros for interpretting DDEVICEIDENTIFIER2.dwWHQLLevel
  855.  */
  856. #define GET_WHQL_YEAR( dwWHQLLevel ) 
  857.     ( (dwWHQLLevel) / 0x10000 )
  858. #define GET_WHQL_MONTH( dwWHQLLevel ) 
  859.     ( ( (dwWHQLLevel) / 0x100 ) & 0x00ff )
  860. #define GET_WHQL_DAY( dwWHQLLevel ) 
  861.     ( (dwWHQLLevel) & 0xff )
  862. /*
  863.  * callbacks
  864.  */
  865. typedef DWORD   (FAR PASCAL *LPCLIPPERCALLBACK)(LPDIRECTDRAWCLIPPER lpDDClipper, HWND hWnd, DWORD code, LPVOID lpContext );
  866. #ifdef STREAMING
  867. typedef DWORD   (FAR PASCAL *LPSURFACESTREAMINGCALLBACK)(DWORD);
  868. #endif
  869. /*
  870.  * INTERACES FOLLOW:
  871.  *      IDirectDraw
  872.  *      IDirectDrawClipper
  873.  *      IDirectDrawPalette
  874.  *      IDirectDrawSurface
  875.  */
  876. /*
  877.  * IDirectDraw
  878.  */
  879. #if defined( _WIN32 ) && !defined( _NO_COM )
  880. #undef INTERFACE
  881. #define INTERFACE IDirectDraw
  882. DECLARE_INTERFACE_( IDirectDraw, IUnknown )
  883. {
  884.     /*** IUnknown methods ***/
  885.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  886.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  887.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  888.     /*** IDirectDraw methods ***/
  889.     STDMETHOD(Compact)(THIS) PURE;
  890.     STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE;
  891.     STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE;
  892.     STDMETHOD(CreateSurface)(THIS_  LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE;
  893.     STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR * ) PURE;
  894.     STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK ) PURE;
  895.     STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC, LPVOID,LPDDENUMSURFACESCALLBACK ) PURE;
  896.     STDMETHOD(FlipToGDISurface)(THIS) PURE;
  897.     STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE;
  898.     STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC) PURE;
  899.     STDMETHOD(GetFourCCCodes)(THIS_  LPDWORD, LPDWORD ) PURE;
  900.     STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE FAR *) PURE;
  901.     STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE;
  902.     STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE;
  903.     STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE;
  904.     STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE;
  905.     STDMETHOD(RestoreDisplayMode)(THIS) PURE;
  906.     STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE;
  907.     STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD) PURE;
  908.     STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE;
  909. };
  910. #if !defined(__cplusplus) || defined(CINTERFACE)
  911. #define IDirectDraw_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
  912. #define IDirectDraw_AddRef(p)                       (p)->lpVtbl->AddRef(p)
  913. #define IDirectDraw_Release(p)                      (p)->lpVtbl->Release(p)
  914. #define IDirectDraw_Compact(p)                      (p)->lpVtbl->Compact(p)
  915. #define IDirectDraw_CreateClipper(p, a, b, c)       (p)->lpVtbl->CreateClipper(p, a, b, c)
  916. #define IDirectDraw_CreatePalette(p, a, b, c, d)    (p)->lpVtbl->CreatePalette(p, a, b, c, d)
  917. #define IDirectDraw_CreateSurface(p, a, b, c)       (p)->lpVtbl->CreateSurface(p, a, b, c)
  918. #define IDirectDraw_DuplicateSurface(p, a, b)       (p)->lpVtbl->DuplicateSurface(p, a, b)
  919. #define IDirectDraw_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d)
  920. #define IDirectDraw_EnumSurfaces(p, a, b, c, d)     (p)->lpVtbl->EnumSurfaces(p, a, b, c, d)
  921. #define IDirectDraw_FlipToGDISurface(p)             (p)->lpVtbl->FlipToGDISurface(p)
  922. #define IDirectDraw_GetCaps(p, a, b)                (p)->lpVtbl->GetCaps(p, a, b)
  923. #define IDirectDraw_GetDisplayMode(p, a)            (p)->lpVtbl->GetDisplayMode(p, a)
  924. #define IDirectDraw_GetFourCCCodes(p, a, b)         (p)->lpVtbl->GetFourCCCodes(p, a, b)
  925. #define IDirectDraw_GetGDISurface(p, a)             (p)->lpVtbl->GetGDISurface(p, a)
  926. #define IDirectDraw_GetMonitorFrequency(p, a)       (p)->lpVtbl->GetMonitorFrequency(p, a)
  927. #define IDirectDraw_GetScanLine(p, a)               (p)->lpVtbl->GetScanLine(p, a)
  928. #define IDirectDraw_GetVerticalBlankStatus(p, a)    (p)->lpVtbl->GetVerticalBlankStatus(p, a)
  929. #define IDirectDraw_Initialize(p, a)                (p)->lpVtbl->Initialize(p, a)
  930. #define IDirectDraw_RestoreDisplayMode(p)           (p)->lpVtbl->RestoreDisplayMode(p)
  931. #define IDirectDraw_SetCooperativeLevel(p, a, b)    (p)->lpVtbl->SetCooperativeLevel(p, a, b)
  932. #define IDirectDraw_SetDisplayMode(p, a, b, c)      (p)->lpVtbl->SetDisplayMode(p, a, b, c)
  933. #define IDirectDraw_WaitForVerticalBlank(p, a, b)   (p)->lpVtbl->WaitForVerticalBlank(p, a, b)
  934. #else
  935. #define IDirectDraw_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
  936. #define IDirectDraw_AddRef(p)                       (p)->AddRef()
  937. #define IDirectDraw_Release(p)                      (p)->Release()
  938. #define IDirectDraw_Compact(p)                      (p)->Compact()
  939. #define IDirectDraw_CreateClipper(p, a, b, c)       (p)->CreateClipper(a, b, c)
  940. #define IDirectDraw_CreatePalette(p, a, b, c, d)    (p)->CreatePalette(a, b, c, d)
  941. #define IDirectDraw_CreateSurface(p, a, b, c)       (p)->CreateSurface(a, b, c)
  942. #define IDirectDraw_DuplicateSurface(p, a, b)       (p)->DuplicateSurface(a, b)
  943. #define IDirectDraw_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d)
  944. #define IDirectDraw_EnumSurfaces(p, a, b, c, d)     (p)->EnumSurfaces(a, b, c, d)
  945. #define IDirectDraw_FlipToGDISurface(p)             (p)->FlipToGDISurface()
  946. #define IDirectDraw_GetCaps(p, a, b)                (p)->GetCaps(a, b)
  947. #define IDirectDraw_GetDisplayMode(p, a)            (p)->GetDisplayMode(a)
  948. #define IDirectDraw_GetFourCCCodes(p, a, b)         (p)->GetFourCCCodes(a, b)
  949. #define IDirectDraw_GetGDISurface(p, a)             (p)->GetGDISurface(a)
  950. #define IDirectDraw_GetMonitorFrequency(p, a)       (p)->GetMonitorFrequency(a)
  951. #define IDirectDraw_GetScanLine(p, a)               (p)->GetScanLine(a)
  952. #define IDirectDraw_GetVerticalBlankStatus(p, a)    (p)->GetVerticalBlankStatus(a)
  953. #define IDirectDraw_Initialize(p, a)                (p)->Initialize(a)
  954. #define IDirectDraw_RestoreDisplayMode(p)           (p)->RestoreDisplayMode()
  955. #define IDirectDraw_SetCooperativeLevel(p, a, b)    (p)->SetCooperativeLevel(a, b)
  956. #define IDirectDraw_SetDisplayMode(p, a, b, c)      (p)->SetDisplayMode(a, b, c)
  957. #define IDirectDraw_WaitForVerticalBlank(p, a, b)   (p)->WaitForVerticalBlank(a, b)
  958. #endif
  959. #endif
  960. #if defined( _WIN32 ) && !defined( _NO_COM )
  961. #undef INTERFACE
  962. #define INTERFACE IDirectDraw2
  963. DECLARE_INTERFACE_( IDirectDraw2, IUnknown )
  964. {
  965.     /*** IUnknown methods ***/
  966.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  967.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  968.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  969.     /*** IDirectDraw methods ***/
  970.     STDMETHOD(Compact)(THIS) PURE;
  971.     STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE;
  972.     STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE;
  973.     STDMETHOD(CreateSurface)(THIS_  LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE;
  974.     STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR * ) PURE;
  975.     STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK ) PURE;
  976.     STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC, LPVOID,LPDDENUMSURFACESCALLBACK ) PURE;
  977.     STDMETHOD(FlipToGDISurface)(THIS) PURE;
  978.     STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE;
  979.     STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC) PURE;
  980.     STDMETHOD(GetFourCCCodes)(THIS_  LPDWORD, LPDWORD ) PURE;
  981.     STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE FAR *) PURE;
  982.     STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE;
  983.     STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE;
  984.     STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE;
  985.     STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE;
  986.     STDMETHOD(RestoreDisplayMode)(THIS) PURE;
  987.     STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE;
  988.     STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE;
  989.     STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE;
  990.     /*** Added in the v2 interface ***/
  991.     STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS, LPDWORD, LPDWORD) PURE;
  992. };
  993. #if !defined(__cplusplus) || defined(CINTERFACE)
  994. #define IDirectDraw2_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
  995. #define IDirectDraw2_AddRef(p)                       (p)->lpVtbl->AddRef(p)
  996. #define IDirectDraw2_Release(p)                      (p)->lpVtbl->Release(p)
  997. #define IDirectDraw2_Compact(p)                      (p)->lpVtbl->Compact(p)
  998. #define IDirectDraw2_CreateClipper(p, a, b, c)       (p)->lpVtbl->CreateClipper(p, a, b, c)
  999. #define IDirectDraw2_CreatePalette(p, a, b, c, d)    (p)->lpVtbl->CreatePalette(p, a, b, c, d)
  1000. #define IDirectDraw2_CreateSurface(p, a, b, c)       (p)->lpVtbl->CreateSurface(p, a, b, c)
  1001. #define IDirectDraw2_DuplicateSurface(p, a, b)       (p)->lpVtbl->DuplicateSurface(p, a, b)
  1002. #define IDirectDraw2_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d)
  1003. #define IDirectDraw2_EnumSurfaces(p, a, b, c, d)     (p)->lpVtbl->EnumSurfaces(p, a, b, c, d)
  1004. #define IDirectDraw2_FlipToGDISurface(p)             (p)->lpVtbl->FlipToGDISurface(p)
  1005. #define IDirectDraw2_GetCaps(p, a, b)                (p)->lpVtbl->GetCaps(p, a, b)
  1006. #define IDirectDraw2_GetDisplayMode(p, a)            (p)->lpVtbl->GetDisplayMode(p, a)
  1007. #define IDirectDraw2_GetFourCCCodes(p, a, b)         (p)->lpVtbl->GetFourCCCodes(p, a, b)
  1008. #define IDirectDraw2_GetGDISurface(p, a)             (p)->lpVtbl->GetGDISurface(p, a)
  1009. #define IDirectDraw2_GetMonitorFrequency(p, a)       (p)->lpVtbl->GetMonitorFrequency(p, a)
  1010. #define IDirectDraw2_GetScanLine(p, a)               (p)->lpVtbl->GetScanLine(p, a)
  1011. #define IDirectDraw2_GetVerticalBlankStatus(p, a)    (p)->lpVtbl->GetVerticalBlankStatus(p, a)
  1012. #define IDirectDraw2_Initialize(p, a)                (p)->lpVtbl->Initialize(p, a)
  1013. #define IDirectDraw2_RestoreDisplayMode(p)           (p)->lpVtbl->RestoreDisplayMode(p)
  1014. #define IDirectDraw2_SetCooperativeLevel(p, a, b)    (p)->lpVtbl->SetCooperativeLevel(p, a, b)
  1015. #define IDirectDraw2_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e)
  1016. #define IDirectDraw2_WaitForVerticalBlank(p, a, b)   (p)->lpVtbl->WaitForVerticalBlank(p, a, b)
  1017. #define IDirectDraw2_GetAvailableVidMem(p, a, b, c)  (p)->lpVtbl->GetAvailableVidMem(p, a, b, c)
  1018. #else
  1019. #define IDirectDraw2_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
  1020. #define IDirectDraw2_AddRef(p)                       (p)->AddRef()
  1021. #define IDirectDraw2_Release(p)                      (p)->Release()
  1022. #define IDirectDraw2_Compact(p)                      (p)->Compact()
  1023. #define IDirectDraw2_CreateClipper(p, a, b, c)       (p)->CreateClipper(a, b, c)
  1024. #define IDirectDraw2_CreatePalette(p, a, b, c, d)    (p)->CreatePalette(a, b, c, d)
  1025. #define IDirectDraw2_CreateSurface(p, a, b, c)       (p)->CreateSurface(a, b, c)
  1026. #define IDirectDraw2_DuplicateSurface(p, a, b)       (p)->DuplicateSurface(a, b)
  1027. #define IDirectDraw2_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d)
  1028. #define IDirectDraw2_EnumSurfaces(p, a, b, c, d)     (p)->EnumSurfaces(a, b, c, d)
  1029. #define IDirectDraw2_FlipToGDISurface(p)             (p)->FlipToGDISurface()
  1030. #define IDirectDraw2_GetCaps(p, a, b)                (p)->GetCaps(a, b)
  1031. #define IDirectDraw2_GetDisplayMode(p, a)            (p)->GetDisplayMode(a)
  1032. #define IDirectDraw2_GetFourCCCodes(p, a, b)         (p)->GetFourCCCodes(a, b)
  1033. #define IDirectDraw2_GetGDISurface(p, a)             (p)->GetGDISurface(a)
  1034. #define IDirectDraw2_GetMonitorFrequency(p, a)       (p)->GetMonitorFrequency(a)
  1035. #define IDirectDraw2_GetScanLine(p, a)               (p)->GetScanLine(a)
  1036. #define IDirectDraw2_GetVerticalBlankStatus(p, a)    (p)->GetVerticalBlankStatus(a)
  1037. #define IDirectDraw2_Initialize(p, a)                (p)->Initialize(a)
  1038. #define IDirectDraw2_RestoreDisplayMode(p)           (p)->RestoreDisplayMode()
  1039. #define IDirectDraw2_SetCooperativeLevel(p, a, b)    (p)->SetCooperativeLevel(a, b)
  1040. #define IDirectDraw2_SetDisplayMode(p, a, b, c, d, e) (p)->SetDisplayMode(a, b, c, d, e)
  1041. #define IDirectDraw2_WaitForVerticalBlank(p, a, b)   (p)->WaitForVerticalBlank(a, b)
  1042. #define IDirectDraw2_GetAvailableVidMem(p, a, b, c)  (p)->GetAvailableVidMem(a, b, c)
  1043. #endif
  1044. #endif
  1045. #if defined( _WIN32 ) && !defined( _NO_COM )
  1046. #undef INTERFACE
  1047. #define INTERFACE IDirectDraw4
  1048. DECLARE_INTERFACE_( IDirectDraw4, IUnknown )
  1049. {
  1050.     /*** IUnknown methods ***/
  1051.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  1052.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1053.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1054.     /*** IDirectDraw methods ***/
  1055.     STDMETHOD(Compact)(THIS) PURE;
  1056.     STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE;
  1057.     STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE;
  1058.     STDMETHOD(CreateSurface)(THIS_  LPDDSURFACEDESC2, LPDIRECTDRAWSURFACE4 FAR *, IUnknown FAR *) PURE;
  1059.     STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE4, LPDIRECTDRAWSURFACE4 FAR * ) PURE;
  1060.     STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC2, LPVOID, LPDDENUMMODESCALLBACK2 ) PURE;
  1061.     STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC2, LPVOID,LPDDENUMSURFACESCALLBACK2 ) PURE;
  1062.     STDMETHOD(FlipToGDISurface)(THIS) PURE;
  1063.     STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE;
  1064.     STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC2) PURE;
  1065.     STDMETHOD(GetFourCCCodes)(THIS_  LPDWORD, LPDWORD ) PURE;
  1066.     STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE4 FAR *) PURE;
  1067.     STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE;
  1068.     STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE;
  1069.     STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE;
  1070.     STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE;
  1071.     STDMETHOD(RestoreDisplayMode)(THIS) PURE;
  1072.     STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE;
  1073.     STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE;
  1074.     STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE;
  1075.     /*** Added in the v2 interface ***/
  1076.     STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2, LPDWORD, LPDWORD) PURE;
  1077.     /*** Added in the V4 Interface ***/
  1078.     STDMETHOD(GetSurfaceFromDC) (THIS_ HDC, LPDIRECTDRAWSURFACE4 *) PURE;
  1079.     STDMETHOD(RestoreAllSurfaces)(THIS) PURE;
  1080.     STDMETHOD(TestCooperativeLevel)(THIS) PURE;
  1081.     STDMETHOD(GetDeviceIdentifier)(THIS_ LPDDDEVICEIDENTIFIER, DWORD ) PURE;
  1082. };
  1083. #if !defined(__cplusplus) || defined(CINTERFACE)
  1084. #define IDirectDraw4_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
  1085. #define IDirectDraw4_AddRef(p)                       (p)->lpVtbl->AddRef(p)
  1086. #define IDirectDraw4_Release(p)                      (p)->lpVtbl->Release(p)
  1087. #define IDirectDraw4_Compact(p)                      (p)->lpVtbl->Compact(p)
  1088. #define IDirectDraw4_CreateClipper(p, a, b, c)       (p)->lpVtbl->CreateClipper(p, a, b, c)
  1089. #define IDirectDraw4_CreatePalette(p, a, b, c, d)    (p)->lpVtbl->CreatePalette(p, a, b, c, d)
  1090. #define IDirectDraw4_CreateSurface(p, a, b, c)       (p)->lpVtbl->CreateSurface(p, a, b, c)
  1091. #define IDirectDraw4_DuplicateSurface(p, a, b)       (p)->lpVtbl->DuplicateSurface(p, a, b)
  1092. #define IDirectDraw4_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d)
  1093. #define IDirectDraw4_EnumSurfaces(p, a, b, c, d)     (p)->lpVtbl->EnumSurfaces(p, a, b, c, d)
  1094. #define IDirectDraw4_FlipToGDISurface(p)             (p)->lpVtbl->FlipToGDISurface(p)
  1095. #define IDirectDraw4_GetCaps(p, a, b)                (p)->lpVtbl->GetCaps(p, a, b)
  1096. #define IDirectDraw4_GetDisplayMode(p, a)            (p)->lpVtbl->GetDisplayMode(p, a)
  1097. #define IDirectDraw4_GetFourCCCodes(p, a, b)         (p)->lpVtbl->GetFourCCCodes(p, a, b)
  1098. #define IDirectDraw4_GetGDISurface(p, a)             (p)->lpVtbl->GetGDISurface(p, a)
  1099. #define IDirectDraw4_GetMonitorFrequency(p, a)       (p)->lpVtbl->GetMonitorFrequency(p, a)
  1100. #define IDirectDraw4_GetScanLine(p, a)               (p)->lpVtbl->GetScanLine(p, a)
  1101. #define IDirectDraw4_GetVerticalBlankStatus(p, a)    (p)->lpVtbl->GetVerticalBlankStatus(p, a)
  1102. #define IDirectDraw4_Initialize(p, a)                (p)->lpVtbl->Initialize(p, a)
  1103. #define IDirectDraw4_RestoreDisplayMode(p)           (p)->lpVtbl->RestoreDisplayMode(p)
  1104. #define IDirectDraw4_SetCooperativeLevel(p, a, b)    (p)->lpVtbl->SetCooperativeLevel(p, a, b)
  1105. #define IDirectDraw4_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e)
  1106. #define IDirectDraw4_WaitForVerticalBlank(p, a, b)   (p)->lpVtbl->WaitForVerticalBlank(p, a, b)
  1107. #define IDirectDraw4_GetAvailableVidMem(p, a, b, c)  (p)->lpVtbl->GetAvailableVidMem(p, a, b, c)
  1108. #define IDirectDraw4_GetSurfaceFromDC(p, a, b)       (p)->lpVtbl->GetSurfaceFromDC(p, a, b)
  1109. #define IDirectDraw4_RestoreAllSurfaces(p)           (p)->lpVtbl->RestoreAllSurfaces(p)
  1110. #define IDirectDraw4_TestCooperativeLevel(p)         (p)->lpVtbl->TestCooperativeLevel(p)
  1111. #define IDirectDraw4_GetDeviceIdentifier(p,a,b)      (p)->lpVtbl->GetDeviceIdentifier(p,a,b)
  1112. #else
  1113. #define IDirectDraw4_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
  1114. #define IDirectDraw4_AddRef(p)                       (p)->AddRef()
  1115. #define IDirectDraw4_Release(p)                      (p)->Release()
  1116. #define IDirectDraw4_Compact(p)                      (p)->Compact()
  1117. #define IDirectDraw4_CreateClipper(p, a, b, c)       (p)->CreateClipper(a, b, c)
  1118. #define IDirectDraw4_CreatePalette(p, a, b, c, d)    (p)->CreatePalette(a, b, c, d)
  1119. #define IDirectDraw4_CreateSurface(p, a, b, c)       (p)->CreateSurface(a, b, c)
  1120. #define IDirectDraw4_DuplicateSurface(p, a, b)       (p)->DuplicateSurface(a, b)
  1121. #define IDirectDraw4_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d)
  1122. #define IDirectDraw4_EnumSurfaces(p, a, b, c, d)     (p)->EnumSurfaces(a, b, c, d)
  1123. #define IDirectDraw4_FlipToGDISurface(p)             (p)->FlipToGDISurface()
  1124. #define IDirectDraw4_GetCaps(p, a, b)                (p)->GetCaps(a, b)
  1125. #define IDirectDraw4_GetDisplayMode(p, a)            (p)->GetDisplayMode(a)
  1126. #define IDirectDraw4_GetFourCCCodes(p, a, b)         (p)->GetFourCCCodes(a, b)
  1127. #define IDirectDraw4_GetGDISurface(p, a)             (p)->GetGDISurface(a)
  1128. #define IDirectDraw4_GetMonitorFrequency(p, a)       (p)->GetMonitorFrequency(a)
  1129. #define IDirectDraw4_GetScanLine(p, a)               (p)->GetScanLine(a)
  1130. #define IDirectDraw4_GetVerticalBlankStatus(p, a)    (p)->GetVerticalBlankStatus(a)
  1131. #define IDirectDraw4_Initialize(p, a)                (p)->Initialize(a)
  1132. #define IDirectDraw4_RestoreDisplayMode(p)           (p)->RestoreDisplayMode()
  1133. #define IDirectDraw4_SetCooperativeLevel(p, a, b)    (p)->SetCooperativeLevel(a, b)
  1134. #define IDirectDraw4_SetDisplayMode(p, a, b, c, d, e) (p)->SetDisplayMode(a, b, c, d, e)
  1135. #define IDirectDraw4_WaitForVerticalBlank(p, a, b)   (p)->WaitForVerticalBlank(a, b)
  1136. #define IDirectDraw4_GetAvailableVidMem(p, a, b, c)  (p)->GetAvailableVidMem(a, b, c)
  1137. #define IDirectDraw4_GetSurfaceFromDC(p, a, b)       (p)->GetSurfaceFromDC(a, b)
  1138. #define IDirectDraw4_RestoreAllSurfaces(p)           (p)->RestoreAllSurfaces()
  1139. #define IDirectDraw4_TestCooperativeLevel(p)         (p)->TestCooperativeLevel()
  1140. #define IDirectDraw4_GetDeviceIdentifier(p,a,b)      (p)->GetDeviceIdentifier(a,b)
  1141. #endif
  1142. #endif
  1143. #if defined( _WIN32 ) && !defined( _NO_COM )
  1144. #undef INTERFACE
  1145. #define INTERFACE IDirectDraw7
  1146. DECLARE_INTERFACE_( IDirectDraw7, IUnknown )
  1147. {
  1148.     /*** IUnknown methods ***/
  1149.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  1150.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1151.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1152.     /*** IDirectDraw methods ***/
  1153.     STDMETHOD(Compact)(THIS) PURE;
  1154.     STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE;
  1155.     STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE;
  1156.     STDMETHOD(CreateSurface)(THIS_  LPDDSURFACEDESC2, LPDIRECTDRAWSURFACE7 FAR *, IUnknown FAR *) PURE;
  1157.     STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE7, LPDIRECTDRAWSURFACE7 FAR * ) PURE;
  1158.     STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC2, LPVOID, LPDDENUMMODESCALLBACK2 ) PURE;
  1159.     STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC2, LPVOID,LPDDENUMSURFACESCALLBACK7 ) PURE;
  1160.     STDMETHOD(FlipToGDISurface)(THIS) PURE;
  1161.     STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE;
  1162.     STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC2) PURE;
  1163.     STDMETHOD(GetFourCCCodes)(THIS_  LPDWORD, LPDWORD ) PURE;
  1164.     STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE7 FAR *) PURE;
  1165.     STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE;
  1166.     STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE;
  1167.     STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE;
  1168.     STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE;
  1169.     STDMETHOD(RestoreDisplayMode)(THIS) PURE;
  1170.     STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE;
  1171.     STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE;
  1172.     STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE;
  1173.     /*** Added in the v2 interface ***/
  1174.     STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2, LPDWORD, LPDWORD) PURE;
  1175.     /*** Added in the V4 Interface ***/
  1176.     STDMETHOD(GetSurfaceFromDC) (THIS_ HDC, LPDIRECTDRAWSURFACE7 *) PURE;
  1177.     STDMETHOD(RestoreAllSurfaces)(THIS) PURE;
  1178.     STDMETHOD(TestCooperativeLevel)(THIS) PURE;
  1179.     STDMETHOD(GetDeviceIdentifier)(THIS_ LPDDDEVICEIDENTIFIER2, DWORD ) PURE;
  1180.     STDMETHOD(StartModeTest)(THIS_ LPSIZE, DWORD, DWORD ) PURE;
  1181.     STDMETHOD(EvaluateMode)(THIS_ DWORD, DWORD * ) PURE;
  1182. };
  1183. #if !defined(__cplusplus) || defined(CINTERFACE)
  1184. #define IDirectDraw7_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
  1185. #define IDirectDraw7_AddRef(p)                       (p)->lpVtbl->AddRef(p)
  1186. #define IDirectDraw7_Release(p)                      (p)->lpVtbl->Release(p)
  1187. #define IDirectDraw7_Compact(p)                      (p)->lpVtbl->Compact(p)
  1188. #define IDirectDraw7_CreateClipper(p, a, b, c)       (p)->lpVtbl->CreateClipper(p, a, b, c)
  1189. #define IDirectDraw7_CreatePalette(p, a, b, c, d)    (p)->lpVtbl->CreatePalette(p, a, b, c, d)
  1190. #define IDirectDraw7_CreateSurface(p, a, b, c)       (p)->lpVtbl->CreateSurface(p, a, b, c)
  1191. #define IDirectDraw7_DuplicateSurface(p, a, b)       (p)->lpVtbl->DuplicateSurface(p, a, b)
  1192. #define IDirectDraw7_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d)
  1193. #define IDirectDraw7_EnumSurfaces(p, a, b, c, d)     (p)->lpVtbl->EnumSurfaces(p, a, b, c, d)
  1194. #define IDirectDraw7_FlipToGDISurface(p)             (p)->lpVtbl->FlipToGDISurface(p)
  1195. #define IDirectDraw7_GetCaps(p, a, b)                (p)->lpVtbl->GetCaps(p, a, b)
  1196. #define IDirectDraw7_GetDisplayMode(p, a)            (p)->lpVtbl->GetDisplayMode(p, a)
  1197. #define IDirectDraw7_GetFourCCCodes(p, a, b)         (p)->lpVtbl->GetFourCCCodes(p, a, b)
  1198. #define IDirectDraw7_GetGDISurface(p, a)             (p)->lpVtbl->GetGDISurface(p, a)
  1199. #define IDirectDraw7_GetMonitorFrequency(p, a)       (p)->lpVtbl->GetMonitorFrequency(p, a)
  1200. #define IDirectDraw7_GetScanLine(p, a)               (p)->lpVtbl->GetScanLine(p, a)
  1201. #define IDirectDraw7_GetVerticalBlankStatus(p, a)    (p)->lpVtbl->GetVerticalBlankStatus(p, a)
  1202. #define IDirectDraw7_Initialize(p, a)                (p)->lpVtbl->Initialize(p, a)
  1203. #define IDirectDraw7_RestoreDisplayMode(p)           (p)->lpVtbl->RestoreDisplayMode(p)
  1204. #define IDirectDraw7_SetCooperativeLevel(p, a, b)    (p)->lpVtbl->SetCooperativeLevel(p, a, b)
  1205. #define IDirectDraw7_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e)
  1206. #define IDirectDraw7_WaitForVerticalBlank(p, a, b)   (p)->lpVtbl->WaitForVerticalBlank(p, a, b)
  1207. #define IDirectDraw7_GetAvailableVidMem(p, a, b, c)  (p)->lpVtbl->GetAvailableVidMem(p, a, b, c)
  1208. #define IDirectDraw7_GetSurfaceFromDC(p, a, b)       (p)->lpVtbl->GetSurfaceFromDC(p, a, b)
  1209. #define IDirectDraw7_RestoreAllSurfaces(p)           (p)->lpVtbl->RestoreAllSurfaces(p)
  1210. #define IDirectDraw7_TestCooperativeLevel(p)         (p)->lpVtbl->TestCooperativeLevel(p)
  1211. #define IDirectDraw7_GetDeviceIdentifier(p,a,b)      (p)->lpVtbl->GetDeviceIdentifier(p,a,b)
  1212. #define IDirectDraw7_StartModeTest(p,a,b,c)        (p)->lpVtbl->StartModeTest(p,a,b,c)
  1213. #define IDirectDraw7_EvaluateMode(p,a,b)           (p)->lpVtbl->EvaluateMode(p,a,b)
  1214. #else
  1215. #define IDirectDraw7_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
  1216. #define IDirectDraw7_AddRef(p)                       (p)->AddRef()
  1217. #define IDirectDraw7_Release(p)                      (p)->Release()
  1218. #define IDirectDraw7_Compact(p)                      (p)->Compact()
  1219. #define IDirectDraw7_CreateClipper(p, a, b, c)       (p)->CreateClipper(a, b, c)
  1220. #define IDirectDraw7_CreatePalette(p, a, b, c, d)    (p)->CreatePalette(a, b, c, d)
  1221. #define IDirectDraw7_CreateSurface(p, a, b, c)       (p)->CreateSurface(a, b, c)
  1222. #define IDirectDraw7_DuplicateSurface(p, a, b)       (p)->DuplicateSurface(a, b)
  1223. #define IDirectDraw7_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d)
  1224. #define IDirectDraw7_EnumSurfaces(p, a, b, c, d)     (p)->EnumSurfaces(a, b, c, d)
  1225. #define IDirectDraw7_FlipToGDISurface(p)             (p)->FlipToGDISurface()
  1226. #define IDirectDraw7_GetCaps(p, a, b)                (p)->GetCaps(a, b)
  1227. #define IDirectDraw7_GetDisplayMode(p, a)            (p)->GetDisplayMode(a)
  1228. #define IDirectDraw7_GetFourCCCodes(p, a, b)         (p)->GetFourCCCodes(a, b)
  1229. #define IDirectDraw7_GetGDISurface(p, a)             (p)->GetGDISurface(a)
  1230. #define IDirectDraw7_GetMonitorFrequency(p, a)       (p)->GetMonitorFrequency(a)
  1231. #define IDirectDraw7_GetScanLine(p, a)               (p)->GetScanLine(a)
  1232. #define IDirectDraw7_GetVerticalBlankStatus(p, a)    (p)->GetVerticalBlankStatus(a)
  1233. #define IDirectDraw7_Initialize(p, a)                (p)->Initialize(a)
  1234. #define IDirectDraw7_RestoreDisplayMode(p)           (p)->RestoreDisplayMode()
  1235. #define IDirectDraw7_SetCooperativeLevel(p, a, b)    (p)->SetCooperativeLevel(a, b)
  1236. #define IDirectDraw7_SetDisplayMode(p, a, b, c, d, e) (p)->SetDisplayMode(a, b, c, d, e)
  1237. #define IDirectDraw7_WaitForVerticalBlank(p, a, b)   (p)->WaitForVerticalBlank(a, b)
  1238. #define IDirectDraw7_GetAvailableVidMem(p, a, b, c)  (p)->GetAvailableVidMem(a, b, c)
  1239. #define IDirectDraw7_GetSurfaceFromDC(p, a, b)       (p)->GetSurfaceFromDC(a, b)
  1240. #define IDirectDraw7_RestoreAllSurfaces(p)           (p)->RestoreAllSurfaces()
  1241. #define IDirectDraw7_TestCooperativeLevel(p)         (p)->TestCooperativeLevel()
  1242. #define IDirectDraw7_GetDeviceIdentifier(p,a,b)      (p)->GetDeviceIdentifier(a,b)
  1243. #define IDirectDraw7_StartModeTest(p,a,b,c)        (p)->lpVtbl->StartModeTest(a,b,c)
  1244. #define IDirectDraw7_EvaluateMode(p,a,b)           (p)->lpVtbl->EvaluateMode(a,b)
  1245. #endif
  1246. #endif
  1247. /*
  1248.  * IDirectDrawPalette
  1249.  */
  1250. #if defined( _WIN32 ) && !defined( _NO_COM )
  1251. #undef INTERFACE
  1252. #define INTERFACE IDirectDrawPalette
  1253. DECLARE_INTERFACE_( IDirectDrawPalette, IUnknown )
  1254. {
  1255.     /*** IUnknown methods ***/
  1256.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  1257.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1258.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1259.     /*** IDirectDrawPalette methods ***/
  1260.     STDMETHOD(GetCaps)(THIS_ LPDWORD) PURE;
  1261.     STDMETHOD(GetEntries)(THIS_ DWORD,DWORD,DWORD,LPPALETTEENTRY) PURE;
  1262.     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, DWORD, LPPALETTEENTRY) PURE;
  1263.     STDMETHOD(SetEntries)(THIS_ DWORD,DWORD,DWORD,LPPALETTEENTRY) PURE;
  1264. };
  1265. #if !defined(__cplusplus) || defined(CINTERFACE)
  1266. #define IDirectDrawPalette_QueryInterface(p, a, b)      (p)->lpVtbl->QueryInterface(p, a, b)
  1267. #define IDirectDrawPalette_AddRef(p)                    (p)->lpVtbl->AddRef(p)
  1268. #define IDirectDrawPalette_Release(p)                   (p)->lpVtbl->Release(p)
  1269. #define IDirectDrawPalette_GetCaps(p, a)                (p)->lpVtbl->GetCaps(p, a)
  1270. #define IDirectDrawPalette_GetEntries(p, a, b, c, d)    (p)->lpVtbl->GetEntries(p, a, b, c, d)
  1271. #define IDirectDrawPalette_Initialize(p, a, b, c)       (p)->lpVtbl->Initialize(p, a, b, c)
  1272. #define IDirectDrawPalette_SetEntries(p, a, b, c, d)    (p)->lpVtbl->SetEntries(p, a, b, c, d)
  1273. #else
  1274. #define IDirectDrawPalette_QueryInterface(p, a, b)      (p)->QueryInterface(a, b)
  1275. #define IDirectDrawPalette_AddRef(p)                    (p)->AddRef()
  1276. #define IDirectDrawPalette_Release(p)                   (p)->Release()
  1277. #define IDirectDrawPalette_GetCaps(p, a)                (p)->GetCaps(a)
  1278. #define IDirectDrawPalette_GetEntries(p, a, b, c, d)    (p)->GetEntries(a, b, c, d)
  1279. #define IDirectDrawPalette_Initialize(p, a, b, c)       (p)->Initialize(a, b, c)
  1280. #define IDirectDrawPalette_SetEntries(p, a, b, c, d)    (p)->SetEntries(a, b, c, d)
  1281. #endif
  1282. #endif
  1283. /*
  1284.  * IDirectDrawClipper
  1285.  */
  1286. #if defined( _WIN32 ) && !defined( _NO_COM )
  1287. #undef INTERFACE
  1288. #define INTERFACE IDirectDrawClipper
  1289. DECLARE_INTERFACE_( IDirectDrawClipper, IUnknown )
  1290. {
  1291.     /*** IUnknown methods ***/
  1292.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  1293.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1294.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1295.     /*** IDirectDrawClipper methods ***/
  1296.     STDMETHOD(GetClipList)(THIS_ LPRECT, LPRGNDATA, LPDWORD) PURE;
  1297.     STDMETHOD(GetHWnd)(THIS_ HWND FAR *) PURE;
  1298.     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, DWORD) PURE;
  1299.     STDMETHOD(IsClipListChanged)(THIS_ BOOL FAR *) PURE;
  1300.     STDMETHOD(SetClipList)(THIS_ LPRGNDATA,DWORD) PURE;
  1301.     STDMETHOD(SetHWnd)(THIS_ DWORD, HWND ) PURE;
  1302. };
  1303. #if !defined(__cplusplus) || defined(CINTERFACE)
  1304. #define IDirectDrawClipper_QueryInterface(p, a, b)  (p)->lpVtbl->QueryInterface(p, a, b)
  1305. #define IDirectDrawClipper_AddRef(p)                (p)->lpVtbl->AddRef(p)
  1306. #define IDirectDrawClipper_Release(p)               (p)->lpVtbl->Release(p)
  1307. #define IDirectDrawClipper_GetClipList(p, a, b, c)  (p)->lpVtbl->GetClipList(p, a, b, c)
  1308. #define IDirectDrawClipper_GetHWnd(p, a)            (p)->lpVtbl->GetHWnd(p, a)
  1309. #define IDirectDrawClipper_Initialize(p, a, b)      (p)->lpVtbl->Initialize(p, a, b)
  1310. #define IDirectDrawClipper_IsClipListChanged(p, a)  (p)->lpVtbl->IsClipListChanged(p, a)
  1311. #define IDirectDrawClipper_SetClipList(p, a, b)     (p)->lpVtbl->SetClipList(p, a, b)
  1312. #define IDirectDrawClipper_SetHWnd(p, a, b)         (p)->lpVtbl->SetHWnd(p, a, b)
  1313. #else
  1314. #define IDirectDrawClipper_QueryInterface(p, a, b)  (p)->QueryInterface(a, b)
  1315. #define IDirectDrawClipper_AddRef(p)                (p)->AddRef()
  1316. #define IDirectDrawClipper_Release(p)               (p)->Release()
  1317. #define IDirectDrawClipper_GetClipList(p, a, b, c)  (p)->GetClipList(a, b, c)
  1318. #define IDirectDrawClipper_GetHWnd(p, a)            (p)->GetHWnd(a)
  1319. #define IDirectDrawClipper_Initialize(p, a, b)      (p)->Initialize(a, b)
  1320. #define IDirectDrawClipper_IsClipListChanged(p, a)  (p)->IsClipListChanged(a)
  1321. #define IDirectDrawClipper_SetClipList(p, a, b)     (p)->SetClipList(a, b)
  1322. #define IDirectDrawClipper_SetHWnd(p, a, b)         (p)->SetHWnd(a, b)
  1323. #endif
  1324. #endif
  1325. /*
  1326.  * IDirectDrawSurface and related interfaces
  1327.  */
  1328. #if defined( _WIN32 ) && !defined( _NO_COM )
  1329. #undef INTERFACE
  1330. #define INTERFACE IDirectDrawSurface
  1331. DECLARE_INTERFACE_( IDirectDrawSurface, IUnknown )
  1332. {
  1333.     /*** IUnknown methods ***/
  1334.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  1335.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1336.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1337.     /*** IDirectDrawSurface methods ***/
  1338.     STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE) PURE;
  1339.     STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE;
  1340.     STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE, LPRECT,DWORD, LPDDBLTFX) PURE;
  1341.     STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE;
  1342.     STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE, LPRECT,DWORD) PURE;
  1343.     STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE) PURE;
  1344.     STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
  1345.     STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
  1346.     STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE;
  1347.     STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE FAR *) PURE;
  1348.     STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE;
  1349.     STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE;
  1350.     STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE;
  1351.     STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
  1352.     STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE;
  1353.     STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE;
  1354.     STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE;
  1355.     STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE;
  1356.     STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE;
  1357.     STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE;
  1358.     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE;
  1359.     STDMETHOD(IsLost)(THIS) PURE;
  1360.     STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE;
  1361.     STDMETHOD(ReleaseDC)(THIS_ HDC) PURE;
  1362.     STDMETHOD(Restore)(THIS) PURE;
  1363.     STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE;
  1364.     STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
  1365.     STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE;
  1366.     STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE;
  1367.     STDMETHOD(Unlock)(THIS_ LPVOID) PURE;
  1368.     STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE,LPRECT,DWORD, LPDDOVERLAYFX) PURE;
  1369.     STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE;
  1370.     STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE) PURE;
  1371. };
  1372. #if !defined(__cplusplus) || defined(CINTERFACE)
  1373. #define IDirectDrawSurface_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
  1374. #define IDirectDrawSurface_AddRef(p)                    (p)->lpVtbl->AddRef(p)
  1375. #define IDirectDrawSurface_Release(p)                   (p)->lpVtbl->Release(p)
  1376. #define IDirectDrawSurface_AddAttachedSurface(p,a)      (p)->lpVtbl->AddAttachedSurface(p,a)
  1377. #define IDirectDrawSurface_AddOverlayDirtyRect(p,a)     (p)->lpVtbl->AddOverlayDirtyRect(p,a)
  1378. #define IDirectDrawSurface_Blt(p,a,b,c,d,e)             (p)->lpVtbl->Blt(p,a,b,c,d,e)
  1379. #define IDirectDrawSurface_BltBatch(p,a,b,c)            (p)->lpVtbl->BltBatch(p,a,b,c)
  1380. #define IDirectDrawSurface_BltFast(p,a,b,c,d,e)         (p)->lpVtbl->BltFast(p,a,b,c,d,e)
  1381. #define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b)
  1382. #define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b)  (p)->lpVtbl->EnumAttachedSurfaces(p,a,b)
  1383. #define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c)  (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c)
  1384. #define IDirectDrawSurface_Flip(p,a,b)                  (p)->lpVtbl->Flip(p,a,b)
  1385. #define IDirectDrawSurface_GetAttachedSurface(p,a,b)    (p)->lpVtbl->GetAttachedSurface(p,a,b)
  1386. #define IDirectDrawSurface_GetBltStatus(p,a)            (p)->lpVtbl->GetBltStatus(p,a)
  1387. #define IDirectDrawSurface_GetCaps(p,b)                 (p)->lpVtbl->GetCaps(p,b)
  1388. #define IDirectDrawSurface_GetClipper(p,a)              (p)->lpVtbl->GetClipper(p,a)
  1389. #define IDirectDrawSurface_GetColorKey(p,a,b)           (p)->lpVtbl->GetColorKey(p,a,b)
  1390. #define IDirectDrawSurface_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
  1391. #define IDirectDrawSurface_GetFlipStatus(p,a)           (p)->lpVtbl->GetFlipStatus(p,a)
  1392. #define IDirectDrawSurface_GetOverlayPosition(p,a,b)    (p)->lpVtbl->GetOverlayPosition(p,a,b)
  1393. #define IDirectDrawSurface_GetPalette(p,a)              (p)->lpVtbl->GetPalette(p,a)
  1394. #define IDirectDrawSurface_GetPixelFormat(p,a)          (p)->lpVtbl->GetPixelFormat(p,a)
  1395. #define IDirectDrawSurface_GetSurfaceDesc(p,a)          (p)->lpVtbl->GetSurfaceDesc(p,a)
  1396. #define IDirectDrawSurface_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
  1397. #define IDirectDrawSurface_IsLost(p)                    (p)->lpVtbl->IsLost(p)
  1398. #define IDirectDrawSurface_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
  1399. #define IDirectDrawSurface_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
  1400. #define IDirectDrawSurface_Restore(p)                   (p)->lpVtbl->Restore(p)
  1401. #define IDirectDrawSurface_SetClipper(p,a)              (p)->lpVtbl->SetClipper(p,a)
  1402. #define IDirectDrawSurface_SetColorKey(p,a,b)           (p)->lpVtbl->SetColorKey(p,a,b)
  1403. #define IDirectDrawSurface_SetOverlayPosition(p,a,b)    (p)->lpVtbl->SetOverlayPosition(p,a,b)
  1404. #define IDirectDrawSurface_SetPalette(p,a)              (p)->lpVtbl->SetPalette(p,a)
  1405. #define IDirectDrawSurface_Unlock(p,b)                  (p)->lpVtbl->Unlock(p,b)
  1406. #define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e)   (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e)
  1407. #define IDirectDrawSurface_UpdateOverlayDisplay(p,a)    (p)->lpVtbl->UpdateOverlayDisplay(p,a)
  1408. #define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b)   (p)->lpVtbl->UpdateOverlayZOrder(p,a,b)
  1409. #else
  1410. #define IDirectDrawSurface_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
  1411. #define IDirectDrawSurface_AddRef(p)                    (p)->AddRef()
  1412. #define IDirectDrawSurface_Release(p)                   (p)->Release()
  1413. #define IDirectDrawSurface_AddAttachedSurface(p,a)      (p)->AddAttachedSurface(a)
  1414. #define IDirectDrawSurface_AddOverlayDirtyRect(p,a)     (p)->AddOverlayDirtyRect(a)
  1415. #define IDirectDrawSurface_Blt(p,a,b,c,d,e)             (p)->Blt(a,b,c,d,e)
  1416. #define IDirectDrawSurface_BltBatch(p,a,b,c)            (p)->BltBatch(a,b,c)
  1417. #define IDirectDrawSurface_BltFast(p,a,b,c,d,e)         (p)->BltFast(a,b,c,d,e)
  1418. #define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b)
  1419. #define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b)  (p)->EnumAttachedSurfaces(a,b)
  1420. #define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c)  (p)->EnumOverlayZOrders(a,b,c)
  1421. #define IDirectDrawSurface_Flip(p,a,b)                  (p)->Flip(a,b)
  1422. #define IDirectDrawSurface_GetAttachedSurface(p,a,b)    (p)->GetAttachedSurface(a,b)
  1423. #define IDirectDrawSurface_GetBltStatus(p,a)            (p)->GetBltStatus(a)
  1424. #define IDirectDrawSurface_GetCaps(p,b)                 (p)->GetCaps(b)
  1425. #define IDirectDrawSurface_GetClipper(p,a)              (p)->GetClipper(a)
  1426. #define IDirectDrawSurface_GetColorKey(p,a,b)           (p)->GetColorKey(a,b)
  1427. #define IDirectDrawSurface_GetDC(p,a)                   (p)->GetDC(a)
  1428. #define IDirectDrawSurface_GetFlipStatus(p,a)           (p)->GetFlipStatus(a)
  1429. #define IDirectDrawSurface_GetOverlayPosition(p,a,b)    (p)->GetOverlayPosition(a,b)
  1430. #define IDirectDrawSurface_GetPalette(p,a)              (p)->GetPalette(a)
  1431. #define IDirectDrawSurface_GetPixelFormat(p,a)          (p)->GetPixelFormat(a)
  1432. #define IDirectDrawSurface_GetSurfaceDesc(p,a)          (p)->GetSurfaceDesc(a)
  1433. #define IDirectDrawSurface_Initialize(p,a,b)            (p)->Initialize(a,b)
  1434. #define IDirectDrawSurface_IsLost(p)                    (p)->IsLost()
  1435. #define IDirectDrawSurface_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
  1436. #define IDirectDrawSurface_ReleaseDC(p,a)               (p)->ReleaseDC(a)
  1437. #define IDirectDrawSurface_Restore(p)                   (p)->Restore()
  1438. #define IDirectDrawSurface_SetClipper(p,a)              (p)->SetClipper(a)
  1439. #define IDirectDrawSurface_SetColorKey(p,a,b)           (p)->SetColorKey(a,b)
  1440. #define IDirectDrawSurface_SetOverlayPosition(p,a,b)    (p)->SetOverlayPosition(a,b)
  1441. #define IDirectDrawSurface_SetPalette(p,a)              (p)->SetPalette(a)
  1442. #define IDirectDrawSurface_Unlock(p,b)                  (p)->Unlock(b)
  1443. #define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e)   (p)->UpdateOverlay(a,b,c,d,e)
  1444. #define IDirectDrawSurface_UpdateOverlayDisplay(p,a)    (p)->UpdateOverlayDisplay(a)
  1445. #define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b)   (p)->UpdateOverlayZOrder(a,b)
  1446. #endif
  1447. /*
  1448.  * IDirectDrawSurface2 and related interfaces
  1449.  */
  1450. #undef INTERFACE
  1451. #define INTERFACE IDirectDrawSurface2
  1452. DECLARE_INTERFACE_( IDirectDrawSurface2, IUnknown )
  1453. {
  1454.     /*** IUnknown methods ***/
  1455.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  1456.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1457.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1458.     /*** IDirectDrawSurface methods ***/
  1459.     STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE2) PURE;
  1460.     STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE;
  1461.     STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE2, LPRECT,DWORD, LPDDBLTFX) PURE;
  1462.     STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE;
  1463.     STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE2, LPRECT,DWORD) PURE;
  1464.     STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE2) PURE;
  1465.     STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
  1466.     STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
  1467.     STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE2, DWORD) PURE;
  1468.     STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE2 FAR *) PURE;
  1469.     STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE;
  1470.     STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE;
  1471.     STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE;
  1472.     STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
  1473.     STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE;
  1474.     STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE;
  1475.     STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE;
  1476.     STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE;
  1477.     STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE;
  1478.     STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE;
  1479.     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE;
  1480.     STDMETHOD(IsLost)(THIS) PURE;
  1481.     STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE;
  1482.     STDMETHOD(ReleaseDC)(THIS_ HDC) PURE;
  1483.     STDMETHOD(Restore)(THIS) PURE;
  1484.     STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE;
  1485.     STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
  1486.     STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE;
  1487.     STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE;
  1488.     STDMETHOD(Unlock)(THIS_ LPVOID) PURE;
  1489.     STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE2,LPRECT,DWORD, LPDDOVERLAYFX) PURE;
  1490.     STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE;
  1491.     STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE2) PURE;
  1492.     /*** Added in the v2 interface ***/
  1493.     STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE;
  1494.     STDMETHOD(PageLock)(THIS_ DWORD) PURE;
  1495.     STDMETHOD(PageUnlock)(THIS_ DWORD) PURE;
  1496. };
  1497. #if !defined(__cplusplus) || defined(CINTERFACE)
  1498. #define IDirectDrawSurface2_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
  1499. #define IDirectDrawSurface2_AddRef(p)                    (p)->lpVtbl->AddRef(p)
  1500. #define IDirectDrawSurface2_Release(p)                   (p)->lpVtbl->Release(p)
  1501. #define IDirectDrawSurface2_AddAttachedSurface(p,a)      (p)->lpVtbl->AddAttachedSurface(p,a)
  1502. #define IDirectDrawSurface2_AddOverlayDirtyRect(p,a)     (p)->lpVtbl->AddOverlayDirtyRect(p,a)
  1503. #define IDirectDrawSurface2_Blt(p,a,b,c,d,e)             (p)->lpVtbl->Blt(p,a,b,c,d,e)
  1504. #define IDirectDrawSurface2_BltBatch(p,a,b,c)            (p)->lpVtbl->BltBatch(p,a,b,c)
  1505. #define IDirectDrawSurface2_BltFast(p,a,b,c,d,e)         (p)->lpVtbl->BltFast(p,a,b,c,d,e)
  1506. #define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b)
  1507. #define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b)  (p)->lpVtbl->EnumAttachedSurfaces(p,a,b)
  1508. #define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c)  (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c)
  1509. #define IDirectDrawSurface2_Flip(p,a,b)                  (p)->lpVtbl->Flip(p,a,b)
  1510. #define IDirectDrawSurface2_GetAttachedSurface(p,a,b)    (p)->lpVtbl->GetAttachedSurface(p,a,b)
  1511. #define IDirectDrawSurface2_GetBltStatus(p,a)            (p)->lpVtbl->GetBltStatus(p,a)
  1512. #define IDirectDrawSurface2_GetCaps(p,b)                 (p)->lpVtbl->GetCaps(p,b)
  1513. #define IDirectDrawSurface2_GetClipper(p,a)              (p)->lpVtbl->GetClipper(p,a)
  1514. #define IDirectDrawSurface2_GetColorKey(p,a,b)           (p)->lpVtbl->GetColorKey(p,a,b)
  1515. #define IDirectDrawSurface2_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
  1516. #define IDirectDrawSurface2_GetFlipStatus(p,a)           (p)->lpVtbl->GetFlipStatus(p,a)
  1517. #define IDirectDrawSurface2_GetOverlayPosition(p,a,b)    (p)->lpVtbl->GetOverlayPosition(p,a,b)
  1518. #define IDirectDrawSurface2_GetPalette(p,a)              (p)->lpVtbl->GetPalette(p,a)
  1519. #define IDirectDrawSurface2_GetPixelFormat(p,a)          (p)->lpVtbl->GetPixelFormat(p,a)
  1520. #define IDirectDrawSurface2_GetSurfaceDesc(p,a)          (p)->lpVtbl->GetSurfaceDesc(p,a)
  1521. #define IDirectDrawSurface2_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
  1522. #define IDirectDrawSurface2_IsLost(p)                    (p)->lpVtbl->IsLost(p)
  1523. #define IDirectDrawSurface2_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
  1524. #define IDirectDrawSurface2_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
  1525. #define IDirectDrawSurface2_Restore(p)                   (p)->lpVtbl->Restore(p)
  1526. #define IDirectDrawSurface2_SetClipper(p,a)              (p)->lpVtbl->SetClipper(p,a)
  1527. #define IDirectDrawSurface2_SetColorKey(p,a,b)           (p)->lpVtbl->SetColorKey(p,a,b)
  1528. #define IDirectDrawSurface2_SetOverlayPosition(p,a,b)    (p)->lpVtbl->SetOverlayPosition(p,a,b)
  1529. #define IDirectDrawSurface2_SetPalette(p,a)              (p)->lpVtbl->SetPalette(p,a)
  1530. #define IDirectDrawSurface2_Unlock(p,b)                  (p)->lpVtbl->Unlock(p,b)
  1531. #define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e)   (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e)
  1532. #define IDirectDrawSurface2_UpdateOverlayDisplay(p,a)    (p)->lpVtbl->UpdateOverlayDisplay(p,a)
  1533. #define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b)   (p)->lpVtbl->UpdateOverlayZOrder(p,a,b)
  1534. #define IDirectDrawSurface2_GetDDInterface(p,a)          (p)->lpVtbl->GetDDInterface(p,a)
  1535. #define IDirectDrawSurface2_PageLock(p,a)                (p)->lpVtbl->PageLock(p,a)
  1536. #define IDirectDrawSurface2_PageUnlock(p,a)              (p)->lpVtbl->PageUnlock(p,a)
  1537. #else
  1538. #define IDirectDrawSurface2_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
  1539. #define IDirectDrawSurface2_AddRef(p)                    (p)->AddRef()
  1540. #define IDirectDrawSurface2_Release(p)                   (p)->Release()
  1541. #define IDirectDrawSurface2_AddAttachedSurface(p,a)      (p)->AddAttachedSurface(a)
  1542. #define IDirectDrawSurface2_AddOverlayDirtyRect(p,a)     (p)->AddOverlayDirtyRect(a)
  1543. #define IDirectDrawSurface2_Blt(p,a,b,c,d,e)             (p)->Blt(a,b,c,d,e)
  1544. #define IDirectDrawSurface2_BltBatch(p,a,b,c)            (p)->BltBatch(a,b,c)
  1545. #define IDirectDrawSurface2_BltFast(p,a,b,c,d,e)         (p)->BltFast(a,b,c,d,e)
  1546. #define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b)
  1547. #define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b)  (p)->EnumAttachedSurfaces(a,b)
  1548. #define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c)  (p)->EnumOverlayZOrders(a,b,c)
  1549. #define IDirectDrawSurface2_Flip(p,a,b)                  (p)->Flip(a,b)
  1550. #define IDirectDrawSurface2_GetAttachedSurface(p,a,b)    (p)->GetAttachedSurface(a,b)
  1551. #define IDirectDrawSurface2_GetBltStatus(p,a)            (p)->GetBltStatus(a)
  1552. #define IDirectDrawSurface2_GetCaps(p,b)                 (p)->GetCaps(b)
  1553. #define IDirectDrawSurface2_GetClipper(p,a)              (p)->GetClipper(a)
  1554. #define IDirectDrawSurface2_GetColorKey(p,a,b)           (p)->GetColorKey(a,b)
  1555. #define IDirectDrawSurface2_GetDC(p,a)                   (p)->GetDC(a)
  1556. #define IDirectDrawSurface2_GetFlipStatus(p,a)           (p)->GetFlipStatus(a)
  1557. #define IDirectDrawSurface2_GetOverlayPosition(p,a,b)    (p)->GetOverlayPosition(a,b)
  1558. #define IDirectDrawSurface2_GetPalette(p,a)              (p)->GetPalette(a)
  1559. #define IDirectDrawSurface2_GetPixelFormat(p,a)          (p)->GetPixelFormat(a)
  1560. #define IDirectDrawSurface2_GetSurfaceDesc(p,a)          (p)->GetSurfaceDesc(a)
  1561. #define IDirectDrawSurface2_Initialize(p,a,b)            (p)->Initialize(a,b)
  1562. #define IDirectDrawSurface2_IsLost(p)                    (p)->IsLost()
  1563. #define IDirectDrawSurface2_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
  1564. #define IDirectDrawSurface2_ReleaseDC(p,a)               (p)->ReleaseDC(a)
  1565. #define IDirectDrawSurface2_Restore(p)                   (p)->Restore()
  1566. #define IDirectDrawSurface2_SetClipper(p,a)              (p)->SetClipper(a)
  1567. #define IDirectDrawSurface2_SetColorKey(p,a,b)           (p)->SetColorKey(a,b)
  1568. #define IDirectDrawSurface2_SetOverlayPosition(p,a,b)    (p)->SetOverlayPosition(a,b)
  1569. #define IDirectDrawSurface2_SetPalette(p,a)              (p)->SetPalette(a)
  1570. #define IDirectDrawSurface2_Unlock(p,b)                  (p)->Unlock(b)
  1571. #define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e)   (p)->UpdateOverlay(a,b,c,d,e)
  1572. #define IDirectDrawSurface2_UpdateOverlayDisplay(p,a)    (p)->UpdateOverlayDisplay(a)
  1573. #define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b)   (p)->UpdateOverlayZOrder(a,b)
  1574. #define IDirectDrawSurface2_GetDDInterface(p,a)          (p)->GetDDInterface(a)
  1575. #define IDirectDrawSurface2_PageLock(p,a)                (p)->PageLock(a)
  1576. #define IDirectDrawSurface2_PageUnlock(p,a)              (p)->PageUnlock(a)
  1577. #endif
  1578. /*
  1579.  * IDirectDrawSurface3 and related interfaces
  1580.  */
  1581. #undef INTERFACE
  1582. #define INTERFACE IDirectDrawSurface3
  1583. DECLARE_INTERFACE_( IDirectDrawSurface3, IUnknown )
  1584. {
  1585.     /*** IUnknown methods ***/
  1586.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  1587.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1588.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1589.     /*** IDirectDrawSurface methods ***/
  1590.     STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE3) PURE;
  1591.     STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE;
  1592.     STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE3, LPRECT,DWORD, LPDDBLTFX) PURE;
  1593.     STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE;
  1594.     STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE3, LPRECT,DWORD) PURE;
  1595.     STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE3) PURE;
  1596.     STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
  1597.     STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
  1598.     STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE3, DWORD) PURE;
  1599.     STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE3 FAR *) PURE;
  1600.     STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE;
  1601.     STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE;
  1602.     STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE;
  1603.     STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
  1604.     STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE;
  1605.     STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE;
  1606.     STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE;
  1607.     STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE;
  1608.     STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE;
  1609.     STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE;
  1610.     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE;
  1611.     STDMETHOD(IsLost)(THIS) PURE;
  1612.     STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE;
  1613.     STDMETHOD(ReleaseDC)(THIS_ HDC) PURE;
  1614.     STDMETHOD(Restore)(THIS) PURE;
  1615.     STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE;
  1616.     STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
  1617.     STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE;
  1618.     STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE;
  1619.     STDMETHOD(Unlock)(THIS_ LPVOID) PURE;
  1620.     STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE3,LPRECT,DWORD, LPDDOVERLAYFX) PURE;
  1621.     STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE;
  1622.     STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE3) PURE;
  1623.     /*** Added in the v2 interface ***/
  1624.     STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE;
  1625.     STDMETHOD(PageLock)(THIS_ DWORD) PURE;
  1626.     STDMETHOD(PageUnlock)(THIS_ DWORD) PURE;
  1627.     /*** Added in the V3 interface ***/
  1628.     STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC, DWORD) PURE;
  1629. };
  1630. #if !defined(__cplusplus) || defined(CINTERFACE)
  1631. #define IDirectDrawSurface3_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
  1632. #define IDirectDrawSurface3_AddRef(p)                    (p)->lpVtbl->AddRef(p)
  1633. #define IDirectDrawSurface3_Release(p)                   (p)->lpVtbl->Release(p)
  1634. #define IDirectDrawSurface3_AddAttachedSurface(p,a)      (p)->lpVtbl->AddAttachedSurface(p,a)
  1635. #define IDirectDrawSurface3_AddOverlayDirtyRect(p,a)     (p)->lpVtbl->AddOverlayDirtyRect(p,a)
  1636. #define IDirectDrawSurface3_Blt(p,a,b,c,d,e)             (p)->lpVtbl->Blt(p,a,b,c,d,e)
  1637. #define IDirectDrawSurface3_BltBatch(p,a,b,c)            (p)->lpVtbl->BltBatch(p,a,b,c)
  1638. #define IDirectDrawSurface3_BltFast(p,a,b,c,d,e)         (p)->lpVtbl->BltFast(p,a,b,c,d,e)
  1639. #define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b)
  1640. #define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b)  (p)->lpVtbl->EnumAttachedSurfaces(p,a,b)
  1641. #define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c)  (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c)
  1642. #define IDirectDrawSurface3_Flip(p,a,b)                  (p)->lpVtbl->Flip(p,a,b)
  1643. #define IDirectDrawSurface3_GetAttachedSurface(p,a,b)    (p)->lpVtbl->GetAttachedSurface(p,a,b)
  1644. #define IDirectDrawSurface3_GetBltStatus(p,a)            (p)->lpVtbl->GetBltStatus(p,a)
  1645. #define IDirectDrawSurface3_GetCaps(p,b)                 (p)->lpVtbl->GetCaps(p,b)
  1646. #define IDirectDrawSurface3_GetClipper(p,a)              (p)->lpVtbl->GetClipper(p,a)
  1647. #define IDirectDrawSurface3_GetColorKey(p,a,b)           (p)->lpVtbl->GetColorKey(p,a,b)
  1648. #define IDirectDrawSurface3_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
  1649. #define IDirectDrawSurface3_GetFlipStatus(p,a)           (p)->lpVtbl->GetFlipStatus(p,a)
  1650. #define IDirectDrawSurface3_GetOverlayPosition(p,a,b)    (p)->lpVtbl->GetOverlayPosition(p,a,b)
  1651. #define IDirectDrawSurface3_GetPalette(p,a)              (p)->lpVtbl->GetPalette(p,a)
  1652. #define IDirectDrawSurface3_GetPixelFormat(p,a)          (p)->lpVtbl->GetPixelFormat(p,a)
  1653. #define IDirectDrawSurface3_GetSurfaceDesc(p,a)          (p)->lpVtbl->GetSurfaceDesc(p,a)
  1654. #define IDirectDrawSurface3_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
  1655. #define IDirectDrawSurface3_IsLost(p)                    (p)->lpVtbl->IsLost(p)
  1656. #define IDirectDrawSurface3_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
  1657. #define IDirectDrawSurface3_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
  1658. #define IDirectDrawSurface3_Restore(p)                   (p)->lpVtbl->Restore(p)
  1659. #define IDirectDrawSurface3_SetClipper(p,a)              (p)->lpVtbl->SetClipper(p,a)
  1660. #define IDirectDrawSurface3_SetColorKey(p,a,b)           (p)->lpVtbl->SetColorKey(p,a,b)
  1661. #define IDirectDrawSurface3_SetOverlayPosition(p,a,b)    (p)->lpVtbl->SetOverlayPosition(p,a,b)
  1662. #define IDirectDrawSurface3_SetPalette(p,a)              (p)->lpVtbl->SetPalette(p,a)
  1663. #define IDirectDrawSurface3_Unlock(p,b)                  (p)->lpVtbl->Unlock(p,b)
  1664. #define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e)   (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e)
  1665. #define IDirectDrawSurface3_UpdateOverlayDisplay(p,a)    (p)->lpVtbl->UpdateOverlayDisplay(p,a)
  1666. #define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b)   (p)->lpVtbl->UpdateOverlayZOrder(p,a,b)
  1667. #define IDirectDrawSurface3_GetDDInterface(p,a)          (p)->lpVtbl->GetDDInterface(p,a)
  1668. #define IDirectDrawSurface3_PageLock(p,a)                (p)->lpVtbl->PageLock(p,a)
  1669. #define IDirectDrawSurface3_PageUnlock(p,a)              (p)->lpVtbl->PageUnlock(p,a)
  1670. #define IDirectDrawSurface3_SetSurfaceDesc(p,a,b)        (p)->lpVtbl->SetSurfaceDesc(p,a,b)
  1671. #else
  1672. #define IDirectDrawSurface3_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
  1673. #define IDirectDrawSurface3_AddRef(p)                    (p)->AddRef()
  1674. #define IDirectDrawSurface3_Release(p)                   (p)->Release()
  1675. #define IDirectDrawSurface3_AddAttachedSurface(p,a)      (p)->AddAttachedSurface(a)
  1676. #define IDirectDrawSurface3_AddOverlayDirtyRect(p,a)     (p)->AddOverlayDirtyRect(a)
  1677. #define IDirectDrawSurface3_Blt(p,a,b,c,d,e)             (p)->Blt(a,b,c,d,e)
  1678. #define IDirectDrawSurface3_BltBatch(p,a,b,c)            (p)->BltBatch(a,b,c)
  1679. #define IDirectDrawSurface3_BltFast(p,a,b,c,d,e)         (p)->BltFast(a,b,c,d,e)
  1680. #define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b)
  1681. #define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b)  (p)->EnumAttachedSurfaces(a,b)
  1682. #define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c)  (p)->EnumOverlayZOrders(a,b,c)
  1683. #define IDirectDrawSurface3_Flip(p,a,b)                  (p)->Flip(a,b)
  1684. #define IDirectDrawSurface3_GetAttachedSurface(p,a,b)    (p)->GetAttachedSurface(a,b)
  1685. #define IDirectDrawSurface3_GetBltStatus(p,a)            (p)->GetBltStatus(a)
  1686. #define IDirectDrawSurface3_GetCaps(p,b)                 (p)->GetCaps(b)
  1687. #define IDirectDrawSurface3_GetClipper(p,a)              (p)->GetClipper(a)
  1688. #define IDirectDrawSurface3_GetColorKey(p,a,b)           (p)->GetColorKey(a,b)
  1689. #define IDirectDrawSurface3_GetDC(p,a)                   (p)->GetDC(a)
  1690. #define IDirectDrawSurface3_GetFlipStatus(p,a)           (p)->GetFlipStatus(a)
  1691. #define IDirectDrawSurface3_GetOverlayPosition(p,a,b)    (p)->GetOverlayPosition(a,b)
  1692. #define IDirectDrawSurface3_GetPalette(p,a)              (p)->GetPalette(a)
  1693. #define IDirectDrawSurface3_GetPixelFormat(p,a)          (p)->GetPixelFormat(a)
  1694. #define IDirectDrawSurface3_GetSurfaceDesc(p,a)          (p)->GetSurfaceDesc(a)
  1695. #define IDirectDrawSurface3_Initialize(p,a,b)            (p)->Initialize(a,b)
  1696. #define IDirectDrawSurface3_IsLost(p)                    (p)->IsLost()
  1697. #define IDirectDrawSurface3_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
  1698. #define IDirectDrawSurface3_ReleaseDC(p,a)               (p)->ReleaseDC(a)
  1699. #define IDirectDrawSurface3_Restore(p)                   (p)->Restore()
  1700. #define IDirectDrawSurface3_SetClipper(p,a)              (p)->SetClipper(a)
  1701. #define IDirectDrawSurface3_SetColorKey(p,a,b)           (p)->SetColorKey(a,b)
  1702. #define IDirectDrawSurface3_SetOverlayPosition(p,a,b)    (p)->SetOverlayPosition(a,b)
  1703. #define IDirectDrawSurface3_SetPalette(p,a)              (p)->SetPalette(a)
  1704. #define IDirectDrawSurface3_Unlock(p,b)                  (p)->Unlock(b)
  1705. #define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e)   (p)->UpdateOverlay(a,b,c,d,e)
  1706. #define IDirectDrawSurface3_UpdateOverlayDisplay(p,a)    (p)->UpdateOverlayDisplay(a)
  1707. #define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b)   (p)->UpdateOverlayZOrder(a,b)
  1708. #define IDirectDrawSurface3_GetDDInterface(p,a)          (p)->GetDDInterface(a)
  1709. #define IDirectDrawSurface3_PageLock(p,a)                (p)->PageLock(a)
  1710. #define IDirectDrawSurface3_PageUnlock(p,a)              (p)->PageUnlock(a)
  1711. #define IDirectDrawSurface3_SetSurfaceDesc(p,a,b)        (p)->SetSurfaceDesc(a,b)
  1712. #endif
  1713. /*
  1714.  * IDirectDrawSurface4 and related interfaces
  1715.  */
  1716. #undef INTERFACE
  1717. #define INTERFACE IDirectDrawSurface4
  1718. DECLARE_INTERFACE_( IDirectDrawSurface4, IUnknown )
  1719. {
  1720.     /*** IUnknown methods ***/
  1721.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  1722.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1723.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1724.     /*** IDirectDrawSurface methods ***/
  1725.     STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE4) PURE;
  1726.     STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE;
  1727.     STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE4, LPRECT,DWORD, LPDDBLTFX) PURE;
  1728.     STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE;
  1729.     STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE4, LPRECT,DWORD) PURE;
  1730.     STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE4) PURE;
  1731.     STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK2) PURE;
  1732.     STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK2) PURE;
  1733.     STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE4, DWORD) PURE;
  1734.     STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS2, LPDIRECTDRAWSURFACE4 FAR *) PURE;
  1735.     STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE;
  1736.     STDMETHOD(GetCaps)(THIS_ LPDDSCAPS2) PURE;
  1737.     STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE;
  1738.     STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
  1739.     STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE;
  1740.     STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE;
  1741.     STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE;
  1742.     STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE;
  1743.     STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE;
  1744.     STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC2) PURE;
  1745.     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC2) PURE;
  1746.     STDMETHOD(IsLost)(THIS) PURE;
  1747.     STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC2,DWORD,HANDLE) PURE;
  1748.     STDMETHOD(ReleaseDC)(THIS_ HDC) PURE;
  1749.     STDMETHOD(Restore)(THIS) PURE;
  1750.     STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE;
  1751.     STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
  1752.     STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE;
  1753.     STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE;
  1754.     STDMETHOD(Unlock)(THIS_ LPRECT) PURE;
  1755.     STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE4,LPRECT,DWORD, LPDDOVERLAYFX) PURE;
  1756.     STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE;
  1757.     STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE4) PURE;
  1758.     /*** Added in the v2 interface ***/
  1759.     STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE;
  1760.     STDMETHOD(PageLock)(THIS_ DWORD) PURE;
  1761.     STDMETHOD(PageUnlock)(THIS_ DWORD) PURE;
  1762.     /*** Added in the v3 interface ***/
  1763.     STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC2, DWORD) PURE;
  1764.     /*** Added in the v4 interface ***/
  1765.     STDMETHOD(SetPrivateData)(THIS_ REFGUID, LPVOID, DWORD, DWORD) PURE;
  1766.     STDMETHOD(GetPrivateData)(THIS_ REFGUID, LPVOID, LPDWORD) PURE;
  1767.     STDMETHOD(FreePrivateData)(THIS_ REFGUID) PURE;
  1768.     STDMETHOD(GetUniquenessValue)(THIS_ LPDWORD) PURE;
  1769.     STDMETHOD(ChangeUniquenessValue)(THIS) PURE;
  1770. };
  1771. #if !defined(__cplusplus) || defined(CINTERFACE)
  1772. #define IDirectDrawSurface4_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
  1773. #define IDirectDrawSurface4_AddRef(p)                    (p)->lpVtbl->AddRef(p)
  1774. #define IDirectDrawSurface4_Release(p)                   (p)->lpVtbl->Release(p)
  1775. #define IDirectDrawSurface4_AddAttachedSurface(p,a)      (p)->lpVtbl->AddAttachedSurface(p,a)
  1776. #define IDirectDrawSurface4_AddOverlayDirtyRect(p,a)     (p)->lpVtbl->AddOverlayDirtyRect(p,a)
  1777. #define IDirectDrawSurface4_Blt(p,a,b,c,d,e)             (p)->lpVtbl->Blt(p,a,b,c,d,e)
  1778. #define IDirectDrawSurface4_BltBatch(p,a,b,c)            (p)->lpVtbl->BltBatch(p,a,b,c)
  1779. #define IDirectDrawSurface4_BltFast(p,a,b,c,d,e)         (p)->lpVtbl->BltFast(p,a,b,c,d,e)
  1780. #define IDirectDrawSurface4_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b)
  1781. #define IDirectDrawSurface4_EnumAttachedSurfaces(p,a,b)  (p)->lpVtbl->EnumAttachedSurfaces(p,a,b)
  1782. #define IDirectDrawSurface4_EnumOverlayZOrders(p,a,b,c)  (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c)
  1783. #define IDirectDrawSurface4_Flip(p,a,b)                  (p)->lpVtbl->Flip(p,a,b)
  1784. #define IDirectDrawSurface4_GetAttachedSurface(p,a,b)    (p)->lpVtbl->GetAttachedSurface(p,a,b)
  1785. #define IDirectDrawSurface4_GetBltStatus(p,a)            (p)->lpVtbl->GetBltStatus(p,a)
  1786. #define IDirectDrawSurface4_GetCaps(p,b)                 (p)->lpVtbl->GetCaps(p,b)
  1787. #define IDirectDrawSurface4_GetClipper(p,a)              (p)->lpVtbl->GetClipper(p,a)
  1788. #define IDirectDrawSurface4_GetColorKey(p,a,b)           (p)->lpVtbl->GetColorKey(p,a,b)
  1789. #define IDirectDrawSurface4_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
  1790. #define IDirectDrawSurface4_GetFlipStatus(p,a)           (p)->lpVtbl->GetFlipStatus(p,a)
  1791. #define IDirectDrawSurface4_GetOverlayPosition(p,a,b)    (p)->lpVtbl->GetOverlayPosition(p,a,b)
  1792. #define IDirectDrawSurface4_GetPalette(p,a)              (p)->lpVtbl->GetPalette(p,a)
  1793. #define IDirectDrawSurface4_GetPixelFormat(p,a)          (p)->lpVtbl->GetPixelFormat(p,a)
  1794. #define IDirectDrawSurface4_GetSurfaceDesc(p,a)          (p)->lpVtbl->GetSurfaceDesc(p,a)
  1795. #define IDirectDrawSurface4_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
  1796. #define IDirectDrawSurface4_IsLost(p)                    (p)->lpVtbl->IsLost(p)
  1797. #define IDirectDrawSurface4_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
  1798. #define IDirectDrawSurface4_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
  1799. #define IDirectDrawSurface4_Restore(p)                   (p)->lpVtbl->Restore(p)
  1800. #define IDirectDrawSurface4_SetClipper(p,a)              (p)->lpVtbl->SetClipper(p,a)
  1801. #define IDirectDrawSurface4_SetColorKey(p,a,b)           (p)->lpVtbl->SetColorKey(p,a,b)
  1802. #define IDirectDrawSurface4_SetOverlayPosition(p,a,b)    (p)->lpVtbl->SetOverlayPosition(p,a,b)
  1803. #define IDirectDrawSurface4_SetPalette(p,a)              (p)->lpVtbl->SetPalette(p,a)
  1804. #define IDirectDrawSurface4_Unlock(p,b)                  (p)->lpVtbl->Unlock(p,b)
  1805. #define IDirectDrawSurface4_UpdateOverlay(p,a,b,c,d,e)   (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e)
  1806. #define IDirectDrawSurface4_UpdateOverlayDisplay(p,a)    (p)->lpVtbl->UpdateOverlayDisplay(p,a)
  1807. #define IDirectDrawSurface4_UpdateOverlayZOrder(p,a,b)   (p)->lpVtbl->UpdateOverlayZOrder(p,a,b)
  1808. #define IDirectDrawSurface4_GetDDInterface(p,a)          (p)->lpVtbl->GetDDInterface(p,a)
  1809. #define IDirectDrawSurface4_PageLock(p,a)                (p)->lpVtbl->PageLock(p,a)
  1810. #define IDirectDrawSurface4_PageUnlock(p,a)              (p)->lpVtbl->PageUnlock(p,a)
  1811. #define IDirectDrawSurface4_SetSurfaceDesc(p,a,b)        (p)->lpVtbl->SetSurfaceDesc(p,a,b)
  1812. #define IDirectDrawSurface4_SetPrivateData(p,a,b,c,d)    (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
  1813. #define IDirectDrawSurface4_GetPrivateData(p,a,b,c)      (p)->lpVtbl->GetPrivateData(p,a,b,c)
  1814. #define IDirectDrawSurface4_FreePrivateData(p,a)         (p)->lpVtbl->FreePrivateData(p,a)
  1815. #define IDirectDrawSurface4_GetUniquenessValue(p, a)     (p)->lpVtbl->GetUniquenessValue(p, a)
  1816. #define IDirectDrawSurface4_ChangeUniquenessValue(p)     (p)->lpVtbl->ChangeUniquenessValue(p)
  1817. #else
  1818. #define IDirectDrawSurface4_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
  1819. #define IDirectDrawSurface4_AddRef(p)                    (p)->AddRef()
  1820. #define IDirectDrawSurface4_Release(p)                   (p)->Release()
  1821. #define IDirectDrawSurface4_AddAttachedSurface(p,a)      (p)->AddAttachedSurface(a)
  1822. #define IDirectDrawSurface4_AddOverlayDirtyRect(p,a)     (p)->AddOverlayDirtyRect(a)
  1823. #define IDirectDrawSurface4_Blt(p,a,b,c,d,e)             (p)->Blt(a,b,c,d,e)
  1824. #define IDirectDrawSurface4_BltBatch(p,a,b,c)            (p)->BltBatch(a,b,c)
  1825. #define IDirectDrawSurface4_BltFast(p,a,b,c,d,e)         (p)->BltFast(a,b,c,d,e)
  1826. #define IDirectDrawSurface4_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b)
  1827. #define IDirectDrawSurface4_EnumAttachedSurfaces(p,a,b)  (p)->EnumAttachedSurfaces(a,b)
  1828. #define IDirectDrawSurface4_EnumOverlayZOrders(p,a,b,c)  (p)->EnumOverlayZOrders(a,b,c)
  1829. #define IDirectDrawSurface4_Flip(p,a,b)                  (p)->Flip(a,b)
  1830. #define IDirectDrawSurface4_GetAttachedSurface(p,a,b)    (p)->GetAttachedSurface(a,b)
  1831. #define IDirectDrawSurface4_GetBltStatus(p,a)            (p)->GetBltStatus(a)
  1832. #define IDirectDrawSurface4_GetCaps(p,b)                 (p)->GetCaps(b)
  1833. #define IDirectDrawSurface4_GetClipper(p,a)              (p)->GetClipper(a)
  1834. #define IDirectDrawSurface4_GetColorKey(p,a,b)           (p)->GetColorKey(a,b)
  1835. #define IDirectDrawSurface4_GetDC(p,a)                   (p)->GetDC(a)
  1836. #define IDirectDrawSurface4_GetFlipStatus(p,a)           (p)->GetFlipStatus(a)
  1837. #define IDirectDrawSurface4_GetOverlayPosition(p,a,b)    (p)->GetOverlayPosition(a,b)
  1838. #define IDirectDrawSurface4_GetPalette(p,a)              (p)->GetPalette(a)
  1839. #define IDirectDrawSurface4_GetPixelFormat(p,a)          (p)->GetPixelFormat(a)
  1840. #define IDirectDrawSurface4_GetSurfaceDesc(p,a)          (p)->GetSurfaceDesc(a)
  1841. #define IDirectDrawSurface4_Initialize(p,a,b)            (p)->Initialize(a,b)
  1842. #define IDirectDrawSurface4_IsLost(p)                    (p)->IsLost()
  1843. #define IDirectDrawSurface4_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
  1844. #define IDirectDrawSurface4_ReleaseDC(p,a)               (p)->ReleaseDC(a)
  1845. #define IDirectDrawSurface4_Restore(p)                   (p)->Restore()
  1846. #define IDirectDrawSurface4_SetClipper(p,a)              (p)->SetClipper(a)
  1847. #define IDirectDrawSurface4_SetColorKey(p,a,b)           (p)->SetColorKey(a,b)
  1848. #define IDirectDrawSurface4_SetOverlayPosition(p,a,b)    (p)->SetOverlayPosition(a,b)
  1849. #define IDirectDrawSurface4_SetPalette(p,a)              (p)->SetPalette(a)
  1850. #define IDirectDrawSurface4_Unlock(p,b)                  (p)->Unlock(b)
  1851. #define IDirectDrawSurface4_UpdateOverlay(p,a,b,c,d,e)   (p)->UpdateOverlay(a,b,c,d,e)
  1852. #define IDirectDrawSurface4_UpdateOverlayDisplay(p,a)    (p)->UpdateOverlayDisplay(a)
  1853. #define IDirectDrawSurface4_UpdateOverlayZOrder(p,a,b)   (p)->UpdateOverlayZOrder(a,b)
  1854. #define IDirectDrawSurface4_GetDDInterface(p,a)          (p)->GetDDInterface(a)
  1855. #define IDirectDrawSurface4_PageLock(p,a)                (p)->PageLock(a)
  1856. #define IDirectDrawSurface4_PageUnlock(p,a)              (p)->PageUnlock(a)
  1857. #define IDirectDrawSurface4_SetSurfaceDesc(p,a,b)        (p)->SetSurfaceDesc(a,b)
  1858. #define IDirectDrawSurface4_SetPrivateData(p,a,b,c,d)    (p)->SetPrivateData(a,b,c,d)
  1859. #define IDirectDrawSurface4_GetPrivateData(p,a,b,c)      (p)->GetPrivateData(a,b,c)
  1860. #define IDirectDrawSurface4_FreePrivateData(p,a)         (p)->FreePrivateData(a)
  1861. #define IDirectDrawSurface4_GetUniquenessValue(p, a)     (p)->GetUniquenessValue(a)
  1862. #define IDirectDrawSurface4_ChangeUniquenessValue(p)     (p)->ChangeUniquenessValue()
  1863. #endif
  1864. /*
  1865.  * IDirectDrawSurface7 and related interfaces
  1866.  */
  1867. #undef INTERFACE
  1868. #define INTERFACE IDirectDrawSurface7
  1869. DECLARE_INTERFACE_( IDirectDrawSurface7, IUnknown )
  1870. {
  1871.     /*** IUnknown methods ***/
  1872.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  1873.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1874.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1875.     /*** IDirectDrawSurface methods ***/
  1876.     STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE7) PURE;
  1877.     STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE;
  1878.     STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE7, LPRECT,DWORD, LPDDBLTFX) PURE;
  1879.     STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE;
  1880.     STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE7, LPRECT,DWORD) PURE;
  1881.     STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE7) PURE;
  1882.     STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK7) PURE;
  1883.     STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK7) PURE;
  1884.     STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE7, DWORD) PURE;
  1885.     STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS2, LPDIRECTDRAWSURFACE7 FAR *) PURE;
  1886.     STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE;
  1887.     STDMETHOD(GetCaps)(THIS_ LPDDSCAPS2) PURE;
  1888.     STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE;
  1889.     STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
  1890.     STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE;
  1891.     STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE;
  1892.     STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE;
  1893.     STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE;
  1894.     STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE;
  1895.     STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC2) PURE;
  1896.     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC2) PURE;
  1897.     STDMETHOD(IsLost)(THIS) PURE;
  1898.     STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC2,DWORD,HANDLE) PURE;
  1899.     STDMETHOD(ReleaseDC)(THIS_ HDC) PURE;
  1900.     STDMETHOD(Restore)(THIS) PURE;
  1901.     STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE;
  1902.     STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
  1903.     STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE;
  1904.     STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE;
  1905.     STDMETHOD(Unlock)(THIS_ LPRECT) PURE;
  1906.     STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE7,LPRECT,DWORD, LPDDOVERLAYFX) PURE;
  1907.     STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE;
  1908.     STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE7) PURE;
  1909.     /*** Added in the v2 interface ***/
  1910.     STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE;
  1911.     STDMETHOD(PageLock)(THIS_ DWORD) PURE;
  1912.     STDMETHOD(PageUnlock)(THIS_ DWORD) PURE;
  1913.     /*** Added in the v3 interface ***/
  1914.     STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC2, DWORD) PURE;
  1915.     /*** Added in the v4 interface ***/
  1916.     STDMETHOD(SetPrivateData)(THIS_ REFGUID, LPVOID, DWORD, DWORD) PURE;
  1917.     STDMETHOD(GetPrivateData)(THIS_ REFGUID, LPVOID, LPDWORD) PURE;
  1918.     STDMETHOD(FreePrivateData)(THIS_ REFGUID) PURE;
  1919.     STDMETHOD(GetUniquenessValue)(THIS_ LPDWORD) PURE;
  1920.     STDMETHOD(ChangeUniquenessValue)(THIS) PURE;
  1921.     /*** Moved Texture7 methods here ***/
  1922.     STDMETHOD(SetPriority)(THIS_ DWORD) PURE;
  1923.     STDMETHOD(GetPriority)(THIS_ LPDWORD) PURE;
  1924.     STDMETHOD(SetLOD)(THIS_ DWORD) PURE;
  1925.     STDMETHOD(GetLOD)(THIS_ LPDWORD) PURE;
  1926. };
  1927. #if !defined(__cplusplus) || defined(CINTERFACE)
  1928. #define IDirectDrawSurface7_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
  1929. #define IDirectDrawSurface7_AddRef(p)                    (p)->lpVtbl->AddRef(p)
  1930. #define IDirectDrawSurface7_Release(p)                   (p)->lpVtbl->Release(p)
  1931. #define IDirectDrawSurface7_AddAttachedSurface(p,a)      (p)->lpVtbl->AddAttachedSurface(p,a)
  1932. #define IDirectDrawSurface7_AddOverlayDirtyRect(p,a)     (p)->lpVtbl->AddOverlayDirtyRect(p,a)
  1933. #define IDirectDrawSurface7_Blt(p,a,b,c,d,e)             (p)->lpVtbl->Blt(p,a,b,c,d,e)
  1934. #define IDirectDrawSurface7_BltBatch(p,a,b,c)            (p)->lpVtbl->BltBatch(p,a,b,c)
  1935. #define IDirectDrawSurface7_BltFast(p,a,b,c,d,e)         (p)->lpVtbl->BltFast(p,a,b,c,d,e)
  1936. #define IDirectDrawSurface7_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b)
  1937. #define IDirectDrawSurface7_EnumAttachedSurfaces(p,a,b)  (p)->lpVtbl->EnumAttachedSurfaces(p,a,b)
  1938. #define IDirectDrawSurface7_EnumOverlayZOrders(p,a,b,c)  (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c)
  1939. #define IDirectDrawSurface7_Flip(p,a,b)                  (p)->lpVtbl->Flip(p,a,b)
  1940. #define IDirectDrawSurface7_GetAttachedSurface(p,a,b)    (p)->lpVtbl->GetAttachedSurface(p,a,b)
  1941. #define IDirectDrawSurface7_GetBltStatus(p,a)            (p)->lpVtbl->GetBltStatus(p,a)
  1942. #define IDirectDrawSurface7_GetCaps(p,b)                 (p)->lpVtbl->GetCaps(p,b)
  1943. #define IDirectDrawSurface7_GetClipper(p,a)              (p)->lpVtbl->GetClipper(p,a)
  1944. #define IDirectDrawSurface7_GetColorKey(p,a,b)           (p)->lpVtbl->GetColorKey(p,a,b)
  1945. #define IDirectDrawSurface7_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
  1946. #define IDirectDrawSurface7_GetFlipStatus(p,a)           (p)->lpVtbl->GetFlipStatus(p,a)
  1947. #define IDirectDrawSurface7_GetOverlayPosition(p,a,b)    (p)->lpVtbl->GetOverlayPosition(p,a,b)
  1948. #define IDirectDrawSurface7_GetPalette(p,a)              (p)->lpVtbl->GetPalette(p,a)
  1949. #define IDirectDrawSurface7_GetPixelFormat(p,a)          (p)->lpVtbl->GetPixelFormat(p,a)
  1950. #define IDirectDrawSurface7_GetSurfaceDesc(p,a)          (p)->lpVtbl->GetSurfaceDesc(p,a)
  1951. #define IDirectDrawSurface7_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
  1952. #define IDirectDrawSurface7_IsLost(p)                    (p)->lpVtbl->IsLost(p)
  1953. #define IDirectDrawSurface7_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
  1954. #define IDirectDrawSurface7_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
  1955. #define IDirectDrawSurface7_Restore(p)                   (p)->lpVtbl->Restore(p)
  1956. #define IDirectDrawSurface7_SetClipper(p,a)              (p)->lpVtbl->SetClipper(p,a)
  1957. #define IDirectDrawSurface7_SetColorKey(p,a,b)           (p)->lpVtbl->SetColorKey(p,a,b)
  1958. #define IDirectDrawSurface7_SetOverlayPosition(p,a,b)    (p)->lpVtbl->SetOverlayPosition(p,a,b)
  1959. #define IDirectDrawSurface7_SetPalette(p,a)              (p)->lpVtbl->SetPalette(p,a)
  1960. #define IDirectDrawSurface7_Unlock(p,b)                  (p)->lpVtbl->Unlock(p,b)
  1961. #define IDirectDrawSurface7_UpdateOverlay(p,a,b,c,d,e)   (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e)
  1962. #define IDirectDrawSurface7_UpdateOverlayDisplay(p,a)    (p)->lpVtbl->UpdateOverlayDisplay(p,a)
  1963. #define IDirectDrawSurface7_UpdateOverlayZOrder(p,a,b)   (p)->lpVtbl->UpdateOverlayZOrder(p,a,b)
  1964. #define IDirectDrawSurface7_GetDDInterface(p,a)          (p)->lpVtbl->GetDDInterface(p,a)
  1965. #define IDirectDrawSurface7_PageLock(p,a)                (p)->lpVtbl->PageLock(p,a)
  1966. #define IDirectDrawSurface7_PageUnlock(p,a)              (p)->lpVtbl->PageUnlock(p,a)
  1967. #define IDirectDrawSurface7_SetSurfaceDesc(p,a,b)        (p)->lpVtbl->SetSurfaceDesc(p,a,b)
  1968. #define IDirectDrawSurface7_SetPrivateData(p,a,b,c,d)    (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
  1969. #define IDirectDrawSurface7_GetPrivateData(p,a,b,c)      (p)->lpVtbl->GetPrivateData(p,a,b,c)
  1970. #define IDirectDrawSurface7_FreePrivateData(p,a)         (p)->lpVtbl->FreePrivateData(p,a)
  1971. #define IDirectDrawSurface7_GetUniquenessValue(p, a)     (p)->lpVtbl->GetUniquenessValue(p, a)
  1972. #define IDirectDrawSurface7_ChangeUniquenessValue(p)     (p)->lpVtbl->ChangeUniquenessValue(p)
  1973. #define IDirectDrawSurface7_SetPriority(p,a)             (p)->lpVtbl->SetPriority(p,a)
  1974. #define IDirectDrawSurface7_GetPriority(p,a)             (p)->lpVtbl->GetPriority(p,a)
  1975. #define IDirectDrawSurface7_SetLOD(p,a)                  (p)->lpVtbl->SetLOD(p,a)
  1976. #define IDirectDrawSurface7_GetLOD(p,a)                  (p)->lpVtbl->GetLOD(p,a)
  1977. #else
  1978. #define IDirectDrawSurface7_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
  1979. #define IDirectDrawSurface7_AddRef(p)                    (p)->AddRef()
  1980. #define IDirectDrawSurface7_Release(p)                   (p)->Release()
  1981. #define IDirectDrawSurface7_AddAttachedSurface(p,a)      (p)->AddAttachedSurface(a)
  1982. #define IDirectDrawSurface7_AddOverlayDirtyRect(p,a)     (p)->AddOverlayDirtyRect(a)
  1983. #define IDirectDrawSurface7_Blt(p,a,b,c,d,e)             (p)->Blt(a,b,c,d,e)
  1984. #define IDirectDrawSurface7_BltBatch(p,a,b,c)            (p)->BltBatch(a,b,c)
  1985. #define IDirectDrawSurface7_BltFast(p,a,b,c,d,e)         (p)->BltFast(a,b,c,d,e)
  1986. #define IDirectDrawSurface7_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b)
  1987. #define IDirectDrawSurface7_EnumAttachedSurfaces(p,a,b)  (p)->EnumAttachedSurfaces(a,b)
  1988. #define IDirectDrawSurface7_EnumOverlayZOrders(p,a,b,c)  (p)->EnumOverlayZOrders(a,b,c)
  1989. #define IDirectDrawSurface7_Flip(p,a,b)                  (p)->Flip(a,b)
  1990. #define IDirectDrawSurface7_GetAttachedSurface(p,a,b)    (p)->GetAttachedSurface(a,b)
  1991. #define IDirectDrawSurface7_GetBltStatus(p,a)            (p)->GetBltStatus(a)
  1992. #define IDirectDrawSurface7_GetCaps(p,b)                 (p)->GetCaps(b)
  1993. #define IDirectDrawSurface7_GetClipper(p,a)              (p)->GetClipper(a)
  1994. #define IDirectDrawSurface7_GetColorKey(p,a,b)           (p)->GetColorKey(a,b)
  1995. #define IDirectDrawSurface7_GetDC(p,a)                   (p)->GetDC(a)
  1996. #define IDirectDrawSurface7_GetFlipStatus(p,a)           (p)->GetFlipStatus(a)
  1997. #define IDirectDrawSurface7_GetOverlayPosition(p,a,b)    (p)->GetOverlayPosition(a,b)
  1998. #define IDirectDrawSurface7_GetPalette(p,a)              (p)->GetPalette(a)
  1999. #define IDirectDrawSurface7_GetPixelFormat(p,a)          (p)->GetPixelFormat(a)
  2000. #define IDirectDrawSurface7_GetSurfaceDesc(p,a)          (p)->GetSurfaceDesc(a)
  2001. #define IDirectDrawSurface7_Initialize(p,a,b)            (p)->Initialize(a,b)
  2002. #define IDirectDrawSurface7_IsLost(p)                    (p)->IsLost()
  2003. #define IDirectDrawSurface7_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
  2004. #define IDirectDrawSurface7_ReleaseDC(p,a)               (p)->ReleaseDC(a)
  2005. #define IDirectDrawSurface7_Restore(p)                   (p)->Restore()
  2006. #define IDirectDrawSurface7_SetClipper(p,a)              (p)->SetClipper(a)
  2007. #define IDirectDrawSurface7_SetColorKey(p,a,b)           (p)->SetColorKey(a,b)
  2008. #define IDirectDrawSurface7_SetOverlayPosition(p,a,b)    (p)->SetOverlayPosition(a,b)
  2009. #define IDirectDrawSurface7_SetPalette(p,a)              (p)->SetPalette(a)
  2010. #define IDirectDrawSurface7_Unlock(p,b)                  (p)->Unlock(b)
  2011. #define IDirectDrawSurface7_UpdateOverlay(p,a,b,c,d,e)   (p)->UpdateOverlay(a,b,c,d,e)
  2012. #define IDirectDrawSurface7_UpdateOverlayDisplay(p,a)    (p)->UpdateOverlayDisplay(a)
  2013. #define IDirectDrawSurface7_UpdateOverlayZOrder(p,a,b)   (p)->UpdateOverlayZOrder(a,b)
  2014. #define IDirectDrawSurface7_GetDDInterface(p,a)          (p)->GetDDInterface(a)
  2015. #define IDirectDrawSurface7_PageLock(p,a)                (p)->PageLock(a)
  2016. #define IDirectDrawSurface7_PageUnlock(p,a)              (p)->PageUnlock(a)
  2017. #define IDirectDrawSurface7_SetSurfaceDesc(p,a,b)        (p)->SetSurfaceDesc(a,b)
  2018. #define IDirectDrawSurface7_SetPrivateData(p,a,b,c,d)    (p)->SetPrivateData(a,b,c,d)
  2019. #define IDirectDrawSurface7_GetPrivateData(p,a,b,c)      (p)->GetPrivateData(a,b,c)
  2020. #define IDirectDrawSurface7_FreePrivateData(p,a)         (p)->FreePrivateData(a)
  2021. #define IDirectDrawSurface7_GetUniquenessValue(p, a)     (p)->GetUniquenessValue(a)
  2022. #define IDirectDrawSurface7_ChangeUniquenessValue(p)     (p)->ChangeUniquenessValue()
  2023. #define IDirectDrawSurface7_SetPriority(p,a)             (p)->SetPriority(a)
  2024. #define IDirectDrawSurface7_GetPriority(p,a)             (p)->GetPriority(a)
  2025. #define IDirectDrawSurface7_SetLOD(p,a)                  (p)->SetLOD(a)
  2026. #define IDirectDrawSurface7_GetLOD(p,a)                  (p)->GetLOD(a)
  2027. #endif
  2028. /*
  2029.  * IDirectDrawColorControl
  2030.  */
  2031. #if defined( _WIN32 ) && !defined( _NO_COM )
  2032. #undef INTERFACE
  2033. #define INTERFACE IDirectDrawColorControl
  2034. DECLARE_INTERFACE_( IDirectDrawColorControl, IUnknown )
  2035. {
  2036.     /*** IUnknown methods ***/
  2037.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  2038.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  2039.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  2040.     /*** IDirectDrawColorControl methods ***/
  2041.     STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL) PURE;
  2042.     STDMETHOD(SetColorControls)(THIS_ LPDDCOLORCONTROL) PURE;
  2043. };
  2044. #if !defined(__cplusplus) || defined(CINTERFACE)
  2045. #define IDirectDrawColorControl_QueryInterface(p, a, b)  (p)->lpVtbl->QueryInterface(p, a, b)
  2046. #define IDirectDrawColorControl_AddRef(p)                (p)->lpVtbl->AddRef(p)
  2047. #define IDirectDrawColorControl_Release(p)               (p)->lpVtbl->Release(p)
  2048. #define IDirectDrawColorControl_GetColorControls(p, a)   (p)->lpVtbl->GetColorControls(p, a)
  2049. #define IDirectDrawColorControl_SetColorControls(p, a)   (p)->lpVtbl->SetColorControls(p, a)
  2050. #else
  2051. #define IDirectDrawColorControl_QueryInterface(p, a, b)  (p)->QueryInterface(a, b)
  2052. #define IDirectDrawColorControl_AddRef(p)                (p)->AddRef()
  2053. #define IDirectDrawColorControl_Release(p)               (p)->Release()
  2054. #define IDirectDrawColorControl_GetColorControls(p, a)   (p)->GetColorControls(a)
  2055. #define IDirectDrawColorControl_SetColorControls(p, a)   (p)->SetColorControls(a)
  2056. #endif
  2057. #endif
  2058. /*
  2059.  * IDirectDrawGammaControl
  2060.  */
  2061. #if defined( _WIN32 ) && !defined( _NO_COM )
  2062. #undef INTERFACE
  2063. #define INTERFACE IDirectDrawGammaControl
  2064. DECLARE_INTERFACE_( IDirectDrawGammaControl, IUnknown )
  2065. {
  2066.     /*** IUnknown methods ***/
  2067.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  2068.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  2069.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  2070.     /*** IDirectDrawGammaControl methods ***/
  2071.     STDMETHOD(GetGammaRamp)(THIS_ DWORD, LPDDGAMMARAMP) PURE;
  2072.     STDMETHOD(SetGammaRamp)(THIS_ DWORD, LPDDGAMMARAMP) PURE;
  2073. };
  2074. #if !defined(__cplusplus) || defined(CINTERFACE)
  2075. #define IDirectDrawGammaControl_QueryInterface(p, a, b)  (p)->lpVtbl->QueryInterface(p, a, b)
  2076. #define IDirectDrawGammaControl_AddRef(p)                (p)->lpVtbl->AddRef(p)
  2077. #define IDirectDrawGammaControl_Release(p)               (p)->lpVtbl->Release(p)
  2078. #define IDirectDrawGammaControl_GetGammaRamp(p, a, b)    (p)->lpVtbl->GetGammaRamp(p, a, b)
  2079. #define IDirectDrawGammaControl_SetGammaRamp(p, a, b)    (p)->lpVtbl->SetGammaRamp(p, a, b)
  2080. #else
  2081. #define IDirectDrawGammaControl_QueryInterface(p, a, b)  (p)->QueryInterface(a, b)
  2082. #define IDirectDrawGammaControl_AddRef(p)                (p)->AddRef()
  2083. #define IDirectDrawGammaControl_Release(p)               (p)->Release()
  2084. #define IDirectDrawGammaControl_GetGammaRamp(p, a, b)    (p)->GetGammaRamp(a, b)
  2085. #define IDirectDrawGammaControl_SetGammaRamp(p, a, b)    (p)->SetGammaRamp(a, b)
  2086. #endif
  2087. #endif
  2088. #endif
  2089. /*
  2090.  * DDSURFACEDESC
  2091.  */
  2092. typedef struct _DDSURFACEDESC
  2093. {
  2094.     DWORD               dwSize;                 // size of the DDSURFACEDESC structure
  2095.     DWORD               dwFlags;                // determines what fields are valid
  2096.     DWORD               dwHeight;               // height of surface to be created
  2097.     DWORD               dwWidth;                // width of input surface
  2098.     union
  2099.     {
  2100.         LONG            lPitch;                 // distance to start of next line (return value only)
  2101.         DWORD           dwLinearSize;           // Formless late-allocated optimized surface size
  2102.     } DUMMYUNIONNAMEN(1);
  2103.     DWORD               dwBackBufferCount;      // number of back buffers requested
  2104.     union
  2105.     {
  2106.         DWORD           dwMipMapCount;          // number of mip-map levels requested
  2107.         DWORD           dwZBufferBitDepth;      // depth of Z buffer requested
  2108.         DWORD           dwRefreshRate;          // refresh rate (used when display mode is described)
  2109.     } DUMMYUNIONNAMEN(2);
  2110.     DWORD               dwAlphaBitDepth;        // depth of alpha buffer requested
  2111.     DWORD               dwReserved;             // reserved
  2112.     LPVOID              lpSurface;              // pointer to the associated surface memory
  2113.     DDCOLORKEY          ddckCKDestOverlay;      // color key for destination overlay use
  2114.     DDCOLORKEY          ddckCKDestBlt;          // color key for destination blt use
  2115.     DDCOLORKEY          ddckCKSrcOverlay;       // color key for source overlay use
  2116.     DDCOLORKEY          ddckCKSrcBlt;           // color key for source blt use
  2117.     DDPIXELFORMAT       ddpfPixelFormat;        // pixel format description of the surface
  2118.     DDSCAPS             ddsCaps;                // direct draw surface capabilities
  2119. } DDSURFACEDESC;
  2120. /*
  2121.  * DDSURFACEDESC2
  2122.  */
  2123. typedef struct _DDSURFACEDESC2
  2124. {
  2125.     DWORD               dwSize;                 // size of the DDSURFACEDESC structure
  2126.     DWORD               dwFlags;                // determines what fields are valid
  2127.     DWORD               dwHeight;               // height of surface to be created
  2128.     DWORD               dwWidth;                // width of input surface
  2129.     union
  2130.     {
  2131.         LONG            lPitch;                 // distance to start of next line (return value only)
  2132.         DWORD           dwLinearSize;           // Formless late-allocated optimized surface size
  2133.     } DUMMYUNIONNAMEN(1);
  2134.     union
  2135.     {
  2136.         DWORD           dwBackBufferCount;      // number of back buffers requested
  2137.         DWORD           dwDepth;                // the depth if this is a volume texture 
  2138.     } DUMMYUNIONNAMEN(5);
  2139.     union
  2140.     {
  2141.         DWORD           dwMipMapCount;          // number of mip-map levels requestde
  2142.                                                 // dwZBufferBitDepth removed, use ddpfPixelFormat one instead
  2143.         DWORD           dwRefreshRate;          // refresh rate (used when display mode is described)
  2144.         DWORD           dwSrcVBHandle;          // The source used in VB::Optimize
  2145.     } DUMMYUNIONNAMEN(2);
  2146.     DWORD               dwAlphaBitDepth;        // depth of alpha buffer requested
  2147.     DWORD               dwReserved;             // reserved
  2148.     LPVOID              lpSurface;              // pointer to the associated surface memory
  2149.     union
  2150.     {
  2151.         DDCOLORKEY      ddckCKDestOverlay;      // color key for destination overlay use
  2152.         DWORD           dwEmptyFaceColor;       // Physical color for empty cubemap faces
  2153.     } DUMMYUNIONNAMEN(3);
  2154.     DDCOLORKEY          ddckCKDestBlt;          // color key for destination blt use
  2155.     DDCOLORKEY          ddckCKSrcOverlay;       // color key for source overlay use
  2156.     DDCOLORKEY          ddckCKSrcBlt;           // color key for source blt use
  2157.     union
  2158.     {
  2159.         DDPIXELFORMAT   ddpfPixelFormat;        // pixel format description of the surface
  2160.         DWORD           dwFVF;                  // vertex format description of vertex buffers
  2161.     } DUMMYUNIONNAMEN(4);
  2162.     DDSCAPS2            ddsCaps;                // direct draw surface capabilities
  2163.     DWORD               dwTextureStage;         // stage in multitexture cascade
  2164. } DDSURFACEDESC2;
  2165. /*
  2166.  * ddsCaps field is valid.
  2167.  */
  2168. #define DDSD_CAPS               0x00000001l     // default
  2169. /*
  2170.  * dwHeight field is valid.
  2171.  */
  2172. #define DDSD_HEIGHT             0x00000002l
  2173. /*
  2174.  * dwWidth field is valid.
  2175.  */
  2176. #define DDSD_WIDTH              0x00000004l
  2177. /*
  2178.  * lPitch is valid.
  2179.  */
  2180. #define DDSD_PITCH              0x00000008l
  2181. /*
  2182.  * dwBackBufferCount is valid.
  2183.  */
  2184. #define DDSD_BACKBUFFERCOUNT    0x00000020l
  2185. /*
  2186.  * dwZBufferBitDepth is valid.  (shouldnt be used in DDSURFACEDESC2)
  2187.  */
  2188. #define DDSD_ZBUFFERBITDEPTH    0x00000040l
  2189. /*
  2190.  * dwAlphaBitDepth is valid.
  2191.  */
  2192. #define DDSD_ALPHABITDEPTH      0x00000080l
  2193. /*
  2194.  * lpSurface is valid.
  2195.  */
  2196. #define DDSD_LPSURFACE          0x00000800l
  2197. /*
  2198.  * ddpfPixelFormat is valid.
  2199.  */
  2200. #define DDSD_PIXELFORMAT        0x00001000l
  2201. /*
  2202.  * ddckCKDestOverlay is valid.
  2203.  */
  2204. #define DDSD_CKDESTOVERLAY      0x00002000l
  2205. /*
  2206.  * ddckCKDestBlt is valid.
  2207.  */
  2208. #define DDSD_CKDESTBLT          0x00004000l
  2209. /*
  2210.  * ddckCKSrcOverlay is valid.
  2211.  */
  2212. #define DDSD_CKSRCOVERLAY       0x00008000l
  2213. /*
  2214.  * ddckCKSrcBlt is valid.
  2215.  */
  2216. #define DDSD_CKSRCBLT           0x00010000l
  2217. /*
  2218.  * dwMipMapCount is valid.
  2219.  */
  2220. #define DDSD_MIPMAPCOUNT        0x00020000l
  2221.  /*
  2222.   * dwRefreshRate is valid
  2223.   */
  2224. #define DDSD_REFRESHRATE        0x00040000l
  2225. /*
  2226.  * dwLinearSize is valid
  2227.  */
  2228. #define DDSD_LINEARSIZE         0x00080000l
  2229. /*
  2230.  * dwTextureStage is valid
  2231.  */
  2232. #define DDSD_TEXTURESTAGE       0x00100000l
  2233. /*
  2234.  * dwFVF is valid
  2235.  */
  2236. #define DDSD_FVF                0x00200000l
  2237. /*
  2238.  * dwSrcVBHandle is valid
  2239.  */
  2240. #define DDSD_SRCVBHANDLE        0x00400000l
  2241. /*
  2242.  * dwDepth is valid
  2243.  */
  2244. #define DDSD_DEPTH              0x00800000l
  2245. /*
  2246.  * All input fields are valid.
  2247.  */
  2248. #define DDSD_ALL                0x00fff9eel
  2249. /*
  2250.  * DDOPTSURFACEDESC
  2251.  */
  2252. typedef struct _DDOPTSURFACEDESC
  2253. {
  2254.     DWORD       dwSize;             // size of the DDOPTSURFACEDESC structure
  2255.     DWORD       dwFlags;            // determines what fields are valid
  2256.     DDSCAPS2    ddSCaps;            // Common caps like: Memory type
  2257.     DDOSCAPS    ddOSCaps;           // Common caps like: Memory type
  2258.     GUID        guid;               // Compression technique GUID
  2259.     DWORD       dwCompressionRatio; // Compression ratio
  2260. } DDOPTSURFACEDESC;
  2261. /*
  2262.  * guid field is valid.
  2263.  */
  2264. #define DDOSD_GUID                  0x00000001l
  2265. /*
  2266.  * dwCompressionRatio field is valid.
  2267.  */
  2268. #define DDOSD_COMPRESSION_RATIO     0x00000002l
  2269. /*
  2270.  * ddSCaps field is valid.
  2271.  */
  2272. #define DDOSD_SCAPS                 0x00000004l
  2273. /*
  2274.  * ddOSCaps field is valid.
  2275.  */
  2276. #define DDOSD_OSCAPS                0x00000008l
  2277. /*
  2278.  * All input fields are valid.
  2279.  */
  2280. #define DDOSD_ALL                   0x0000000fl
  2281. /*
  2282.  * The surface's optimized pixelformat is compressed
  2283.  */
  2284. #define DDOSDCAPS_OPTCOMPRESSED                 0x00000001l
  2285. /*
  2286.  * The surface's optimized pixelformat is reordered
  2287.  */
  2288. #define DDOSDCAPS_OPTREORDERED                  0x00000002l
  2289. /*
  2290.  * The opt surface is a monolithic mipmap
  2291.  */
  2292. #define DDOSDCAPS_MONOLITHICMIPMAP              0x00000004l
  2293. /*
  2294.  * The valid Surf caps:
  2295.  * #define DDSCAPS_SYSTEMMEMORY                 0x00000800l
  2296.  * #define DDSCAPS_VIDEOMEMORY          0x00004000l
  2297.  * #define DDSCAPS_LOCALVIDMEM          0x10000000l
  2298.  * #define DDSCAPS_NONLOCALVIDMEM       0x20000000l
  2299.  */
  2300. #define DDOSDCAPS_VALIDSCAPS            0x30004800l
  2301. /*
  2302.  * The valid OptSurf caps
  2303.  */
  2304. #define DDOSDCAPS_VALIDOSCAPS           0x00000007l
  2305. /*
  2306.  * DDCOLORCONTROL
  2307.  */
  2308. typedef struct _DDCOLORCONTROL
  2309. {
  2310.     DWORD               dwSize;
  2311.     DWORD               dwFlags;
  2312.     LONG                lBrightness;
  2313.     LONG                lContrast;
  2314.     LONG                lHue;
  2315.     LONG                lSaturation;
  2316.     LONG                lSharpness;
  2317.     LONG                lGamma;
  2318.     LONG                lColorEnable;
  2319.     DWORD               dwReserved1;
  2320. } DDCOLORCONTROL;
  2321. /*
  2322.  * lBrightness field is valid.
  2323.  */
  2324. #define DDCOLOR_BRIGHTNESS              0x00000001l
  2325. /*
  2326.  * lContrast field is valid.
  2327.  */
  2328. #define DDCOLOR_CONTRAST                0x00000002l
  2329. /*
  2330.  * lHue field is valid.
  2331.  */
  2332. #define DDCOLOR_HUE                     0x00000004l
  2333. /*
  2334.  * lSaturation field is valid.
  2335.  */
  2336. #define DDCOLOR_SATURATION              0x00000008l
  2337. /*
  2338.  * lSharpness field is valid.
  2339.  */
  2340. #define DDCOLOR_SHARPNESS               0x00000010l
  2341. /*
  2342.  * lGamma field is valid.
  2343.  */
  2344. #define DDCOLOR_GAMMA                   0x00000020l
  2345. /*
  2346.  * lColorEnable field is valid.
  2347.  */
  2348. #define DDCOLOR_COLORENABLE             0x00000040l
  2349. /*============================================================================
  2350.  *
  2351.  * Direct Draw Capability Flags
  2352.  *
  2353.  * These flags are used to describe the capabilities of a given Surface.
  2354.  * All flags are bit flags.
  2355.  *
  2356.  *==========================================================================*/
  2357. /****************************************************************************
  2358.  *
  2359.  * DIRECTDRAWSURFACE CAPABILITY FLAGS
  2360.  *
  2361.  ****************************************************************************/
  2362. /*
  2363.  * This bit is reserved. It should not be specified.
  2364.  */
  2365. #define DDSCAPS_RESERVED1                       0x00000001l
  2366. /*
  2367.  * Indicates that this surface contains alpha-only information.
  2368.  * (To determine if a surface is RGBA/YUVA, the pixel format must be
  2369.  * interrogated.)
  2370.  */
  2371. #define DDSCAPS_ALPHA                           0x00000002l
  2372. /*
  2373.  * Indicates that this surface is a backbuffer.  It is generally
  2374.  * set by CreateSurface when the DDSCAPS_FLIP capability bit is set.
  2375.  * It indicates that this surface is THE back buffer of a surface
  2376.  * flipping structure.  DirectDraw supports N surfaces in a
  2377.  * surface flipping structure.  Only the surface that immediately
  2378.  * precedeces the DDSCAPS_FRONTBUFFER has this capability bit set.
  2379.  * The other surfaces are identified as back buffers by the presence
  2380.  * of the DDSCAPS_FLIP capability, their attachment order, and the
  2381.  * absence of the DDSCAPS_FRONTBUFFER and DDSCAPS_BACKBUFFER
  2382.  * capabilities.  The bit is sent to CreateSurface when a standalone
  2383.  * back buffer is being created.  This surface could be attached to
  2384.  * a front buffer and/or back buffers to form a flipping surface
  2385.  * structure after the CreateSurface call.  See AddAttachments for
  2386.  * a detailed description of the behaviors in this case.
  2387.  */
  2388. #define DDSCAPS_BACKBUFFER                      0x00000004l
  2389. /*
  2390.  * Indicates a complex surface structure is being described.  A
  2391.  * complex surface structure results in the creation of more than
  2392.  * one surface.  The additional surfaces are attached to the root
  2393.  * surface.  The complex structure can only be destroyed by
  2394.  * destroying the root.
  2395.  */
  2396. #define DDSCAPS_COMPLEX                         0x00000008l
  2397. /*
  2398.  * Indicates that this surface is a part of a surface flipping structure.
  2399.  * When it is passed to CreateSurface the DDSCAPS_FRONTBUFFER and
  2400.  * DDSCAP_BACKBUFFER bits are not set.  They are set by CreateSurface
  2401.  * on the resulting creations.  The dwBackBufferCount field in the
  2402.  * DDSURFACEDESC structure must be set to at least 1 in order for
  2403.  * the CreateSurface call to succeed.  The DDSCAPS_COMPLEX capability
  2404.  * must always be set with creating multiple surfaces through CreateSurface.
  2405.  */
  2406. #define DDSCAPS_FLIP                            0x00000010l
  2407. /*
  2408.  * Indicates that this surface is THE front buffer of a surface flipping
  2409.  * structure.  It is generally set by CreateSurface when the DDSCAPS_FLIP
  2410.  * capability bit is set.
  2411.  * If this capability is sent to CreateSurface then a standalonw front buffer
  2412.  * is created.  This surface will not have the DDSCAPS_FLIP capability.
  2413.  * It can be attached to other back buffers to form a flipping structure.
  2414.  * See AddAttachments for a detailed description of the behaviors in this
  2415.  * case.
  2416.  */
  2417. #define DDSCAPS_FRONTBUFFER                     0x00000020l
  2418. /*
  2419.  * Indicates that this surface is any offscreen surface that is not an overlay,
  2420.  * texture, zbuffer, front buffer, back buffer, or alpha surface.  It is used
  2421.  * to identify plain vanilla surfaces.
  2422.  */
  2423. #define DDSCAPS_OFFSCREENPLAIN                  0x00000040l
  2424. /*
  2425.  * Indicates that this surface is an overlay.  It may or may not be directly visible
  2426.  * depending on whether or not it is currently being overlayed onto the primary
  2427.  * surface.  DDSCAPS_VISIBLE can be used to determine whether or not it is being
  2428.  * overlayed at the moment.
  2429.  */
  2430. #define DDSCAPS_OVERLAY                         0x00000080l
  2431. /*
  2432.  * Indicates that unique DirectDrawPalette objects can be created and
  2433.  * attached to this surface.
  2434.  */
  2435. #define DDSCAPS_PALETTE                         0x00000100l
  2436. /*
  2437.  * Indicates that this surface is the primary surface.  The primary
  2438.  * surface represents what the user is seeing at the moment.
  2439.  */
  2440. #define DDSCAPS_PRIMARYSURFACE                  0x00000200l
  2441. /*
  2442.  * This flag used to be DDSCAPS_PRIMARYSURFACELEFT, which is now
  2443.  * obsolete.
  2444.  */
  2445. #define DDSCAPS_RESERVED3               0x00000400l
  2446. #define DDSCAPS_PRIMARYSURFACELEFT              0x00000000l
  2447. /*
  2448.  * Indicates that this surface memory was allocated in system memory
  2449.  */
  2450. #define DDSCAPS_SYSTEMMEMORY                    0x00000800l
  2451. /*
  2452.  * Indicates that this surface can be used as a 3D texture.  It does not
  2453.  * indicate whether or not the surface is being used for that purpose.
  2454.  */
  2455. #define DDSCAPS_TEXTURE                         0x00001000l
  2456. /*
  2457.  * Indicates that a surface may be a destination for 3D rendering.  This
  2458.  * bit must be set in order to query for a Direct3D Device Interface
  2459.  * from this surface.
  2460.  */
  2461. #define DDSCAPS_3DDEVICE                        0x00002000l
  2462. /*
  2463.  * Indicates that this surface exists in video memory.
  2464.  */
  2465. #define DDSCAPS_VIDEOMEMORY                     0x00004000l
  2466. /*
  2467.  * Indicates that changes made to this surface are immediately visible.
  2468.  * It is always set for the primary surface and is set for overlays while
  2469.  * they are being overlayed and texture maps while they are being textured.
  2470.  */
  2471. #define DDSCAPS_VISIBLE                         0x00008000l
  2472. /*
  2473.  * Indicates that only writes are permitted to the surface.  Read accesses
  2474.  * from the surface may or may not generate a protection fault, but the
  2475.  * results of a read from this surface will not be meaningful.  READ ONLY.
  2476.  */
  2477. #define DDSCAPS_WRITEONLY                       0x00010000l
  2478. /*
  2479.  * Indicates that this surface is a z buffer. A z buffer does not contain
  2480.  * displayable information.  Instead it contains bit depth information that is
  2481.  * used to determine which pixels are visible and which are obscured.
  2482.  */
  2483. #define DDSCAPS_ZBUFFER                         0x00020000l
  2484. /*
  2485.  * Indicates surface will have a DC associated long term
  2486.  */
  2487. #define DDSCAPS_OWNDC                           0x00040000l
  2488. /*
  2489.  * Indicates surface should be able to receive live video
  2490.  */
  2491. #define DDSCAPS_LIVEVIDEO                       0x00080000l
  2492. /*
  2493.  * Indicates surface should be able to have a stream decompressed
  2494.  * to it by the hardware.
  2495.  */
  2496. #define DDSCAPS_HWCODEC                         0x00100000l
  2497. /*
  2498.  * Surface is a ModeX surface.
  2499.  *
  2500.  */
  2501. #define DDSCAPS_MODEX                           0x00200000l
  2502. /*
  2503.  * Indicates surface is one level of a mip-map. This surface will
  2504.  * be attached to other DDSCAPS_MIPMAP surfaces to form the mip-map.
  2505.  * This can be done explicitly, by creating a number of surfaces and
  2506.  * attaching them with AddAttachedSurface or by implicitly by CreateSurface.
  2507.  * If this bit is set then DDSCAPS_TEXTURE must also be set.
  2508.  */
  2509. #define DDSCAPS_MIPMAP                          0x00400000l
  2510. /*
  2511.  * This bit is reserved. It should not be specified.
  2512.  */
  2513. #define DDSCAPS_RESERVED2                       0x00800000l
  2514. /*
  2515.  * Indicates that memory for the surface is not allocated until the surface
  2516.  * is loaded (via the Direct3D texture Load() function).
  2517.  */
  2518. #define DDSCAPS_ALLOCONLOAD                     0x04000000l
  2519. /*
  2520.  * Indicates that the surface will recieve data from a video port.
  2521.  */
  2522. #define DDSCAPS_VIDEOPORT                       0x08000000l
  2523. /*
  2524.  * Indicates that a video memory surface is resident in true, local video
  2525.  * memory rather than non-local video memory. If this flag is specified then
  2526.  * so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with
  2527.  * DDSCAPS_NONLOCALVIDMEM.
  2528.  */
  2529. #define DDSCAPS_LOCALVIDMEM                     0x10000000l
  2530. /*
  2531.  * Indicates that a video memory surface is resident in non-local video
  2532.  * memory rather than true, local video memory. If this flag is specified
  2533.  * then so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with
  2534.  * DDSCAPS_LOCALVIDMEM.
  2535.  */
  2536. #define DDSCAPS_NONLOCALVIDMEM                  0x20000000l
  2537. /*
  2538.  * Indicates that this surface is a standard VGA mode surface, and not a
  2539.  * ModeX surface. (This flag will never be set in combination with the
  2540.  * DDSCAPS_MODEX flag).
  2541.  */
  2542. #define DDSCAPS_STANDARDVGAMODE                 0x40000000l
  2543. /*
  2544.  * Indicates that this surface will be an optimized surface. This flag is
  2545.  * currently only valid in conjunction with the DDSCAPS_TEXTURE flag. The surface
  2546.  * will be created without any underlying video memory until loaded.
  2547.  */
  2548. #define DDSCAPS_OPTIMIZED                       0x80000000l
  2549. /*
  2550.  * This bit is reserved
  2551.  */
  2552. #define DDSCAPS2_RESERVED4                      0x00000002L
  2553. #define DDSCAPS2_HARDWAREDEINTERLACE            0x00000000L
  2554. /*
  2555.  * Indicates to the driver that this surface will be locked very frequently
  2556.  * (for procedural textures, dynamic lightmaps, etc). Surfaces with this cap
  2557.  * set must also have DDSCAPS_TEXTURE. This cap cannot be used with
  2558.  * DDSCAPS2_HINTSTATIC and DDSCAPS2_OPAQUE.
  2559.  */
  2560. #define DDSCAPS2_HINTDYNAMIC                    0x00000004L
  2561. /*
  2562.  * Indicates to the driver that this surface can be re-ordered/retiled on
  2563.  * load. This operation will not change the size of the texture. It is
  2564.  * relatively fast and symmetrical, since the application may lock these
  2565.  * bits (although it will take a performance hit when doing so). Surfaces
  2566.  * with this cap set must also have DDSCAPS_TEXTURE. This cap cannot be
  2567.  * used with DDSCAPS2_HINTDYNAMIC and DDSCAPS2_OPAQUE.
  2568.  */
  2569. #define DDSCAPS2_HINTSTATIC                     0x00000008L
  2570. /*
  2571.  * Indicates that the client would like this texture surface to be managed by the
  2572.  * DirectDraw/Direct3D runtime. Surfaces with this cap set must also have
  2573.  * DDSCAPS_TEXTURE set.
  2574.  */
  2575. #define DDSCAPS2_TEXTUREMANAGE                  0x00000010L
  2576. /*
  2577.  * These bits are reserved for internal use */
  2578. #define DDSCAPS2_RESERVED1                      0x00000020L
  2579. #define DDSCAPS2_RESERVED2                      0x00000040L
  2580. /*
  2581.  * Indicates to the driver that this surface will never be locked again.
  2582.  * The driver is free to optimize this surface via retiling and actual compression.
  2583.  * All calls to Lock() or Blts from this surface will fail. Surfaces with this
  2584.  * cap set must also have DDSCAPS_TEXTURE. This cap cannot be used with
  2585.  * DDSCAPS2_HINTDYNAMIC and DDSCAPS2_HINTSTATIC.
  2586.  */
  2587. #define DDSCAPS2_OPAQUE                         0x00000080L
  2588. /*
  2589.  * Applications should set this bit at CreateSurface time to indicate that they
  2590.  * intend to use antialiasing. Only valid if DDSCAPS_3DDEVICE is also set.
  2591.  */
  2592. #define DDSCAPS2_HINTANTIALIASING               0x00000100L
  2593. /*
  2594.  * This flag is used at CreateSurface time to indicate that this set of
  2595.  * surfaces is a cubic environment map
  2596.  */
  2597. #define DDSCAPS2_CUBEMAP                        0x00000200L
  2598. /*
  2599.  * These flags preform two functions:
  2600.  * - At CreateSurface time, they define which of the six cube faces are
  2601.  *   required by the application.
  2602.  * - After creation, each face in the cubemap will have exactly one of these
  2603.  *   bits set.
  2604.  */
  2605. #define DDSCAPS2_CUBEMAP_POSITIVEX              0x00000400L
  2606. #define DDSCAPS2_CUBEMAP_NEGATIVEX              0x00000800L
  2607. #define DDSCAPS2_CUBEMAP_POSITIVEY              0x00001000L
  2608. #define DDSCAPS2_CUBEMAP_NEGATIVEY              0x00002000L
  2609. #define DDSCAPS2_CUBEMAP_POSITIVEZ              0x00004000L
  2610. #define DDSCAPS2_CUBEMAP_NEGATIVEZ              0x00008000L
  2611. /*
  2612.  * This macro may be used to specify all faces of a cube map at CreateSurface time
  2613.  */
  2614. #define DDSCAPS2_CUBEMAP_ALLFACES ( DDSCAPS2_CUBEMAP_POSITIVEX |
  2615.                                     DDSCAPS2_CUBEMAP_NEGATIVEX |
  2616.                                     DDSCAPS2_CUBEMAP_POSITIVEY |
  2617.                                     DDSCAPS2_CUBEMAP_NEGATIVEY |
  2618.                                     DDSCAPS2_CUBEMAP_POSITIVEZ |
  2619.                                     DDSCAPS2_CUBEMAP_NEGATIVEZ )
  2620. /*
  2621.  * This flag is an additional flag which is present on mipmap sublevels from DX7 onwards
  2622.  * It enables easier use of GetAttachedSurface rather than EnumAttachedSurfaces for surface
  2623.  * constructs such as Cube Maps, wherein there are more than one mipmap surface attached
  2624.  * to the root surface.
  2625.  * This caps bit is ignored by CreateSurface
  2626.  */