Subversion Repositories spacemission

Rev

Rev 16 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. (*==========================================================================;
  2.  *
  3.  *  Copyright (C) 1994-1999 Microsoft Corporation.  All Rights Reserved.
  4.  *
  5.  *  DirectX header version 98.11.20
  6.  *
  7.  *  Present by Hiroyuki Hori.
  8.  *
  9.  *  E-Mail: hori@ingjapan.ne.jp
  10.  *  Homepage: http://www.ingjapan.ne.jp/hori/index.html
  11.  *  Homepage: http://www.ingjapan.ne.jp/hori/index-e.html
  12.  *
  13.  *  Present unit:
  14.  *    DirectX.pas    DirectX 7 (DirectX 7 SDK)
  15.  *    DShow.pas      DirectShow (DirectX Media SDK 5.1)
  16.  *    DAnim.pas      DirectAnimation (DirectX Media SDK 5.1)
  17.  *
  18.  *--------------------------------------------------------------------------
  19.  *
  20.  *    DirectMusic header version 1.0
  21.  *
  22.  *    Present by Kazuya Yamane
  23.  *
  24.  *    e-mail : kazuya-y@infosakyu.ne.jp
  25.  *    URL    : http://www.infosakyu.ne.jp/~kazuya-y/index.html
  26.  *
  27.  ***************************************************************************)
  28. {
  29. (c)2004 Jaro Benes Recompilation with Erik Unger's headers
  30.  
  31. Join in order:
  32.   1) DirectDraw
  33.   2) Direct3D
  34.   3) Direct3DRM
  35.   4) DirectInput
  36.   5) DirectPlay
  37.   6) DirectSetup
  38.   7) DirectSound
  39.   8) DirectMusic
  40. }
  41. Unit DirectX;
  42.  
  43. Interface
  44.  
  45. {Delphi version marks}
  46.  
  47. {$I DelphiXcfg.inc}
  48.  
  49. {$MINENUMSIZE 4}
  50. {$ALIGN ON}
  51.  
  52. uses
  53.   Windows, MMSystem;
  54.  
  55. type
  56. {$IFDEF UNICODE}
  57.   PCharAW = PWideChar;
  58. {$ELSE}
  59.   PCharAW = PAnsiChar;
  60. {$ENDIF}
  61.  
  62. //DirectDraw file
  63. (*==========================================================================;
  64.  *
  65.  *  Copyright (C) 1994-1997 Microsoft Corporation.  All Rights Reserved.
  66.  *
  67.  *  Files:      ddraw.h dvp.h
  68.  *  Content:    DirectDraw and DirectDrawVideoPort include files
  69.  *
  70.  *  DirectX 7.0 Delphi adaptation by Erik Unger
  71.  *
  72.  *  Modified: 10-Sep-2000
  73.  *
  74.  *  Download: http://www.delphi-jedi.org/DelphiGraphics/
  75.  *  E-Mail: DelphiDirectX@next-reality.com
  76.  *
  77.  *
  78.  ***************************************************************************)
  79.  
  80. var
  81.   DDrawDLL : HMODULE = 0;
  82.  
  83. function DDErrorString(Value: HResult) : string;
  84.  
  85. function MAKEFOURCC(ch0, ch1, ch2, ch3: Char) : DWORD;
  86.  
  87. (*
  88.  * FOURCC codes for DX compressed-texture pixel formats
  89.  *)
  90. const
  91.   FOURCC_DXT1 = 'DXT1';
  92.   FOURCC_DXT2 = 'DXT2';
  93.   FOURCC_DXT3 = 'DXT3';
  94.   FOURCC_DXT4 = 'DXT4';
  95.   FOURCC_DXT5 = 'DXT5';
  96.  
  97. (*
  98.  * GUIDS used by DirectDraw objects
  99.  *)
  100. const
  101.   CLSID_DirectDraw: TGUID = '{D7B70EE0-4340-11CF-B063-0020AFC2CD35}';
  102.   CLSID_DirectDraw7: TGUID = '{3c305196-50db-11d3-9cfe-00c04fd930c5}';
  103.   CLSID_DirectDrawClipper: TGUID = '{593817A0-7DB3-11CF-A2DE-00AA00b93356}';
  104.  
  105. const
  106.   DD_ROP_SPACE = (256 div 32);       // space required to store ROP array
  107.  
  108.   MAX_DDDEVICEID_STRING = 512;
  109.  
  110. (*
  111.  * Flags for the IDirectDraw4::GetDeviceIdentifier method
  112.  *)
  113.  
  114. (*
  115.  * This flag causes GetDeviceIdentifier to return information about the host (typically 2D) adapter in a system equipped
  116.  * with a stacked secondary 3D adapter. Such an adapter appears to the application as if it were part of the
  117.  * host adapter, but is typically physcially located on a separate card. The stacked secondary's information is
  118.  * returned when GetDeviceIdentifier's dwFlags field is zero, since this most accurately reflects the qualities
  119.  * of the DirectDraw object involved.
  120.  *)
  121.   DDGDI_GETHOSTIDENTIFIER         = $00000001;
  122.  
  123. (*============================================================================
  124.  *
  125.  * DirectDraw Structures
  126.  *
  127.  * Various structures used to invoke DirectDraw.
  128.  *
  129.  *==========================================================================*)
  130.  
  131. var
  132.   NilGUID : TGUID{$IfNDef VER6UP} absolute 0{$EndIf};
  133.  
  134. type
  135.   TRefGUID = packed record
  136.     case integer of
  137.     1: (guid : PGUID);
  138.     2: (dwFlags : DWORD);
  139.   end;
  140.  
  141.   IDirectDraw = interface;
  142.   IDirectDraw2 = interface;
  143.   IDirectDraw4 = interface;
  144.   IDirectDraw7 = interface;
  145.   IDirectDrawSurface = interface;
  146.   IDirectDrawSurface2 = interface;
  147.   IDirectDrawSurface3 = interface;
  148.   IDirectDrawSurface4 = interface;
  149.   IDirectDrawSurface7 = interface;
  150.  
  151.   IDirectDrawPalette = interface;
  152.   IDirectDrawClipper = interface;
  153.   IDirectDrawColorControl = interface;
  154.   IDirectDrawGammaControl = interface;
  155.  
  156. (*
  157.  * Generic pixel format with 8-bit RGB and alpha components
  158.  *)
  159.   PDDARGB = ^TDDARGB;
  160.   TDDARGB = packed record
  161.     blue:     BYTE;
  162.     green:    BYTE;
  163.     red:      BYTE;
  164.     alpha:    BYTE;
  165.   end;
  166.  
  167. (*
  168.  * This version of the structure remains for backwards source compatibility.
  169.  * The DDARGB structure is the one that should be used for all DirectDraw APIs.
  170.  *)
  171.   PDDRGBA = ^TDDRGBA;
  172.   TDDRGBA = packed record
  173.     red   : BYTE;
  174.     green : BYTE;
  175.     blue  : BYTE;
  176.     alpha : BYTE;
  177.   end;
  178.  
  179. (*
  180.  * TDDColorKey
  181.  *)
  182.   PDDColorKey = ^TDDColorKey;
  183.   TDDColorKey = packed record
  184.     dwColorSpaceLowValue: DWORD;   // low boundary of color space that is to
  185.                                    // be treated as Color Key, inclusive
  186.     dwColorSpaceHighValue: DWORD;  // high boundary of color space that is
  187.                                    // to be treated as Color Key, inclusive
  188.   end;
  189.  
  190. // Delphi 5 can't handle interface in variant records
  191. // so we have to use pointers instead (which can be type-casted into interfaces):
  192.  
  193. {$IFDEF VER5UP}
  194.   PDirectDrawSurface = Pointer;              
  195. {$ELSE}
  196.   PDirectDrawSurface = IDirectDrawSurface;
  197. {$ENDIF}
  198.  
  199. (*
  200.  * TDDBltFX
  201.  * Used to pass override information to the DIRECTDRAWSURFACE callback Blt.
  202.  *)
  203.   PDDBltFX = ^TDDBltFX;
  204.   TDDBltFX = packed record
  205.     dwSize                        : DWORD;     // size of structure
  206.     dwDDFX                        : DWORD;     // FX operations
  207.     dwROP                         : DWORD;     // Win32 raster operations
  208.     dwDDROP                       : DWORD;     // Raster operations new for DirectDraw
  209.     dwRotationAngle               : DWORD;     // Rotation angle for blt
  210.     dwZBufferOpCode               : DWORD;     // ZBuffer compares
  211.     dwZBufferLow                  : DWORD;     // Low limit of Z buffer
  212.     dwZBufferHigh                 : DWORD;     // High limit of Z buffer
  213.     dwZBufferBaseDest             : DWORD;     // Destination base value
  214.     dwZDestConstBitDepth          : DWORD;     // Bit depth used to specify Z constant for destination
  215.     case integer of
  216.     0: (
  217.       dwZDestConst                : DWORD      // Constant to use as Z buffer for dest
  218.      );
  219.     1: (
  220.       lpDDSZBufferDest            : PDirectDrawSurface; // Surface to use as Z buffer for dest
  221.       dwZSrcConstBitDepth         : DWORD;     // Bit depth used to specify Z constant for source
  222.       case integer of
  223.       0: (
  224.         dwZSrcConst               : DWORD;     // Constant to use as Z buffer for src
  225.        );
  226.       1: (
  227.         lpDDSZBufferSrc           : PDirectDrawSurface; // Surface to use as Z buffer for src
  228.         dwAlphaEdgeBlendBitDepth  : DWORD;     // Bit depth used to specify constant for alpha edge blend
  229.         dwAlphaEdgeBlend          : DWORD;     // Alpha for edge blending
  230.         dwReserved                : DWORD;
  231.         dwAlphaDestConstBitDepth  : DWORD;     // Bit depth used to specify alpha constant for destination
  232.         case integer of
  233.         0: (
  234.           dwAlphaDestConst        : DWORD;     // Constant to use as Alpha Channel
  235.          );
  236.         1: (
  237.           lpDDSAlphaDest          : PDirectDrawSurface; // Surface to use as Alpha Channel
  238.           dwAlphaSrcConstBitDepth : DWORD;     // Bit depth used to specify alpha constant for source
  239.           case integer of
  240.           0: (
  241.             dwAlphaSrcConst       : DWORD;     // Constant to use as Alpha Channel
  242.           );
  243.           1: (
  244.             lpDDSAlphaSrc         : PDirectDrawSurface; // Surface to use as Alpha Channel
  245.             case integer of
  246.             0: (
  247.               dwFillColor         : DWORD;     // color in RGB or Palettized
  248.             );
  249.             1: (
  250.               dwFillDepth         : DWORD;     // depth value for z-buffer
  251.             );
  252.             2: (
  253.               dwFillPixel         : DWORD;     // pixel value
  254.             );
  255.             3: (
  256.               lpDDSPattern        : PDirectDrawSurface; // Surface to use as pattern
  257.               ddckDestColorkey    : TDDColorKey; // DestColorkey override
  258.               ddckSrcColorkey     : TDDColorKey; // SrcColorkey override
  259.             )
  260.         )
  261.       )
  262.     )
  263.   )
  264.   end;
  265.  
  266. (*
  267.  * TDDSCaps
  268.  *)
  269.   PDDSCaps = ^TDDSCaps;
  270.   TDDSCaps = packed record
  271.     dwCaps: DWORD;         // capabilities of surface wanted
  272.   end;
  273.  
  274. (*
  275.  * TDDOSCaps
  276.  *)
  277.   PDDOSCaps = ^TDDOSCaps;
  278.   TDDOSCaps = packed record
  279.     dwCaps: DWORD;         // capabilities of surface wanted
  280.   end;
  281.  
  282. (*
  283.  * This structure is used internally by DirectDraw.
  284.  *)
  285.   PDDSCapsEx = ^TDDSCapsEx;
  286.   TDDSCapsEx = packed record
  287.     dwCaps2 : DWORD;
  288.     dwCaps3 : DWORD;
  289.     dwCaps4 : DWORD;
  290.   end;
  291.  
  292. (*
  293.  * TDDSCaps2
  294.  *)
  295.   PDDSCaps2 = ^TDDSCaps2;
  296.   TDDSCaps2 = packed record
  297.     dwCaps: DWORD;         // capabilities of surface wanted
  298.     dwCaps2 : DWORD;
  299.     dwCaps3 : DWORD;
  300.     dwCaps4 : DWORD;
  301.   end;
  302.  
  303. (*
  304.  * TDDCaps
  305.  *)
  306. (*
  307.  * This structure is the TDDCaps structure as it was in version 2 and 3 of Direct X.
  308.  * It is present for back compatability.
  309.  *)
  310.   PDDCaps_DX3 = ^TDDCaps_DX3;
  311.   TDDCaps_DX3 = packed record
  312.     dwSize: DWORD;                 // size of the DDDRIVERCAPS structure
  313.     dwCaps: DWORD;                 // driver specific capabilities
  314.     dwCaps2: DWORD;                // more driver specific capabilites
  315.     dwCKeyCaps: DWORD;             // color key capabilities of the surface
  316.     dwFXCaps: DWORD;               // driver specific stretching and effects capabilites
  317.     dwFXAlphaCaps: DWORD;          // alpha driver specific capabilities
  318.     dwPalCaps: DWORD;              // palette capabilities
  319.     dwSVCaps: DWORD;               // stereo vision capabilities
  320.     dwAlphaBltConstBitDepths: DWORD;       // DDBD_2,4,8
  321.     dwAlphaBltPixelBitDepths: DWORD;       // DDBD_1,2,4,8
  322.     dwAlphaBltSurfaceBitDepths: DWORD;     // DDBD_1,2,4,8
  323.     dwAlphaOverlayConstBitDepths: DWORD;   // DDBD_2,4,8
  324.     dwAlphaOverlayPixelBitDepths: DWORD;   // DDBD_1,2,4,8
  325.     dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  326.     dwZBufferBitDepths: DWORD;             // DDBD_8,16,24,32
  327.     dwVidMemTotal: DWORD;          // total amount of video memory
  328.     dwVidMemFree: DWORD;           // amount of free video memory
  329.     dwMaxVisibleOverlays: DWORD;   // maximum number of visible overlays
  330.     dwCurrVisibleOverlays: DWORD;  // current number of visible overlays
  331.     dwNumFourCCCodes: DWORD;       // number of four cc codes
  332.     dwAlignBoundarySrc: DWORD;     // source rectangle alignment
  333.     dwAlignSizeSrc: DWORD;         // source rectangle byte size
  334.     dwAlignBoundaryDest: DWORD;    // dest rectangle alignment
  335.     dwAlignSizeDest: DWORD;        // dest rectangle byte size
  336.     dwAlignStrideAlign: DWORD;     // stride alignment
  337.     dwRops: Array [0..DD_ROP_SPACE-1] of DWORD;   // ROPS supported
  338.     ddsCaps: TDDSCaps;             // TDDSCaps structure has all the general capabilities
  339.     dwMinOverlayStretch: DWORD;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  340.     dwMaxOverlayStretch: DWORD;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  341.     dwMinLiveVideoStretch: DWORD;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  342.     dwMaxLiveVideoStretch: DWORD;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  343.     dwMinHwCodecStretch: DWORD;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  344.     dwMaxHwCodecStretch: DWORD;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  345.     dwReserved1: DWORD;            // reserved
  346.     dwReserved2: DWORD;            // reserved
  347.     dwReserved3: DWORD;            // reserved
  348.     dwSVBCaps: DWORD;              // driver specific capabilities for System->Vmem blts
  349.     dwSVBCKeyCaps: DWORD;          // driver color key capabilities for System->Vmem blts
  350.     dwSVBFXCaps: DWORD;            // driver FX capabilities for System->Vmem blts
  351.     dwSVBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
  352.     dwVSBCaps: DWORD;              // driver specific capabilities for Vmem->System blts
  353.     dwVSBCKeyCaps: DWORD;          // driver color key capabilities for Vmem->System blts
  354.     dwVSBFXCaps: DWORD;            // driver FX capabilities for Vmem->System blts
  355.     dwVSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
  356.     dwSSBCaps: DWORD;              // driver specific capabilities for System->System blts
  357.     dwSSBCKeyCaps: DWORD;          // driver color key capabilities for System->System blts
  358.     dwSSBFXCaps: DWORD;            // driver FX capabilities for System->System blts
  359.     dwSSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
  360.     dwReserved4 : DWORD;
  361.     dwReserved5 : DWORD;
  362.     dwReserved6 : DWORD;
  363.   end;
  364.  
  365. (*
  366.  * This structure is the TDDCaps structure as it was in version 5 of Direct X.
  367.  * It is present for back compatability.
  368.  *)
  369.   PDDCaps_DX5 = ^TDDCaps_DX5;
  370.   TDDCaps_DX5 = packed record
  371.     dwSize: DWORD;                 // size of the DDDRIVERCAPS structure
  372.     dwCaps: DWORD;                 // driver specific capabilities
  373.     dwCaps2: DWORD;                // more driver specific capabilites
  374.     dwCKeyCaps: DWORD;             // color key capabilities of the surface
  375.     dwFXCaps: DWORD;               // driver specific stretching and effects capabilites
  376.     dwFXAlphaCaps: DWORD;          // alpha driver specific capabilities
  377.     dwPalCaps: DWORD;              // palette capabilities
  378.     dwSVCaps: DWORD;               // stereo vision capabilities
  379.     dwAlphaBltConstBitDepths: DWORD;       // DDBD_2,4,8
  380.     dwAlphaBltPixelBitDepths: DWORD;       // DDBD_1,2,4,8
  381.     dwAlphaBltSurfaceBitDepths: DWORD;     // DDBD_1,2,4,8
  382.     dwAlphaOverlayConstBitDepths: DWORD;   // DDBD_2,4,8
  383.     dwAlphaOverlayPixelBitDepths: DWORD;   // DDBD_1,2,4,8
  384.     dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  385.     dwZBufferBitDepths: DWORD;             // DDBD_8,16,24,32
  386.     dwVidMemTotal: DWORD;          // total amount of video memory
  387.     dwVidMemFree: DWORD;           // amount of free video memory
  388.     dwMaxVisibleOverlays: DWORD;   // maximum number of visible overlays
  389.     dwCurrVisibleOverlays: DWORD;  // current number of visible overlays
  390.     dwNumFourCCCodes: DWORD;       // number of four cc codes
  391.     dwAlignBoundarySrc: DWORD;     // source rectangle alignment
  392.     dwAlignSizeSrc: DWORD;         // source rectangle byte size
  393.     dwAlignBoundaryDest: DWORD;    // dest rectangle alignment
  394.     dwAlignSizeDest: DWORD;        // dest rectangle byte size
  395.     dwAlignStrideAlign: DWORD;     // stride alignment
  396.     dwRops: Array [0..DD_ROP_SPACE-1] of DWORD;   // ROPS supported
  397.     ddsCaps: TDDSCaps;             // TDDSCaps structure has all the general capabilities
  398.     dwMinOverlayStretch: DWORD;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  399.     dwMaxOverlayStretch: DWORD;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  400.     dwMinLiveVideoStretch: DWORD;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  401.     dwMaxLiveVideoStretch: DWORD;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  402.     dwMinHwCodecStretch: DWORD;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  403.     dwMaxHwCodecStretch: DWORD;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  404.     dwReserved1: DWORD;            // reserved
  405.     dwReserved2: DWORD;            // reserved
  406.     dwReserved3: DWORD;            // reserved
  407.     dwSVBCaps: DWORD;              // driver specific capabilities for System->Vmem blts
  408.     dwSVBCKeyCaps: DWORD;          // driver color key capabilities for System->Vmem blts
  409.     dwSVBFXCaps: DWORD;            // driver FX capabilities for System->Vmem blts
  410.     dwSVBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
  411.     dwVSBCaps: DWORD;              // driver specific capabilities for Vmem->System blts
  412.     dwVSBCKeyCaps: DWORD;          // driver color key capabilities for Vmem->System blts
  413.     dwVSBFXCaps: DWORD;            // driver FX capabilities for Vmem->System blts
  414.     dwVSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
  415.     dwSSBCaps: DWORD;              // driver specific capabilities for System->System blts
  416.     dwSSBCKeyCaps: DWORD;          // driver color key capabilities for System->System blts
  417.     dwSSBFXCaps: DWORD;            // driver FX capabilities for System->System blts
  418.     dwSSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
  419.     // Members added for DX5:
  420.     dwMaxVideoPorts: DWORD;        // maximum number of usable video ports
  421.     dwCurrVideoPorts: DWORD;       // current number of video ports used
  422.     dwSVBCaps2: DWORD;             // more driver specific capabilities for System->Vmem blts
  423.     dwNLVBCaps: DWORD;             // driver specific capabilities for non-local->local vidmem blts
  424.     dwNLVBCaps2: DWORD;            // more driver specific capabilities non-local->local vidmem blts
  425.     dwNLVBCKeyCaps: DWORD;         // driver color key capabilities for non-local->local vidmem blts
  426.     dwNLVBFXCaps: DWORD;           // driver FX capabilities for non-local->local blts
  427.     dwNLVBRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for non-local->local blts
  428.   end;
  429.  
  430.   PDDCaps_DX6 = ^TDDCaps_DX6;
  431.   TDDCaps_DX6 = packed record
  432.     dwSize: DWORD;                 // size of the DDDRIVERCAPS structure
  433.     dwCaps: DWORD;                 // driver specific capabilities
  434.     dwCaps2: DWORD;                // more driver specific capabilites
  435.     dwCKeyCaps: DWORD;             // color key capabilities of the surface
  436.     dwFXCaps: DWORD;               // driver specific stretching and effects capabilites
  437.     dwFXAlphaCaps: DWORD;          // alpha driver specific capabilities
  438.     dwPalCaps: DWORD;              // palette capabilities
  439.     dwSVCaps: DWORD;               // stereo vision capabilities
  440.     dwAlphaBltConstBitDepths: DWORD;       // DDBD_2,4,8
  441.     dwAlphaBltPixelBitDepths: DWORD;       // DDBD_1,2,4,8
  442.     dwAlphaBltSurfaceBitDepths: DWORD;     // DDBD_1,2,4,8
  443.     dwAlphaOverlayConstBitDepths: DWORD;   // DDBD_2,4,8
  444.     dwAlphaOverlayPixelBitDepths: DWORD;   // DDBD_1,2,4,8
  445.     dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  446.     dwZBufferBitDepths: DWORD;             // DDBD_8,16,24,32
  447.     dwVidMemTotal: DWORD;          // total amount of video memory
  448.     dwVidMemFree: DWORD;           // amount of free video memory
  449.     dwMaxVisibleOverlays: DWORD;   // maximum number of visible overlays
  450.     dwCurrVisibleOverlays: DWORD;  // current number of visible overlays
  451.     dwNumFourCCCodes: DWORD;       // number of four cc codes
  452.     dwAlignBoundarySrc: DWORD;     // source rectangle alignment
  453.     dwAlignSizeSrc: DWORD;         // source rectangle byte size
  454.     dwAlignBoundaryDest: DWORD;    // dest rectangle alignment
  455.     dwAlignSizeDest: DWORD;        // dest rectangle byte size
  456.     dwAlignStrideAlign: DWORD;     // stride alignment
  457.     dwRops: Array [0..DD_ROP_SPACE-1] of DWORD;   // ROPS supported
  458.     ddsOldCaps: TDDSCaps;          // Was dssCaps: TDDSCaps. ddsCaps is of type TDDScaps2 for DX6
  459.     dwMinOverlayStretch: DWORD;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  460.     dwMaxOverlayStretch: DWORD;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  461.     dwMinLiveVideoStretch: DWORD;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  462.     dwMaxLiveVideoStretch: DWORD;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  463.     dwMinHwCodecStretch: DWORD;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  464.     dwMaxHwCodecStretch: DWORD;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  465.     dwReserved1: DWORD;            // reserved
  466.     dwReserved2: DWORD;            // reserved
  467.     dwReserved3: DWORD;            // reserved
  468.     dwSVBCaps: DWORD;              // driver specific capabilities for System->Vmem blts
  469.     dwSVBCKeyCaps: DWORD;          // driver color key capabilities for System->Vmem blts
  470.     dwSVBFXCaps: DWORD;            // driver FX capabilities for System->Vmem blts
  471.     dwSVBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
  472.     dwVSBCaps: DWORD;              // driver specific capabilities for Vmem->System blts
  473.     dwVSBCKeyCaps: DWORD;          // driver color key capabilities for Vmem->System blts
  474.     dwVSBFXCaps: DWORD;            // driver FX capabilities for Vmem->System blts
  475.     dwVSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
  476.     dwSSBCaps: DWORD;              // driver specific capabilities for System->System blts
  477.     dwSSBCKeyCaps: DWORD;          // driver color key capabilities for System->System blts
  478.     dwSSBFXCaps: DWORD;            // driver FX capabilities for System->System blts
  479.     dwSSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
  480.     // Members added for DX5:
  481.     dwMaxVideoPorts: DWORD;        // maximum number of usable video ports
  482.     dwCurrVideoPorts: DWORD;       // current number of video ports used
  483.     dwSVBCaps2: DWORD;             // more driver specific capabilities for System->Vmem blts
  484.     dwNLVBCaps: DWORD;             // driver specific capabilities for non-local->local vidmem blts
  485.     dwNLVBCaps2: DWORD;            // more driver specific capabilities non-local->local vidmem blts
  486.     dwNLVBCKeyCaps: DWORD;         // driver color key capabilities for non-local->local vidmem blts
  487.     dwNLVBFXCaps: DWORD;           // driver FX capabilities for non-local->local blts
  488.     dwNLVBRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for non-local->local blts
  489.     // Members added for DX6 release
  490.     ddsCaps : TDDSCaps2 ;          // Surface Caps
  491.   end;
  492.  
  493.   TDDCaps_DX7 = TDDCaps_DX6;
  494.  
  495.   PDDCaps = ^TDDCaps;
  496.  
  497. {$IFDEF DIRECTX3}
  498.   TDDCaps = TDDCaps_DX3;
  499. {$ELSE}
  500.   {$IFDEF DIRECTX5}
  501.     TDDCaps = TDDCaps_DX5;
  502.   {$ELSE}
  503.     {$IFDEF DIRECTX6}
  504.       TDDCaps = TDDCaps_DX6;
  505.     {$ELSE}
  506.       TDDCaps = TDDCaps_DX7;
  507.     {$ENDIF}
  508.   {$ENDIF}
  509. {$ENDIF}
  510.  
  511.  
  512.  
  513.  
  514. (*
  515.  * TDDPixelFormat
  516.  *)
  517.   PDDPixelFormat_DX5 = ^TDDPixelFormat_DX5;
  518.   TDDPixelFormat_DX5 = packed record
  519.     dwSize: DWORD;                 // size of structure
  520.     dwFlags: DWORD;                // pixel format flags
  521.     dwFourCC: DWORD;               // (FOURCC code)
  522.     case Integer of
  523.     0: (
  524.       dwZBufferBitDepth: DWORD;      // how many bits for z buffers
  525.      );
  526.     1: (
  527.       dwAlphaBitDepth: DWORD;        // how many bits for alpha channels
  528.      );
  529.     2: (
  530.       dwRGBBitCount: DWORD;          // how many bits per pixel
  531.       dwRBitMask: DWORD;             // mask for red bit
  532.       dwGBitMask: DWORD;             // mask for green bits
  533.       dwBBitMask: DWORD;             // mask for blue bits
  534.       dwRGBAlphaBitMask: DWORD;      // mask for alpha channel
  535.      );
  536.     3: (
  537.       dwYUVBitCount: DWORD;          // how many bits per pixel
  538.       dwYBitMask: DWORD;             // mask for Y bits
  539.       dwUBitMask: DWORD;             // mask for U bits
  540.       dwVBitMask: DWORD;             // mask for V bits
  541.       case Integer of
  542.       0: (
  543.         dwYUVAlphaBitMask: DWORD;      // mask for alpha channel
  544.        );
  545.       1: (
  546.         dwRGBZBitMask: DWORD;
  547.        );
  548.       2: (
  549.         dwYUVZBitMask: DWORD;
  550.        );
  551.      );
  552.   end;
  553.  
  554.   PDDPixelFormat_DX6 = ^TDDPixelFormat_DX6;
  555.   TDDPixelFormat_DX6 = packed record
  556.     dwSize: DWORD;                 // size of structure
  557.     dwFlags: DWORD;                // pixel format flags
  558.     dwFourCC: DWORD;               // (FOURCC code)
  559.     case Integer of
  560.       1: (
  561.           dwRGBBitCount : DWORD;  // how many bits per pixel
  562.           dwRBitMask : DWORD;  // mask for red bit
  563.           dwGBitMask : DWORD;  // mask for green bits
  564.           dwBBitMask : DWORD;  // mask for blue bits
  565.           dwRGBAlphaBitMask : DWORD; // mask for alpha channel
  566.           );
  567.       2: (
  568.           dwYUVBitCount : DWORD;  // how many bits per pixel
  569.           dwYBitMask : DWORD;  // mask for Y bits
  570.           dwUBitMask : DWORD;  // mask for U bits
  571.           dwVBitMask : DWORD;  // mask for V bits
  572.           dwYUVAlphaBitMask : DWORD; // mask for alpha channel
  573.           );
  574.       3: (
  575.           dwZBufferBitDepth : DWORD; // how many total bits/pixel in z buffer (including any stencil bits)
  576.           dwStencilBitDepth : DWORD; // how many stencil bits (note: dwZBufferBitDepth-dwStencilBitDepth is total Z-only bits)
  577.           dwZBitMask : DWORD;  // mask for Z bits
  578.           dwStencilBitMask : DWORD; // mask for stencil bits
  579.           dwLuminanceAlphaBitMask : DWORD;// mask for alpha channel
  580.           );
  581.       4: (
  582.           dwAlphaBitDepth : DWORD; // how many bits for alpha channels
  583.           dwLuminanceBitMask : DWORD; // mask for luminance bits
  584.           dwBumpDvBitMask : DWORD;        // mask for bump map V delta bits
  585.           dwBumpLuminanceBitMask : DWORD; // mask for luminance in bump map
  586.           dwRGBZBitMask : DWORD;  // mask for Z channel
  587.           );
  588.       5: (
  589.            dwLuminanceBitCount : DWORD; // how many bits per pixel
  590.            dwBumpDuBitMask : DWORD;       // mask for bump map U delta bits
  591.            Fill1, Fill2    : DWORD;
  592.            dwYUVZBitMask   : DWORD;  // mask for Z channel
  593.          );
  594.       6: ( dwBumpBitCount  : DWORD;         // how many bits per "buxel", total
  595.          );
  596.   end;
  597.  
  598.   TDDPixelFormat_DX3 = TDDPixelFormat_DX5;
  599.   TDDPixelFormat_DX7 = TDDPixelFormat_DX6;
  600.  
  601.   PDDPixelFormat = ^TDDPixelFormat;
  602. {$IFDEF DIRECTX3}
  603.   TDDPixelFormat = TDDPixelFormat_DX3;
  604. {$ELSE}
  605.   {$IFDEF DIRECTX5}
  606.     TDDPixelFormat = TDDPixelFormat_DX5;
  607.   {$ELSE}
  608.     {$IFDEF DIRECTX6}
  609.       TDDPixelFormat = TDDPixelFormat_DX6;
  610.     {$ELSE}
  611.       TDDPixelFormat = TDDPixelFormat_DX7;
  612.     {$ENDIF}
  613.   {$ENDIF}
  614. {$ENDIF}
  615.  
  616. (*
  617.  * TDDOverlayFX
  618.  *)
  619.   PDDOverlayFX = ^TDDOverlayFX;
  620.   TDDOverlayFX = packed record
  621.     dwSize: DWORD;                         // size of structure
  622.     dwAlphaEdgeBlendBitDepth: DWORD;       // Bit depth used to specify constant for alpha edge blend
  623.     dwAlphaEdgeBlend: DWORD;               // Constant to use as alpha for edge blend
  624.     dwReserved: DWORD;
  625.     dwAlphaDestConstBitDepth: DWORD;       // Bit depth used to specify alpha constant for destination
  626.     case Integer of
  627.     0: (
  628.       dwAlphaDestConst: DWORD;               // Constant to use as alpha channel for dest
  629.       dwAlphaSrcConstBitDepth: DWORD;        // Bit depth used to specify alpha constant for source
  630.       dwAlphaSrcConst: DWORD;                // Constant to use as alpha channel for src
  631.       dckDestColorkey: TDDColorKey;                // DestColorkey override
  632.       dckSrcColorkey: TDDColorKey;                 // DestColorkey override
  633.       dwDDFX: DWORD;                         // Overlay FX
  634.       dwFlags: DWORD;                        // flags
  635.      );
  636.     1: (
  637.       lpDDSAlphaDest: PDirectDrawSurface;     // Surface to use as alpha channel for dest
  638.       filler: DWORD;
  639.       lpDDSAlphaSrc: PDirectDrawSurface;      // Surface to use as alpha channel for src
  640.      );
  641.   end;
  642.  
  643. (*
  644.  * TDDBltBatch: BltBatch entry structure
  645.  *)
  646.   PDDBltBatch = ^TDDBltBatch;
  647.   TDDBltBatch = packed record
  648.     lprDest: PRect;
  649.     lpDDSSrc: IDirectDrawSurface;
  650.     lprSrc: PRect;
  651.     dwFlags: DWORD;
  652.     lpDDBltFx: TDDBltFX;
  653.   end;
  654.  
  655. (*
  656.  * TDDGammaRamp
  657.  *)
  658.   PDDGammaRamp = ^TDDGammaRamp;
  659.   TDDGammaRamp = packed record
  660.     red   : array[0..255] of WORD;
  661.     green : array[0..255] of WORD;
  662.     blue  : array[0..255] of WORD;
  663.   end;
  664.  
  665. (*
  666.  *  This is the structure within which DirectDraw returns data about the current graphics driver and chipset
  667.  *)
  668.  
  669.   PDDDeviceIdentifier = ^TDDDeviceIdentifier;
  670.   TDDDeviceIdentifier = 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.   end;
  712.  
  713.   PDDDeviceIdentifier2 = ^TDDDeviceIdentifier2;
  714.   TDDDeviceIdentifier2 = packed record
  715.     //
  716.     // These elements are for presentation to the user only. They should not be used to identify particular
  717.     // drivers, since this is unreliable and many different strings may be associated with the same
  718.     // device, and the same driver from different vendors.
  719.     //
  720.     szDriver: array[0..MAX_DDDEVICEID_STRING-1] of Char;
  721.     szDescription: array[0..MAX_DDDEVICEID_STRING-1] of Char;
  722.  
  723.     //
  724.     // This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons
  725.     // on the whole 64 bits. Caution should be exercised if you use this element to identify problematic
  726.     // drivers. It is recommended that guidDeviceIdentifier is used for this purpose.
  727.     //
  728.     // This version has the form:
  729.     //  wProduct = HIWORD(liDriverVersion.HighPart)
  730.     //  wVersion = LOWORD(liDriverVersion.HighPart)
  731.     //  wSubVersion = HIWORD(liDriverVersion.LowPart)
  732.     //  wBuild = LOWORD(liDriverVersion.LowPart)
  733.     //
  734.     liDriverVersion: TLargeInteger;     // Defined for applications and other 32 bit components
  735.  
  736.     //
  737.     // These elements can be used to identify particular chipsets. Use with extreme caution.
  738.     //   dwVendorId     Identifies the manufacturer. May be zero if unknown.
  739.     //   dwDeviceId     Identifies the type of chipset. May be zero if unknown.
  740.     //   dwSubSysId     Identifies the subsystem, typically this means the particular board. May be zero if unknown.
  741.     //   dwRevision     Identifies the revision level of the chipset. May be zero if unknown.
  742.     //
  743.     dwVendorId: DWORD;
  744.     dwDeviceId: DWORD;
  745.     dwSubSysId: DWORD;
  746.     dwRevision: DWORD;
  747.  
  748.     //
  749.     // This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the
  750.     // driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to
  751.     // reprofile the graphics subsystem.
  752.     // This element can also be used to identify particular problematic drivers.
  753.     //
  754.     guidDeviceIdentifier: TGUID;
  755.  
  756.     (*
  757.      * This element is used to determine the Windows Hardware Quality Lab (WHQL)
  758.      * certification level for this driver/device pair.
  759.      *)
  760.     dwWHQLLevel: DWORD;
  761.   end;
  762.  
  763. (*
  764.  * callbacks
  765.  *)
  766.   TClipperCallback = function(lpDDClipper: IDirectDrawClipper; hWnd: HWND;
  767.       Code: DWORD; lpContext: Pointer): HResult; stdcall;
  768.   TSurfacesStreamingCallback = function(Arg: DWORD): HResult; stdcall;
  769.  
  770. (*
  771.  * TDDSurfaceDesc
  772.  *)
  773.   PDDSurfaceDesc_DX5 = ^TDDSurfaceDesc_DX5;
  774.   TDDSurfaceDesc_DX5 = packed record
  775.     dwSize: DWORD;                 // size of the TDDSurfaceDesc structure
  776.     dwFlags: DWORD;                // determines what fields are valid
  777.     dwHeight: DWORD;               // height of surface to be created
  778.     dwWidth: DWORD;                // width of input surface
  779.     case Integer of
  780.     0: (
  781.       dwLinearSize : DWORD;       // unused at the moment
  782.      );
  783.     1: (
  784.       lPitch: LongInt;                 // distance to start of next line (return value only)
  785.       dwBackBufferCount: DWORD;      // number of back buffers requested
  786.       case Integer of
  787.       0: (
  788.         dwMipMapCount: DWORD;          // number of mip-map levels requested
  789.         dwAlphaBitDepth: DWORD;        // depth of alpha buffer requested
  790.         dwReserved: DWORD;             // reserved
  791.         lpSurface: Pointer;              // pointer to the associated surface memory
  792.         ddckCKDestOverlay: TDDColorKey;      // color key for destination overlay use
  793.         ddckCKDestBlt: TDDColorKey;          // color key for destination blt use
  794.         ddckCKSrcOverlay: TDDColorKey;       // color key for source overlay use
  795.         ddckCKSrcBlt: TDDColorKey;           // color key for source blt use
  796.         ddpfPixelFormat: TDDPixelFormat_DX5; // pixel format description of the surface
  797.         ddsCaps: TDDSCaps;                // direct draw surface capabilities
  798.        );
  799.       1: (
  800.         dwZBufferBitDepth: DWORD;      // depth of Z buffer requested
  801.        );
  802.       2: (
  803.         dwRefreshRate: DWORD;          // refresh rate (used when display mode is described)
  804.        );
  805.      );
  806.   end;
  807.  
  808.   PDDSurfaceDesc_DX6 = ^TDDSurfaceDesc_DX6;
  809.   TDDSurfaceDesc_DX6 = packed record
  810.     dwSize: DWORD;                 // size of the TDDSurfaceDesc structure
  811.     dwFlags: DWORD;                // determines what fields are valid
  812.     dwHeight: DWORD;               // height of surface to be created
  813.     dwWidth: DWORD;                // width of input surface
  814.     case Integer of
  815.     0: (
  816.       dwLinearSize : DWORD;       // unused at the moment
  817.      );
  818.     1: (
  819.       lPitch: LongInt;                 // distance to start of next line (return value only)
  820.       dwBackBufferCount: DWORD;      // number of back buffers requested
  821.       case Integer of
  822.       0: (
  823.         dwMipMapCount: DWORD;          // number of mip-map levels requested
  824.         dwAlphaBitDepth: DWORD;        // depth of alpha buffer requested
  825.         dwReserved: DWORD;             // reserved
  826.         lpSurface: Pointer;              // pointer to the associated surface memory
  827.         ddckCKDestOverlay: TDDColorKey;      // color key for destination overlay use
  828.         ddckCKDestBlt: TDDColorKey;          // color key for destination blt use
  829.         ddckCKSrcOverlay: TDDColorKey;       // color key for source overlay use
  830.         ddckCKSrcBlt: TDDColorKey;           // color key for source blt use
  831.         ddpfPixelFormat: TDDPixelFormat_DX6; // pixel format description of the surface
  832.         ddsCaps: TDDSCaps;                // direct draw surface capabilities
  833.        );
  834.       1: (
  835.         dwZBufferBitDepth: DWORD;      // depth of Z buffer requested
  836.        );
  837.       2: (
  838.         dwRefreshRate: DWORD;          // refresh rate (used when display mode is described)
  839.        );
  840.      );
  841.   end;
  842.  
  843.   PDDSurfaceDesc = ^TDDSurfaceDesc;
  844. {$IFDEF DIRECTX5}
  845.   TDDSurfaceDesc = TDDSurfaceDesc_DX5;
  846. {$ELSE}
  847.   TDDSurfaceDesc = TDDSurfaceDesc_DX6;
  848. {$ENDIF}
  849.  
  850.  
  851. (*
  852.  * TDDSurfaceDesc2
  853.  *)
  854.   PDDSurfaceDesc2 = ^TDDSurfaceDesc2;
  855.   TDDSurfaceDesc2 = packed record
  856.     dwSize: DWORD;                 // size of the TDDSurfaceDesc structure
  857.     dwFlags: DWORD;                // determines what fields are valid
  858.     dwHeight: DWORD;               // height of surface to be created
  859.     dwWidth: DWORD;                // width of input surface
  860.     case Integer of
  861.     0: (
  862.       lPitch : LongInt;                  // distance to start of next line (return value only)
  863.      );
  864.     1: (
  865.       dwLinearSize : DWORD;              // Formless late-allocated optimized surface size
  866.       dwBackBufferCount: DWORD;          // number of back buffers requested
  867.       case Integer of
  868.       0: (
  869.         dwMipMapCount: DWORD;            // number of mip-map levels requested
  870.         dwAlphaBitDepth: DWORD;          // depth of alpha buffer requested
  871.         dwReserved: DWORD;               // reserved
  872.         lpSurface: Pointer;              // pointer to the associated surface memory
  873.         ddckCKDestOverlay: TDDColorKey;  // color key for destination overlay use
  874.         ddckCKDestBlt: TDDColorKey;      // color key for destination blt use
  875.         ddckCKSrcOverlay: TDDColorKey;   // color key for source overlay use
  876.         ddckCKSrcBlt: TDDColorKey;       // color key for source blt use
  877.         ddpfPixelFormat: TDDPixelFormat; // pixel format description of the surface
  878.         ddsCaps: TDDSCaps2;              // direct draw surface capabilities
  879.         dwTextureStage: DWORD;           // stage in multitexture cascade
  880.        );
  881.       1: (
  882.         dwRefreshRate: DWORD;          // refresh rate (used when display mode is described)
  883.        );
  884.      );
  885.   end;
  886.  
  887. (*
  888.  * TDDOptSurfaceDesc
  889.  *)
  890.  
  891.   PDDOptSurfaceDesc = ^TDDOptSurfaceDesc;
  892.   TDDOptSurfaceDesc = packed record
  893.     dwSize : DWORD;             // size of the DDOPTSURFACEDESC structure
  894.     dwFlags : DWORD;            // determines what fields are valid
  895.     ddSCaps : TDDSCaps2;        // Common caps like: Memory type
  896.     ddOSCaps : TDDOSCaps;       // Common caps like: Memory type
  897.     guid : TGUID;               // Compression technique GUID
  898.     dwCompressionRatio : DWORD; // Compression ratio
  899.   end;
  900.  
  901. (*
  902.  * DDCOLORCONTROL
  903.  *)
  904.   PDDColorControl = ^TDDColorControl;
  905.   TDDColorControl = packed record
  906.     dwSize: DWORD;
  907.     dwFlags: DWORD;
  908.     lBrightness: LongInt;
  909.     lContrast: LongInt;
  910.     lHue: LongInt;
  911.     lSaturation: LongInt;
  912.     lSharpness: LongInt;
  913.     lGamma: LongInt;
  914.     lColorEnable: LongInt;
  915.     dwReserved1: DWORD;
  916.   end;
  917.  
  918. (*
  919.  * callbacks
  920.  *)
  921.  
  922. {$IFNDEF WINNT}
  923.   TDDEnumModesCallback = function (const lpDDSurfaceDesc: TDDSurfaceDesc;
  924.       lpContext: Pointer) : HResult; stdcall;
  925.   TDDEnumModesCallback2 = function (const lpDDSurfaceDesc: TDDSurfaceDesc2;
  926.       lpContext: Pointer) : HResult; stdcall;
  927.   TDDEnumSurfacesCallback = function (lpDDSurface: IDirectDrawSurface;
  928.       const lpDDSurfaceDesc: TDDSurfaceDesc; lpContext: Pointer) : HResult; stdcall;
  929.   TDDEnumSurfacesCallback2 = function (lpDDSurface: IDirectDrawSurface4;
  930.       const lpDDSurfaceDesc: TDDSurfaceDesc2; lpContext: Pointer) : HResult; stdcall;
  931.   TDDEnumSurfacesCallback7 = function (lpDDSurface: IDirectDrawSurface7;
  932.       const lpDDSurfaceDesc: TDDSurfaceDesc2; lpContext: Pointer) : HResult; stdcall;
  933. {$ENDIF}
  934.  
  935. (*
  936.  * INTERACES FOLLOW:
  937.  *      IDirectDraw
  938.  *      IDirectDrawClipper
  939.  *      IDirectDrawPalette
  940.  *      IDirectDrawSurface
  941.  *)
  942.  
  943. (*
  944.  * IDirectDraw
  945.  *)
  946.  
  947.   IDirectDraw = interface (IUnknown)
  948.     ['{6C14DB80-A733-11CE-A521-0020AF0BE560}']
  949.     (*** IDirectDraw methods ***)
  950.     function Compact: HResult; stdcall;
  951.     function CreateClipper (dwFlags: DWORD;
  952.         out lplpDDClipper: IDirectDrawClipper;
  953.         pUnkOuter: IUnknown) : HResult; stdcall;
  954.     function CreatePalette (dwFlags: DWORD; lpColorTable: pointer;
  955.         out lplpDDPalette: IDirectDrawPalette;
  956.         pUnkOuter: IUnknown) : HResult; stdcall;
  957.     function CreateSurface (var lpDDSurfaceDesc: TDDSurfaceDesc;
  958.         out lplpDDSurface: IDirectDrawSurface;
  959.         pUnkOuter: IUnknown) : HResult; stdcall;
  960.     function DuplicateSurface (lpDDSurface: IDirectDrawSurface;
  961.         out lplpDupDDSurface: IDirectDrawSurface) : HResult; stdcall;
  962.     function EnumDisplayModes (dwFlags: DWORD;
  963.         lpDDSurfaceDesc: PDDSurfaceDesc; lpContext: Pointer;
  964.         lpEnumModesCallback: TDDEnumModesCallback) : HResult; stdcall;
  965.     function EnumSurfaces (dwFlags: DWORD; const lpDDSD: TDDSurfaceDesc;
  966.         lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback) :
  967.         HResult; stdcall;
  968.     function FlipToGDISurface: HResult; stdcall;
  969.     function GetCaps (lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps) : HResult; stdcall;
  970.     function GetDisplayMode (out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
  971.     function GetFourCCCodes (var lpNumCodes: DWORD; lpCodes: PDWORD) : HResult; stdcall;
  972.     function GetGDISurface (out lplpGDIDDSSurface: IDirectDrawSurface) :
  973.         HResult; stdcall;
  974.     function GetMonitorFrequency (out lpdwFrequency: DWORD) : HResult; stdcall;
  975.     function GetScanLine (out lpdwScanLine: DWORD) : HResult; stdcall;
  976.     function GetVerticalBlankStatus (out lpbIsInVB: BOOL) : HResult; stdcall;
  977.     function Initialize (lpGUID: PGUID) : HResult; stdcall;
  978.     function RestoreDisplayMode: HResult; stdcall;
  979.     function SetCooperativeLevel (hWnd: HWND; dwFlags: DWORD) : HResult; stdcall;
  980.     (*** Warning!  SetDisplayMode differs between DirectDraw 1 and DirectDraw 2 ***)
  981.     function SetDisplayMode (dwWidth: DWORD; dwHeight: DWORD;
  982.         dwBpp: DWORD) : HResult; stdcall;
  983.     function WaitForVerticalBlank (dwFlags: DWORD; hEvent: THandle) :
  984.         HResult; stdcall;
  985.   end;
  986.  
  987.   IDirectDraw2 = interface (IUnknown)
  988.     ['{B3A6F3E0-2B43-11CF-A2DE-00AA00B93356}']
  989.     (*** IDirectDraw methods ***)
  990.     function Compact: HResult; stdcall;
  991.     function CreateClipper (dwFlags: DWORD;
  992.         out lplpDDClipper: IDirectDrawClipper;
  993.         pUnkOuter: IUnknown) : HResult; stdcall;
  994.     function CreatePalette (dwFlags: DWORD; lpColorTable: pointer;
  995.         out lplpDDPalette: IDirectDrawPalette;
  996.         pUnkOuter: IUnknown) : HResult; stdcall;
  997.     function CreateSurface (var lpDDSurfaceDesc: TDDSurfaceDesc;
  998.         out lplpDDSurface: IDirectDrawSurface;
  999.         pUnkOuter: IUnknown) : HResult; stdcall;
  1000.     function DuplicateSurface (lpDDSurface: IDirectDrawSurface;
  1001.         out lplpDupDDSurface: IDirectDrawSurface) : HResult; stdcall;
  1002.     function EnumDisplayModes (dwFlags: DWORD;
  1003.         lpDDSurfaceDesc: PDDSurfaceDesc; lpContext: Pointer;
  1004.         lpEnumModesCallback: TDDEnumModesCallback) : HResult; stdcall;
  1005.     function EnumSurfaces (dwFlags: DWORD; var lpDDSD: TDDSurfaceDesc;
  1006.         lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback) :
  1007.         HResult; stdcall;
  1008.     function FlipToGDISurface: HResult; stdcall;
  1009.     function GetCaps (lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps) : HResult; stdcall;
  1010.     function GetDisplayMode (out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
  1011.     function GetFourCCCodes (var lpNumCodes: DWORD; lpCodes: PDWORD) : HResult; stdcall;
  1012.     function GetGDISurface (out lplpGDIDDSSurface: IDirectDrawSurface) : HResult; stdcall;
  1013.     function GetMonitorFrequency (out lpdwFrequency: DWORD) : HResult; stdcall;
  1014.     function GetScanLine (out lpdwScanLine: DWORD) : HResult; stdcall;
  1015.     function GetVerticalBlankStatus (out lpbIsInVB: BOOL) : HResult; stdcall;
  1016.     function Initialize (lpGUID: PGUID) : HResult; stdcall;
  1017.     function RestoreDisplayMode: HResult; stdcall;
  1018.     function SetCooperativeLevel (hWnd: HWND; dwFlags: DWORD) : HResult; stdcall;
  1019. (*** Warning!  SetDisplayMode differs between DirectDraw 1 and DirectDraw 2 ***)
  1020.     function SetDisplayMode (dwWidth: DWORD; dwHeight: DWORD; dwBPP: DWORD;
  1021.         dwRefreshRate: DWORD; dwFlags: DWORD) : HResult; stdcall;
  1022.     function WaitForVerticalBlank (dwFlags: DWORD; hEvent: THandle) :
  1023.         HResult; stdcall;
  1024.     (*** Added in the v2 interface ***)
  1025.     function GetAvailableVidMem (var lpDDSCaps: TDDSCaps;
  1026.         out lpdwTotal, lpdwFree: DWORD) : HResult; stdcall;
  1027.   end;
  1028.  
  1029.   IDirectDraw4 = interface (IUnknown)
  1030.     ['{9c59509a-39bd-11d1-8c4a-00c04fd930c5}']
  1031.     (*** IDirectDraw methods ***)
  1032.     function Compact: HResult; stdcall;
  1033.     function CreateClipper (dwFlags: DWORD;
  1034.         out lplpDDClipper: IDirectDrawClipper;
  1035.         pUnkOuter: IUnknown) : HResult; stdcall;
  1036.     function CreatePalette (dwFlags: DWORD; lpColorTable: pointer;
  1037.         out lplpDDPalette: IDirectDrawPalette;
  1038.         pUnkOuter: IUnknown) : HResult; stdcall;
  1039.     function CreateSurface (const lpDDSurfaceDesc: TDDSurfaceDesc2;
  1040.         out lplpDDSurface: IDirectDrawSurface4;
  1041.         pUnkOuter: IUnknown) : HResult; stdcall;
  1042.     function DuplicateSurface (lpDDSurface: IDirectDrawSurface4;
  1043.         out lplpDupDDSurface: IDirectDrawSurface4) : HResult; stdcall;
  1044.     function EnumDisplayModes (dwFlags: DWORD;
  1045.         lpDDSurfaceDesc: PDDSurfaceDesc2; lpContext: Pointer;
  1046.         lpEnumModesCallback: TDDEnumModesCallback2) : HResult; stdcall;
  1047.     function EnumSurfaces (dwFlags: DWORD; const lpDDSD: TDDSurfaceDesc2;
  1048.         lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback2) :
  1049.         HResult; stdcall;
  1050.     function FlipToGDISurface: HResult; stdcall;
  1051.     function GetCaps (lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps) : HResult; stdcall;
  1052.     function GetDisplayMode (out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
  1053.     function GetFourCCCodes (var lpNumCodes: DWORD; lpCodes: PDWORD) : HResult; stdcall;
  1054.     function GetGDISurface (out lplpGDIDDSSurface: IDirectDrawSurface4) :
  1055.         HResult; stdcall;
  1056.     function GetMonitorFrequency (out lpdwFrequency: DWORD) : HResult; stdcall;
  1057.     function GetScanLine (out lpdwScanLine: DWORD) : HResult; stdcall;
  1058.     function GetVerticalBlankStatus (out lpbIsInVB: BOOL) : HResult; stdcall;
  1059.     function Initialize (lpGUID: PGUID) : HResult; stdcall;
  1060.     function RestoreDisplayMode: HResult; stdcall;
  1061.     function SetCooperativeLevel (hWnd: HWND; dwFlags: DWORD) : HResult; stdcall;
  1062. (*** Warning!  SetDisplayMode differs between DirectDraw 1 and DirectDraw 2 ***)
  1063.     function SetDisplayMode (dwWidth: DWORD; dwHeight: DWORD; dwBPP: DWORD;
  1064.         dwRefreshRate: DWORD; dwFlags: DWORD) : HResult; stdcall;
  1065.     function WaitForVerticalBlank (dwFlags: DWORD; hEvent: THandle) :
  1066.         HResult; stdcall;
  1067.     (*** Added in the v2 interface ***)
  1068.     function GetAvailableVidMem (const lpDDSCaps: TDDSCaps2;
  1069.         out lpdwTotal, lpdwFree: DWORD) : HResult; stdcall;
  1070.     (*** Added in the V4 Interface ***)
  1071.     function GetSurfaceFromDC (hdc : Windows.HDC;
  1072.         out lpDDS4: IDirectDrawSurface4) : HResult; stdcall;
  1073.     function RestoreAllSurfaces : HResult; stdcall;
  1074.     function TestCooperativeLevel : HResult; stdcall;
  1075.     function GetDeviceIdentifier (out lpdddi: TDDDeviceIdentifier;
  1076.         dwFlags: DWORD) : HResult; stdcall;
  1077.   end;
  1078.  
  1079.   IDirectDraw7 = interface (IUnknown)
  1080.     ['{15e65ec0-3b9c-11d2-b92f-00609797ea5b}']
  1081.     (*** IDirectDraw methods ***)
  1082.     function Compact: HResult; stdcall;
  1083.     function CreateClipper (dwFlags: DWORD;
  1084.         out lplpDDClipper: IDirectDrawClipper;
  1085.         pUnkOuter: IUnknown) : HResult; stdcall;
  1086.     function CreatePalette (dwFlags: DWORD; lpColorTable: pointer;
  1087.         out lplpDDPalette: IDirectDrawPalette;
  1088.         pUnkOuter: IUnknown) : HResult; stdcall;
  1089.     function CreateSurface (const lpDDSurfaceDesc: TDDSurfaceDesc2;
  1090.         out lplpDDSurface: IDirectDrawSurface7;
  1091.         pUnkOuter: IUnknown) : HResult; stdcall;
  1092.     function DuplicateSurface (lpDDSurface: IDirectDrawSurface7;
  1093.         out lplpDupDDSurface: IDirectDrawSurface7) : HResult; stdcall;
  1094.     function EnumDisplayModes (dwFlags: DWORD;
  1095.         lpDDSurfaceDesc: PDDSurfaceDesc2; lpContext: Pointer;
  1096.         lpEnumModesCallback: TDDEnumModesCallback2) : HResult; stdcall;
  1097.     function EnumSurfaces (dwFlags: DWORD; const lpDDSD: TDDSurfaceDesc2;
  1098.         lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback7) :
  1099.         HResult; stdcall;
  1100.     function FlipToGDISurface: HResult; stdcall;
  1101.     function GetCaps (lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps) : HResult; stdcall;
  1102.     function GetDisplayMode (out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
  1103.     function GetFourCCCodes (var lpNumCodes: DWORD; lpCodes: PDWORD) : HResult; stdcall;
  1104.     function GetGDISurface (out lplpGDIDDSSurface: IDirectDrawSurface7) :
  1105.         HResult; stdcall;
  1106.     function GetMonitorFrequency (out lpdwFrequency: DWORD) : HResult; stdcall;
  1107.     function GetScanLine (out lpdwScanLine: DWORD) : HResult; stdcall;
  1108.     function GetVerticalBlankStatus (out lpbIsInVB: BOOL) : HResult; stdcall;
  1109.     function Initialize (lpGUID: PGUID) : HResult; stdcall;
  1110.     function RestoreDisplayMode: HResult; stdcall;
  1111.     function SetCooperativeLevel (hWnd: HWND; dwFlags: DWORD) : HResult; stdcall;
  1112.     function SetDisplayMode (dwWidth: DWORD; dwHeight: DWORD; dwBPP: DWORD;
  1113.         dwRefreshRate: DWORD; dwFlags: DWORD) : HResult; stdcall;
  1114.     function WaitForVerticalBlank (dwFlags: DWORD; hEvent: THandle) :
  1115.         HResult; stdcall;
  1116.     (*** Added in the v2 interface ***)
  1117.     function GetAvailableVidMem (const lpDDSCaps: TDDSCaps2;
  1118.         out lpdwTotal, lpdwFree: DWORD) : HResult; stdcall;
  1119.     (*** Added in the V4 Interface ***)
  1120.     function GetSurfaceFromDC (hdc : Windows.HDC;
  1121.         out lpDDS: IDirectDrawSurface7) : HResult; stdcall;
  1122.     function RestoreAllSurfaces : HResult; stdcall;
  1123.     function TestCooperativeLevel : HResult; stdcall;
  1124.     function GetDeviceIdentifier (out lpdddi: TDDDeviceIdentifier2;
  1125.         dwFlags: DWORD) : HResult; stdcall;
  1126.     function StartModeTest(const lpModesToTest; dwNumEntries, dwFlags: DWORD) : HResult; stdcall;
  1127.     function EvaluateMode(dwFlags: DWORD; out pSecondsUntilTimeout: DWORD) : HResult; stdcall;
  1128.   end;
  1129.  
  1130.  
  1131.  
  1132. (*
  1133.  * IDirectDrawPalette
  1134.  *)
  1135.  
  1136.   IDirectDrawPalette = interface (IUnknown)
  1137.     ['{6C14DB84-A733-11CE-A521-0020AF0BE560}']
  1138.     (*** IDirectDrawPalette methods ***)
  1139.     function GetCaps (out lpdwCaps: DWORD) : HResult; stdcall;
  1140.     function GetEntries (dwFlags: DWORD; dwBase: DWORD; dwNumEntries: DWORD;
  1141.         lpEntries: pointer) : HResult; stdcall;
  1142.     function Initialize (lpDD: IDirectDraw; dwFlags: DWORD;
  1143.         lpDDColorTable: pointer) : HResult; stdcall;
  1144.     function SetEntries (dwFlags: DWORD; dwStartingEntry: DWORD;
  1145.         dwCount: DWORD; lpEntries: pointer) : HResult; stdcall;
  1146.   end;
  1147.  
  1148. (*
  1149.  * IDirectDrawClipper
  1150.  *)
  1151.  
  1152.   IDirectDrawClipper = interface (IUnknown)
  1153.     ['{6C14DB85-A733-11CE-A521-0020AF0BE560}']
  1154.     (*** IDirectDrawClipper methods ***)
  1155.     function GetClipList (lpRect: PRect; lpClipList: PRgnData;
  1156.         var lpdwSize: DWORD) : HResult; stdcall;
  1157.     function GetHWnd (out lphWnd: HWND) : HResult; stdcall;
  1158.     function Initialize (lpDD: IDirectDraw; dwFlags: DWORD) : HResult; stdcall;
  1159.     function IsClipListChanged (out lpbChanged: BOOL) : HResult; stdcall;
  1160.     function SetClipList (lpClipList: PRgnData; dwFlags: DWORD) : HResult; stdcall;
  1161.     function SetHWnd (dwFlags: DWORD; hWnd: HWND) : HResult; stdcall;
  1162.   end;
  1163.  
  1164. (*
  1165.  * IDirectDrawSurface and related interfaces
  1166.  *)
  1167.  
  1168.   IDirectDrawSurface = interface (IUnknown)
  1169.     ['{6C14DB81-A733-11CE-A521-0020AF0BE560}']
  1170.     (*** IDirectDrawSurface methods ***)
  1171.     function AddAttachedSurface (lpDDSAttachedSurface: IDirectDrawSurface) :
  1172.         HResult; stdcall;
  1173.     function AddOverlayDirtyRect (const lpRect: TRect) : HResult; stdcall;
  1174.     function Blt (lpDestRect: PRect;
  1175.         lpDDSrcSurface: IDirectDrawSurface; lpSrcRect: PRect;
  1176.         dwFlags: DWORD; lpDDBltFx: PDDBltFX) : HResult; stdcall;
  1177.     function BltBatch (const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
  1178.         dwFlags: DWORD) : HResult; stdcall;
  1179.     function BltFast (dwX: DWORD; dwY: DWORD;
  1180.         lpDDSrcSurface: IDirectDrawSurface; lpSrcRect: PRect;
  1181.         dwTrans: DWORD) : HResult; stdcall;
  1182.     function DeleteAttachedSurface (dwFlags: DWORD;
  1183.         lpDDSAttachedSurface: IDirectDrawSurface) : HResult; stdcall;
  1184.     function EnumAttachedSurfaces (lpContext: Pointer;
  1185.         lpEnumSurfacesCallback: TDDEnumSurfacesCallback) : HResult; stdcall;
  1186.     function EnumOverlayZOrders (dwFlags: DWORD; lpContext: Pointer;
  1187.         lpfnCallback: TDDEnumSurfacesCallback) : HResult; stdcall;
  1188.     function Flip (lpDDSurfaceTargetOverride: IDirectDrawSurface;
  1189.         dwFlags: DWORD) : HResult; stdcall;
  1190.     function GetAttachedSurface (var lpDDSCaps: TDDSCaps;
  1191.         (*out*)var lplpDDAttachedSurface: IDirectDrawSurface) : HResult; stdcall;
  1192.     function GetBltStatus (dwFlags: DWORD) : HResult; stdcall;
  1193.     function GetCaps (out lpDDSCaps: TDDSCaps) : HResult; stdcall;
  1194.     function GetClipper (out lplpDDClipper: IDirectDrawClipper) : HResult; stdcall;
  1195.     function GetColorKey (dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
  1196.         HResult; stdcall;
  1197.     function GetDC (out lphDC: HDC) : HResult; stdcall;
  1198.     function GetFlipStatus (dwFlags: DWORD) : HResult; stdcall;
  1199.     function GetOverlayPosition (out lplX, lplY: LongInt) : HResult; stdcall;
  1200.     function GetPalette (out lplpDDPalette: IDirectDrawPalette) : HResult; stdcall;
  1201.     function GetPixelFormat (out lpDDPixelFormat: TDDPixelFormat) : HResult; stdcall;
  1202.     function GetSurfaceDesc (out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
  1203.     function Initialize (lpDD: IDirectDraw;
  1204.         out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
  1205.     function IsLost: HResult; stdcall;
  1206.     function Lock (lpDestRect: PRect; out lpDDSurfaceDesc:
  1207.         TDDSurfaceDesc; dwFlags: DWORD; hEvent: THandle) : HResult; stdcall;
  1208.     function ReleaseDC (hDC: Windows.HDC) : HResult; stdcall;
  1209.     function _Restore: HResult; stdcall;
  1210.     function SetClipper (lpDDClipper: IDirectDrawClipper) : HResult; stdcall;
  1211.     function SetColorKey (dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
  1212.         HResult; stdcall;
  1213.     function SetOverlayPosition (lX, lY: LongInt) : HResult; stdcall;
  1214.     function SetPalette (lpDDPalette: IDirectDrawPalette) : HResult; stdcall;
  1215.     function Unlock (lpSurfaceData: Pointer) : HResult; stdcall;
  1216.     function UpdateOverlay (lpSrcRect: PRect;
  1217.         lpDDDestSurface: IDirectDrawSurface; lpDestRect: PRect;
  1218.         dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX) : HResult; stdcall;
  1219.     function UpdateOverlayDisplay (dwFlags: DWORD) : HResult; stdcall;
  1220.     function UpdateOverlayZOrder (dwFlags: DWORD;
  1221.         lpDDSReference: IDirectDrawSurface) : HResult; stdcall;
  1222.   end;
  1223.  
  1224. (*
  1225.  * IDirectDrawSurface2 and related interfaces
  1226.  *)
  1227.  
  1228.   IDirectDrawSurface2 = interface (IUnknown)
  1229.     ['{57805885-6eec-11cf-9441-a82303c10e27}']
  1230.     (*** IDirectDrawSurface methods ***)
  1231.     function AddAttachedSurface (lpDDSAttachedSurface: IDirectDrawSurface2) :
  1232.         HResult; stdcall;
  1233.     function AddOverlayDirtyRect (const lpRect: TRect) : HResult; stdcall;
  1234.     function Blt (lpDestRect: PRect;
  1235.         lpDDSrcSurface: IDirectDrawSurface2; lpSrcRect: PRect;
  1236.         dwFlags: DWORD; lpDDBltFx: PDDBltFX) : HResult; stdcall;
  1237.     function BltBatch (const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
  1238.         dwFlags: DWORD) : HResult; stdcall;
  1239.     function BltFast (dwX: DWORD; dwY: DWORD;
  1240.         lpDDSrcSurface: IDirectDrawSurface2; lpSrcRect: PRect;
  1241.         dwTrans: DWORD) : HResult; stdcall;
  1242.     function DeleteAttachedSurface (dwFlags: DWORD;
  1243.         lpDDSAttachedSurface: IDirectDrawSurface2) : HResult; stdcall;
  1244.     function EnumAttachedSurfaces (lpContext: Pointer;
  1245.         lpEnumSurfacesCallback: TDDEnumSurfacesCallback) : HResult; stdcall;
  1246.     function EnumOverlayZOrders (dwFlags: DWORD; lpContext: Pointer;
  1247.         lpfnCallback: TDDEnumSurfacesCallback) : HResult; stdcall;
  1248.     function Flip (lpDDSurfaceTargetOverride: IDirectDrawSurface2;
  1249.         dwFlags: DWORD) : HResult; stdcall;
  1250.     function GetAttachedSurface (var lpDDSCaps: TDDSCaps;
  1251.         out lplpDDAttachedSurface: IDirectDrawSurface2) : HResult; stdcall;
  1252.     function GetBltStatus (dwFlags: DWORD) : HResult; stdcall;
  1253.     function GetCaps (out lpDDSCaps: TDDSCaps) : HResult; stdcall;
  1254.     function GetClipper (out lplpDDClipper: IDirectDrawClipper) : HResult; stdcall;
  1255.     function GetColorKey (dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
  1256.         HResult; stdcall;
  1257.     function GetDC (out lphDC: HDC) : HResult; stdcall;
  1258.     function GetFlipStatus (dwFlags: DWORD) : HResult; stdcall;
  1259.     function GetOverlayPosition (out lplX, lplY: LongInt) : HResult; stdcall;
  1260.     function GetPalette (out lplpDDPalette: IDirectDrawPalette) : HResult; stdcall;
  1261.     function GetPixelFormat (out lpDDPixelFormat: TDDPixelFormat) : HResult; stdcall;
  1262.     function GetSurfaceDesc (out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
  1263.     function Initialize (lpDD: IDirectDraw;
  1264.         out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
  1265.     function IsLost: HResult; stdcall;
  1266.     function Lock (lpDestRect: PRect;
  1267.         out lpDDSurfaceDesc: TDDSurfaceDesc; dwFlags: DWORD;
  1268.         hEvent: THandle) : HResult; stdcall;
  1269.     function ReleaseDC (hDC: Windows.HDC) : HResult; stdcall;
  1270.     function _Restore: HResult; stdcall;
  1271.     function SetClipper (lpDDClipper: IDirectDrawClipper) : HResult; stdcall;
  1272.     function SetColorKey (dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
  1273.         HResult; stdcall;
  1274.     function SetOverlayPosition (lX, lY: LongInt) : HResult; stdcall;
  1275.     function SetPalette (lpDDPalette: IDirectDrawPalette) : HResult; stdcall;
  1276.     function Unlock (lpSurfaceData: Pointer) : HResult; stdcall;
  1277.     function UpdateOverlay (lpSrcRect: PRect;
  1278.         lpDDDestSurface: IDirectDrawSurface2; lpDestRect: PRect;
  1279.         dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX) : HResult; stdcall;
  1280.     function UpdateOverlayDisplay (dwFlags: DWORD) : HResult; stdcall;
  1281.     function UpdateOverlayZOrder (dwFlags: DWORD;
  1282.         lpDDSReference: IDirectDrawSurface2) : HResult; stdcall;
  1283.     (*** Added in the v2 interface ***)
  1284.     function GetDDInterface (var lplpDD: IDirectDraw) : HResult; stdcall;
  1285.     function PageLock (dwFlags: DWORD) : HResult; stdcall;
  1286.     function PageUnlock (dwFlags: DWORD) : HResult; stdcall;
  1287.   end;
  1288.  
  1289.   IDirectDrawSurface3 = interface (IUnknown)
  1290.     ['{DA044E00-69B2-11D0-A1D5-00AA00B8DFBB}']
  1291.     (*** IDirectDrawSurface methods ***)
  1292.     function AddAttachedSurface (lpDDSAttachedSurface: IDirectDrawSurface3) :
  1293.         HResult; stdcall;
  1294.     function AddOverlayDirtyRect (const lpRect: TRect) : HResult; stdcall;
  1295.     function Blt (lpDestRect: PRect;
  1296.         lpDDSrcSurface: IDirectDrawSurface3; lpSrcRect: PRect;
  1297.         dwFlags: DWORD; lpDDBltFx: PDDBltFX) : HResult; stdcall;
  1298.     function BltBatch (const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
  1299.         dwFlags: DWORD) : HResult; stdcall;
  1300.     function BltFast (dwX: DWORD; dwY: DWORD;
  1301.         lpDDSrcSurface: IDirectDrawSurface3; lpSrcRect: PRect;
  1302.         dwTrans: DWORD) : HResult; stdcall;
  1303.     function DeleteAttachedSurface (dwFlags: DWORD;
  1304.         lpDDSAttachedSurface: IDirectDrawSurface3) : HResult; stdcall;
  1305.     function EnumAttachedSurfaces (lpContext: Pointer;
  1306.         lpEnumSurfacesCallback: TDDEnumSurfacesCallback) : HResult; stdcall;
  1307.     function EnumOverlayZOrders (dwFlags: DWORD; lpContext: Pointer;
  1308.         lpfnCallback: TDDEnumSurfacesCallback) : HResult; stdcall;
  1309.     function Flip (lpDDSurfaceTargetOverride: IDirectDrawSurface3;
  1310.         dwFlags: DWORD) : HResult; stdcall;
  1311.     function GetAttachedSurface (var lpDDSCaps: TDDSCaps;
  1312.         out lplpDDAttachedSurface: IDirectDrawSurface3) : HResult; stdcall;
  1313.     function GetBltStatus (dwFlags: DWORD) : HResult; stdcall;
  1314.     function GetCaps (out lpDDSCaps: TDDSCaps) : HResult; stdcall;
  1315.     function GetClipper (out lplpDDClipper: IDirectDrawClipper) : HResult; stdcall;
  1316.     function GetColorKey (dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
  1317.         HResult; stdcall;
  1318.     function GetDC (out lphDC: HDC) : HResult; stdcall;
  1319.     function GetFlipStatus (dwFlags: DWORD) : HResult; stdcall;
  1320.     function GetOverlayPosition (out lplX, lplY: LongInt) : HResult; stdcall;
  1321.     function GetPalette (out lplpDDPalette: IDirectDrawPalette) : HResult; stdcall;
  1322.     function GetPixelFormat (out lpDDPixelFormat: TDDPixelFormat) : HResult; stdcall;
  1323.     function GetSurfaceDesc (out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
  1324.     function Initialize (lpDD: IDirectDraw;
  1325.         out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
  1326.     function IsLost: HResult; stdcall;
  1327.     function Lock (lpDestRect: PRect;
  1328.         out lpDDSurfaceDesc: TDDSurfaceDesc; dwFlags: DWORD;
  1329.         hEvent: THandle) : HResult; stdcall;
  1330.     function ReleaseDC (hDC: Windows.HDC) : HResult; stdcall;
  1331.     function _Restore: HResult; stdcall;
  1332.     function SetClipper (lpDDClipper: IDirectDrawClipper) : HResult; stdcall;
  1333.     function SetColorKey (dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
  1334.         HResult; stdcall;
  1335.     function SetOverlayPosition (lX, lY: LongInt) : HResult; stdcall;
  1336.     function SetPalette (lpDDPalette: IDirectDrawPalette) : HResult; stdcall;
  1337.     function Unlock (lpSurfaceData: Pointer) : HResult; stdcall;
  1338.     function UpdateOverlay (lpSrcRect: PRect;
  1339.         lpDDDestSurface: IDirectDrawSurface3; lpDestRect: PRect;
  1340.         dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX) : HResult; stdcall;
  1341.     function UpdateOverlayDisplay (dwFlags: DWORD) : HResult; stdcall;
  1342.     function UpdateOverlayZOrder (dwFlags: DWORD;
  1343.         lpDDSReference: IDirectDrawSurface3) : HResult; stdcall;
  1344.     (*** Added in the v2 interface ***)
  1345.     function GetDDInterface (out lplpDD: IDirectDraw) : HResult; stdcall;
  1346.     function PageLock (dwFlags: DWORD) : HResult; stdcall;
  1347.     function PageUnlock (dwFlags: DWORD) : HResult; stdcall;
  1348.     (*** Added in the V3 interface ***)
  1349.     function SetSurfaceDesc(const lpddsd: TDDSurfaceDesc; dwFlags: DWORD) : HResult; stdcall;
  1350.   end;
  1351.  
  1352. (*
  1353.  * IDirectDrawSurface4 and related interfaces
  1354.  *)
  1355.   IDirectDrawSurface4 = interface (IUnknown)
  1356.     ['{0B2B8630-AD35-11D0-8EA6-00609797EA5B}']
  1357.     (*** IDirectDrawSurface methods ***)
  1358.     function AddAttachedSurface (lpDDSAttachedSurface: IDirectDrawSurface4) :
  1359.         HResult; stdcall;
  1360.     function AddOverlayDirtyRect (const lpRect: TRect) : HResult; stdcall;
  1361.     function Blt (lpDestRect: PRect;
  1362.         lpDDSrcSurface: IDirectDrawSurface4; lpSrcRect: PRect;
  1363.         dwFlags: DWORD; lpDDBltFx: PDDBltFX) : HResult; stdcall;
  1364.     function BltBatch (const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
  1365.         dwFlags: DWORD) : HResult; stdcall;
  1366.     function BltFast (dwX: DWORD; dwY: DWORD;
  1367.         lpDDSrcSurface: IDirectDrawSurface4; lpSrcRect: PRect;
  1368.         dwTrans: DWORD) : HResult; stdcall;
  1369.     function DeleteAttachedSurface (dwFlags: DWORD;
  1370.         lpDDSAttachedSurface: IDirectDrawSurface4) : HResult; stdcall;
  1371.     function EnumAttachedSurfaces (lpContext: Pointer;
  1372.         lpEnumSurfacesCallback: TDDEnumSurfacesCallback2) : HResult; stdcall;
  1373.     function EnumOverlayZOrders (dwFlags: DWORD; lpContext: Pointer;
  1374.         lpfnCallback: TDDEnumSurfacesCallback2) : HResult; stdcall;
  1375.     function Flip (lpDDSurfaceTargetOverride: IDirectDrawSurface4;
  1376.         dwFlags: DWORD) : HResult; stdcall;
  1377.     function GetAttachedSurface (const lpDDSCaps: TDDSCaps2;
  1378.         out lplpDDAttachedSurface: IDirectDrawSurface4) : HResult; stdcall;
  1379.     function GetBltStatus (dwFlags: DWORD) : HResult; stdcall;
  1380.     function GetCaps (out lpDDSCaps: TDDSCaps2) : HResult; stdcall;
  1381.     function GetClipper (out lplpDDClipper: IDirectDrawClipper) : HResult; stdcall;
  1382.     function GetColorKey (dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
  1383.         HResult; stdcall;
  1384.     function GetDC (out lphDC: HDC) : HResult; stdcall;
  1385.     function GetFlipStatus (dwFlags: DWORD) : HResult; stdcall;
  1386.     function GetOverlayPosition (out lplX, lplY: LongInt) : HResult; stdcall;
  1387.     function GetPalette (out lplpDDPalette: IDirectDrawPalette) : HResult; stdcall;
  1388.     function GetPixelFormat (out lpDDPixelFormat: TDDPixelFormat) : HResult; stdcall;
  1389.     function GetSurfaceDesc (out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
  1390.     function Initialize (lpDD: IDirectDraw;
  1391.         out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
  1392.     function IsLost: HResult; stdcall;
  1393.     function Lock (lpDestRect: PRect;
  1394.         out lpDDSurfaceDesc: TDDSurfaceDesc2; dwFlags: DWORD;
  1395.         hEvent: THandle) : HResult; stdcall;
  1396.     function ReleaseDC (hDC: Windows.HDC) : HResult; stdcall;
  1397.     function _Restore: HResult; stdcall;
  1398.     function SetClipper (lpDDClipper: IDirectDrawClipper) : HResult; stdcall;
  1399.     function SetColorKey (dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
  1400.         HResult; stdcall;
  1401.     function SetOverlayPosition (lX, lY: LongInt) : HResult; stdcall;
  1402.     function SetPalette (lpDDPalette: IDirectDrawPalette) : HResult; stdcall;
  1403.     function Unlock (lpRect: PRect) : HResult; stdcall;
  1404.     function UpdateOverlay (lpSrcRect: PRect;
  1405.         lpDDDestSurface: IDirectDrawSurface4; lpDestRect: PRect;
  1406.         dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX) : HResult; stdcall;
  1407.     function UpdateOverlayDisplay (dwFlags: DWORD) : HResult; stdcall;
  1408.     function UpdateOverlayZOrder (dwFlags: DWORD;
  1409.         lpDDSReference: IDirectDrawSurface4) : HResult; stdcall;
  1410.     (*** Added in the v2 interface ***)
  1411.     function GetDDInterface (out lplpDD: IUnknown) : HResult; stdcall;
  1412.     function PageLock (dwFlags: DWORD) : HResult; stdcall;
  1413.     function PageUnlock (dwFlags: DWORD) : HResult; stdcall;
  1414.     (*** Added in the V3 interface ***)
  1415.     function SetSurfaceDesc(const lpddsd2: TDDSurfaceDesc2; dwFlags: DWORD) : HResult; stdcall;
  1416.     (*** Added in the v4 interface ***)
  1417.     function SetPrivateData(const guidTag: TGUID; lpData: pointer;
  1418.         cbSize: DWORD; dwFlags: DWORD) : HResult; stdcall;
  1419.     function GetPrivateData(const guidTag: TGUID; lpBuffer: pointer;
  1420.         var lpcbBufferSize: DWORD) : HResult; stdcall;
  1421.     function FreePrivateData(const guidTag: TGUID) : HResult; stdcall;
  1422.     function GetUniquenessValue(out lpValue: DWORD) : HResult; stdcall;
  1423.     function ChangeUniquenessValue : HResult; stdcall;
  1424.   end;
  1425.  
  1426.   IDirectDrawSurface7 = interface (IUnknown)
  1427.     ['{06675a80-3b9b-11d2-b92f-00609797ea5b}']
  1428.     (*** IDirectDrawSurface methods ***)
  1429.     function AddAttachedSurface (lpDDSAttachedSurface: IDirectDrawSurface7) :
  1430.         HResult; stdcall;
  1431.     function AddOverlayDirtyRect (const lpRect: TRect) : HResult; stdcall;
  1432.     function Blt (lpDestRect: PRect;
  1433.         lpDDSrcSurface: IDirectDrawSurface7; lpSrcRect: PRect;
  1434.         dwFlags: DWORD; lpDDBltFx: PDDBltFX) : HResult; stdcall;
  1435.     function BltBatch (const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
  1436.         dwFlags: DWORD) : HResult; stdcall;
  1437.     function BltFast (dwX: DWORD; dwY: DWORD;
  1438.         lpDDSrcSurface: IDirectDrawSurface7; lpSrcRect: PRect;
  1439.         dwTrans: DWORD) : HResult; stdcall;
  1440.     function DeleteAttachedSurface (dwFlags: DWORD;
  1441.         lpDDSAttachedSurface: IDirectDrawSurface7) : HResult; stdcall;
  1442.     function EnumAttachedSurfaces (lpContext: Pointer;
  1443.         lpEnumSurfacesCallback: TDDEnumSurfacesCallback7) : HResult; stdcall;
  1444.     function EnumOverlayZOrders (dwFlags: DWORD; lpContext: Pointer;
  1445.         lpfnCallback: TDDEnumSurfacesCallback7) : HResult; stdcall;
  1446.     function Flip (lpDDSurfaceTargetOverride: IDirectDrawSurface7;
  1447.         dwFlags: DWORD) : HResult; stdcall;
  1448.     function GetAttachedSurface (const lpDDSCaps: TDDSCaps2;
  1449.         out lplpDDAttachedSurface: IDirectDrawSurface7) : HResult; stdcall;
  1450.     function GetBltStatus (dwFlags: DWORD) : HResult; stdcall;
  1451.     function GetCaps (out lpDDSCaps: TDDSCaps2) : HResult; stdcall;
  1452.     function GetClipper (out lplpDDClipper: IDirectDrawClipper) : HResult; stdcall;
  1453.     function GetColorKey (dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
  1454.         HResult; stdcall;
  1455.     function GetDC (out lphDC: HDC) : HResult; stdcall;
  1456.     function GetFlipStatus (dwFlags: DWORD) : HResult; stdcall;
  1457.     function GetOverlayPosition (out lplX, lplY: LongInt) : HResult; stdcall;
  1458.     function GetPalette (out lplpDDPalette: IDirectDrawPalette) : HResult; stdcall;
  1459.     function GetPixelFormat (out lpDDPixelFormat: TDDPixelFormat) : HResult; stdcall;
  1460.     function GetSurfaceDesc (out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
  1461.     function Initialize (lpDD: IDirectDraw;
  1462.         out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
  1463.     function IsLost: HResult; stdcall;
  1464.     function Lock (lpDestRect: PRect;
  1465.         out lpDDSurfaceDesc: TDDSurfaceDesc2; dwFlags: DWORD;
  1466.         hEvent: THandle) : HResult; stdcall;
  1467.     function ReleaseDC (hDC: Windows.HDC) : HResult; stdcall;
  1468.     function _Restore: HResult; stdcall;
  1469.     function SetClipper (lpDDClipper: IDirectDrawClipper) : HResult; stdcall;
  1470.     function SetColorKey (dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
  1471.         HResult; stdcall;
  1472.     function SetOverlayPosition (lX, lY: LongInt) : HResult; stdcall;
  1473.     function SetPalette (lpDDPalette: IDirectDrawPalette) : HResult; stdcall;
  1474.     function Unlock (lpRect: PRect) : HResult; stdcall;
  1475.     function UpdateOverlay (lpSrcRect: PRect;
  1476.         lpDDDestSurface: IDirectDrawSurface7; lpDestRect: PRect;
  1477.         dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX) : HResult; stdcall;
  1478.     function UpdateOverlayDisplay (dwFlags: DWORD) : HResult; stdcall;
  1479.     function UpdateOverlayZOrder (dwFlags: DWORD;
  1480.         lpDDSReference: IDirectDrawSurface7) : HResult; stdcall;
  1481.     (*** Added in the v2 interface ***)
  1482.     function GetDDInterface (out lplpDD: IUnknown) : HResult; stdcall;
  1483.     function PageLock (dwFlags: DWORD) : HResult; stdcall;
  1484.     function PageUnlock (dwFlags: DWORD) : HResult; stdcall;
  1485.     (*** Added in the V3 interface ***)
  1486.     function SetSurfaceDesc(const lpddsd2: TDDSurfaceDesc2; dwFlags: DWORD) : HResult; stdcall;
  1487.     (*** Added in the v4 interface ***)
  1488.     function SetPrivateData(const guidTag: TGUID; lpData: pointer;
  1489.         cbSize: DWORD; dwFlags: DWORD) : HResult; stdcall;
  1490.     function GetPrivateData(const guidTag: TGUID; lpBuffer: pointer;
  1491.         var lpcbBufferSize: DWORD) : HResult; stdcall;
  1492.     function FreePrivateData(const guidTag: TGUID) : HResult; stdcall;
  1493.     function GetUniquenessValue(out lpValue: DWORD) : HResult; stdcall;
  1494.     function ChangeUniquenessValue : HResult; stdcall;
  1495.     (*** Moved Texture7 methods here ***)
  1496.     function SetPriority(dwPriority: DWORD) : HResult; stdcall;
  1497.     function GetPriority(out lpdwPriority: DWORD) : HResult; stdcall;
  1498.     function SetLOD(dwMaxLOD: DWORD) : HResult; stdcall;
  1499.     function GetLOD(out lpdwMaxLOD: DWORD) : HResult; stdcall;
  1500.   end;
  1501.  
  1502.   IDirectDrawColorControl = interface (IUnknown)
  1503.     ['{4B9F0EE0-0D7E-11D0-9B06-00A0C903A3B8}']
  1504.     function GetColorControls(out lpColorControl: TDDColorControl) : HResult; stdcall;
  1505.     function SetColorControls(const lpColorControl: TDDColorControl) : HResult; stdcall;
  1506.   end;
  1507.  
  1508. (*
  1509.  * IDirectDrawGammaControl
  1510.  *)
  1511.   IDirectDrawGammaControl = interface (IUnknown)
  1512.     ['{69C11C3E-B46B-11D1-AD7A-00C04FC29B4E}']
  1513.     function GetGammaRamp (dwFlags: DWORD; out lpRampData: TDDGammaRamp)
  1514.         : HResult; stdcall;
  1515.     function SetGammaRamp (dwFlags: DWORD; const lpRampData: TDDGammaRamp)
  1516.         : HResult; stdcall;
  1517.   end;
  1518.  
  1519. type
  1520.   IID_IDirectDraw = IDirectDraw;
  1521.   IID_IDirectDraw2 = IDirectDraw2;
  1522.   IID_IDirectDraw4 = IDirectDraw4;
  1523.   IID_IDirectDraw7 = IDirectDraw7;
  1524.   IID_IDirectDrawSurface = IDirectDrawSurface;
  1525.   IID_IDirectDrawSurface2 = IDirectDrawSurface2;
  1526.   IID_IDirectDrawSurface3 = IDirectDrawSurface3;
  1527.   IID_IDirectDrawSurface4 = IDirectDrawSurface4;
  1528.   IID_IDirectDrawSurface7 = IDirectDrawSurface7;
  1529.  
  1530.   IID_IDirectDrawPalette = IDirectDrawPalette;
  1531.   IID_IDirectDrawClipper = IDirectDrawClipper;
  1532.   IID_IDirectDrawColorControl = IDirectDrawColorControl;
  1533.   IID_IDirectDrawGammaControl = IDirectDrawGammaControl;
  1534.  
  1535. const  
  1536. (*
  1537.  * ddsCaps field is valid.
  1538.  *)
  1539.   DDSD_CAPS               = $00000001;     // default
  1540.  
  1541. (*
  1542.  * dwHeight field is valid.
  1543.  *)
  1544.   DDSD_HEIGHT             = $00000002;
  1545.  
  1546. (*
  1547.  * dwWidth field is valid.
  1548.  *)
  1549.   DDSD_WIDTH              = $00000004;
  1550.  
  1551. (*
  1552.  * lPitch is valid.
  1553.  *)
  1554.   DDSD_PITCH              = $00000008;
  1555.  
  1556. (*
  1557.  * dwBackBufferCount is valid.
  1558.  *)
  1559.   DDSD_BACKBUFFERCOUNT    = $00000020;
  1560.  
  1561. (*
  1562.  * dwZBufferBitDepth is valid.  (shouldnt be used in DDSURFACEDESC2)
  1563.  *)
  1564.   DDSD_ZBUFFERBITDEPTH    = $00000040;
  1565.  
  1566. (*
  1567.  * dwAlphaBitDepth is valid.
  1568.  *)
  1569.    DDSD_ALPHABITDEPTH      = $00000080;
  1570.  
  1571. (*
  1572.  * lpSurface is valid.
  1573.  *)
  1574.   DDSD_LPSURFACE           = $00000800;
  1575.  
  1576. (*
  1577.  * ddpfPixelFormat is valid.
  1578.  *)
  1579.   DDSD_PIXELFORMAT        = $00001000;
  1580.  
  1581. (*
  1582.  * ddckCKDestOverlay is valid.
  1583.  *)
  1584.   DDSD_CKDESTOVERLAY      = $00002000;
  1585.  
  1586. (*
  1587.  * ddckCKDestBlt is valid.
  1588.  *)
  1589.   DDSD_CKDESTBLT          = $00004000;
  1590.  
  1591. (*
  1592.  * ddckCKSrcOverlay is valid.
  1593.  *)
  1594.   DDSD_CKSRCOVERLAY       = $00008000;
  1595.  
  1596. (*
  1597.  * ddckCKSrcBlt is valid.
  1598.  *)
  1599.   DDSD_CKSRCBLT           = $00010000;
  1600.  
  1601. (*
  1602.  * dwMipMapCount is valid.
  1603.  *)
  1604.   DDSD_MIPMAPCOUNT        = $00020000;
  1605.  
  1606.  (*
  1607.   * dwRefreshRate is valid
  1608.   *)
  1609.   DDSD_REFRESHRATE        = $00040000;
  1610.  
  1611. (*
  1612.  * dwLinearSize is valid
  1613.  *)
  1614.   DDSD_LINEARSIZE         = $00080000;
  1615.  
  1616. (*
  1617.  * dwTextureStage is valid
  1618.  *)
  1619.   DDSD_TEXTURESTAGE       = $00100000;
  1620.  
  1621. (*
  1622.  * All input fields are valid.
  1623.  *)
  1624.   DDSD_ALL                = $001ff9ee;
  1625.  
  1626.  
  1627. (*
  1628.  * guid field is valid.
  1629.  *)
  1630.   DDOSD_GUID                  = $00000001;
  1631.  
  1632. (*
  1633.  * dwCompressionRatio field is valid.
  1634.  *)
  1635.   DDOSD_COMPRESSION_RATIO     = $00000002;
  1636.  
  1637. (*
  1638.  * ddSCaps field is valid.
  1639.  *)
  1640.   DDOSD_SCAPS                 = $00000004;
  1641.  
  1642. (*
  1643.  * ddOSCaps field is valid.
  1644.  *)
  1645.   DDOSD_OSCAPS                = $00000008;
  1646.  
  1647. (*
  1648.  * All input fields are valid.
  1649.  *)
  1650.   DDOSD_ALL                   = $0000000f;
  1651.  
  1652. (*
  1653.  * The surface's optimized pixelformat is compressed
  1654.  *)
  1655.   DDOSDCAPS_OPTCOMPRESSED                       = $00000001;
  1656.  
  1657. (*
  1658.  * The surface's optimized pixelformat is reordered
  1659.  *)
  1660.   DDOSDCAPS_OPTREORDERED                        = $00000002;
  1661.  
  1662. (*
  1663.  * The opt surface is a monolithic mipmap
  1664.  *)
  1665.   DDOSDCAPS_MONOLITHICMIPMAP            = $00000004;
  1666.  
  1667. (*
  1668.  * The valid Surf caps:
  1669.  *   DDSCAPS_SYSTEMMEMORY       = $00000800;
  1670.  *   DDSCAPS_VIDEOMEMORY        = $00004000;
  1671.  *   DDSCAPS_LOCALVIDMEM        = $10000000;
  1672.  *   DDSCAPS_NONLOCALVIDMEM     = $20000000;
  1673.  *)
  1674.   DDOSDCAPS_VALIDSCAPS          = $30004800;
  1675.  
  1676. (*
  1677.  * The valid OptSurf caps
  1678.  *)
  1679.   DDOSDCAPS_VALIDOSCAPS                 = $00000007;
  1680.  
  1681.  
  1682. (*
  1683.  * DDCOLORCONTROL
  1684.  *)
  1685.  
  1686. (*
  1687.  * lBrightness field is valid.
  1688.  *)
  1689.   DDCOLOR_BRIGHTNESS            = $00000001;
  1690.  
  1691. (*
  1692.  * lContrast field is valid.
  1693.  *)
  1694.   DDCOLOR_CONTRAST              = $00000002;
  1695.  
  1696. (*
  1697.  * lHue field is valid.
  1698.  *)
  1699.   DDCOLOR_HUE                   = $00000004;
  1700.  
  1701. (*
  1702.  * lSaturation field is valid.
  1703.  *)
  1704.   DDCOLOR_SATURATION            = $00000008;
  1705.  
  1706. (*
  1707.  * lSharpness field is valid.
  1708.  *)
  1709.   DDCOLOR_SHARPNESS             = $00000010;
  1710.  
  1711. (*
  1712.  * lGamma field is valid.
  1713.  *)
  1714.   DDCOLOR_GAMMA                 = $00000020;
  1715.  
  1716. (*
  1717.  * lColorEnable field is valid.
  1718.  *)
  1719.   DDCOLOR_COLORENABLE           = $00000040;
  1720.  
  1721.  
  1722.  
  1723. (*============================================================================
  1724.  *
  1725.  * Direct Draw Capability Flags
  1726.  *
  1727.  * These flags are used to describe the capabilities of a given Surface.
  1728.  * All flags are bit flags.
  1729.  *
  1730.  *==========================================================================*)
  1731.  
  1732. (****************************************************************************
  1733.  *
  1734.  * DIRECTDRAWSURFACE CAPABILITY FLAGS
  1735.  *
  1736.  ****************************************************************************)
  1737. (*
  1738.  * This bit currently has no meaning.
  1739.  *)
  1740.   DDSCAPS_RESERVED1                       = $00000001;
  1741.  
  1742. (*
  1743.  * Indicates that this surface contains alpha-only information.
  1744.  * (To determine if a surface is RGBA/YUVA, the pixel format must be
  1745.  * interrogated.)
  1746.  *)
  1747.   DDSCAPS_ALPHA                           = $00000002;
  1748.  
  1749. (*
  1750.  * Indicates that this surface is a backbuffer.  It is generally
  1751.  * set by CreateSurface when the DDSCAPS_FLIP capability bit is set.
  1752.  * It indicates that this surface is THE back buffer of a surface
  1753.  * flipping structure.  DirectDraw supports N surfaces in a
  1754.  * surface flipping structure.  Only the surface that immediately
  1755.  * precedeces the DDSCAPS_FRONTBUFFER has this capability bit set.
  1756.  * The other surfaces are identified as back buffers by the presence
  1757.  * of the DDSCAPS_FLIP capability, their attachment order, and the
  1758.  * absence of the DDSCAPS_FRONTBUFFER and DDSCAPS_BACKBUFFER
  1759.  * capabilities.  The bit is sent to CreateSurface when a standalone
  1760.  * back buffer is being created.  This surface could be attached to
  1761.  * a front buffer and/or back buffers to form a flipping surface
  1762.  * structure after the CreateSurface call.  See AddAttachments for
  1763.  * a detailed description of the behaviors in this case.
  1764.  *)
  1765.   DDSCAPS_BACKBUFFER                      = $00000004;
  1766.  
  1767. (*
  1768.  * Indicates a complex surface structure is being described.  A
  1769.  * complex surface structure results in the creation of more than
  1770.  * one surface.  The additional surfaces are attached to the root
  1771.  * surface.  The complex structure can only be destroyed by
  1772.  * destroying the root.
  1773.  *)
  1774.   DDSCAPS_COMPLEX                         = $00000008;
  1775.  
  1776. (*
  1777.  * Indicates that this surface is a part of a surface flipping structure.
  1778.  * When it is passed to CreateSurface the DDSCAPS_FRONTBUFFER and
  1779.  * DDSCAP_BACKBUFFER bits are not set.  They are set by CreateSurface
  1780.  * on the resulting creations.  The dwBackBufferCount field in the
  1781.  * TDDSurfaceDesc structure must be set to at least 1 in order for
  1782.  * the CreateSurface call to succeed.  The DDSCAPS_COMPLEX capability
  1783.  * must always be set with creating multiple surfaces through CreateSurface.
  1784.  *)
  1785.   DDSCAPS_FLIP                            = $00000010;
  1786.  
  1787. (*
  1788.  * Indicates that this surface is THE front buffer of a surface flipping
  1789.  * structure.  It is generally set by CreateSurface when the DDSCAPS_FLIP
  1790.  * capability bit is set.
  1791.  * If this capability is sent to CreateSurface then a standalonw front buffer
  1792.  * is created.  This surface will not have the DDSCAPS_FLIP capability.
  1793.  * It can be attached to other back buffers to form a flipping structure.
  1794.  * See AddAttachments for a detailed description of the behaviors in this
  1795.  * case.
  1796.  *)
  1797.   DDSCAPS_FRONTBUFFER                     = $00000020;
  1798.  
  1799. (*
  1800.  * Indicates that this surface is any offscreen surface that is not an overlay,
  1801.  * texture, zbuffer, front buffer, back buffer, or alpha surface.  It is used
  1802.  * to identify plain vanilla surfaces.
  1803.  *)
  1804.   DDSCAPS_OFFSCREENPLAIN                  = $00000040;
  1805.  
  1806. (*
  1807.  * Indicates that this surface is an overlay.  It may or may not be directly visible
  1808.  * depending on whether or not it is currently being overlayed onto the primary
  1809.  * surface.  DDSCAPS_VISIBLE can be used to determine whether or not it is being
  1810.  * overlayed at the moment.
  1811.  *)
  1812.   DDSCAPS_OVERLAY                         = $00000080;
  1813.  
  1814. (*
  1815.  * Indicates that unique DirectDrawPalette objects can be created and
  1816.  * attached to this surface.
  1817.  *)
  1818.   DDSCAPS_PALETTE                         = $00000100;
  1819.  
  1820. (*
  1821.  * Indicates that this surface is the primary surface.  The primary
  1822.  * surface represents what the user is seeing at the moment.
  1823.  *)
  1824.   DDSCAPS_PRIMARYSURFACE                  = $00000200;
  1825.  
  1826. (*
  1827.  * This flag used to be DDSCAPS_PRIMARYSURFACELEFT, which is now
  1828.  * obsolete.
  1829.  *)
  1830.   DDSCAPS_RESERVED3              = $00000400;
  1831. (*
  1832.  * Indicates that this surface is the primary surface for the left eye.
  1833.  * The primary surface for the left eye represents what the user is seeing
  1834.  * at the moment with the users left eye.  When this surface is created the
  1835.  * DDSCAPS_PRIMARYSURFACE represents what the user is seeing with the users
  1836.  * right eye.
  1837.  *)
  1838.   DDSCAPS_PRIMARYSURFACELEFT = DDSCAPS_RESERVED3;
  1839.  
  1840. (*
  1841.  * Indicates that this surface memory was allocated in system memory
  1842.  *)
  1843.   DDSCAPS_SYSTEMMEMORY                    = $00000800;
  1844.  
  1845. (*
  1846.  * Indicates that this surface can be used as a 3D texture.  It does not
  1847.  * indicate whether or not the surface is being used for that purpose.
  1848.  *)
  1849.   DDSCAPS_TEXTURE                         = $00001000;
  1850.  
  1851. (*
  1852.  * Indicates that a surface may be a destination for 3D rendering.  This
  1853.  * bit must be set in order to query for a Direct3D Device Interface
  1854.  * from this surface.
  1855.  *)
  1856.   DDSCAPS_3DDEVICE                        = $00002000;
  1857.  
  1858. (*
  1859.  * Indicates that this surface exists in video memory.
  1860.  *)
  1861.   DDSCAPS_VIDEOMEMORY                     = $00004000;
  1862.  
  1863. (*
  1864.  * Indicates that changes made to this surface are immediately visible.
  1865.  * It is always set for the primary surface and is set for overlays while
  1866.  * they are being overlayed and texture maps while they are being textured.
  1867.  *)
  1868.   DDSCAPS_VISIBLE                         = $00008000;
  1869.  
  1870. (*
  1871.  * Indicates that only writes are permitted to the surface.  Read accesses
  1872.  * from the surface may or may not generate a protection fault, but the
  1873.  * results of a read from this surface will not be meaningful.  READ ONLY.
  1874.  *)
  1875.   DDSCAPS_WRITEONLY                       = $00010000;
  1876.  
  1877. (*
  1878.  * Indicates that this surface is a z buffer. A z buffer does not contain
  1879.  * displayable information.  Instead it contains bit depth information that is
  1880.  * used to determine which pixels are visible and which are obscured.
  1881.  *)
  1882.   DDSCAPS_ZBUFFER                         = $00020000;
  1883.  
  1884. (*
  1885.  * Indicates surface will have a DC associated long term
  1886.  *)
  1887.   DDSCAPS_OWNDC                           = $00040000;
  1888.  
  1889. (*
  1890.  * Indicates surface should be able to receive live video
  1891.  *)
  1892.   DDSCAPS_LIVEVIDEO                       = $00080000;
  1893.  
  1894. (*
  1895.  * Indicates surface should be able to have a stream decompressed
  1896.  * to it by the hardware.
  1897.  *)
  1898.   DDSCAPS_HWCODEC                         = $00100000;
  1899.  
  1900. (*
  1901.  * Surface is a ModeX surface.
  1902.  *
  1903.  *)
  1904.   DDSCAPS_MODEX                           = $00200000;
  1905.  
  1906. (*
  1907.  * Indicates surface is one level of a mip-map. This surface will
  1908.  * be attached to other DDSCAPS_MIPMAP surfaces to form the mip-map.
  1909.  * This can be done explicitly, by creating a number of surfaces and
  1910.  * attaching them with AddAttachedSurface or by implicitly by CreateSurface.
  1911.  * If this bit is set then DDSCAPS_TEXTURE must also be set.
  1912.  *)
  1913.   DDSCAPS_MIPMAP                          = $00400000;
  1914.  
  1915. (*
  1916.  * This bit is reserved. It should not be specified.
  1917.  *)
  1918.   DDSCAPS_RESERVED2                       = $00800000;
  1919.  
  1920. (*
  1921.  * Indicates that memory for the surface is not allocated until the surface
  1922.  * is loaded (via the Direct3D texture Load() function).
  1923.  *)
  1924.   DDSCAPS_ALLOCONLOAD                     = $04000000;
  1925.  
  1926. (*
  1927.  * Indicates that the surface will recieve data from a video port.
  1928.  *)
  1929.   DDSCAPS_VIDEOPORT                       = $08000000;
  1930.  
  1931. (*
  1932.  * Indicates that a video memory surface is resident in true, local video
  1933.  * memory rather than non-local video memory. If this flag is specified then
  1934.  * so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with
  1935.  * DDSCAPS_NONLOCALVIDMEM.
  1936.  *)
  1937.   DDSCAPS_LOCALVIDMEM                     = $10000000;
  1938.  
  1939. (*
  1940.  * Indicates that a video memory surface is resident in non-local video
  1941.  * memory rather than true, local video memory. If this flag is specified
  1942.  * then so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with
  1943.  * DDSCAPS_LOCALVIDMEM.
  1944.  *)
  1945.   DDSCAPS_NONLOCALVIDMEM                  = $20000000;
  1946.  
  1947. (*
  1948.  * Indicates that this surface is a standard VGA mode surface, and not a
  1949.  * ModeX surface. (This flag will never be set in combination with the
  1950.  * DDSCAPS_MODEX flag).
  1951.  *)
  1952.   DDSCAPS_STANDARDVGAMODE                 = $40000000;
  1953.  
  1954. (*
  1955.  * Indicates that this surface will be an optimized surface. This flag is
  1956.  * currently only valid in conjunction with the DDSCAPS_TEXTURE flag. The surface
  1957.  * will be created without any underlying video memory until loaded.
  1958.  *)
  1959.   DDSCAPS_OPTIMIZED                       = $80000000;
  1960.  
  1961.  
  1962.  
  1963. (*
  1964.  * Indicates that this surface will receive data from a video port using
  1965.  * the de-interlacing hardware.  This allows the driver to allocate memory
  1966.  * for any extra buffers that may be required.  The DDSCAPS_VIDEOPORT and
  1967.  * DDSCAPS_OVERLAY flags must also be set.
  1968.  *)
  1969.   DDSCAPS2_HARDWAREDEINTERLACE            = $00000002;
  1970.  
  1971. (*
  1972.  * Indicates to the driver that this surface will be locked very frequently
  1973.  * (for procedural textures, dynamic lightmaps, etc). Surfaces with this cap
  1974.  * set must also have DDSCAPS_TEXTURE. This cap cannot be used with
  1975.  * DDSCAPS2_HINTSTATIC and DDSCAPS2_OPAQUE.
  1976.  *)
  1977.   DDSCAPS2_HINTDYNAMIC                  = $00000004;
  1978.  
  1979. (*
  1980.  * Indicates to the driver that this surface can be re-ordered/retiled on
  1981.  * load. This operation will not change the size of the texture. It is
  1982.  * relatively fast and symmetrical, since the application may lock these
  1983.  * bits (although it will take a performance hit when doing so). Surfaces
  1984.  * with this cap set must also have DDSCAPS_TEXTURE. This cap cannot be
  1985.  * used with DDSCAPS2_HINTDYNAMIC and DDSCAPS2_OPAQUE.
  1986.  *)
  1987.   DDSCAPS2_HINTSTATIC                   = $00000008;
  1988.  
  1989. (*
  1990.  * Indicates that the client would like this texture surface to be managed by the
  1991.  * DirectDraw/Direct3D runtime. Surfaces with this cap set must also have
  1992.  * DDSCAPS_TEXTURE and DDSCAPS_SYSTEMMEMORY.
  1993.  *)
  1994.   DDSCAPS2_TEXTUREMANAGE                  = $00000010;
  1995.  
  1996. (*
  1997.  * These bits are reserved for internal use *)
  1998.   DDSCAPS2_RESERVED1                      = $00000020;
  1999.   DDSCAPS2_RESERVED2                      = $00000040;
  2000.  
  2001. (*
  2002.  * Indicates to the driver that this surface will never be locked again.
  2003.  * The driver is free to optimize this surface via retiling and actual compression.
  2004.  * All calls to Lock() or Blts from this surface will fail. Surfaces with this
  2005.  * cap set must also have DDSCAPS_TEXTURE. This cap cannot be used with
  2006.  * DDSCAPS2_HINTDYNAMIC and DDSCAPS2_HINTSTATIC.
  2007.  *)
  2008.   DDSCAPS2_OPAQUE                         = $00000080;
  2009.  
  2010. (*
  2011.  * Applications should set this bit at CreateSurface time to indicate that they
  2012.  * intend to use antialiasing. Only valid if DDSCAPS_3DDEVICE is also set.
  2013.  *)
  2014.   DDSCAPS2_HINTANTIALIASING               = $00000100;
  2015.  
  2016. (*
  2017.  * This flag is used at CreateSurface time to indicate that this set of
  2018.  * surfaces is a cubic environment map
  2019.  *)
  2020.   DDSCAPS2_CUBEMAP                        = $00000200;
  2021.  
  2022. (*
  2023.  * These flags preform two functions:
  2024.  * - At CreateSurface time, they define which of the six cube faces are
  2025.  *   required by the application.
  2026.  * - After creation, each face in the cubemap will have exactly one of these
  2027.  *   bits set.
  2028.  *)
  2029.   DDSCAPS2_CUBEMAP_POSITIVEX              = $00000400;
  2030.   DDSCAPS2_CUBEMAP_NEGATIVEX              = $00000800;
  2031.   DDSCAPS2_CUBEMAP_POSITIVEY              = $00001000;
  2032.   DDSCAPS2_CUBEMAP_NEGATIVEY              = $00002000;
  2033.   DDSCAPS2_CUBEMAP_POSITIVEZ              = $00004000;
  2034.   DDSCAPS2_CUBEMAP_NEGATIVEZ              = $00008000;
  2035.  
  2036. (*
  2037.  * This macro may be used to specify all faces of a cube map at CreateSurface time
  2038.  *)
  2039.   DDSCAPS2_CUBEMAP_ALLFACES = ( DDSCAPS2_CUBEMAP_POSITIVEX or
  2040.                                 DDSCAPS2_CUBEMAP_NEGATIVEX or
  2041.                                 DDSCAPS2_CUBEMAP_POSITIVEY or
  2042.                                 DDSCAPS2_CUBEMAP_NEGATIVEY or
  2043.                                 DDSCAPS2_CUBEMAP_POSITIVEZ or
  2044.                                 DDSCAPS2_CUBEMAP_NEGATIVEZ );
  2045.  
  2046.  
  2047. (*
  2048.  * This flag is an additional flag which is present on mipmap sublevels from DX7 onwards
  2049.  * It enables easier use of GetAttachedSurface rather than EnumAttachedSurfaces for surface
  2050.  * constructs such as Cube Maps, wherein there are more than one mipmap surface attached
  2051.  * to the root surface.
  2052.  * This caps bit is ignored by CreateSurface
  2053.  *)
  2054.   DDSCAPS2_MIPMAPSUBLEVEL                 = $00010000;
  2055.  
  2056. (* This flag indicates that the texture should be managed by D3D only *)
  2057.   DDSCAPS2_D3DTEXTUREMANAGE               = $00020000;
  2058.  
  2059. (* This flag indicates that the managed surface can be safely lost *)
  2060.   DDSCAPS2_DONOTPERSIST                   = $00040000;
  2061.  
  2062. (* indicates that this surface is part of a stereo flipping chain *)
  2063.   DDSCAPS2_STEREOSURFACELEFT              = $00080000;
  2064.  
  2065.  
  2066.  
  2067.  (****************************************************************************
  2068.  *
  2069.  * DIRECTDRAW DRIVER CAPABILITY FLAGS
  2070.  *
  2071.  ****************************************************************************)
  2072.  
  2073. (*
  2074.  * Display hardware has 3D acceleration.
  2075.  *)
  2076.   DDCAPS_3D                       = $00000001;
  2077.  
  2078. (*
  2079.  * Indicates that DirectDraw will support only dest rectangles that are aligned
  2080.  * on DIRECTDRAWCAPS.dwAlignBoundaryDest boundaries of the surface, respectively.
  2081.  * READ ONLY.
  2082.  *)
  2083.   DDCAPS_ALIGNBOUNDARYDEST        = $00000002;
  2084.  
  2085. (*
  2086.  * Indicates that DirectDraw will support only source rectangles  whose sizes in
  2087.  * BYTEs are DIRECTDRAWCAPS.dwAlignSizeDest multiples, respectively.  READ ONLY.
  2088.  *)
  2089.   DDCAPS_ALIGNSIZEDEST            = $00000004;
  2090. (*
  2091.  * Indicates that DirectDraw will support only source rectangles that are aligned
  2092.  * on DIRECTDRAWCAPS.dwAlignBoundarySrc boundaries of the surface, respectively.
  2093.  * READ ONLY.
  2094.  *)
  2095.   DDCAPS_ALIGNBOUNDARYSRC         = $00000008;
  2096.  
  2097. (*
  2098.  * Indicates that DirectDraw will support only source rectangles  whose sizes in
  2099.  * BYTEs are DIRECTDRAWCAPS.dwAlignSizeSrc multiples, respectively.  READ ONLY.
  2100.  *)
  2101.   DDCAPS_ALIGNSIZESRC             = $00000010;
  2102.  
  2103. (*
  2104.  * Indicates that DirectDraw will create video memory surfaces that have a stride
  2105.  * alignment equal to DIRECTDRAWCAPS.dwAlignStride.  READ ONLY.
  2106.  *)
  2107.   DDCAPS_ALIGNSTRIDE              = $00000020;
  2108.  
  2109. (*
  2110.  * Display hardware is capable of blt operations.
  2111.  *)
  2112.   DDCAPS_BLT                      = $00000040;
  2113.  
  2114. (*
  2115.  * Display hardware is capable of asynchronous blt operations.
  2116.  *)
  2117.   DDCAPS_BLTQUEUE                 = $00000080;
  2118.  
  2119. (*
  2120.  * Display hardware is capable of color space conversions during the blt operation.
  2121.  *)
  2122.   DDCAPS_BLTFOURCC                = $00000100;
  2123.  
  2124. (*
  2125.  * Display hardware is capable of stretching during blt operations.
  2126.  *)
  2127.   DDCAPS_BLTSTRETCH               = $00000200;
  2128.  
  2129. (*
  2130.  * Display hardware is shared with GDI.
  2131.  *)
  2132.   DDCAPS_GDI                      = $00000400;
  2133.  
  2134. (*
  2135.  * Display hardware can overlay.
  2136.  *)
  2137.   DDCAPS_OVERLAY                  = $00000800;
  2138.  
  2139. (*
  2140.  * Set if display hardware supports overlays but can not clip them.
  2141.  *)
  2142.   DDCAPS_OVERLAYCANTCLIP          = $00001000;
  2143.  
  2144. (*
  2145.  * Indicates that overlay hardware is capable of color space conversions during
  2146.  * the overlay operation.
  2147.  *)
  2148.   DDCAPS_OVERLAYFOURCC            = $00002000;
  2149.  
  2150. (*
  2151.  * Indicates that stretching can be done by the overlay hardware.
  2152.  *)
  2153.   DDCAPS_OVERLAYSTRETCH           = $00004000;
  2154.  
  2155. (*
  2156.  * Indicates that unique DirectDrawPalettes can be created for DirectDrawSurfaces
  2157.  * other than the primary surface.
  2158.  *)
  2159.   DDCAPS_PALETTE                  = $00008000;
  2160.  
  2161. (*
  2162.  * Indicates that palette changes can be syncd with the veritcal refresh.
  2163.  *)
  2164.   DDCAPS_PALETTEVSYNC             = $00010000;
  2165.  
  2166. (*
  2167.  * Display hardware can return the current scan line.
  2168.  *)
  2169.   DDCAPS_READSCANLINE             = $00020000;
  2170.  
  2171. (*
  2172.  * Display hardware has stereo vision capabilities.  DDSCAPS_PRIMARYSURFACELEFT
  2173.  * can be created.
  2174.  *)
  2175.   DDCAPS_STEREOVIEW               = $00040000;
  2176.  
  2177. (*
  2178.  * Display hardware is capable of generating a vertical blank interrupt.
  2179.  *)
  2180.   DDCAPS_VBI                      = $00080000;
  2181.  
  2182. (*
  2183.  * Supports the use of z buffers with blt operations.
  2184.  *)
  2185.   DDCAPS_ZBLTS                    = $00100000;
  2186.  
  2187. (*
  2188.  * Supports Z Ordering of overlays.
  2189.  *)
  2190.   DDCAPS_ZOVERLAYS                = $00200000;
  2191.  
  2192. (*
  2193.  * Supports color key
  2194.  *)
  2195.   DDCAPS_COLORKEY                 = $00400000;
  2196.  
  2197. (*
  2198.  * Supports alpha surfaces
  2199.  *)
  2200.   DDCAPS_ALPHA                    = $00800000;
  2201.  
  2202. (*
  2203.  * colorkey is hardware assisted(DDCAPS_COLORKEY will also be set)
  2204.  *)
  2205.   DDCAPS_COLORKEYHWASSIST         = $01000000;
  2206.  
  2207. (*
  2208.  * no hardware support at all
  2209.  *)
  2210.   DDCAPS_NOHARDWARE               = $02000000;
  2211.  
  2212. (*
  2213.  * Display hardware is capable of color fill with bltter
  2214.  *)
  2215.   DDCAPS_BLTCOLORFILL             = $04000000;
  2216.  
  2217. (*
  2218.  * Display hardware is bank switched, and potentially very slow at
  2219.  * random access to VRAM.
  2220.  *)
  2221.   DDCAPS_BANKSWITCHED             = $08000000;
  2222.  
  2223. (*
  2224.  * Display hardware is capable of depth filling Z-buffers with bltter
  2225.  *)
  2226.   DDCAPS_BLTDEPTHFILL             = $10000000;
  2227.  
  2228. (*
  2229.  * Display hardware is capable of clipping while bltting.
  2230.  *)
  2231.   DDCAPS_CANCLIP                  = $20000000;
  2232.  
  2233. (*
  2234.  * Display hardware is capable of clipping while stretch bltting.
  2235.  *)
  2236.   DDCAPS_CANCLIPSTRETCHED         = $40000000;
  2237.  
  2238. (*
  2239.  * Display hardware is capable of bltting to or from system memory
  2240.  *)
  2241.   DDCAPS_CANBLTSYSMEM             = $80000000;
  2242.  
  2243.  
  2244.  (****************************************************************************
  2245.  *
  2246.  * MORE DIRECTDRAW DRIVER CAPABILITY FLAGS (dwCaps2)
  2247.  *
  2248.  ****************************************************************************)
  2249.  
  2250. (*
  2251.  * Display hardware is certified
  2252.  *)
  2253.   DDCAPS2_CERTIFIED               = $00000001;
  2254.  
  2255. (*
  2256.  * Driver cannot interleave 2D operations (lock and blt) to surfaces with
  2257.  * Direct3D rendering operations between calls to BeginScene() and EndScene()
  2258.  *)
  2259.   DDCAPS2_NO2DDURING3DSCENE       = $00000002;
  2260.  
  2261. (*
  2262.  * Display hardware contains a video port
  2263.  *)
  2264.   DDCAPS2_VIDEOPORT               = $00000004;
  2265.  
  2266. (*
  2267.  * The overlay can be automatically flipped according to the video port
  2268.  * VSYNCs, providing automatic doubled buffered display of video port
  2269.  * data using an overlay
  2270.  *)
  2271.   DDCAPS2_AUTOFLIPOVERLAY         = $00000008;
  2272.  
  2273. (*
  2274.  * Overlay can display each field of interlaced data individually while
  2275.  * it is interleaved in memory without causing jittery artifacts.
  2276.  *)
  2277.   DDCAPS2_CANBOBINTERLEAVED     = $00000010;
  2278.  
  2279. (*
  2280.  * Overlay can display each field of interlaced data individually while
  2281.  * it is not interleaved in memory without causing jittery artifacts.
  2282.  *)
  2283.   DDCAPS2_CANBOBNONINTERLEAVED  = $00000020;
  2284.  
  2285. (*
  2286.  * The overlay surface contains color controls (brightness, sharpness, etc.)
  2287.  *)
  2288.   DDCAPS2_COLORCONTROLOVERLAY   = $00000040;
  2289.  
  2290. (*
  2291.  * The primary surface contains color controls (gamma, etc.)
  2292.  *)
  2293.   DDCAPS2_COLORCONTROLPRIMARY   = $00000080;
  2294.  
  2295. (*
  2296.  * RGBZ -> RGB supported for 16:16 RGB:Z
  2297.  *)
  2298.   DDCAPS2_CANDROPZ16BIT         = $00000100;
  2299.  
  2300. (*
  2301.  * Driver supports non-local video memory.
  2302.  *)
  2303.   DDCAPS2_NONLOCALVIDMEM          = $00000200;
  2304.  
  2305. (*
  2306.  * Dirver supports non-local video memory but has different capabilities for
  2307.  * non-local video memory surfaces. If this bit is set then so must
  2308.  * DDCAPS2_NONLOCALVIDMEM.
  2309.  *)
  2310.   DDCAPS2_NONLOCALVIDMEMCAPS      = $00000400;
  2311.  
  2312. (*
  2313.  * Driver neither requires nor prefers surfaces to be pagelocked when performing
  2314.  * blts involving system memory surfaces
  2315.  *)
  2316.   DDCAPS2_NOPAGELOCKREQUIRED      = $00000800;
  2317.  
  2318. (*
  2319.  * Driver can create surfaces which are wider than the primary surface
  2320.  *)
  2321.   DDCAPS2_WIDESURFACES            = $00001000;
  2322.  
  2323. (*
  2324.  * Driver supports bob without using a video port by handling the
  2325.  * DDFLIP_ODD and DDFLIP_EVEN flags specified in Flip.
  2326.  *)
  2327.   DDCAPS2_CANFLIPODDEVEN          = $00002000;
  2328.  
  2329. (*
  2330.  * Driver supports bob using hardware
  2331.  *)
  2332.   DDCAPS2_CANBOBHARDWARE          = $00004000;
  2333.  
  2334. (*
  2335.  * Driver supports bltting any FOURCC surface to another surface of the same FOURCC
  2336.  *)
  2337.   DDCAPS2_COPYFOURCC              = $00008000;
  2338.  
  2339.  
  2340. (*
  2341.  * Driver supports loadable gamma ramps for the primary surface
  2342.  *)
  2343.   DDCAPS2_PRIMARYGAMMA            = $00020000;
  2344.  
  2345. (*
  2346.  * Driver can render in windowed mode.
  2347.  *)
  2348.   DDCAPS2_CANRENDERWINDOWED       = $00080000;
  2349.  
  2350. (*
  2351.  * A calibrator is available to adjust the gamma ramp according to the
  2352.  * physical display properties so that the result will be identical on
  2353.  * all calibrated systems.
  2354.  *)
  2355.   DDCAPS2_CANCALIBRATEGAMMA       = $00100000;
  2356.  
  2357. (*
  2358.  * Indicates that the driver will respond to DDFLIP_INTERVALn flags
  2359.  *)
  2360.   DDCAPS2_FLIPINTERVAL            = $00200000;
  2361.  
  2362. (*
  2363.  * Indicates that the driver will respond to DDFLIP_NOVSYNC
  2364.  *)
  2365.    DDCAPS2_FLIPNOVSYNC             = $00400000;
  2366.  
  2367. (*
  2368.  * Driver supports management of video memory, if this flag is ON,
  2369.  * driver manages the texture if requested with DDSCAPS2_TEXTUREMANAGE on
  2370.  * DirectX manages the texture if this flag is OFF and surface has DDSCAPS2_TEXTUREMANAGE on
  2371.  *)
  2372.   DDCAPS2_CANMANAGETEXTURE        = $00800000;
  2373.  
  2374. (*
  2375.  * The Direct3D texture manager uses this cap to decide whether to put managed
  2376.  * surfaces in non-local video memory. If the cap is set, the texture manager will
  2377.  * put managed surfaces in non-local vidmem. Drivers that cannot texture from
  2378.  * local vidmem SHOULD NOT set this cap.
  2379.  *)
  2380.   DDCAPS2_TEXMANINNONLOCALVIDMEM  = $01000000;
  2381.  
  2382. (*
  2383.  * Indicates that the driver supports DX7 type of stereo in at least one mode (which may
  2384.  * not necessarily be the current mode). Applications should use IDirectDraw7 (or higher)
  2385.  * ::EnumDisplayModes and check the DDSURFACEDESC.ddsCaps.dwCaps2 field for the presence of
  2386.  * DDSCAPS2_STEREOSURFACELEFT to check if a particular mode supports stereo. The application
  2387.  * can also use IDirectDraw7(or higher)::GetDisplayMode to check the current mode.
  2388.  *)
  2389.   DDCAPS2_STEREO                  = $02000000;
  2390.  
  2391. (*
  2392.  * This caps bit is intended for internal DirectDraw use.
  2393.  * -It is only valid if DDCAPS2_NONLOCALVIDMEMCAPS is set.
  2394.  * -If this bit is set, then DDCAPS_CANBLTSYSMEM MUST be set by the driver (and
  2395.  *  all the assoicated system memory blt caps must be correct).
  2396.  * -It implies that the system->video blt caps in DDCAPS also apply to system to
  2397.  *  nonlocal blts. I.e. the dwSVBCaps, dwSVBCKeyCaps, dwSVBFXCaps and dwSVBRops
  2398.  *  members of DDCAPS (DDCORECAPS) are filled in correctly.
  2399.  * -Any blt from system to nonlocal memory that matches these caps bits will
  2400.  *  be passed to the driver.
  2401.  *
  2402.  * NOTE: This is intended to enable the driver itself to do efficient reordering
  2403.  * of textures. This is NOT meant to imply that hardware can write into AGP memory.
  2404.  * This operation is not currently supported.
  2405.  *)
  2406.   DDCAPS2_SYSTONONLOCAL_AS_SYSTOLOCAL   = $04000000;
  2407.  
  2408. (****************************************************************************
  2409.  *
  2410.  * DIRECTDRAW FX ALPHA CAPABILITY FLAGS
  2411.  *
  2412.  ****************************************************************************)
  2413.  
  2414. (*
  2415.  * Supports alpha blending around the edge of a source color keyed surface.
  2416.  * For Blt.
  2417.  *)
  2418.   DDFXALPHACAPS_BLTALPHAEDGEBLEND         = $00000001;
  2419.  
  2420. (*
  2421.  * Supports alpha information in the pixel format.  The bit depth of alpha
  2422.  * information in the pixel format can be 1,2,4, or 8.  The alpha value becomes
  2423.  * more opaque as the alpha value increases.  (0 is transparent.)
  2424.  * For Blt.
  2425.  *)
  2426.   DDFXALPHACAPS_BLTALPHAPIXELS            = $00000002;
  2427.  
  2428. (*
  2429.  * Supports alpha information in the pixel format.  The bit depth of alpha
  2430.  * information in the pixel format can be 1,2,4, or 8.  The alpha value
  2431.  * becomes more transparent as the alpha value increases.  (0 is opaque.)
  2432.  * This flag can only be set if DDCAPS_ALPHA is set.
  2433.  * For Blt.
  2434.  *)
  2435.   DDFXALPHACAPS_BLTALPHAPIXELSNEG         = $00000004;
  2436.  
  2437. (*
  2438.  * Supports alpha only surfaces.  The bit depth of an alpha only surface can be
  2439.  * 1,2,4, or 8.  The alpha value becomes more opaque as the alpha value increases.
  2440.  * (0 is transparent.)
  2441.  * For Blt.
  2442.  *)
  2443.   DDFXALPHACAPS_BLTALPHASURFACES          = $00000008;
  2444.  
  2445. (*
  2446.  * The depth of the alpha channel data can range can be 1,2,4, or 8.
  2447.  * The NEG suffix indicates that this alpha channel becomes more transparent
  2448.  * as the alpha value increases. (0 is opaque.)  This flag can only be set if
  2449.  * DDCAPS_ALPHA is set.
  2450.  * For Blt.
  2451.  *)
  2452.   DDFXALPHACAPS_BLTALPHASURFACESNEG       = $00000010;
  2453.  
  2454. (*
  2455.  * Supports alpha blending around the edge of a source color keyed surface.
  2456.  * For Overlays.
  2457.  *)
  2458.   DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND     = $00000020;
  2459.  
  2460. (*
  2461.  * Supports alpha information in the pixel format.  The bit depth of alpha
  2462.  * information in the pixel format can be 1,2,4, or 8.  The alpha value becomes
  2463.  * more opaque as the alpha value increases.  (0 is transparent.)
  2464.  * For Overlays.
  2465.  *)
  2466.   DDFXALPHACAPS_OVERLAYALPHAPIXELS        = $00000040;
  2467.  
  2468. (*
  2469.  * Supports alpha information in the pixel format.  The bit depth of alpha
  2470.  * information in the pixel format can be 1,2,4, or 8.  The alpha value
  2471.  * becomes more transparent as the alpha value increases.  (0 is opaque.)
  2472.  * This flag can only be set if DDCAPS_ALPHA is set.
  2473.  * For Overlays.
  2474.  *)
  2475.   DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG     = $00000080;
  2476.  
  2477. (*
  2478.  * Supports alpha only surfaces.  The bit depth of an alpha only surface can be
  2479.  * 1,2,4, or 8.  The alpha value becomes more opaque as the alpha value increases.
  2480.  * (0 is transparent.)
  2481.  * For Overlays.
  2482.  *)
  2483.   DDFXALPHACAPS_OVERLAYALPHASURFACES      = $00000100;
  2484.  
  2485. (*
  2486.  * The depth of the alpha channel data can range can be 1,2,4, or 8.  
  2487.  * The NEG suffix indicates that this alpha channel becomes more transparent
  2488.  * as the alpha value increases. (0 is opaque.)  This flag can only be set if
  2489.  * DDCAPS_ALPHA is set.
  2490.  * For Overlays.
  2491.  *)
  2492.   DDFXALPHACAPS_OVERLAYALPHASURFACESNEG   = $00000200;
  2493.  
  2494. (****************************************************************************
  2495.  *
  2496.  * DIRECTDRAW FX CAPABILITY FLAGS
  2497.  *
  2498.  ****************************************************************************)
  2499.  
  2500. (*
  2501.  * Uses arithmetic operations to stretch and shrink surfaces during blt
  2502.  * rather than pixel doubling techniques.  Along the Y axis.
  2503.  *)
  2504.   DDFXCAPS_BLTARITHSTRETCHY       = $00000020;
  2505.  
  2506. (*
  2507.  * Uses arithmetic operations to stretch during blt
  2508.  * rather than pixel doubling techniques.  Along the Y axis. Only
  2509.  * works for x1, x2, etc.
  2510.  *)
  2511.   DDFXCAPS_BLTARITHSTRETCHYN      = $00000010;
  2512.  
  2513. (*
  2514.  * Supports mirroring left to right in blt.
  2515.  *)
  2516.   DDFXCAPS_BLTMIRRORLEFTRIGHT     = $00000040;
  2517.  
  2518. (*
  2519.  * Supports mirroring top to bottom in blt.
  2520.  *)
  2521.   DDFXCAPS_BLTMIRRORUPDOWN        = $00000080;
  2522.  
  2523. (*
  2524.  * Supports arbitrary rotation for blts.
  2525.  *)
  2526.   DDFXCAPS_BLTROTATION            = $00000100;
  2527.  
  2528. (*
  2529.  * Supports 90 degree rotations for blts.
  2530.  *)
  2531.    DDFXCAPS_BLTROTATION90          = $00000200;
  2532.  
  2533. (*
  2534.  * DirectDraw supports arbitrary shrinking of a surface along the
  2535.  * x axis (horizontal direction) for blts.
  2536.  *)
  2537.   DDFXCAPS_BLTSHRINKX             = $00000400;
  2538.  
  2539. (*
  2540.  * DirectDraw supports integer shrinking (1x,2x,) of a surface
  2541.  * along the x axis (horizontal direction) for blts.
  2542.  *)
  2543.   DDFXCAPS_BLTSHRINKXN            = $00000800;
  2544.  
  2545. (*
  2546.  * DirectDraw supports arbitrary shrinking of a surface along the
  2547.  * y axis (horizontal direction) for blts.  
  2548.  *)
  2549.   DDFXCAPS_BLTSHRINKY             = $00001000;
  2550.  
  2551. (*
  2552.  * DirectDraw supports integer shrinking (1x,2x,) of a surface
  2553.  * along the y axis (vertical direction) for blts.
  2554.  *)
  2555.   DDFXCAPS_BLTSHRINKYN            = $00002000;
  2556.  
  2557. (*
  2558.  * DirectDraw supports arbitrary stretching of a surface along the
  2559.  * x axis (horizontal direction) for blts.
  2560.  *)
  2561.   DDFXCAPS_BLTSTRETCHX            = $00004000;
  2562.  
  2563. (*
  2564.  * DirectDraw supports integer stretching (1x,2x,) of a surface
  2565.  * along the x axis (horizontal direction) for blts.
  2566.  *)
  2567.   DDFXCAPS_BLTSTRETCHXN           = $00008000;
  2568.  
  2569. (*
  2570.  * DirectDraw supports arbitrary stretching of a surface along the
  2571.  * y axis (horizontal direction) for blts.  
  2572.  *)
  2573.   DDFXCAPS_BLTSTRETCHY            = $00010000;
  2574.  
  2575. (*
  2576.  * DirectDraw supports integer stretching (1x,2x,) of a surface
  2577.  * along the y axis (vertical direction) for blts.  
  2578.  *)
  2579.   DDFXCAPS_BLTSTRETCHYN           = $00020000;
  2580.  
  2581. (*
  2582.  * Uses arithmetic operations to stretch and shrink surfaces during
  2583.  * overlay rather than pixel doubling techniques.  Along the Y axis
  2584.  * for overlays.
  2585.  *)
  2586.   DDFXCAPS_OVERLAYARITHSTRETCHY   = $00040000;
  2587.  
  2588. (*
  2589.  * Uses arithmetic operations to stretch surfaces during
  2590.  * overlay rather than pixel doubling techniques.  Along the Y axis
  2591.  * for overlays. Only works for x1, x2, etc.
  2592.  *)
  2593.   DDFXCAPS_OVERLAYARITHSTRETCHYN  = $00000008;
  2594.  
  2595. (*
  2596.  * DirectDraw supports arbitrary shrinking of a surface along the
  2597.  * x axis (horizontal direction) for overlays.
  2598.  *)
  2599.   DDFXCAPS_OVERLAYSHRINKX         = $00080000;
  2600.  
  2601. (*
  2602.  * DirectDraw supports integer shrinking (1x,2x,) of a surface
  2603.  * along the x axis (horizontal direction) for overlays.
  2604.  *)
  2605.   DDFXCAPS_OVERLAYSHRINKXN        = $00100000;
  2606.  
  2607. (*
  2608.  * DirectDraw supports arbitrary shrinking of a surface along the
  2609.  * y axis (horizontal direction) for overlays.
  2610.  *)
  2611.   DDFXCAPS_OVERLAYSHRINKY         = $00200000;
  2612.  
  2613. (*
  2614.  * DirectDraw supports integer shrinking (1x,2x,) of a surface
  2615.  * along the y axis (vertical direction) for overlays.  
  2616.  *)
  2617.   DDFXCAPS_OVERLAYSHRINKYN        = $00400000;
  2618.  
  2619. (*
  2620.  * DirectDraw supports arbitrary stretching of a surface along the
  2621.  * x axis (horizontal direction) for overlays.
  2622.  *)
  2623.   DDFXCAPS_OVERLAYSTRETCHX        = $00800000;
  2624.  
  2625. (*
  2626.  * DirectDraw supports integer stretching (1x,2x,) of a surface
  2627.  * along the x axis (horizontal direction) for overlays.
  2628.  *)
  2629.   DDFXCAPS_OVERLAYSTRETCHXN       = $01000000;
  2630.  
  2631. (*
  2632.  * DirectDraw supports arbitrary stretching of a surface along the
  2633.  * y axis (horizontal direction) for overlays.  
  2634.  *)
  2635.   DDFXCAPS_OVERLAYSTRETCHY        = $02000000;
  2636.  
  2637. (*
  2638.  * DirectDraw supports integer stretching (1x,2x,) of a surface
  2639.  * along the y axis (vertical direction) for overlays.  
  2640.  *)
  2641.   DDFXCAPS_OVERLAYSTRETCHYN       = $04000000;
  2642.  
  2643. (*
  2644.  * DirectDraw supports mirroring of overlays across the vertical axis
  2645.  *)
  2646.   DDFXCAPS_OVERLAYMIRRORLEFTRIGHT = $08000000;
  2647.  
  2648. (*
  2649.  * DirectDraw supports mirroring of overlays across the horizontal axis
  2650.  *)
  2651.   DDFXCAPS_OVERLAYMIRRORUPDOWN    = $10000000;
  2652.  
  2653. (*
  2654.  * Driver can do alpha blending for blits.
  2655.  *)
  2656.   DDFXCAPS_BLTALPHA             = $00000001;
  2657.  
  2658. (*
  2659.  * Driver can do geometric transformations (or warps) for blits.
  2660.  *)
  2661.   DDFXCAPS_BLTTRANSFORM         = $00000002;
  2662.  
  2663. (*
  2664.  * Driver can do surface-reconstruction filtering for warped blits.
  2665.  *)
  2666.   DDFXCAPS_BLTFILTER           = DDFXCAPS_BLTARITHSTRETCHY;
  2667.  
  2668. (*
  2669.  * Driver can do alpha blending for overlays.
  2670.  *)
  2671.   DDFXCAPS_OVERLAYALPHA                 = $00000004;
  2672.  
  2673. (*
  2674.  * Driver can do geometric transformations (or warps) for overlays.
  2675.  *)
  2676.   DDFXCAPS_OVERLAYTRANSFORM     = $20000000;
  2677.  
  2678. (*
  2679.  * Driver can do surface-reconstruction filtering for warped overlays.
  2680.  *)
  2681.   DDFXCAPS_OVERLAYFILTER              = DDFXCAPS_OVERLAYARITHSTRETCHY;
  2682.  
  2683. (****************************************************************************
  2684.  *
  2685.  * DIRECTDRAW STEREO VIEW CAPABILITIES
  2686.  *
  2687.  ****************************************************************************)
  2688.  
  2689. (*
  2690.  * This flag used to be DDSVCAPS_ENIGMA, which is now obsolete
  2691.  * The stereo view is accomplished via enigma encoding.
  2692.  *)
  2693.   DDSVCAPS_RESERVED1                 = $00000001;
  2694.   DDSVCAPS_ENIGMA                 = DDSVCAPS_RESERVED1;
  2695.  
  2696. (*
  2697.  * This flag used to be DDSVCAPS_FLICKER, which is now obsolete
  2698.  * The stereo view is accomplished via high frequency flickering.
  2699.  *)
  2700.   DDSVCAPS_RESERVED2                = $00000002;
  2701.   DDSVCAPS_FLICKER                = DDSVCAPS_RESERVED2;
  2702.  
  2703. (*
  2704.  * This flag used to be DDSVCAPS_REDBLUE, which is now obsolete
  2705.  * The stereo view is accomplished via red and blue filters applied
  2706.  * to the left and right eyes.  All images must adapt their colorspaces
  2707.  * for this process.
  2708.  *)
  2709.   DDSVCAPS_RESERVED3                = $00000004;
  2710.   DDSVCAPS_REDBLUE                = DDSVCAPS_RESERVED3;
  2711.  
  2712. (*
  2713.  * This flag used to be DDSVCAPS_SPLIT, which is now obsolete
  2714.  * The stereo view is accomplished with split screen technology.
  2715.  *)
  2716.   DDSVCAPS_RESERVED4                  = $00000008;
  2717.   DDSVCAPS_SPLIT                  = DDSVCAPS_RESERVED4;
  2718.  
  2719. (*
  2720.  * The stereo view is accomplished with switching technology
  2721.  *)
  2722.   DDSVCAPS_STEREOSEQUENTIAL       = $00000010;
  2723.  
  2724. (****************************************************************************
  2725.  *
  2726.  * DIRECTDRAWPALETTE CAPABILITIES
  2727.  *
  2728.  ****************************************************************************)
  2729.  
  2730. (*
  2731.  * Index is 4 bits.  There are sixteen color entries in the palette table.
  2732.  *)
  2733.   DDPCAPS_4BIT                    = $00000001;
  2734.  
  2735. (*
  2736.  * Index is onto a 8 bit color index.  This field is only valid with the
  2737.  * DDPCAPS_1BIT, DDPCAPS_2BIT or DDPCAPS_4BIT capability and the target
  2738.  * surface is in 8bpp. Each color entry is one byte long and is an index
  2739.  * into destination surface's 8bpp palette.
  2740.  *)
  2741.   DDPCAPS_8BITENTRIES             = $00000002;
  2742.  
  2743. (*
  2744.  * Index is 8 bits.  There are 256 color entries in the palette table.
  2745.  *)
  2746.   DDPCAPS_8BIT                    = $00000004;
  2747.  
  2748. (*
  2749.  * Indicates that this DIRECTDRAWPALETTE should use the palette color array
  2750.  * passed into the lpDDColorArray parameter to initialize the DIRECTDRAWPALETTE
  2751.  * object.
  2752.  * This flag is obsolete. DirectDraw always initializes the color array from
  2753.  * the lpDDColorArray parameter. The definition remains for source-level
  2754.  * compatibility.
  2755.  *)
  2756.   DDPCAPS_INITIALIZE              = $00000008;
  2757.  
  2758. (*
  2759.  * This palette is the one attached to the primary surface.  Changing this
  2760.  * table has immediate effect on the display unless DDPSETPAL_VSYNC is specified
  2761.  * and supported.
  2762.  *)
  2763.   DDPCAPS_PRIMARYSURFACE          = $00000010;
  2764.  
  2765. (*
  2766.  * This palette is the one attached to the primary surface left.  Changing
  2767.  * this table has immediate effect on the display for the left eye unless
  2768.  * DDPSETPAL_VSYNC is specified and supported.
  2769.  *)
  2770.   DDPCAPS_PRIMARYSURFACELEFT      = $00000020;
  2771.  
  2772. (*
  2773.  * This palette can have all 256 entries defined
  2774.  *)
  2775.   DDPCAPS_ALLOW256                = $00000040;
  2776.  
  2777. (*
  2778.  * This palette can have modifications to it synced with the monitors
  2779.  * refresh rate.
  2780.  *)
  2781.   DDPCAPS_VSYNC                   = $00000080;
  2782.  
  2783. (*
  2784.  * Index is 1 bit.  There are two color entries in the palette table.
  2785.  *)
  2786.   DDPCAPS_1BIT                    = $00000100;
  2787.  
  2788. (*
  2789.  * Index is 2 bit.  There are four color entries in the palette table.
  2790.  *)
  2791.   DDPCAPS_2BIT                    = $00000200;
  2792.  
  2793. (*
  2794.  * The peFlags member of PALETTEENTRY denotes an 8 bit alpha value
  2795.  *)
  2796.   DDPCAPS_ALPHA                 = $00000400;
  2797.  
  2798. (****************************************************************************
  2799.  *
  2800.  * DIRECTDRAWPALETTE SETENTRY CONSTANTS
  2801.  *
  2802.  ****************************************************************************)
  2803.  
  2804.  
  2805. (****************************************************************************
  2806.  *
  2807.  * DIRECTDRAWPALETTE GETENTRY CONSTANTS
  2808.  *
  2809.  ****************************************************************************)
  2810.  
  2811. (* 0 is the only legal value *)
  2812.  
  2813. (****************************************************************************
  2814.  *
  2815.  * DIRECTDRAWSURFACE SETPALETTE CONSTANTS
  2816.  *
  2817.  ****************************************************************************)
  2818.  
  2819. (*
  2820.  * The passed pointer is an IUnknown ptr. The cbData argument to SetPrivateData
  2821.  * must be set to sizeof(IUnknown^). DirectDraw will call AddRef through this
  2822.  * pointer and Release when the private data is destroyed. This includes when
  2823.  * the surface or palette is destroyed before such priovate data is destroyed.
  2824.  *)
  2825.   DDSPD_IUNKNOWNPOINTER           = $00000001;
  2826.  
  2827. (*
  2828.  * Private data is only valid for the current state of the object,
  2829.  * as determined by the uniqueness value.
  2830.  *)
  2831.   DDSPD_VOLATILE                  = $00000002;
  2832.  
  2833. (****************************************************************************
  2834.  *
  2835.  * DIRECTDRAWSURFACE SETPALETTE CONSTANTS
  2836.  *
  2837.  ****************************************************************************)
  2838.  
  2839.  
  2840. (****************************************************************************
  2841.  *
  2842.  * DIRECTDRAW BITDEPTH CONSTANTS
  2843.  *
  2844.  * NOTE:  These are only used to indicate supported bit depths.   These
  2845.  * are flags only, they are not to be used as an actual bit depth.   The
  2846.  * absolute numbers 1, 2, 4, 8, 16, 24 and 32 are used to indicate actual
  2847.  * bit depths in a surface or for changing the display mode.
  2848.  *
  2849.  ****************************************************************************)
  2850.  
  2851. (*
  2852.  * 1 bit per pixel.
  2853.  *)
  2854.   DDBD_1                  = $00004000;
  2855.  
  2856. (*
  2857.  * 2 bits per pixel.
  2858.  *)
  2859.   DDBD_2                  = $00002000;
  2860.  
  2861. (*
  2862.  * 4 bits per pixel.
  2863.  *)
  2864.   DDBD_4                  = $00001000;
  2865.  
  2866. (*
  2867.  * 8 bits per pixel.
  2868.  *)
  2869.   DDBD_8                  = $00000800;
  2870.  
  2871. (*
  2872.  * 16 bits per pixel.
  2873.  *)
  2874.   DDBD_16                 = $00000400;
  2875.  
  2876. (*
  2877.  * 24 bits per pixel.
  2878.  *)
  2879.   DDBD_24                 = $00000200;
  2880.  
  2881. (*
  2882.  * 32 bits per pixel.
  2883.  *)
  2884.   DDBD_32   &nbs