/packages/ptc/src/win32/directx/p_ddraw.pp

https://github.com/slibre/freepascal · Puppet · 5259 lines · 4867 code · 361 blank · 31 comment · 275 complexity · 8d08739756d3642ddbd99cc70dfc0c85 MD5 · raw file

Large files are truncated 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. unit p_ddraw;
  10. {$MODE objfpc}{$H+}
  11. {$MACRO on}
  12. {$PACKRECORDS c}
  13. {$MODESWITCH NESTEDCOMMENTS-}
  14. {$DEFINE DIRECTDRAW_DYNAMIC_LINK}
  15. interface
  16. uses
  17. windows;
  18. {#ifndef __DDRAW_INCLUDED__
  19. #define __DDRAW_INCLUDED__
  20. //Disable the nameless union warning when building internally
  21. #undef ENABLE_NAMELESS_UNION_PRAGMA
  22. #ifdef DIRECTX_REDIST
  23. #define ENABLE_NAMELESS_UNION_PRAGMA
  24. #endif
  25. #ifdef ENABLE_NAMELESS_UNION_PRAGMA
  26. #pragma warning(disable:4201)
  27. #endif}
  28. (*
  29. * If you wish an application built against the newest version of DirectDraw
  30. * to run against an older DirectDraw run time then define DIRECTDRAW_VERSION
  31. * to be the earlies version of DirectDraw you wish to run against. For,
  32. * example if you wish an application to run against a DX 3 runtime define
  33. * DIRECTDRAW_VERSION to be 0x0300.
  34. *)
  35. {$IFNDEF DIRECTDRAW_VERSION}
  36. {$DEFINE DIRECTDRAW_VERSION:=$0700}
  37. {$ENDIF} //#endif /* DIRECTDRAW_VERSION */
  38. {#if defined( _WIN32 ) && !defined( _NO_COM )
  39. #define COM_NO_WINDOWS_H
  40. #include <objbase.h>
  41. #else
  42. #define IUnknown void
  43. #if !defined( NT_BUILD_ENVIRONMENT ) && !defined(WINNT)
  44. #define CO_E_NOTINITIALIZED 0x800401F0L
  45. #endif
  46. #endif}
  47. const
  48. _FACDD = $876;
  49. //#define _FACDD 0x876
  50. //#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
  51. //#ifdef __cplusplus
  52. //extern "C" {
  53. //#endif
  54. //
  55. // For compilers that don't support nameless unions, do a
  56. //
  57. // #define NONAMELESSUNION
  58. //
  59. // before #include <ddraw.h>
  60. //
  61. {#ifndef DUMMYUNIONNAMEN
  62. #if defined(__cplusplus) || !defined(NONAMELESSUNION)
  63. #define DUMMYUNIONNAMEN(n)
  64. #else
  65. #define DUMMYUNIONNAMEN(n) u##n
  66. #endif
  67. #endif}
  68. {#ifndef MAKEFOURCC
  69. #define MAKEFOURCC(ch0, ch1, ch2, ch3) \
  70. ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
  71. ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
  72. #endif //defined(MAKEFOURCC)}
  73. (*
  74. * FOURCC codes for DX compressed-texture pixel formats
  75. *)
  76. const
  77. FOURCC_DXT1 = Ord('D') or (Ord('X') shl 8) or (Ord('T') shl 16) or (Ord('1') shl 24);
  78. FOURCC_DXT2 = Ord('D') or (Ord('X') shl 8) or (Ord('T') shl 16) or (Ord('2') shl 24);
  79. FOURCC_DXT3 = Ord('D') or (Ord('X') shl 8) or (Ord('T') shl 16) or (Ord('3') shl 24);
  80. FOURCC_DXT4 = Ord('D') or (Ord('X') shl 8) or (Ord('T') shl 16) or (Ord('4') shl 24);
  81. FOURCC_DXT5 = Ord('D') or (Ord('X') shl 8) or (Ord('T') shl 16) or (Ord('5') shl 24);
  82. (*
  83. * GUIDS used by DirectDraw objects
  84. *)
  85. //#if defined( _WIN32 ) && !defined( _NO_COM )
  86. const
  87. CLSID_DirectDraw: TGuid = '{D7B70EE0-4340-11CF-B063-0020AFC2CD35}';
  88. CLSID_DirectDraw7: TGuid = '{3c305196-50db-11d3-9cfe-00c04fd930c5}';
  89. CLSID_DirectDrawClipper: TGuid = '{593817A0-7DB3-11CF-A2DE-00AA00b93356}';
  90. IID_IDirectDraw: TGuid = '{6C14DB80-A733-11CE-A521-0020AF0BE560}';
  91. IID_IDirectDraw2: TGuid = '{B3A6F3E0-2B43-11CF-A2DE-00AA00B93356}';
  92. IID_IDirectDraw4: TGuid = '{9c59509a-39bd-11d1-8c4a-00c04fd930c5}';
  93. IID_IDirectDraw7: TGuid = '{15e65ec0-3b9c-11d2-b92f-00609797ea5b}';
  94. IID_IDirectDrawSurface: TGuid = '{6C14DB81-A733-11CE-A521-0020AF0BE560}';
  95. IID_IDirectDrawSurface2: TGuid = '{57805885-6eec-11cf-9441-a82303c10e27}';
  96. IID_IDirectDrawSurface3: TGuid = '{DA044E00-69B2-11D0-A1D5-00AA00B8DFBB}';
  97. IID_IDirectDrawSurface4: TGuid = '{0B2B8630-AD35-11D0-8EA6-00609797EA5B}';
  98. IID_IDirectDrawSurface7: TGuid = '{06675a80-3b9b-11d2-b92f-00609797ea5b}';
  99. IID_IDirectDrawPalette: TGuid = '{6C14DB84-A733-11CE-A521-0020AF0BE560}';
  100. IID_IDirectDrawClipper: TGuid = '{6C14DB85-A733-11CE-A521-0020AF0BE560}';
  101. IID_IDirectDrawColorControl: TGuid = '{4B9F0EE0-0D7E-11D0-9B06-00A0C903A3B8}';
  102. IID_IDirectDrawGammaControl: TGuid = '{69C11C3E-B46B-11D1-AD7A-00C04FC29B4E}';
  103. //#endif
  104. (*============================================================================
  105. *
  106. * DirectDraw Structures
  107. *
  108. * Various structures used to invoke DirectDraw.
  109. *
  110. *==========================================================================*)
  111. {struct IDirectDraw;
  112. struct IDirectDrawSurface;
  113. struct IDirectDrawPalette;
  114. struct IDirectDrawClipper;}
  115. {typedef struct IDirectDraw FAR *LPDIRECTDRAW;
  116. typedef struct IDirectDraw2 FAR *LPDIRECTDRAW2;
  117. typedef struct IDirectDraw4 FAR *LPDIRECTDRAW4;
  118. typedef struct IDirectDraw7 FAR *LPDIRECTDRAW7;
  119. typedef struct IDirectDrawSurface FAR *LPDIRECTDRAWSURFACE;
  120. typedef struct IDirectDrawSurface2 FAR *LPDIRECTDRAWSURFACE2;
  121. typedef struct IDirectDrawSurface3 FAR *LPDIRECTDRAWSURFACE3;
  122. typedef struct IDirectDrawSurface4 FAR *LPDIRECTDRAWSURFACE4;
  123. typedef struct IDirectDrawSurface7 FAR *LPDIRECTDRAWSURFACE7;
  124. typedef struct IDirectDrawPalette FAR *LPDIRECTDRAWPALETTE;
  125. typedef struct IDirectDrawClipper FAR *LPDIRECTDRAWCLIPPER;
  126. typedef struct IDirectDrawColorControl FAR *LPDIRECTDRAWCOLORCONTROL;
  127. typedef struct IDirectDrawGammaControl FAR *LPDIRECTDRAWGAMMACONTROL;}
  128. type
  129. IDirectDraw = interface;
  130. IDirectDraw2 = interface;
  131. IDirectDraw4 = interface;
  132. IDirectDraw7 = interface;
  133. IDirectDrawSurface = interface;
  134. IDirectDrawSurface2 = interface;
  135. IDirectDrawSurface3 = interface;
  136. IDirectDrawSurface4 = interface;
  137. IDirectDrawSurface7 = interface;
  138. IDirectDrawPalette = interface;
  139. IDirectDrawClipper = interface;
  140. IDirectDrawColorControl = interface;
  141. IDirectDrawGammaControl = interface;
  142. {typedef struct _DDFXROP FAR *LPDDFXROP;
  143. typedef struct _DDSURFACEDESC FAR *LPDDSURFACEDESC;
  144. typedef struct _DDSURFACEDESC2 FAR *LPDDSURFACEDESC2;
  145. typedef struct _DDCOLORCONTROL FAR *LPDDCOLORCONTROL;}
  146. (*
  147. * API's
  148. *)
  149. //#if (defined (WIN32) || defined( _WIN32 ) ) && !defined( _NO_COM )
  150. //#if defined( _WIN32 ) && !defined( _NO_ENUM )
  151. // typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKA)(GUID FAR *, LPSTR, LPSTR, LPVOID);
  152. LPDDENUMCALLBACKA = function(lpGUID: PGUID; lpDriverDescription: LPSTR; lpDriverName: LPSTR; lpContext: LPVOID): BOOL; stdcall;
  153. // typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKW)(GUID FAR *, LPWSTR, LPWSTR, LPVOID);
  154. LPDDENUMCALLBACKW = function(lpGUID: PGUID; lpDriverDescription: LPWSTR; lpDriverName: LPWSTR; lpContext: LPVOID): BOOL; stdcall;
  155. type
  156. { /*
  157. * Protect against old SDKs
  158. */
  159. #if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500)
  160. #define HMONITOR_DECLARED
  161. DECLARE_HANDLE(HMONITOR);
  162. #endif}
  163. {$WARNING HMONITOR should go to the windows unit}
  164. HMONITOR = HANDLE;
  165. // typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKEXA)(GUID FAR *, LPSTR, LPSTR, LPVOID, HMONITOR);
  166. LPDDENUMCALLBACKEXA = function(lpGUID: PGUID; lpDriverDescription: LPSTR; lpDriverName: LPSTR; lpContext: LPVOID; hm: HMONITOR): BOOL; stdcall;
  167. // typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKEXW)(GUID FAR *, LPWSTR, LPWSTR, LPVOID, HMONITOR);
  168. LPDDENUMCALLBACKEXW = function(lpGUID: PGUID; lpDriverDescription: LPWSTR; lpDriverName: LPWSTR; lpContext: LPVOID; hm: HMONITOR): BOOL; stdcall;
  169. type
  170. // typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXA)( LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags);
  171. LPDIRECTDRAWENUMERATEEXA = function(lpCallback: LPDDENUMCALLBACKEXA; lpContext: LPVOID; dwFlags: DWORD): HRESULT; stdcall;
  172. // typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXW)( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags);
  173. LPDIRECTDRAWENUMERATEEXW = function(lpCallback: LPDDENUMCALLBACKEXW; lpContext: LPVOID; dwFlags: DWORD): HRESULT; stdcall;
  174. { #ifdef UNICODE
  175. typedef LPDDENUMCALLBACKW LPDDENUMCALLBACK;
  176. #define DirectDrawEnumerate DirectDrawEnumerateW
  177. typedef LPDDENUMCALLBACKEXW LPDDENUMCALLBACKEX;
  178. typedef LPDIRECTDRAWENUMERATEEXW LPDIRECTDRAWENUMERATEEX;
  179. #define DirectDrawEnumerateEx DirectDrawEnumerateExW
  180. #else
  181. typedef LPDDENUMCALLBACKA LPDDENUMCALLBACK;
  182. #define DirectDrawEnumerate DirectDrawEnumerateA
  183. typedef LPDDENUMCALLBACKEXA LPDDENUMCALLBACKEX;
  184. typedef LPDIRECTDRAWENUMERATEEXA LPDIRECTDRAWENUMERATEEX;
  185. #define DirectDrawEnumerateEx DirectDrawEnumerateExA
  186. #endif}
  187. //#endif}
  188. (*
  189. * Flags for DirectDrawEnumerateEx
  190. * DirectDrawEnumerateEx supercedes DirectDrawEnumerate. You must use GetProcAddress to
  191. * obtain a function pointer (of type LPDIRECTDRAWENUMERATEEX) to DirectDrawEnumerateEx.
  192. * By default, only the primary display device is enumerated.
  193. * DirectDrawEnumerate is equivalent to DirectDrawEnumerate(,,DDENUM_NONDISPLAYDEVICES)
  194. *)
  195. (*
  196. * This flag causes enumeration of any GDI display devices which are part of
  197. * the Windows Desktop
  198. *)
  199. const
  200. DDENUM_ATTACHEDSECONDARYDEVICES = $00000001;
  201. (*
  202. * This flag causes enumeration of any GDI display devices which are not
  203. * part of the Windows Desktop
  204. *)
  205. DDENUM_DETACHEDSECONDARYDEVICES = $00000002;
  206. (*
  207. * This flag causes enumeration of non-display devices
  208. *)
  209. DDENUM_NONDISPLAYDEVICES = $00000004;
  210. REGSTR_KEY_DDHW_DESCRIPTION = 'Description';
  211. REGSTR_KEY_DDHW_DRIVERNAME = 'DriverName';
  212. REGSTR_PATH_DDHW = 'Hardware\DirectDrawDrivers';
  213. DDCREATE_HARDWAREONLY = $00000001;
  214. DDCREATE_EMULATIONONLY = $00000002;
  215. {#if defined(WINNT) || !defined(WIN32)
  216. #ifndef _HRESULT_DEFINED
  217. #define _HRESULT_DEFINED
  218. typedef __success(return >= 0) long HRESULT;
  219. #endif // !_HRESULT_DEFINED
  220. #endif}
  221. (*
  222. * Generic pixel format with 8-bit RGB and alpha components
  223. *)
  224. type
  225. PDDARGB = ^TDDARGB;
  226. TDDARGB = record
  227. blue: BYTE;
  228. green: BYTE;
  229. red: BYTE;
  230. alpha: BYTE;
  231. end;
  232. (*
  233. * This version of the structure remains for backwards source compatibility.
  234. * The DDARGB structure is the one that should be used for all DirectDraw APIs.
  235. *)
  236. PDDRGBA = ^TDDRGBA;
  237. TDDRGBA = record
  238. red: BYTE;
  239. green: BYTE;
  240. blue: BYTE;
  241. alpha: BYTE;
  242. end;
  243. (*
  244. * DDCOLORKEY
  245. *)
  246. PDDCOLORKEY = ^TDDCOLORKEY;
  247. TDDCOLORKEY = record
  248. dwColorSpaceLowValue: DWORD; // low boundary of color space that is to
  249. // be treated as Color Key, inclusive
  250. dwColorSpaceHighValue: DWORD; // high boundary of color space that is
  251. // to be treated as Color Key, inclusive
  252. end;
  253. PDirectDrawSurface = Pointer;
  254. (*
  255. * DDBLTFX
  256. * Used to pass override information to the DIRECTDRAWSURFACE callback Blt.
  257. *)
  258. PDDBLTFX = ^TDDBLTFX;
  259. TDDBLTFX = record
  260. dwSize: DWORD; // size of structure
  261. dwDDFX: DWORD; // FX operations
  262. dwROP: DWORD; // Win32 raster operations
  263. dwDDROP: DWORD; // Raster operations new for DirectDraw
  264. dwRotationAngle: DWORD; // Rotation angle for blt
  265. dwZBufferOpCode: DWORD; // ZBuffer compares
  266. dwZBufferLow: DWORD; // Low limit of Z buffer
  267. dwZBufferHigh: DWORD; // High limit of Z buffer
  268. dwZBufferBaseDest: DWORD; // Destination base value
  269. dwZDestConstBitDepth: DWORD; // Bit depth used to specify Z constant for destination
  270. case Integer of
  271. 0: (
  272. dwZDestConst: DWORD; // Constant to use as Z buffer for dest
  273. );
  274. 1: (
  275. lpDDSZBufferDest: PDirectDrawSurface; // Surface to use as Z buffer for dest
  276. dwZSrcConstBitDepth: DWORD; // Bit depth used to specify Z constant for source
  277. case Integer of
  278. 0: (
  279. dwZSrcConst: DWORD; // Constant to use as Z buffer for src
  280. );
  281. 1: (
  282. lpDDSZBufferSrc: PDirectDrawSurface; // Surface to use as Z buffer for src
  283. dwAlphaEdgeBlendBitDepth: DWORD; // Bit depth used to specify constant for alpha edge blend
  284. dwAlphaEdgeBlend: DWORD; // Alpha for edge blending
  285. dwReserved: DWORD;
  286. dwAlphaDestConstBitDepth: DWORD; // Bit depth used to specify alpha constant for destination
  287. case Integer of
  288. 0: (
  289. dwAlphaDestConst: DWORD; // Constant to use as Alpha Channel
  290. );
  291. 1: (
  292. lpDDSAlphaDest: PDirectDrawSurface; // Surface to use as Alpha Channel
  293. dwAlphaSrcConstBitDepth: DWORD; // Bit depth used to specify alpha constant for source
  294. case Integer of
  295. 0: (
  296. dwAlphaSrcConst: DWORD; // Constant to use as Alpha Channel
  297. );
  298. 1: (
  299. lpDDSAlphaSrc: PDirectDrawSurface; // Surface to use as Alpha Channel
  300. case Integer of
  301. 0: (
  302. dwFillColor: DWORD; // color in RGB or Palettized
  303. );
  304. 1: (
  305. dwFillDepth: DWORD; // depth value for z-buffer
  306. );
  307. 2: (
  308. dwFillPixel: DWORD; // pixel value for RGBA or RGBZ
  309. );
  310. 3: (
  311. lpDDSPattern: PDirectDrawSurface; // Surface to use as pattern
  312. ddckDestColorkey: TDDCOLORKEY; // DestColorkey override
  313. ddckSrcColorkey: TDDCOLORKEY; // SrcColorkey override
  314. );
  315. );
  316. );
  317. );
  318. );
  319. end;
  320. (*
  321. * DDSCAPS
  322. *)
  323. PDDSCAPS = ^TDDSCAPS;
  324. TDDSCAPS = record
  325. dwCaps: DWORD; // capabilities of surface wanted
  326. end;
  327. (*
  328. * DDOSCAPS
  329. *)
  330. PDDOSCAPS = ^TDDOSCAPS;
  331. TDDOSCAPS = record
  332. dwCaps: DWORD; // capabilities of surface wanted
  333. end;
  334. (*
  335. * This structure is used internally by DirectDraw.
  336. *)
  337. PDDSCAPSEX = ^TDDSCAPSEX;
  338. TDDSCAPSEX = record
  339. dwCaps2: DWORD;
  340. dwCaps3: DWORD;
  341. case Integer of
  342. 0: (
  343. dwCaps4: DWORD;
  344. );
  345. 1: (
  346. dwVolumeDepth: DWORD;
  347. );
  348. end;
  349. (*
  350. * DDSCAPS2
  351. *)
  352. PDDSCAPS2 = ^TDDSCAPS2;
  353. TDDSCAPS2 = record
  354. dwCaps: DWORD; // capabilities of surface wanted
  355. dwCaps2: DWORD;
  356. dwCaps3: DWORD;
  357. case Integer of
  358. 0: (
  359. dwCaps4: DWORD;
  360. );
  361. 1: (
  362. dwVolumeDepth: DWORD;
  363. );
  364. end;
  365. (*
  366. * DDCAPS
  367. *)
  368. const
  369. DD_ROP_SPACE = 256 div 32; // space required to store ROP array
  370. (*
  371. * NOTE: Our choosen structure number scheme is to append a single digit to
  372. * the end of the structure giving the version that structure is associated
  373. * with.
  374. *)
  375. (*
  376. * This structure represents the DDCAPS structure released in DirectDraw 1.0. It is used internally
  377. * by DirectDraw to interpret caps passed into ddraw by drivers written prior to the release of DirectDraw 2.0.
  378. * New applications should use the DDCAPS structure defined below.
  379. *)
  380. type
  381. PDDCAPS_DX1 = ^TDDCAPS_DX1;
  382. TDDCAPS_DX1 = record
  383. dwSize: DWORD; // size of the DDDRIVERCAPS structure
  384. dwCaps: DWORD; // driver specific capabilities
  385. dwCaps2: DWORD; // more driver specific capabilites
  386. dwCKeyCaps: DWORD; // color key capabilities of the surface
  387. dwFXCaps: DWORD; // driver specific stretching and effects capabilites
  388. dwFXAlphaCaps: DWORD; // alpha driver specific capabilities
  389. dwPalCaps: DWORD; // palette capabilities
  390. dwSVCaps: DWORD; // stereo vision capabilities
  391. dwAlphaBltConstBitDepths: DWORD; // DDBD_2,4,8
  392. dwAlphaBltPixelBitDepths: DWORD; // DDBD_1,2,4,8
  393. dwAlphaBltSurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  394. dwAlphaOverlayConstBitDepths: DWORD; // DDBD_2,4,8
  395. dwAlphaOverlayPixelBitDepths: DWORD; // DDBD_1,2,4,8
  396. dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  397. dwZBufferBitDepths: DWORD; // DDBD_8,16,24,32
  398. dwVidMemTotal: DWORD; // total amount of video memory
  399. dwVidMemFree: DWORD; // amount of free video memory
  400. dwMaxVisibleOverlays: DWORD; // maximum number of visible overlays
  401. dwCurrVisibleOverlays: DWORD; // current number of visible overlays
  402. dwNumFourCCCodes: DWORD; // number of four cc codes
  403. dwAlignBoundarySrc: DWORD; // source rectangle alignment
  404. dwAlignSizeSrc: DWORD; // source rectangle byte size
  405. dwAlignBoundaryDest: DWORD; // dest rectangle alignment
  406. dwAlignSizeDest: DWORD; // dest rectangle byte size
  407. dwAlignStrideAlign: DWORD; // stride alignment
  408. dwRops: array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported
  409. ddsCaps: TDDSCAPS; // DDSCAPS structure has all the general capabilities
  410. dwMinOverlayStretch: DWORD; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  411. dwMaxOverlayStretch: DWORD; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  412. dwMinLiveVideoStretch: DWORD; // OBSOLETE! This field remains for compatability reasons only
  413. dwMaxLiveVideoStretch: DWORD; // OBSOLETE! This field remains for compatability reasons only
  414. dwMinHwCodecStretch: DWORD; // OBSOLETE! This field remains for compatability reasons only
  415. dwMaxHwCodecStretch: DWORD; // OBSOLETE! This field remains for compatability reasons only
  416. dwReserved1: DWORD; // reserved
  417. dwReserved2: DWORD; // reserved
  418. dwReserved3: DWORD; // reserved
  419. end;
  420. (*
  421. * This structure is the DDCAPS structure as it was in version 2 and 3 of Direct X.
  422. * It is present for back compatability.
  423. *)
  424. PDDCAPS_DX3 = ^TDDCAPS_DX3;
  425. TDDCAPS_DX3 = record
  426. dwSize: DWORD; // size of the DDDRIVERCAPS structure
  427. dwCaps: DWORD; // driver specific capabilities
  428. dwCaps2: DWORD; // more driver specific capabilites
  429. dwCKeyCaps: DWORD; // color key capabilities of the surface
  430. dwFXCaps: DWORD; // driver specific stretching and effects capabilites
  431. dwFXAlphaCaps: DWORD; // alpha driver specific capabilities
  432. dwPalCaps: DWORD; // palette capabilities
  433. dwSVCaps: DWORD; // stereo vision capabilities
  434. dwAlphaBltConstBitDepths: DWORD; // DDBD_2,4,8
  435. dwAlphaBltPixelBitDepths: DWORD; // DDBD_1,2,4,8
  436. dwAlphaBltSurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  437. dwAlphaOverlayConstBitDepths: DWORD; // DDBD_2,4,8
  438. dwAlphaOverlayPixelBitDepths: DWORD; // DDBD_1,2,4,8
  439. dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  440. dwZBufferBitDepths: DWORD; // DDBD_8,16,24,32
  441. dwVidMemTotal: DWORD; // total amount of video memory
  442. dwVidMemFree: DWORD; // amount of free video memory
  443. dwMaxVisibleOverlays: DWORD; // maximum number of visible overlays
  444. dwCurrVisibleOverlays: DWORD; // current number of visible overlays
  445. dwNumFourCCCodes: DWORD; // number of four cc codes
  446. dwAlignBoundarySrc: DWORD; // source rectangle alignment
  447. dwAlignSizeSrc: DWORD; // source rectangle byte size
  448. dwAlignBoundaryDest: DWORD; // dest rectangle alignment
  449. dwAlignSizeDest: DWORD; // dest rectangle byte size
  450. dwAlignStrideAlign: DWORD; // stride alignment
  451. dwRops: array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported
  452. ddsCaps: TDDSCAPS; // DDSCAPS structure has all the general capabilities
  453. dwMinOverlayStretch: DWORD; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  454. dwMaxOverlayStretch: DWORD; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  455. dwMinLiveVideoStretch: DWORD; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  456. dwMaxLiveVideoStretch: DWORD; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  457. dwMinHwCodecStretch: DWORD; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  458. dwMaxHwCodecStretch: DWORD; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  459. dwReserved1: DWORD; // reserved
  460. dwReserved2: DWORD; // reserved
  461. dwReserved3: DWORD; // reserved
  462. dwSVBCaps: DWORD; // driver specific capabilities for System->Vmem blts
  463. dwSVBCKeyCaps: DWORD; // driver color key capabilities for System->Vmem blts
  464. dwSVBFXCaps: DWORD; // driver FX capabilities for System->Vmem blts
  465. dwSVBRops: array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for System->Vmem blts
  466. dwVSBCaps: DWORD; // driver specific capabilities for Vmem->System blts
  467. dwVSBCKeyCaps: DWORD; // driver color key capabilities for Vmem->System blts
  468. dwVSBFXCaps: DWORD; // driver FX capabilities for Vmem->System blts
  469. dwVSBRops: array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for Vmem->System blts
  470. dwSSBCaps: DWORD; // driver specific capabilities for System->System blts
  471. dwSSBCKeyCaps: DWORD; // driver color key capabilities for System->System blts
  472. dwSSBFXCaps: DWORD; // driver FX capabilities for System->System blts
  473. dwSSBRops: array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for System->System blts
  474. dwReserved4: DWORD; // reserved
  475. dwReserved5: DWORD; // reserved
  476. dwReserved6: DWORD; // reserved
  477. end;
  478. (*
  479. * This structure is the DDCAPS structure as it was in version 5 of Direct X.
  480. * It is present for back compatability.
  481. *)
  482. PDDCAPS_DX5 = ^TDDCAPS_DX5;
  483. TDDCAPS_DX5 = record
  484. (* 0*) dwSize: DWORD; // size of the DDDRIVERCAPS structure
  485. (* 4*) dwCaps: DWORD; // driver specific capabilities
  486. (* 8*) dwCaps2: DWORD; // more driver specific capabilites
  487. (* c*) dwCKeyCaps: DWORD; // color key capabilities of the surface
  488. (* 10*) dwFXCaps: DWORD; // driver specific stretching and effects capabilites
  489. (* 14*) dwFXAlphaCaps: DWORD; // alpha driver specific capabilities
  490. (* 18*) dwPalCaps: DWORD; // palette capabilities
  491. (* 1c*) dwSVCaps: DWORD; // stereo vision capabilities
  492. (* 20*) dwAlphaBltConstBitDepths: DWORD; // DDBD_2,4,8
  493. (* 24*) dwAlphaBltPixelBitDepths: DWORD; // DDBD_1,2,4,8
  494. (* 28*) dwAlphaBltSurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  495. (* 2c*) dwAlphaOverlayConstBitDepths: DWORD; // DDBD_2,4,8
  496. (* 30*) dwAlphaOverlayPixelBitDepths: DWORD; // DDBD_1,2,4,8
  497. (* 34*) dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  498. (* 38*) dwZBufferBitDepths: DWORD; // DDBD_8,16,24,32
  499. (* 3c*) dwVidMemTotal: DWORD; // total amount of video memory
  500. (* 40*) dwVidMemFree: DWORD; // amount of free video memory
  501. (* 44*) dwMaxVisibleOverlays: DWORD; // maximum number of visible overlays
  502. (* 48*) dwCurrVisibleOverlays: DWORD; // current number of visible overlays
  503. (* 4c*) dwNumFourCCCodes: DWORD; // number of four cc codes
  504. (* 50*) dwAlignBoundarySrc: DWORD; // source rectangle alignment
  505. (* 54*) dwAlignSizeSrc: DWORD; // source rectangle byte size
  506. (* 58*) dwAlignBoundaryDest: DWORD; // dest rectangle alignment
  507. (* 5c*) dwAlignSizeDest: DWORD; // dest rectangle byte size
  508. (* 60*) dwAlignStrideAlign: DWORD; // stride alignment
  509. (* 64*) dwRops: array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported
  510. (* 84*) ddsCaps: TDDSCAPS; // DDSCAPS structure has all the general capabilities
  511. (* 88*) dwMinOverlayStretch: DWORD; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  512. (* 8c*) dwMaxOverlayStretch: DWORD; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  513. (* 90*) dwMinLiveVideoStretch: DWORD; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  514. (* 94*) dwMaxLiveVideoStretch: DWORD; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  515. (* 98*) dwMinHwCodecStretch: DWORD; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  516. (* 9c*) dwMaxHwCodecStretch: DWORD; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  517. (* a0*) dwReserved1: DWORD; // reserved
  518. (* a4*) dwReserved2: DWORD; // reserved
  519. (* a8*) dwReserved3: DWORD; // reserved
  520. (* ac*) dwSVBCaps: DWORD; // driver specific capabilities for System->Vmem blts
  521. (* b0*) dwSVBCKeyCaps: DWORD; // driver color key capabilities for System->Vmem blts
  522. (* b4*) dwSVBFXCaps: DWORD; // driver FX capabilities for System->Vmem blts
  523. (* b8*) dwSVBRops: array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for System->Vmem blts
  524. (* d8*) dwVSBCaps: DWORD; // driver specific capabilities for Vmem->System blts
  525. (* dc*) dwVSBCKeyCaps: DWORD; // driver color key capabilities for Vmem->System blts
  526. (* e0*) dwVSBFXCaps: DWORD; // driver FX capabilities for Vmem->System blts
  527. (* e4*) dwVSBRops: array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for Vmem->System blts
  528. (*104*) dwSSBCaps: DWORD; // driver specific capabilities for System->System blts
  529. (*108*) dwSSBCKeyCaps: DWORD; // driver color key capabilities for System->System blts
  530. (*10c*) dwSSBFXCaps: DWORD; // driver FX capabilities for System->System blts
  531. (*110*) dwSSBRops: array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for System->System blts
  532. // Members added for DX5:
  533. (*130*) dwMaxVideoPorts: DWORD; // maximum number of usable video ports
  534. (*134*) dwCurrVideoPorts: DWORD; // current number of video ports used
  535. (*138*) dwSVBCaps2: DWORD; // more driver specific capabilities for System->Vmem blts
  536. (*13c*) dwNLVBCaps: DWORD; // driver specific capabilities for non-local->local vidmem blts
  537. (*140*) dwNLVBCaps2: DWORD; // more driver specific capabilities non-local->local vidmem blts
  538. (*144*) dwNLVBCKeyCaps: DWORD; // driver color key capabilities for non-local->local vidmem blts
  539. (*148*) dwNLVBFXCaps: DWORD; // driver FX capabilities for non-local->local blts
  540. (*14c*) dwNLVBRops: array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for non-local->local blts
  541. end;
  542. PDDCAPS_DX6 = ^TDDCAPS_DX6;
  543. TDDCAPS_DX6 = record
  544. (* 0*) dwSize: DWORD; // size of the DDDRIVERCAPS structure
  545. (* 4*) dwCaps: DWORD; // driver specific capabilities
  546. (* 8*) dwCaps2: DWORD; // more driver specific capabilites
  547. (* c*) dwCKeyCaps: DWORD; // color key capabilities of the surface
  548. (* 10*) dwFXCaps: DWORD; // driver specific stretching and effects capabilites
  549. (* 14*) dwFXAlphaCaps: DWORD; // alpha caps
  550. (* 18*) dwPalCaps: DWORD; // palette capabilities
  551. (* 1c*) dwSVCaps: DWORD; // stereo vision capabilities
  552. (* 20*) dwAlphaBltConstBitDepths: DWORD; // DDBD_2,4,8
  553. (* 24*) dwAlphaBltPixelBitDepths: DWORD; // DDBD_1,2,4,8
  554. (* 28*) dwAlphaBltSurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  555. (* 2c*) dwAlphaOverlayConstBitDepths: DWORD; // DDBD_2,4,8
  556. (* 30*) dwAlphaOverlayPixelBitDepths: DWORD; // DDBD_1,2,4,8
  557. (* 34*) dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  558. (* 38*) dwZBufferBitDepths: DWORD; // DDBD_8,16,24,32
  559. (* 3c*) dwVidMemTotal: DWORD; // total amount of video memory
  560. (* 40*) dwVidMemFree: DWORD; // amount of free video memory
  561. (* 44*) dwMaxVisibleOverlays: DWORD; // maximum number of visible overlays
  562. (* 48*) dwCurrVisibleOverlays: DWORD; // current number of visible overlays
  563. (* 4c*) dwNumFourCCCodes: DWORD; // number of four cc codes
  564. (* 50*) dwAlignBoundarySrc: DWORD; // source rectangle alignment
  565. (* 54*) dwAlignSizeSrc: DWORD; // source rectangle byte size
  566. (* 58*) dwAlignBoundaryDest: DWORD; // dest rectangle alignment
  567. (* 5c*) dwAlignSizeDest: DWORD; // dest rectangle byte size
  568. (* 60*) dwAlignStrideAlign: DWORD; // stride alignment
  569. (* 64*) dwRops: array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported
  570. (* 84*) ddsOldCaps: TDDSCAPS; // Was DDSCAPS ddsCaps. ddsCaps is of type DDSCAPS2 for DX6
  571. (* 88*) dwMinOverlayStretch: DWORD; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  572. (* 8c*) dwMaxOverlayStretch: DWORD; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  573. (* 90*) dwMinLiveVideoStretch: DWORD; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  574. (* 94*) dwMaxLiveVideoStretch: DWORD; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  575. (* 98*) dwMinHwCodecStretch: DWORD; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  576. (* 9c*) dwMaxHwCodecStretch: DWORD; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  577. (* a0*) dwReserved1: DWORD; // reserved
  578. (* a4*) dwReserved2: DWORD; // reserved
  579. (* a8*) dwReserved3: DWORD; // reserved
  580. (* ac*) dwSVBCaps: DWORD; // driver specific capabilities for System->Vmem blts
  581. (* b0*) dwSVBCKeyCaps: DWORD; // driver color key capabilities for System->Vmem blts
  582. (* b4*) dwSVBFXCaps: DWORD; // driver FX capabilities for System->Vmem blts
  583. (* b8*) dwSVBRops: array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for System->Vmem blts
  584. (* d8*) dwVSBCaps: DWORD; // driver specific capabilities for Vmem->System blts
  585. (* dc*) dwVSBCKeyCaps: DWORD; // driver color key capabilities for Vmem->System blts
  586. (* e0*) dwVSBFXCaps: DWORD; // driver FX capabilities for Vmem->System blts
  587. (* e4*) dwVSBRops: array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for Vmem->System blts
  588. (*104*) dwSSBCaps: DWORD; // driver specific capabilities for System->System blts
  589. (*108*) dwSSBCKeyCaps: DWORD; // driver color key capabilities for System->System blts
  590. (*10c*) dwSSBFXCaps: DWORD; // driver FX capabilities for System->System blts
  591. (*110*) dwSSBRops: array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for System->System blts
  592. (*130*) dwMaxVideoPorts: DWORD; // maximum number of usable video ports
  593. (*134*) dwCurrVideoPorts: DWORD; // current number of video ports used
  594. (*138*) dwSVBCaps2: DWORD; // more driver specific capabilities for System->Vmem blts
  595. (*13c*) dwNLVBCaps: DWORD; // driver specific capabilities for non-local->local vidmem blts
  596. (*140*) dwNLVBCaps2: DWORD; // more driver specific capabilities non-local->local vidmem blts
  597. (*144*) dwNLVBCKeyCaps: DWORD; // driver color key capabilities for non-local->local vidmem blts
  598. (*148*) dwNLVBFXCaps: DWORD; // driver FX capabilities for non-local->local blts
  599. (*14c*) dwNLVBRops: array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for non-local->local blts
  600. // Members added for DX6 release
  601. (*16c*) ddsCaps: TDDSCAPS2; // Surface Caps
  602. end;
  603. PDDCAPS_DX7 = ^TDDCAPS_DX7;
  604. TDDCAPS_DX7 = record
  605. (* 0*) dwSize: DWORD; // size of the DDDRIVERCAPS structure
  606. (* 4*) dwCaps: DWORD; // driver specific capabilities
  607. (* 8*) dwCaps2: DWORD; // more driver specific capabilites
  608. (* c*) dwCKeyCaps: DWORD; // color key capabilities of the surface
  609. (* 10*) dwFXCaps: DWORD; // driver specific stretching and effects capabilites
  610. (* 14*) dwFXAlphaCaps: DWORD; // alpha driver specific capabilities
  611. (* 18*) dwPalCaps: DWORD; // palette capabilities
  612. (* 1c*) dwSVCaps: DWORD; // stereo vision capabilities
  613. (* 20*) dwAlphaBltConstBitDepths: DWORD; // DDBD_2,4,8
  614. (* 24*) dwAlphaBltPixelBitDepths: DWORD; // DDBD_1,2,4,8
  615. (* 28*) dwAlphaBltSurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  616. (* 2c*) dwAlphaOverlayConstBitDepths: DWORD; // DDBD_2,4,8
  617. (* 30*) dwAlphaOverlayPixelBitDepths: DWORD; // DDBD_1,2,4,8
  618. (* 34*) dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  619. (* 38*) dwZBufferBitDepths: DWORD; // DDBD_8,16,24,32
  620. (* 3c*) dwVidMemTotal: DWORD; // total amount of video memory
  621. (* 40*) dwVidMemFree: DWORD; // amount of free video memory
  622. (* 44*) dwMaxVisibleOverlays: DWORD; // maximum number of visible overlays
  623. (* 48*) dwCurrVisibleOverlays: DWORD; // current number of visible overlays
  624. (* 4c*) dwNumFourCCCodes: DWORD; // number of four cc codes
  625. (* 50*) dwAlignBoundarySrc: DWORD; // source rectangle alignment
  626. (* 54*) dwAlignSizeSrc: DWORD; // source rectangle byte size
  627. (* 58*) dwAlignBoundaryDest: DWORD; // dest rectangle alignment
  628. (* 5c*) dwAlignSizeDest: DWORD; // dest rectangle byte size
  629. (* 60*) dwAlignStrideAlign: DWORD; // stride alignment
  630. (* 64*) dwRops: array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported
  631. (* 84*) ddsOldCaps: TDDSCAPS; // Was DDSCAPS ddsCaps. ddsCaps is of type DDSCAPS2 for DX6
  632. (* 88*) dwMinOverlayStretch: DWORD; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  633. (* 8c*) dwMaxOverlayStretch: DWORD; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  634. (* 90*) dwMinLiveVideoStretch: DWORD; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  635. (* 94*) dwMaxLiveVideoStretch: DWORD; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  636. (* 98*) dwMinHwCodecStretch: DWORD; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  637. (* 9c*) dwMaxHwCodecStretch: DWORD; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  638. (* a0*) dwReserved1: DWORD; // reserved
  639. (* a4*) dwReserved2: DWORD; // reserved
  640. (* a8*) dwReserved3: DWORD; // reserved
  641. (* ac*) dwSVBCaps: DWORD; // driver specific capabilities for System->Vmem blts
  642. (* b0*) dwSVBCKeyCaps: DWORD; // driver color key capabilities for System->Vmem blts
  643. (* b4*) dwSVBFXCaps: DWORD; // driver FX capabilities for System->Vmem blts
  644. (* b8*) dwSVBRops: array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for System->Vmem blts
  645. (* d8*) dwVSBCaps: DWORD; // driver specific capabilities for Vmem->System blts
  646. (* dc*) dwVSBCKeyCaps: DWORD; // driver color key capabilities for Vmem->System blts
  647. (* e0*) dwVSBFXCaps: DWORD; // driver FX capabilities for Vmem->System blts
  648. (* e4*) dwVSBRops: array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for Vmem->System blts
  649. (*104*) dwSSBCaps: DWORD; // driver specific capabilities for System->System blts
  650. (*108*) dwSSBCKeyCaps: DWORD; // driver color key capabilities for System->System blts
  651. (*10c*) dwSSBFXCaps: DWORD; // driver FX capabilities for System->System blts
  652. (*110*) dwSSBRops: array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for System->System blts
  653. (*130*) dwMaxVideoPorts: DWORD; // maximum number of usable video ports
  654. (*134*) dwCurrVideoPorts: DWORD; // current number of video ports used
  655. (*138*) dwSVBCaps2: DWORD; // more driver specific capabilities for System->Vmem blts
  656. (*13c*) dwNLVBCaps: DWORD; // driver specific capabilities for non-local->local vidmem blts
  657. (*140*) dwNLVBCaps2: DWORD; // more driver specific capabilities non-local->local vidmem blts
  658. (*144*) dwNLVBCKeyCaps: DWORD; // driver color key capabilities for non-local->local vidmem blts
  659. (*148*) dwNLVBFXCaps: DWORD; // driver FX capabilities for non-local->local blts
  660. (*14c*) dwNLVBRops: array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for non-local->local blts
  661. // Members added for DX6 release
  662. (*16c*) ddsCaps: TDDSCAPS2; // Surface Caps
  663. end;
  664. {$IF DIRECTDRAW_VERSION <= $300}
  665. TDDCAPS = TDDCAPS_DX3;
  666. {$ELSEIF DIRECTDRAW_VERSION <= $500}
  667. TDDCAPS = TDDCAPS_DX5;
  668. {$ELSEIF DIRECTDRAW_VERSION <= $600}
  669. TDDCAPS = TDDCAPS_DX6;
  670. {$ELSE}
  671. TDDCAPS = TDDCAPS_DX7;
  672. {$ENDIF}
  673. PDDCAPS = TDDCAPS;
  674. (*
  675. * DDPIXELFORMAT
  676. *)
  677. PDDPIXELFORMAT = ^TDDPIXELFORMAT;
  678. TDDPIXELFORMAT = record
  679. dwSize: DWORD; // size of structure
  680. dwFlags: DWORD; // pixel format flags
  681. dwFourCC: DWORD; // (FOURCC code)
  682. case Integer of
  683. 0: (
  684. dwRGBBitCount: DWORD; // how many bits per pixel
  685. );
  686. 1: (
  687. dwYUVBitCount: DWORD; // how many bits per pixel
  688. );
  689. 2: (
  690. dwZBufferBitDepth: DWORD; // how many total bits/pixel in z buffer (including any stencil bits)
  691. );
  692. 3: (
  693. dwAlphaBitDepth: DWORD; // how many bits for alpha channels
  694. );
  695. 4: (
  696. dwLuminanceBitCount: DWORD; // how many bits per pixel
  697. );
  698. 5: (
  699. dwBumpBitCount: DWORD; // how many bits per "buxel", total
  700. );
  701. 6: (
  702. dwPrivateFormatBitCount: DWORD; // Bits per pixel of private driver formats. Only valid in texture
  703. // format list and if DDPF_D3DFORMAT is set
  704. case Integer of
  705. 0: (
  706. dwRBitMask: DWORD; // mask for red bit
  707. );
  708. 1: (
  709. dwYBitMask: DWORD; // mask for Y bits
  710. );
  711. 2: (
  712. dwStencilBitDepth: DWORD; // how many stencil bits (note: dwZBufferBitDepth-dwStencilBitDepth is total Z-only bits)
  713. );
  714. 3: (
  715. dwLuminanceBitMask: DWORD; // mask for luminance bits
  716. );
  717. 4: (
  718. dwBumpDuBitMask: DWORD; // mask for bump map U delta bits
  719. );
  720. 5: (
  721. dwOperations: DWORD; // DDPF_D3DFORMAT Operations
  722. case Integer of
  723. 0: (
  724. dwGBitMask: DWORD; // mask for green bits
  725. );
  726. 1: (
  727. dwUBitMask: DWORD; // mask for U bits
  728. );
  729. 2: (
  730. dwZBitMask: DWORD; // mask for Z bits
  731. );
  732. 3: (
  733. dwBumpDvBitMask: DWORD; // mask for bump map V delta bits
  734. );
  735. 4: (
  736. MultiSampleCaps: record
  737. wFlipMSTypes: WORD; // Multisample methods supported via flip for this D3DFORMAT
  738. wBltMSTypes: WORD; // Multisample methods supported via blt for this D3DFORMAT
  739. end;
  740. case Integer of
  741. 0: (
  742. dwBBitMask: DWORD; // mask for blue bits
  743. );
  744. 1: (
  745. dwVBitMask: DWORD; // mask for V bits
  746. );
  747. 2: (
  748. dwStencilBitMask: DWORD; // mask for stencil bits
  749. );
  750. 3: (
  751. dwBumpLuminanceBitMask: DWORD; // mask for luminance in bump map
  752. case Integer of
  753. 0: (
  754. dwRGBAlphaBitMask: DWORD; // mask for alpha channel
  755. );
  756. 1: (
  757. dwYUVAlphaBitMask: DWORD; // mask for alpha channel
  758. );
  759. 2: (
  760. dwLuminanceAlphaBitMask: DWORD; // mask for alpha channel
  761. );
  762. 3: (
  763. dwRGBZBitMask: DWORD; // mask for Z channel
  764. );
  765. 4: (
  766. dwYUVZBitMask: DWORD; // mask for Z channel
  767. );
  768. );
  769. );
  770. );
  771. );
  772. end;
  773. (*
  774. * DDOVERLAYFX
  775. *)
  776. PDDOVERLAYFX = ^TDDOVERLAYFX;
  777. TDDOVERLAYFX = record
  778. dwSize: DWORD; // size of structure
  779. dwAlphaEdgeBlendBitDepth: DWORD; // Bit depth used to specify constant for alpha edge blend
  780. dwAlphaEdgeBlend: DWORD; // Constant to use as alpha for edge blend
  781. dwReserved: DWORD;
  782. dwAlphaDestConstBitDepth: DWORD; // Bit depth used to specify alpha constant for destination
  783. case Integer of
  784. 0: (
  785. dwAlphaDestConst: DWORD; // Constant to use as alpha channel for dest
  786. );
  787. 1: (
  788. lpDDSAlphaDest: PDirectDrawSurface; // Surface to use as alpha channel for dest
  789. dwAlphaSrcConstBitDepth: DWORD; // Bit depth used to specify alpha constant for source
  790. case Integer of
  791. 0: (
  792. dwAlphaSrcConst: DWORD; // Constant to use as alpha channel for src
  793. );
  794. 1: (
  795. lpDDSAlphaSrc: PDirectDrawSurface; // Surface to use as alpha channel for src
  796. dckDestColorkey: TDDCOLORKEY; // DestColorkey override
  797. dckSrcColorkey: TDDCOLORKEY; // DestColorkey override
  798. dwDDFX: DWORD; // Overlay FX
  799. dwFlags: DWORD; // flags
  800. );
  801. );
  802. end;
  803. (*
  804. * DDBLTBATCH: BltBatch entry structure
  805. *)
  806. PDDBLTBATCH = ^TDDBLTBATCH;
  807. TDDBLTBATCH = record
  808. lprDest: PRECT;
  809. lpDDSSrc: IDirectDrawSurface;
  810. lprSrc: PRECT;
  811. dwFlags: DWORD;
  812. lpDDBltFx: PDDBLTFX;
  813. end;
  814. (*
  815. * DDGAMMARAMP
  816. *)
  817. PDDGAMMARAMP = ^TDDGAMMARAMP;
  818. TDDGAMMARAMP = record
  819. red: array [0..255] of WORD;
  820. green: array [0..255] of WORD;
  821. blue: array [0..255] of WORD;
  822. end;
  823. (*
  824. * This is the structure within which DirectDraw returns data about the current graphics driver and chipset
  825. *)
  826. const
  827. MAX_DDDEVICEID_STRING = 512;
  828. type
  829. PDDDEVICEIDENTIFIER = ^TDDDEVICEIDENTIFIER;
  830. TDDDEVICEIDENTIFIER = record
  831. (*
  832. * These elements are for presentation to the user only. They should not be used to identify particular
  833. * drivers, since this is unreliable and many different strings may be associated with the same
  834. * device, and the same driver from different vendors.
  835. *)
  836. szDriver: array [0..MAX_DDDEVICEID_STRING-1] of char;
  837. szDescription: array [0..MAX_DDDEVICEID_STRING-1] of char;
  838. (*
  839. * This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons
  840. * on the whole 64 bits. Caution should be exercised if you use this element to identify problematic
  841. * drivers. It is recommended that guidDeviceIdentifier is used for this purpose.
  842. *
  843. * This version has the form:
  844. * wProduct = HIWORD(liDriverVersion.HighPart)
  845. * wVersion = LOWORD(liDriverVersion.HighPart)
  846. * wSubVersion = HIWORD(liDriverVersion.LowPart)
  847. * wBuild = LOWORD(liDriverVersion.LowPart)
  848. *)
  849. //#ifdef _WIN32
  850. liDriverVersion: LARGE_INTEGER; { Defined for applications and other 32 bit components }
  851. //#else
  852. // DWORD dwDriverVersionLowPart; /* Defined for 16 bit driver components */
  853. // DWORD dwDriverVersionHighPart;
  854. //#endif
  855. (*
  856. * These elements can be used to identify particular chipsets. Use with extreme caution.
  857. * dwVendorId Identifies the manufacturer. May be zero if unknown.
  858. * dwDeviceId Identifies the type of chipset. May be zero if unknown.
  859. * dwSubSysId Identifies the subsystem, typically this means the particular board. May be zero if unknown.
  860. * dwRevision Identifies the revision level of the chipset. May be zero if unknown.
  861. *)
  862. dwVendorId: DWORD;
  863. dwDeviceId: DWORD;
  864. dwSubSysId: DWORD;
  865. dwRevision: DWORD;
  866. (*
  867. * This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the
  868. * driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to
  869. * reprofile the graphics subsystem.
  870. * This element can also be used to identify particular problematic drivers.
  871. *)
  872. guidDeviceIdentifier: TGuid;
  873. end;
  874. PDDDEVICEIDENTIFIER2 = ^TDDDEVICEIDENTIFIER2;
  875. TDDDEVICEIDENTIFIER2 = record
  876. (*
  877. * These elements are for presentation to the user only. They should not be used to identify particular
  878. * drivers, since this is unreliable and many different strings may be associated with the same
  879. * device, and the same driver from different vendors.
  880. *)
  881. szDriver: array [0..MAX_DDDEVICEID_STRING-1] of char;
  882. szDescription: array [0..MAX_DDDEVICEID_STRING-1] of char;
  883. (*
  884. * This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons
  885. * on the whole 64 bits. Caution should be exercised if you use this element to identify problematic
  886. * drivers. It is recommended that guidDeviceIdentifier is used for this purpose.
  887. *
  888. * This version has the form:
  889. * wProduct = HIWORD(liDriverVersion.HighPart)
  890. * wVersion = LOWORD(liDriverVersion.HighPart)
  891. * wSubVersion = HIWORD(liDriverVersion.LowPart)
  892. * wBuild = LOWORD(liDriverVersion.LowPart)
  893. *)
  894. //#ifdef _WIN32
  895. liDriverVersion: LARGE_INTEGER; { Defined for applications and other 32 bit components }
  896. //#else
  897. // DWORD dwDriverVersionLowPart; /* Defined for 16 bit driver components */
  898. // DWORD dwDriverVersionHighPart;
  899. //#endif
  900. (*
  901. * These elements can be used to identify particular chipsets. Use with extreme caution.
  902. * dwVendorId Identifies the manufacturer. May be zero if unknown.
  903. * dwDeviceId Identifies the type of chipset. May be zero if unknown.
  904. * dwSubSysId Identifies the subsystem, typically this means the particular board. May be zero if unknown.
  905. * dwRevision Identifies the revision level of the chipset. May be zero if unknown.
  906. *)
  907. dwVendorId: DWORD;
  908. dwDeviceId: DWORD;
  909. dwSubSysId: DWORD;
  910. dwRevision: DWORD;
  911. (*
  912. * This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the
  913. * driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to
  914. * reprofile the graphics subsystem.
  915. * This element can also be used to identify particular problematic drivers.
  916. *)
  917. guidDeviceIdentifier: TGuid;
  918. (*
  919. * This element is used to determine the Windows Hardware Quality Lab (WHQL)
  920. * certification level for this driver/device pair.
  921. *)
  922. dwWHQLLevel: DWORD;
  923. end;
  924. (*
  925. * Flags for the IDirectDraw4::GetDeviceIdentifier method
  926. *)
  927. (*
  928. * This flag causes GetDeviceIdentifier to return information about the host (typically 2D) adapter in a system equipped
  929. * with a stacked secondary 3D adapter. Such an adapter appears to the application as if it were part of the
  930. * host adapter, but is typically physcially located on a separate card. The stacked secondary's information is
  931. * returned when GetDeviceIdentifier's dwFlags field is zero, since this most accurately reflects the qualities
  932. * of the DirectDraw object involved.
  933. *)
  934. const
  935. DDGDI_GETHOSTIDENTIFIER = $00000001;
  936. (*
  937. * callbacks
  938. *)
  939. {typedef DWORD (FAR PASCAL *LPCLIPPERCALLBACK)(LPDIRECTDRAWCLIPPER lpDDClipper, HWND hWnd, DWORD code, LPVOID lpContext );
  940. #ifdef STREAMING
  941. typedef DWORD (FAR PASCAL *LPSURFACESTREAMINGCALLBACK)(DWORD);
  942. #endif}
  943. type
  944. (*
  945. * DDSURFACEDESC
  946. *)
  947. PDDSURFACEDESC = ^TDDSURFACEDESC;
  948. TDDSURFACEDESC = record
  949. dwSize: DWORD; // size of the DDSURFACEDESC structure
  950. dwFlags: DWORD; // determines what fields are valid
  951. dwHeight: DWORD; // height of surface to be created
  952. dwWidth: DWORD; // width of input surface
  953. case Integer of
  954. 0: (
  955. lPitch: LONG; // distance to start of next line (return value only)
  956. );
  957. 1: (
  958. dwLinearSize: DWORD; // Formless late-allocated optimized surface size
  959. dwBackBufferCount: DWORD; // number of back buffers requested
  960. case Integer of
  961. 0: (
  962. dwMipMapCount: DWORD; // number of mip-map levels requested
  963. );
  964. 1: (
  965. dwZBufferBitDepth: DWORD; // depth of Z buffer requested
  966. );
  967. 2: (
  968. dwRefreshRate: DWORD; // refresh rate (used when display mode is described)
  969. dwAlphaBitDepth: DWORD; // depth of alpha buffer requested
  970. dwReserved: DWORD; // reserved
  971. lpSurface: LPVOID; // pointer to the associated surface memory
  972. ddckCKDestOverlay: TDDCOLORKEY; // color key for destination overlay use
  973. ddckCKDestBlt: TDDCOLORKEY; // color key for destination blt use
  974. ddckCKSrcOverlay: TDDCOLORKEY; // color key for source overlay use
  975. ddckCKSrcBlt: TDDCOLORKEY; // color key for source blt use
  976. ddpfPixelFormat: TDDPIXELFORMAT; // pixel format description of the surface
  977. ddsCaps: TDDSCAPS; // direct draw surface capabilities
  978. );
  979. );
  980. end;
  981. (*
  982. * DDSURFACEDESC2
  983. *)
  984. PDDSURFACEDESC2 = ^TDDSURFACEDESC2;
  985. TDDSURFACEDESC2 = record
  986. dwSize: DWORD; // size of the DDSURFACEDESC structure
  987. dwFlags: DWORD; // determines what…