PageRenderTime 67ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 2ms

/common/dx9/include/ddraw.h

https://bitbucket.org/ayufan/ayuine2b
C Header | 5792 lines | 2442 code | 768 blank | 2582 comment | 30 complexity | 209238b7eba186d89ce68d626fa25e5a MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  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(Ini

Large files files are truncated, but you can click here to view the full file