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