home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 May / CMCD0504.ISO / Software / Freeware / Programare / dspack / DSPACK231.exe / {app} / src / DirectX9 / DirectDraw.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2003-01-26  |  261.8 KB  |  7,163 lines

  1. {******************************************************************************}
  2. {*                                                                            *}
  3. {*  Copyright (C) Microsoft Corporation.  All Rights Reserved.                *}
  4. {*                                                                            *}
  5. {*  Files:      ddraw.h dvp.h                                                 *}
  6. {*  Content:    DirectDraw and DirectDrawVideoPort include files              *}
  7. {*                                                                            *}
  8. {*  DirectX 9.0 Delphi adaptation by Alexey Barkovoy                          *}
  9. {*  E-Mail: clootie@reactor.ru                                                *}
  10. {*                                                                            *}
  11. {*  Modified: 26-Jan-2003                                                     *}
  12. {*                                                                            *}
  13. {*  Based upon :                                                              *}
  14. {*    DirectX 7.0 Object Pascal adaptation by                                 *}
  15. {*      Erik Unger, e-Mail: DelphiDirectX@next-reality.com                    *}
  16. {*                                                                            *}
  17. {*  Latest version can be downloaded from:                                    *}
  18. {*     http://clootie.narod.ru/delphi/                                        *}
  19. {*                                                                            *}
  20. {******************************************************************************}
  21. {                                                                              }
  22. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
  23. {                                                                              }
  24. { The contents of this file are used with permission, subject to the Mozilla   }
  25. { Public License Version 1.1 (the "License"); you may not use this file except }
  26. { in compliance with the License. You may obtain a copy of the License at      }
  27. { http://www.mozilla.org/MPL/MPL-1.1.html                                      }
  28. {                                                                              }
  29. { Software distributed under the License is distributed on an "AS IS" basis,   }
  30. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  31. { the specific language governing rights and limitations under the License.    }
  32. {                                                                              }
  33. { Alternatively, the contents of this file may be used under the terms of the  }
  34. { GNU Lesser General Public License (the  "LGPL License"), in which case the   }
  35. { provisions of the LGPL License are applicable instead of those above.        }
  36. { If you wish to allow use of your version of this file only under the terms   }
  37. { of the LGPL License and not to allow others to use your version of this file }
  38. { under the MPL, indicate your decision by deleting  the provisions above and  }
  39. { replace  them with the notice and other provisions required by the LGPL      }
  40. { License.  If you do not delete the provisions above, a recipient may use     }
  41. { your version of this file under either the MPL or the LGPL License.          }
  42. {                                                                              }
  43. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  44. {                                                                              }
  45. {******************************************************************************}
  46.  
  47. ///////////////////////////////////////////////////////////////////////////////
  48. // Notes:
  49. //----------------------------------------------------------------------------
  50. // Possible input defines for this file, mapped to original C values:
  51. //   DIRECTDRAW_VERSION_7 : DIRECTDRAW_VERSION = 0x0700,
  52. //   DIRECTDRAW_VERSION_6 : DIRECTDRAW_VERSION = 0x0600,
  53. //   DIRECTDRAW_VERSION_5 : DIRECTDRAW_VERSION = 0x0500,
  54. //   DIRECTDRAW_VERSION_3 : DIRECTDRAW_VERSION = 0x0300,
  55. //   DIRECTDRAW_VERSION_LESS_3 : DIRECTDRAW_VERSION < 0x0300,
  56. //
  57. // By default DIRECTDRAW_VERSION_7 (DIRECTDRAW_VERSION = 0x0700) is assumed
  58. //
  59. // Also you can use generic DIRECTXx defines, so:
  60. //   DIRECTX7 equal to DIRECTDRAW_VERSION_7;
  61. //   DIRECTX6 equal to DIRECTDRAW_VERSION_6;
  62. //   DIRECTX5 equal to DIRECTDRAW_VERSION_5;
  63. //   DIRECTX3 equal to DIRECTDRAW_VERSION_3
  64. ///////////////////////////////////////////////////////////////////////////////
  65.  
  66. unit DirectDraw;
  67.  
  68. interface
  69.  
  70. {$I DirectX.inc}
  71.  
  72. ////////////////////////////////////////////////////////////////////////
  73. // Global level dynamic loading support
  74. {$IFDEF DYNAMIC_LINK_ALL}
  75.   {$DEFINE DIRECTDRAW_DYNAMIC_LINK}
  76. {$ENDIF}
  77. {$IFDEF DYNAMIC_LINK_EXPLICIT_ALL}
  78.   {$DEFINE DIRECTDRAW_DYNAMIC_LINK_EXPLICIT}
  79. {$ENDIF}
  80.  
  81. // Remove "dots" below to force some kind of dynamic linking
  82. {.$DEFINE DIRECTDRAW_DYNAMIC_LINK}
  83. {.$DEFINE DIRECTDRAW_DYNAMIC_LINK_EXPLICIT}
  84.  
  85. ////////////////////////////////////////////////////////////////////////
  86. // Assume for what DirectDraw version we will compile headers
  87. {$IFDEF DIRECTX7}
  88.   {$DEFINE DIRECTDRAW_VERSION_7}
  89. {$ENDIF}
  90. {$IFDEF DIRECTX6}
  91.   {$DEFINE DIRECTDRAW_VERSION_6}
  92. {$ENDIF}
  93. {$IFDEF DIRECTX5}
  94.   {$DEFINE DIRECTDRAW_VERSION_5}
  95. {$ENDIF}
  96. {$IFDEF DIRECTX3}
  97.   {$DEFINE DIRECTDRAW_VERSION_3}
  98. {$ENDIF}
  99.  
  100. {$IFNDEF DIRECTDRAW_VERSION_7}
  101.   {$IFNDEF DIRECTDRAW_VERSION_6}
  102.     {$IFNDEF DIRECTDRAW_VERSION_5}
  103.       {$IFNDEF DIRECTDRAW_VERSION_3}
  104.         {$IFNDEF DIRECTDRAW_VERSION_LESS_3}
  105.           {$DEFINE DIRECTDRAW_VERSION_7} // Compiling for DirectDraw7 by default
  106.         {$ENDIF}
  107.       {$ENDIF}
  108.     {$ENDIF}
  109.   {$ENDIF}
  110. {$ENDIF}
  111.  
  112. ////////////////////////////////////////////////////////////////////////
  113. // Emit conditionals to C++Builder compiler
  114. {$IFDEF DIRECTDRAW_VERSION_LESS_3}
  115.   {$HPPEMIT '#define DIRECTDRAW_VERSION         0x0100'}
  116. {$ENDIF}
  117. {$IFDEF DIRECTDRAW_VERSION_3}
  118.   {$HPPEMIT '#define DIRECTDRAW_VERSION         0x0300'}
  119. {$ENDIF}
  120. {$IFDEF DIRECTDRAW_VERSION_5}
  121.   {$HPPEMIT '#define DIRECTDRAW_VERSION         0x0500'}
  122. {$ENDIF}
  123. {$IFDEF DIRECTDRAW_VERSION_6}
  124.   {$HPPEMIT '#define DIRECTDRAW_VERSION         0x0600'}
  125. {$ENDIF}
  126. {$IFDEF DIRECTDRAW_VERSION_7}
  127.   {$HPPEMIT '#define DIRECTDRAW_VERSION         0x0700'}
  128. {$ENDIF}
  129.  
  130. ////////////////////////////////////////////////////////////////////////
  131. // Define symbols for '<=' comparision
  132. {$IFDEF DIRECTDRAW_VERSION_7}
  133.   {$DEFINE DIRECTDRAW_VERSION_6}
  134. {$ENDIF}
  135. {$IFDEF DIRECTDRAW_VERSION_6}
  136.   {$DEFINE DIRECTDRAW_VERSION_5}
  137. {$ENDIF}
  138. {$IFDEF DIRECTDRAW_VERSION_5}
  139.   {$DEFINE DIRECTDRAW_VERSION_3}
  140. {$ENDIF}
  141. {$IFDEF DIRECTDRAW_VERSION_3}
  142.   {$DEFINE DIRECTDRAW_VERSION_LESS_3}
  143. {$ENDIF}
  144.  
  145. (*$HPPEMIT '#include "ddraw.h"' *)
  146. (*$HPPEMIT '#include "dvp.h"' *)
  147.  
  148. uses
  149.   Windows;
  150.  
  151.   
  152. (*==========================================================================;
  153.  *
  154.  *  Copyright (C) Microsoft Corporation.  All Rights Reserved.
  155.  *
  156.  *  File:       ddraw.h
  157.  *  Content:    DirectDraw include file
  158.  *
  159.  ***************************************************************************)
  160.  
  161. function MAKEFOURCC(ch0, ch1, ch2, ch3: Char): DWORD;
  162. {$EXTERNALSYM MAKEFOURCC}
  163.  
  164. (*
  165.  * FOURCC codes for DX compressed-texture pixel formats
  166.  *)
  167. const
  168.   //#define FOURCC_DXT1  (MAKEFOURCC('D','X','T','1'))
  169.   FOURCC_DXT1 = DWORD(Byte('D') or (Byte('X') shl 8) or (Byte('T') shl 16) or (Byte('1') shl 24));
  170.   {$EXTERNALSYM FOURCC_DXT1}
  171.   //#define FOURCC_DXT2  (MAKEFOURCC('D','X','T','2'))
  172.   FOURCC_DXT2 = DWORD(Byte('D') or (Byte('X') shl 8) or (Byte('T') shl 16) or (Byte('2') shl 24));
  173.   {$EXTERNALSYM FOURCC_DXT2}
  174.   //#define FOURCC_DXT3  (MAKEFOURCC('D','X','T','3'))
  175.   FOURCC_DXT3 = DWORD(Byte('D') or (Byte('X') shl 8) or (Byte('T') shl 16) or (Byte('3') shl 24));
  176.   {$EXTERNALSYM FOURCC_DXT3}
  177.   //#define FOURCC_DXT4  (MAKEFOURCC('D','X','T','4'))
  178.   FOURCC_DXT4 = DWORD(Byte('D') or (Byte('X') shl 8) or (Byte('T') shl 16) or (Byte('4') shl 24));
  179.   {$EXTERNALSYM FOURCC_DXT4}
  180.   //#define FOURCC_DXT5  (MAKEFOURCC('D','X','T','5'))
  181.   FOURCC_DXT5 = DWORD(Byte('D') or (Byte('X') shl 8) or (Byte('T') shl 16) or (Byte('5') shl 24));
  182.   {$EXTERNALSYM FOURCC_DXT5}
  183.  
  184. (*
  185.  * GUIDS used by DirectDraw objects
  186.  *)
  187. const
  188.   CLSID_DirectDraw: TGUID = '{D7B70EE0-4340-11CF-B063-0020AFC2CD35}';
  189.   {$EXTERNALSYM CLSID_DirectDraw}
  190.   CLSID_DirectDraw7: TGUID = '{3c305196-50db-11d3-9cfe-00c04fd930c5}';
  191.   {$EXTERNALSYM CLSID_DirectDraw7}
  192.   CLSID_DirectDrawClipper: TGUID = '{593817A0-7DB3-11CF-A2DE-00AA00b93356}';
  193.   {$EXTERNALSYM CLSID_DirectDrawClipper}
  194.   (* These GUID's defined later by typedefing to Delphi interfaces
  195.   DEFINE_GUID( IID_IDirectDraw,                   0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
  196.   DEFINE_GUID( IID_IDirectDraw2,                  0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 );
  197.   DEFINE_GUID( IID_IDirectDraw4,                  0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
  198.   DEFINE_GUID( IID_IDirectDraw7,                  0x15e65ec0,0x3b9c,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b );
  199.   DEFINE_GUID( IID_IDirectDrawSurface,            0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
  200.   DEFINE_GUID( IID_IDirectDrawSurface2,           0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27 );
  201.   DEFINE_GUID( IID_IDirectDrawSurface3,           0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB );
  202.   DEFINE_GUID( IID_IDirectDrawSurface4,           0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B );
  203.   DEFINE_GUID( IID_IDirectDrawSurface7,           0x06675a80,0x3b9b,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b );
  204.   DEFINE_GUID( IID_IDirectDrawPalette,            0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
  205.   DEFINE_GUID( IID_IDirectDrawClipper,            0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
  206.   DEFINE_GUID( IID_IDirectDrawColorControl,       0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 );
  207.   DEFINE_GUID( IID_IDirectDrawGammaControl,       0x69C11C3E,0xB46B,0x11D1,0xAD,0x7A,0x00,0xC0,0x4F,0xC2,0x9B,0x4E );
  208.   *)
  209.  
  210. const
  211.   DD_ROP_SPACE = (256 div 32);       // space required to store ROP array
  212.   {$EXTERNALSYM DD_ROP_SPACE}
  213.  
  214.   MAX_DDDEVICEID_STRING    = 512;
  215.   {$EXTERNALSYM MAX_DDDEVICEID_STRING}
  216.  
  217.  
  218. (*============================================================================
  219.  *
  220.  * DirectDraw Structures
  221.  *
  222.  * Various structures used to invoke DirectDraw.
  223.  *
  224.  *==========================================================================*)
  225.  
  226. var
  227.   NilGUID : TGUID = '{00000000-0000-0000-0000-000000000000}';
  228.  
  229.  
  230. type
  231.   //Clootie: This was originally in Erik Unger headers - don't know why, so leave it alone
  232.   TRefGUID = packed record
  233.     case Integer of
  234.     1: (guid : PGUID);
  235.     2: (dwFlags : DWORD);
  236.   end;
  237.  
  238.   REFGUID = PGUID;
  239.   {$EXTERNALSYM REFGUID}
  240.  
  241.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDraw);'}
  242.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDraw2);'}
  243.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDraw4);'}
  244.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDraw7);'}
  245.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawSurface);'}
  246.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawSurface2);'}
  247.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawSurface3);'}
  248.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawSurface4);'}
  249.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawSurface7);'}
  250.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawPalette);'}
  251.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawClipper);'}
  252.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawColorControl);'}
  253.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawGammaControl);'}
  254.   
  255.   IDirectDraw = interface;
  256.   {$EXTERNALSYM IDirectDraw}
  257.   IDirectDraw2 = interface;
  258.   {$EXTERNALSYM IDirectDraw2}
  259.   IDirectDraw4 = interface;
  260.   {$EXTERNALSYM IDirectDraw4}
  261.   IDirectDraw7 = interface;
  262.   {$EXTERNALSYM IDirectDraw7}
  263.   IDirectDrawSurface = interface;
  264.   {$EXTERNALSYM IDirectDrawSurface}
  265.   IDirectDrawSurface2 = interface;
  266.   {$EXTERNALSYM IDirectDrawSurface2}
  267.   IDirectDrawSurface3 = interface;
  268.   {$EXTERNALSYM IDirectDrawSurface3}
  269.   IDirectDrawSurface4 = interface;
  270.   {$EXTERNALSYM IDirectDrawSurface4}
  271.   IDirectDrawSurface7 = interface;
  272.   {$EXTERNALSYM IDirectDrawSurface7}
  273.  
  274.   IDirectDrawPalette = interface;
  275.   {$EXTERNALSYM IDirectDrawPalette}
  276.   IDirectDrawClipper = interface;
  277.   {$EXTERNALSYM IDirectDrawClipper}
  278.   IDirectDrawColorControl = interface;
  279.   {$EXTERNALSYM IDirectDrawColorControl}
  280.   IDirectDrawGammaControl = interface;
  281.   {$EXTERNALSYM IDirectDrawGammaControl}
  282.  
  283. (*
  284.  * Generic pixel format with 8-bit RGB and alpha components
  285.  *)
  286.   PDDARGB = ^TDDARGB;
  287.   _DDARGB = packed record
  288.     blue:     Byte;
  289.     green:    Byte;
  290.     red:      Byte;
  291.     alpha:    Byte;
  292.   end;
  293.   {$EXTERNALSYM _DDARGB}
  294.   DDARGB = _DDARGB;
  295.   {$EXTERNALSYM DDARGB}
  296.   TDDARGB = _DDARGB;
  297.  
  298. (*
  299.  * This version of the structure remains for backwards source compatibility.
  300.  * The DDARGB structure is the one that should be used for all DirectDraw APIs.
  301.  *)
  302.   PDDRGBA = ^TDDRGBA;
  303.   _DDRGBA = packed record
  304.     red   : Byte;
  305.     green : Byte;
  306.     blue  : Byte;
  307.     alpha : Byte;
  308.   end;
  309.   {$EXTERNALSYM _DDRGBA}
  310.   DDRGBA = _DDRGBA;
  311.   {$EXTERNALSYM DDRGBA}
  312.   TDDRGBA = _DDRGBA;
  313.  
  314. (*
  315.  * TDDColorKey
  316.  *)
  317.   PDDColorKey = ^TDDColorKey;
  318.   _DDCOLORKEY = packed record
  319.     dwColorSpaceLowValue: DWORD;   // low boundary of color space that is to
  320.                                    // be treated as Color Key, inclusive
  321.     dwColorSpaceHighValue: DWORD;  // high boundary of color space that is
  322.                                    // to be treated as Color Key, inclusive
  323.   end;
  324.   {$EXTERNALSYM _DDCOLORKEY}
  325.   DDCOLORKEY = _DDCOLORKEY;
  326.   {$EXTERNALSYM DDCOLORKEY}
  327.   TDDColorKey = _DDCOLORKEY;
  328.  
  329. // Delphi 5 and up don't allow interfaces in variant records
  330. // so we have to use pointers instead (which can be type-casted into interfaces):
  331.  
  332. {$IFDEF COMPILER5_UP}
  333.   PDirectDrawSurface = Pointer;
  334. {$ELSE}
  335.   PDirectDrawSurface = IDirectDrawSurface;
  336. {$ENDIF}
  337.  
  338. (*
  339.  * TDDBltFX
  340.  * Used to pass override information to the DIRECTDRAWSURFACE callback Blt.
  341.  *)
  342.   PDDBltFX = ^TDDBltFX;
  343.   _DDBLTFX = packed record
  344.     dwSize                        : DWORD;     // size of structure
  345.     dwDDFX                        : DWORD;     // FX operations
  346.     dwROP                         : DWORD;     // Win32 raster operations
  347.     dwDDROP                       : DWORD;     // Raster operations new for DirectDraw
  348.     dwRotationAngle               : DWORD;     // Rotation angle for blt
  349.     dwZBufferOpCode               : DWORD;     // ZBuffer compares
  350.     dwZBufferLow                  : DWORD;     // Low limit of Z buffer
  351.     dwZBufferHigh                 : DWORD;     // High limit of Z buffer
  352.     dwZBufferBaseDest             : DWORD;     // Destination base value
  353.     dwZDestConstBitDepth          : DWORD;     // Bit depth used to specify Z constant for destination
  354.     case Integer of
  355.     0: (
  356.       dwZDestConst                : DWORD      // Constant to use as Z buffer for dest
  357.      );
  358.     1: (
  359.       lpDDSZBufferDest            : PDirectDrawSurface; // Surface to use as Z buffer for dest
  360.       dwZSrcConstBitDepth         : DWORD;     // Bit depth used to specify Z constant for source
  361.       case integer of
  362.       0: (
  363.         dwZSrcConst               : DWORD;     // Constant to use as Z buffer for src
  364.        );
  365.       1: (
  366.         lpDDSZBufferSrc           : PDirectDrawSurface; // Surface to use as Z buffer for src
  367.         dwAlphaEdgeBlendBitDepth  : DWORD;     // Bit depth used to specify constant for alpha edge blend
  368.         dwAlphaEdgeBlend          : DWORD;     // Alpha for edge blending
  369.         dwReserved                : DWORD;
  370.         dwAlphaDestConstBitDepth  : DWORD;     // Bit depth used to specify alpha constant for destination
  371.         case integer of
  372.         0: (
  373.           dwAlphaDestConst        : DWORD;     // Constant to use as Alpha Channel
  374.          );
  375.         1: (
  376.           lpDDSAlphaDest          : PDirectDrawSurface; // Surface to use as Alpha Channel
  377.           dwAlphaSrcConstBitDepth : DWORD;     // Bit depth used to specify alpha constant for source
  378.           case integer of
  379.           0: (
  380.             dwAlphaSrcConst       : DWORD;     // Constant to use as Alpha Channel
  381.           );
  382.           1: (
  383.             lpDDSAlphaSrc         : PDirectDrawSurface; // Surface to use as Alpha Channel
  384.             case integer of
  385.             0: (
  386.               dwFillColor         : DWORD;     // color in RGB or Palettized
  387.             );
  388.             1: (
  389.               dwFillDepth         : DWORD;     // depth value for z-buffer
  390.             );
  391.             2: (
  392.               dwFillPixel         : DWORD;     // pixel value
  393.             );
  394.             3: (
  395.               lpDDSPattern        : PDirectDrawSurface; // Surface to use as pattern
  396.               ddckDestColorkey    : TDDColorKey; // DestColorkey override
  397.               ddckSrcColorkey     : TDDColorKey; // SrcColorkey override
  398.             )
  399.         )
  400.       )
  401.     )
  402.   )
  403.   end;
  404.   {$EXTERNALSYM _DDBLTFX}
  405.   DDBLTFX = _DDBLTFX;
  406.   {$EXTERNALSYM DDBLTFX}
  407.   TDDBltFX = _DDBLTFX;
  408.  
  409. (*
  410.  * TDDSCaps
  411.  *)
  412.   PDDSCaps = ^TDDSCaps;
  413.   _DDSCAPS = packed record
  414.     dwCaps: DWORD;         // capabilities of surface wanted
  415.   end;
  416.   {$EXTERNALSYM _DDSCAPS}
  417.   DDSCAPS = _DDSCAPS;
  418.   {$EXTERNALSYM DDSCAPS}
  419.   TDDSCaps = _DDSCAPS;
  420.  
  421. (*
  422.  * TDDOSCaps
  423.  *)
  424.   PDDOSCaps = ^TDDOSCaps;
  425.   _DDOSCAPS = packed record
  426.     dwCaps: DWORD;         // capabilities of surface wanted
  427.   end;
  428.   {$EXTERNALSYM _DDOSCAPS}
  429.   DDOSCAPS = _DDOSCAPS;
  430.   {$EXTERNALSYM DDOSCAPS}
  431.   TDDOSCaps = _DDOSCAPS;
  432.  
  433. (*
  434.  * This structure is used internally by DirectDraw.
  435.  *)
  436.   PDDSCapsEx = ^TDDSCapsEx;
  437.   _DDSCAPSEX = packed record
  438.     dwCaps2 : DWORD;
  439.     dwCaps3 : DWORD;
  440.     dwCaps4 : DWORD;
  441.   end;
  442.   {$EXTERNALSYM _DDSCAPSEX}
  443.   DDSCAPSEX = _DDSCAPSEX;
  444.   {$EXTERNALSYM DDSCAPSEX}
  445.   TDDSCapsEx = _DDSCAPSEX;
  446.  
  447. (*
  448.  * TDDSCaps2
  449.  *)
  450.   PDDSCaps2 = ^TDDSCaps2;
  451.   _DDSCAPS2 = packed record
  452.     dwCaps: DWORD;         // capabilities of surface wanted
  453.     dwCaps2 : DWORD;
  454.     dwCaps3 : DWORD;
  455.     dwCaps4 : DWORD;
  456.   end;
  457.   {$EXTERNALSYM _DDSCAPS2}
  458.   DDSCAPS2 = _DDSCAPS2;
  459.   {$EXTERNALSYM DDSCAPS2}
  460.   TDDSCaps2 = _DDSCAPS2;
  461.  
  462. (*
  463.  * NOTE: Our choosen structure number scheme is to append a single digit to
  464.  * the end of the structure giving the version that structure is associated
  465.  * with.
  466.  *)
  467.  
  468. (*
  469.  * This structure represents the DDCAPS structure released in DirectDraw 1.0.  It is used internally
  470.  * by DirectDraw to interpret caps passed into ddraw by drivers written prior to the release of DirectDraw 2.0.
  471.  * New applications should use the DDCAPS structure defined below.
  472.  *)
  473.   PDDCaps_DX1 = ^TDDCaps_DX1;
  474.   _DDCAPS_DX1 = packed record
  475.     dwSize: DWORD;                 // size of the DDDRIVERCAPS structure
  476.     dwCaps: DWORD;                 // driver specific capabilities
  477.     dwCaps2: DWORD;                // more driver specific capabilites
  478.     dwCKeyCaps: DWORD;             // color key capabilities of the surface
  479.     dwFXCaps: DWORD;               // driver specific stretching and effects capabilites
  480.     dwFXAlphaCaps: DWORD;          // alpha driver specific capabilities
  481.     dwPalCaps: DWORD;              // palette capabilities
  482.     dwSVCaps: DWORD;               // stereo vision capabilities
  483.     dwAlphaBltConstBitDepths: DWORD;       // DDBD_2,4,8
  484.     dwAlphaBltPixelBitDepths: DWORD;       // DDBD_1,2,4,8
  485.     dwAlphaBltSurfaceBitDepths: DWORD;     // DDBD_1,2,4,8
  486.     dwAlphaOverlayConstBitDepths: DWORD;   // DDBD_2,4,8
  487.     dwAlphaOverlayPixelBitDepths: DWORD;   // DDBD_1,2,4,8
  488.     dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  489.     dwZBufferBitDepths: DWORD;             // DDBD_8,16,24,32
  490.     dwVidMemTotal: DWORD;          // total amount of video memory
  491.     dwVidMemFree: DWORD;           // amount of free video memory
  492.     dwMaxVisibleOverlays: DWORD;   // maximum number of visible overlays
  493.     dwCurrVisibleOverlays: DWORD;  // current number of visible overlays
  494.     dwNumFourCCCodes: DWORD;       // number of four cc codes
  495.     dwAlignBoundarySrc: DWORD;     // source rectangle alignment
  496.     dwAlignSizeSrc: DWORD;         // source rectangle byte size
  497.     dwAlignBoundaryDest: DWORD;    // dest rectangle alignment
  498.     dwAlignSizeDest: DWORD;        // dest rectangle byte size
  499.     dwAlignStrideAlign: DWORD;     // stride alignment
  500.     dwRops: Array [0..DD_ROP_SPACE-1] of DWORD;   // ROPS supported
  501.     ddsCaps: TDDSCaps;             // TDDSCaps structure has all the general capabilities
  502.     dwMinOverlayStretch: DWORD;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  503.     dwMaxOverlayStretch: DWORD;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  504.     dwMinLiveVideoStretch: DWORD;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  505.     dwMaxLiveVideoStretch: DWORD;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  506.     dwMinHwCodecStretch: DWORD;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  507.     dwMaxHwCodecStretch: DWORD;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  508.     dwReserved1: DWORD;            // reserved
  509.     dwReserved2: DWORD;            // reserved
  510.     dwReserved3: DWORD;            // reserved
  511.   end;
  512.   {$EXTERNALSYM _DDCAPS_DX1}
  513.   DDCAPS_DX1 = _DDCAPS_DX1;
  514.   {$EXTERNALSYM DDCAPS_DX1}
  515.   TDDCaps_DX1 = _DDCAPS_DX1;
  516.  
  517. (*
  518.  * This structure is the TDDCaps structure as it was in version 2 and 3 of Direct X.
  519.  * It is present for back compatability.
  520.  *)
  521.   PDDCaps_DX3 = ^TDDCaps_DX3;
  522.   _DDCAPS_DX3 = packed record
  523.     dwSize: DWORD;                 // size of the DDDRIVERCAPS structure
  524.     dwCaps: DWORD;                 // driver specific capabilities
  525.     dwCaps2: DWORD;                // more driver specific capabilites
  526.     dwCKeyCaps: DWORD;             // color key capabilities of the surface
  527.     dwFXCaps: DWORD;               // driver specific stretching and effects capabilites
  528.     dwFXAlphaCaps: DWORD;          // alpha driver specific capabilities
  529.     dwPalCaps: DWORD;              // palette capabilities
  530.     dwSVCaps: DWORD;               // stereo vision capabilities
  531.     dwAlphaBltConstBitDepths: DWORD;       // DDBD_2,4,8
  532.     dwAlphaBltPixelBitDepths: DWORD;       // DDBD_1,2,4,8
  533.     dwAlphaBltSurfaceBitDepths: DWORD;     // DDBD_1,2,4,8
  534.     dwAlphaOverlayConstBitDepths: DWORD;   // DDBD_2,4,8
  535.     dwAlphaOverlayPixelBitDepths: DWORD;   // DDBD_1,2,4,8
  536.     dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  537.     dwZBufferBitDepths: DWORD;             // DDBD_8,16,24,32
  538.     dwVidMemTotal: DWORD;          // total amount of video memory
  539.     dwVidMemFree: DWORD;           // amount of free video memory
  540.     dwMaxVisibleOverlays: DWORD;   // maximum number of visible overlays
  541.     dwCurrVisibleOverlays: DWORD;  // current number of visible overlays
  542.     dwNumFourCCCodes: DWORD;       // number of four cc codes
  543.     dwAlignBoundarySrc: DWORD;     // source rectangle alignment
  544.     dwAlignSizeSrc: DWORD;         // source rectangle byte size
  545.     dwAlignBoundaryDest: DWORD;    // dest rectangle alignment
  546.     dwAlignSizeDest: DWORD;        // dest rectangle byte size
  547.     dwAlignStrideAlign: DWORD;     // stride alignment
  548.     dwRops: Array [0..DD_ROP_SPACE-1] of DWORD;   // ROPS supported
  549.     ddsCaps: TDDSCaps;             // TDDSCaps structure has all the general capabilities
  550.     dwMinOverlayStretch: DWORD;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  551.     dwMaxOverlayStretch: DWORD;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  552.     dwMinLiveVideoStretch: DWORD;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  553.     dwMaxLiveVideoStretch: DWORD;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  554.     dwMinHwCodecStretch: DWORD;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  555.     dwMaxHwCodecStretch: DWORD;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  556.     dwReserved1: DWORD;            // reserved
  557.     dwReserved2: DWORD;            // reserved
  558.     dwReserved3: DWORD;            // reserved
  559.     dwSVBCaps: DWORD;              // driver specific capabilities for System->Vmem blts
  560.     dwSVBCKeyCaps: DWORD;          // driver color key capabilities for System->Vmem blts
  561.     dwSVBFXCaps: DWORD;            // driver FX capabilities for System->Vmem blts
  562.     dwSVBRops: array[0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
  563.     dwVSBCaps: DWORD;              // driver specific capabilities for Vmem->System blts
  564.     dwVSBCKeyCaps: DWORD;          // driver color key capabilities for Vmem->System blts
  565.     dwVSBFXCaps: DWORD;            // driver FX capabilities for Vmem->System blts
  566.     dwVSBRops: array[0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
  567.     dwSSBCaps: DWORD;              // driver specific capabilities for System->System blts
  568.     dwSSBCKeyCaps: DWORD;          // driver color key capabilities for System->System blts
  569.     dwSSBFXCaps: DWORD;            // driver FX capabilities for System->System blts
  570.     dwSSBRops: array[0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
  571.     dwReserved4 : DWORD;
  572.     dwReserved5 : DWORD;
  573.     dwReserved6 : DWORD;
  574.   end;
  575.   {$EXTERNALSYM _DDCAPS_DX3}
  576.   DDCAPS_DX3 = _DDCAPS_DX3;
  577.   {$EXTERNALSYM DDCAPS_DX3}
  578.   TDDCaps_DX3 = _DDCAPS_DX3;
  579.  
  580. (*
  581.  * This structure is the TDDCaps structure as it was in version 5 of Direct X.
  582.  * It is present for back compatability.
  583.  *)
  584.   PDDCaps_DX5 = ^TDDCaps_DX5;
  585.   _DDCAPS_DX5 = packed record
  586.     dwSize: DWORD;                 // size of the DDDRIVERCAPS structure
  587.     dwCaps: DWORD;                 // driver specific capabilities
  588.     dwCaps2: DWORD;                // more driver specific capabilites
  589.     dwCKeyCaps: DWORD;             // color key capabilities of the surface
  590.     dwFXCaps: DWORD;               // driver specific stretching and effects capabilites
  591.     dwFXAlphaCaps: DWORD;          // alpha driver specific capabilities
  592.     dwPalCaps: DWORD;              // palette capabilities
  593.     dwSVCaps: DWORD;               // stereo vision capabilities
  594.     dwAlphaBltConstBitDepths: DWORD;       // DDBD_2,4,8
  595.     dwAlphaBltPixelBitDepths: DWORD;       // DDBD_1,2,4,8
  596.     dwAlphaBltSurfaceBitDepths: DWORD;     // DDBD_1,2,4,8
  597.     dwAlphaOverlayConstBitDepths: DWORD;   // DDBD_2,4,8
  598.     dwAlphaOverlayPixelBitDepths: DWORD;   // DDBD_1,2,4,8
  599.     dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  600.     dwZBufferBitDepths: DWORD;             // DDBD_8,16,24,32
  601.     dwVidMemTotal: DWORD;          // total amount of video memory
  602.     dwVidMemFree: DWORD;           // amount of free video memory
  603.     dwMaxVisibleOverlays: DWORD;   // maximum number of visible overlays
  604.     dwCurrVisibleOverlays: DWORD;  // current number of visible overlays
  605.     dwNumFourCCCodes: DWORD;       // number of four cc codes
  606.     dwAlignBoundarySrc: DWORD;     // source rectangle alignment
  607.     dwAlignSizeSrc: DWORD;         // source rectangle byte size
  608.     dwAlignBoundaryDest: DWORD;    // dest rectangle alignment
  609.     dwAlignSizeDest: DWORD;        // dest rectangle byte size
  610.     dwAlignStrideAlign: DWORD;     // stride alignment
  611.     dwRops: Array [0..DD_ROP_SPACE-1] of DWORD;   // ROPS supported
  612.     ddsCaps: TDDSCaps;             // TDDSCaps structure has all the general capabilities
  613.     dwMinOverlayStretch: DWORD;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  614.     dwMaxOverlayStretch: DWORD;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  615.     dwMinLiveVideoStretch: DWORD;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  616.     dwMaxLiveVideoStretch: DWORD;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  617.     dwMinHwCodecStretch: DWORD;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  618.     dwMaxHwCodecStretch: DWORD;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  619.     dwReserved1: DWORD;            // reserved
  620.     dwReserved2: DWORD;            // reserved
  621.     dwReserved3: DWORD;            // reserved
  622.     dwSVBCaps: DWORD;              // driver specific capabilities for System->Vmem blts
  623.     dwSVBCKeyCaps: DWORD;          // driver color key capabilities for System->Vmem blts
  624.     dwSVBFXCaps: DWORD;            // driver FX capabilities for System->Vmem blts
  625.     dwSVBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
  626.     dwVSBCaps: DWORD;              // driver specific capabilities for Vmem->System blts
  627.     dwVSBCKeyCaps: DWORD;          // driver color key capabilities for Vmem->System blts
  628.     dwVSBFXCaps: DWORD;            // driver FX capabilities for Vmem->System blts
  629.     dwVSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
  630.     dwSSBCaps: DWORD;              // driver specific capabilities for System->System blts
  631.     dwSSBCKeyCaps: DWORD;          // driver color key capabilities for System->System blts
  632.     dwSSBFXCaps: DWORD;            // driver FX capabilities for System->System blts
  633.     dwSSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
  634.     // Members added for DX5:
  635.     dwMaxVideoPorts: DWORD;       // maximum number of usable video ports
  636.     dwCurrVideoPorts: DWORD;       // current number of video ports used
  637.     dwSVBCaps2: DWORD;           // more driver specific capabilities for System->Vmem blts
  638.     dwNLVBCaps: DWORD;           // driver specific capabilities for non-local->local vidmem blts
  639.     dwNLVBCaps2: DWORD;           // more driver specific capabilities non-local->local vidmem blts
  640.     dwNLVBCKeyCaps: DWORD;       // driver color key capabilities for non-local->local vidmem blts
  641.     dwNLVBFXCaps: DWORD;       // driver FX capabilities for non-local->local blts
  642.     dwNLVBRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for non-local->local blts
  643.   end;
  644.   {$EXTERNALSYM _DDCAPS_DX5}
  645.   DDCAPS_DX5 = _DDCAPS_DX5;
  646.   {$EXTERNALSYM DDCAPS_DX5}
  647.   TDDCaps_DX5 = _DDCAPS_DX5;
  648.  
  649.   PDDCaps_DX6 = ^TDDCaps_DX6;
  650.   _DDCAPS_DX6 = packed record
  651.     dwSize: DWORD;                 // size of the DDDRIVERCAPS structure
  652.     dwCaps: DWORD;                 // driver specific capabilities
  653.     dwCaps2: DWORD;                // more driver specific capabilites
  654.     dwCKeyCaps: DWORD;             // color key capabilities of the surface
  655.     dwFXCaps: DWORD;               // driver specific stretching and effects capabilites
  656.     dwFXAlphaCaps: DWORD;          // alpha driver specific capabilities
  657.     dwPalCaps: DWORD;              // palette capabilities
  658.     dwSVCaps: DWORD;               // stereo vision capabilities
  659.     dwAlphaBltConstBitDepths: DWORD;       // DDBD_2,4,8
  660.     dwAlphaBltPixelBitDepths: DWORD;       // DDBD_1,2,4,8
  661.     dwAlphaBltSurfaceBitDepths: DWORD;     // DDBD_1,2,4,8
  662.     dwAlphaOverlayConstBitDepths: DWORD;   // DDBD_2,4,8
  663.     dwAlphaOverlayPixelBitDepths: DWORD;   // DDBD_1,2,4,8
  664.     dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  665.     dwZBufferBitDepths: DWORD;             // DDBD_8,16,24,32
  666.     dwVidMemTotal: DWORD;          // total amount of video memory
  667.     dwVidMemFree: DWORD;           // amount of free video memory
  668.     dwMaxVisibleOverlays: DWORD;   // maximum number of visible overlays
  669.     dwCurrVisibleOverlays: DWORD;  // current number of visible overlays
  670.     dwNumFourCCCodes: DWORD;       // number of four cc codes
  671.     dwAlignBoundarySrc: DWORD;     // source rectangle alignment
  672.     dwAlignSizeSrc: DWORD;         // source rectangle byte size
  673.     dwAlignBoundaryDest: DWORD;    // dest rectangle alignment
  674.     dwAlignSizeDest: DWORD;        // dest rectangle byte size
  675.     dwAlignStrideAlign: DWORD;     // stride alignment
  676.     dwRops: Array [0..DD_ROP_SPACE-1] of DWORD;   // ROPS supported
  677.     ddsOldCaps: TDDSCaps;          // Was dssCaps: TDDSCaps. ddsCaps is of type TDDScaps2 for DX6
  678.     dwMinOverlayStretch: DWORD;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  679.     dwMaxOverlayStretch: DWORD;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  680.     dwMinLiveVideoStretch: DWORD;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  681.     dwMaxLiveVideoStretch: DWORD;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  682.     dwMinHwCodecStretch: DWORD;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  683.     dwMaxHwCodecStretch: DWORD;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  684.     dwReserved1: DWORD;            // reserved
  685.     dwReserved2: DWORD;            // reserved
  686.     dwReserved3: DWORD;            // reserved
  687.     dwSVBCaps: DWORD;              // driver specific capabilities for System->Vmem blts
  688.     dwSVBCKeyCaps: DWORD;          // driver color key capabilities for System->Vmem blts
  689.     dwSVBFXCaps: DWORD;            // driver FX capabilities for System->Vmem blts
  690.     dwSVBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
  691.     dwVSBCaps: DWORD;              // driver specific capabilities for Vmem->System blts
  692.     dwVSBCKeyCaps: DWORD;          // driver color key capabilities for Vmem->System blts
  693.     dwVSBFXCaps: DWORD;            // driver FX capabilities for Vmem->System blts
  694.     dwVSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
  695.     dwSSBCaps: DWORD;              // driver specific capabilities for System->System blts
  696.     dwSSBCKeyCaps: DWORD;          // driver color key capabilities for System->System blts
  697.     dwSSBFXCaps: DWORD;            // driver FX capabilities for System->System blts
  698.     dwSSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
  699.     // Members added for DX5:
  700.     dwMaxVideoPorts: DWORD;       // maximum number of usable video ports
  701.     dwCurrVideoPorts: DWORD;       // current number of video ports used
  702.     dwSVBCaps2: DWORD;           // more driver specific capabilities for System->Vmem blts
  703.     dwNLVBCaps: DWORD;           // driver specific capabilities for non-local->local vidmem blts
  704.     dwNLVBCaps2: DWORD;           // more driver specific capabilities non-local->local vidmem blts
  705.     dwNLVBCKeyCaps: DWORD;       // driver color key capabilities for non-local->local vidmem blts
  706.     dwNLVBFXCaps: DWORD;       // driver FX capabilities for non-local->local blts
  707.     dwNLVBRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for non-local->local blts
  708.     // Members added for DX6 release
  709.     ddsCaps : TDDSCaps2 ;          // Surface Caps
  710.   end;
  711.   {$EXTERNALSYM _DDCAPS_DX6}
  712.   DDCAPS_DX6 = _DDCAPS_DX6;
  713.   {$EXTERNALSYM DDCAPS_DX6}
  714.   TDDCaps_DX6 = _DDCAPS_DX6;
  715.  
  716.   _DDCAPS_DX7 = TDDCaps_DX6;
  717.   {$EXTERNALSYM _DDCAPS_DX7}
  718.   DDCAPS_DX7 = _DDCAPS_DX7;
  719.   {$EXTERNALSYM DDCAPS_DX7}
  720.   PDDCaps_DX7 = ^TDDCaps_DX7;
  721.   TDDCaps_DX7 = TDDCaps_DX6;
  722.  
  723. {$IFDEF DIRECTDRAW_VERSION_7}
  724.   PDDCaps = PDDCaps_DX7;
  725.   TDDCaps = TDDCaps_DX7;
  726. {$ELSE}
  727. {$IFDEF DIRECTDRAW_VERSION_6}
  728.   PDDCaps = PDDCaps_DX6;
  729.   TDDCaps = TDDCaps_DX6;
  730. {$ELSE}
  731. {$IFDEF DIRECTDRAW_VERSION_5}
  732.   PDDCaps = PDDCaps_DX5;
  733.   TDDCaps = TDDCaps_DX5;
  734. {$ELSE}
  735. {$IFDEF DIRECTDRAW_VERSION_3}
  736.   PDDCaps = PDDCaps_DX3;
  737.   TDDCaps = TDDCaps_DX3;
  738. {$ELSE}
  739.   PDDCaps = PDDCaps_DX1;
  740.   TDDCaps = TDDCaps_DX1;
  741. {$ENDIF}
  742. {$ENDIF}
  743. {$ENDIF}
  744. {$ENDIF}
  745.  
  746.  
  747.  
  748. (*
  749.  * TDDPixelFormat
  750.  *)
  751.   PDDPixelFormat = ^TDDPixelFormat;
  752.   _DDPIXELFORMAT = packed record
  753.     dwSize: DWORD;                 // size of structure
  754.     dwFlags: DWORD;                // pixel format flags
  755.     dwFourCC: DWORD;               // (FOURCC code)
  756.     case Integer of
  757.       1: (
  758.           dwRGBBitCount : DWORD;          // how many bits per pixel
  759.           dwRBitMask : DWORD;             // mask for red bit
  760.           dwGBitMask : DWORD;             // mask for green bits
  761.           dwBBitMask : DWORD;             // mask for blue bits
  762.           dwRGBAlphaBitMask : DWORD;      // mask for alpha channel
  763.           );
  764.       2: (
  765.           dwYUVBitCount : DWORD;          // how many bits per pixel
  766.           dwYBitMask : DWORD;             // mask for Y bits
  767.           dwUBitMask : DWORD;             // mask for U bits
  768.           dwVBitMask : DWORD;             // mask for V bits
  769.           dwYUVAlphaBitMask : DWORD;      // mask for alpha channel
  770.           );
  771.       3: (
  772.           dwZBufferBitDepth : DWORD;      // how many total bits/pixel in z buffer (including any stencil bits)
  773.           dwStencilBitDepth : DWORD;      // how many stencil bits (note: dwZBufferBitDepth-dwStencilBitDepth is total Z-only bits)
  774.           dwZBitMask : DWORD;             // mask for Z bits
  775.           dwStencilBitMask : DWORD;       // mask for stencil bits
  776.           dwLuminanceAlphaBitMask : DWORD; // mask for alpha channel
  777.           );
  778.       4: (
  779.           dwAlphaBitDepth : DWORD;        // how many bits for alpha channels
  780.           dwLuminanceBitMask : DWORD;     // mask for luminance bits
  781.           dwBumpDvBitMask : DWORD;        // mask for bump map V delta bits
  782.           dwBumpLuminanceBitMask : DWORD; // mask for luminance in bump map
  783.           dwRGBZBitMask : DWORD;          // mask for Z channel
  784.           );
  785.       5: (
  786.            dwLuminanceBitCount : DWORD;   // how many bits per pixel
  787.            dwBumpDuBitMask : DWORD;       // mask for bump map U delta bits
  788.            Fill1, Fill2    : DWORD;
  789.            dwYUVZBitMask   : DWORD;       // mask for Z channel
  790.          );
  791.       6: ( dwBumpBitCount  : DWORD;       // how many bits per "buxel", total
  792.          );
  793.   end;
  794.   {$EXTERNALSYM _DDPIXELFORMAT}
  795.   DDPIXELFORMAT = _DDPIXELFORMAT;
  796.   {$EXTERNALSYM DDPIXELFORMAT}
  797.   TDDPixelFormat = _DDPIXELFORMAT;
  798.  
  799.   // These definitions are for compatibility with Erik Unger original conversion
  800.   PDDPixelFormat_DX3 = PDDPixelFormat;
  801.   TDDPixelFormat_DX3 = TDDPixelFormat;
  802.  
  803.   PDDPixelFormat_DX5 = PDDPixelFormat;
  804.   TDDPixelFormat_DX5 = TDDPixelFormat;
  805.  
  806.   PDDPixelFormat_DX6 = PDDPixelFormat;
  807.   TDDPixelFormat_DX6 = TDDPixelFormat;
  808.  
  809.   PDDPixelFormat_DX7 = PDDPixelFormat;
  810.   TDDPixelFormat_DX7 = TDDPixelFormat;
  811.  
  812.  
  813.  
  814. (*
  815.  * TDDOverlayFX
  816.  *)
  817.   PDDOverlayFX = ^TDDOverlayFX;
  818.   _DDOVERLAYFX = packed record
  819.     dwSize: DWORD;                         // size of structure
  820.     dwAlphaEdgeBlendBitDepth: DWORD;       // Bit depth used to specify constant for alpha edge blend
  821.     dwAlphaEdgeBlend: DWORD;               // Constant to use as alpha for edge blend
  822.     dwReserved: DWORD;
  823.     dwAlphaDestConstBitDepth: DWORD;       // Bit depth used to specify alpha constant for destination
  824.     case Integer of
  825.     0: (
  826.       dwAlphaDestConst: DWORD;             // Constant to use as alpha channel for dest
  827.       dwAlphaSrcConstBitDepth: DWORD;      // Bit depth used to specify alpha constant for source
  828.       dwAlphaSrcConst: DWORD;              // Constant to use as alpha channel for src
  829.       dckDestColorkey: TDDColorKey;        // DestColorkey override
  830.       dckSrcColorkey: TDDColorKey;         // DestColorkey override
  831.       dwDDFX: DWORD;                       // Overlay FX
  832.       dwFlags: DWORD;                      // flags
  833.      );
  834.     1: (
  835.       lpDDSAlphaDest: PDirectDrawSurface;  // Surface to use as alpha channel for dest
  836.       filler: DWORD;
  837.       lpDDSAlphaSrc: PDirectDrawSurface;   // Surface to use as alpha channel for src
  838.      );
  839.   end;
  840.   {$EXTERNALSYM _DDOVERLAYFX}
  841.   DDOVERLAYFX = _DDOVERLAYFX;
  842.   {$EXTERNALSYM DDOVERLAYFX}
  843.   TDDOverlayFX = _DDOVERLAYFX;
  844.  
  845. (*
  846.  * TDDBltBatch: BltBatch entry structure
  847.  *)
  848.   PDDBltBatch = ^TDDBltBatch;
  849.   _DDBLTBATCH = packed record
  850.     lprDest: PRect;
  851.     lpDDSSrc: IDirectDrawSurface;
  852.     lprSrc: PRect;
  853.     dwFlags: DWORD;
  854.     lpDDBltFx: TDDBltFX;
  855.   end;
  856.   {$EXTERNALSYM _DDBLTBATCH}
  857.   DDBLTBATCH = _DDBLTBATCH;
  858.   {$EXTERNALSYM DDBLTBATCH}
  859.   TDDBltBatch = _DDBLTBATCH;
  860.  
  861. (*
  862.  * TDDGammaRamp
  863.  *)
  864.   PDDGammaRamp = ^TDDGammaRamp;
  865.   _DDGAMMARAMP = packed record
  866.     red   : array[0..255] of WORD;
  867.     green : array[0..255] of WORD;
  868.     blue  : array[0..255] of WORD;
  869.   end;
  870.   {$EXTERNALSYM _DDGAMMARAMP}
  871.   DDGAMMARAMP = _DDGAMMARAMP;
  872.   {$EXTERNALSYM DDGAMMARAMP}
  873.   TDDGammaRamp = _DDGAMMARAMP;
  874.  
  875. (*
  876.  *  This is the structure within which DirectDraw returns data about the current graphics driver and chipset
  877.  *)
  878.  
  879.   PDDDeviceIdentifier = ^TDDDeviceIdentifier;
  880.   tagDDDEVICEIDENTIFIER = packed record
  881.     //
  882.     // These elements are for presentation to the user only. They should not be used to identify particular
  883.     // drivers, since this is unreliable and many different strings may be associated with the same
  884.     // device, and the same driver from different vendors.
  885.     //
  886.     szDriver: array[0..MAX_DDDEVICEID_STRING-1] of Char;
  887.     szDescription: array[0..MAX_DDDEVICEID_STRING-1] of Char;
  888.  
  889.     //
  890.     // This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons
  891.     // on the whole 64 bits. Caution should be exercised if you use this element to identify problematic
  892.     // drivers. It is recommended that guidDeviceIdentifier is used for this purpose.
  893.     //
  894.     // This version has the form:
  895.     //  wProduct = HIWORD(liDriverVersion.HighPart)
  896.     //  wVersion = LOWORD(liDriverVersion.HighPart)
  897.     //  wSubVersion = HIWORD(liDriverVersion.LowPart)
  898.     //  wBuild = LOWORD(liDriverVersion.LowPart)
  899.     //
  900.     liDriverVersion: TLargeInteger;     // Defined for applications and other 32 bit components
  901.  
  902.     //
  903.     // These elements can be used to identify particular chipsets. Use with extreme caution.
  904.     //   dwVendorId     Identifies the manufacturer. May be zero if unknown.
  905.     //   dwDeviceId     Identifies the type of chipset. May be zero if unknown.
  906.     //   dwSubSysId     Identifies the subsystem, typically this means the particular board. May be zero if unknown.
  907.     //   dwRevision     Identifies the revision level of the chipset. May be zero if unknown.
  908.     //
  909.     dwVendorId: DWORD;
  910.     dwDeviceId: DWORD;
  911.     dwSubSysId: DWORD;
  912.     dwRevision: DWORD;
  913.  
  914.     //
  915.     // This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the
  916.     // driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to
  917.     // reprofile the graphics subsystem.
  918.     // This element can also be used to identify particular problematic drivers.
  919.     //
  920.     guidDeviceIdentifier: TGUID;
  921.   end;
  922.   {$EXTERNALSYM tagDDDEVICEIDENTIFIER}
  923.   DDDEVICEIDENTIFIER = tagDDDEVICEIDENTIFIER;
  924.   {$EXTERNALSYM DDDEVICEIDENTIFIER}
  925.   TDDDeviceIdentifier = tagDDDEVICEIDENTIFIER;
  926.  
  927.   PDDDeviceIdentifier2 = ^TDDDeviceIdentifier2;
  928.   tagDDDEVICEIDENTIFIER2 = packed record
  929.     //
  930.     // These elements are for presentation to the user only. They should not be used to identify particular
  931.     // drivers, since this is unreliable and many different strings may be associated with the same
  932.     // device, and the same driver from different vendors.
  933.     //
  934.     szDriver: array[0..MAX_DDDEVICEID_STRING-1] of Char;
  935.     szDescription: array[0..MAX_DDDEVICEID_STRING-1] of Char;
  936.  
  937.     //
  938.     // This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons
  939.     // on the whole 64 bits. Caution should be exercised if you use this element to identify problematic
  940.     // drivers. It is recommended that guidDeviceIdentifier is used for this purpose.
  941.     //
  942.     // This version has the form:
  943.     //  wProduct = HIWORD(liDriverVersion.HighPart)
  944.     //  wVersion = LOWORD(liDriverVersion.HighPart)
  945.     //  wSubVersion = HIWORD(liDriverVersion.LowPart)
  946.     //  wBuild = LOWORD(liDriverVersion.LowPart)
  947.     //
  948.     liDriverVersion: TLargeInteger;     // Defined for applications and other 32 bit components
  949.  
  950.     //
  951.     // These elements can be used to identify particular chipsets. Use with extreme caution.
  952.     //   dwVendorId     Identifies the manufacturer. May be zero if unknown.
  953.     //   dwDeviceId     Identifies the type of chipset. May be zero if unknown.
  954.     //   dwSubSysId     Identifies the subsystem, typically this means the particular board. May be zero if unknown.
  955.     //   dwRevision     Identifies the revision level of the chipset. May be zero if unknown.
  956.     //
  957.     dwVendorId: DWORD;
  958.     dwDeviceId: DWORD;
  959.     dwSubSysId: DWORD;
  960.     dwRevision: DWORD;
  961.  
  962.     //
  963.     // This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the
  964.     // driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to
  965.     // reprofile the graphics subsystem.
  966.     // This element can also be used to identify particular problematic drivers.
  967.     //
  968.     guidDeviceIdentifier: TGUID;
  969.  
  970.     (*
  971.      * This element is used to determine the Windows Hardware Quality Lab (WHQL)
  972.      * certification level for this driver/device pair.
  973.      *)
  974.     dwWHQLLevel: DWORD;
  975.   end;
  976.   {$EXTERNALSYM tagDDDEVICEIDENTIFIER2}
  977.   DDDEVICEIDENTIFIER2 = tagDDDEVICEIDENTIFIER2;
  978.   {$EXTERNALSYM DDDEVICEIDENTIFIER2}
  979.   TDDDeviceIdentifier2 = tagDDDEVICEIDENTIFIER2;
  980.  
  981. (*
  982.  * callbacks
  983.  *)
  984.   TClipperCallback = function(lpDDClipper: IDirectDrawClipper; hWnd: HWND;
  985.       Code: DWORD; lpContext: Pointer): HResult; stdcall;
  986.   {$NODEFINE TClipperCallback}
  987.   {$HPPEMIT 'typedef LPCLIPPERCALLBACK TClipperCallback;'}
  988.   TSurfacesStreamingCallback = function(arg: DWORD): HResult; stdcall;
  989.   {$NODEFINE TSurfacesStreamingCallback}
  990.  
  991. (*
  992.  * TDDSurfaceDesc
  993.  *)
  994.   PDDSurfaceDesc = ^TDDSurfaceDesc;
  995.   _DDSURFACEDESC = packed record
  996.     dwSize: DWORD;                        // size of the TDDSurfaceDesc structure
  997.     dwFlags: DWORD;                       // determines what fields are valid
  998.     dwHeight: DWORD;                      // height of surface to be created
  999.     dwWidth: DWORD;                       // width of input surface
  1000.     case Integer of
  1001.     0: (
  1002.       dwLinearSize: DWORD;                // unused at the moment
  1003.      );
  1004.     1: (
  1005.       lPitch: Longint;                    // distance to start of next line (return value only)
  1006.       dwBackBufferCount: DWORD;           // number of back buffers requested
  1007.       case Integer of
  1008.       0: (
  1009.         dwMipMapCount: DWORD;             // number of mip-map levels requested
  1010.         dwAlphaBitDepth: DWORD;           // depth of alpha buffer requested
  1011.         dwReserved: DWORD;                // reserved
  1012.         lpSurface: Pointer;               // pointer to the associated surface memory
  1013.         ddckCKDestOverlay: TDDColorKey;   // color key for destination overlay use
  1014.         ddckCKDestBlt: TDDColorKey;       // color key for destination blt use
  1015.         ddckCKSrcOverlay: TDDColorKey;    // color key for source overlay use
  1016.         ddckCKSrcBlt: TDDColorKey;        // color key for source blt use
  1017.         ddpfPixelFormat: TDDPixelFormat;  // pixel format description of the surface
  1018.         ddsCaps: TDDSCaps;                // direct draw surface capabilities
  1019.        );
  1020.       1: (
  1021.         dwZBufferBitDepth: DWORD;         // depth of Z buffer requested
  1022.        );
  1023.       2: (
  1024.         dwRefreshRate: DWORD;             // refresh rate (used when display mode is described)
  1025.        );
  1026.      );
  1027.   end;
  1028.   {$EXTERNALSYM _DDSURFACEDESC}
  1029.   DDSURFACEDESC = _DDSURFACEDESC;
  1030.   {$EXTERNALSYM DDSURFACEDESC}
  1031.   TDDSurfaceDesc = _DDSURFACEDESC;
  1032.  
  1033.   // These definitions are for compatibility with Erik Unger original conversion
  1034.   PDDSurfaceDesc_DX5 = PDDSurfaceDesc;
  1035.   TDDSurfaceDesc_DX5 = TDDSurfaceDesc;
  1036.  
  1037.   PDDSurfaceDesc_DX6 = PDDSurfaceDesc;
  1038.   TDDSurfaceDesc_DX6 = TDDSurfaceDesc;
  1039.  
  1040.  
  1041. (*
  1042.  * TDDSurfaceDesc2
  1043.  *)
  1044.   PDDSurfaceDesc2 = ^TDDSurfaceDesc2;
  1045.   _DDSURFACEDESC2 = packed record
  1046.     dwSize: DWORD;                      // size of the TDDSurfaceDesc structure
  1047.     dwFlags: DWORD;                     // determines what fields are valid
  1048.     dwHeight: DWORD;                    // height of surface to be created
  1049.     dwWidth: DWORD;                     // width of input surface
  1050.     case Integer of
  1051.     0: (
  1052.       lPitch : Longint;                  // distance to start of next line (return value only)
  1053.      );
  1054.     1: (
  1055.       dwLinearSize : DWORD;              // Formless late-allocated optimized surface size
  1056.       dwBackBufferCount: DWORD;          // number of back buffers requested
  1057.       case Integer of
  1058.       0: (
  1059.         dwMipMapCount: DWORD;            // number of mip-map levels requested
  1060.         dwAlphaBitDepth: DWORD;          // depth of alpha buffer requested
  1061.         dwReserved: DWORD;               // reserved
  1062.         lpSurface: Pointer;              // pointer to the associated surface memory
  1063.         ddckCKDestOverlay: TDDColorKey;  // color key for destination overlay use
  1064.         ddckCKDestBlt: TDDColorKey;      // color key for destination blt use
  1065.         ddckCKSrcOverlay: TDDColorKey;   // color key for source overlay use
  1066.         ddckCKSrcBlt: TDDColorKey;       // color key for source blt use
  1067.         ddpfPixelFormat: TDDPixelFormat; // pixel format description of the surface
  1068.         ddsCaps: TDDSCaps2;              // direct draw surface capabilities
  1069.         dwTextureStage: DWORD;           // stage in multitexture cascade
  1070.        );
  1071.       1: (
  1072.         dwRefreshRate: DWORD;            // refresh rate (used when display mode is described)
  1073.        );
  1074.      );
  1075.   end;
  1076.   {$EXTERNALSYM _DDSURFACEDESC2}
  1077.   DDSURFACEDESC2 = _DDSURFACEDESC2;
  1078.   {$EXTERNALSYM DDSURFACEDESC2}
  1079.   TDDSurfaceDesc2 = _DDSURFACEDESC2;
  1080.  
  1081. (*
  1082.  * TDDOptSurfaceDesc
  1083.  *)
  1084.  
  1085.   PDDOptSurfaceDesc = ^TDDOptSurfaceDesc;
  1086.   _DDOPTSURFACEDESC = packed record
  1087.     dwSize : DWORD;             // size of the DDOPTSURFACEDESC structure
  1088.     dwFlags : DWORD;            // determines what fields are valid
  1089.     ddSCaps : TDDSCaps2;        // Common caps like: Memory type
  1090.     ddOSCaps : TDDOSCaps;       // Common caps like: Memory type
  1091.     guid : TGUID;               // Compression technique GUID
  1092.     dwCompressionRatio : DWORD; // Compression ratio
  1093.   end;
  1094.   {$EXTERNALSYM _DDOPTSURFACEDESC}
  1095.   DDOPTSURFACEDESC = _DDOPTSURFACEDESC;
  1096.   {$EXTERNALSYM DDOPTSURFACEDESC}
  1097.   TDDOptSurfaceDesc = _DDOPTSURFACEDESC;
  1098.  
  1099. (*
  1100.  * DDCOLORCONTROL
  1101.  *)
  1102.   PDDColorControl = ^TDDColorControl;
  1103.   _DDCOLORCONTROL = packed record
  1104.     dwSize: DWORD;
  1105.     dwFlags: DWORD;
  1106.     lBrightness: Longint;
  1107.     lContrast: Longint;
  1108.     lHue: Longint;
  1109.     lSaturation: Longint;
  1110.     lSharpness: Longint;
  1111.     lGamma: Longint;
  1112.     lColorEnable: Longint;
  1113.     dwReserved1: DWORD;
  1114.   end;
  1115.   {$EXTERNALSYM _DDCOLORCONTROL}
  1116.   DDCOLORCONTROL = _DDCOLORCONTROL;
  1117.   {$EXTERNALSYM DDCOLORCONTROL}
  1118.   TDDColorControl = _DDCOLORCONTROL;
  1119.  
  1120. (*
  1121.  * callbacks
  1122.  *)
  1123.  
  1124. //{$IFNDEF WINNT}
  1125.   TDDEnumModesCallback = function (const lpDDSurfaceDesc: TDDSurfaceDesc;
  1126.       lpContext: Pointer): HResult; stdcall;
  1127.   {$NODEFINE TDDEnumModesCallback}
  1128.   {$HPPEMIT 'typedef LPCLIPPERCALLBACK TDDEnumModesCallback;'}
  1129.   TDDEnumModesCallback2 = function (const lpDDSurfaceDesc: TDDSurfaceDesc2;
  1130.       lpContext: Pointer): HResult; stdcall;
  1131.   {$NODEFINE TDDEnumModesCallback2}
  1132.   {$HPPEMIT 'typedef LPDDENUMMODESCALLBACK2 TDDEnumModesCallback2;'}
  1133.   TDDEnumSurfacesCallback = function (lpDDSurface: IDirectDrawSurface;
  1134.       const lpDDSurfaceDesc: TDDSurfaceDesc; lpContext: Pointer): HResult; stdcall;
  1135.   {$NODEFINE TDDEnumSurfacesCallback}
  1136.   {$HPPEMIT 'typedef LPDDENUMSURFACESCALLBACK TDDEnumSurfacesCallback;'}
  1137.   TDDEnumSurfacesCallback2 = function (lpDDSurface: IDirectDrawSurface4;
  1138.       const lpDDSurfaceDesc: TDDSurfaceDesc2; lpContext: Pointer): HResult; stdcall;
  1139.   {$NODEFINE TDDEnumSurfacesCallback2}
  1140.   {$HPPEMIT 'typedef LPDDENUMSURFACESCALLBACK2 TDDEnumSurfacesCallback2;'}
  1141.   TDDEnumSurfacesCallback7 = function (lpDDSurface: IDirectDrawSurface7;
  1142.       const lpDDSurfaceDesc: TDDSurfaceDesc2; lpContext: Pointer): HResult; stdcall;
  1143.   {$NODEFINE TDDEnumSurfacesCallback7}
  1144.   {$HPPEMIT 'typedef LPDDENUMSURFACESCALLBACK7 TDDEnumSurfacesCallback7;'}
  1145. //{$ENDIF}
  1146.  
  1147. (*
  1148.  * INTERACES FOLLOW:
  1149.  *      IDirectDraw
  1150.  *      IDirectDrawClipper
  1151.  *      IDirectDrawPalette
  1152.  *      IDirectDrawSurface
  1153.  *)
  1154.  
  1155. (*
  1156.  * IDirectDraw
  1157.  *)
  1158.  
  1159.   IDirectDraw = interface(IUnknown)
  1160.     ['{6C14DB80-A733-11CE-A521-0020AF0BE560}']
  1161.     (*** IDirectDraw methods ***)
  1162.     function Compact: HResult; stdcall;
  1163.     function CreateClipper(dwFlags: DWORD;
  1164.         out lplpDDClipper: IDirectDrawClipper;
  1165.         pUnkOuter: IUnknown): HResult; stdcall;
  1166.     function CreatePalette(dwFlags: DWORD; lpColorTable: Pointer;
  1167.         out lplpDDPalette: IDirectDrawPalette;
  1168.         pUnkOuter: IUnknown): HResult; stdcall;
  1169.     function CreateSurface(var lpDDSurfaceDesc: TDDSurfaceDesc;
  1170.         out lplpDDSurface: IDirectDrawSurface;
  1171.         pUnkOuter: IUnknown): HResult; stdcall;
  1172.     function DuplicateSurface(lpDDSurface: IDirectDrawSurface;
  1173.         out lplpDupDDSurface: IDirectDrawSurface): HResult; stdcall;
  1174.     function EnumDisplayModes(dwFlags: DWORD;
  1175.         lpDDSurfaceDesc: PDDSurfaceDesc; lpContext: Pointer;
  1176.         lpEnumModesCallback: TDDEnumModesCallback): HResult; stdcall;
  1177.     function EnumSurfaces(dwFlags: DWORD; const lpDDSD: TDDSurfaceDesc;
  1178.         lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback) :
  1179.         HResult; stdcall;
  1180.     function FlipToGDISurface: HResult; stdcall;
  1181.     function GetCaps(lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps): HResult; stdcall;
  1182.     function GetDisplayMode(out lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
  1183.     function GetFourCCCodes(var lpNumCodes: DWORD; lpCodes: PDWORD): HResult; stdcall;
  1184.     function GetGDISurface(out lplpGDIDDSSurface: IDirectDrawSurface): HResult; stdcall;
  1185.     function GetMonitorFrequency(out lpdwFrequency: DWORD): HResult; stdcall;
  1186.     function GetScanLine(out lpdwScanLine: DWORD): HResult; stdcall;
  1187.     function GetVerticalBlankStatus(out lpbIsInVB: BOOL): HResult; stdcall;
  1188.     function Initialize(lpGUID: PGUID): HResult; stdcall;
  1189.     function RestoreDisplayMode: HResult; stdcall;
  1190.     function SetCooperativeLevel(hWnd: HWND; dwFlags: DWORD): HResult; stdcall;
  1191.     (*** Warning!  SetDisplayMode differs between DirectDraw 1 and DirectDraw 2 ***)
  1192.     function SetDisplayMode(dwWidth: DWORD; dwHeight: DWORD;
  1193.         dwBpp: DWORD): HResult; stdcall;
  1194.     function WaitForVerticalBlank(dwFlags: DWORD; hEvent: THandle): HResult; stdcall;
  1195.   end;
  1196.  
  1197.   IDirectDraw2 = interface(IUnknown)
  1198.     ['{B3A6F3E0-2B43-11CF-A2DE-00AA00B93356}']
  1199.     (*** IDirectDraw methods ***)
  1200.     function Compact: HResult; stdcall;
  1201.     function CreateClipper(dwFlags: DWORD;
  1202.         out lplpDDClipper: IDirectDrawClipper;
  1203.         pUnkOuter: IUnknown): HResult; stdcall;
  1204.     function CreatePalette(dwFlags: DWORD; lpColorTable: Pointer;
  1205.         out lplpDDPalette: IDirectDrawPalette;
  1206.         pUnkOuter: IUnknown): HResult; stdcall;
  1207.     function CreateSurface(var lpDDSurfaceDesc: TDDSurfaceDesc;
  1208.         out lplpDDSurface: IDirectDrawSurface;
  1209.         pUnkOuter: IUnknown): HResult; stdcall;
  1210.     function DuplicateSurface(lpDDSurface: IDirectDrawSurface;
  1211.         out lplpDupDDSurface: IDirectDrawSurface): HResult; stdcall;
  1212.     function EnumDisplayModes(dwFlags: DWORD;
  1213.         lpDDSurfaceDesc: PDDSurfaceDesc; lpContext: Pointer;
  1214.         lpEnumModesCallback: TDDEnumModesCallback): HResult; stdcall;
  1215.     function EnumSurfaces(dwFlags: DWORD; var lpDDSD: TDDSurfaceDesc;
  1216.         lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback): HResult; stdcall;
  1217.     function FlipToGDISurface: HResult; stdcall;
  1218.     function GetCaps(lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps): HResult; stdcall;
  1219.     function GetDisplayMode(out lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
  1220.     function GetFourCCCodes(var lpNumCodes: DWORD; lpCodes: PDWORD): HResult; stdcall;
  1221.     function GetGDISurface(out lplpGDIDDSSurface: IDirectDrawSurface): HResult; stdcall;
  1222.     function GetMonitorFrequency(out lpdwFrequency: DWORD): HResult; stdcall;
  1223.     function GetScanLine(out lpdwScanLine: DWORD): HResult; stdcall;
  1224.     function GetVerticalBlankStatus(out lpbIsInVB: BOOL): HResult; stdcall;
  1225.     function Initialize(lpGUID: PGUID): HResult; stdcall;
  1226.     function RestoreDisplayMode: HResult; stdcall;
  1227.     function SetCooperativeLevel(hWnd: HWND; dwFlags: DWORD): HResult; stdcall;
  1228.     function SetDisplayMode(dwWidth: DWORD; dwHeight: DWORD; dwBPP: DWORD;
  1229.         dwRefreshRate: DWORD; dwFlags: DWORD): HResult; stdcall;
  1230.     function WaitForVerticalBlank(dwFlags: DWORD; hEvent: THandle): HResult; stdcall;
  1231.     (*** Added in the v2 interface ***)
  1232.     function GetAvailableVidMem(var lpDDSCaps: TDDSCaps;
  1233.         out lpdwTotal, lpdwFree: DWORD): HResult; stdcall;
  1234.   end;
  1235.  
  1236.   IDirectDraw4 = interface(IUnknown)
  1237.     ['{9c59509a-39bd-11d1-8c4a-00c04fd930c5}']
  1238.     (*** IDirectDraw methods ***)
  1239.     function Compact: HResult; stdcall;
  1240.     function CreateClipper(dwFlags: DWORD;
  1241.         out lplpDDClipper: IDirectDrawClipper;
  1242.         pUnkOuter: IUnknown): HResult; stdcall;
  1243.     function CreatePalette(dwFlags: DWORD; lpColorTable: Pointer;
  1244.         out lplpDDPalette: IDirectDrawPalette;
  1245.         pUnkOuter: IUnknown): HResult; stdcall;
  1246.     function CreateSurface(const lpDDSurfaceDesc: TDDSurfaceDesc2;
  1247.         out lplpDDSurface: IDirectDrawSurface4;
  1248.         pUnkOuter: IUnknown): HResult; stdcall;
  1249.     function DuplicateSurface(lpDDSurface: IDirectDrawSurface4;
  1250.         out lplpDupDDSurface: IDirectDrawSurface4): HResult; stdcall;
  1251.     function EnumDisplayModes(dwFlags: DWORD;
  1252.         lpDDSurfaceDesc: PDDSurfaceDesc2; lpContext: Pointer;
  1253.         lpEnumModesCallback: TDDEnumModesCallback2): HResult; stdcall;
  1254.     function EnumSurfaces(dwFlags: DWORD; const lpDDSD: TDDSurfaceDesc2;
  1255.         lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback2):
  1256.         HResult; stdcall;
  1257.     function FlipToGDISurface: HResult; stdcall;
  1258.     function GetCaps(lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps): HResult; stdcall;
  1259.     function GetDisplayMode(out lpDDSurfaceDesc: TDDSurfaceDesc2): HResult; stdcall;
  1260.     function GetFourCCCodes(var lpNumCodes: DWORD; lpCodes: PDWORD): HResult; stdcall;
  1261.     function GetGDISurface(out lplpGDIDDSSurface: IDirectDrawSurface4): HResult; stdcall;
  1262.     function GetMonitorFrequency(out lpdwFrequency: DWORD): HResult; stdcall;
  1263.     function GetScanLine(out lpdwScanLine: DWORD): HResult; stdcall;
  1264.     function GetVerticalBlankStatus(out lpbIsInVB: BOOL): HResult; stdcall;
  1265.     function Initialize(lpGUID: PGUID): HResult; stdcall;
  1266.     function RestoreDisplayMode: HResult; stdcall;
  1267.     function SetCooperativeLevel(hWnd: HWND; dwFlags: DWORD): HResult; stdcall;
  1268.     function SetDisplayMode(dwWidth: DWORD; dwHeight: DWORD; dwBPP: DWORD;
  1269.         dwRefreshRate: DWORD; dwFlags: DWORD): HResult; stdcall;
  1270.     function WaitForVerticalBlank(dwFlags: DWORD; hEvent: THandle): HResult; stdcall;
  1271.     (*** Added in the v2 interface ***)
  1272.     function GetAvailableVidMem(const lpDDSCaps: TDDSCaps2;
  1273.         out lpdwTotal, lpdwFree: DWORD): HResult; stdcall;
  1274.     (*** Added in the V4 Interface ***)
  1275.     function GetSurfaceFromDC(hdc: Windows.HDC;
  1276.         out lpDDS4: IDirectDrawSurface4): HResult; stdcall;
  1277.     function RestoreAllSurfaces: HResult; stdcall;
  1278.     function TestCooperativeLevel: HResult; stdcall;
  1279.     function GetDeviceIdentifier(out lpdddi: TDDDeviceIdentifier;
  1280.         dwFlags: DWORD): HResult; stdcall;
  1281.   end;
  1282.  
  1283.   IDirectDraw7 = interface(IUnknown)
  1284.     ['{15e65ec0-3b9c-11d2-b92f-00609797ea5b}']
  1285.     (*** IDirectDraw methods ***)
  1286.     function Compact: HResult; stdcall;
  1287.     function CreateClipper(dwFlags: DWORD;
  1288.         out lplpDDClipper: IDirectDrawClipper;
  1289.         pUnkOuter: IUnknown): HResult; stdcall;
  1290.     function CreatePalette(dwFlags: DWORD; lpColorTable: Pointer;
  1291.         out lplpDDPalette: IDirectDrawPalette;
  1292.         pUnkOuter: IUnknown): HResult; stdcall;
  1293.     function CreateSurface(const lpDDSurfaceDesc: TDDSurfaceDesc2;
  1294.         out lplpDDSurface: IDirectDrawSurface7;
  1295.         pUnkOuter: IUnknown): HResult; stdcall;
  1296.     function DuplicateSurface(lpDDSurface: IDirectDrawSurface7;
  1297.         out lplpDupDDSurface: IDirectDrawSurface7): HResult; stdcall;
  1298.     function EnumDisplayModes(dwFlags: DWORD;
  1299.         lpDDSurfaceDesc: PDDSurfaceDesc2; lpContext: Pointer;
  1300.         lpEnumModesCallback: TDDEnumModesCallback2): HResult; stdcall;
  1301.     function EnumSurfaces(dwFlags: DWORD; const lpDDSD: TDDSurfaceDesc2;
  1302.         lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback7) :
  1303.         HResult; stdcall;
  1304.     function FlipToGDISurface: HResult; stdcall;
  1305.     function GetCaps(lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps): HResult; stdcall;
  1306.     function GetDisplayMode(out lpDDSurfaceDesc: TDDSurfaceDesc2): HResult; stdcall;
  1307.     function GetFourCCCodes(var lpNumCodes: DWORD; lpCodes: PDWORD): HResult; stdcall;
  1308.     function GetGDISurface(out lplpGDIDDSSurface: IDirectDrawSurface7) :
  1309.         HResult; stdcall;
  1310.     function GetMonitorFrequency(out lpdwFrequency: DWORD): HResult; stdcall;
  1311.     function GetScanLine(out lpdwScanLine: DWORD): HResult; stdcall;
  1312.     function GetVerticalBlankStatus(out lpbIsInVB: BOOL): HResult; stdcall;
  1313.     function Initialize(lpGUID: PGUID): HResult; stdcall;
  1314.     function RestoreDisplayMode: HResult; stdcall;
  1315.     function SetCooperativeLevel(hWnd: HWND; dwFlags: DWORD): HResult; stdcall;
  1316.     function SetDisplayMode(dwWidth: DWORD; dwHeight: DWORD; dwBPP: DWORD;
  1317.         dwRefreshRate: DWORD; dwFlags: DWORD): HResult; stdcall;
  1318.     function WaitForVerticalBlank(dwFlags: DWORD; hEvent: THandle) :
  1319.         HResult; stdcall;
  1320.     (*** Added in the v2 interface ***)
  1321.     function GetAvailableVidMem(const lpDDSCaps: TDDSCaps2;
  1322.         out lpdwTotal, lpdwFree: DWORD): HResult; stdcall;
  1323.     (*** Added in the V4 Interface ***)
  1324.     function GetSurfaceFromDC(hdc: Windows.HDC;
  1325.         out lpDDS: IDirectDrawSurface7): HResult; stdcall;
  1326.     function RestoreAllSurfaces: HResult; stdcall;
  1327.     function TestCooperativeLevel: HResult; stdcall;
  1328.     function GetDeviceIdentifier(out lpdddi: TDDDeviceIdentifier2;
  1329.         dwFlags: DWORD): HResult; stdcall;
  1330.     function StartModeTest(const lpModesToTest; dwNumEntries, dwFlags: DWORD): HResult; stdcall;
  1331.     function EvaluateMode(dwFlags: DWORD; out pSecondsUntilTimeout: DWORD): HResult; stdcall;
  1332.   end;
  1333.  
  1334.  
  1335.  
  1336. (*
  1337.  * IDirectDrawPalette
  1338.  *)
  1339.  
  1340.   IDirectDrawPalette = interface(IUnknown)
  1341.     ['{6C14DB84-A733-11CE-A521-0020AF0BE560}']
  1342.     (*** IDirectDrawPalette methods ***)
  1343.     function GetCaps(out lpdwCaps: DWORD): HResult; stdcall;
  1344.     function GetEntries(dwFlags: DWORD; dwBase: DWORD; dwNumEntries: DWORD;
  1345.         lpEntries: Pointer): HResult; stdcall;
  1346.     function Initialize(lpDD: IDirectDraw; dwFlags: DWORD;
  1347.         lpDDColorTable: Pointer): HResult; stdcall;
  1348.     function SetEntries(dwFlags: DWORD; dwStartingEntry: DWORD;
  1349.         dwCount: DWORD; lpEntries: Pointer): HResult; stdcall;
  1350.   end;
  1351.  
  1352. (*
  1353.  * IDirectDrawClipper
  1354.  *)
  1355.  
  1356.   IDirectDrawClipper = interface(IUnknown)
  1357.     ['{6C14DB85-A733-11CE-A521-0020AF0BE560}']
  1358.     (*** IDirectDrawClipper methods ***)
  1359.     function GetClipList(lpRect: PRect; lpClipList: PRgnData;
  1360.         var lpdwSize: DWORD): HResult; stdcall;
  1361.     function GetHWnd(out lphWnd: HWND): HResult; stdcall;
  1362.     function Initialize(lpDD: IDirectDraw; dwFlags: DWORD): HResult; stdcall;
  1363.     function IsClipListChanged(out lpbChanged: BOOL): HResult; stdcall;
  1364.     function SetClipList(lpClipList: PRgnData; dwFlags: DWORD): HResult; stdcall;
  1365.     function SetHWnd(dwFlags: DWORD; hWnd: HWND): HResult; stdcall;
  1366.   end;
  1367.  
  1368. (*
  1369.  * IDirectDrawSurface and related interfaces
  1370.  *)
  1371.  
  1372.   IDirectDrawSurface = interface(IUnknown)
  1373.     ['{6C14DB81-A733-11CE-A521-0020AF0BE560}']
  1374.     (*** IDirectDrawSurface methods ***)
  1375.     function AddAttachedSurface(lpDDSAttachedSurface: IDirectDrawSurface) :
  1376.         HResult; stdcall;
  1377.     function AddOverlayDirtyRect(const lpRect: TRect): HResult; stdcall;
  1378.     function Blt(lpDestRect: PRect;
  1379.         lpDDSrcSurface: IDirectDrawSurface; lpSrcRect: PRect;
  1380.         dwFlags: DWORD; lpDDBltFx: PDDBltFX): HResult; stdcall;
  1381.     function BltBatch(const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
  1382.         dwFlags: DWORD): HResult; stdcall;
  1383.     function BltFast(dwX: DWORD; dwY: DWORD;
  1384.         lpDDSrcSurface: IDirectDrawSurface; lpSrcRect: PRect;
  1385.         dwTrans: DWORD): HResult; stdcall;
  1386.     function DeleteAttachedSurface(dwFlags: DWORD;
  1387.         lpDDSAttachedSurface: IDirectDrawSurface): HResult; stdcall;
  1388.     function EnumAttachedSurfaces(lpContext: Pointer;
  1389.         lpEnumSurfacesCallback: TDDEnumSurfacesCallback): HResult; stdcall;
  1390.     function EnumOverlayZOrders(dwFlags: DWORD; lpContext: Pointer;
  1391.         lpfnCallback: TDDEnumSurfacesCallback): HResult; stdcall;
  1392.     function Flip(lpDDSurfaceTargetOverride: IDirectDrawSurface;
  1393.         dwFlags: DWORD): HResult; stdcall;
  1394.     function GetAttachedSurface(var lpDDSCaps: TDDSCaps;
  1395.         (*out*)var lplpDDAttachedSurface: IDirectDrawSurface): HResult; stdcall;
  1396.     function GetBltStatus(dwFlags: DWORD): HResult; stdcall;
  1397.     function GetCaps(out lpDDSCaps: TDDSCaps): HResult; stdcall;
  1398.     function GetClipper(out lplpDDClipper: IDirectDrawClipper): HResult; stdcall;
  1399.     function GetColorKey(dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
  1400.         HResult; stdcall;
  1401.     function GetDC(out lphDC: HDC): HResult; stdcall;
  1402.     function GetFlipStatus(dwFlags: DWORD): HResult; stdcall;
  1403.     function GetOverlayPosition(out lplX, lplY: Longint): HResult; stdcall;
  1404.     function GetPalette(out lplpDDPalette: IDirectDrawPalette): HResult; stdcall;
  1405.     function GetPixelFormat(out lpDDPixelFormat: TDDPixelFormat): HResult; stdcall;
  1406.     function GetSurfaceDesc(out lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
  1407.     function Initialize(lpDD: IDirectDraw;
  1408.         out lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
  1409.     function IsLost: HResult; stdcall;
  1410.     function Lock(lpDestRect: PRect; out lpDDSurfaceDesc:
  1411.         TDDSurfaceDesc; dwFlags: DWORD; hEvent: THandle): HResult; stdcall;
  1412.     function ReleaseDC(hDC: Windows.HDC): HResult; stdcall;
  1413.     function _Restore: HResult; stdcall;
  1414.     function SetClipper(lpDDClipper: IDirectDrawClipper): HResult; stdcall;
  1415.     function SetColorKey(dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
  1416.         HResult; stdcall;
  1417.     function SetOverlayPosition(lX, lY: Longint): HResult; stdcall;
  1418.     function SetPalette(lpDDPalette: IDirectDrawPalette): HResult; stdcall;
  1419.     function Unlock(lpSurfaceData: Pointer): HResult; stdcall;
  1420.     function UpdateOverlay(lpSrcRect: PRect;
  1421.         lpDDDestSurface: IDirectDrawSurface; lpDestRect: PRect;
  1422.         dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX): HResult; stdcall;
  1423.     function UpdateOverlayDisplay(dwFlags: DWORD): HResult; stdcall;
  1424.     function UpdateOverlayZOrder(dwFlags: DWORD;
  1425.         lpDDSReference: IDirectDrawSurface): HResult; stdcall;
  1426.   end;
  1427.  
  1428. (*
  1429.  * IDirectDrawSurface2 and related interfaces
  1430.  *)
  1431.  
  1432.   IDirectDrawSurface2 = interface(IUnknown)
  1433.     ['{57805885-6eec-11cf-9441-a82303c10e27}']
  1434.     (*** IDirectDrawSurface methods ***)
  1435.     function AddAttachedSurface(lpDDSAttachedSurface: IDirectDrawSurface2) :
  1436.         HResult; stdcall;
  1437.     function AddOverlayDirtyRect(const lpRect: TRect): HResult; stdcall;
  1438.     function Blt(lpDestRect: PRect;
  1439.         lpDDSrcSurface: IDirectDrawSurface2; lpSrcRect: PRect;
  1440.         dwFlags: DWORD; lpDDBltFx: PDDBltFX): HResult; stdcall;
  1441.     function BltBatch(const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
  1442.         dwFlags: DWORD): HResult; stdcall;
  1443.     function BltFast(dwX: DWORD; dwY: DWORD;
  1444.         lpDDSrcSurface: IDirectDrawSurface2; lpSrcRect: PRect;
  1445.         dwTrans: DWORD): HResult; stdcall;
  1446.     function DeleteAttachedSurface(dwFlags: DWORD;
  1447.         lpDDSAttachedSurface: IDirectDrawSurface2): HResult; stdcall;
  1448.     function EnumAttachedSurfaces(lpContext: Pointer;
  1449.         lpEnumSurfacesCallback: TDDEnumSurfacesCallback): HResult; stdcall;
  1450.     function EnumOverlayZOrders(dwFlags: DWORD; lpContext: Pointer;
  1451.         lpfnCallback: TDDEnumSurfacesCallback): HResult; stdcall;
  1452.     function Flip(lpDDSurfaceTargetOverride: IDirectDrawSurface2;
  1453.         dwFlags: DWORD): HResult; stdcall;
  1454.     function GetAttachedSurface(var lpDDSCaps: TDDSCaps;
  1455.         out lplpDDAttachedSurface: IDirectDrawSurface2): HResult; stdcall;
  1456.     function GetBltStatus(dwFlags: DWORD): HResult; stdcall;
  1457.     function GetCaps(out lpDDSCaps: TDDSCaps): HResult; stdcall;
  1458.     function GetClipper(out lplpDDClipper: IDirectDrawClipper): HResult; stdcall;
  1459.     function GetColorKey(dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
  1460.         HResult; stdcall;
  1461.     function GetDC(out lphDC: HDC): HResult; stdcall;
  1462.     function GetFlipStatus(dwFlags: DWORD): HResult; stdcall;
  1463.     function GetOverlayPosition(out lplX, lplY: Longint): HResult; stdcall;
  1464.     function GetPalette(out lplpDDPalette: IDirectDrawPalette): HResult; stdcall;
  1465.     function GetPixelFormat(out lpDDPixelFormat: TDDPixelFormat): HResult; stdcall;
  1466.     function GetSurfaceDesc(out lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
  1467.     function Initialize(lpDD: IDirectDraw;
  1468.         out lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
  1469.     function IsLost: HResult; stdcall;
  1470.     function Lock(lpDestRect: PRect;
  1471.         out lpDDSurfaceDesc: TDDSurfaceDesc; dwFlags: DWORD;
  1472.         hEvent: THandle): HResult; stdcall;
  1473.     function ReleaseDC(hDC: Windows.HDC): HResult; stdcall;
  1474.     function _Restore: HResult; stdcall;
  1475.     function SetClipper(lpDDClipper: IDirectDrawClipper): HResult; stdcall;
  1476.     function SetColorKey(dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
  1477.         HResult; stdcall;
  1478.     function SetOverlayPosition(lX, lY: Longint): HResult; stdcall;
  1479.     function SetPalette(lpDDPalette: IDirectDrawPalette): HResult; stdcall;
  1480.     function Unlock(lpSurfaceData: Pointer): HResult; stdcall;
  1481.     function UpdateOverlay(lpSrcRect: PRect;
  1482.         lpDDDestSurface: IDirectDrawSurface2; lpDestRect: PRect;
  1483.         dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX): HResult; stdcall;
  1484.     function UpdateOverlayDisplay(dwFlags: DWORD): HResult; stdcall;
  1485.     function UpdateOverlayZOrder(dwFlags: DWORD;
  1486.         lpDDSReference: IDirectDrawSurface2): HResult; stdcall;
  1487.     (*** Added in the v2 interface ***)
  1488.     function GetDDInterface(var lplpDD: IDirectDraw): HResult; stdcall;
  1489.     function PageLock(dwFlags: DWORD): HResult; stdcall;
  1490.     function PageUnlock(dwFlags: DWORD): HResult; stdcall;
  1491.   end;
  1492.  
  1493.   IDirectDrawSurface3 = interface(IUnknown)
  1494.     ['{DA044E00-69B2-11D0-A1D5-00AA00B8DFBB}']
  1495.     (*** IDirectDrawSurface methods ***)
  1496.     function AddAttachedSurface(lpDDSAttachedSurface: IDirectDrawSurface3) :
  1497.         HResult; stdcall;
  1498.     function AddOverlayDirtyRect(const lpRect: TRect): HResult; stdcall;
  1499.     function Blt(lpDestRect: PRect;
  1500.         lpDDSrcSurface: IDirectDrawSurface3; lpSrcRect: PRect;
  1501.         dwFlags: DWORD; lpDDBltFx: PDDBltFX): HResult; stdcall;
  1502.     function BltBatch(const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
  1503.         dwFlags: DWORD): HResult; stdcall;
  1504.     function BltFast(dwX: DWORD; dwY: DWORD;
  1505.         lpDDSrcSurface: IDirectDrawSurface3; lpSrcRect: PRect;
  1506.         dwTrans: DWORD): HResult; stdcall;
  1507.     function DeleteAttachedSurface(dwFlags: DWORD;
  1508.         lpDDSAttachedSurface: IDirectDrawSurface3): HResult; stdcall;
  1509.     function EnumAttachedSurfaces(lpContext: Pointer;
  1510.         lpEnumSurfacesCallback: TDDEnumSurfacesCallback): HResult; stdcall;
  1511.     function EnumOverlayZOrders(dwFlags: DWORD; lpContext: Pointer;
  1512.         lpfnCallback: TDDEnumSurfacesCallback): HResult; stdcall;
  1513.     function Flip(lpDDSurfaceTargetOverride: IDirectDrawSurface3;
  1514.         dwFlags: DWORD): HResult; stdcall;
  1515.     function GetAttachedSurface(var lpDDSCaps: TDDSCaps;
  1516.         out lplpDDAttachedSurface: IDirectDrawSurface3): HResult; stdcall;
  1517.     function GetBltStatus(dwFlags: DWORD): HResult; stdcall;
  1518.     function GetCaps(out lpDDSCaps: TDDSCaps): HResult; stdcall;
  1519.     function GetClipper(out lplpDDClipper: IDirectDrawClipper): HResult; stdcall;
  1520.     function GetColorKey(dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
  1521.         HResult; stdcall;
  1522.     function GetDC(out lphDC: HDC): HResult; stdcall;
  1523.     function GetFlipStatus(dwFlags: DWORD): HResult; stdcall;
  1524.     function GetOverlayPosition(out lplX, lplY: Longint): HResult; stdcall;
  1525.     function GetPalette(out lplpDDPalette: IDirectDrawPalette): HResult; stdcall;
  1526.     function GetPixelFormat(out lpDDPixelFormat: TDDPixelFormat): HResult; stdcall;
  1527.     function GetSurfaceDesc(out lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
  1528.     function Initialize(lpDD: IDirectDraw;
  1529.         out lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
  1530.     function IsLost: HResult; stdcall;
  1531.     function Lock(lpDestRect: PRect;
  1532.         out lpDDSurfaceDesc: TDDSurfaceDesc; dwFlags: DWORD;
  1533.         hEvent: THandle): HResult; stdcall;
  1534.     function ReleaseDC(hDC: Windows.HDC): HResult; stdcall;
  1535.     function _Restore: HResult; stdcall;
  1536.     function SetClipper(lpDDClipper: IDirectDrawClipper): HResult; stdcall;
  1537.     function SetColorKey(dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
  1538.         HResult; stdcall;
  1539.     function SetOverlayPosition(lX, lY: Longint): HResult; stdcall;
  1540.     function SetPalette(lpDDPalette: IDirectDrawPalette): HResult; stdcall;
  1541.     function Unlock(lpSurfaceData: Pointer): HResult; stdcall;
  1542.     function UpdateOverlay(lpSrcRect: PRect;
  1543.         lpDDDestSurface: IDirectDrawSurface3; lpDestRect: PRect;
  1544.         dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX): HResult; stdcall;
  1545.     function UpdateOverlayDisplay(dwFlags: DWORD): HResult; stdcall;
  1546.     function UpdateOverlayZOrder(dwFlags: DWORD;
  1547.         lpDDSReference: IDirectDrawSurface3): HResult; stdcall;
  1548.     (*** Added in the v2 interface ***)
  1549.     function GetDDInterface(out lplpDD: IDirectDraw): HResult; stdcall;
  1550.     function PageLock(dwFlags: DWORD): HResult; stdcall;
  1551.     function PageUnlock(dwFlags: DWORD): HResult; stdcall;
  1552.     (*** Added in the V3 interface ***)
  1553.     function SetSurfaceDesc(const lpddsd: TDDSurfaceDesc; dwFlags: DWORD): HResult; stdcall;
  1554.   end;
  1555.  
  1556. (*
  1557.  * IDirectDrawSurface4 and related interfaces
  1558.  *)
  1559.   IDirectDrawSurface4 = interface(IUnknown)
  1560.     ['{0B2B8630-AD35-11D0-8EA6-00609797EA5B}']
  1561.     (*** IDirectDrawSurface methods ***)
  1562.     function AddAttachedSurface(lpDDSAttachedSurface: IDirectDrawSurface4) :
  1563.         HResult; stdcall;
  1564.     function AddOverlayDirtyRect(const lpRect: TRect): HResult; stdcall;
  1565.     function Blt(lpDestRect: PRect;
  1566.         lpDDSrcSurface: IDirectDrawSurface4; lpSrcRect: PRect;
  1567.         dwFlags: DWORD; lpDDBltFx: PDDBltFX): HResult; stdcall;
  1568.     function BltBatch(const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
  1569.         dwFlags: DWORD): HResult; stdcall;
  1570.     function BltFast(dwX: DWORD; dwY: DWORD;
  1571.         lpDDSrcSurface: IDirectDrawSurface4; lpSrcRect: PRect;
  1572.         dwTrans: DWORD): HResult; stdcall;
  1573.     function DeleteAttachedSurface(dwFlags: DWORD;
  1574.         lpDDSAttachedSurface: IDirectDrawSurface4): HResult; stdcall;
  1575.     function EnumAttachedSurfaces(lpContext: Pointer;
  1576.         lpEnumSurfacesCallback: TDDEnumSurfacesCallback2): HResult; stdcall;
  1577.     function EnumOverlayZOrders(dwFlags: DWORD; lpContext: Pointer;
  1578.         lpfnCallback: TDDEnumSurfacesCallback2): HResult; stdcall;
  1579.     function Flip(lpDDSurfaceTargetOverride: IDirectDrawSurface4;
  1580.         dwFlags: DWORD): HResult; stdcall;
  1581.     function GetAttachedSurface(const lpDDSCaps: TDDSCaps2;
  1582.         out lplpDDAttachedSurface: IDirectDrawSurface4): HResult; stdcall;
  1583.     function GetBltStatus(dwFlags: DWORD): HResult; stdcall;
  1584.     function GetCaps(out lpDDSCaps: TDDSCaps2): HResult; stdcall;
  1585.     function GetClipper(out lplpDDClipper: IDirectDrawClipper): HResult; stdcall;
  1586.     function GetColorKey(dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
  1587.         HResult; stdcall;
  1588.     function GetDC(out lphDC: HDC): HResult; stdcall;
  1589.     function GetFlipStatus(dwFlags: DWORD): HResult; stdcall;
  1590.     function GetOverlayPosition(out lplX, lplY: Longint): HResult; stdcall;
  1591.     function GetPalette(out lplpDDPalette: IDirectDrawPalette): HResult; stdcall;
  1592.     function GetPixelFormat(out lpDDPixelFormat: TDDPixelFormat): HResult; stdcall;
  1593.     function GetSurfaceDesc(out lpDDSurfaceDesc: TDDSurfaceDesc2): HResult; stdcall;
  1594.     function Initialize(lpDD: IDirectDraw;
  1595.         out lpDDSurfaceDesc: TDDSurfaceDesc2): HResult; stdcall;
  1596.     function IsLost: HResult; stdcall;
  1597.     function Lock(lpDestRect: PRect;
  1598.         out lpDDSurfaceDesc: TDDSurfaceDesc2; dwFlags: DWORD;
  1599.         hEvent: THandle): HResult; stdcall;
  1600.     function ReleaseDC(hDC: Windows.HDC): HResult; stdcall;
  1601.     function _Restore: HResult; stdcall;
  1602.     function SetClipper(lpDDClipper: IDirectDrawClipper): HResult; stdcall;
  1603.     function SetColorKey(dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
  1604.         HResult; stdcall;
  1605.     function SetOverlayPosition(lX, lY: Longint): HResult; stdcall;
  1606.     function SetPalette(lpDDPalette: IDirectDrawPalette): HResult; stdcall;
  1607.     function Unlock(lpRect: PRect): HResult; stdcall;
  1608.     function UpdateOverlay(lpSrcRect: PRect;
  1609.         lpDDDestSurface: IDirectDrawSurface4; lpDestRect: PRect;
  1610.         dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX): HResult; stdcall;
  1611.     function UpdateOverlayDisplay(dwFlags: DWORD): HResult; stdcall;
  1612.     function UpdateOverlayZOrder(dwFlags: DWORD;
  1613.         lpDDSReference: IDirectDrawSurface4): HResult; stdcall;
  1614.     (*** Added in the v2 interface ***)
  1615.     function GetDDInterface(out lplpDD: IUnknown): HResult; stdcall;
  1616.     function PageLock(dwFlags: DWORD): HResult; stdcall;
  1617.     function PageUnlock(dwFlags: DWORD): HResult; stdcall;
  1618.     (*** Added in the V3 interface ***)
  1619.     function SetSurfaceDesc(const lpddsd2: TDDSurfaceDesc2; dwFlags: DWORD): HResult; stdcall;
  1620.     (*** Added in the v4 interface ***)
  1621.     function SetPrivateData(const guidTag: TGUID; lpData: Pointer;
  1622.         cbSize: DWORD; dwFlags: DWORD): HResult; stdcall;
  1623.     function GetPrivateData(const guidTag: TGUID; lpBuffer: Pointer;
  1624.         var lpcbBufferSize: DWORD): HResult; stdcall;
  1625.     function FreePrivateData(const guidTag: TGUID): HResult; stdcall;
  1626.     function GetUniquenessValue(out lpValue: DWORD): HResult; stdcall;
  1627.     function ChangeUniquenessValue: HResult; stdcall;
  1628.   end;
  1629.  
  1630.   IDirectDrawSurface7 = interface(IUnknown)
  1631.     ['{06675a80-3b9b-11d2-b92f-00609797ea5b}']
  1632.     (*** IDirectDrawSurface methods ***)
  1633.     function AddAttachedSurface(lpDDSAttachedSurface: IDirectDrawSurface7) :
  1634.         HResult; stdcall;
  1635.     function AddOverlayDirtyRect(const lpRect: TRect): HResult; stdcall;
  1636.     function Blt(lpDestRect: PRect;
  1637.         lpDDSrcSurface: IDirectDrawSurface7; lpSrcRect: PRect;
  1638.         dwFlags: DWORD; lpDDBltFx: PDDBltFX): HResult; stdcall;
  1639.     function BltBatch(const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
  1640.         dwFlags: DWORD): HResult; stdcall;
  1641.     function BltFast(dwX: DWORD; dwY: DWORD;
  1642.         lpDDSrcSurface: IDirectDrawSurface7; lpSrcRect: PRect;
  1643.         dwTrans: DWORD): HResult; stdcall;
  1644.     function DeleteAttachedSurface(dwFlags: DWORD;
  1645.         lpDDSAttachedSurface: IDirectDrawSurface7): HResult; stdcall;
  1646.     function EnumAttachedSurfaces(lpContext: Pointer;
  1647.         lpEnumSurfacesCallback: TDDEnumSurfacesCallback7): HResult; stdcall;
  1648.     function EnumOverlayZOrders(dwFlags: DWORD; lpContext: Pointer;
  1649.         lpfnCallback: TDDEnumSurfacesCallback7): HResult; stdcall;
  1650.     function Flip(lpDDSurfaceTargetOverride: IDirectDrawSurface7;
  1651.         dwFlags: DWORD): HResult; stdcall;
  1652.     function GetAttachedSurface(const lpDDSCaps: TDDSCaps2;
  1653.         out lplpDDAttachedSurface: IDirectDrawSurface7): HResult; stdcall;
  1654.     function GetBltStatus(dwFlags: DWORD): HResult; stdcall;
  1655.     function GetCaps(out lpDDSCaps: TDDSCaps2): HResult; stdcall;
  1656.     function GetClipper(out lplpDDClipper: IDirectDrawClipper): HResult; stdcall;
  1657.     function GetColorKey(dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
  1658.         HResult; stdcall;
  1659.     function GetDC(out lphDC: HDC): HResult; stdcall;
  1660.     function GetFlipStatus(dwFlags: DWORD): HResult; stdcall;
  1661.     function GetOverlayPosition(out lplX, lplY: Longint): HResult; stdcall;
  1662.     function GetPalette(out lplpDDPalette: IDirectDrawPalette): HResult; stdcall;
  1663.     function GetPixelFormat(out lpDDPixelFormat: TDDPixelFormat): HResult; stdcall;
  1664.     function GetSurfaceDesc(out lpDDSurfaceDesc: TDDSurfaceDesc2): HResult; stdcall;
  1665.     function Initialize(lpDD: IDirectDraw;
  1666.         out lpDDSurfaceDesc: TDDSurfaceDesc2): HResult; stdcall;
  1667.     function IsLost: HResult; stdcall;
  1668.     function Lock(lpDestRect: PRect;
  1669.         out lpDDSurfaceDesc: TDDSurfaceDesc2; dwFlags: DWORD;
  1670.         hEvent: THandle): HResult; stdcall;
  1671.     function ReleaseDC(hDC: Windows.HDC): HResult; stdcall;
  1672.     function _Restore: HResult; stdcall;
  1673.     function SetClipper(lpDDClipper: IDirectDrawClipper): HResult; stdcall;
  1674.     function SetColorKey(dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
  1675.         HResult; stdcall;
  1676.     function SetOverlayPosition(lX, lY: Longint): HResult; stdcall;
  1677.     function SetPalette(lpDDPalette: IDirectDrawPalette): HResult; stdcall;
  1678.     function Unlock(lpRect: PRect): HResult; stdcall;
  1679.     function UpdateOverlay(lpSrcRect: PRect;
  1680.         lpDDDestSurface: IDirectDrawSurface7; lpDestRect: PRect;
  1681.         dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX): HResult; stdcall;
  1682.     function UpdateOverlayDisplay(dwFlags: DWORD): HResult; stdcall;
  1683.     function UpdateOverlayZOrder(dwFlags: DWORD;
  1684.         lpDDSReference: IDirectDrawSurface7): HResult; stdcall;
  1685.     (*** Added in the v2 interface ***)
  1686.     function GetDDInterface(out lplpDD: IUnknown): HResult; stdcall;
  1687.     function PageLock(dwFlags: DWORD): HResult; stdcall;
  1688.     function PageUnlock(dwFlags: DWORD): HResult; stdcall;
  1689.     (*** Added in the V3 interface ***)
  1690.     function SetSurfaceDesc(const lpddsd2: TDDSurfaceDesc2; dwFlags: DWORD): HResult; stdcall;
  1691.     (*** Added in the v4 interface ***)
  1692.     function SetPrivateData(const guidTag: TGUID; lpData: Pointer;
  1693.         cbSize: DWORD; dwFlags: DWORD): HResult; stdcall;
  1694.     function GetPrivateData(const guidTag: TGUID; lpBuffer: Pointer;
  1695.         var lpcbBufferSize: DWORD): HResult; stdcall;
  1696.     function FreePrivateData(const guidTag: TGUID): HResult; stdcall;
  1697.     function GetUniquenessValue(out lpValue: DWORD): HResult; stdcall;
  1698.     function ChangeUniquenessValue: HResult; stdcall;
  1699.     (*** Moved Texture7 methods here ***)
  1700.     function SetPriority(dwPriority: DWORD): HResult; stdcall;
  1701.     function GetPriority(out lpdwPriority: DWORD): HResult; stdcall;
  1702.     function SetLOD(dwMaxLOD: DWORD): HResult; stdcall;
  1703.     function GetLOD(out lpdwMaxLOD: DWORD): HResult; stdcall;
  1704.   end;
  1705.  
  1706.   IDirectDrawColorControl = interface(IUnknown)
  1707.     ['{4B9F0EE0-0D7E-11D0-9B06-00A0C903A3B8}']
  1708.     function GetColorControls(out lpColorControl: TDDColorControl): HResult; stdcall;
  1709.     function SetColorControls(const lpColorControl: TDDColorControl): HResult; stdcall;
  1710.   end;
  1711.  
  1712. (*
  1713.  * IDirectDrawGammaControl
  1714.  *)
  1715.   IDirectDrawGammaControl = interface(IUnknown)
  1716.     ['{69C11C3E-B46B-11D1-AD7A-00C04FC29B4E}']
  1717.     function GetGammaRamp(dwFlags: DWORD; out lpRampData: TDDGammaRamp): HResult; stdcall;
  1718.     function SetGammaRamp(dwFlags: DWORD; const lpRampData: TDDGammaRamp): HResult; stdcall;
  1719.   end;
  1720.  
  1721. type
  1722.   IID_IDirectDraw = IDirectDraw;
  1723.   {$EXTERNALSYM IID_IDirectDraw}
  1724.   IID_IDirectDraw2 = IDirectDraw2;
  1725.   {$EXTERNALSYM IID_IDirectDraw2}
  1726.   IID_IDirectDraw4 = IDirectDraw4;
  1727.   {$EXTERNALSYM IID_IDirectDraw4}
  1728.   IID_IDirectDraw7 = IDirectDraw7;
  1729.   {$EXTERNALSYM IID_IDirectDraw7}
  1730.   IID_IDirectDrawSurface = IDirectDrawSurface;
  1731.   {$EXTERNALSYM IID_IDirectDrawSurface}
  1732.   IID_IDirectDrawSurface2 = IDirectDrawSurface2;
  1733.   {$EXTERNALSYM IID_IDirectDrawSurface2}
  1734.   IID_IDirectDrawSurface3 = IDirectDrawSurface3;
  1735.   {$EXTERNALSYM IID_IDirectDrawSurface3}
  1736.   IID_IDirectDrawSurface4 = IDirectDrawSurface4;
  1737.   {$EXTERNALSYM IID_IDirectDrawSurface4}
  1738.   IID_IDirectDrawSurface7 = IDirectDrawSurface7;
  1739.   {$EXTERNALSYM IID_IDirectDrawSurface7}
  1740.  
  1741.   IID_IDirectDrawPalette = IDirectDrawPalette;
  1742.   {$EXTERNALSYM IID_IDirectDrawPalette}
  1743.   IID_IDirectDrawClipper = IDirectDrawClipper;
  1744.   {$EXTERNALSYM IID_IDirectDrawClipper}
  1745.   IID_IDirectDrawColorControl = IDirectDrawColorControl;
  1746.   {$EXTERNALSYM IID_IDirectDrawColorControl}
  1747.   IID_IDirectDrawGammaControl = IDirectDrawGammaControl;
  1748.   {$EXTERNALSYM IID_IDirectDrawGammaControl}
  1749.  
  1750. const
  1751. (*
  1752.  * ddsCaps field is valid.
  1753.  *)
  1754.   DDSD_CAPS               = $00000001;     // default
  1755.   {$EXTERNALSYM DDSD_CAPS}
  1756.  
  1757. (*
  1758.  * dwHeight field is valid.
  1759.  *)
  1760.   DDSD_HEIGHT             = $00000002;
  1761.   {$EXTERNALSYM DDSD_HEIGHT}
  1762.  
  1763. (*
  1764.  * dwWidth field is valid.
  1765.  *)
  1766.   DDSD_WIDTH              = $00000004;
  1767.   {$EXTERNALSYM DDSD_WIDTH}
  1768.  
  1769. (*
  1770.  * lPitch is valid.
  1771.  *)
  1772.   DDSD_PITCH              = $00000008;
  1773.   {$EXTERNALSYM DDSD_PITCH}
  1774.  
  1775. (*
  1776.  * dwBackBufferCount is valid.
  1777.  *)
  1778.   DDSD_BACKBUFFERCOUNT    = $00000020;
  1779.   {$EXTERNALSYM DDSD_BACKBUFFERCOUNT}
  1780.  
  1781. (*
  1782.  * dwZBufferBitDepth is valid.  (shouldnt be used in DDSURFACEDESC2)
  1783.  *)
  1784.   DDSD_ZBUFFERBITDEPTH    = $00000040;
  1785.   {$EXTERNALSYM DDSD_ZBUFFERBITDEPTH}
  1786.  
  1787. (*
  1788.  * dwAlphaBitDepth is valid.
  1789.  *)
  1790.    DDSD_ALPHABITDEPTH      = $00000080;
  1791.    {$EXTERNALSYM DDSD_ALPHABITDEPTH}
  1792.  
  1793. (*
  1794.  * lpSurface is valid.
  1795.  *)
  1796.   DDSD_LPSURFACE       = $00000800;
  1797.   {$EXTERNALSYM DDSD_LPSURFACE}
  1798.  
  1799. (*
  1800.  * ddpfPixelFormat is valid.
  1801.  *)
  1802.   DDSD_PIXELFORMAT        = $00001000;
  1803.   {$EXTERNALSYM DDSD_PIXELFORMAT}
  1804.  
  1805. (*
  1806.  * ddckCKDestOverlay is valid.
  1807.  *)
  1808.   DDSD_CKDESTOVERLAY      = $00002000;
  1809.   {$EXTERNALSYM DDSD_CKDESTOVERLAY}
  1810.  
  1811. (*
  1812.  * ddckCKDestBlt is valid.
  1813.  *)
  1814.   DDSD_CKDESTBLT          = $00004000;
  1815.   {$EXTERNALSYM DDSD_CKDESTBLT}
  1816.  
  1817. (*
  1818.  * ddckCKSrcOverlay is valid.
  1819.  *)
  1820.   DDSD_CKSRCOVERLAY       = $00008000;
  1821.   {$EXTERNALSYM DDSD_CKSRCOVERLAY}
  1822.  
  1823. (*
  1824.  * ddckCKSrcBlt is valid.
  1825.  *)
  1826.   DDSD_CKSRCBLT           = $00010000;
  1827.   {$EXTERNALSYM DDSD_CKSRCBLT}
  1828.  
  1829. (*
  1830.  * dwMipMapCount is valid.
  1831.  *)
  1832.   DDSD_MIPMAPCOUNT        = $00020000;
  1833.   {$EXTERNALSYM DDSD_MIPMAPCOUNT}
  1834.  
  1835.  (*
  1836.   * dwRefreshRate is valid
  1837.   *)
  1838.   DDSD_REFRESHRATE        = $00040000;
  1839.   {$EXTERNALSYM DDSD_REFRESHRATE}
  1840.  
  1841. (*
  1842.  * dwLinearSize is valid
  1843.  *)
  1844.   DDSD_LINEARSIZE      = $00080000;
  1845.   {$EXTERNALSYM DDSD_LINEARSIZE}
  1846.  
  1847. (*
  1848.  * dwTextureStage is valid
  1849.  *)
  1850.   DDSD_TEXTURESTAGE       = $00100000;
  1851.   {$EXTERNALSYM DDSD_TEXTURESTAGE}
  1852.  
  1853. (*
  1854.  * dwFVF is valid
  1855.  *)
  1856.   DDSD_FVF                = $00200000;
  1857.   {$EXTERNALSYM DDSD_FVF}
  1858.  
  1859. (*
  1860.  * dwSrcVBHandle is valid
  1861.  *)
  1862.   DDSD_SRCVBHANDLE        = $00400000;
  1863.   {$EXTERNALSYM DDSD_SRCVBHANDLE}
  1864.  
  1865. (*
  1866.  * dwDepth is valid
  1867.  *)
  1868.   DDSD_DEPTH              = $00800000;
  1869.   {$EXTERNALSYM DDSD_DEPTH}
  1870.  
  1871. (*
  1872.  * All input fields are valid.
  1873.  *)
  1874.   DDSD_ALL          = $00fff9ee;
  1875.   {$EXTERNALSYM DDSD_ALL}
  1876.  
  1877.  
  1878. (*
  1879.  * guid field is valid.
  1880.  *)
  1881.   DDOSD_GUID                  = $00000001;
  1882.   {$EXTERNALSYM DDOSD_GUID}
  1883.  
  1884. (*
  1885.  * dwCompressionRatio field is valid.
  1886.  *)
  1887.   DDOSD_COMPRESSION_RATIO     = $00000002;
  1888.   {$EXTERNALSYM DDOSD_COMPRESSION_RATIO}
  1889.  
  1890. (*
  1891.  * ddSCaps field is valid.
  1892.  *)
  1893.   DDOSD_SCAPS                 = $00000004;
  1894.   {$EXTERNALSYM DDOSD_SCAPS}
  1895.  
  1896. (*
  1897.  * ddOSCaps field is valid.
  1898.  *)
  1899.   DDOSD_OSCAPS                = $00000008;
  1900.   {$EXTERNALSYM DDOSD_OSCAPS}
  1901.  
  1902. (*
  1903.  * All input fields are valid.
  1904.  *)
  1905.   DDOSD_ALL                   = $0000000f;
  1906.   {$EXTERNALSYM DDOSD_ALL}
  1907.  
  1908. (*
  1909.  * The surface's optimized pixelformat is compressed
  1910.  *)
  1911.   DDOSDCAPS_OPTCOMPRESSED            = $00000001;
  1912.   {$EXTERNALSYM DDOSDCAPS_OPTCOMPRESSED}
  1913.  
  1914. (*
  1915.  * The surface's optimized pixelformat is reordered
  1916.  *)
  1917.   DDOSDCAPS_OPTREORDERED            = $00000002;
  1918.   {$EXTERNALSYM DDOSDCAPS_OPTREORDERED}
  1919.  
  1920. (*
  1921.  * The opt surface is a monolithic mipmap
  1922.  *)
  1923.   DDOSDCAPS_MONOLITHICMIPMAP        = $00000004;
  1924.   {$EXTERNALSYM DDOSDCAPS_MONOLITHICMIPMAP}
  1925.  
  1926. (*
  1927.  * The valid Surf caps:
  1928.  *   DDSCAPS_SYSTEMMEMORY      = $00000800;
  1929.  *   DDSCAPS_VIDEOMEMORY        = $00004000;
  1930.  *   DDSCAPS_LOCALVIDMEM        = $10000000;
  1931.  *   DDSCAPS_NONLOCALVIDMEM     = $20000000;
  1932.  *)
  1933.   DDOSDCAPS_VALIDSCAPS             = $30004800;
  1934.   {$EXTERNALSYM DDOSDCAPS_VALIDSCAPS}
  1935.  
  1936. (*
  1937.  * The valid OptSurf caps
  1938.  *)
  1939.   DDOSDCAPS_VALIDOSCAPS             = $00000007;
  1940.   {$EXTERNALSYM DDOSDCAPS_VALIDOSCAPS}
  1941.  
  1942.  
  1943. (*
  1944.  * DDCOLORCONTROL
  1945.  *)
  1946.  
  1947. (*
  1948.  * lBrightness field is valid.
  1949.  *)
  1950.   DDCOLOR_BRIGHTNESS        = $00000001;
  1951.   {$EXTERNALSYM DDCOLOR_BRIGHTNESS}
  1952.  
  1953. (*
  1954.  * lContrast field is valid.
  1955.  *)
  1956.   DDCOLOR_CONTRAST        = $00000002;
  1957.   {$EXTERNALSYM DDCOLOR_CONTRAST}
  1958.  
  1959. (*
  1960.  * lHue field is valid.
  1961.  *)
  1962.   DDCOLOR_HUE            = $00000004;
  1963.   {$EXTERNALSYM DDCOLOR_HUE}
  1964.  
  1965. (*
  1966.  * lSaturation field is valid.
  1967.  *)
  1968.   DDCOLOR_SATURATION        = $00000008;
  1969.   {$EXTERNALSYM DDCOLOR_SATURATION}
  1970.  
  1971. (*
  1972.  * lSharpness field is valid.
  1973.  *)
  1974.   DDCOLOR_SHARPNESS        = $00000010;
  1975.   {$EXTERNALSYM DDCOLOR_SHARPNESS}
  1976.  
  1977. (*
  1978.  * lGamma field is valid.
  1979.  *)
  1980.   DDCOLOR_GAMMA            = $00000020;
  1981.   {$EXTERNALSYM DDCOLOR_GAMMA}
  1982.  
  1983. (*
  1984.  * lColorEnable field is valid.
  1985.  *)
  1986.   DDCOLOR_COLORENABLE        = $00000040;
  1987.   {$EXTERNALSYM DDCOLOR_COLORENABLE}
  1988.  
  1989.  
  1990.  
  1991. (*============================================================================
  1992.  *
  1993.  * Direct Draw Capability Flags
  1994.  *
  1995.  * These flags are used to describe the capabilities of a given Surface.
  1996.  * All flags are bit flags.
  1997.  *
  1998.  *==========================================================================*)
  1999.  
  2000. (****************************************************************************
  2001.  *
  2002.  * DIRECTDRAWSURFACE CAPABILITY FLAGS
  2003.  *
  2004.  ****************************************************************************)
  2005. (*
  2006.  * This bit currently has no meaning.
  2007.  *)
  2008.   DDSCAPS_RESERVED1                       = $00000001;
  2009.   {$EXTERNALSYM DDSCAPS_RESERVED1}
  2010.  
  2011. (*
  2012.  * Indicates that this surface contains alpha-only information.
  2013.  * (To determine if a surface is RGBA/YUVA, the pixel format must be
  2014.  * interrogated.)
  2015.  *)
  2016.   DDSCAPS_ALPHA                           = $00000002;
  2017.   {$EXTERNALSYM DDSCAPS_ALPHA}
  2018.  
  2019. (*
  2020.  * Indicates that this surface is a backbuffer.  It is generally
  2021.  * set by CreateSurface when the DDSCAPS_FLIP capability bit is set.
  2022.  * It indicates that this surface is THE back buffer of a surface
  2023.  * flipping structure.  DirectDraw supports N surfaces in a
  2024.  * surface flipping structure.  Only the surface that immediately
  2025.  * precedeces the DDSCAPS_FRONTBUFFER has this capability bit set.
  2026.  * The other surfaces are identified as back buffers by the presence
  2027.  * of the DDSCAPS_FLIP capability, their attachment order, and the
  2028.  * absence of the DDSCAPS_FRONTBUFFER and DDSCAPS_BACKBUFFER
  2029.  * capabilities.  The bit is sent to CreateSurface when a standalone
  2030.  * back buffer is being created.  This surface could be attached to
  2031.  * a front buffer and/or back buffers to form a flipping surface
  2032.  * structure after the CreateSurface call.  See AddAttachments for
  2033.  * a detailed description of the behaviors in this case.
  2034.  *)
  2035.   DDSCAPS_BACKBUFFER                      = $00000004;
  2036.   {$EXTERNALSYM DDSCAPS_BACKBUFFER}
  2037.  
  2038. (*
  2039.  * Indicates a complex surface structure is being described.  A
  2040.  * complex surface structure results in the creation of more than
  2041.  * one surface.  The additional surfaces are attached to the root
  2042.  * surface.  The complex structure can only be destroyed by
  2043.  * destroying the root.
  2044.  *)
  2045.   DDSCAPS_COMPLEX                         = $00000008;
  2046.   {$EXTERNALSYM DDSCAPS_COMPLEX}
  2047.  
  2048. (*
  2049.  * Indicates that this surface is a part of a surface flipping structure.
  2050.  * When it is passed to CreateSurface the DDSCAPS_FRONTBUFFER and
  2051.  * DDSCAP_BACKBUFFER bits are not set.  They are set by CreateSurface
  2052.  * on the resulting creations.  The dwBackBufferCount field in the
  2053.  * TDDSurfaceDesc structure must be set to at least 1 in order for
  2054.  * the CreateSurface call to succeed.  The DDSCAPS_COMPLEX capability
  2055.  * must always be set with creating multiple surfaces through CreateSurface.
  2056.  *)
  2057.   DDSCAPS_FLIP                            = $00000010;
  2058.   {$EXTERNALSYM DDSCAPS_FLIP}
  2059.  
  2060. (*
  2061.  * Indicates that this surface is THE front buffer of a surface flipping
  2062.  * structure.  It is generally set by CreateSurface when the DDSCAPS_FLIP
  2063.  * capability bit is set.
  2064.  * If this capability is sent to CreateSurface then a standalonw front buffer
  2065.  * is created.  This surface will not have the DDSCAPS_FLIP capability.
  2066.  * It can be attached to other back buffers to form a flipping structure.
  2067.  * See AddAttachments for a detailed description of the behaviors in this
  2068.  * case.
  2069.  *)
  2070.   DDSCAPS_FRONTBUFFER                     = $00000020;
  2071.   {$EXTERNALSYM DDSCAPS_FRONTBUFFER}
  2072.  
  2073. (*
  2074.  * Indicates that this surface is any offscreen surface that is not an overlay,
  2075.  * texture, zbuffer, front buffer, back buffer, or alpha surface.  It is used
  2076.  * to identify plain vanilla surfaces.
  2077.  *)
  2078.   DDSCAPS_OFFSCREENPLAIN                  = $00000040;
  2079.   {$EXTERNALSYM DDSCAPS_OFFSCREENPLAIN}
  2080.  
  2081. (*
  2082.  * Indicates that this surface is an overlay.  It may or may not be directly visible
  2083.  * depending on whether or not it is currently being overlayed onto the primary
  2084.  * surface.  DDSCAPS_VISIBLE can be used to determine whether or not it is being
  2085.  * overlayed at the moment.
  2086.  *)
  2087.   DDSCAPS_OVERLAY                         = $00000080;
  2088.   {$EXTERNALSYM DDSCAPS_OVERLAY}
  2089.  
  2090. (*
  2091.  * Indicates that unique DirectDrawPalette objects can be created and
  2092.  * attached to this surface.
  2093.  *)
  2094.   DDSCAPS_PALETTE                         = $00000100;
  2095.   {$EXTERNALSYM DDSCAPS_PALETTE}
  2096.  
  2097. (*
  2098.  * Indicates that this surface is the primary surface.  The primary
  2099.  * surface represents what the user is seeing at the moment.
  2100.  *)
  2101.   DDSCAPS_PRIMARYSURFACE                  = $00000200;
  2102.   {$EXTERNALSYM DDSCAPS_PRIMARYSURFACE}
  2103.  
  2104. (*
  2105.  * This flag used to be DDSCAPS_PRIMARYSURFACELEFT, which is now
  2106.  * obsolete.
  2107.  *)
  2108.   DDSCAPS_RESERVED3              = $00000400;
  2109.   {$EXTERNALSYM DDSCAPS_RESERVED3}
  2110.   DDSCAPS_PRIMARYSURFACELEFT = DDSCAPS_RESERVED3;
  2111.   {$EXTERNALSYM DDSCAPS_PRIMARYSURFACELEFT}
  2112.  
  2113. (*
  2114.  * Indicates that this surface memory was allocated in system memory
  2115.  *)
  2116.   DDSCAPS_SYSTEMMEMORY                    = $00000800;
  2117.   {$EXTERNALSYM DDSCAPS_SYSTEMMEMORY}
  2118.  
  2119. (*
  2120.  * Indicates that this surface can be used as a 3D texture.  It does not
  2121.  * indicate whether or not the surface is being used for that purpose.
  2122.  *)
  2123.   DDSCAPS_TEXTURE                         = $00001000;
  2124.   {$EXTERNALSYM DDSCAPS_TEXTURE}
  2125.  
  2126. (*
  2127.  * Indicates that a surface may be a destination for 3D rendering.  This
  2128.  * bit must be set in order to query for a Direct3D Device Interface
  2129.  * from this surface.
  2130.  *)
  2131.   DDSCAPS_3DDEVICE                        = $00002000;
  2132.   {$EXTERNALSYM DDSCAPS_3DDEVICE}
  2133.  
  2134. (*
  2135.  * Indicates that this surface exists in video memory.
  2136.  *)
  2137.   DDSCAPS_VIDEOMEMORY                     = $00004000;
  2138.   {$EXTERNALSYM DDSCAPS_VIDEOMEMORY}
  2139.  
  2140. (*
  2141.  * Indicates that changes made to this surface are immediately visible.
  2142.  * It is always set for the primary surface and is set for overlays while
  2143.  * they are being overlayed and texture maps while they are being textured.
  2144.  *)
  2145.   DDSCAPS_VISIBLE                         = $00008000;
  2146.   {$EXTERNALSYM DDSCAPS_VISIBLE}
  2147.  
  2148. (*
  2149.  * Indicates that only writes are permitted to the surface.  Read accesses
  2150.  * from the surface may or may not generate a protection fault, but the
  2151.  * results of a read from this surface will not be meaningful.  READ ONLY.
  2152.  *)
  2153.   DDSCAPS_WRITEONLY                       = $00010000;
  2154.   {$EXTERNALSYM DDSCAPS_WRITEONLY}
  2155.  
  2156. (*
  2157.  * Indicates that this surface is a z buffer. A z buffer does not contain
  2158.  * displayable information.  Instead it contains bit depth information that is
  2159.  * used to determine which pixels are visible and which are obscured.
  2160.  *)
  2161.   DDSCAPS_ZBUFFER                         = $00020000;
  2162.   {$EXTERNALSYM DDSCAPS_ZBUFFER}
  2163.  
  2164. (*
  2165.  * Indicates surface will have a DC associated long term
  2166.  *)
  2167.   DDSCAPS_OWNDC                           = $00040000;
  2168.   {$EXTERNALSYM DDSCAPS_OWNDC}
  2169.  
  2170. (*
  2171.  * Indicates surface should be able to receive live video
  2172.  *)
  2173.   DDSCAPS_LIVEVIDEO                       = $00080000;
  2174.   {$EXTERNALSYM DDSCAPS_LIVEVIDEO}
  2175.  
  2176. (*
  2177.  * Indicates surface should be able to have a stream decompressed
  2178.  * to it by the hardware.
  2179.  *)
  2180.   DDSCAPS_HWCODEC                         = $00100000;
  2181.   {$EXTERNALSYM DDSCAPS_HWCODEC}
  2182.  
  2183. (*
  2184.  * Surface is a ModeX surface.
  2185.  *
  2186.  *)
  2187.   DDSCAPS_MODEX                           = $00200000;
  2188.   {$EXTERNALSYM DDSCAPS_MODEX}
  2189.  
  2190. (*
  2191.  * Indicates surface is one level of a mip-map. This surface will
  2192.  * be attached to other DDSCAPS_MIPMAP surfaces to form the mip-map.
  2193.  * This can be done explicitly, by creating a number of surfaces and
  2194.  * attaching them with AddAttachedSurface or by implicitly by CreateSurface.
  2195.  * If this bit is set then DDSCAPS_TEXTURE must also be set.
  2196.  *)
  2197.   DDSCAPS_MIPMAP                          = $00400000;
  2198.   {$EXTERNALSYM DDSCAPS_MIPMAP}
  2199.  
  2200. (*
  2201.  * This bit is reserved. It should not be specified.
  2202.  *)
  2203.   DDSCAPS_RESERVED2                       = $00800000;
  2204.   {$EXTERNALSYM DDSCAPS_RESERVED2}
  2205.  
  2206. (*
  2207.  * Indicates that memory for the surface is not allocated until the surface
  2208.  * is loaded (via the Direct3D texture Load() function).
  2209.  *)
  2210.   DDSCAPS_ALLOCONLOAD                     = $04000000;
  2211.   {$EXTERNALSYM DDSCAPS_ALLOCONLOAD}
  2212.  
  2213. (*
  2214.  * Indicates that the surface will recieve data from a video port.
  2215.  *)
  2216.   DDSCAPS_VIDEOPORT                  = $08000000;
  2217.   {$EXTERNALSYM DDSCAPS_VIDEOPORT}
  2218.  
  2219. (*
  2220.  * Indicates that a video memory surface is resident in true, local video
  2221.  * memory rather than non-local video memory. If this flag is specified then
  2222.  * so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with
  2223.  * DDSCAPS_NONLOCALVIDMEM.
  2224.  *)
  2225.   DDSCAPS_LOCALVIDMEM                     = $10000000;
  2226.   {$EXTERNALSYM DDSCAPS_LOCALVIDMEM}
  2227.  
  2228. (*
  2229.  * Indicates that a video memory surface is resident in non-local video
  2230.  * memory rather than true, local video memory. If this flag is specified
  2231.  * then so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with
  2232.  * DDSCAPS_LOCALVIDMEM.
  2233.  *)
  2234.   DDSCAPS_NONLOCALVIDMEM                  = $20000000;
  2235.   {$EXTERNALSYM DDSCAPS_NONLOCALVIDMEM}
  2236.  
  2237. (*
  2238.  * Indicates that this surface is a standard VGA mode surface, and not a
  2239.  * ModeX surface. (This flag will never be set in combination with the
  2240.  * DDSCAPS_MODEX flag).
  2241.  *)
  2242.   DDSCAPS_STANDARDVGAMODE                 = $40000000;
  2243.   {$EXTERNALSYM DDSCAPS_STANDARDVGAMODE}
  2244.  
  2245. (*
  2246.  * Indicates that this surface will be an optimized surface. This flag is
  2247.  * currently only valid in conjunction with the DDSCAPS_TEXTURE flag. The surface
  2248.  * will be created without any underlying video memory until loaded.
  2249.  *)
  2250.   DDSCAPS_OPTIMIZED                       = $80000000;
  2251.   {$EXTERNALSYM DDSCAPS_OPTIMIZED}
  2252.  
  2253.  
  2254.  
  2255. (*
  2256.  * This bit is reserved
  2257.  *)
  2258.   DDSCAPS2_RESERVED4                      = $00000002;
  2259.   {$EXTERNALSYM DDSCAPS2_RESERVED4}
  2260.   DDSCAPS2_HARDWAREDEINTERLACE            = $00000000;
  2261.   {$EXTERNALSYM DDSCAPS2_HARDWAREDEINTERLACE}
  2262.  
  2263. (*
  2264.  * Indicates to the driver that this surface will be locked very frequently
  2265.  * (for procedural textures, dynamic lightmaps, etc). Surfaces with this cap
  2266.  * set must also have DDSCAPS_TEXTURE. This cap cannot be used with
  2267.  * DDSCAPS2_HINTSTATIC and DDSCAPS2_OPAQUE.
  2268.  *)
  2269.   DDSCAPS2_HINTDYNAMIC             = $00000004;
  2270.   {$EXTERNALSYM DDSCAPS2_HINTDYNAMIC}
  2271.  
  2272. (*
  2273.  * Indicates to the driver that this surface can be re-ordered/retiled on
  2274.  * load. This operation will not change the size of the texture. It is
  2275.  * relatively fast and symmetrical, since the application may lock these
  2276.  * bits (although it will take a performance hit when doing so). Surfaces
  2277.  * with this cap set must also have DDSCAPS_TEXTURE. This cap cannot be
  2278.  * used with DDSCAPS2_HINTDYNAMIC and DDSCAPS2_OPAQUE.
  2279.  *)
  2280.   DDSCAPS2_HINTSTATIC             = $00000008;
  2281.   {$EXTERNALSYM DDSCAPS2_HINTSTATIC}
  2282.  
  2283. (*
  2284.  * Indicates that the client would like this texture surface to be managed by the
  2285.  * DirectDraw/Direct3D runtime. Surfaces with this cap set must also have
  2286.  * DDSCAPS_TEXTURE and DDSCAPS_SYSTEMMEMORY.
  2287.  *)
  2288.   DDSCAPS2_TEXTUREMANAGE                  = $00000010;
  2289.   {$EXTERNALSYM DDSCAPS2_TEXTUREMANAGE}
  2290.  
  2291. (*
  2292.  * These bits are reserved for internal use *)
  2293.   DDSCAPS2_RESERVED1                      = $00000020;
  2294.   {$EXTERNALSYM DDSCAPS2_RESERVED1}
  2295.   DDSCAPS2_RESERVED2                      = $00000040;
  2296.   {$EXTERNALSYM DDSCAPS2_RESERVED2}
  2297.  
  2298. (*
  2299.  * Indicates to the driver that this surface will never be locked again.
  2300.  * The driver is free to optimize this surface via retiling and actual compression.
  2301.  * All calls to Lock() or Blts from this surface will fail. Surfaces with this
  2302.  * cap set must also have DDSCAPS_TEXTURE. This cap cannot be used with
  2303.  * DDSCAPS2_HINTDYNAMIC and DDSCAPS2_HINTSTATIC.
  2304.  *)
  2305.   DDSCAPS2_OPAQUE                         = $00000080;
  2306.   {$EXTERNALSYM DDSCAPS2_OPAQUE}
  2307.  
  2308. (*
  2309.  * Applications should set this bit at CreateSurface time to indicate that they
  2310.  * intend to use antialiasing. Only valid if DDSCAPS_3DDEVICE is also set.
  2311.  *)
  2312.   DDSCAPS2_HINTANTIALIASING               = $00000100;
  2313.   {$EXTERNALSYM DDSCAPS2_HINTANTIALIASING}
  2314.  
  2315. (*
  2316.  * This flag is used at CreateSurface time to indicate that this set of
  2317.  * surfaces is a cubic environment map
  2318.  *)
  2319.   DDSCAPS2_CUBEMAP                        = $00000200;
  2320.   {$EXTERNALSYM DDSCAPS2_CUBEMAP}
  2321.  
  2322. (*
  2323.  * These flags preform two functions:
  2324.  * - At CreateSurface time, they define which of the six cube faces are
  2325.  *   required by the application.
  2326.  * - After creation, each face in the cubemap will have exactly one of these
  2327.  *   bits set.
  2328.  *)
  2329.   DDSCAPS2_CUBEMAP_POSITIVEX              = $00000400;
  2330.   {$EXTERNALSYM DDSCAPS2_CUBEMAP_POSITIVEX}
  2331.   DDSCAPS2_CUBEMAP_NEGATIVEX              = $00000800;
  2332.   {$EXTERNALSYM DDSCAPS2_CUBEMAP_NEGATIVEX}
  2333.   DDSCAPS2_CUBEMAP_POSITIVEY              = $00001000;
  2334.   {$EXTERNALSYM DDSCAPS2_CUBEMAP_POSITIVEY}
  2335.   DDSCAPS2_CUBEMAP_NEGATIVEY              = $00002000;
  2336.   {$EXTERNALSYM DDSCAPS2_CUBEMAP_NEGATIVEY}
  2337.   DDSCAPS2_CUBEMAP_POSITIVEZ              = $00004000;
  2338.   {$EXTERNALSYM DDSCAPS2_CUBEMAP_POSITIVEZ}
  2339.   DDSCAPS2_CUBEMAP_NEGATIVEZ              = $00008000;
  2340.   {$EXTERNALSYM DDSCAPS2_CUBEMAP_NEGATIVEZ}
  2341.  
  2342. (*
  2343.  * This macro may be used to specify all faces of a cube map at CreateSurface time
  2344.  *)
  2345.   DDSCAPS2_CUBEMAP_ALLFACES = ( DDSCAPS2_CUBEMAP_POSITIVEX or
  2346.                                 DDSCAPS2_CUBEMAP_NEGATIVEX or
  2347.                                 DDSCAPS2_CUBEMAP_POSITIVEY or
  2348.                                 DDSCAPS2_CUBEMAP_NEGATIVEY or
  2349.                                 DDSCAPS2_CUBEMAP_POSITIVEZ or
  2350.                                 DDSCAPS2_CUBEMAP_NEGATIVEZ );
  2351.   {$EXTERNALSYM DDSCAPS2_CUBEMAP_ALLFACES}
  2352.  
  2353.  
  2354. (*
  2355.  * This flag is an additional flag which is present on mipmap sublevels from DX7 onwards
  2356.  * It enables easier use of GetAttachedSurface rather than EnumAttachedSurfaces for surface
  2357.  * constructs such as Cube Maps, wherein there are more than one mipmap surface attached
  2358.  * to the root surface.
  2359.  * This caps bit is ignored by CreateSurface
  2360.  *)
  2361.   DDSCAPS2_MIPMAPSUBLEVEL                 = $00010000;
  2362.   {$EXTERNALSYM DDSCAPS2_MIPMAPSUBLEVEL}
  2363.  
  2364. (* This flag indicates that the texture should be managed by D3D only *)
  2365.   DDSCAPS2_D3DTEXTUREMANAGE               = $00020000;
  2366.   {$EXTERNALSYM DDSCAPS2_D3DTEXTUREMANAGE}
  2367.  
  2368. (* This flag indicates that the managed surface can be safely lost *)
  2369.   DDSCAPS2_DONOTPERSIST                   = $00040000;
  2370.   {$EXTERNALSYM DDSCAPS2_DONOTPERSIST}
  2371.  
  2372. (* indicates that this surface is part of a stereo flipping chain *)
  2373.   DDSCAPS2_STEREOSURFACELEFT              = $00080000;
  2374.   {$EXTERNALSYM DDSCAPS2_STEREOSURFACELEFT}
  2375.  
  2376.  
  2377. (*
  2378.  * Indicates that the surface is a volume.
  2379.  * Can be combined with DDSCAPS_MIPMAP to indicate a multi-level volume
  2380.  *)
  2381.   DDSCAPS2_VOLUME                         = $00200000;
  2382.   {$EXTERNALSYM DDSCAPS2_VOLUME}
  2383.  
  2384. (*
  2385.  * Indicates that the surface may be locked multiple times by the application.
  2386.  * This cap cannot be used with DDSCAPS2_OPAQUE.
  2387.  *)
  2388.   DDSCAPS2_NOTUSERLOCKABLE                = $00400000;
  2389.   {$EXTERNALSYM DDSCAPS2_NOTUSERLOCKABLE}
  2390.  
  2391. (*
  2392.  * Indicates that the vertex buffer data can be used to render points and
  2393.  * point sprites.
  2394.  *)
  2395.   DDSCAPS2_POINTS                         = $00800000;
  2396.   {$EXTERNALSYM DDSCAPS2_POINTS}
  2397.  
  2398. (*
  2399.  * Indicates that the vertex buffer data can be used to render rt pactches.
  2400.  *)
  2401.   DDSCAPS2_RTPATCHES                      = $01000000;
  2402.   {$EXTERNALSYM DDSCAPS2_RTPATCHES}
  2403.  
  2404. (*
  2405.  * Indicates that the vertex buffer data can be used to render n patches.
  2406.  *)
  2407.   DDSCAPS2_NPATCHES                       = $02000000;
  2408.   {$EXTERNALSYM DDSCAPS2_NPATCHES}
  2409.  
  2410. (*
  2411.  * This bit is reserved for internal use
  2412.  *)
  2413.   DDSCAPS2_RESERVED3                      = $04000000;
  2414.   {$EXTERNALSYM DDSCAPS2_RESERVED3}
  2415.  
  2416.  
  2417. (*
  2418.  * Indicates that the contents of the backbuffer do not have to be preserved
  2419.  * the contents of the backbuffer after they are presented.
  2420.  *)
  2421.   DDSCAPS2_DISCARDBACKBUFFER              = $10000000;
  2422.   {$EXTERNALSYM DDSCAPS2_DISCARDBACKBUFFER}
  2423.  
  2424. (*
  2425.  * Indicates that all surfaces in this creation chain should be given an alpha channel.
  2426.  * This flag will be set on primary surface chains that may have no explicit pixel format
  2427.  * (and thus take on the format of the current display mode).
  2428.  * The driver should infer that all these surfaces have a format having an alpha channel.
  2429.  * (e.g. assume D3DFMT_A8R8G8B8 if the display mode is x888.)
  2430.  *)
  2431.   DDSCAPS2_ENABLEALPHACHANNEL             = $20000000;
  2432.   {$EXTERNALSYM DDSCAPS2_ENABLEALPHACHANNEL}
  2433.  
  2434. (*
  2435.  * Indicates that all surfaces in this creation chain is extended primary surface format.
  2436.  * This flag will be set on extended primary surface chains that always have explicit pixel
  2437.  * format and the pixel format is typically GDI (Graphics Device Interface) couldn't handle,
  2438.  * thus only used with fullscreen application. (e.g. D3DFMT_A2R10G10B10 format)
  2439.  *)
  2440.   DDSCAPS2_EXTENDEDFORMATPRIMARY          = $40000000;
  2441.   {$EXTERNALSYM DDSCAPS2_EXTENDEDFORMATPRIMARY}
  2442.  
  2443. (*
  2444.  * Indicates that all surfaces in this creation chain is additional primary surface.
  2445.  * This flag will be set on primary surface chains which must present on the adapter
  2446.  * id provided on dwCaps4. Typically this will be used to create secondary primary surface
  2447.  * on DualView display adapter.
  2448.  *)
  2449.   DDSCAPS2_ADDITIONALPRIMARY              = $80000000;
  2450.   {$EXTERNALSYM DDSCAPS2_ADDITIONALPRIMARY}
  2451.  
  2452. (*
  2453.  * This is a mask that indicates the set of bits that may be set
  2454.  * at createsurface time to indicate number of samples per pixel
  2455.  * when multisampling
  2456.  *)
  2457.   DDSCAPS3_MULTISAMPLE_MASK               = $0000001F;
  2458.   {$EXTERNALSYM DDSCAPS3_MULTISAMPLE_MASK}
  2459.  
  2460. (*
  2461.  * This is a mask that indicates the set of bits that may be set
  2462.  * at createsurface time to indicate the quality level of rendering
  2463.  * for the current number of samples per pixel
  2464.  *)
  2465.   DDSCAPS3_MULTISAMPLE_QUALITY_MASK       = $000000E0;
  2466.   {$EXTERNALSYM DDSCAPS3_MULTISAMPLE_QUALITY_MASK}
  2467.   DDSCAPS3_MULTISAMPLE_QUALITY_SHIFT      = 5;
  2468.   {$EXTERNALSYM DDSCAPS3_MULTISAMPLE_QUALITY_SHIFT}
  2469.  
  2470. (*
  2471.  * This bit is reserved for internal use
  2472.  *)
  2473.   DDSCAPS3_RESERVED1                      = $00000100;
  2474.   {$EXTERNALSYM DDSCAPS3_RESERVED1}
  2475.  
  2476. (*
  2477.  * This bit is reserved for internal use
  2478.  *)
  2479.   DDSCAPS3_RESERVED2                      = $00000200;
  2480.   {$EXTERNALSYM DDSCAPS3_RESERVED2}
  2481.  
  2482. (*
  2483.  * This indicates whether this surface has light-weight miplevels
  2484.  *)
  2485.   DDSCAPS3_LIGHTWEIGHTMIPMAP              = $00000400;
  2486.   {$EXTERNALSYM DDSCAPS3_LIGHTWEIGHTMIPMAP}
  2487.  
  2488. (*
  2489.  * This indicates that the mipsublevels for this surface are auto-generated
  2490.  *)
  2491.   DDSCAPS3_AUTOGENMIPMAP                  = $00000800;
  2492.   {$EXTERNALSYM DDSCAPS3_AUTOGENMIPMAP}
  2493.  
  2494. (*
  2495.  * This indicates that the mipsublevels for this surface are auto-generated
  2496.  *)
  2497.   DDSCAPS3_DMAP                           = $00001000;
  2498.   {$EXTERNALSYM DDSCAPS3_DMAP}
  2499.  
  2500.  
  2501.  (****************************************************************************
  2502.  *
  2503.  * DIRECTDRAW DRIVER CAPABILITY FLAGS
  2504.  *
  2505.  ****************************************************************************)
  2506.  
  2507. (*
  2508.  * Display hardware has 3D acceleration.
  2509.  *)
  2510.   DDCAPS_3D                       = $00000001;
  2511.   {$EXTERNALSYM DDCAPS_3D}
  2512.  
  2513. (*
  2514.  * Indicates that DirectDraw will support only dest rectangles that are aligned
  2515.  * on DIRECTDRAWCAPS.dwAlignBoundaryDest boundaries of the surface, respectively.
  2516.  * READ ONLY.
  2517.  *)
  2518.   DDCAPS_ALIGNBOUNDARYDEST        = $00000002;
  2519.   {$EXTERNALSYM DDCAPS_ALIGNBOUNDARYDEST}
  2520.  
  2521. (*
  2522.  * Indicates that DirectDraw will support only source rectangles  whose sizes in
  2523.  * BYTEs are DIRECTDRAWCAPS.dwAlignSizeDest multiples, respectively.  READ ONLY.
  2524.  *)
  2525.   DDCAPS_ALIGNSIZEDEST            = $00000004;
  2526.   {$EXTERNALSYM DDCAPS_ALIGNSIZEDEST}
  2527. (*
  2528.  * Indicates that DirectDraw will support only source rectangles that are aligned
  2529.  * on DIRECTDRAWCAPS.dwAlignBoundarySrc boundaries of the surface, respectively.
  2530.  * READ ONLY.
  2531.  *)
  2532.   DDCAPS_ALIGNBOUNDARYSRC         = $00000008;
  2533.   {$EXTERNALSYM DDCAPS_ALIGNBOUNDARYSRC}
  2534.  
  2535. (*
  2536.  * Indicates that DirectDraw will support only source rectangles  whose sizes in
  2537.  * BYTEs are DIRECTDRAWCAPS.dwAlignSizeSrc multiples, respectively.  READ ONLY.
  2538.  *)
  2539.   DDCAPS_ALIGNSIZESRC             = $00000010;
  2540.   {$EXTERNALSYM DDCAPS_ALIGNSIZESRC}
  2541.  
  2542. (*
  2543.  * Indicates that DirectDraw will create video memory surfaces that have a stride
  2544.  * alignment equal to DIRECTDRAWCAPS.dwAlignStride.  READ ONLY.
  2545.  *)
  2546.   DDCAPS_ALIGNSTRIDE              = $00000020;
  2547.   {$EXTERNALSYM DDCAPS_ALIGNSTRIDE}
  2548.  
  2549. (*
  2550.  * Display hardware is capable of blt operations.
  2551.  *)
  2552.   DDCAPS_BLT                      = $00000040;
  2553.   {$EXTERNALSYM DDCAPS_BLT}
  2554.  
  2555. (*
  2556.  * Display hardware is capable of asynchronous blt operations.
  2557.  *)
  2558.   DDCAPS_BLTQUEUE                 = $00000080;
  2559.   {$EXTERNALSYM DDCAPS_BLTQUEUE}
  2560.  
  2561. (*
  2562.  * Display hardware is capable of color space conversions during the blt operation.
  2563.  *)
  2564.   DDCAPS_BLTFOURCC                = $00000100;
  2565.   {$EXTERNALSYM DDCAPS_BLTFOURCC}
  2566.  
  2567. (*
  2568.  * Display hardware is capable of stretching during blt operations.
  2569.  *)
  2570.   DDCAPS_BLTSTRETCH               = $00000200;
  2571.   {$EXTERNALSYM DDCAPS_BLTSTRETCH}
  2572.  
  2573. (*
  2574.  * Display hardware is shared with GDI.
  2575.  *)
  2576.   DDCAPS_GDI                      = $00000400;
  2577.   {$EXTERNALSYM DDCAPS_GDI}
  2578.  
  2579. (*
  2580.  * Display hardware can overlay.
  2581.  *)
  2582.   DDCAPS_OVERLAY                  = $00000800;
  2583.   {$EXTERNALSYM DDCAPS_OVERLAY}
  2584.  
  2585. (*
  2586.  * Set if display hardware supports overlays but can not clip them.
  2587.  *)
  2588.   DDCAPS_OVERLAYCANTCLIP          = $00001000;
  2589.   {$EXTERNALSYM DDCAPS_OVERLAYCANTCLIP}
  2590.  
  2591. (*
  2592.  * Indicates that overlay hardware is capable of color space conversions during
  2593.  * the overlay operation.
  2594.  *)
  2595.   DDCAPS_OVERLAYFOURCC            = $00002000;
  2596.   {$EXTERNALSYM DDCAPS_OVERLAYFOURCC}
  2597.  
  2598. (*
  2599.  * Indicates that stretching can be done by the overlay hardware.
  2600.  *)
  2601.   DDCAPS_OVERLAYSTRETCH           = $00004000;
  2602.   {$EXTERNALSYM DDCAPS_OVERLAYSTRETCH}
  2603.  
  2604. (*
  2605.  * Indicates that unique DirectDrawPalettes can be created for DirectDrawSurfaces
  2606.  * other than the primary surface.
  2607.  *)
  2608.   DDCAPS_PALETTE                  = $00008000;
  2609.   {$EXTERNALSYM DDCAPS_PALETTE}
  2610.  
  2611. (*
  2612.  * Indicates that palette changes can be syncd with the veritcal refresh.
  2613.  *)
  2614.   DDCAPS_PALETTEVSYNC             = $00010000;
  2615.   {$EXTERNALSYM DDCAPS_PALETTEVSYNC}
  2616.  
  2617. (*
  2618.  * Display hardware can return the current scan line.
  2619.  *)
  2620.   DDCAPS_READSCANLINE             = $00020000;
  2621.   {$EXTERNALSYM DDCAPS_READSCANLINE}
  2622.  
  2623. (*
  2624.  * This flag used to bo DDCAPS_STEREOVIEW, which is now obsolete
  2625.  *)
  2626.   DDCAPS_RESERVED1                = $00040000;
  2627.   {$EXTERNALSYM DDCAPS_RESERVED1}
  2628.  
  2629. (*
  2630.  * Display hardware is capable of generating a vertical blank interrupt.
  2631.  *)
  2632.   DDCAPS_VBI                      = $00080000;
  2633.   {$EXTERNALSYM DDCAPS_VBI}
  2634.  
  2635. (*
  2636.  * Supports the use of z buffers with blt operations.
  2637.  *)
  2638.   DDCAPS_ZBLTS                    = $00100000;
  2639.   {$EXTERNALSYM DDCAPS_ZBLTS}
  2640.  
  2641. (*
  2642.  * Supports Z Ordering of overlays.
  2643.  *)
  2644.   DDCAPS_ZOVERLAYS                = $00200000;
  2645.   {$EXTERNALSYM DDCAPS_ZOVERLAYS}
  2646.  
  2647. (*
  2648.  * Supports color key
  2649.  *)
  2650.   DDCAPS_COLORKEY                 = $00400000;
  2651.   {$EXTERNALSYM DDCAPS_COLORKEY}
  2652.  
  2653. (*
  2654.  * Supports alpha surfaces
  2655.  *)
  2656.   DDCAPS_ALPHA                    = $00800000;
  2657.   {$EXTERNALSYM DDCAPS_ALPHA}
  2658.  
  2659. (*
  2660.  * colorkey is hardware assisted(DDCAPS_COLORKEY will also be set)
  2661.  *)
  2662.   DDCAPS_COLORKEYHWASSIST         = $01000000;
  2663.   {$EXTERNALSYM DDCAPS_COLORKEYHWASSIST}
  2664.  
  2665. (*
  2666.  * no hardware support at all
  2667.  *)
  2668.   DDCAPS_NOHARDWARE               = $02000000;
  2669.   {$EXTERNALSYM DDCAPS_NOHARDWARE}
  2670.  
  2671. (*
  2672.  * Display hardware is capable of color fill with bltter
  2673.  *)
  2674.   DDCAPS_BLTCOLORFILL             = $04000000;
  2675.   {$EXTERNALSYM DDCAPS_BLTCOLORFILL}
  2676.  
  2677. (*
  2678.  * Display hardware is bank switched, and potentially very slow at
  2679.  * random access to VRAM.
  2680.  *)
  2681.   DDCAPS_BANKSWITCHED             = $08000000;
  2682.   {$EXTERNALSYM DDCAPS_BANKSWITCHED}
  2683.  
  2684. (*
  2685.  * Display hardware is capable of depth filling Z-buffers with bltter
  2686.  *)
  2687.   DDCAPS_BLTDEPTHFILL             = $10000000;
  2688.   {$EXTERNALSYM DDCAPS_BLTDEPTHFILL}
  2689.  
  2690. (*
  2691.  * Display hardware is capable of clipping while bltting.
  2692.  *)
  2693.   DDCAPS_CANCLIP                  = $20000000;
  2694.   {$EXTERNALSYM DDCAPS_CANCLIP}
  2695.  
  2696. (*
  2697.  * Display hardware is capable of clipping while stretch bltting.
  2698.  *)
  2699.   DDCAPS_CANCLIPSTRETCHED         = $40000000;
  2700.   {$EXTERNALSYM DDCAPS_CANCLIPSTRETCHED}
  2701.  
  2702. (*
  2703.  * Display hardware is capable of bltting to or from system memory
  2704.  *)
  2705.   DDCAPS_CANBLTSYSMEM             = $80000000;
  2706.   {$EXTERNALSYM DDCAPS_CANBLTSYSMEM}
  2707.  
  2708.  
  2709.  (****************************************************************************
  2710.  *
  2711.  * MORE DIRECTDRAW DRIVER CAPABILITY FLAGS (dwCaps2)
  2712.  *
  2713.  ****************************************************************************)
  2714.  
  2715. (*
  2716.  * Display hardware is certified
  2717.  *)
  2718.   DDCAPS2_CERTIFIED               = $00000001;
  2719.   {$EXTERNALSYM DDCAPS2_CERTIFIED}
  2720.  
  2721. (*
  2722.  * Driver cannot interleave 2D operations (lock and blt) to surfaces with
  2723.  * Direct3D rendering operations between calls to BeginScene() and EndScene()
  2724.  *)
  2725.   DDCAPS2_NO2DDURING3DSCENE       = $00000002;
  2726.   {$EXTERNALSYM DDCAPS2_NO2DDURING3DSCENE}
  2727.  
  2728. (*
  2729.  * Display hardware contains a video port
  2730.  *)
  2731.   DDCAPS2_VIDEOPORT              = $00000004;
  2732.   {$EXTERNALSYM DDCAPS2_VIDEOPORT}
  2733.  
  2734. (*
  2735.  * The overlay can be automatically flipped according to the video port
  2736.  * VSYNCs, providing automatic doubled buffered display of video port
  2737.  * data using an overlay
  2738.  *)
  2739.   DDCAPS2_AUTOFLIPOVERLAY      = $00000008;
  2740.   {$EXTERNALSYM DDCAPS2_AUTOFLIPOVERLAY}
  2741.  
  2742. (*
  2743.  * Overlay can display each field of interlaced data individually while
  2744.  * it is interleaved in memory without causing jittery artifacts.
  2745.  *)
  2746.   DDCAPS2_CANBOBINTERLEAVED      = $00000010;
  2747.   {$EXTERNALSYM DDCAPS2_CANBOBINTERLEAVED}
  2748.  
  2749. (*
  2750.  * Overlay can display each field of interlaced data individually while
  2751.  * it is not interleaved in memory without causing jittery artifacts.
  2752.  *)
  2753.   DDCAPS2_CANBOBNONINTERLEAVED      = $00000020;
  2754.   {$EXTERNALSYM DDCAPS2_CANBOBNONINTERLEAVED}
  2755.  
  2756. (*
  2757.  * The overlay surface contains color controls (brightness, sharpness, etc.)
  2758.  *)
  2759.   DDCAPS2_COLORCONTROLOVERLAY      = $00000040;
  2760.   {$EXTERNALSYM DDCAPS2_COLORCONTROLOVERLAY}
  2761.  
  2762. (*
  2763.  * The primary surface contains color controls (gamma, etc.)
  2764.  *)
  2765.   DDCAPS2_COLORCONTROLPRIMARY     = $00000080;
  2766.   {$EXTERNALSYM DDCAPS2_COLORCONTROLPRIMARY}
  2767.  
  2768. (*
  2769.  * RGBZ -> RGB supported for 16:16 RGB:Z
  2770.  *)
  2771.   DDCAPS2_CANDROPZ16BIT          = $00000100;
  2772.   {$EXTERNALSYM DDCAPS2_CANDROPZ16BIT}
  2773.  
  2774. (*
  2775.  * Driver supports non-local video memory.
  2776.  *)
  2777.   DDCAPS2_NONLOCALVIDMEM          = $00000200;
  2778.   {$EXTERNALSYM DDCAPS2_NONLOCALVIDMEM}
  2779.  
  2780. (*
  2781.  * Dirver supports non-local video memory but has different capabilities for
  2782.  * non-local video memory surfaces. If this bit is set then so must
  2783.  * DDCAPS2_NONLOCALVIDMEM.
  2784.  *)
  2785.   DDCAPS2_NONLOCALVIDMEMCAPS      = $00000400;
  2786.   {$EXTERNALSYM DDCAPS2_NONLOCALVIDMEMCAPS}
  2787.  
  2788. (*
  2789.  * Driver neither requires nor prefers surfaces to be pagelocked when performing
  2790.  * blts involving system memory surfaces
  2791.  *)
  2792.   DDCAPS2_NOPAGELOCKREQUIRED      = $00000800;
  2793.   {$EXTERNALSYM DDCAPS2_NOPAGELOCKREQUIRED}
  2794.  
  2795. (*
  2796.  * Driver can create surfaces which are wider than the primary surface
  2797.  *)
  2798.   DDCAPS2_WIDESURFACES            = $00001000;
  2799.   {$EXTERNALSYM DDCAPS2_WIDESURFACES}
  2800.  
  2801. (*
  2802.  * Driver supports bob without using a video port by handling the
  2803.  * DDFLIP_ODD and DDFLIP_EVEN flags specified in Flip.
  2804.  *)
  2805.   DDCAPS2_CANFLIPODDEVEN          = $00002000;
  2806.   {$EXTERNALSYM DDCAPS2_CANFLIPODDEVEN}
  2807.  
  2808. (*
  2809.  * Driver supports bob using hardware
  2810.  *)
  2811.   DDCAPS2_CANBOBHARDWARE          = $00004000;
  2812.   {$EXTERNALSYM DDCAPS2_CANBOBHARDWARE}
  2813.  
  2814. (*
  2815.  * Driver supports bltting any FOURCC surface to another surface of the same FOURCC
  2816.  *)
  2817.   DDCAPS2_COPYFOURCC              = $00008000;
  2818.   {$EXTERNALSYM DDCAPS2_COPYFOURCC}
  2819.  
  2820.  
  2821. (*
  2822.  * Driver supports loadable gamma ramps for the primary surface
  2823.  *)
  2824.   DDCAPS2_PRIMARYGAMMA            = $00020000;
  2825.   {$EXTERNALSYM DDCAPS2_PRIMARYGAMMA}
  2826.  
  2827. (*
  2828.  * Driver can render in windowed mode.
  2829.  *)
  2830.   DDCAPS2_CANRENDERWINDOWED       = $00080000;
  2831.   {$EXTERNALSYM DDCAPS2_CANRENDERWINDOWED}
  2832.  
  2833. (*
  2834.  * A calibrator is available to adjust the gamma ramp according to the
  2835.  * physical display properties so that the result will be identical on
  2836.  * all calibrated systems.
  2837.  *)
  2838.   DDCAPS2_CANCALIBRATEGAMMA       = $00100000;
  2839.   {$EXTERNALSYM DDCAPS2_CANCALIBRATEGAMMA}
  2840.  
  2841. (*
  2842.  * Indicates that the driver will respond to DDFLIP_INTERVALn flags
  2843.  *)
  2844.   DDCAPS2_FLIPINTERVAL            = $00200000;
  2845.   {$EXTERNALSYM DDCAPS2_FLIPINTERVAL}
  2846.  
  2847. (*
  2848.  * Indicates that the driver will respond to DDFLIP_NOVSYNC
  2849.  *)
  2850.    DDCAPS2_FLIPNOVSYNC            = $00400000;
  2851.    {$EXTERNALSYM DDCAPS2_FLIPNOVSYNC}
  2852.  
  2853. (*
  2854.  * Driver supports management of video memory, if this flag is ON,
  2855.  * driver manages the texture if requested with DDSCAPS2_TEXTUREMANAGE on
  2856.  * DirectX manages the texture if this flag is OFF and surface has DDSCAPS2_TEXTUREMANAGE on
  2857.  *)
  2858.   DDCAPS2_CANMANAGETEXTURE        = $00800000;
  2859.   {$EXTERNALSYM DDCAPS2_CANMANAGETEXTURE}
  2860.  
  2861. (*
  2862.  * The Direct3D texture manager uses this cap to decide whether to put managed
  2863.  * surfaces in non-local video memory. If the cap is set, the texture manager will
  2864.  * put managed surfaces in non-local vidmem. Drivers that cannot texture from
  2865.  * local vidmem SHOULD NOT set this cap.
  2866.  *)
  2867.   DDCAPS2_TEXMANINNONLOCALVIDMEM  = $01000000;
  2868.   {$EXTERNALSYM DDCAPS2_TEXMANINNONLOCALVIDMEM}
  2869.  
  2870. (*
  2871.  * Indicates that the driver supports DX7 type of stereo in at least one mode (which may
  2872.  * not necessarily be the current mode). Applications should use IDirectDraw7 (or higher)
  2873.  * ::EnumDisplayModes and check the DDSURFACEDESC.ddsCaps.dwCaps2 field for the presence of
  2874.  * DDSCAPS2_STEREOSURFACELEFT to check if a particular mode supports stereo. The application
  2875.  * can also use IDirectDraw7(or higher)::GetDisplayMode to check the current mode.
  2876.  *)
  2877.   DDCAPS2_STEREO                  = $02000000;
  2878.   {$EXTERNALSYM DDCAPS2_STEREO}
  2879.  
  2880. (*
  2881.  * This caps bit is intended for internal DirectDraw use.
  2882.  * -It is only valid if DDCAPS2_NONLOCALVIDMEMCAPS is set.
  2883.  * -If this bit is set, then DDCAPS_CANBLTSYSMEM MUST be set by the driver (and
  2884.  *  all the assoicated system memory blt caps must be correct).
  2885.  * -It implies that the system->video blt caps in DDCAPS also apply to system to
  2886.  *  nonlocal blts. I.e. the dwSVBCaps, dwSVBCKeyCaps, dwSVBFXCaps and dwSVBRops
  2887.  *  members of DDCAPS (DDCORECAPS) are filled in correctly.
  2888.  * -Any blt from system to nonlocal memory that matches these caps bits will
  2889.  *  be passed to the driver.
  2890.  *
  2891.  * NOTE: This is intended to enable the driver itself to do efficient reordering
  2892.  * of textures. This is NOT meant to imply that hardware can write into AGP memory.
  2893.  * This operation is not currently supported.
  2894.  *)
  2895.   DDCAPS2_SYSTONONLOCAL_AS_SYSTOLOCAL   = $04000000;
  2896.   {$EXTERNALSYM DDCAPS2_SYSTONONLOCAL_AS_SYSTOLOCAL}
  2897.  
  2898. (*
  2899.  * was DDCAPS2_PUREHAL
  2900.  *)
  2901.   DDCAPS2_RESERVED1                     = $08000000;
  2902.   {$EXTERNALSYM DDCAPS2_RESERVED1}
  2903.  
  2904. (*
  2905.  * Driver supports management of video memory, if this flag is ON,
  2906.  * driver manages the resource if requested with DDSCAPS2_TEXTUREMANAGE on
  2907.  * DirectX manages the resource if this flag is OFF and surface has DDSCAPS2_TEXTUREMANAGE on
  2908.  *)
  2909.   DDCAPS2_CANMANAGERESOURCE             = $10000000;
  2910.   {$EXTERNALSYM DDCAPS2_CANMANAGERESOURCE}
  2911.  
  2912. (*
  2913.  * Driver supports dynamic textures. This will allow the application to set
  2914.  * D3DUSAGE_DYNAMIC (DDSCAPS2_HINTDYNAMIC for drivers) at texture create time.
  2915.  * Video memory dynamic textures WILL be lockable by applications. It is
  2916.  * expected that these locks will be very efficient (which implies that the
  2917.  * driver should always maintain a linear copy, a pointer to which can be
  2918.  * quickly handed out to the application).
  2919.  *)
  2920.   DDCAPS2_DYNAMICTEXTURES               = $20000000;
  2921.   {$EXTERNALSYM DDCAPS2_DYNAMICTEXTURES}
  2922.  
  2923. (*
  2924.  * Driver supports auto-generation of mipmaps.
  2925.  *)
  2926.   DDCAPS2_CANAUTOGENMIPMAP              = $40000000;
  2927.   {$EXTERNALSYM DDCAPS2_CANAUTOGENMIPMAP}
  2928.  
  2929.  
  2930. (****************************************************************************
  2931.  *
  2932.  * DIRECTDRAW FX ALPHA CAPABILITY FLAGS
  2933.  *
  2934.  ****************************************************************************)
  2935.  
  2936. (*
  2937.  * Supports alpha blending around the edge of a source color keyed surface.
  2938.  * For Blt.
  2939.  *)
  2940.   DDFXALPHACAPS_BLTALPHAEDGEBLEND         = $00000001;
  2941.   {$EXTERNALSYM DDFXALPHACAPS_BLTALPHAEDGEBLEND}
  2942.  
  2943. (*
  2944.  * Supports alpha information in the pixel format.  The bit depth of alpha
  2945.  * information in the pixel format can be 1,2,4, or 8.  The alpha value becomes
  2946.  * more opaque as the alpha value increases.  (0 is transparent.)
  2947.  * For Blt.
  2948.  *)
  2949.   DDFXALPHACAPS_BLTALPHAPIXELS            = $00000002;
  2950.   {$EXTERNALSYM DDFXALPHACAPS_BLTALPHAPIXELS}
  2951.  
  2952. (*
  2953.  * Supports alpha information in the pixel format.  The bit depth of alpha
  2954.  * information in the pixel format can be 1,2,4, or 8.  The alpha value
  2955.  * becomes more transparent as the alpha value increases.  (0 is opaque.)
  2956.  * This flag can only be set if DDCAPS_ALPHA is set.
  2957.  * For Blt.
  2958.  *)
  2959.   DDFXALPHACAPS_BLTALPHAPIXELSNEG         = $00000004;
  2960.   {$EXTERNALSYM DDFXALPHACAPS_BLTALPHAPIXELSNEG}
  2961.  
  2962. (*
  2963.  * Supports alpha only surfaces.  The bit depth of an alpha only surface can be
  2964.  * 1,2,4, or 8.  The alpha value becomes more opaque as the alpha value increases.
  2965.  * (0 is transparent.)
  2966.  * For Blt.
  2967.  *)
  2968.   DDFXALPHACAPS_BLTALPHASURFACES          = $00000008;
  2969.   {$EXTERNALSYM DDFXALPHACAPS_BLTALPHASURFACES}
  2970.  
  2971. (*
  2972.  * The depth of the alpha channel data can range can be 1,2,4, or 8.
  2973.  * The NEG suffix indicates that this alpha channel becomes more transparent
  2974.  * as the alpha value increases. (0 is opaque.)  This flag can only be set if
  2975.  * DDCAPS_ALPHA is set.
  2976.  * For Blt.
  2977.  *)
  2978.   DDFXALPHACAPS_BLTALPHASURFACESNEG       = $00000010;
  2979.   {$EXTERNALSYM DDFXALPHACAPS_BLTALPHASURFACESNEG}
  2980.  
  2981. (*
  2982.  * Supports alpha blending around the edge of a source color keyed surface.
  2983.  * For Overlays.
  2984.  *)
  2985.   DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND     = $00000020;
  2986.   {$EXTERNALSYM DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND}
  2987.  
  2988. (*
  2989.  * Supports alpha information in the pixel format.  The bit depth of alpha
  2990.  * information in the pixel format can be 1,2,4, or 8.  The alpha value becomes
  2991.  * more opaque as the alpha value increases.  (0 is transparent.)
  2992.  * For Overlays.
  2993.  *)
  2994.   DDFXALPHACAPS_OVERLAYALPHAPIXELS        = $00000040;
  2995.   {$EXTERNALSYM DDFXALPHACAPS_OVERLAYALPHAPIXELS}
  2996.  
  2997. (*
  2998.  * Supports alpha information in the pixel format.  The bit depth of alpha
  2999.  * information in the pixel format can be 1,2,4, or 8.  The alpha value
  3000.  * becomes more transparent as the alpha value increases.  (0 is opaque.)
  3001.  * This flag can only be set if DDCAPS_ALPHA is set.
  3002.  * For Overlays.
  3003.  *)
  3004.   DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG     = $00000080;
  3005.   {$EXTERNALSYM DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG}
  3006.  
  3007. (*
  3008.  * Supports alpha only surfaces.  The bit depth of an alpha only surface can be
  3009.  * 1,2,4, or 8.  The alpha value becomes more opaque as the alpha value increases.
  3010.  * (0 is transparent.)
  3011.  * For Overlays.
  3012.  *)
  3013.   DDFXALPHACAPS_OVERLAYALPHASURFACES      = $00000100;
  3014.   {$EXTERNALSYM DDFXALPHACAPS_OVERLAYALPHASURFACES}
  3015.  
  3016. (*
  3017.  * The depth of the alpha channel data can range can be 1,2,4, or 8.
  3018.  * The NEG suffix indicates that this alpha channel becomes more transparent
  3019.  * as the alpha value increases. (0 is opaque.)  This flag can only be set if
  3020.  * DDCAPS_ALPHA is set.
  3021.  * For Overlays.
  3022.  *)
  3023.   DDFXALPHACAPS_OVERLAYALPHASURFACESNEG   = $00000200;
  3024.   {$EXTERNALSYM DDFXALPHACAPS_OVERLAYALPHASURFACESNEG}
  3025.  
  3026. (****************************************************************************
  3027.  *
  3028.  * DIRECTDRAW FX CAPABILITY FLAGS
  3029.  *
  3030.  ****************************************************************************)
  3031.  
  3032. (*
  3033.  * Uses arithmetic operations to stretch and shrink surfaces during blt
  3034.  * rather than pixel doubling techniques.  Along the Y axis.
  3035.  *)
  3036.   DDFXCAPS_BLTARITHSTRETCHY       = $00000020;
  3037.   {$EXTERNALSYM DDFXCAPS_BLTARITHSTRETCHY}
  3038.  
  3039. (*
  3040.  * Uses arithmetic operations to stretch during blt
  3041.  * rather than pixel doubling techniques.  Along the Y axis. Only
  3042.  * works for x1, x2, etc.
  3043.  *)
  3044.   DDFXCAPS_BLTARITHSTRETCHYN      = $00000010;
  3045.   {$EXTERNALSYM DDFXCAPS_BLTARITHSTRETCHYN}
  3046.  
  3047. (*
  3048.  * Supports mirroring left to right in blt.
  3049.  *)
  3050.   DDFXCAPS_BLTMIRRORLEFTRIGHT     = $00000040;
  3051.   {$EXTERNALSYM DDFXCAPS_BLTMIRRORLEFTRIGHT}
  3052.  
  3053. (*
  3054.  * Supports mirroring top to bottom in blt.
  3055.  *)
  3056.   DDFXCAPS_BLTMIRRORUPDOWN        = $00000080;
  3057.   {$EXTERNALSYM DDFXCAPS_BLTMIRRORUPDOWN}
  3058.  
  3059. (*
  3060.  * Supports arbitrary rotation for blts.
  3061.  *)
  3062.   DDFXCAPS_BLTROTATION            = $00000100;
  3063.   {$EXTERNALSYM DDFXCAPS_BLTROTATION}
  3064.  
  3065. (*
  3066.  * Supports 90 degree rotations for blts.
  3067.  *)
  3068.    DDFXCAPS_BLTROTATION90          = $00000200;
  3069.    {$EXTERNALSYM DDFXCAPS_BLTROTATION90}
  3070.  
  3071. (*
  3072.  * DirectDraw supports arbitrary shrinking of a surface along the
  3073.  * x axis (horizontal direction) for blts.
  3074.  *)
  3075.   DDFXCAPS_BLTSHRINKX             = $00000400;
  3076.   {$EXTERNALSYM DDFXCAPS_BLTSHRINKX}
  3077.  
  3078. (*
  3079.  * DirectDraw supports integer shrinking (1x,2x,) of a surface
  3080.  * along the x axis (horizontal direction) for blts.
  3081.  *)
  3082.   DDFXCAPS_BLTSHRINKXN            = $00000800;
  3083.   {$EXTERNALSYM DDFXCAPS_BLTSHRINKXN}
  3084.  
  3085. (*
  3086.  * DirectDraw supports arbitrary shrinking of a surface along the
  3087.  * y axis (horizontal direction) for blts.
  3088.  *)
  3089.   DDFXCAPS_BLTSHRINKY             = $00001000;
  3090.   {$EXTERNALSYM DDFXCAPS_BLTSHRINKY}
  3091.  
  3092. (*
  3093.  * DirectDraw supports integer shrinking (1x,2x,) of a surface
  3094.  * along the y axis (vertical direction) for blts.
  3095.  *)
  3096.   DDFXCAPS_BLTSHRINKYN            = $00002000;
  3097.   {$EXTERNALSYM DDFXCAPS_BLTSHRINKYN}
  3098.  
  3099. (*
  3100.  * DirectDraw supports arbitrary stretching of a surface along the
  3101.  * x axis (horizontal direction) for blts.
  3102.  *)
  3103.   DDFXCAPS_BLTSTRETCHX            = $00004000;
  3104.   {$EXTERNALSYM DDFXCAPS_BLTSTRETCHX}
  3105.  
  3106. (*
  3107.  * DirectDraw supports integer stretching (1x,2x,) of a surface
  3108.  * along the x axis (horizontal direction) for blts.
  3109.  *)
  3110.   DDFXCAPS_BLTSTRETCHXN           = $00008000;
  3111.   {$EXTERNALSYM DDFXCAPS_BLTSTRETCHXN}
  3112.  
  3113. (*
  3114.  * DirectDraw supports arbitrary stretching of a surface along the
  3115.  * y axis (horizontal direction) for blts.
  3116.  *)
  3117.   DDFXCAPS_BLTSTRETCHY            = $00010000;
  3118.   {$EXTERNALSYM DDFXCAPS_BLTSTRETCHY}
  3119.  
  3120. (*
  3121.  * DirectDraw supports integer stretching (1x,2x,) of a surface
  3122.  * along the y axis (vertical direction) for blts.
  3123.  *)
  3124.   DDFXCAPS_BLTSTRETCHYN           = $00020000;
  3125.   {$EXTERNALSYM DDFXCAPS_BLTSTRETCHYN}
  3126.  
  3127. (*
  3128.  * Uses arithmetic operations to stretch and shrink surfaces during
  3129.  * overlay rather than pixel doubling techniques.  Along the Y axis
  3130.  * for overlays.
  3131.  *)
  3132.   DDFXCAPS_OVERLAYARITHSTRETCHY   = $00040000;
  3133.   {$EXTERNALSYM DDFXCAPS_OVERLAYARITHSTRETCHY}
  3134.  
  3135. (*
  3136.  * Uses arithmetic operations to stretch surfaces during
  3137.  * overlay rather than pixel doubling techniques.  Along the Y axis
  3138.  * for overlays. Only works for x1, x2, etc.
  3139.  *)
  3140.   DDFXCAPS_OVERLAYARITHSTRETCHYN  = $00000008;
  3141.   {$EXTERNALSYM DDFXCAPS_OVERLAYARITHSTRETCHYN}
  3142.  
  3143. (*
  3144.  * DirectDraw supports arbitrary shrinking of a surface along the
  3145.  * x axis (horizontal direction) for overlays.
  3146.  *)
  3147.   DDFXCAPS_OVERLAYSHRINKX         = $00080000;
  3148.   {$EXTERNALSYM DDFXCAPS_OVERLAYSHRINKX}
  3149.  
  3150. (*
  3151.  * DirectDraw supports integer shrinking (1x,2x,) of a surface
  3152.  * along the x axis (horizontal direction) for overlays.
  3153.  *)
  3154.   DDFXCAPS_OVERLAYSHRINKXN        = $00100000;
  3155.   {$EXTERNALSYM DDFXCAPS_OVERLAYSHRINKXN}
  3156.  
  3157. (*
  3158.  * DirectDraw supports arbitrary shrinking of a surface along the
  3159.  * y axis (horizontal direction) for overlays.
  3160.  *)
  3161.   DDFXCAPS_OVERLAYSHRINKY         = $00200000;
  3162.   {$EXTERNALSYM DDFXCAPS_OVERLAYSHRINKY}
  3163.  
  3164. (*
  3165.  * DirectDraw supports integer shrinking (1x,2x,) of a surface
  3166.  * along the y axis (vertical direction) for overlays.
  3167.  *)
  3168.   DDFXCAPS_OVERLAYSHRINKYN        = $00400000;
  3169.   {$EXTERNALSYM DDFXCAPS_OVERLAYSHRINKYN}
  3170.  
  3171. (*
  3172.  * DirectDraw supports arbitrary stretching of a surface along the
  3173.  * x axis (horizontal direction) for overlays.
  3174.  *)
  3175.   DDFXCAPS_OVERLAYSTRETCHX        = $00800000;
  3176.   {$EXTERNALSYM DDFXCAPS_OVERLAYSTRETCHX}
  3177.  
  3178. (*
  3179.  * DirectDraw supports integer stretching (1x,2x,) of a surface
  3180.  * along the x axis (horizontal direction) for overlays.
  3181.  *)
  3182.   DDFXCAPS_OVERLAYSTRETCHXN       = $01000000;
  3183.   {$EXTERNALSYM DDFXCAPS_OVERLAYSTRETCHXN}
  3184.  
  3185. (*
  3186.  * DirectDraw supports arbitrary stretching of a surface along the
  3187.  * y axis (horizontal direction) for overlays.
  3188.  *)
  3189.   DDFXCAPS_OVERLAYSTRETCHY        = $02000000;
  3190.   {$EXTERNALSYM DDFXCAPS_OVERLAYSTRETCHY}
  3191.  
  3192. (*
  3193.  * DirectDraw supports integer stretching (1x,2x,) of a surface
  3194.  * along the y axis (vertical direction) for overlays.
  3195.  *)
  3196.   DDFXCAPS_OVERLAYSTRETCHYN       = $04000000;
  3197.   {$EXTERNALSYM DDFXCAPS_OVERLAYSTRETCHYN}
  3198.  
  3199. (*
  3200.  * DirectDraw supports mirroring of overlays across the vertical axis
  3201.  *)
  3202.   DDFXCAPS_OVERLAYMIRRORLEFTRIGHT = $08000000;
  3203.   {$EXTERNALSYM DDFXCAPS_OVERLAYMIRRORLEFTRIGHT}
  3204.  
  3205. (*
  3206.  * DirectDraw supports mirroring of overlays across the horizontal axis
  3207.  *)
  3208.   DDFXCAPS_OVERLAYMIRRORUPDOWN    = $10000000;
  3209.   {$EXTERNALSYM DDFXCAPS_OVERLAYMIRRORUPDOWN}
  3210.  
  3211. (*
  3212.  * DirectDraw supports deinterlacing of overlay surfaces
  3213.  *)
  3214.   DDFXCAPS_OVERLAYDEINTERLACE      = $20000000;
  3215.   {$EXTERNALSYM DDFXCAPS_OVERLAYDEINTERLACE}
  3216.  
  3217.  
  3218. (*
  3219.  * Driver can do alpha blending for blits.
  3220.  *)
  3221.   DDFXCAPS_BLTALPHA           = $00000001;
  3222.   {$EXTERNALSYM DDFXCAPS_BLTALPHA}
  3223.  
  3224. (*
  3225.  * Driver can do geometric transformations (or warps) for blits.
  3226.  *)
  3227.   DDFXCAPS_BLTTRANSFORM          = $00000002;
  3228.   {$EXTERNALSYM DDFXCAPS_BLTTRANSFORM}
  3229.  
  3230. (*
  3231.  * Driver can do surface-reconstruction filtering for warped blits.
  3232.  *)
  3233.   DDFXCAPS_BLTFILTER               = DDFXCAPS_BLTARITHSTRETCHY;
  3234.   {$EXTERNALSYM DDFXCAPS_BLTFILTER}
  3235.  
  3236. (*
  3237.  * Driver can do alpha blending for overlays.
  3238.  *)
  3239.   DDFXCAPS_OVERLAYALPHA       = $00000004;
  3240.   {$EXTERNALSYM DDFXCAPS_OVERLAYALPHA}
  3241.  
  3242. (*
  3243.  * Driver can do geometric transformations (or warps) for overlays.
  3244.  *)
  3245.   DDFXCAPS_OVERLAYTRANSFORM       = $20000000;
  3246.   {$EXTERNALSYM DDFXCAPS_OVERLAYTRANSFORM}
  3247.  
  3248. (*
  3249.  * Driver can do surface-reconstruction filtering for warped overlays.
  3250.  *)
  3251.   DDFXCAPS_OVERLAYFILTER       = DDFXCAPS_OVERLAYARITHSTRETCHY;
  3252.   {$EXTERNALSYM DDFXCAPS_OVERLAYFILTER}
  3253.  
  3254. (****************************************************************************
  3255.  *
  3256.  * DIRECTDRAW STEREO VIEW CAPABILITIES
  3257.  *
  3258.  ****************************************************************************)
  3259.  
  3260. (*
  3261.  * This flag used to be DDSVCAPS_ENIGMA, which is now obsolete
  3262.  *)
  3263.   DDSVCAPS_RESERVED1              = $00000001;
  3264.   {$EXTERNALSYM DDSVCAPS_RESERVED1}
  3265.  
  3266. (*
  3267.  * This flag used to be DDSVCAPS_FLICKER, which is now obsolete
  3268.  *)
  3269.   DDSVCAPS_RESERVED2              = $00000002;
  3270.   {$EXTERNALSYM DDSVCAPS_RESERVED2}
  3271.  
  3272. (*
  3273.  * This flag used to be DDSVCAPS_REDBLUE, which is now obsolete
  3274.  *)
  3275.   DDSVCAPS_RESERVED3              = $00000004;
  3276.   {$EXTERNALSYM DDSVCAPS_RESERVED3}
  3277.  
  3278. (*
  3279.  * This flag used to be DDSVCAPS_SPLIT, which is now obsolete
  3280.  *)
  3281.   DDSVCAPS_RESERVED4              = $00000008;
  3282.   {$EXTERNALSYM DDSVCAPS_RESERVED4}
  3283.  
  3284. (*
  3285.  * The stereo view is accomplished with switching technology
  3286.  *)
  3287.   DDSVCAPS_STEREOSEQUENTIAL       = $00000010;
  3288.   {$EXTERNALSYM DDSVCAPS_STEREOSEQUENTIAL}
  3289.  
  3290. (****************************************************************************
  3291.  *
  3292.  * DIRECTDRAWPALETTE CAPABILITIES
  3293.  *
  3294.  ****************************************************************************)
  3295.  
  3296. (*
  3297.  * Index is 4 bits.  There are sixteen color entries in the palette table.
  3298.  *)
  3299.   DDPCAPS_4BIT                    = $00000001;
  3300.   {$EXTERNALSYM DDPCAPS_4BIT}
  3301.  
  3302. (*
  3303.  * Index is onto a 8 bit color index.  This field is only valid with the
  3304.  * DDPCAPS_1BIT, DDPCAPS_2BIT or DDPCAPS_4BIT capability and the target
  3305.  * surface is in 8bpp. Each color entry is one byte long and is an index
  3306.  * into destination surface's 8bpp palette.
  3307.  *)
  3308.   DDPCAPS_8BITENTRIES             = $00000002;
  3309.   {$EXTERNALSYM DDPCAPS_8BITENTRIES}
  3310.  
  3311. (*
  3312.  * Index is 8 bits.  There are 256 color entries in the palette table.
  3313.  *)
  3314.   DDPCAPS_8BIT                    = $00000004;
  3315.   {$EXTERNALSYM DDPCAPS_8BIT}
  3316.  
  3317. (*
  3318.  * Indicates that this DIRECTDRAWPALETTE should use the palette color array
  3319.  * passed into the lpDDColorArray parameter to initialize the DIRECTDRAWPALETTE
  3320.  * object.
  3321.  * This flag is obsolete. DirectDraw always initializes the color array from
  3322.  * the lpDDColorArray parameter. The definition remains for source-level
  3323.  * compatibility.
  3324.  *)
  3325.   DDPCAPS_INITIALIZE              = $00000008;
  3326.   {$EXTERNALSYM DDPCAPS_INITIALIZE}
  3327.  
  3328. (*
  3329.  * This palette is the one attached to the primary surface.  Changing this
  3330.  * table has immediate effect on the display unless DDPSETPAL_VSYNC is specified
  3331.  * and supported.
  3332.  *)
  3333.   DDPCAPS_PRIMARYSURFACE          = $00000010;
  3334.   {$EXTERNALSYM DDPCAPS_PRIMARYSURFACE}
  3335.  
  3336. (*
  3337.  * This palette is the one attached to the primary surface left.  Changing
  3338.  * this table has immediate effect on the display for the left eye unless
  3339.  * DDPSETPAL_VSYNC is specified and supported.
  3340.  *)
  3341.   DDPCAPS_PRIMARYSURFACELEFT      = $00000020;
  3342.   {$EXTERNALSYM DDPCAPS_PRIMARYSURFACELEFT}
  3343.  
  3344. (*
  3345.  * This palette can have all 256 entries defined
  3346.  *)
  3347.   DDPCAPS_ALLOW256                = $00000040;
  3348.   {$EXTERNALSYM DDPCAPS_ALLOW256}
  3349.  
  3350. (*
  3351.  * This palette can have modifications to it synced with the monitors
  3352.  * refresh rate.
  3353.  *)
  3354.   DDPCAPS_VSYNC                   = $00000080;
  3355.   {$EXTERNALSYM DDPCAPS_VSYNC}
  3356.  
  3357. (*
  3358.  * Index is 1 bit.  There are two color entries in the palette table.
  3359.  *)
  3360.   DDPCAPS_1BIT                    = $00000100;
  3361.   {$EXTERNALSYM DDPCAPS_1BIT}
  3362.  
  3363. (*
  3364.  * Index is 2 bit.  There are four color entries in the palette table.
  3365.  *)
  3366.   DDPCAPS_2BIT                    = $00000200;
  3367.   {$EXTERNALSYM DDPCAPS_2BIT}
  3368.  
  3369. (*
  3370.  * The peFlags member of PALETTEENTRY denotes an 8 bit alpha value
  3371.  *)
  3372.   DDPCAPS_ALPHA                  = $00000400;
  3373.   {$EXTERNALSYM DDPCAPS_ALPHA}
  3374.  
  3375.  
  3376. (****************************************************************************
  3377.  *
  3378.  * DIRECTDRAWPALETTE SETENTRY CONSTANTS
  3379.  *
  3380.  ****************************************************************************)
  3381.  
  3382.  
  3383. (****************************************************************************
  3384.  *
  3385.  * DIRECTDRAWPALETTE GETENTRY CONSTANTS
  3386.  *
  3387.  ****************************************************************************)
  3388.  
  3389. (* 0 is the only legal value *)
  3390.  
  3391. (****************************************************************************
  3392.  *
  3393.  * DIRECTDRAWSURFACE SETPRIVATEDATA CONSTANTS
  3394.  *
  3395.  ****************************************************************************)
  3396.  
  3397. (*
  3398.  * The passed pointer is an IUnknown ptr. The cbData argument to SetPrivateData
  3399.  * must be set to SizeOf(IUnknown^). DirectDraw will call AddRef through this
  3400.  * pointer and Release when the private data is destroyed. This includes when
  3401.  * the surface or palette is destroyed before such priovate data is destroyed.
  3402.  *)
  3403.   DDSPD_IUNKNOWNPOINTER           = $00000001;
  3404.   {$EXTERNALSYM DDSPD_IUNKNOWNPOINTER}
  3405.  
  3406. (*
  3407.  * Private data is only valid for the current state of the object,
  3408.  * as determined by the uniqueness value.
  3409.  *)
  3410.   DDSPD_VOLATILE                  = $00000002;
  3411.   {$EXTERNALSYM DDSPD_VOLATILE}
  3412.  
  3413.  
  3414. (****************************************************************************
  3415.  *
  3416.  * DIRECTDRAWSURFACE SETPALETTE CONSTANTS
  3417.  *
  3418.  ****************************************************************************)
  3419.  
  3420.  
  3421. (****************************************************************************
  3422.  *
  3423.  * DIRECTDRAW BITDEPTH CONSTANTS
  3424.  *
  3425.  * NOTE:  These are only used to indicate supported bit depths.   These
  3426.  * are flags only, they are not to be used as an actual bit depth.   The
  3427.  * absolute numbers 1, 2, 4, 8, 16, 24 and 32 are used to indicate actual
  3428.  * bit depths in a surface or for changing the display mode.
  3429.  *
  3430.  ****************************************************************************)
  3431.  
  3432. (*
  3433.  * 1 bit per pixel.
  3434.  *)
  3435.   DDBD_1                  = $00004000;
  3436.   {$EXTERNALSYM DDBD_1}
  3437.  
  3438. (*
  3439.  * 2 bits per pixel.
  3440.  *)
  3441.   DDBD_2                  = $00002000;
  3442.   {$EXTERNALSYM DDBD_2}
  3443.  
  3444. (*
  3445.  * 4 bits per pixel.
  3446.  *)
  3447.   DDBD_4                  = $00001000;
  3448.   {$EXTERNALSYM DDBD_4}
  3449.  
  3450. (*
  3451.  * 8 bits per pixel.
  3452.  *)
  3453.   DDBD_8                  = $00000800;
  3454.   {$EXTERNALSYM DDBD_8}
  3455.  
  3456. (*
  3457.  * 16 bits per pixel.
  3458.  *)
  3459.   DDBD_16                 = $00000400;
  3460.   {$EXTERNALSYM DDBD_16}
  3461.  
  3462. (*
  3463.  * 24 bits per pixel.
  3464.  *)
  3465.   DDBD_24                 = $00000200;
  3466.   {$EXTERNALSYM DDBD_24}
  3467.  
  3468. (*
  3469.  * 32 bits per pixel.
  3470.  *)
  3471.   DDBD_32                 = $00000100;
  3472.   {$EXTERNALSYM DDBD_32}
  3473.  
  3474. (****************************************************************************
  3475.  *
  3476.  * DIRECTDRAWSURFACE SET/GET COLOR KEY FLAGS
  3477.  *
  3478.  ****************************************************************************)
  3479.  
  3480. (*
  3481.  * Set if the structure contains a color space.  Not set if the structure
  3482.  * contains a single color key.
  3483.  *)
  3484.   DDCKEY_COLORSPACE       = $00000001;
  3485.   {$EXTERNALSYM DDCKEY_COLORSPACE}
  3486.  
  3487. (*
  3488.  * Set if the structure specifies a color key or color space which is to be
  3489.  * used as a destination color key for blt operations.
  3490.  *)
  3491.   DDCKEY_DESTBLT          = $00000002;
  3492.   {$EXTERNALSYM DDCKEY_DESTBLT}
  3493.  
  3494. (*
  3495.  * Set if the structure specifies a color key or color space which is to be
  3496.  * used as a destination color key for overlay operations.
  3497.  *)
  3498.   DDCKEY_DESTOVERLAY      = $00000004;
  3499.   {$EXTERNALSYM DDCKEY_DESTOVERLAY}
  3500.  
  3501. (*
  3502.  * Set if the structure specifies a color key or color space which is to be
  3503.  * used as a source color key for blt operations.
  3504.  *)
  3505.   DDCKEY_SRCBLT           = $00000008;
  3506.   {$EXTERNALSYM DDCKEY_SRCBLT}
  3507.  
  3508. (*
  3509.  * Set if the structure specifies a color key or color space which is to be
  3510.  * used as a source color key for overlay operations.
  3511.  *)
  3512.   DDCKEY_SRCOVERLAY       = $00000010;
  3513.   {$EXTERNALSYM DDCKEY_SRCOVERLAY}
  3514.  
  3515.  
  3516. (****************************************************************************
  3517.  *
  3518.  * DIRECTDRAW COLOR KEY CAPABILITY FLAGS
  3519.  *
  3520.  ****************************************************************************)
  3521.  
  3522. (*
  3523.  * Supports transparent blting using a color key to identify the replaceable
  3524.  * bits of the destination surface for RGB colors.
  3525.  *)
  3526.   DDCKEYCAPS_DESTBLT                      = $00000001;
  3527.   {$EXTERNALSYM DDCKEYCAPS_DESTBLT}
  3528.  
  3529. (*
  3530.  * Supports transparent blting using a color space to identify the replaceable
  3531.  * bits of the destination surface for RGB colors.
  3532.  *)
  3533.   DDCKEYCAPS_DESTBLTCLRSPACE              = $00000002;
  3534.   {$EXTERNALSYM DDCKEYCAPS_DESTBLTCLRSPACE}
  3535.  
  3536. (*
  3537.  * Supports transparent blting using a color space to identify the replaceable
  3538.  * bits of the destination surface for YUV colors.
  3539.  *)
  3540.   DDCKEYCAPS_DESTBLTCLRSPACEYUV           = $00000004;
  3541.   {$EXTERNALSYM DDCKEYCAPS_DESTBLTCLRSPACEYUV}
  3542.  
  3543. (*
  3544.  * Supports transparent blting using a color key to identify the replaceable
  3545.  * bits of the destination surface for YUV colors.
  3546.  *)
  3547.   DDCKEYCAPS_DESTBLTYUV                   = $00000008;
  3548.   {$EXTERNALSYM DDCKEYCAPS_DESTBLTYUV}
  3549.  
  3550. (*
  3551.  * Supports overlaying using colorkeying of the replaceable bits of the surface
  3552.  * being overlayed for RGB colors.
  3553.  *)
  3554.   DDCKEYCAPS_DESTOVERLAY                  = $00000010;
  3555.   {$EXTERNALSYM DDCKEYCAPS_DESTOVERLAY}
  3556.  
  3557. (*
  3558.  * Supports a color space as the color key for the destination for RGB colors.
  3559.  *)
  3560.   DDCKEYCAPS_DESTOVERLAYCLRSPACE          = $00000020;
  3561.   {$EXTERNALSYM DDCKEYCAPS_DESTOVERLAYCLRSPACE}
  3562.  
  3563. (*
  3564.  * Supports a color space as the color key for the destination for YUV colors.
  3565.  *)
  3566.   DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV       = $00000040;
  3567.   {$EXTERNALSYM DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV}
  3568.  
  3569. (*
  3570.  * Supports only one active destination color key value for visible overlay
  3571.  * surfaces.
  3572.  *)
  3573.   DDCKEYCAPS_DESTOVERLAYONEACTIVE         = $00000080;
  3574.   {$EXTERNALSYM DDCKEYCAPS_DESTOVERLAYONEACTIVE}
  3575.  
  3576. (*
  3577.  * Supports overlaying using colorkeying of the replaceable bits of the
  3578.  * surface being overlayed for YUV colors.
  3579.  *)
  3580.   DDCKEYCAPS_DESTOVERLAYYUV               = $00000100;
  3581.   {$EXTERNALSYM DDCKEYCAPS_DESTOVERLAYYUV}
  3582.  
  3583. (*
  3584.  * Supports transparent blting using the color key for the source with
  3585.  * this surface for RGB colors.
  3586.  *)
  3587.   DDCKEYCAPS_SRCBLT                       = $00000200;
  3588.   {$EXTERNALSYM DDCKEYCAPS_SRCBLT}
  3589.  
  3590. (*
  3591.  * Supports transparent blting using a color space for the source with
  3592.  * this surface for RGB colors.
  3593.  *)
  3594.   DDCKEYCAPS_SRCBLTCLRSPACE               = $00000400;
  3595.   {$EXTERNALSYM DDCKEYCAPS_SRCBLTCLRSPACE}
  3596.  
  3597. (*
  3598.  * Supports transparent blting using a color space for the source with
  3599.  * this surface for YUV colors.
  3600.  *)
  3601.   DDCKEYCAPS_SRCBLTCLRSPACEYUV            = $00000800;
  3602.   {$EXTERNALSYM DDCKEYCAPS_SRCBLTCLRSPACEYUV}
  3603.  
  3604. (*
  3605.  * Supports transparent blting using the color key for the source with
  3606.  * this surface for YUV colors.
  3607.  *)
  3608.   DDCKEYCAPS_SRCBLTYUV                    = $00001000;
  3609.   {$EXTERNALSYM DDCKEYCAPS_SRCBLTYUV}
  3610.  
  3611. (*
  3612.  * Supports overlays using the color key for the source with this
  3613.  * overlay surface for RGB colors.
  3614.  *)
  3615.   DDCKEYCAPS_SRCOVERLAY                   = $00002000;
  3616.   {$EXTERNALSYM DDCKEYCAPS_SRCOVERLAY}
  3617.  
  3618. (*
  3619.  * Supports overlays using a color space as the source color key for
  3620.  * the overlay surface for RGB colors.
  3621.  *)
  3622.   DDCKEYCAPS_SRCOVERLAYCLRSPACE           = $00004000;
  3623.   {$EXTERNALSYM DDCKEYCAPS_SRCOVERLAYCLRSPACE}
  3624.  
  3625. (*
  3626.  * Supports overlays using a color space as the source color key for
  3627.  * the overlay surface for YUV colors.
  3628.  *)
  3629.   DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV        = $00008000;
  3630.   {$EXTERNALSYM DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV}
  3631.  
  3632. (*
  3633.  * Supports only one active source color key value for visible
  3634.  * overlay surfaces.
  3635.  *)
  3636.   DDCKEYCAPS_SRCOVERLAYONEACTIVE          = $00010000;
  3637.   {$EXTERNALSYM DDCKEYCAPS_SRCOVERLAYONEACTIVE}
  3638.  
  3639. (*
  3640.  * Supports overlays using the color key for the source with this
  3641.  * overlay surface for YUV colors.
  3642.  *)
  3643.   DDCKEYCAPS_SRCOVERLAYYUV                = $00020000;
  3644.   {$EXTERNALSYM DDCKEYCAPS_SRCOVERLAYYUV}
  3645.  
  3646. (*
  3647.  * there are no bandwidth trade-offs for using colorkey with an overlay
  3648.  *)
  3649.   DDCKEYCAPS_NOCOSTOVERLAY                = $00040000;
  3650.   {$EXTERNALSYM DDCKEYCAPS_NOCOSTOVERLAY}
  3651.  
  3652.  
  3653. (****************************************************************************
  3654.  *
  3655.  * DIRECTDRAW PIXELFORMAT FLAGS
  3656.  *
  3657.  ****************************************************************************)
  3658.  
  3659. (*
  3660.  * The surface has alpha channel information in the pixel format.
  3661.  *)
  3662.   DDPF_ALPHAPIXELS                        = $00000001;
  3663.   {$EXTERNALSYM DDPF_ALPHAPIXELS}
  3664.  
  3665. (*
  3666.  * The pixel format contains alpha only information
  3667.  *)
  3668.   DDPF_ALPHA                              = $00000002;
  3669.   {$EXTERNALSYM DDPF_ALPHA}
  3670.  
  3671. (*
  3672.  * The FourCC code is valid.
  3673.  *)
  3674.   DDPF_FOURCC                             = $00000004;
  3675.   {$EXTERNALSYM DDPF_FOURCC}
  3676.  
  3677. (*
  3678.  * The surface is 4-bit color indexed.
  3679.  *)
  3680.   DDPF_PALETTEINDEXED4                    = $00000008;
  3681.   {$EXTERNALSYM DDPF_PALETTEINDEXED4}
  3682.  
  3683. (*
  3684.  * The surface is indexed into a palette which stores indices
  3685.  * into the destination surface's 8-bit palette.
  3686.  *)
  3687.   DDPF_PALETTEINDEXEDTO8                  = $00000010;
  3688.   {$EXTERNALSYM DDPF_PALETTEINDEXEDTO8}
  3689.  
  3690. (*
  3691.  * The surface is 8-bit color indexed.
  3692.  *)
  3693.   DDPF_PALETTEINDEXED8                    = $00000020;
  3694.   {$EXTERNALSYM DDPF_PALETTEINDEXED8}
  3695.  
  3696. (*
  3697.  * The RGB data in the pixel format structure is valid.
  3698.  *)
  3699.   DDPF_RGB                                = $00000040;
  3700.   {$EXTERNALSYM DDPF_RGB}
  3701.  
  3702. (*
  3703.  * The surface will accept pixel data in the format specified
  3704.  * and compress it during the write.
  3705.  *)
  3706.   DDPF_COMPRESSED                         = $00000080;
  3707.   {$EXTERNALSYM DDPF_COMPRESSED}
  3708.  
  3709. (*
  3710.  * The surface will accept RGB data and translate it during
  3711.  * the write to YUV data.  The format of the data to be written
  3712.  * will be contained in the pixel format structure.  The DDPF_RGB
  3713.  * flag will be set.
  3714.  *)
  3715.   DDPF_RGBTOYUV                           = $00000100;
  3716.   {$EXTERNALSYM DDPF_RGBTOYUV}
  3717.  
  3718. (*
  3719.  * pixel format is YUV - YUV data in pixel format struct is valid
  3720.  *)
  3721.   DDPF_YUV                                = $00000200;
  3722.   {$EXTERNALSYM DDPF_YUV}
  3723.  
  3724. (*
  3725.  * pixel format is a z buffer only surface
  3726.  *)
  3727.   DDPF_ZBUFFER                            = $00000400;
  3728.   {$EXTERNALSYM DDPF_ZBUFFER}
  3729.  
  3730. (*
  3731.  * The surface is 1-bit color indexed.
  3732.  *)
  3733.   DDPF_PALETTEINDEXED1                    = $00000800;
  3734.   {$EXTERNALSYM DDPF_PALETTEINDEXED1}
  3735.  
  3736. (*
  3737.  * The surface is 2-bit color indexed.
  3738.  *)
  3739.   DDPF_PALETTEINDEXED2                    = $00001000;
  3740.   {$EXTERNALSYM DDPF_PALETTEINDEXED2}
  3741.  
  3742. (*
  3743.  * The surface contains Z information in the pixels
  3744.  *)
  3745.   DDPF_ZPIXELS                  = $00002000;
  3746.   {$EXTERNALSYM DDPF_ZPIXELS}
  3747.  
  3748. (*
  3749.  * The surface contains stencil information along with Z
  3750.  *)
  3751.   DDPF_STENCILBUFFER              = $00004000;
  3752.   {$EXTERNALSYM DDPF_STENCILBUFFER}
  3753.  
  3754. (*
  3755.  * Premultiplied alpha format -- the color components have been
  3756.  * premultiplied by the alpha component.
  3757.  *)
  3758.   DDPF_ALPHAPREMULT               = $00008000;
  3759.   {$EXTERNALSYM DDPF_ALPHAPREMULT}
  3760.  
  3761.  
  3762. (*
  3763.  * Luminance data in the pixel format is valid.
  3764.  * Use this flag for luminance-only or luminance+alpha surfaces,
  3765.  * the bit depth is then ddpf.dwLuminanceBitCount.
  3766.  *)
  3767.   DDPF_LUMINANCE                          = $00020000;
  3768.   {$EXTERNALSYM DDPF_LUMINANCE}
  3769.  
  3770. (*
  3771.  * Luminance data in the pixel format is valid.
  3772.  * Use this flag when hanging luminance off bumpmap surfaces,
  3773.  * the bit mask for the luminance portion of the pixel is then
  3774.  * ddpf.dwBumpLuminanceBitMask
  3775.  *)
  3776.   DDPF_BUMPLUMINANCE                      = $00040000;
  3777.   {$EXTERNALSYM DDPF_BUMPLUMINANCE}
  3778.  
  3779. (*
  3780.  * Bump map dUdV data in the pixel format is valid.
  3781.  *)
  3782.   DDPF_BUMPDUDV                           = $00080000;
  3783.   {$EXTERNALSYM DDPF_BUMPDUDV}
  3784.  
  3785.  
  3786. (*===========================================================================
  3787.  *
  3788.  *
  3789.  * DIRECTDRAW CALLBACK FLAGS
  3790.  *
  3791.  *
  3792.  *==========================================================================*)
  3793.  
  3794. (****************************************************************************
  3795.  *
  3796.  * DIRECTDRAW ENUMSURFACES FLAGS
  3797.  *
  3798.  ****************************************************************************)
  3799.  
  3800. (*
  3801.  * Enumerate all of the surfaces that meet the search criterion.
  3802.  *)
  3803.   DDENUMSURFACES_ALL                      = $00000001;
  3804.   {$EXTERNALSYM DDENUMSURFACES_ALL}
  3805.   {$EXTERNALSYM DDENUMSURFACES_ALL}
  3806.  
  3807. (*
  3808.  * A search hit is a surface that matches the surface description.
  3809.  *)
  3810.   DDENUMSURFACES_MATCH                    = $00000002;
  3811.   {$EXTERNALSYM DDENUMSURFACES_MATCH}
  3812.  
  3813. (*
  3814.  * A search hit is a surface that does not match the surface description.
  3815.  *)
  3816.   DDENUMSURFACES_NOMATCH                  = $00000004;
  3817.   {$EXTERNALSYM DDENUMSURFACES_NOMATCH}
  3818.  
  3819. (*
  3820.  * Enumerate the first surface that can be created which meets the search criterion.
  3821.  *)
  3822.   DDENUMSURFACES_CANBECREATED             = $00000008;
  3823.   {$EXTERNALSYM DDENUMSURFACES_CANBECREATED}
  3824.  
  3825. (*
  3826.  * Enumerate the surfaces that already exist that meet the search criterion.
  3827.  *)
  3828.   DDENUMSURFACES_DOESEXIST                = $00000010;
  3829.   {$EXTERNALSYM DDENUMSURFACES_DOESEXIST}
  3830.  
  3831.  
  3832. (****************************************************************************
  3833.  *
  3834.  * DIRECTDRAW SETDISPLAYMODE FLAGS
  3835.  *
  3836.  ****************************************************************************)
  3837.  
  3838. (*
  3839.  * The desired mode is a standard VGA mode
  3840.  *)
  3841.   DDSDM_STANDARDVGAMODE                   = $00000001;
  3842.   {$EXTERNALSYM DDSDM_STANDARDVGAMODE}
  3843.  
  3844.  
  3845. (****************************************************************************
  3846.  *
  3847.  * DIRECTDRAW ENUMDISPLAYMODES FLAGS
  3848.  *
  3849.  ****************************************************************************)
  3850.  
  3851. (*
  3852.  * Enumerate Modes with different refresh rates.  EnumDisplayModes guarantees
  3853.  * that a particular mode will be enumerated only once.  This flag specifies whether
  3854.  * the refresh rate is taken into account when determining if a mode is unique.
  3855.  *)
  3856.   DDEDM_REFRESHRATES                      = $00000001;
  3857.   {$EXTERNALSYM DDEDM_REFRESHRATES}
  3858.  
  3859. (*
  3860.  * Enumerate VGA modes. Specify this flag if you wish to enumerate supported VGA
  3861.  * modes such as mode 0x13 in addition to the usual ModeX modes (which are always
  3862.  * enumerated if the application has previously called SetCooperativeLevel with the
  3863.  * DDSCL_ALLOWMODEX flag set).
  3864.  *)
  3865.   DDEDM_STANDARDVGAMODES                  = $00000002;
  3866.   {$EXTERNALSYM DDEDM_STANDARDVGAMODES}
  3867.  
  3868.  
  3869. (****************************************************************************
  3870.  *
  3871.  * DIRECTDRAW SETCOOPERATIVELEVEL FLAGS
  3872.  *
  3873.  ****************************************************************************)
  3874.  
  3875. (*
  3876.  * Exclusive mode owner will be responsible for the entire primary surface.
  3877.  * GDI can be ignored. used with DD
  3878.  *)
  3879.   DDSCL_FULLSCREEN                        = $00000001;
  3880.   {$EXTERNALSYM DDSCL_FULLSCREEN}
  3881.  
  3882. (*
  3883.  * allow CTRL_ALT_DEL to work while in fullscreen exclusive mode
  3884.  *)
  3885.   DDSCL_ALLOWREBOOT                       = $00000002;
  3886.   {$EXTERNALSYM DDSCL_ALLOWREBOOT}
  3887.  
  3888. (*
  3889.  * prevents DDRAW from modifying the application window.
  3890.  * prevents DDRAW from minimize/restore the application window on activation.
  3891.  *)
  3892.   DDSCL_NOWINDOWCHANGES                   = $00000004;
  3893.   {$EXTERNALSYM DDSCL_NOWINDOWCHANGES}
  3894.  
  3895. (*
  3896.  * app wants to work as a regular Windows application
  3897.  *)
  3898.   DDSCL_NORMAL                            = $00000008;
  3899.   {$EXTERNALSYM DDSCL_NORMAL}
  3900.  
  3901. (*
  3902.  * app wants exclusive access
  3903.  *)
  3904.   DDSCL_EXCLUSIVE                         = $00000010;
  3905.   {$EXTERNALSYM DDSCL_EXCLUSIVE}
  3906.  
  3907.  
  3908. (*
  3909.  * app can deal with non-windows display modes
  3910.  *)
  3911.   DDSCL_ALLOWMODEX                        = $00000040;
  3912.   {$EXTERNALSYM DDSCL_ALLOWMODEX}
  3913.  
  3914. (*
  3915.  * this window will receive the focus messages
  3916.  *)
  3917.   DDSCL_SETFOCUSWINDOW                    = $00000080;
  3918.   {$EXTERNALSYM DDSCL_SETFOCUSWINDOW}
  3919.  
  3920. (*
  3921.  * this window is associated with the DDRAW object and will
  3922.  * cover the screen in fullscreen mode
  3923.  *)
  3924.   DDSCL_SETDEVICEWINDOW                   = $00000100;
  3925.   {$EXTERNALSYM DDSCL_SETDEVICEWINDOW}
  3926.  
  3927. (*
  3928.  * app wants DDRAW to create a window to be associated with the
  3929.  * DDRAW object
  3930.  *)
  3931.   DDSCL_CREATEDEVICEWINDOW                = $00000200;
  3932.   {$EXTERNALSYM DDSCL_CREATEDEVICEWINDOW}
  3933.  
  3934. (*
  3935.  * App explicitly asks DDRAW/D3D to be multithread safe. This makes D3D
  3936.  * take the global crtisec more frequently.
  3937.  *)
  3938.   DDSCL_MULTITHREADED                     = $00000400;
  3939.   {$EXTERNALSYM DDSCL_MULTITHREADED}
  3940.  
  3941. (*
  3942.  * App specifies that it would like to keep the FPU set up for optimal Direct3D
  3943.  * performance (single precision and exceptions disabled) so Direct3D
  3944.  * does not need to explicitly set the FPU each time. This is assumed by
  3945.  * default in DirectX 7. See also DDSCL_FPUPRESERVE
  3946.  *)
  3947.   DDSCL_FPUSETUP                          = $00000800;
  3948.   {$EXTERNALSYM DDSCL_FPUSETUP}
  3949.  
  3950. (*
  3951.  * App specifies that it needs either double precision FPU or FPU exceptions
  3952.  * enabled. This makes Direct3D explicitly set the FPU state eah time it is
  3953.  * called. Setting the flag will reduce Direct3D performance. The flag is
  3954.  * assumed by default in DirectX 6 and earlier. See also DDSCL_FPUSETUP
  3955.  *)
  3956.   DDSCL_FPUPRESERVE                       = $00001000;
  3957.   {$EXTERNALSYM DDSCL_FPUPRESERVE}
  3958.  
  3959.  
  3960. (****************************************************************************
  3961.  *
  3962.  * DIRECTDRAW BLT FLAGS
  3963.  *
  3964.  ****************************************************************************)
  3965.  
  3966. (*
  3967.  * Use the alpha information in the pixel format or the alpha channel surface
  3968.  * attached to the destination surface as the alpha channel for this blt.
  3969.  *)
  3970.   DDBLT_ALPHADEST                         = $00000001;
  3971.   {$EXTERNALSYM DDBLT_ALPHADEST}
  3972.  
  3973. (*
  3974.  * Use the dwConstAlphaDest field in the DDBLTFX structure as the alpha channel
  3975.  * for the destination surface for this blt.
  3976.  *)
  3977.   DDBLT_ALPHADESTCONSTOVERRIDE            = $00000002;
  3978.   {$EXTERNALSYM DDBLT_ALPHADESTCONSTOVERRIDE}
  3979.  
  3980. (*
  3981.  * The NEG suffix indicates that the destination surface becomes more
  3982.  * transparent as the alpha value increases. (0 is opaque)
  3983.  *)
  3984.   DDBLT_ALPHADESTNEG                      = $00000004;
  3985.   {$EXTERNALSYM DDBLT_ALPHADESTNEG}
  3986.  
  3987. (*
  3988.  * Use the lpDDSAlphaDest field in the DDBLTFX structure as the alpha
  3989.  * channel for the destination for this blt.
  3990.  *)
  3991.   DDBLT_ALPHADESTSURFACEOVERRIDE          = $00000008;
  3992.   {$EXTERNALSYM DDBLT_ALPHADESTSURFACEOVERRIDE}
  3993.  
  3994. (*
  3995.  * Use the dwAlphaEdgeBlend field in the DDBLTFX structure as the alpha channel
  3996.  * for the edges of the image that border the color key colors.
  3997.  *)
  3998.   DDBLT_ALPHAEDGEBLEND                    = $00000010;
  3999.   {$EXTERNALSYM DDBLT_ALPHAEDGEBLEND}
  4000.  
  4001. (*
  4002.  * Use the alpha information in the pixel format or the alpha channel surface
  4003.  * attached to the source surface as the alpha channel for this blt.
  4004.  *)
  4005.   DDBLT_ALPHASRC                          = $00000020;
  4006.   {$EXTERNALSYM DDBLT_ALPHASRC}
  4007.  
  4008. (*
  4009.  * Use the dwConstAlphaSrc field in the DDBLTFX structure as the alpha channel
  4010.  * for the source for this blt.
  4011.  *)
  4012.   DDBLT_ALPHASRCCONSTOVERRIDE             = $00000040;
  4013.   {$EXTERNALSYM DDBLT_ALPHASRCCONSTOVERRIDE}
  4014.  
  4015. (*
  4016.  * The NEG suffix indicates that the source surface becomes more transparent
  4017.  * as the alpha value increases. (0 is opaque)
  4018.  *)
  4019.   DDBLT_ALPHASRCNEG                       = $00000080;
  4020.   {$EXTERNALSYM DDBLT_ALPHASRCNEG}
  4021.  
  4022. (*
  4023.  * Use the lpDDSAlphaSrc field in the DDBLTFX structure as the alpha channel
  4024.  * for the source for this blt.
  4025.  *)
  4026.   DDBLT_ALPHASRCSURFACEOVERRIDE           = $00000100;
  4027.   {$EXTERNALSYM DDBLT_ALPHASRCSURFACEOVERRIDE}
  4028.  
  4029. (*
  4030.  * Do this blt asynchronously through the FIFO in the order received.  If
  4031.  * there is no room in the hardware FIFO fail the call.
  4032.  *)
  4033.   DDBLT_ASYNC                             = $00000200;
  4034.   {$EXTERNALSYM DDBLT_ASYNC}
  4035.  
  4036. (*
  4037.  * Uses the dwFillColor field in the DDBLTFX structure as the RGB color
  4038.  * to fill the destination rectangle on the destination surface with.
  4039.  *)
  4040.   DDBLT_COLORFILL                         = $00000400;
  4041.   {$EXTERNALSYM DDBLT_COLORFILL}
  4042.  
  4043. (*
  4044.  * Uses the dwDDFX field in the DDBLTFX structure to specify the effects
  4045.  * to use for the blt.
  4046.  *)
  4047.   DDBLT_DDFX                              = $00000800;
  4048.   {$EXTERNALSYM DDBLT_DDFX}
  4049.  
  4050. (*
  4051.  * Uses the dwDDROPS field in the DDBLTFX structure to specify the ROPS
  4052.  * that are not part of the Win32 API.
  4053.  *)
  4054.   DDBLT_DDROPS                            = $00001000;
  4055.   {$EXTERNALSYM DDBLT_DDROPS}
  4056.  
  4057. (*
  4058.  * Use the color key associated with the destination surface.
  4059.  *)
  4060.   DDBLT_KEYDEST                           = $00002000;
  4061.   {$EXTERNALSYM DDBLT_KEYDEST}
  4062.  
  4063. (*
  4064.  * Use the dckDestColorkey field in the DDBLTFX structure as the color key
  4065.  * for the destination surface.
  4066.  *)
  4067.   DDBLT_KEYDESTOVERRIDE                   = $00004000;
  4068.   {$EXTERNALSYM DDBLT_KEYDESTOVERRIDE}
  4069.  
  4070. (*
  4071.  * Use the color key associated with the source surface.
  4072.  *)
  4073.   DDBLT_KEYSRC                            = $00008000;
  4074.   {$EXTERNALSYM DDBLT_KEYSRC}
  4075.  
  4076. (*
  4077.  * Use the dckSrcColorkey field in the DDBLTFX structure as the color key
  4078.  * for the source surface.
  4079.  *)
  4080.   DDBLT_KEYSRCOVERRIDE                    = $00010000;
  4081.   {$EXTERNALSYM DDBLT_KEYSRCOVERRIDE}
  4082.  
  4083. (*
  4084.  * Use the dwROP field in the DDBLTFX structure for the raster operation
  4085.  * for this blt.  These ROPs are the same as the ones defined in the Win32 API.
  4086.  *)
  4087.   DDBLT_ROP                               = $00020000;
  4088.   {$EXTERNALSYM DDBLT_ROP}
  4089.  
  4090. (*
  4091.  * Use the dwRotationAngle field in the DDBLTFX structure as the angle
  4092.  * (specified in 1/100th of a degree) to rotate the surface.
  4093.  *)
  4094.   DDBLT_ROTATIONANGLE                     = $00040000;
  4095.   {$EXTERNALSYM DDBLT_ROTATIONANGLE}
  4096.  
  4097. (*
  4098.  * Z-buffered blt using the z-buffers attached to the source and destination
  4099.  * surfaces and the dwZBufferOpCode field in the DDBLTFX structure as the
  4100.  * z-buffer opcode.
  4101.  *)
  4102.   DDBLT_ZBUFFER                           = $00080000;
  4103.   {$EXTERNALSYM DDBLT_ZBUFFER}
  4104.  
  4105. (*
  4106.  * Z-buffered blt using the dwConstDest Zfield and the dwZBufferOpCode field
  4107.  * in the DDBLTFX structure as the z-buffer and z-buffer opcode respectively
  4108.  * for the destination.
  4109.  *)
  4110.   DDBLT_ZBUFFERDESTCONSTOVERRIDE          = $00100000;
  4111.   {$EXTERNALSYM DDBLT_ZBUFFERDESTCONSTOVERRIDE}
  4112.  
  4113. (*
  4114.  * Z-buffered blt using the lpDDSDestZBuffer field and the dwZBufferOpCode
  4115.  * field in the DDBLTFX structure as the z-buffer and z-buffer opcode
  4116.  * respectively for the destination.
  4117.  *)
  4118.   DDBLT_ZBUFFERDESTOVERRIDE               = $00200000;
  4119.   {$EXTERNALSYM DDBLT_ZBUFFERDESTOVERRIDE}
  4120.  
  4121. (*
  4122.  * Z-buffered blt using the dwConstSrcZ field and the dwZBufferOpCode field
  4123.  * in the DDBLTFX structure as the z-buffer and z-buffer opcode respectively
  4124.  * for the source.
  4125.  *)
  4126.   DDBLT_ZBUFFERSRCCONSTOVERRIDE           = $00400000;
  4127.   {$EXTERNALSYM DDBLT_ZBUFFERSRCCONSTOVERRIDE}
  4128.  
  4129. (*
  4130.  * Z-buffered blt using the lpDDSSrcZBuffer field and the dwZBufferOpCode
  4131.  * field in the DDBLTFX structure as the z-buffer and z-buffer opcode
  4132.  * respectively for the source.
  4133.  *)
  4134.    DDBLT_ZBUFFERSRCOVERRIDE               = $00800000;
  4135.    {$EXTERNALSYM DDBLT_ZBUFFERSRCOVERRIDE}
  4136.  
  4137. (*
  4138.  * wait until the device is ready to handle the blt
  4139.  * this will cause blt to not return DDERR_WASSTILLDRAWING
  4140.  *)
  4141.   DDBLT_WAIT                              = $01000000;
  4142.   {$EXTERNALSYM DDBLT_WAIT}
  4143.  
  4144. (*
  4145.  * Uses the dwFillDepth field in the DDBLTFX structure as the depth value
  4146.  * to fill the destination rectangle on the destination Z-buffer surface
  4147.  * with.
  4148.  *)
  4149.   DDBLT_DEPTHFILL                         = $02000000;
  4150.   {$EXTERNALSYM DDBLT_DEPTHFILL}
  4151.  
  4152.  
  4153. (*
  4154.  * Return immediately (with DDERR_WASSTILLDRAWING) if the device is not
  4155.  * ready to schedule the blt at the time Blt() is called.
  4156.  *)
  4157.   DDBLT_DONOTWAIT                         = $08000000;
  4158.   {$EXTERNALSYM DDBLT_DONOTWAIT}
  4159.  
  4160. (*
  4161.  * These flags indicate a presentation blt (i.e. a blt
  4162.  * that moves surface contents from an offscreen back buffer to the primary
  4163.  * surface). The driver is not allowed to "queue"  more than three such blts.
  4164.  * The "end" of the presentation blt is indicated, since the
  4165.  * blt may be clipped, in which case the runtime will call the driver with
  4166.  * several blts. All blts (even if not clipped) are tagged with DDBLT_PRESENTATION
  4167.  * and the last (even if not clipped) additionally with DDBLT_LAST_PRESENTATION.
  4168.  * Thus the true rule is that the driver must not schedule a DDBLT_PRESENTATION
  4169.  * blt if there are 3 or more DDBLT_PRESENTLAST blts in the hardware pipe.
  4170.  * If there are such blts in the pipe, the driver should return DDERR_WASSTILLDRAWING
  4171.  * until the oldest queued DDBLT_LAST_PRESENTATION blts has been retired (i.e. the
  4172.  * pixels have been actually written to the primary surface). Once the oldest blt
  4173.  * has been retired, the driver is free to schedule the current blt.
  4174.  * The goal is to provide a mechanism whereby the device's hardware queue never
  4175.  * gets more than 3 frames ahead of the frames being generated by the application.
  4176.  * When excessive queueing occurs, applications become unusable because the application
  4177.  * visibly lags user input, and such problems make windowed interactive applications impossible.
  4178.  * Some drivers may not have sufficient knowledge of their hardware's FIFO to know
  4179.  * when a certain blt has been retired. Such drivers should code cautiously, and
  4180.  * simply not allow any frames to be queued at all. DDBLT_LAST_PRESENTATION should cause
  4181.  * such drivers to return DDERR_WASSTILLDRAWING until the accelerator is completely
  4182.  * finished- exactly as if the application had called Lock on the source surface
  4183.  * before calling Blt.
  4184.  * In other words, the driver is allowed and encouraged to
  4185.  * generate as much latency as it can, but never more than 3 frames worth.
  4186.  * Implementation detail: Drivers should count blts against the SOURCE surface, not
  4187.  * against the primary surface. This enables multiple parallel windowed application
  4188.  * to function more optimally.
  4189.  * This flag is passed only to DX8 or higher drivers.
  4190.  *
  4191.  * APPLICATIONS DO NOT SET THESE FLAGS. THEY ARE SET BY THE DIRECTDRAW RUNTIME.
  4192.  *
  4193.  *)
  4194.   DDBLT_PRESENTATION                      = $10000000;
  4195.   {$EXTERNALSYM DDBLT_PRESENTATION}
  4196.   DDBLT_LAST_PRESENTATION                 = $20000000;
  4197.   {$EXTERNALSYM DDBLT_LAST_PRESENTATION}
  4198.  
  4199. (*
  4200.  * If DDBLT_EXTENDED_FLAGS is set, then the driver should re-interpret
  4201.  * other flags according to the definitions that follow.
  4202.  * For example, bit 0 (0x00000001L) means DDBLT_ALPHADEST, unless
  4203.  * DDBLT_EXTENDED_FLAGS is also set, in which case bit 0 means
  4204.  * DDBLT_EXTENDED_LINEAR_CONTENT.
  4205.  * Only DirectX9 and higher drivers will be given extended blt flags.
  4206.  * Only flags explicitly mentioned here should be re-interpreted.
  4207.  * All other flags retain their original meanings.
  4208.  *
  4209.  * List of re-interpreted flags:
  4210.  *
  4211.  * Bit Hex value   New meaning                                  old meaning
  4212.  * ---------------------------------------------------------------
  4213.  *  2  0x00000004  DDBLT_EXTENDED_LINEAR_CONTENT                DDBLT_ALPHADESTNEG
  4214.  *  4  0x00000010  DDBLT_EXTENDED_PRESENTATION_STRETCHFACTOR    DDBLT_ALPHAEDGEBLEND
  4215.  *
  4216.  *
  4217.  * NOTE: APPLICATIONS SHOULD NOT SET THIS FLAG. THIS FLAG IS INTENDED
  4218.  * FOR USE BY THE DIRECT3D RUNTIME.
  4219.  *)
  4220.   DDBLT_EXTENDED_FLAGS                    = $40000000;
  4221.   {$EXTERNALSYM DDBLT_EXTENDED_FLAGS}
  4222.  
  4223. (*
  4224.  * EXTENDED FLAG. SEE DEFINITION OF DDBLT_EXTENDED_FLAGS.
  4225.  * This flag indidcates that the source surface contains content in a
  4226.  * linear color space. The driver may perform gamma correction to the
  4227.  * desktop color space (i.e. sRGB, gamma 2.2) as part of this blt.
  4228.  * If the device can perform such a conversion as part of the copy,
  4229.  * the driver should also set D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION
  4230.  *
  4231.  * NOTE: APPLICATIONS SHOULD NOT SET THIS FLAG. THIS FLAG IS INTENDED
  4232.  * FOR USE BY THE DIRECT3D RUNTIME. Use IDirect3DSwapChain9::Present
  4233.  * and specify D3DPRESENT_LINEAR_CONTENT in order to use this functionality.
  4234.  *)
  4235.   DDBLT_EXTENDED_LINEAR_CONTENT           = $00000004;
  4236.   {$EXTERNALSYM DDBLT_EXTENDED_LINEAR_CONTENT}
  4237.  
  4238.  
  4239. (****************************************************************************
  4240.  *
  4241.  * BLTFAST FLAGS
  4242.  *
  4243.  ****************************************************************************)
  4244.  
  4245.   DDBLTFAST_NOCOLORKEY                    = $00000000;
  4246.   {$EXTERNALSYM DDBLTFAST_NOCOLORKEY}
  4247.   DDBLTFAST_SRCCOLORKEY                   = $00000001;
  4248.   {$EXTERNALSYM DDBLTFAST_SRCCOLORKEY}
  4249.   DDBLTFAST_DESTCOLORKEY                  = $00000002;
  4250.   {$EXTERNALSYM DDBLTFAST_DESTCOLORKEY}
  4251.   DDBLTFAST_WAIT                          = $00000010;
  4252.   {$EXTERNALSYM DDBLTFAST_WAIT}
  4253.   DDBLTFAST_DONOTWAIT                     = $00000020;
  4254.   {$EXTERNALSYM DDBLTFAST_DONOTWAIT}
  4255.  
  4256. (****************************************************************************
  4257.  *
  4258.  * FLIP FLAGS
  4259.  *
  4260.  ****************************************************************************)
  4261.  
  4262.   DDFLIP_WAIT                          = $00000001;
  4263.   {$EXTERNALSYM DDFLIP_WAIT}
  4264.  
  4265. (*
  4266.  * Indicates that the target surface contains the even field of video data.
  4267.  * This flag is only valid with an overlay surface.
  4268.  *)
  4269.   DDFLIP_EVEN                          = $00000002;
  4270.   {$EXTERNALSYM DDFLIP_EVEN}
  4271.  
  4272. (*
  4273.  * Indicates that the target surface contains the odd field of video data.
  4274.  * This flag is only valid with an overlay surface.
  4275.  *)
  4276.   DDFLIP_ODD                           = $00000004;
  4277.   {$EXTERNALSYM DDFLIP_ODD}
  4278.  
  4279. (*
  4280.  * Causes DirectDraw to perform the physical flip immediately and return
  4281.  * to the application. Typically, what was the front buffer but is now the back
  4282.  * buffer will still be visible (depending on timing) until the next vertical
  4283.  * retrace. Subsequent operations involving the two flipped surfaces will
  4284.  * not check to see if the physical flip has finished (i.e. will not return
  4285.  * DDERR_WASSTILLDRAWING for that reason (but may for other reasons)).
  4286.  * This allows an application to perform Flips at a higher frequency than the
  4287.  * monitor refresh rate, but may introduce visible artifacts.
  4288.  * Only effective if DDCAPS2_FLIPNOVSYNC is set. If that bit is not set,
  4289.  * DDFLIP_NOVSYNC has no effect.
  4290.  *)
  4291.   DDFLIP_NOVSYNC                       = $00000008;
  4292.   {$EXTERNALSYM DDFLIP_NOVSYNC}
  4293.  
  4294.  
  4295. (*
  4296.  * Flip Interval Flags. These flags indicate how many vertical retraces to wait between
  4297.  * each flip. The default is one. DirectDraw will return DDERR_WASSTILLDRAWING for each
  4298.  * surface involved in the flip until the specified number of vertical retraces has
  4299.  * ocurred. Only effective if DDCAPS2_FLIPINTERVAL is set. If that bit is not set,
  4300.  * DDFLIP_INTERVALn has no effect.
  4301.  *)
  4302.  
  4303. (*
  4304.  * DirectDraw will flip on every other vertical sync
  4305.  *)
  4306.   DDFLIP_INTERVAL2                     = $02000000;
  4307.   {$EXTERNALSYM DDFLIP_INTERVAL2}
  4308.  
  4309.  
  4310. (*
  4311.  * DirectDraw will flip on every third vertical sync
  4312.  *)
  4313.   DDFLIP_INTERVAL3                     = $03000000;
  4314.   {$EXTERNALSYM DDFLIP_INTERVAL3}
  4315.  
  4316.  
  4317. (*
  4318.  * DirectDraw will flip on every fourth vertical sync
  4319.  *)
  4320.   DDFLIP_INTERVAL4                     = $04000000;
  4321.   {$EXTERNALSYM DDFLIP_INTERVAL4}
  4322.  
  4323. (*
  4324.  * DirectDraw will flip and display a main stereo surface
  4325.  *)
  4326.   DDFLIP_STEREO                        = $00000010;
  4327.   {$EXTERNALSYM DDFLIP_STEREO}
  4328.  
  4329. (*
  4330.  * On IDirectDrawSurface7 and higher interfaces, the default is DDFLIP_WAIT. If you wish
  4331.  * to override the default and use time when the accelerator is busy (as denoted by
  4332.  * the DDERR_WASSTILLDRAWING return code) then use DDFLIP_DONOTWAIT.
  4333.  *)
  4334.   DDFLIP_DONOTWAIT                     = $00000020;
  4335.   {$EXTERNALSYM DDFLIP_DONOTWAIT}
  4336.  
  4337.  
  4338. (****************************************************************************
  4339.  *
  4340.  * DIRECTDRAW SURFACE OVERLAY FLAGS
  4341.  *
  4342.  ****************************************************************************)
  4343.  
  4344. (*
  4345.  * Use the alpha information in the pixel format or the alpha channel surface
  4346.  * attached to the destination surface as the alpha channel for the
  4347.  * destination overlay.
  4348.  *)
  4349.   DDOVER_ALPHADEST                        = $00000001;
  4350.   {$EXTERNALSYM DDOVER_ALPHADEST}
  4351.  
  4352. (*
  4353.  * Use the dwConstAlphaDest field in the DDOVERLAYFX structure as the
  4354.  * destination alpha channel for this overlay.
  4355.  *)
  4356.   DDOVER_ALPHADESTCONSTOVERRIDE           = $00000002;
  4357.   {$EXTERNALSYM DDOVER_ALPHADESTCONSTOVERRIDE}
  4358.  
  4359. (*
  4360.  * The NEG suffix indicates that the destination surface becomes more
  4361.  * transparent as the alpha value increases.
  4362.  *)
  4363.   DDOVER_ALPHADESTNEG                     = $00000004;
  4364.   {$EXTERNALSYM DDOVER_ALPHADESTNEG}
  4365.  
  4366. (*
  4367.  * Use the lpDDSAlphaDest field in the DDOVERLAYFX structure as the alpha
  4368.  * channel destination for this overlay.
  4369.  *)
  4370.   DDOVER_ALPHADESTSURFACEOVERRIDE         = $00000008;
  4371.   {$EXTERNALSYM DDOVER_ALPHADESTSURFACEOVERRIDE}
  4372.  
  4373. (*
  4374.  * Use the dwAlphaEdgeBlend field in the DDOVERLAYFX structure as the alpha
  4375.  * channel for the edges of the image that border the color key colors.
  4376.  *)
  4377.   DDOVER_ALPHAEDGEBLEND                   = $00000010;
  4378.   {$EXTERNALSYM DDOVER_ALPHAEDGEBLEND}
  4379.  
  4380. (*
  4381.  * Use the alpha information in the pixel format or the alpha channel surface
  4382.  * attached to the source surface as the source alpha channel for this overlay.
  4383.  *)
  4384.   DDOVER_ALPHASRC                         = $00000020;
  4385.   {$EXTERNALSYM DDOVER_ALPHASRC}
  4386.  
  4387. (*
  4388.  * Use the dwConstAlphaSrc field in the DDOVERLAYFX structure as the source
  4389.  * alpha channel for this overlay.
  4390.  *)
  4391.   DDOVER_ALPHASRCCONSTOVERRIDE            = $00000040;
  4392.   {$EXTERNALSYM DDOVER_ALPHASRCCONSTOVERRIDE}
  4393.  
  4394. (*
  4395.  * The NEG suffix indicates that the source surface becomes more transparent
  4396.  * as the alpha value increases.
  4397.  *)
  4398.   DDOVER_ALPHASRCNEG                      = $00000080;
  4399.   {$EXTERNALSYM DDOVER_ALPHASRCNEG}
  4400.  
  4401. (*
  4402.  * Use the lpDDSAlphaSrc field in the DDOVERLAYFX structure as the alpha channel
  4403.  * source for this overlay.
  4404.  *)
  4405.   DDOVER_ALPHASRCSURFACEOVERRIDE          = $00000100;
  4406.   {$EXTERNALSYM DDOVER_ALPHASRCSURFACEOVERRIDE}
  4407.  
  4408. (*
  4409.  * Turn this overlay off.
  4410.  *)
  4411.   DDOVER_HIDE                             = $00000200;
  4412.   {$EXTERNALSYM DDOVER_HIDE}
  4413.  
  4414. (*
  4415.  * Use the color key associated with the destination surface.
  4416.  *)
  4417.   DDOVER_KEYDEST                          = $00000400;
  4418.   {$EXTERNALSYM DDOVER_KEYDEST}
  4419.  
  4420. (*
  4421.  * Use the dckDestColorkey field in the DDOVERLAYFX structure as the color key
  4422.  * for the destination surface
  4423.  *)
  4424.   DDOVER_KEYDESTOVERRIDE                  = $00000800;
  4425.   {$EXTERNALSYM DDOVER_KEYDESTOVERRIDE}
  4426.  
  4427. (*
  4428.  * Use the color key associated with the source surface.
  4429.  *)
  4430.   DDOVER_KEYSRC                           = $00001000;
  4431.   {$EXTERNALSYM DDOVER_KEYSRC}
  4432.  
  4433. (*
  4434.  * Use the dckSrcColorkey field in the DDOVERLAYFX structure as the color key
  4435.  * for the source surface.
  4436.  *)
  4437.   DDOVER_KEYSRCOVERRIDE                   = $00002000;
  4438.   {$EXTERNALSYM DDOVER_KEYSRCOVERRIDE}
  4439.  
  4440. (*
  4441.  * Turn this overlay on.
  4442.  *)
  4443.   DDOVER_SHOW                             = $00004000;
  4444.   {$EXTERNALSYM DDOVER_SHOW}
  4445.  
  4446. (*
  4447.  * Add a dirty rect to an emulated overlayed surface.
  4448.  *)
  4449.   DDOVER_ADDDIRTYRECT                     = $00008000;
  4450.   {$EXTERNALSYM DDOVER_ADDDIRTYRECT}
  4451.  
  4452. (*
  4453.  * Redraw all dirty rects on an emulated overlayed surface.
  4454.  *)
  4455.   DDOVER_REFRESHDIRTYRECTS                = $00010000;
  4456.   {$EXTERNALSYM DDOVER_REFRESHDIRTYRECTS}
  4457.  
  4458. (*
  4459.  * Redraw the entire surface on an emulated overlayed surface.
  4460.  *)
  4461.   DDOVER_REFRESHALL                       = $00020000;
  4462.   {$EXTERNALSYM DDOVER_REFRESHALL}
  4463.  
  4464.  
  4465. (*
  4466.  * Use the overlay FX flags to define special overlay FX
  4467.  *)
  4468.   DDOVER_DDFX                             = $00080000;
  4469.   {$EXTERNALSYM DDOVER_DDFX}
  4470.  
  4471. (*
  4472.  * Autoflip the overlay when ever the video port autoflips
  4473.  *)
  4474.   DDOVER_AUTOFLIP                            = $00100000;
  4475.   {$EXTERNALSYM DDOVER_AUTOFLIP}
  4476.  
  4477. (*
  4478.  * Display each field of video port data individually without
  4479.  * causing any jittery artifacts
  4480.  *)
  4481.   DDOVER_BOB                             = $00200000;
  4482.   {$EXTERNALSYM DDOVER_BOB}
  4483.  
  4484. (*
  4485.  * Indicates that bob/weave decisions should not be overridden by other
  4486.  * interfaces.
  4487.  *)
  4488.   DDOVER_OVERRIDEBOBWEAVE          = $00400000;
  4489.   {$EXTERNALSYM DDOVER_OVERRIDEBOBWEAVE}
  4490.  
  4491. (*
  4492.  * Indicates that the surface memory is composed of interleaved fields.
  4493.  *)
  4494.   DDOVER_INTERLEAVED              = $00800000;
  4495.   {$EXTERNALSYM DDOVER_INTERLEAVED}
  4496.  
  4497. (*
  4498.  * Indicates that bob will be performed using hardware rather than
  4499.  * software or emulated.
  4500.  *)
  4501.   DDOVER_BOBHARDWARE                   = $01000000;
  4502.   {$EXTERNALSYM DDOVER_BOBHARDWARE}
  4503.  
  4504. (*
  4505.  * Indicates that overlay FX structure contains valid ARGB scaling factors.
  4506.  *)
  4507.   DDOVER_ARGBSCALEFACTORS                 = $02000000;
  4508.   {$EXTERNALSYM DDOVER_ARGBSCALEFACTORS}
  4509.  
  4510. (*
  4511.  * Indicates that ARGB scaling factors can be degraded to fit driver capabilities.
  4512.  *)
  4513.   DDOVER_DEGRADEARGBSCALING               = $04000000;
  4514.   {$EXTERNALSYM DDOVER_DEGRADEARGBSCALING}
  4515.  
  4516.  
  4517. (****************************************************************************
  4518.  *
  4519.  * DIRECTDRAWSURFACE LOCK FLAGS
  4520.  *
  4521.  ****************************************************************************)
  4522.  
  4523. (*
  4524.  * The default.  Set to indicate that Lock should return a valid memory pointer
  4525.  * to the top of the specified rectangle.  If no rectangle is specified then a
  4526.  * pointer to the top of the surface is returned.
  4527.  *)
  4528.   DDLOCK_SURFACEMEMORYPTR                 = $00000000;    // = default
  4529.   {$EXTERNALSYM DDLOCK_SURFACEMEMORYPTR}
  4530.  
  4531. (*
  4532.  * Set to indicate that Lock should wait until it can obtain a valid memory
  4533.  * pointer before returning.  If this bit is set, Lock will never return
  4534.  * DDERR_WASSTILLDRAWING.
  4535.  *)
  4536.   DDLOCK_WAIT                             = $00000001;
  4537.   {$EXTERNALSYM DDLOCK_WAIT}
  4538.  
  4539. (*
  4540.  * Set if an event handle is being passed to Lock.  Lock will trigger the event
  4541.  * when it can return the surface memory pointer requested.
  4542.  *)
  4543.   DDLOCK_EVENT                            = $00000002;
  4544.   {$EXTERNALSYM DDLOCK_EVENT}
  4545.  
  4546. (*
  4547.  * Indicates that the surface being locked will only be read from.
  4548.  *)
  4549.   DDLOCK_READONLY                         = $00000010;
  4550.   {$EXTERNALSYM DDLOCK_READONLY}
  4551.  
  4552. (*
  4553.  * Indicates that the surface being locked will only be written to
  4554.  *)
  4555.   DDLOCK_WRITEONLY                        = $00000020;
  4556.   {$EXTERNALSYM DDLOCK_WRITEONLY}
  4557.  
  4558.  
  4559. (*
  4560.  * Indicates that a system wide lock should not be taken when this surface
  4561.  * is locked. This has several advantages (cursor responsiveness, ability
  4562.  * to call more Windows functions, easier debugging) when locking video
  4563.  * memory surfaces. However, an application specifying this flag must
  4564.  * comply with a number of conditions documented in the help file.
  4565.  * Furthermore, this flag cannot be specified when locking the primary.
  4566.  *)
  4567.   DDLOCK_NOSYSLOCK                        = $00000800;
  4568.   {$EXTERNALSYM DDLOCK_NOSYSLOCK}
  4569.  
  4570. (*
  4571.  * Used only with Direct3D Vertex Buffer Locks. Indicates that no vertices
  4572.  * that were referred to in Draw*PrimtiveVB calls since the start of the
  4573.  * frame (or the last lock without this flag) will be modified during the
  4574.  * lock. This can be useful when one is only appending data to the vertex
  4575.  * buffer
  4576.  *)
  4577.   DDLOCK_NOOVERWRITE                      = $00001000;
  4578.   {$EXTERNALSYM DDLOCK_NOOVERWRITE}
  4579.  
  4580. (*
  4581.  * Indicates that no assumptions will be made about the contents of the
  4582.  * surface or vertex buffer during this lock.
  4583.  * This enables two things:
  4584.  * -    Direct3D or the driver may provide an alternative memory
  4585.  *      area as the vertex buffer. This is useful when one plans to clear the
  4586.  *      contents of the vertex buffer and fill in new data.
  4587.  * -    Drivers sometimes store surface data in a re-ordered format.
  4588.  *      When the application locks the surface, the driver is forced to un-re-order
  4589.  *      the surface data before allowing the application to see the surface contents.
  4590.  *      This flag is a hint to the driver that it can skip the un-re-ordering process
  4591.  *      since the application plans to overwrite every single pixel in the surface
  4592.  *      or locked rectangle (and so erase any un-re-ordered pixels anyway).
  4593.  *      Applications should always set this flag when they intend to overwrite the entire
  4594.  *      surface or locked rectangle.
  4595.  *)
  4596.   DDLOCK_DISCARDCONTENTS                  = $00002000;
  4597.   {$EXTERNALSYM DDLOCK_DISCARDCONTENTS}
  4598.  (*
  4599.   * DDLOCK_OKTOSWAP is an older, less informative name for DDLOCK_DISCARDCONTENTS
  4600.   *)
  4601.   DDLOCK_OKTOSWAP                         = $00002000;
  4602.   {$EXTERNALSYM DDLOCK_OKTOSWAP}
  4603.  
  4604. (*
  4605.  * On IDirectDrawSurface7 and higher interfaces, the default is DDLOCK_WAIT. If you wish
  4606.  * to override the default and use time when the accelerator is busy (as denoted by
  4607.  * the DDERR_WASSTILLDRAWING return code) then use DDLOCK_DONOTWAIT.
  4608.  *)
  4609.   DDLOCK_DONOTWAIT                        = $00004000;
  4610.   {$EXTERNALSYM DDLOCK_DONOTWAIT}
  4611.  
  4612. (*
  4613.  * This indicates volume texture lock with front and back specified.
  4614.  *)
  4615.   DDLOCK_HASVOLUMETEXTUREBOXRECT          = $00008000;
  4616.   {$EXTERNALSYM DDLOCK_HASVOLUMETEXTUREBOXRECT}
  4617.  
  4618. (*
  4619.  * This indicates that the driver should not update dirty rect information for this lock.
  4620.  *)
  4621.   DDLOCK_NODIRTYUPDATE                    = $00010000;
  4622.   {$EXTERNALSYM DDLOCK_NODIRTYUPDATE}
  4623.  
  4624.  
  4625. (****************************************************************************
  4626.  *
  4627.  * DIRECTDRAWSURFACE PAGELOCK FLAGS
  4628.  *
  4629.  ****************************************************************************)
  4630.  
  4631. (*
  4632.  * No flags defined at present
  4633.  *)
  4634.  
  4635.  
  4636. (****************************************************************************
  4637.  *
  4638.  * DIRECTDRAWSURFACE PAGEUNLOCK FLAGS
  4639.  *
  4640.  ****************************************************************************)
  4641.  
  4642. (*
  4643.  * No flags defined at present
  4644.  *)
  4645.  
  4646.  
  4647. (****************************************************************************
  4648.  *
  4649.  * DIRECTDRAWSURFACE BLT FX FLAGS
  4650.  *
  4651.  ****************************************************************************)
  4652.  
  4653. (*
  4654.  * If stretching, use arithmetic stretching along the Y axis for this blt.
  4655.  *)
  4656.   DDBLTFX_ARITHSTRETCHY                   = $00000001;
  4657.   {$EXTERNALSYM DDBLTFX_ARITHSTRETCHY}
  4658.  
  4659. (*
  4660.  * Do this blt mirroring the surface left to right.  Spin the
  4661.  * surface around its y-axis.
  4662.  *)
  4663.   DDBLTFX_MIRRORLEFTRIGHT                 = $00000002;
  4664.   {$EXTERNALSYM DDBLTFX_MIRRORLEFTRIGHT}
  4665.  
  4666. (*
  4667.  * Do this blt mirroring the surface up and down.  Spin the surface
  4668.  * around its x-axis.
  4669.  *)
  4670.   DDBLTFX_MIRRORUPDOWN                    = $00000004;
  4671.   {$EXTERNALSYM DDBLTFX_MIRRORUPDOWN}
  4672.  
  4673. (*
  4674.  * Schedule this blt to avoid tearing.
  4675.  *)
  4676.   DDBLTFX_NOTEARING                       = $00000008;
  4677.   {$EXTERNALSYM DDBLTFX_NOTEARING}
  4678.  
  4679. (*
  4680.  * Do this blt rotating the surface one hundred and eighty degrees.
  4681.  *)
  4682.   DDBLTFX_ROTATE180                       = $00000010;
  4683.   {$EXTERNALSYM DDBLTFX_ROTATE180}
  4684.  
  4685. (*
  4686.  * Do this blt rotating the surface two hundred and seventy degrees.
  4687.  *)
  4688.   DDBLTFX_ROTATE270                       = $00000020;
  4689.   {$EXTERNALSYM DDBLTFX_ROTATE270}
  4690.  
  4691. (*
  4692.  * Do this blt rotating the surface ninety degrees.
  4693.  *)
  4694.   DDBLTFX_ROTATE90                        = $00000040;
  4695.   {$EXTERNALSYM DDBLTFX_ROTATE90}
  4696.  
  4697. (*
  4698.  * Do this z blt using dwZBufferLow and dwZBufferHigh as  range values
  4699.  * specified to limit the bits copied from the source surface.
  4700.  *)
  4701.   DDBLTFX_ZBUFFERRANGE                    = $00000080;
  4702.   {$EXTERNALSYM DDBLTFX_ZBUFFERRANGE}
  4703.  
  4704. (*
  4705.  * Do this z blt adding the dwZBufferBaseDest to each of the sources z values
  4706.  * before comparing it with the desting z values.
  4707.  *)
  4708.   DDBLTFX_ZBUFFERBASEDEST                 = $00000100;
  4709.   {$EXTERNALSYM DDBLTFX_ZBUFFERBASEDEST}
  4710.  
  4711. (****************************************************************************
  4712.  *
  4713.  * DIRECTDRAWSURFACE OVERLAY FX FLAGS
  4714.  *
  4715.  ****************************************************************************)
  4716.  
  4717. (*
  4718.  * If stretching, use arithmetic stretching along the Y axis for this overlay.
  4719.  *)
  4720.   DDOVERFX_ARITHSTRETCHY                  = $00000001;
  4721.   {$EXTERNALSYM DDOVERFX_ARITHSTRETCHY}
  4722.  
  4723. (*
  4724.  * Mirror the overlay across the vertical axis
  4725.  *)
  4726.   DDOVERFX_MIRRORLEFTRIGHT                = $00000002;
  4727.   {$EXTERNALSYM DDOVERFX_MIRRORLEFTRIGHT}
  4728.  
  4729. (*
  4730.  * Mirror the overlay across the horizontal axis
  4731.  *)
  4732.   DDOVERFX_MIRRORUPDOWN                   = $00000004;
  4733.   {$EXTERNALSYM DDOVERFX_MIRRORUPDOWN}
  4734.  
  4735. (*
  4736.  * Deinterlace the overlay, if possible
  4737.  *)
  4738.   DDOVERFX_DEINTERLACE                    = $00000008;
  4739.   {$EXTERNALSYM DDOVERFX_DEINTERLACE}
  4740.  
  4741.  
  4742. (****************************************************************************
  4743.  *
  4744.  * DIRECTDRAW WAITFORVERTICALBLANK FLAGS
  4745.  *
  4746.  ****************************************************************************)
  4747.  
  4748. (*
  4749.  * return when the vertical blank interval begins
  4750.  *)
  4751.   DDWAITVB_BLOCKBEGIN                     = $00000001;
  4752.   {$EXTERNALSYM DDWAITVB_BLOCKBEGIN}
  4753.  
  4754. (*
  4755.  * set up an event to trigger when the vertical blank begins
  4756.  *)
  4757.   DDWAITVB_BLOCKBEGINEVENT                = $00000002;
  4758.   {$EXTERNALSYM DDWAITVB_BLOCKBEGINEVENT}
  4759.  
  4760. (*
  4761.  * return when the vertical blank interval ends and display begins
  4762.  *)
  4763.   DDWAITVB_BLOCKEND                       = $00000004;
  4764.   {$EXTERNALSYM DDWAITVB_BLOCKEND}
  4765.  
  4766. (****************************************************************************
  4767.  *
  4768.  * DIRECTDRAW GETFLIPSTATUS FLAGS
  4769.  *
  4770.  ****************************************************************************)
  4771.  
  4772. (*
  4773.  * is it OK to flip now?
  4774.  *)
  4775.   DDGFS_CANFLIP                   = $00000001;
  4776.   {$EXTERNALSYM DDGFS_CANFLIP}
  4777.  
  4778. (*
  4779.  * is the last flip finished?
  4780.  *)
  4781.   DDGFS_ISFLIPDONE                = $00000002;
  4782.   {$EXTERNALSYM DDGFS_ISFLIPDONE}
  4783.  
  4784. (****************************************************************************
  4785.  *
  4786.  * DIRECTDRAW GETBLTSTATUS FLAGS
  4787.  *
  4788.  ****************************************************************************)
  4789.  
  4790. (*
  4791.  * is it OK to blt now?
  4792.  *)
  4793.   DDGBS_CANBLT                    = $00000001;
  4794.   {$EXTERNALSYM DDGBS_CANBLT}
  4795.  
  4796. (*
  4797.  * is the blt to the surface finished?
  4798.  *)
  4799.   DDGBS_ISBLTDONE                 = $00000002;
  4800.   {$EXTERNALSYM DDGBS_ISBLTDONE}
  4801.  
  4802.  
  4803. (****************************************************************************
  4804.  *
  4805.  * DIRECTDRAW ENUMOVERLAYZORDER FLAGS
  4806.  *
  4807.  ****************************************************************************)
  4808.  
  4809. (*
  4810.  * Enumerate overlays back to front.
  4811.  *)
  4812.   DDENUMOVERLAYZ_BACKTOFRONT      = $00000000;
  4813.   {$EXTERNALSYM DDENUMOVERLAYZ_BACKTOFRONT}
  4814.  
  4815. (*
  4816.  * Enumerate overlays front to back
  4817.  *)
  4818.   DDENUMOVERLAYZ_FRONTTOBACK      = $00000001;
  4819.   {$EXTERNALSYM DDENUMOVERLAYZ_FRONTTOBACK}
  4820.  
  4821. (****************************************************************************
  4822.  *
  4823.  * DIRECTDRAW UPDATEOVERLAYZORDER FLAGS
  4824.  *
  4825.  ****************************************************************************)
  4826.  
  4827. (*
  4828.  * Send overlay to front
  4829.  *)
  4830.   DDOVERZ_SENDTOFRONT             = $00000000;
  4831.   {$EXTERNALSYM DDOVERZ_SENDTOFRONT}
  4832.  
  4833. (*
  4834.  * Send overlay to back
  4835.  *)
  4836.   DDOVERZ_SENDTOBACK              = $00000001;
  4837.   {$EXTERNALSYM DDOVERZ_SENDTOBACK}
  4838.  
  4839. (*
  4840.  * Move Overlay forward
  4841.  *)
  4842.   DDOVERZ_MOVEFORWARD             = $00000002;
  4843.   {$EXTERNALSYM DDOVERZ_MOVEFORWARD}
  4844.  
  4845. (*
  4846.  * Move Overlay backward
  4847.  *)
  4848.   DDOVERZ_MOVEBACKWARD            = $00000003;
  4849.   {$EXTERNALSYM DDOVERZ_MOVEBACKWARD}
  4850.  
  4851. (*
  4852.  * Move Overlay in front of relative surface
  4853.  *)
  4854.   DDOVERZ_INSERTINFRONTOF         = $00000004;
  4855.   {$EXTERNALSYM DDOVERZ_INSERTINFRONTOF}
  4856.  
  4857. (*
  4858.  * Move Overlay in back of relative surface
  4859.  *)
  4860.   DDOVERZ_INSERTINBACKOF          = $00000005;
  4861.   {$EXTERNALSYM DDOVERZ_INSERTINBACKOF}
  4862.  
  4863.  
  4864. (****************************************************************************
  4865.  *
  4866.  * DIRECTDRAW SETGAMMARAMP FLAGS
  4867.  *
  4868.  ****************************************************************************)
  4869.  
  4870. (*
  4871.  * Request calibrator to adjust the gamma ramp according to the physical
  4872.  * properties of the display so that the result should appear identical
  4873.  * on all systems.
  4874.  *)
  4875.   DDSGR_CALIBRATE                        = $00000001;
  4876.   {$EXTERNALSYM DDSGR_CALIBRATE}
  4877.  
  4878.  
  4879. (****************************************************************************
  4880.  *
  4881.  * DIRECTDRAW STARTMODETEST FLAGS
  4882.  *
  4883.  ****************************************************************************)
  4884.  
  4885. (*
  4886.  * Indicates that the mode being tested has passed
  4887.  *)
  4888.  DDSMT_ISTESTREQUIRED                   = $00000001;
  4889.  {$EXTERNALSYM DDSMT_ISTESTREQUIRED}
  4890.  
  4891.  
  4892. (****************************************************************************
  4893.  *
  4894.  * DIRECTDRAW EVALUATEMODE FLAGS
  4895.  *
  4896.  ****************************************************************************)
  4897.  
  4898. (*
  4899.  * Indicates that the mode being tested has passed
  4900.  *)
  4901.  DDEM_MODEPASSED                        = $00000001;
  4902.  {$EXTERNALSYM DDEM_MODEPASSED}
  4903.  
  4904. (*
  4905.  * Indicates that the mode being tested has failed
  4906.  *)
  4907.  DDEM_MODEFAILED                        = $00000002;
  4908.  {$EXTERNALSYM DDEM_MODEFAILED}
  4909.  
  4910.  
  4911. (*===========================================================================
  4912.  *
  4913.  *
  4914.  * DIRECTDRAW RETURN CODES
  4915.  *
  4916.  * The return values from DirectDraw Commands and Surface that return an HRESULT
  4917.  * are codes from DirectDraw concerning the results of the action
  4918.  * requested by DirectDraw.
  4919.  *
  4920.  *==========================================================================*)
  4921.  
  4922. (*
  4923.  * Status is OK
  4924.  *
  4925.  * Issued by: DirectDraw Commands and all callbacks
  4926.  *)
  4927.   DD_OK                                   = 0;
  4928.   {$EXTERNALSYM DD_OK}
  4929.   DD_FALSE                                = S_FALSE;
  4930.   {$EXTERNALSYM DD_FALSE}
  4931.  
  4932. (****************************************************************************
  4933.  *
  4934.  * DIRECTDRAW ENUMCALLBACK RETURN VALUES
  4935.  *
  4936.  * EnumCallback returns are used to control the flow of the DIRECTDRAW and
  4937.  * DIRECTDRAWSURFACE object enumerations.   They can only be returned by
  4938.  * enumeration callback routines.
  4939.  *
  4940.  ****************************************************************************)
  4941.  
  4942. (*
  4943.  * stop the enumeration
  4944.  *)
  4945.   DDENUMRET_CANCEL                        = 0;
  4946.   {$EXTERNALSYM DDENUMRET_CANCEL}
  4947.  
  4948. (*
  4949.  * continue the enumeration
  4950.  *)
  4951.   DDENUMRET_OK                            = 1;
  4952.   {$EXTERNALSYM DDENUMRET_OK}
  4953.  
  4954. (****************************************************************************
  4955.  *
  4956.  * DIRECTDRAW ERRORS
  4957.  *
  4958.  * Errors are represented by negative values and cannot be combined.
  4959.  *
  4960.  ****************************************************************************)
  4961.  
  4962. const
  4963.   _FACDD = $876;
  4964.   {$EXTERNALSYM _FACDD}
  4965.   _MAKE_DDHRESULT = HResult(1 shl 31) or HResult(_FACDD shl 16);
  4966.  
  4967. //#define MAKE_DDHRESULT( code )  MAKE_HRESULT( 1, _FACDD, code )
  4968. function MAKE_DDHRESULT(Code: DWORD): HResult;
  4969. {$EXTERNALSYM MAKE_DDHRESULT}
  4970.  
  4971. const
  4972. (*
  4973.  * This object is already initialized
  4974.  *)
  4975.   DDERR_ALREADYINITIALIZED                = HResult(_MAKE_DDHRESULT + 5);
  4976.   {$EXTERNALSYM DDERR_ALREADYINITIALIZED}
  4977.  
  4978. (*
  4979.  * This surface can not be attached to the requested surface.
  4980.  *)
  4981.   DDERR_CANNOTATTACHSURFACE               = HResult(_MAKE_DDHRESULT + 10);
  4982.   {$EXTERNALSYM DDERR_CANNOTATTACHSURFACE}
  4983.  
  4984. (*
  4985.  * This surface can not be detached from the requested surface.
  4986.  *)
  4987.   DDERR_CANNOTDETACHSURFACE               = HResult(_MAKE_DDHRESULT + 20);
  4988.   {$EXTERNALSYM DDERR_CANNOTDETACHSURFACE}
  4989.  
  4990. (*
  4991.  * Support is currently not available.
  4992.  *)
  4993.   DDERR_CURRENTLYNOTAVAIL                 = HResult(_MAKE_DDHRESULT + 40);
  4994.   {$EXTERNALSYM DDERR_CURRENTLYNOTAVAIL}
  4995.  
  4996. (*
  4997.  * An exception was encountered while performing the requested operation
  4998.  *)
  4999.   DDERR_EXCEPTION                         = HResult(_MAKE_DDHRESULT + 55);
  5000.   {$EXTERNALSYM DDERR_EXCEPTION}
  5001.  
  5002. (*
  5003.  * Generic failure.
  5004.  *)
  5005.   DDERR_GENERIC                           = E_FAIL;
  5006.   {$EXTERNALSYM DDERR_GENERIC}
  5007.  
  5008. (*
  5009.  * Height of rectangle provided is not a multiple of reqd alignment
  5010.  *)
  5011.   DDERR_HEIGHTALIGN                       = HResult(_MAKE_DDHRESULT + 90);
  5012.   {$EXTERNALSYM DDERR_HEIGHTALIGN}
  5013.  
  5014. (*
  5015.  * Unable to match primary surface creation request with existing
  5016.  * primary surface.
  5017.  *)
  5018.   DDERR_INCOMPATIBLEPRIMARY               = HResult(_MAKE_DDHRESULT + 95);
  5019.   {$EXTERNALSYM DDERR_INCOMPATIBLEPRIMARY}
  5020.  
  5021. (*
  5022.  * One or more of the caps bits passed to the callback are incorrect.
  5023.  *)
  5024.   DDERR_INVALIDCAPS                       = HResult(_MAKE_DDHRESULT + 100);
  5025.   {$EXTERNALSYM DDERR_INVALIDCAPS}
  5026.  
  5027. (*
  5028.  * DirectDraw does not support provided Cliplist.
  5029.  *)
  5030.   DDERR_INVALIDCLIPLIST                   = HResult(_MAKE_DDHRESULT + 110);
  5031.   {$EXTERNALSYM DDERR_INVALIDCLIPLIST}
  5032.  
  5033. (*
  5034.  * DirectDraw does not support the requested mode
  5035.  *)
  5036.   DDERR_INVALIDMODE                       = HResult(_MAKE_DDHRESULT + 120);
  5037.   {$EXTERNALSYM DDERR_INVALIDMODE}
  5038.  
  5039. (*
  5040.  * DirectDraw received a pointer that was an invalid DIRECTDRAW object.
  5041.  *)
  5042.   DDERR_INVALIDOBJECT                     = HResult(_MAKE_DDHRESULT + 130);
  5043.   {$EXTERNALSYM DDERR_INVALIDOBJECT}
  5044.  
  5045. (*
  5046.  * One or more of the parameters passed to the callback function are
  5047.  * incorrect.
  5048.  *)
  5049.   DDERR_INVALIDPARAMS                     = E_INVALIDARG;
  5050.   {$EXTERNALSYM DDERR_INVALIDPARAMS}
  5051.  
  5052. (*
  5053.  * pixel format was invalid as specified
  5054.  *)
  5055.   DDERR_INVALIDPIXELFORMAT                = HResult(_MAKE_DDHRESULT + 145);
  5056.   {$EXTERNALSYM DDERR_INVALIDPIXELFORMAT}
  5057.  
  5058. (*
  5059.  * Rectangle provided was invalid.
  5060.  *)
  5061.   DDERR_INVALIDRECT                       = HResult(_MAKE_DDHRESULT + 150);
  5062.   {$EXTERNALSYM DDERR_INVALIDRECT}
  5063.  
  5064. (*
  5065.  * Operation could not be carried out because one or more surfaces are locked
  5066.  *)
  5067.   DDERR_LOCKEDSURFACES                    = HResult(_MAKE_DDHRESULT + 160);
  5068.   {$EXTERNALSYM DDERR_LOCKEDSURFACES}
  5069.  
  5070. (*
  5071.  * There is no 3D present.
  5072.  *)
  5073.   DDERR_NO3D                              = HResult(_MAKE_DDHRESULT + 170);
  5074.   {$EXTERNALSYM DDERR_NO3D}
  5075.  
  5076. (*
  5077.  * Operation could not be carried out because there is no alpha accleration
  5078.  * hardware present or available.
  5079.  *)
  5080.   DDERR_NOALPHAHW                         = HResult(_MAKE_DDHRESULT + 180);
  5081.   {$EXTERNALSYM DDERR_NOALPHAHW}
  5082.  
  5083. (*
  5084.  * Operation could not be carried out because there is no stereo
  5085.  * hardware present or available.
  5086.  *)
  5087.   DDERR_NOSTEREOHARDWARE                  = HResult(_MAKE_DDHRESULT + 181);
  5088.   {$EXTERNALSYM DDERR_NOSTEREOHARDWARE}
  5089.  
  5090. (*
  5091.  * Operation could not be carried out because there is no hardware
  5092.  * present which supports stereo surfaces
  5093.  *)
  5094.   DDERR_NOSURFACELEFT                     = HResult(_MAKE_DDHRESULT + 182);
  5095.   {$EXTERNALSYM DDERR_NOSURFACELEFT}
  5096.  
  5097.  
  5098.  
  5099. (*
  5100.  * no clip list available
  5101.  *)
  5102.   DDERR_NOCLIPLIST                        = HResult(_MAKE_DDHRESULT + 205);
  5103.   {$EXTERNALSYM DDERR_NOCLIPLIST}
  5104.  
  5105. (*
  5106.  * Operation could not be carried out because there is no color conversion
  5107.  * hardware present or available.
  5108.  *)
  5109.   DDERR_NOCOLORCONVHW                     = HResult(_MAKE_DDHRESULT + 210);
  5110.   {$EXTERNALSYM DDERR_NOCOLORCONVHW}
  5111.  
  5112. (*
  5113.  * Create function called without DirectDraw object method SetCooperativeLevel
  5114.  * being called.
  5115.  *)
  5116.   DDERR_NOCOOPERATIVELEVELSET             = HResult(_MAKE_DDHRESULT + 212);
  5117.   {$EXTERNALSYM DDERR_NOCOOPERATIVELEVELSET}
  5118.  
  5119. (*
  5120.  * Surface doesn't currently have a color key
  5121.  *)
  5122.   DDERR_NOCOLORKEY                        = HResult(_MAKE_DDHRESULT + 215);
  5123.   {$EXTERNALSYM DDERR_NOCOLORKEY}
  5124.  
  5125. (*
  5126.  * Operation could not be carried out because there is no hardware support
  5127.  * of the dest color key.
  5128.  *)
  5129.   DDERR_NOCOLORKEYHW                      = HResult(_MAKE_DDHRESULT + 220);
  5130.   {$EXTERNALSYM DDERR_NOCOLORKEYHW}
  5131.  
  5132. (*
  5133.  * No DirectDraw support possible with current display driver
  5134.  *)
  5135.   DDERR_NODIRECTDRAWSUPPORT               = HResult(_MAKE_DDHRESULT + 222);
  5136.   {$EXTERNALSYM DDERR_NODIRECTDRAWSUPPORT}
  5137.  
  5138. (*
  5139.  * Operation requires the application to have exclusive mode but the
  5140.  * application does not have exclusive mode.
  5141.  *)
  5142.   DDERR_NOEXCLUSIVEMODE                   = HResult(_MAKE_DDHRESULT + 225);
  5143.   {$EXTERNALSYM DDERR_NOEXCLUSIVEMODE}
  5144.  
  5145. (*
  5146.  * Flipping visible surfaces is not supported.
  5147.  *)
  5148.   DDERR_NOFLIPHW                          = HResult(_MAKE_DDHRESULT + 230);
  5149.   {$EXTERNALSYM DDERR_NOFLIPHW}
  5150.  
  5151. (*
  5152.  * There is no GDI present.
  5153.  *)
  5154.   DDERR_NOGDI                             = HResult(_MAKE_DDHRESULT + 240);
  5155.   {$EXTERNALSYM DDERR_NOGDI}
  5156.  
  5157. (*
  5158.  * Operation could not be carried out because there is no hardware present
  5159.  * or available.
  5160.  *)
  5161.   DDERR_NOMIRRORHW                        = HResult(_MAKE_DDHRESULT + 250);
  5162.   {$EXTERNALSYM DDERR_NOMIRRORHW}
  5163.  
  5164. (*
  5165.  * Requested item was not found
  5166.  *)
  5167.   DDERR_NOTFOUND                          = HResult(_MAKE_DDHRESULT + 255);
  5168.   {$EXTERNALSYM DDERR_NOTFOUND}
  5169.  
  5170. (*
  5171.  * Operation could not be carried out because there is no overlay hardware
  5172.  * present or available.
  5173.  *)
  5174.   DDERR_NOOVERLAYHW                       = HResult(_MAKE_DDHRESULT + 260);
  5175.   {$EXTERNALSYM DDERR_NOOVERLAYHW}
  5176.  
  5177. (*
  5178.  * Operation could not be carried out because the source and destination
  5179.  * rectangles are on the same surface and overlap each other.
  5180.  *)
  5181.   DDERR_OVERLAPPINGRECTS                  = HResult(_MAKE_DDHRESULT + 270);
  5182.   {$EXTERNALSYM DDERR_OVERLAPPINGRECTS}
  5183.  
  5184. (*
  5185.  * Operation could not be carried out because there is no appropriate raster
  5186.  * op hardware present or available.
  5187.  *)
  5188.   DDERR_NORASTEROPHW                      = HResult(_MAKE_DDHRESULT + 280);
  5189.   {$EXTERNALSYM DDERR_NORASTEROPHW}
  5190.  
  5191. (*
  5192.  * Operation could not be carried out because there is no rotation hardware
  5193.  * present or available.
  5194.  *)
  5195.   DDERR_NOROTATIONHW                      = HResult(_MAKE_DDHRESULT + 290);
  5196.   {$EXTERNALSYM DDERR_NOROTATIONHW}
  5197.  
  5198. (*
  5199.  * Operation could not be carried out because there is no hardware support
  5200.  * for stretching
  5201.  *)
  5202.   DDERR_NOSTRETCHHW                       = HResult(_MAKE_DDHRESULT + 310);
  5203.   {$EXTERNALSYM DDERR_NOSTRETCHHW}
  5204.  
  5205. (*
  5206.  * DirectDrawSurface is not in 4 bit color palette and the requested operation
  5207.  * requires 4 bit color palette.
  5208.  *)
  5209.   DDERR_NOT4BITCOLOR                      = HResult(_MAKE_DDHRESULT + 316);
  5210.   {$EXTERNALSYM DDERR_NOT4BITCOLOR}
  5211.  
  5212. (*
  5213.  * DirectDrawSurface is not in 4 bit color index palette and the requested
  5214.  * operation requires 4 bit color index palette.
  5215.  *)
  5216.   DDERR_NOT4BITCOLORINDEX                 = HResult(_MAKE_DDHRESULT + 317);
  5217.   {$EXTERNALSYM DDERR_NOT4BITCOLORINDEX}
  5218.  
  5219. (*
  5220.  * DirectDraw Surface is not in 8 bit color mode and the requested operation
  5221.  * requires 8 bit color.
  5222.  *)
  5223.   DDERR_NOT8BITCOLOR                      = HResult(_MAKE_DDHRESULT + 320);
  5224.   {$EXTERNALSYM DDERR_NOT8BITCOLOR}
  5225.  
  5226. (*
  5227.  * Operation could not be carried out because there is no texture mapping
  5228.  * hardware present or available.
  5229.  *)
  5230.   DDERR_NOTEXTUREHW                       = HResult(_MAKE_DDHRESULT + 330);
  5231.   {$EXTERNALSYM DDERR_NOTEXTUREHW}
  5232.  
  5233. (*
  5234.  * Operation could not be carried out because there is no hardware support
  5235.  * for vertical blank synchronized operations.
  5236.  *)
  5237.   DDERR_NOVSYNCHW                         = HResult(_MAKE_DDHRESULT + 335);
  5238.   {$EXTERNALSYM DDERR_NOVSYNCHW}
  5239.  
  5240. (*
  5241.  * Operation could not be carried out because there is no hardware support
  5242.  * for zbuffer blting.
  5243.  *)
  5244.   DDERR_NOZBUFFERHW                       = HResult(_MAKE_DDHRESULT + 340);
  5245.   {$EXTERNALSYM DDERR_NOZBUFFERHW}
  5246.  
  5247. (*
  5248.  * Overlay surfaces could not be z layered based on their BltOrder because
  5249.  * the hardware does not support z layering of overlays.
  5250.  *)
  5251.   DDERR_NOZOVERLAYHW                      = HResult(_MAKE_DDHRESULT + 350);
  5252.   {$EXTERNALSYM DDERR_NOZOVERLAYHW}
  5253.  
  5254. (*
  5255.  * The hardware needed for the requested operation has already been
  5256.  * allocated.
  5257.  *)
  5258.   DDERR_OUTOFCAPS                         = HResult(_MAKE_DDHRESULT + 360);
  5259.   {$EXTERNALSYM DDERR_OUTOFCAPS}
  5260.  
  5261. (*
  5262.  * DirectDraw does not have enough memory to perform the operation.
  5263.  *)
  5264.   DDERR_OUTOFMEMORY                       = E_OUTOFMEMORY;
  5265.   {$EXTERNALSYM DDERR_OUTOFMEMORY}
  5266.  
  5267. (*
  5268.  * DirectDraw does not have enough memory to perform the operation.
  5269.  *)
  5270.   DDERR_OUTOFVIDEOMEMORY                  = HResult(_MAKE_DDHRESULT + 380);
  5271.   {$EXTERNALSYM DDERR_OUTOFVIDEOMEMORY}
  5272.  
  5273. (*
  5274.  * hardware does not support clipped overlays
  5275.  *)
  5276.   DDERR_OVERLAYCANTCLIP                   = HResult(_MAKE_DDHRESULT + 382);
  5277.   {$EXTERNALSYM DDERR_OVERLAYCANTCLIP}
  5278.  
  5279. (*
  5280.  * Can only have ony color key active at one time for overlays
  5281.  *)
  5282.   DDERR_OVERLAYCOLORKEYONLYONEACTIVE      = HResult(_MAKE_DDHRESULT + 384);
  5283.   {$EXTERNALSYM DDERR_OVERLAYCOLORKEYONLYONEACTIVE}
  5284.  
  5285. (*
  5286.  * Access to this palette is being refused because the palette is already
  5287.  * locked by another thread.
  5288.  *)
  5289.   DDERR_PALETTEBUSY                       = HResult(_MAKE_DDHRESULT + 387);
  5290.   {$EXTERNALSYM DDERR_PALETTEBUSY}
  5291.  
  5292. (*
  5293.  * No src color key specified for this operation.
  5294.  *)
  5295.   DDERR_COLORKEYNOTSET                    = HResult(_MAKE_DDHRESULT + 400);
  5296.   {$EXTERNALSYM DDERR_COLORKEYNOTSET}
  5297.  
  5298. (*
  5299.  * This surface is already attached to the surface it is being attached to.
  5300.  *)
  5301.   DDERR_SURFACEALREADYATTACHED            = HResult(_MAKE_DDHRESULT + 410);
  5302.   {$EXTERNALSYM DDERR_SURFACEALREADYATTACHED}
  5303.  
  5304. (*
  5305.  * This surface is already a dependency of the surface it is being made a
  5306.  * dependency of.
  5307.  *)
  5308.   DDERR_SURFACEALREADYDEPENDENT           = HResult(_MAKE_DDHRESULT + 420);
  5309.   {$EXTERNALSYM DDERR_SURFACEALREADYDEPENDENT}
  5310.  
  5311. (*
  5312.  * Access to this surface is being refused because the surface is already
  5313.  * locked by another thread.
  5314.  *)
  5315.   DDERR_SURFACEBUSY                       = HResult(_MAKE_DDHRESULT + 430);
  5316.   {$EXTERNALSYM DDERR_SURFACEBUSY}
  5317.  
  5318. (*
  5319.  * Access to this surface is being refused because no driver exists
  5320.  * which can supply a pointer to the surface.
  5321.  * This is most likely to happen when attempting to lock the primary
  5322.  * surface when no DCI provider is present.
  5323.  * Will also happen on attempts to lock an optimized surface.
  5324.  *)
  5325.   DDERR_CANTLOCKSURFACE                   = HResult(_MAKE_DDHRESULT + 435);
  5326.   {$EXTERNALSYM DDERR_CANTLOCKSURFACE}
  5327.  
  5328. (*
  5329.  * Access to Surface refused because Surface is obscured.
  5330.  *)
  5331.   DDERR_SURFACEISOBSCURED                 = HResult(_MAKE_DDHRESULT + 440);
  5332.   {$EXTERNALSYM DDERR_SURFACEISOBSCURED}
  5333.  
  5334. (*
  5335.  * Access to this surface is being refused because the surface is gone.
  5336.  * The DIRECTDRAWSURFACE object representing this surface should
  5337.  * have Restore called on it.
  5338.  *)
  5339.   DDERR_SURFACELOST                       = HResult(_MAKE_DDHRESULT + 450);
  5340.   {$EXTERNALSYM DDERR_SURFACELOST}
  5341.  
  5342. (*
  5343.  * The requested surface is not attached.
  5344.  *)
  5345.   DDERR_SURFACENOTATTACHED                = HResult(_MAKE_DDHRESULT + 460);
  5346.   {$EXTERNALSYM DDERR_SURFACENOTATTACHED}
  5347.  
  5348. (*
  5349.  * Height requested by DirectDraw is too large.
  5350.  *)
  5351.   DDERR_TOOBIGHEIGHT                      = HResult(_MAKE_DDHRESULT + 470);
  5352.   {$EXTERNALSYM DDERR_TOOBIGHEIGHT}
  5353.  
  5354. (*
  5355.  * Size requested by DirectDraw is too large --  The individual height and
  5356.  * width are OK.
  5357.  *)
  5358.   DDERR_TOOBIGSIZE                        = HResult(_MAKE_DDHRESULT + 480);
  5359.   {$EXTERNALSYM DDERR_TOOBIGSIZE}
  5360.  
  5361. (*
  5362.  * Width requested by DirectDraw is too large.
  5363.  *)
  5364.   DDERR_TOOBIGWIDTH                       = HResult(_MAKE_DDHRESULT + 490);
  5365.   {$EXTERNALSYM DDERR_TOOBIGWIDTH}
  5366.  
  5367. (*
  5368.  * Action not supported.
  5369.  *)
  5370.   DDERR_UNSUPPORTED                       = E_NOTIMPL;
  5371.   {$EXTERNALSYM DDERR_UNSUPPORTED}
  5372.  
  5373. (*
  5374.  * FOURCC format requested is unsupported by DirectDraw
  5375.  *)
  5376.   DDERR_UNSUPPORTEDFORMAT                 = HResult(_MAKE_DDHRESULT + 510);
  5377.   {$EXTERNALSYM DDERR_UNSUPPORTEDFORMAT}
  5378.  
  5379. (*
  5380.  * Bitmask in the pixel format requested is unsupported by DirectDraw
  5381.  *)
  5382.   DDERR_UNSUPPORTEDMASK                   = HResult(_MAKE_DDHRESULT + 520);
  5383.   {$EXTERNALSYM DDERR_UNSUPPORTEDMASK}
  5384.  
  5385. (*
  5386.  * The specified stream contains invalid data
  5387.  *)
  5388.   DDERR_INVALIDSTREAM                     = HResult(_MAKE_DDHRESULT + 521);
  5389.   {$EXTERNALSYM DDERR_INVALIDSTREAM}
  5390.  
  5391. (*
  5392.  * vertical blank is in progress
  5393.  *)
  5394.   DDERR_VERTICALBLANKINPROGRESS           = HResult(_MAKE_DDHRESULT + 537);
  5395.   {$EXTERNALSYM DDERR_VERTICALBLANKINPROGRESS}
  5396.  
  5397. (*
  5398.  * Informs DirectDraw that the previous Blt which is transfering information
  5399.  * to or from this Surface is incomplete.
  5400.  *)
  5401.   DDERR_WASSTILLDRAWING                   = HResult(_MAKE_DDHRESULT + 540);
  5402.   {$EXTERNALSYM DDERR_WASSTILLDRAWING}
  5403.  
  5404.  
  5405. (*
  5406.  * The specified surface type requires specification of the COMPLEX flag
  5407.  *)
  5408.   DDERR_DDSCAPSCOMPLEXREQUIRED            = HResult(_MAKE_DDHRESULT + 542);
  5409.   {$EXTERNALSYM DDERR_DDSCAPSCOMPLEXREQUIRED}
  5410.  
  5411.  
  5412. (*
  5413.  * Rectangle provided was not horizontally aligned on reqd. boundary
  5414.  *)
  5415.   DDERR_XALIGN                            = HResult(_MAKE_DDHRESULT + 560);
  5416.   {$EXTERNALSYM DDERR_XALIGN}
  5417.  
  5418. (*
  5419.  * The GUID passed to DirectDrawCreate is not a valid DirectDraw driver
  5420.  * identifier.
  5421.  *)
  5422.   DDERR_INVALIDDIRECTDRAWGUID             = HResult(_MAKE_DDHRESULT + 561);
  5423.   {$EXTERNALSYM DDERR_INVALIDDIRECTDRAWGUID}
  5424.  
  5425. (*
  5426.  * A DirectDraw object representing this driver has already been created
  5427.  * for this process.
  5428.  *)
  5429.   DDERR_DIRECTDRAWALREADYCREATED          = HResult(_MAKE_DDHRESULT + 562);
  5430.   {$EXTERNALSYM DDERR_DIRECTDRAWALREADYCREATED}
  5431.  
  5432. (*
  5433.  * A hardware only DirectDraw object creation was attempted but the driver
  5434.  * did not support any hardware.
  5435.  *)
  5436.   DDERR_NODIRECTDRAWHW                    = HResult(_MAKE_DDHRESULT + 563);
  5437.   {$EXTERNALSYM DDERR_NODIRECTDRAWHW}
  5438.  
  5439. (*
  5440.  * this process already has created a primary surface
  5441.  *)
  5442.   DDERR_PRIMARYSURFACEALREADYEXISTS       = HResult(_MAKE_DDHRESULT + 564);
  5443.   {$EXTERNALSYM DDERR_PRIMARYSURFACEALREADYEXISTS}
  5444.  
  5445. (*
  5446.  * software emulation not available.
  5447.  *)
  5448.   DDERR_NOEMULATION                       = HResult(_MAKE_DDHRESULT + 565);
  5449.   {$EXTERNALSYM DDERR_NOEMULATION}
  5450.  
  5451. (*
  5452.  * region passed to Clipper::GetClipList is too small.
  5453.  *)
  5454.   DDERR_REGIONTOOSMALL                    = HResult(_MAKE_DDHRESULT + 566);
  5455.   {$EXTERNALSYM DDERR_REGIONTOOSMALL}
  5456.  
  5457. (*
  5458.  * an attempt was made to set a clip list for a clipper objec that
  5459.  * is already monitoring an hwnd.
  5460.  *)
  5461.   DDERR_CLIPPERISUSINGHWND                = HResult(_MAKE_DDHRESULT + 567);
  5462.   {$EXTERNALSYM DDERR_CLIPPERISUSINGHWND}
  5463.  
  5464. (*
  5465.  * No clipper object attached to surface object
  5466.  *)
  5467.   DDERR_NOCLIPPERATTACHED                 = HResult(_MAKE_DDHRESULT + 568);
  5468.   {$EXTERNALSYM DDERR_NOCLIPPERATTACHED}
  5469.  
  5470. (*
  5471.  * Clipper notification requires an HWND or
  5472.  * no HWND has previously been set as the CooperativeLevel HWND.
  5473.  *)
  5474.   DDERR_NOHWND                            = HResult(_MAKE_DDHRESULT + 569);
  5475.   {$EXTERNALSYM DDERR_NOHWND}
  5476.  
  5477. (*
  5478.  * HWND used by DirectDraw CooperativeLevel has been subclassed,
  5479.  * this prevents DirectDraw from restoring state.
  5480.  *)
  5481.   DDERR_HWNDSUBCLASSED                    = HResult(_MAKE_DDHRESULT + 570);
  5482.   {$EXTERNALSYM DDERR_HWNDSUBCLASSED}
  5483.  
  5484. (*
  5485.  * The CooperativeLevel HWND has already been set.
  5486.  * It can not be reset while the process has surfaces or palettes created.
  5487.  *)
  5488.   DDERR_HWNDALREADYSET                    = HResult(_MAKE_DDHRESULT + 571);
  5489.   {$EXTERNALSYM DDERR_HWNDALREADYSET}
  5490.  
  5491. (*
  5492.  * No palette object attached to this surface.
  5493.  *)
  5494.   DDERR_NOPALETTEATTACHED                 = HResult(_MAKE_DDHRESULT + 572);
  5495.   {$EXTERNALSYM DDERR_NOPALETTEATTACHED}
  5496.  
  5497. (*
  5498.  * No hardware support for 16 or 256 color palettes.
  5499.  *)
  5500.   DDERR_NOPALETTEHW                       = HResult(_MAKE_DDHRESULT + 573);
  5501.   {$EXTERNALSYM DDERR_NOPALETTEHW}
  5502.  
  5503. (*
  5504.  * If a clipper object is attached to the source surface passed into a
  5505.  * BltFast call.
  5506.  *)
  5507.   DDERR_BLTFASTCANTCLIP                   = HResult(_MAKE_DDHRESULT + 574);
  5508.   {$EXTERNALSYM DDERR_BLTFASTCANTCLIP}
  5509.  
  5510. (*
  5511.  * No blter.
  5512.  *)
  5513.   DDERR_NOBLTHW                           = HResult(_MAKE_DDHRESULT + 575);
  5514.   {$EXTERNALSYM DDERR_NOBLTHW}
  5515.  
  5516. (*
  5517.  * No DirectDraw ROP hardware.
  5518.  *)
  5519.   DDERR_NODDROPSHW                        = HResult(_MAKE_DDHRESULT + 576);
  5520.   {$EXTERNALSYM DDERR_NODDROPSHW}
  5521.  
  5522. (*
  5523.  * returned when GetOverlayPosition is called on a hidden overlay
  5524.  *)
  5525.   DDERR_OVERLAYNOTVISIBLE                 = HResult(_MAKE_DDHRESULT + 577);
  5526.   {$EXTERNALSYM DDERR_OVERLAYNOTVISIBLE}
  5527.  
  5528. (*
  5529.  * returned when GetOverlayPosition is called on a overlay that UpdateOverlay
  5530.  * has never been called on to establish a destionation.
  5531.  *)
  5532.   DDERR_NOOVERLAYDEST                     = HResult(_MAKE_DDHRESULT + 578);
  5533.   {$EXTERNALSYM DDERR_NOOVERLAYDEST}
  5534.  
  5535. (*
  5536.  * returned when the position of the overlay on the destionation is no longer
  5537.  * legal for that destionation.
  5538.  *)
  5539.   DDERR_INVALIDPOSITION                   = HResult(_MAKE_DDHRESULT + 579);
  5540.   {$EXTERNALSYM DDERR_INVALIDPOSITION}
  5541.  
  5542. (*
  5543.  * returned when an overlay member is called for a non-overlay surface
  5544.  *)
  5545.   DDERR_NOTAOVERLAYSURFACE                = HResult(_MAKE_DDHRESULT + 580);
  5546.   {$EXTERNALSYM DDERR_NOTAOVERLAYSURFACE}
  5547.  
  5548. (*
  5549.  * An attempt was made to set the cooperative level when it was already
  5550.  * set to exclusive.
  5551.  *)
  5552.   DDERR_EXCLUSIVEMODEALREADYSET           = HResult(_MAKE_DDHRESULT + 581);
  5553.   {$EXTERNALSYM DDERR_EXCLUSIVEMODEALREADYSET}
  5554.  
  5555. (*
  5556.  * An attempt has been made to flip a surface that is not flippable.
  5557.  *)
  5558.   DDERR_NOTFLIPPABLE                      = HResult(_MAKE_DDHRESULT + 582);
  5559.   {$EXTERNALSYM DDERR_NOTFLIPPABLE}
  5560.  
  5561. (*
  5562.  * Can't duplicate primary & 3D surfaces, or surfaces that are implicitly
  5563.  * created.
  5564.  *)
  5565.   DDERR_CANTDUPLICATE                     = HResult(_MAKE_DDHRESULT + 583);
  5566.   {$EXTERNALSYM DDERR_CANTDUPLICATE}
  5567.  
  5568. (*
  5569.  * Surface was not locked.  An attempt to unlock a surface that was not
  5570.  * locked at all, or by this process, has been attempted.
  5571.  *)
  5572.   DDERR_NOTLOCKED                         = HResult(_MAKE_DDHRESULT + 584);
  5573.   {$EXTERNALSYM DDERR_NOTLOCKED}
  5574.  
  5575. (*
  5576.  * Windows can not create any more DCs, or a DC was requested for a paltte-indexed
  5577.  * surface when the surface had no palette AND the display mode was not palette-indexed
  5578.  * (in this case DirectDraw cannot select a proper palette into the DC)
  5579.  *)
  5580.   DDERR_CANTCREATEDC                      = HResult(_MAKE_DDHRESULT + 585);
  5581.   {$EXTERNALSYM DDERR_CANTCREATEDC}
  5582.  
  5583. (*
  5584.  * No DC was ever created for this surface.
  5585.  *)
  5586.   DDERR_NODC                              = HResult(_MAKE_DDHRESULT + 586);
  5587.   {$EXTERNALSYM DDERR_NODC}
  5588.  
  5589. (*
  5590.  * This surface can not be restored because it was created in a different
  5591.  * mode.
  5592.  *)
  5593.   DDERR_WRONGMODE                         = HResult(_MAKE_DDHRESULT + 587);
  5594.   {$EXTERNALSYM DDERR_WRONGMODE}
  5595.  
  5596. (*
  5597.  * This surface can not be restored because it is an implicitly created
  5598.  * surface.
  5599.  *)
  5600.   DDERR_IMPLICITLYCREATED                 = HResult(_MAKE_DDHRESULT + 588);
  5601.   {$EXTERNALSYM DDERR_IMPLICITLYCREATED}
  5602.  
  5603. (*
  5604.  * The surface being used is not a palette-based surface
  5605.  *)
  5606.   DDERR_NOTPALETTIZED                     = HResult(_MAKE_DDHRESULT + 589);
  5607.   {$EXTERNALSYM DDERR_NOTPALETTIZED}
  5608.  
  5609.  
  5610. (*
  5611.  * The display is currently in an unsupported mode
  5612.  *)
  5613.   DDERR_UNSUPPORTEDMODE                   = HResult(_MAKE_DDHRESULT + 590);
  5614.   {$EXTERNALSYM DDERR_UNSUPPORTEDMODE}
  5615.  
  5616. (*
  5617.  * Operation could not be carried out because there is no mip-map
  5618.  * texture mapping hardware present or available.
  5619.  *)
  5620.   DDERR_NOMIPMAPHW                        = HResult(_MAKE_DDHRESULT + 591);
  5621.   {$EXTERNALSYM DDERR_NOMIPMAPHW}
  5622.  
  5623. (*
  5624.  * The requested action could not be performed because the surface was of
  5625.  * the wrong type.
  5626.  *)
  5627.   DDERR_INVALIDSURFACETYPE                = HResult(_MAKE_DDHRESULT + 592);
  5628.   {$EXTERNALSYM DDERR_INVALIDSURFACETYPE}
  5629.  
  5630.  
  5631. (*
  5632.  * Device does not support optimized surfaces, therefore no video memory optimized surfaces
  5633.  *)
  5634.   DDERR_NOOPTIMIZEHW                      = HResult(_MAKE_DDHRESULT + 600);
  5635.   {$EXTERNALSYM DDERR_NOOPTIMIZEHW}
  5636.  
  5637. (*
  5638.  * Surface is an optimized surface, but has not yet been allocated any memory
  5639.  *)
  5640.   DDERR_NOTLOADED                         = HResult(_MAKE_DDHRESULT + 601);
  5641.   {$EXTERNALSYM DDERR_NOTLOADED}
  5642.  
  5643. (*
  5644.  * Attempt was made to create or set a device window without first setting
  5645.  * the focus window
  5646.  *)
  5647.   DDERR_NOFOCUSWINDOW                     = HResult(_MAKE_DDHRESULT + 602);
  5648.   {$EXTERNALSYM DDERR_NOFOCUSWINDOW}
  5649.  
  5650. (*
  5651.  * Attempt was made to set a palette on a mipmap sublevel
  5652.  *)
  5653.   DDERR_NOTONMIPMAPSUBLEVEL               = HResult(_MAKE_DDHRESULT + 603);
  5654.   {$EXTERNALSYM DDERR_NOTONMIPMAPSUBLEVEL}
  5655.  
  5656. (*
  5657.  * A DC has already been returned for this surface. Only one DC can be
  5658.  * retrieved per surface.
  5659.  *)
  5660.   DDERR_DCALREADYCREATED                  = HResult(_MAKE_DDHRESULT + 620);
  5661.   {$EXTERNALSYM DDERR_DCALREADYCREATED}
  5662.  
  5663. (*
  5664.  * An attempt was made to allocate non-local video memory from a device
  5665.  * that does not support non-local video memory.
  5666.  *)
  5667.   DDERR_NONONLOCALVIDMEM                  = HResult(_MAKE_DDHRESULT + 630);
  5668.   {$EXTERNALSYM DDERR_NONONLOCALVIDMEM}
  5669.  
  5670. (*
  5671.  * The attempt to page lock a surface failed.
  5672.  *)
  5673.   DDERR_CANTPAGELOCK                      = HResult(_MAKE_DDHRESULT + 640);
  5674.   {$EXTERNALSYM DDERR_CANTPAGELOCK}
  5675.  
  5676.  
  5677. (*
  5678.  * The attempt to page unlock a surface failed.
  5679.  *)
  5680.   DDERR_CANTPAGEUNLOCK                    = HResult(_MAKE_DDHRESULT + 660);
  5681.   {$EXTERNALSYM DDERR_CANTPAGEUNLOCK}
  5682.  
  5683. (*
  5684.  * An attempt was made to page unlock a surface with no outstanding page locks.
  5685.  *)
  5686.   DDERR_NOTPAGELOCKED                     = HResult(_MAKE_DDHRESULT + 680);
  5687.   {$EXTERNALSYM DDERR_NOTPAGELOCKED}
  5688.  
  5689. (*
  5690.  * There is more data available than the specified buffer size could hold
  5691.  *)
  5692.   DDERR_MOREDATA                          = HResult(_MAKE_DDHRESULT + 690);
  5693.   {$EXTERNALSYM DDERR_MOREDATA}
  5694.  
  5695. (*
  5696.  * The data has expired and is therefore no longer valid.
  5697.  *)
  5698.   DDERR_EXPIRED                           = HResult(_MAKE_DDHRESULT + 691);
  5699.   {$EXTERNALSYM DDERR_EXPIRED}
  5700.  
  5701. (*
  5702.  * The mode test has finished executing.
  5703.  *)
  5704.  DDERR_TESTFINISHED                       = HResult(_MAKE_DDHRESULT + 692);
  5705.  {$EXTERNALSYM DDERR_TESTFINISHED}
  5706.  
  5707. (*
  5708.  * The mode test has switched to a new mode.
  5709.  *)
  5710.  DDERR_NEWMODE                            = HResult(_MAKE_DDHRESULT + 693);
  5711.  {$EXTERNALSYM DDERR_NEWMODE}
  5712.  
  5713. (*
  5714.  * D3D has not yet been initialized.
  5715.  *)
  5716.  DDERR_D3DNOTINITIALIZED                  = HResult(_MAKE_DDHRESULT + 694);
  5717.  {$EXTERNALSYM DDERR_D3DNOTINITIALIZED}
  5718.  
  5719. (*
  5720.  * The video port is not active
  5721.  *)
  5722.   DDERR_VIDEONOTACTIVE                    = HResult(_MAKE_DDHRESULT + 695);
  5723.   {$EXTERNALSYM DDERR_VIDEONOTACTIVE}
  5724.  
  5725. (*
  5726.  * The monitor does not have EDID data.
  5727.  *)
  5728.  DDERR_NOMONITORINFORMATION               = HResult(_MAKE_DDHRESULT + 696);
  5729.  {$EXTERNALSYM DDERR_NOMONITORINFORMATION}
  5730.  
  5731. (*
  5732.  * The driver does not enumerate display mode refresh rates.
  5733.  *)
  5734.  DDERR_NODRIVERSUPPORT                    = HResult(_MAKE_DDHRESULT + 697);
  5735.  {$EXTERNALSYM DDERR_NODRIVERSUPPORT}
  5736.  
  5737. (*
  5738.  * Surfaces created by one direct draw device cannot be used directly by
  5739.  * another direct draw device.
  5740.  *)
  5741.   DDERR_DEVICEDOESNTOWNSURFACE            = HResult(_MAKE_DDHRESULT + 699);
  5742.   {$EXTERNALSYM DDERR_DEVICEDOESNTOWNSURFACE}
  5743.  
  5744.  
  5745.  
  5746. (*
  5747.  * An attempt was made to invoke an interface member of a DirectDraw object
  5748.  * created by CoCreateInstance() before it was initialized.
  5749.  *)
  5750.   DDERR_NOTINITIALIZED                    = CO_E_NOTINITIALIZED;
  5751.   {$EXTERNALSYM DDERR_NOTINITIALIZED}
  5752.  
  5753. (* Alpha bit depth constants *)
  5754.  
  5755.  
  5756.  
  5757. (*
  5758.  * API's
  5759.  *)
  5760.  
  5761. const
  5762.   DirectDrawDll = 'ddraw.dll';
  5763.  
  5764. type
  5765.   HMonitor = THandle;
  5766.   {$EXTERNALSYM HMonitor}
  5767.  
  5768.   TDDEnumCallbackA = function (lpGUID: PGUID; lpDriverDescription: PAnsiChar;
  5769.       lpDriverName: PAnsiChar; lpContext: Pointer): BOOL; stdcall;
  5770.   {$EXTERNALSYM TDDEnumCallbackA}
  5771.   TDDEnumCallbackW = function (lpGUID: PGUID; lpDriverDescription: PWideChar;
  5772.       lpDriverName: PWideChar; lpContext: Pointer): BOOL; stdcall;
  5773.   {$EXTERNALSYM TDDEnumCallbackW}
  5774.   TDDEnumCallback = function (lpGUID: PGUID; lpDriverDescription: PChar;
  5775.       lpDriverName: PChar; lpContext: Pointer): BOOL; stdcall;
  5776.   {$EXTERNALSYM TDDEnumCallback}
  5777.  
  5778.   TDDEnumCallbackExA = function (lpGUID: PGUID; lpDriverDescription: PAnsiChar;
  5779.       lpDriverName: PAnsiChar; lpContext: Pointer; Monitor: HMonitor): BOOL;
  5780.       stdcall;
  5781.   {$EXTERNALSYM TDDEnumCallbackExA}
  5782.   TDDEnumCallbackExW = function (lpGUID: PGUID; lpDriverDescription: PWideChar;
  5783.       lpDriverName: PWideChar; lpContext: Pointer; Monitor: HMonitor): BOOL;
  5784.       stdcall;
  5785.   {$EXTERNALSYM TDDEnumCallbackExW}
  5786.   TDDEnumCallbackEx = function (lpGUID: PGUID; lpDriverDescription: PChar;
  5787.       lpDriverName: PChar; lpContext: Pointer; Monitor: HMonitor): BOOL;
  5788.       stdcall;
  5789.   {$EXTERNALSYM TDDEnumCallbackEx}
  5790.  
  5791. function DirectDrawLoaded: Boolean;
  5792. function UnLoadDirectDraw: Boolean;
  5793. function LoadDirectDraw: Boolean;
  5794.  
  5795. {$IFDEF DIRECTDRAW_DYNAMIC_LINK}
  5796. var
  5797.   DirectDrawEnumerateA : function (lpCallback: TDDEnumCallbackA;
  5798.        lpContext: Pointer): HResult; stdcall;
  5799.   {$EXTERNALSYM DirectDrawEnumerateA}
  5800.   DirectDrawEnumerateW : function (lpCallback: TDDEnumCallbackW;
  5801.        lpContext: Pointer): HResult; stdcall;
  5802.   {$EXTERNALSYM DirectDrawEnumerateW}
  5803.   DirectDrawEnumerate  : function (lpCallback: TDDEnumCallback;
  5804.        lpContext: Pointer): HResult; stdcall;
  5805.   {$EXTERNALSYM DirectDrawEnumerate}
  5806.  
  5807.   DirectDrawEnumerateExA : function (lpCallback: TDDEnumCallbackExA;
  5808.        lpContext: Pointer; dwFlags: DWORD): HResult; stdcall;
  5809.   {$EXTERNALSYM DirectDrawEnumerateExA}
  5810.   DirectDrawEnumerateExW : function (lpCallback: TDDEnumCallbackExW;
  5811.        lpContext: Pointer; dwFlags: DWORD): HResult; stdcall;
  5812.   {$EXTERNALSYM DirectDrawEnumerateExW}
  5813.   DirectDrawEnumerateEx  : function (lpCallback: TDDEnumCallbackEx;
  5814.        lpContext: Pointer; dwFlags: DWORD): HResult; stdcall;
  5815.   {$EXTERNALSYM DirectDrawEnumerateEx}
  5816.  
  5817.   DirectDrawCreate : function (lpGUID: PGUID;
  5818.        out lplpDD: IDirectDraw;
  5819.        pUnkOuter: IUnknown): HResult; stdcall;
  5820.   {$EXTERNALSYM DirectDrawCreate}
  5821.   DirectDrawCreateEx : function  (lpGUID: PGUID;
  5822.        out lplpDD: IDirectDraw7; const iid: TGUID;
  5823.        pUnkOuter: IUnknown): HResult; stdcall;
  5824.   {$EXTERNALSYM DirectDrawCreateEx}
  5825.   DirectDrawCreateClipper : function (dwFlags: DWORD;
  5826.        out lplpDDClipper: IDirectDrawClipper;
  5827.        pUnkOuter: IUnknown): HResult; stdcall;
  5828.   {$EXTERNALSYM DirectDrawCreateClipper}
  5829. {$ELSE}
  5830.  
  5831. function DirectDrawEnumerateA(lpCallback: TDDEnumCallbackA; lpContext: Pointer): HResult; stdcall; external DirectDrawDll;
  5832. {$EXTERNALSYM DirectDrawEnumerateA}
  5833. function DirectDrawEnumerateW(lpCallback: TDDEnumCallbackW; lpContext: Pointer): HResult; stdcall; external DirectDrawDll;
  5834. {$EXTERNALSYM DirectDrawEnumerateW}
  5835. function DirectDrawEnumerate(lpCallback: TDDEnumCallback; lpContext: Pointer): HResult; stdcall;
  5836.   external DirectDrawDll name {$IFDEF UNICODE}'DirectDrawEnumerateW'{$ELSE}'DirectDrawEnumerateA'{$ENDIF};
  5837. {$EXTERNALSYM DirectDrawEnumerate}
  5838.  
  5839. function DirectDrawEnumerateExA(lpCallback: TDDEnumCallbackExA; lpContext: Pointer; dwFlags: DWORD): HResult; stdcall; external DirectDrawDll;
  5840. {$EXTERNALSYM DirectDrawEnumerateExA}
  5841. function DirectDrawEnumerateExW(lpCallback: TDDEnumCallbackExW; lpContext: Pointer; dwFlags: DWORD): HResult; stdcall; external DirectDrawDll;
  5842. {$EXTERNALSYM DirectDrawEnumerateExW}
  5843. function DirectDrawEnumerateEx(lpCallback: TDDEnumCallbackEx; lpContext: Pointer; dwFlags: DWORD): HResult; stdcall;
  5844.   external DirectDrawDll name {$IFDEF UNICODE}'DirectDrawEnumerateExW'{$ELSE}'DirectDrawEnumerateExA'{$ENDIF};
  5845. {$EXTERNALSYM DirectDrawEnumerateEx}
  5846.  
  5847. function DirectDrawCreate(lpGUID: PGUID; out lplpDD: IDirectDraw;
  5848.     pUnkOuter: IUnknown): HResult; stdcall; external DirectDrawDll;
  5849. {$EXTERNALSYM DirectDrawCreate}
  5850.  
  5851. function DirectDrawCreateEx(lpGUID: PGUID; out lplpDD: IDirectDraw7;
  5852.     const iid: TGUID; pUnkOuter: IUnknown): HResult; stdcall; external DirectDrawDll;
  5853. {$EXTERNALSYM DirectDrawCreateEx}
  5854.  
  5855. function DirectDrawCreateClipper(dwFlags: DWORD; out lplpDDClipper: IDirectDrawClipper;
  5856.     pUnkOuter: IUnknown): HResult; stdcall; external DirectDrawDll;
  5857. {$EXTERNALSYM DirectDrawCreateClipper}
  5858.  
  5859. {$ENDIF}
  5860.  
  5861. const
  5862. (*
  5863.  * Flags for DirectDrawEnumerateEx
  5864.  * DirectDrawEnumerateEx supercedes DirectDrawEnumerate. You must use GetProcAddress to
  5865.  * obtain a function pointer (of type LPDIRECTDRAWENUMERATEEX) to DirectDrawEnumerateEx.
  5866.  * By default, only the primary display device is enumerated.
  5867.  * DirectDrawEnumerate is equivalent to DirectDrawEnumerate(,,DDENUM_NONDISPLAYDEVICES)
  5868.  *)
  5869.  
  5870. (*
  5871.  * This flag causes enumeration of any GDI display devices which are part of
  5872.  * the Windows Desktop
  5873.  *)
  5874.   DDENUM_ATTACHEDSECONDARYDEVICES     = $00000001;
  5875.   {$EXTERNALSYM DDENUM_ATTACHEDSECONDARYDEVICES}
  5876.  
  5877. (*
  5878.  * This flag causes enumeration of any GDI display devices which are not
  5879.  * part of the Windows Desktop
  5880.  *)
  5881.   DDENUM_DETACHEDSECONDARYDEVICES     = $00000002;
  5882.   {$EXTERNALSYM DDENUM_DETACHEDSECONDARYDEVICES}
  5883.  
  5884. (*
  5885.  * This flag causes enumeration of non-display devices
  5886.  *)
  5887.   DDENUM_NONDISPLAYDEVICES            = $00000004;
  5888.   {$EXTERNALSYM DDENUM_NONDISPLAYDEVICES}
  5889.  
  5890.  
  5891.   REGSTR_KEY_DDHW_DESCRIPTION = 'Description';
  5892.   {$EXTERNALSYM REGSTR_KEY_DDHW_DESCRIPTION}
  5893.   REGSTR_KEY_DDHW_DRIVERNAME  = 'DriverName';
  5894.   {$EXTERNALSYM REGSTR_KEY_DDHW_DRIVERNAME}
  5895.   REGSTR_PATH_DDHW            = 'Hardware\DirectDrawDrivers';
  5896.   {$EXTERNALSYM REGSTR_PATH_DDHW}
  5897.  
  5898.   DDCREATE_HARDWAREONLY       = $00000001;
  5899.   {$EXTERNALSYM DDCREATE_HARDWAREONLY}
  5900.   DDCREATE_EMULATIONONLY      = $00000002;
  5901.   {$EXTERNALSYM DDCREATE_EMULATIONONLY}
  5902.  
  5903. (*
  5904.  * Flags for the IDirectDraw4::GetDeviceIdentifier method
  5905.  *)
  5906.  
  5907. (*
  5908.  * This flag causes GetDeviceIdentifier to return information about the host (typically 2D) adapter in a system equipped
  5909.  * with a stacked secondary 3D adapter. Such an adapter appears to the application as if it were part of the
  5910.  * host adapter, but is typically physcially located on a separate card. The stacked secondary's information is
  5911.  * returned when GetDeviceIdentifier's dwFlags field is zero, since this most accurately reflects the qualities
  5912.  * of the DirectDraw object involved.
  5913.  *)
  5914.   DDGDI_GETHOSTIDENTIFIER         = $00000001;
  5915.   {$EXTERNALSYM DDGDI_GETHOSTIDENTIFIER}
  5916.  
  5917. (*
  5918.  * Macros for interpretting DDEVICEIDENTIFIER2.dwWHQLLevel
  5919.  *)
  5920. function GET_WHQL_YEAR(dwWHQLLevel: DWORD): DWORD;
  5921. {$EXTERNALSYM GET_WHQL_YEAR}
  5922. function GET_WHQL_MONTH(dwWHQLLevel: DWORD): DWORD;
  5923. {$EXTERNALSYM GET_WHQL_MONTH}
  5924. function GET_WHQL_DAY(dwWHQLLevel: DWORD): DWORD;
  5925. {$EXTERNALSYM GET_WHQL_DAY}
  5926.  
  5927.  
  5928. (*==========================================================================;
  5929.  *
  5930.  *  Copyright (C) 1996-1997 Microsoft Corporation.  All Rights Reserved.
  5931.  *
  5932.  *  File:    dvp.h
  5933.  *  Content:    DirectDrawVideoPort include file
  5934.  *
  5935.  ***************************************************************************)
  5936.  
  5937. const
  5938. (*
  5939.  * GUIDS used by DirectDrawVideoPort objects
  5940.  *)
  5941.  
  5942. (*
  5943.   IID_IDDVideoPortContainer,
  5944.   IID_IDirectDrawVideoPort,
  5945.   IID_IDirectDrawVideoPortNotify
  5946.     - are defined later in Delphi header
  5947. *)
  5948.  
  5949.   DDVPTYPE_E_HREFH_VREFH: TGUID = (D1:$54F39980;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
  5950.   {$EXTERNALSYM DDVPTYPE_E_HREFH_VREFH}
  5951.   DDVPTYPE_E_HREFH_VREFL: TGUID = (D1:$92783220;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
  5952.   {$EXTERNALSYM DDVPTYPE_E_HREFH_VREFL}
  5953.   DDVPTYPE_E_HREFL_VREFH: TGUID = (D1:$A07A02E0;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
  5954.   {$EXTERNALSYM DDVPTYPE_E_HREFL_VREFH}
  5955.   DDVPTYPE_E_HREFL_VREFL: TGUID = (D1:$E09C77E0;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
  5956.   {$EXTERNALSYM DDVPTYPE_E_HREFL_VREFL}
  5957.   DDVPTYPE_CCIR656:       TGUID = (D1:$FCA326A0;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
  5958.   {$EXTERNALSYM DDVPTYPE_CCIR656}
  5959.   DDVPTYPE_BROOKTREE:     TGUID = (D1:$1352A560;D2:$DA61;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
  5960.   {$EXTERNALSYM DDVPTYPE_BROOKTREE}
  5961.   DDVPTYPE_PHILIPS:       TGUID = (D1:$332CF160;D2:$DA61;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
  5962.   {$EXTERNALSYM DDVPTYPE_PHILIPS}
  5963.  
  5964.  
  5965. (*
  5966.  * These definitions are required to allow polymorphic structure members (i.e. those
  5967.  * that are referred to both as DWORDs and as pointers) to resolve into a type
  5968.  * of correct size to hold the largest of those two types (i.e. pointer) on 64 bit
  5969.  * systems. For 32 bit environments, ULONG_PTR resolves to a DWORD.
  5970.  *)
  5971. type
  5972.   ULONG_PTR = DWORD;
  5973.   {$EXTERNALSYM ULONG_PTR}
  5974.  
  5975. (*============================================================================
  5976.  *
  5977.  * DirectDraw Structures
  5978.  *
  5979.  * Various structures used to invoke DirectDraw.
  5980.  *
  5981.  *==========================================================================*)
  5982.  
  5983. type
  5984.  
  5985. (*
  5986.  * DDVIDEOPORTCONNECT
  5987.  *)
  5988.   PDDVideoPortConnect = ^TDDVideoPortConnect;
  5989.   _DDVIDEOPORTCONNECT = packed record
  5990.     dwSize: DWORD;              // size of the TDDVideoPortConnect structure
  5991.     dwPortWidth: DWORD;         // Width of the video port
  5992.     guidTypeID: TGUID;          // Description of video port connection
  5993.     dwFlags: DWORD;             // Connection flags
  5994.     dwReserved1: ULONG_PTR;     // Reserved, set to zero.
  5995.   end;
  5996.   {$EXTERNALSYM _DDVIDEOPORTCONNECT}
  5997.   DDVIDEOPORTCONNECT = _DDVIDEOPORTCONNECT;
  5998.   {$EXTERNALSYM DDVIDEOPORTCONNECT}
  5999.   TDDVideoPortConnect = _DDVIDEOPORTCONNECT;
  6000.  
  6001. (*
  6002.  * DDVIDEOPORTCAPS
  6003.  *)
  6004.   PDDVideoPortCaps = ^TDDVideoPortCaps;
  6005.   _DDVIDEOPORTCAPS = packed record
  6006.     dwSize: DWORD;                          // size of the TDDVideoPortCaps structure
  6007.     dwFlags: DWORD;                         // indicates which fields contain data
  6008.     dwMaxWidth: DWORD;                      // max width of the video port field
  6009.     dwMaxVBIWidth: DWORD;                   // max width of the VBI data
  6010.     dwMaxHeight: DWORD;                     // max height of the video port field
  6011.     dwVideoPortID: DWORD;                   // Video port ID (0 - (dwMaxVideoPorts -1))
  6012.     dwCaps: DWORD;                          // Video port capabilities
  6013.     dwFX: DWORD;                            // More video port capabilities
  6014.     dwNumAutoFlipSurfaces: DWORD;           // Number of autoflippable surfaces
  6015.     dwAlignVideoPortBoundary: DWORD;        // Byte restriction of placement within the surface
  6016.     dwAlignVideoPortPrescaleWidth: DWORD;   // Byte restriction of width after prescaling
  6017.     dwAlignVideoPortCropBoundary: DWORD;    // Byte restriction of left cropping
  6018.     dwAlignVideoPortCropWidth: DWORD;       // Byte restriction of cropping width
  6019.     dwPreshrinkXStep: DWORD;                // Width can be shrunk in steps of 1/x
  6020.     dwPreshrinkYStep: DWORD;                // Height can be shrunk in steps of 1/x
  6021.     dwNumVBIAutoFlipSurfaces: DWORD;        // Number of VBI autoflippable surfaces allowed
  6022.     dwNumPreferredAutoflip: DWORD;          // Optimal number of autoflippable surfaces for hardware
  6023.     wNumFilterTapsX: Word;                  // Number of taps the prescaler uses in the X direction (0 - no prescale, 1 - replication, etc.)
  6024.     wNumFilterTapsY: Word;                  // Number of taps the prescaler uses in the Y direction (0 - no prescale, 1 - replication, etc.)
  6025.   end;
  6026.   {$EXTERNALSYM _DDVIDEOPORTCAPS}
  6027.   DDVIDEOPORTCAPS = _DDVIDEOPORTCAPS;
  6028.   {$EXTERNALSYM DDVIDEOPORTCAPS}
  6029.   TDDVideoPortCaps = _DDVIDEOPORTCAPS;
  6030.  
  6031. const
  6032. (*
  6033.  * The dwMaxWidth and dwMaxVBIWidth members are valid
  6034.  *)
  6035.   DDVPD_WIDTH = $00000001;
  6036.   {$EXTERNALSYM DDVPD_WIDTH}
  6037.  
  6038. (*
  6039.  * The dwMaxHeight member is valid
  6040.  *)
  6041.   DDVPD_HEIGHT = $00000002;
  6042.   {$EXTERNALSYM DDVPD_HEIGHT}
  6043.  
  6044. (*
  6045.  * The dwVideoPortID member is valid
  6046.  *)
  6047.   DDVPD_ID = $00000004;
  6048.   {$EXTERNALSYM DDVPD_ID}
  6049.  
  6050. (*
  6051.  * The dwCaps member is valid
  6052.  *)
  6053.   DDVPD_CAPS = $00000008;
  6054.   {$EXTERNALSYM DDVPD_CAPS}
  6055.  
  6056. (*
  6057.  * The dwFX member is valid
  6058.  *)
  6059.   DDVPD_FX = $00000010;
  6060.   {$EXTERNALSYM DDVPD_FX}
  6061.  
  6062. (*
  6063.  * The dwNumAutoFlipSurfaces member is valid
  6064.  *)
  6065.   DDVPD_AUTOFLIP = $00000020;
  6066.   {$EXTERNALSYM DDVPD_AUTOFLIP}
  6067.  
  6068. (*
  6069.  * All of the alignment members are valid
  6070.  *)
  6071.   DDVPD_ALIGN = $00000040;
  6072.   {$EXTERNALSYM DDVPD_ALIGN}
  6073.  
  6074. (*
  6075.  * The dwNumPreferredAutoflip member is valid
  6076.  *)
  6077.   DDVPD_PREFERREDAUTOFLIP = $00000080;
  6078.   {$EXTERNALSYM DDVPD_PREFERREDAUTOFLIP}
  6079.  
  6080. (*
  6081.  * The wNumFilterTapsX and wNumFilterTapsY fields are valid
  6082.  *)
  6083.   DDVPD_FILTERQUALITY     = $00000100;
  6084.   {$EXTERNALSYM DDVPD_FILTERQUALITY}
  6085.  
  6086. type
  6087. (*
  6088.  * DDVIDEOPORTDESC
  6089.  *)
  6090.   PDDVideoPortDesc = ^TDDVideoPortDesc;
  6091.   _DDVIDEOPORTDESC = packed record
  6092.     dwSize: DWORD;                       // size of the TDDVideoPortDesc structure
  6093.     dwFieldWidth: DWORD;                 // width of the video port field
  6094.     dwVBIWidth: DWORD;                   // width of the VBI data
  6095.     dwFieldHeight: DWORD;                // height of the video port field
  6096.     dwMicrosecondsPerField: DWORD;       // Microseconds per video field
  6097.     dwMaxPixelsPerSecond: DWORD;         // Maximum pixel rate per second
  6098.     dwVideoPortID: DWORD;                // Video port ID (0 - (dwMaxVideoPorts -1))
  6099.     dwReserved1: DWORD;                  // Reserved for future use - set to zero (struct padding)
  6100.     VideoPortType: TDDVideoPortConnect;  // Description of video port connection
  6101.     dwReserved2: DWORD;                  // Reserved for future use - set to zero
  6102.     dwReserved3: DWORD;                  // Reserved for future use - set to zero
  6103.   end;
  6104.   {$EXTERNALSYM _DDVIDEOPORTDESC}
  6105.   DDVIDEOPORTDESC = _DDVIDEOPORTDESC;
  6106.   {$EXTERNALSYM DDVIDEOPORTDESC}
  6107.   TDDVideoPortDesc = _DDVIDEOPORTDESC;
  6108.  
  6109. (*
  6110.  * DDVIDEOPORTINFO
  6111.  *)
  6112.   PDDVideoPortInfo = ^TDDVideoPortInfo;
  6113.   _DDVIDEOPORTINFO = packed record
  6114.     dwSize: DWORD;                            // Size of the structure
  6115.     dwOriginX: DWORD;                         // Placement of the video data within the surface.
  6116.     dwOriginY: DWORD;                         // Placement of the video data within the surface.
  6117.     dwVPFlags: DWORD;                         // Video port options
  6118.     rCrop: TRect;                             // Cropping rectangle (optional).
  6119.     dwPrescaleWidth: DWORD;                   // Determines pre-scaling/zooming in the X direction (optional).
  6120.     dwPrescaleHeight: DWORD;                  // Determines pre-scaling/zooming in the Y direction (optional).
  6121.     lpddpfInputFormat: PDDPixelFormat;        // Video format written to the video port
  6122.     lpddpfVBIInputFormat: PDDPixelFormat;     // Input format of the VBI data
  6123.     lpddpfVBIOutputFormat: PDDPixelFormat;    // Output format of the data
  6124.     dwVBIHeight: DWORD;                       // Specifies the number of lines of data within the vertical blanking interval.
  6125.     dwReserved1: DWORD;                       // Reserved for future use - set to zero
  6126.     dwReserved2: DWORD;                       // Reserved for future use - set to zero
  6127.   end;
  6128.   {$EXTERNALSYM _DDVIDEOPORTINFO}
  6129.   DDVIDEOPORTINFO = _DDVIDEOPORTINFO;
  6130.   {$EXTERNALSYM DDVIDEOPORTINFO}
  6131.   TDDVideoPortInfo = _DDVIDEOPORTINFO;
  6132.  
  6133. (*
  6134.  * DDVIDEOPORTBANDWIDTH
  6135.  *)
  6136.   PDDVideoPortBandWidth = ^TDDVideoPortBandWidth;
  6137.   _DDVIDEOPORTBANDWIDTH = packed record
  6138.     dwSize: DWORD;                 // Size of the structure
  6139.     dwCaps: DWORD;
  6140.     dwOverlay: DWORD;              // Zoom factor at which overlay is supported
  6141.     dwColorkey: DWORD;             // Zoom factor at which overlay w/ colorkey is supported
  6142.     dwYInterpolate: DWORD;         // Zoom factor at which overlay w/ Y interpolation is supported
  6143.     dwYInterpAndColorkey: DWORD;   // Zoom factor at which ovelray w/ Y interpolation and colorkeying is supported
  6144.     dwReserved1: DWORD;            // Reserved for future use - set to zero
  6145.     dwReserved2: DWORD;            // Reserved for future use - set to zero
  6146.   end;
  6147.   {$EXTERNALSYM _DDVIDEOPORTBANDWIDTH}
  6148.   DDVIDEOPORTBANDWIDTH = _DDVIDEOPORTBANDWIDTH;
  6149.   {$EXTERNALSYM DDVIDEOPORTBANDWIDTH}
  6150.   TDDVideoPortBandWidth = _DDVIDEOPORTBANDWIDTH;
  6151.  
  6152. (*
  6153.  * DDVIDEOPORTSTATUS
  6154.  *)
  6155.   PDDVideoPortStatus = ^TDDVideoPortStatus;
  6156.   _DDVIDEOPORTSTATUS = record
  6157.     dwSize: DWORD;                       // Size of the structure
  6158.     bInUse: BOOL;                        // TRUE if video port is currently being used
  6159.     dwFlags: DWORD;                      // Currently not used
  6160.     dwReserved1: DWORD;                  // Reserved for future use
  6161.     VideoPortType: TDDVideoPortConnect;  // Information about the connection
  6162.     dwReserved2: DWORD;                  // Reserved for future use
  6163.     dwReserved3: DWORD;                  // Reserved for future use
  6164.   end;
  6165.   {$EXTERNALSYM _DDVIDEOPORTSTATUS}
  6166.   DDVIDEOPORTSTATUS = _DDVIDEOPORTSTATUS;
  6167.   {$EXTERNALSYM DDVIDEOPORTSTATUS}
  6168.   TDDVideoPortStatus = _DDVIDEOPORTSTATUS;
  6169.  
  6170. (*
  6171.  * DDVIDEOPORTNOTIFY
  6172.  *)
  6173.   PDDVideoPortNotify = ^TDDVideoPortNotify;
  6174.   _DDVIDEOPORTNOTIFY = packed record
  6175.     ApproximateTimeStamp: Int64;        // Timestamp in the event notification
  6176.     lField: Longint;                    // 0 if even, 1 if odd, -1 if unknown
  6177.     dwSurfaceIndex: Longword;           // Index in the surface chain of the surface that received the sample
  6178.     lDone: Longint;                     // Call InterlockedIncrement on this when done with sample
  6179.   end;
  6180.   {$EXTERNALSYM _DDVIDEOPORTNOTIFY}
  6181.   DDVIDEOPORTNOTIFY = _DDVIDEOPORTNOTIFY;
  6182.   {$EXTERNALSYM DDVIDEOPORTNOTIFY}
  6183.   TDDVideoPortNotify = _DDVIDEOPORTNOTIFY;
  6184.  
  6185.  
  6186. (*============================================================================
  6187.  *
  6188.  * Video Port Flags
  6189.  *
  6190.  * All flags are bit flags.
  6191.  *
  6192.  *==========================================================================*)
  6193. const
  6194. (****************************************************************************
  6195.  *
  6196.  * VIDEOPORT DDVIDEOPORTCONNECT / TDDVideoPortConnect FLAGS
  6197.  *
  6198.  ****************************************************************************)
  6199.  
  6200. (*
  6201.  * When this is set by the driver and passed to the client, this
  6202.  * indicates that the video port is capable of double clocking the data.
  6203.  * When this is set by the client, this indicates that the video port
  6204.  * should enable double clocking.  This flag is only valid with external
  6205.  * syncs.
  6206.  *)
  6207.   DDVPCONNECT_DOUBLECLOCK = $00000001;
  6208.   {$EXTERNALSYM DDVPCONNECT_DOUBLECLOCK}
  6209.  
  6210. (*
  6211.  * When this is set by the driver and passed to the client, this
  6212.  * indicates that the video port is capable of using an external VACT
  6213.  * signal. When this is set by the client, this indicates that the
  6214.  * video port should use the external VACT signal.
  6215.  *)
  6216.   DDVPCONNECT_VACT = $00000002;
  6217.   {$EXTERNALSYM DDVPCONNECT_VACT}
  6218.  
  6219. (*
  6220.  * When this is set by the driver and passed to the client, this
  6221.  * indicates that the video port is capable of treating even fields
  6222.  * like odd fields and visa versa.  When this is set by the client,
  6223.  * this indicates that the video port should treat even fields like odd
  6224.  * fields.
  6225.  *)
  6226.   DDVPCONNECT_INVERTPOLARITY = $00000004;
  6227.   {$EXTERNALSYM DDVPCONNECT_INVERTPOLARITY}
  6228.  
  6229. (*
  6230.  * Indicates that any data written to the video port during the VREF
  6231.  * period will not be written into the frame buffer. This flag is read only.
  6232.  *)
  6233.   DDVPCONNECT_DISCARDSVREFDATA = $00000008;
  6234.   {$EXTERNALSYM DDVPCONNECT_DISCARDSVREFDATA}
  6235.  
  6236. (*
  6237.  * When this is set be the driver and passed to the client, this
  6238.  * indicates that the device will write half lines into the frame buffer
  6239.  * if half lines are provided by the decoder.  If this is set by the client,
  6240.  * this indicates that the decoder will be supplying half lines.
  6241.  *)
  6242.   DDVPCONNECT_HALFLINE = $00000010;
  6243.   {$EXTERNALSYM DDVPCONNECT_HALFLINE}
  6244.  
  6245. (*
  6246.  * Indicates that the signal is interlaced. This flag is only
  6247.  * set by the client.
  6248.  *)
  6249.   DDVPCONNECT_INTERLACED = $00000020;
  6250.   {$EXTERNALSYM DDVPCONNECT_INTERLACED}
  6251.  
  6252. (*
  6253.  * Indicates that video port is shareable and that this video port
  6254.  * will use the even fields.  This flag is only set by the client.
  6255.  *)
  6256.   DDVPCONNECT_SHAREEVEN = $00000040;
  6257.   {$EXTERNALSYM DDVPCONNECT_SHAREEVEN}
  6258.  
  6259. (*
  6260.  * Indicates that video port is shareable and that this video port
  6261.  * will use the odd fields.  This flag is only set by the client.
  6262.  *)
  6263.   DDVPCONNECT_SHAREODD = $00000080;
  6264.   {$EXTERNALSYM DDVPCONNECT_SHAREODD}
  6265.  
  6266. (****************************************************************************
  6267.  *
  6268.  * VIDEOPORT DDVIDEOPORTDESC / TDDVideoPortDesc CAPS
  6269.  *
  6270.  ****************************************************************************)
  6271.  
  6272. (*
  6273.  * Flip can be performed automatically to avoid tearing.
  6274.  *)
  6275.   DDVPCAPS_AUTOFLIP = $00000001;
  6276.   {$EXTERNALSYM DDVPCAPS_AUTOFLIP}
  6277.  
  6278. (*
  6279.  * Supports interlaced video
  6280.  *)
  6281.   DDVPCAPS_INTERLACED = $00000002;
  6282.   {$EXTERNALSYM DDVPCAPS_INTERLACED}
  6283.  
  6284. (*
  6285.  * Supports non-interlaced video
  6286.  *)
  6287.   DDVPCAPS_NONINTERLACED = $00000004;
  6288.   {$EXTERNALSYM DDVPCAPS_NONINTERLACED}
  6289.  
  6290. (*
  6291.  * Indicates that the device can return whether the current field
  6292.  * of an interlaced signal is even or odd.
  6293.  *)
  6294.   DDVPCAPS_READBACKFIELD = $00000008;
  6295.   {$EXTERNALSYM DDVPCAPS_READBACKFIELD}
  6296.  
  6297. (*
  6298.  * Indicates that the device can return the current line of video
  6299.  * being written into the frame buffer.
  6300.  *)
  6301.   DDVPCAPS_READBACKLINE = $00000010;
  6302.   {$EXTERNALSYM DDVPCAPS_READBACKLINE}
  6303.  
  6304. (*
  6305.  * Allows two gen-locked video streams to share a single video port,
  6306.  * where one stream uses the even fields and the other uses the odd
  6307.  * fields. Separate parameters (including address, scaling,
  6308.  * cropping, etc.) are maintained for both fields.)
  6309.  *)
  6310.   DDVPCAPS_SHAREABLE = $00000020;
  6311.   {$EXTERNALSYM DDVPCAPS_SHAREABLE}
  6312.  
  6313. (*
  6314.  * Even fields of video can be automatically discarded.
  6315.  *)
  6316.   DDVPCAPS_SKIPEVENFIELDS = $00000040;
  6317.   {$EXTERNALSYM DDVPCAPS_SKIPEVENFIELDS}
  6318.  
  6319. (*
  6320.  * Odd fields of video can be automatically discarded.
  6321.  *)
  6322.   DDVPCAPS_SKIPODDFIELDS = $00000080;
  6323.   {$EXTERNALSYM DDVPCAPS_SKIPODDFIELDS}
  6324.  
  6325. (*
  6326.  * Indicates that the device is capable of driving the graphics
  6327.  * VSYNC with the video port VSYNC.
  6328.  *)
  6329.   DDVPCAPS_SYNCMASTER = $00000100;
  6330.   {$EXTERNALSYM DDVPCAPS_SYNCMASTER}
  6331.  
  6332. (*
  6333.  * Indicates that data within the vertical blanking interval can
  6334.  * be written to a different surface.
  6335.  *)
  6336.   DDVPCAPS_VBISURFACE = $00000200;
  6337.   {$EXTERNALSYM DDVPCAPS_VBISURFACE}
  6338.  
  6339. (*
  6340.  * Indicates that the video port can perform color operations
  6341.  * on the incoming data before it is written to the frame buffer.
  6342.  *)
  6343.   DDVPCAPS_COLORCONTROL = $00000400;
  6344.   {$EXTERNALSYM DDVPCAPS_COLORCONTROL}
  6345.  
  6346. (*
  6347.  * Indicates that the video port can accept VBI data in a different
  6348.  * width or format than the regular video data.
  6349.  *)
  6350.   DDVPCAPS_OVERSAMPLEDVBI = $00000800;
  6351.   {$EXTERNALSYM DDVPCAPS_OVERSAMPLEDVBI}
  6352.  
  6353. (*
  6354.  * Indicates that the video port can write data directly to system memory
  6355.  *)
  6356.   DDVPCAPS_SYSTEMMEMORY = $00001000;
  6357.   {$EXTERNALSYM DDVPCAPS_SYSTEMMEMORY}
  6358.  
  6359. (*
  6360.  * Indicates that the VBI and video portions of the video stream can
  6361.  * be controlled by an independent processes.
  6362.  *)
  6363.   DDVPCAPS_VBIANDVIDEOINDEPENDENT    = $00002000;
  6364.   {$EXTERNALSYM DDVPCAPS_VBIANDVIDEOINDEPENDENT}
  6365.  
  6366. (*
  6367.  * Indicates that the video port contains high quality hardware
  6368.  * de-interlacing hardware that should be used instead of the
  6369.  * bob/weave algorithms.
  6370.  *)
  6371.   DDVPCAPS_HARDWAREDEINTERLACE        = $00004000;
  6372.   {$EXTERNALSYM DDVPCAPS_HARDWAREDEINTERLACE}
  6373.  
  6374.  
  6375. (****************************************************************************
  6376.  *
  6377.  * VIDEOPORT DDVIDEOPORTDESC / TDDVideoPortDesc FX
  6378.  *
  6379.  ****************************************************************************)
  6380.  
  6381. (*
  6382.  * Limited cropping is available to crop out the vertical interval data.
  6383.  *)
  6384.   DDVPFX_CROPTOPDATA = $00000001;
  6385.   {$EXTERNALSYM DDVPFX_CROPTOPDATA}
  6386.  
  6387. (*
  6388.  * Incoming data can be cropped in the X direction before it is written
  6389.  * to the surface.
  6390.  *)
  6391.   DDVPFX_CROPX = $00000002;
  6392.   {$EXTERNALSYM DDVPFX_CROPX}
  6393.  
  6394. (*
  6395.  * Incoming data can be cropped in the Y direction before it is written
  6396.  * to the surface.
  6397.  *)
  6398.   DDVPFX_CROPY = $00000004;
  6399.   {$EXTERNALSYM DDVPFX_CROPY}
  6400.  
  6401. (*
  6402.  * Supports interleaving interlaced fields in memory.
  6403.  *)
  6404.   DDVPFX_INTERLEAVE = $00000008;
  6405.   {$EXTERNALSYM DDVPFX_INTERLEAVE}
  6406.  
  6407. (*
  6408.  * Supports mirroring left to right as the video data is written
  6409.  * into the frame buffer.
  6410.  *)
  6411.   DDVPFX_MIRRORLEFTRIGHT = $00000010;
  6412.   {$EXTERNALSYM DDVPFX_MIRRORLEFTRIGHT}
  6413.  
  6414. (*
  6415.  * Supports mirroring top to bottom as the video data is written
  6416.  * into the frame buffer.
  6417.  *)
  6418.   DDVPFX_MIRRORUPDOWN = $00000020;
  6419.   {$EXTERNALSYM DDVPFX_MIRRORUPDOWN}
  6420.  
  6421. (*
  6422.  * Data can be arbitrarily shrunk in the X direction before it
  6423.  * is written to the surface.
  6424.  *)
  6425.   DDVPFX_PRESHRINKX = $00000040;
  6426.   {$EXTERNALSYM DDVPFX_PRESHRINKX}
  6427.  
  6428. (*
  6429.  * Data can be arbitrarily shrunk in the Y direction before it
  6430.  * is written to the surface.
  6431.  *)
  6432.   DDVPFX_PRESHRINKY = $00000080;
  6433.   {$EXTERNALSYM DDVPFX_PRESHRINKY}
  6434.  
  6435. (*
  6436.  * Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the X
  6437.  * direction before it is written to the surface.
  6438.  *)
  6439.   DDVPFX_PRESHRINKXB = $00000100;
  6440.   {$EXTERNALSYM DDVPFX_PRESHRINKXB}
  6441.  
  6442. (*
  6443.  * Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the Y
  6444.  * direction before it is written to the surface.
  6445.  *)
  6446.   DDVPFX_PRESHRINKYB = $00000200;
  6447.   {$EXTERNALSYM DDVPFX_PRESHRINKYB}
  6448.  
  6449. (*
  6450.  * Data can be shrunk in increments of 1/x in the X direction
  6451.  * (where X is specified in the TDDVideoPortCaps.dwPreshrinkXStep)
  6452.  * before it is written to the surface.
  6453.  *)
  6454.   DDVPFX_PRESHRINKXS = $00000400;
  6455.   {$EXTERNALSYM DDVPFX_PRESHRINKXS}
  6456.  
  6457. (*
  6458.  * Data can be shrunk in increments of 1/x in the Y direction
  6459.  * (where X is specified in the TDDVideoPortCaps.dwPreshrinkYStep)
  6460.  * before it is written to the surface.
  6461.  *)
  6462.   DDVPFX_PRESHRINKYS = $00000800;
  6463.   {$EXTERNALSYM DDVPFX_PRESHRINKYS}
  6464.  
  6465. (*
  6466.  * Data can be arbitrarily stretched in the X direction before
  6467.  * it is written to the surface.
  6468.  *)
  6469.   DDVPFX_PRESTRETCHX = $00001000;
  6470.   {$EXTERNALSYM DDVPFX_PRESTRETCHX}
  6471.  
  6472. (*
  6473.  * Data can be arbitrarily stretched in the Y direction before
  6474.  * it is written to the surface.
  6475.  *)
  6476.   DDVPFX_PRESTRETCHY = $00002000;
  6477.   {$EXTERNALSYM DDVPFX_PRESTRETCHY}
  6478.  
  6479. (*
  6480.  * Data can be integer stretched in the X direction before it is
  6481.  * written to the surface.
  6482.  *)
  6483.   DDVPFX_PRESTRETCHXN = $00004000;
  6484.   {$EXTERNALSYM DDVPFX_PRESTRETCHXN}
  6485.  
  6486. (*
  6487.  * Data can be integer stretched in the Y direction before it is
  6488.  * written to the surface.
  6489.  *)
  6490.   DDVPFX_PRESTRETCHYN = $00008000;
  6491.   {$EXTERNALSYM DDVPFX_PRESTRETCHYN}
  6492.  
  6493. (*
  6494.  * Indicates that data within the vertical blanking interval can
  6495.  * be converted independently of the remaining video data.
  6496.  *)
  6497.   DDVPFX_VBICONVERT = $00010000;
  6498.   {$EXTERNALSYM DDVPFX_VBICONVERT}
  6499.  
  6500. (*
  6501.  * Indicates that scaling can be disabled for data within the
  6502.  * vertical blanking interval.
  6503.  *)
  6504.   DDVPFX_VBINOSCALE = $00020000;
  6505.   {$EXTERNALSYM DDVPFX_VBINOSCALE}
  6506.  
  6507. (*
  6508.  * Indicates that the video data can ignore the left and right
  6509.  * cropping coordinates when cropping oversampled VBI data.
  6510.  *)
  6511.   DDVPFX_IGNOREVBIXCROP = $00040000;
  6512.   {$EXTERNALSYM DDVPFX_IGNOREVBIXCROP}
  6513.  
  6514. (*
  6515.  * Indicates that interleaving can be disabled for data within the
  6516.  * vertical blanking interval.
  6517.  *)
  6518.   DDVPFX_VBINOINTERLEAVE     = $00080000;
  6519.   {$EXTERNALSYM DDVPFX_VBINOINTERLEAVE}
  6520.  
  6521.  
  6522. (****************************************************************************
  6523.  *
  6524.  * VIDEOPORT DDVIDEOPORTINFO / TDDVideoPortInfo FLAGS
  6525.  *
  6526.  ****************************************************************************)
  6527.  
  6528. (*
  6529.  * Perform automatic flipping.   Auto-flipping is performed between
  6530.  * the overlay surface that was attached to the video port using
  6531.  * IDirectDrawVideoPort::AttachSurface and the overlay surfaces that
  6532.  * are attached to the surface via the IDirectDrawSurface::AttachSurface
  6533.  * method.  The flip order is the order in which the overlay surfaces
  6534.  * were. attached.
  6535.  *)
  6536.   DDVP_AUTOFLIP = $00000001;
  6537.   {$EXTERNALSYM DDVP_AUTOFLIP}
  6538.  
  6539. (*
  6540.  * Perform conversion using the ddpfOutputFormat information.
  6541.  *)
  6542.   DDVP_CONVERT = $00000002;
  6543.   {$EXTERNALSYM DDVP_CONVERT}
  6544.  
  6545. (*
  6546.  * Perform cropping using the specified rectangle.
  6547.  *)
  6548.   DDVP_CROP = $00000004;
  6549.   {$EXTERNALSYM DDVP_CROP}
  6550.  
  6551. (*
  6552.  * Indicates that interlaced fields should be interleaved in memory.
  6553.  *)
  6554.   DDVP_INTERLEAVE = $00000008;
  6555.   {$EXTERNALSYM DDVP_INTERLEAVE}
  6556.  
  6557. (*
  6558.  * Indicates that the data should be mirrored left to right as it's
  6559.  * written into the frame buffer.
  6560.  *)
  6561.   DDVP_MIRRORLEFTRIGHT = $00000010;
  6562.   {$EXTERNALSYM DDVP_MIRRORLEFTRIGHT}
  6563.  
  6564. (*
  6565.  * Indicates that the data should be mirrored top to bottom as it's
  6566.  * written into the frame buffer.
  6567.  *)
  6568.   DDVP_MIRRORUPDOWN = $00000020;
  6569.   {$EXTERNALSYM DDVP_MIRRORUPDOWN}
  6570.  
  6571. (*
  6572.  * Perform pre-scaling/zooming based on the pre-scale parameters.
  6573.  *)
  6574.   DDVP_PRESCALE = $00000040;
  6575.   {$EXTERNALSYM DDVP_PRESCALE}
  6576.  
  6577. (*
  6578.  * Ignore input of even fields.
  6579.  *)
  6580.   DDVP_SKIPEVENFIELDS = $00000080;
  6581.   {$EXTERNALSYM DDVP_SKIPEVENFIELDS}
  6582.  
  6583. (*
  6584.  * Ignore input of odd fields.
  6585.  *)
  6586.   DDVP_SKIPODDFIELDS = $00000100;
  6587.   {$EXTERNALSYM DDVP_SKIPODDFIELDS}
  6588.  
  6589. (*
  6590.  * Drive the graphics VSYNCs using the video port VYSNCs.
  6591.  *)
  6592.   DDVP_SYNCMASTER = $00000200;
  6593.   {$EXTERNALSYM DDVP_SYNCMASTER}
  6594.  
  6595. (*
  6596.  * The ddpfVBIOutputFormatFormat member contains data that should be used
  6597.  * to convert the data within the vertical blanking interval.
  6598.  *)
  6599.   DDVP_VBICONVERT = $00000400;
  6600.   {$EXTERNALSYM DDVP_VBICONVERT}
  6601.  
  6602. (*
  6603.  * Indicates that data within the vertical blanking interval
  6604.  * should not be scaled.
  6605.  *)
  6606.   DDVP_VBINOSCALE = $00000800;
  6607.   {$EXTERNALSYM DDVP_VBINOSCALE}
  6608.  
  6609. (*
  6610.  * Indicates that these bob/weave decisions should not be
  6611.  * overriden by other interfaces.
  6612.  *)
  6613.   DDVP_OVERRIDEBOBWEAVE = $00001000;
  6614.   {$EXTERNALSYM DDVP_OVERRIDEBOBWEAVE}
  6615.  
  6616. (*
  6617.  * Indicates that the video data should ignore the left and right
  6618.  * cropping coordinates when cropping the VBI data.
  6619.  *)
  6620.   DDVP_IGNOREVBIXCROP = $00002000;
  6621.   {$EXTERNALSYM DDVP_IGNOREVBIXCROP}
  6622.  
  6623. (*
  6624.  * Indicates that interleaving can be disabled for data within the
  6625.  * vertical blanking interval.
  6626.  *)
  6627.   DDVP_VBINOINTERLEAVE            = $00004000;
  6628.   {$EXTERNALSYM DDVP_VBINOINTERLEAVE}
  6629.  
  6630. (*
  6631.  * Indicates that the video port should use the hardware
  6632.  * de-interlacing hardware.
  6633.  *)
  6634.   DDVP_HARDWAREDEINTERLACE        = $00008000;
  6635.   {$EXTERNALSYM DDVP_HARDWAREDEINTERLACE}
  6636.  
  6637. (****************************************************************************
  6638.  *
  6639.  * DIRIRECTDRAWVIDEOPORT GETINPUTFORMAT/GETOUTPUTFORMAT FLAGS
  6640.  *
  6641.  ****************************************************************************)
  6642.  
  6643. (*
  6644.  * Return formats for the video data
  6645.  *)
  6646.   DDVPFORMAT_VIDEO = $00000001;
  6647.   {$EXTERNALSYM DDVPFORMAT_VIDEO}
  6648.  
  6649. (*
  6650.  * Return formats for the VBI data
  6651.  *)
  6652.   DDVPFORMAT_VBI = $00000002;
  6653.   {$EXTERNALSYM DDVPFORMAT_VBI}
  6654.  
  6655. (****************************************************************************
  6656.  *
  6657.  * DIRIRECTDRAWVIDEOPORT SETTARGETSURFACE FLAGS
  6658.  *
  6659.  ****************************************************************************)
  6660.  
  6661. (*
  6662.  * Surface should receive video data (and VBI data if a surface
  6663.  * is not explicitly attached for that purpose)
  6664.  *)
  6665.   DDVPTARGET_VIDEO = $00000001;
  6666.   {$EXTERNALSYM DDVPTARGET_VIDEO}
  6667.  
  6668. (*
  6669.  * Surface should receive VBI data
  6670.  *)
  6671.   DDVPTARGET_VBI = $00000002;
  6672.   {$EXTERNALSYM DDVPTARGET_VBI}
  6673.  
  6674.  
  6675. (****************************************************************************
  6676.  *
  6677.  * DIRIRECTDRAWVIDEOPORT WAITFORSYNC FLAGS
  6678.  *
  6679.  ****************************************************************************)
  6680.  
  6681. (*
  6682.  * Waits until the beginning of the next VSYNC
  6683.  *)
  6684.   DDVPWAIT_BEGIN = $00000001;
  6685.   {$EXTERNALSYM DDVPWAIT_BEGIN}
  6686.  
  6687. (*
  6688.  * Waits until the end of the next/current VSYNC
  6689.  *)
  6690.   DDVPWAIT_END = $00000002;
  6691.   {$EXTERNALSYM DDVPWAIT_END}
  6692.  
  6693. (*
  6694.  * Waits until the beginning of the specified line
  6695.  *)
  6696.   DDVPWAIT_LINE = $00000003;
  6697.   {$EXTERNALSYM DDVPWAIT_LINE}
  6698.  
  6699. (****************************************************************************
  6700.  *
  6701.  * DIRECTDRAWVIDEOPORT FLIP FLAGS
  6702.  *
  6703.  ****************************************************************************)
  6704.  
  6705. (*
  6706.  * Flips the normal video surface
  6707.  *)
  6708.   DDVPFLIP_VIDEO = $00000001;
  6709.   {$EXTERNALSYM DDVPFLIP_VIDEO}
  6710.  
  6711. (*
  6712.  * Flips the VBI surface
  6713.  *)
  6714.   DDVPFLIP_VBI = $00000002;
  6715.   {$EXTERNALSYM DDVPFLIP_VBI}
  6716.  
  6717. (****************************************************************************
  6718.  *
  6719.  * DIRIRECTDRAWVIDEOPORT GETVIDEOSIGNALSTATUS VALUES
  6720.  *
  6721.  ****************************************************************************)
  6722.  
  6723. (*
  6724.  * No video signal is present at the video port
  6725.  *)
  6726.   DDVPSQ_NOSIGNAL = $00000001;
  6727.   {$EXTERNALSYM DDVPSQ_NOSIGNAL}
  6728.  
  6729. (*
  6730.  * A valid video signal is present at the video port
  6731.  *)
  6732.   DDVPSQ_SIGNALOK = $00000002;
  6733.   {$EXTERNALSYM DDVPSQ_SIGNALOK}
  6734.  
  6735. (****************************************************************************
  6736.  *
  6737.  * VIDEOPORTBANDWIDTH Flags
  6738.  *
  6739.  ****************************************************************************)
  6740.  
  6741. (*
  6742.  * The specified height/width refer to the size of the video port data
  6743.  * written into memory, after prescaling has occured.
  6744.  *)
  6745.   DDVPB_VIDEOPORT = $00000001;
  6746.   {$EXTERNALSYM DDVPB_VIDEOPORT}
  6747.  
  6748. (*
  6749.  * The specified height/width refer to the source size of the overlay.
  6750.  *)
  6751.   DDVPB_OVERLAY = $00000002;
  6752.   {$EXTERNALSYM DDVPB_OVERLAY}
  6753.  
  6754. (*
  6755.  * This is a query for the device to return which caps this device requires.
  6756.  *)
  6757.   DDVPB_TYPE = $00000004;
  6758.   {$EXTERNALSYM DDVPB_TYPE}
  6759.  
  6760. (****************************************************************************
  6761.  *
  6762.  * VIDEOPORTBANDWIDTH Caps
  6763.  *
  6764.  ****************************************************************************)
  6765.  
  6766. (*
  6767.  * The bandwidth for this device is dependant on the overlay source size.
  6768.  *)
  6769.   DDVPBCAPS_SOURCE = $00000001;
  6770.   {$EXTERNALSYM DDVPBCAPS_SOURCE}
  6771.  
  6772. (*
  6773.  * The bandwidth for this device is dependant on the overlay destination
  6774.  * size.
  6775.  *)
  6776.   DDVPBCAPS_DESTINATION = $00000002;
  6777.   {$EXTERNALSYM DDVPBCAPS_DESTINATION}
  6778.  
  6779. (****************************************************************************
  6780.  *
  6781.  * DDVIDEOPORTCONTAINER CreateVideoPort flags
  6782.  *
  6783.  ****************************************************************************)
  6784.  
  6785. (*
  6786.  * The process only wants to control the VBI portion of the video stream.
  6787.  *)
  6788.   DDVPCREATE_VBIONLY            = $00000001;
  6789.   {$EXTERNALSYM DDVPCREATE_VBIONLY}
  6790.  
  6791. (*
  6792.  * The process only wants to control the non-VBI (video) portion of
  6793.  * the video stream.
  6794.  *)
  6795.   DDVPCREATE_VIDEOONLY            = $00000002;
  6796.   {$EXTERNALSYM DDVPCREATE_VIDEOONLY}
  6797.  
  6798. (****************************************************************************
  6799.  *
  6800.  * DDVIDEOPORTSTATUS flags
  6801.  *
  6802.  ****************************************************************************)
  6803.  
  6804. (*
  6805.  * The video port interface is only controlling the VBI portion of the
  6806.  * video stream
  6807.  *)
  6808.   DDVPSTATUS_VBIONLY            = $00000001;
  6809.   {$EXTERNALSYM DDVPSTATUS_VBIONLY}
  6810.  
  6811. (*
  6812.  * The video port interface is only controlling the video portion of the
  6813.  * video stream
  6814.  *)
  6815.   DDVPSTATUS_VIDEOONLY            = $00000002;
  6816.   {$EXTERNALSYM DDVPSTATUS_VIDEOONLY}
  6817.  
  6818.  
  6819. type
  6820. (*
  6821.  * API's
  6822.  *)
  6823.  
  6824.   TDDEnumVideoCallback = function (lpTDDVideoPortCaps: PDDVideoPortCaps;
  6825.       lpContext: Pointer): HResult; stdcall;
  6826.   {$EXTERNALSYM TDDEnumVideoCallback}
  6827.  
  6828. (*
  6829.  * INTERACES FOLLOW:
  6830.  *    IDirectDrawVideoPort
  6831.  *    IVideoPort
  6832.  *)
  6833.   IDirectDrawVideoPort = interface;
  6834.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawVideoPort);'}
  6835.   {$EXTERNALSYM IDirectDrawVideoPort}
  6836.  
  6837. (*
  6838.  * IDirectDrawVideoPortContainer
  6839.  *)
  6840.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDDVideoPortContainer);'}
  6841.   {$EXTERNALSYM IDDVideoPortContainer}
  6842.   IDDVideoPortContainer = interface(IUnknown)
  6843.     ['{6C142760-A733-11CE-A521-0020AF0BE560}']
  6844.     (*** IDDVideoPortContainer methods ***)
  6845.     function CreateVideoPort(dwFlags: DWORD; var lpTDDVideoPortDesc:
  6846.         TDDVideoPortDesc; var lplpDDVideoPort: IDirectDrawVideoPort;
  6847.         pUnkOuter: IUnknown): HResult; stdcall;
  6848.     function EnumVideoPorts(dwFlags: DWORD;
  6849.         lpTDDVideoPortCaps: PDDVideoPortCaps; lpContext: Pointer;
  6850.         lpEnumVideoCallback: TDDEnumVideoCallback): HResult; stdcall;
  6851.     function GetVideoPortConnectInfo(dwPortId: DWORD; var lpNumEntries: DWORD;
  6852.         lpConnectInfo: PDDVideoPortConnect): HResult; stdcall;
  6853.     function QueryVideoPortStatus(dwPortId: DWORD;
  6854.         var lpVPStatus: TDDVideoPortStatus): HResult; stdcall;
  6855.   end;
  6856.  
  6857. (*
  6858.  * IDirectDrawVideoPort
  6859.  *)
  6860.   IDirectDrawVideoPort = interface(IUnknown)
  6861.     ['{B36D93E0-2B43-11CF-A2DE-00AA00B93356}']
  6862.     (*** IDirectDrawVideoPort methods ***)
  6863.     function Flip(lpDDSurface: IDirectDrawSurface; dwFlags: DWORD): HResult; stdcall;
  6864.     function GetBandwidthInfo(var lpddpfFormat: TDDPixelFormat;
  6865.         dwWidth: DWORD; dwHeight: DWORD; dwFlags: DWORD;
  6866.         var lpBandwidth: TDDVideoPortBandWidth): HResult; stdcall;
  6867.     function GetColorControls(var lpColorControl: TDDColorControl): HResult; stdcall;
  6868.     function GetInputFormats(var lpNumFormats: DWORD; var lpFormats:
  6869.         TDDPixelFormat; dwFlags: DWORD): HResult; stdcall;
  6870.     function GetOutputFormats(var lpInputFormat: TDDPixelFormat;
  6871.         var lpNumFormats: DWORD; lpFormats: PDDPixelFormat; dwFlags: DWORD):
  6872.         HResult; stdcall;
  6873.     function GetFieldPolarity(var lpbVideoField: BOOL): HResult; stdcall;
  6874.     function GetVideoLine(var lpdwLine: DWORD): HResult; stdcall;
  6875.     function GetVideoSignalStatus(varlpdwStatus: DWORD): HResult; stdcall;
  6876.     function SetColorControls(var lpColorControl: TDDColorControl): HResult; stdcall;
  6877.     function SetTargetSurface(lpDDSurface: IDirectDrawSurface; dwFlags: DWORD):
  6878.         HResult; stdcall;
  6879.     function StartVideo(var lpVideoInfo: TDDVideoPortInfo): HResult; stdcall;
  6880.     function StopVideo: HResult; stdcall;
  6881.     function UpdateVideo(var lpVideoInfo: TDDVideoPortInfo): HResult; stdcall;
  6882.     function WaitForSync(dwFlags: DWORD; dwLine: DWORD; dwTimeout: DWORD):
  6883.         HResult; stdcall;
  6884.   end;
  6885.  
  6886.   IID_IDDVideoPortContainer = IDDVideoPortContainer;
  6887.   {$EXTERNALSYM IID_IDDVideoPortContainer}
  6888.   IID_IDirectDrawVideoPort = IDirectDrawVideoPort;
  6889.   {$EXTERNALSYM IID_IDirectDrawVideoPort}
  6890.  
  6891. (*
  6892.  * IDirectDrawVideoPort
  6893.  *)
  6894.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawVideoPortNotify);'}
  6895.   {$EXTERNALSYM IDirectDrawVideoPortNotify}
  6896.   IDirectDrawVideoPortNotify = interface(IUnknown)
  6897.     ['{6C142760-A733-11CE-A521-0020AF0BE560}']
  6898.     (*** IVideoPort methods ***)
  6899.     function AcquireNotification(hEvent: THandle; const params: TDDVideoPortNotify): HResult; stdcall;
  6900.     function ReleaseNotification(hEvent: THandle): HResult; stdcall;
  6901.   end;
  6902.  
  6903.  
  6904. var
  6905.   DDrawDLL : HMODULE = 0;
  6906.  
  6907. function DDErrorString(Value: HResult): String;
  6908.  
  6909. implementation
  6910.  
  6911. //#define MAKE_DDHRESULT( code )  MAKE_HRESULT( 1, _FACDD, code )
  6912. function MAKE_DDHRESULT(Code: DWORD): HResult;
  6913. begin
  6914.   Result:= MakeResult(1, _FACDD, code);
  6915. end;
  6916.  
  6917. //#define GET_WHQL_YEAR( dwWHQLLevel ) \
  6918. //    ( (dwWHQLLevel) / 0x10000 )
  6919. function GET_WHQL_YEAR(dwWHQLLevel: DWORD): DWORD;
  6920. begin
  6921.   Result := (dwWHQLLevel) div $10000;
  6922. end;
  6923.  
  6924. //#define GET_WHQL_MONTH( dwWHQLLevel ) \
  6925. //    ( ( (dwWHQLLevel) / 0x100 ) & 0x00ff )
  6926. function GET_WHQL_MONTH(dwWHQLLevel: DWORD): DWORD;
  6927. begin
  6928.   Result := ((dwWHQLLevel) div $100) and $00ff;
  6929. end;
  6930.  
  6931. //#define GET_WHQL_DAY( dwWHQLLevel ) \
  6932. //    ( (dwWHQLLevel) & 0xff )
  6933. function GET_WHQL_DAY(dwWHQLLevel: DWORD): DWORD;
  6934. begin
  6935.   Result := (dwWHQLLevel) and $ff;
  6936. end;
  6937.  
  6938.  
  6939. function MAKEFOURCC(ch0, ch1, ch2, ch3: Char): DWORD;
  6940. begin
  6941.   Result := DWORD(Byte(ch0) shl 0) or
  6942.             DWORD(Byte(ch1) shl 8) or
  6943.             DWORD(Byte(ch2) shl 16) or
  6944.             DWORD(Byte(ch3) shl 24);
  6945. end;
  6946.  
  6947. function DDErrorString(Value: HResult): String;
  6948. begin
  6949.   case Value of
  6950.     DD_OK: Result := 'The request completed successfully.';
  6951.     DDERR_ALREADYINITIALIZED: Result := 'This object is already initialized.';
  6952.     DDERR_BLTFASTCANTCLIP: Result := ' if a clipper object is attached to the source surface passed into a BltFast call.';
  6953.     DDERR_CANNOTATTACHSURFACE: Result := 'This surface can not be attached to the requested surface.';
  6954.     DDERR_CANNOTDETACHSURFACE: Result := 'This surface can not be detached from the requested surface.';
  6955.     DDERR_CANTCREATEDC: Result := 'Windows can not create any more DCs.';
  6956.     DDERR_CANTDUPLICATE: Result := 'Cannot duplicate primary & 3D surfaces, or surfaces that are implicitly created.';
  6957.     DDERR_CLIPPERISUSINGHWND: Result := 'An attempt was made to set a cliplist for a clipper object that is already monitoring an hwnd.';
  6958.     DDERR_COLORKEYNOTSET: Result := 'No src color key specified for this operation.';
  6959.     DDERR_CURRENTLYNOTAVAIL: Result := 'Support is currently not available.';
  6960.     DDERR_DIRECTDRAWALREADYCREATED: Result := 'A DirectDraw object representing this driver has already been created for this process.';
  6961.     DDERR_EXCEPTION: Result := 'An exception was encountered while performing the requested operation.';
  6962.     DDERR_EXCLUSIVEMODEALREADYSET: Result := 'An attempt was made to set the cooperative level when it was already set to exclusive.';
  6963.     DDERR_GENERIC: Result := 'Generic failure.';
  6964.     DDERR_HEIGHTALIGN: Result := 'Height of rectangle provided is not a multiple of reqd alignment.';
  6965.     DDERR_HWNDALREADYSET: Result := 'The CooperativeLevel HWND has already been set. It can not be reset while the process has surfaces or palettes created.';
  6966.     DDERR_HWNDSUBCLASSED: Result := 'HWND used by DirectDraw CooperativeLevel has been subclassed, this prevents DirectDraw from restoring state.';
  6967.     DDERR_IMPLICITLYCREATED: Result := 'This surface can not be restored because it is an implicitly created surface.';
  6968.     DDERR_INCOMPATIBLEPRIMARY: Result := 'Unable to match primary surface creation request with existing primary surface.';
  6969.     DDERR_INVALIDCAPS: Result := 'One or more of the caps bits passed to the callback are incorrect.';
  6970.     DDERR_INVALIDCLIPLIST: Result := 'DirectDraw does not support the provided cliplist.';
  6971.     DDERR_INVALIDDIRECTDRAWGUID: Result := 'The GUID passed to DirectDrawCreate is not a valid DirectDraw driver identifier.';
  6972.     DDERR_INVALIDMODE: Result := 'DirectDraw does not support the requested mode.';
  6973.     DDERR_INVALIDOBJECT: Result := 'DirectDraw received a pointer that was an invalid DIRECTDRAW object.';
  6974.     DDERR_INVALIDPARAMS: Result := 'One or more of the parameters passed to the function are incorrect.';
  6975.     DDERR_INVALIDPIXELFORMAT: Result := 'The pixel format was invalid as specified.';
  6976.     DDERR_INVALIDPOSITION: Result := 'Returned when the position of the overlay on the destination is no longer legal for that destination.';
  6977.     DDERR_INVALIDRECT: Result := 'Rectangle provided was invalid.';
  6978.     DDERR_LOCKEDSURFACES: Result := 'Operation could not be carried out because one or more surfaces are locked.';
  6979.     DDERR_NO3D: Result := 'There is no 3D present.';
  6980.     DDERR_NOALPHAHW: Result := 'Operation could not be carried out because there is no alpha accleration hardware present or available.';
  6981.     DDERR_NOBLTHW: Result := 'No blitter hardware present.';
  6982.     DDERR_NOCLIPLIST: Result := 'No cliplist available.';
  6983.     DDERR_NOCLIPPERATTACHED: Result := 'No clipper object attached to surface object.';
  6984.     DDERR_NOCOLORCONVHW: Result := 'Operation could not be carried out because there is no color conversion hardware present or available.';
  6985.     DDERR_NOCOLORKEY: Result := 'Surface does not currently have a color key';
  6986.     DDERR_NOCOLORKEYHW: Result := 'Operation could not be carried out because there is no hardware support of the destination color key.';
  6987.     DDERR_NOCOOPERATIVELEVELSET: Result := 'Create function called without DirectDraw object method SetCooperativeLevel being called.';
  6988.     DDERR_NODC: Result := 'No DC was ever created for this surface.';
  6989.     DDERR_NODDROPSHW: Result := 'No DirectDraw ROP hardware.';
  6990.     DDERR_NODIRECTDRAWHW: Result := 'A hardware-only DirectDraw object creation was attempted but the driver did not support any hardware.';
  6991.     DDERR_NOEMULATION: Result := 'Software emulation not available.';
  6992.     DDERR_NOEXCLUSIVEMODE: Result := 'Operation requires the application to have exclusive mode but the application does not have exclusive mode.';
  6993.     DDERR_NOFLIPHW: Result := 'Flipping visible surfaces is not supported.';
  6994.     DDERR_NOGDI: Result := 'There is no GDI present.';
  6995.     DDERR_NOHWND: Result := 'Clipper notification requires an HWND or no HWND has previously been set as the CooperativeLevel HWND.';
  6996.     DDERR_NOMIRRORHW: Result := 'Operation could not be carried out because there is no hardware present or available.';
  6997.     DDERR_NOOVERLAYDEST: Result := 'Returned when GetOverlayPosition is called on an overlay that UpdateOverlay has never been called on to establish a destination.';
  6998.     DDERR_NOOVERLAYHW: Result := 'Operation could not be carried out because there is no overlay hardware present or available.';
  6999.     DDERR_NOPALETTEATTACHED: Result := 'No palette object attached to this surface.';
  7000.     DDERR_NOPALETTEHW: Result := 'No hardware support for 16 or 256 color palettes.';
  7001.     DDERR_NORASTEROPHW: Result := 'Operation could not be carried out because there is no appropriate raster op hardware present or available.';
  7002.     DDERR_NOROTATIONHW: Result := 'Operation could not be carried out because there is no rotation hardware present or available.';
  7003.     DDERR_NOSTRETCHHW: Result := 'Operation could not be carried out because there is no hardware support for stretching.';
  7004.     DDERR_NOT4BITCOLOR: Result := 'DirectDrawSurface is not in 4 bit color palette and the requested operation requires 4 bit color palette.';
  7005.     DDERR_NOT4BITCOLORINDEX: Result := 'DirectDrawSurface is not in 4 bit color index palette and the requested operation requires 4 bit color index palette.';
  7006.     DDERR_NOT8BITCOLOR: Result := 'DirectDrawSurface is not in 8 bit color mode and the requested operation requires 8 bit color.';
  7007.     DDERR_NOTAOVERLAYSURFACE: Result := 'Returned when an overlay member is called for a non-overlay surface.';
  7008.     DDERR_NOTEXTUREHW: Result := 'Operation could not be carried out because there is no texture mapping hardware present or available.';
  7009.     DDERR_NOTFLIPPABLE: Result := 'An attempt has been made to flip a surface that is not flippable.';
  7010.     DDERR_NOTFOUND: Result := 'Requested item was not found.';
  7011.     DDERR_NOTLOCKED: Result := 'Surface was not locked.  An attempt to unlock a surface that was not locked at all, or by this process, has been attempted.';
  7012.     DDERR_NOTPALETTIZED: Result := 'The surface being used is not a palette-based surface.';
  7013.     DDERR_NOVSYNCHW: Result := 'Operation could not be carried out because there is no hardware support for vertical blank synchronized operations.';
  7014.     DDERR_NOZBUFFERHW: Result := 'Operation could not be carried out because there is no hardware support for zbuffer blitting.';
  7015.     DDERR_NOZOVERLAYHW: Result := 'Overlay surfaces could not be z layered based on their BltOrder because the hardware does not support z layering of overlays.';
  7016.     DDERR_OUTOFCAPS: Result := 'The hardware needed for the requested operation has already been allocated.';
  7017.     DDERR_OUTOFMEMORY: Result := 'DirectDraw does not have enough memory to perform the operation.';
  7018.     DDERR_OUTOFVIDEOMEMORY: Result := 'DirectDraw does not have enough memory to perform the operation.';
  7019.     DDERR_OVERLAYCANTCLIP: Result := 'The hardware does not support clipped overlays.';
  7020.     DDERR_OVERLAYCOLORKEYONLYONEACTIVE: Result := 'Can only have ony color key active at one time for overlays.';
  7021.     DDERR_OVERLAYNOTVISIBLE: Result := 'Returned when GetOverlayPosition is called on a hidden overlay.';
  7022.     DDERR_PALETTEBUSY: Result := 'Access to this palette is being refused because the palette is already locked by another thread.';
  7023.     DDERR_PRIMARYSURFACEALREADYEXISTS: Result := 'This process already has created a primary surface.';
  7024.     DDERR_REGIONTOOSMALL: Result := 'Region passed to Clipper::GetClipList is too small.';
  7025.     DDERR_SURFACEALREADYATTACHED: Result := 'This surface is already attached to the surface it is being attached to.';
  7026.     DDERR_SURFACEALREADYDEPENDENT: Result := 'This surface is already a dependency of the surface it is being made a dependency of.';
  7027.     DDERR_SURFACEBUSY: Result := 'Access to this surface is being refused because the surface is already locked by another thread.';
  7028.     DDERR_SURFACEISOBSCURED: Result := 'Access to surface refused because the surface is obscured.';
  7029.     DDERR_SURFACELOST: Result := 'Access to this surface is being refused because the surface memory is gone. The DirectDrawSurface object representing this surface should have Restore called on it.';
  7030.     DDERR_SURFACENOTATTACHED: Result := 'The requested surface is not attached.';
  7031.     DDERR_TOOBIGHEIGHT: Result := 'Height requested by DirectDraw is too large.';
  7032.     DDERR_TOOBIGSIZE: Result := 'Size requested by DirectDraw is too large, but the individual height and width are OK.';
  7033.     DDERR_TOOBIGWIDTH: Result := 'Width requested by DirectDraw is too large.';
  7034.     DDERR_UNSUPPORTED: Result := 'Action not supported.';
  7035.     DDERR_UNSUPPORTEDFORMAT: Result := 'FOURCC format requested is unsupported by DirectDraw.';
  7036.     DDERR_UNSUPPORTEDMASK: Result := 'Bitmask in the pixel format requested is unsupported by DirectDraw.';
  7037.     DDERR_VERTICALBLANKINPROGRESS: Result := 'Vertical blank is in progress.';
  7038.     DDERR_WASSTILLDRAWING: Result := 'Informs DirectDraw that the previous Blt which is transfering information to or from this Surface is incomplete.';
  7039.     DDERR_WRONGMODE: Result := 'This surface can not be restored because it was created in a different mode.';
  7040.     DDERR_XALIGN: Result := 'Rectangle provided was not horizontally aligned on required boundary.';
  7041.     // new:
  7042.     DDERR_OVERLAPPINGRECTS: Result := 'Operation could not be carried out because the source and destination rectangles are on the same surface and overlap each other.';
  7043.     DDERR_INVALIDSTREAM: Result := 'The specified stream contains invalid data';
  7044.     DDERR_UNSUPPORTEDMODE: Result := 'The display is currently in an unsupported mode';
  7045.     DDERR_NOMIPMAPHW: Result := 'Operation could not be carried out because there is no mip-map texture mapping hardware present or available.';
  7046.     DDERR_INVALIDSURFACETYPE: Result := 'The requested action could not be performed because the surface was of the wrong type.';
  7047.     DDERR_NOOPTIMIZEHW: Result := 'Device does not support optimized surfaces, therefore no video memory optimized surfaces';
  7048.     DDERR_NOTLOADED: Result := 'Surface is an optimized surface, but has not yet been allocated any memory';
  7049.     DDERR_NOFOCUSWINDOW: Result := 'Attempt was made to create or set a device window without first setting the focus window';
  7050.     DDERR_DCALREADYCREATED: Result := 'A DC has already been returned for this surface. Only one DC can be retrieved per surface.';
  7051.     DDERR_NONONLOCALVIDMEM: Result := 'An attempt was made to allocate non-local video memory from a device that does not support non-local video memory.';
  7052.     DDERR_CANTPAGELOCK: Result := 'The attempt to page lock a surface failed.';
  7053.     DDERR_CANTPAGEUNLOCK: Result := 'The attempt to page unlock a surface failed.';
  7054.     DDERR_NOTPAGELOCKED: Result := 'An attempt was made to page unlock a surface with no outstanding page locks.';
  7055.     DDERR_MOREDATA: Result := 'There is more data available than the specified buffer size could hold';
  7056.     DDERR_EXPIRED: Result := 'The data has expired and is therefore no longer valid.';
  7057.     DDERR_VIDEONOTACTIVE: Result := 'The video port is not active';
  7058.     DDERR_DEVICEDOESNTOWNSURFACE: Result := 'Surfaces created by one direct draw device cannot be used directly by another direct draw device.';
  7059.     DDERR_NOTINITIALIZED: Result := 'An attempt was made to invoke an interface member of a DirectDraw object created by CoCreateInstance() before it was initialized.';
  7060.     else Result := 'Unrecognized Error';
  7061.   end;
  7062. end;
  7063.  
  7064. {$IFDEF DIRECTDRAW_DYNAMIC_LINK}
  7065. var
  7066.   DirectDrawLib: THandle = 0;
  7067.  
  7068. function DirectDrawLoaded: Boolean;
  7069. begin
  7070.   Result:= DirectDrawLib <> 0;
  7071. end;
  7072.  
  7073. function UnLoadDirectDraw: Boolean;
  7074. begin
  7075.   Result:= True;
  7076.   if DirectDrawLoaded then
  7077.   begin
  7078.     Result:= FreeLibrary(DirectDrawLib);
  7079.  
  7080.     DirectDrawEnumerateA := nil;
  7081.     DirectDrawEnumerateW := nil;
  7082.     DirectDrawEnumerate := nil;
  7083.  
  7084.     DirectDrawEnumerateExA := nil;
  7085.     DirectDrawEnumerateExW := nil;
  7086.     DirectDrawEnumerateEx := nil;
  7087.  
  7088.     DirectDrawCreate := nil;
  7089.     DirectDrawCreateEx := nil;
  7090.     DirectDrawCreateClipper := nil;
  7091.     {$IFDEF WINNT}
  7092.     NtDirectDrawCreate := nil;
  7093.     {$ENDIF}
  7094.  
  7095.     DirectDrawLib:= 0;
  7096.   end;
  7097. end;
  7098.  
  7099. function LoadDirectDraw: Boolean;
  7100. begin
  7101.   Result:= DirectDrawLoaded;
  7102.   if (not Result) then
  7103.   begin
  7104.     DirectDrawLib:= LoadLibrary(DirectDrawDll);
  7105.     if DirectDrawLoaded then
  7106.     begin
  7107.       DirectDrawEnumerateA := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateA');
  7108.       DirectDrawEnumerateW := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateW');
  7109.       {$IFDEF UNICODE}
  7110.       DirectDrawEnumerate := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateW');
  7111.       {$ELSE}
  7112.       DirectDrawEnumerate := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateA');
  7113.       {$ENDIF}
  7114.  
  7115.       DirectDrawEnumerateExA := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateExA');
  7116.       DirectDrawEnumerateExW := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateExW');
  7117.       {$IFDEF UNICODE}
  7118.       DirectDrawEnumerateEx := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateExW');
  7119.       {$ELSE}
  7120.       DirectDrawEnumerateEx := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateExA');
  7121.       {$ENDIF}
  7122.  
  7123.       DirectDrawCreate := GetProcAddress(DDrawDLL,'DirectDrawCreate');
  7124.       DirectDrawCreateEx := GetProcAddress(DDrawDLL,'DirectDrawCreateEx');
  7125.       DirectDrawCreateClipper := GetProcAddress(DDrawDLL,'DirectDrawCreateClipper');
  7126.       {$IFDEF WINNT}
  7127.       NtDirectDrawCreate := GetProcAddress(DDrawDLL,'NtDirectDrawCreate');
  7128.       {$ENDIF}
  7129.  
  7130.       Result:= Assigned(DirectDrawCreate); // At least basic procedure is found!
  7131.       if not Result then UnLoadDirectDraw;
  7132.     end;
  7133.   end;
  7134. end;
  7135. {$ELSE}
  7136. function DirectDrawLoaded: Boolean;
  7137. begin // Stub function for static linking
  7138.   Result:= True;
  7139. end;
  7140.  
  7141. function UnLoadDirectDraw: Boolean;
  7142. begin // Stub function for static linking
  7143.   Result:= True; // should emulate "normal" behaviour
  7144. end;
  7145.  
  7146. function LoadDirectDraw: Boolean;
  7147. begin // Stub function for static linking
  7148.   Result:= True;
  7149. end;
  7150.  
  7151. {$ENDIF}
  7152.  
  7153. {$IFDEF DIRECTDRAW_DYNAMIC_LINK}
  7154. initialization
  7155. {$IFNDEF DIRECTDRAW_DYNAMIC_LINK_EXPLICIT}
  7156.   LoadDirectDraw;
  7157. {$ENDIF}
  7158. finalization
  7159.   UnLoadDirectDraw;
  7160. {$ENDIF}
  7161. end.
  7162.  
  7163.