home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 December / Chip_2001-12_cd1.bin / zkuste / delphi / kompon / d56 / CMDXCAP.ZIP / DirectDraw.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-09-16  |  207.7 KB  |  5,841 lines

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