Subversion Repositories spacemission

Compare Revisions

Regard whitespace Rev HEAD → Rev 1

/VCL_DELPHIX_D6/DirectX.pas
25,111 → 25,118
* URL : http://www.infosakyu.ne.jp/~kazuya-y/index.html
*
***************************************************************************)
{
(c)2004 Jaro Benes Recompilation with Erik Unger's headers
 
Join in order:
1) DirectDraw
2) Direct3D
3) Direct3DRM
4) DirectInput
5) DirectPlay
6) DirectSetup
7) DirectSound
8) DirectMusic
}
Unit DirectX;
unit DirectX;
 
Interface
interface
 
{Delphi version marks}
{$Z4}
{$A+}
{$WEAKPACKAGEUNIT}
 
{$I DelphiXcfg.inc}
{$IFNDEF DirectX3}
{$IFNDEF DirectX5}
{$IFNDEF DirectX6}
{$IFNDEF DirectX7}
{$DEFINE DirectX7}
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}
 
{$MINENUMSIZE 4}
{$ALIGN ON}
{$IFDEF DirectX3}
{$UNDEF DirectX5}
{$UNDEF DirectX6}
{$UNDEF DirectX7}
{$DEFINE SupportDirectX3}
{$ENDIF}
 
uses
Windows, MMSystem;
//DirectDraw file
{$IFDEF DirectX5}
{$UNDEF DirectX3}
{$UNDEF DirectX6}
{$UNDEF DirectX7}
{$DEFINE SupportDirectX3}
{$DEFINE SupportDirectX5}
{$ENDIF}
 
{$IFDEF DirectX6}
{$UNDEF DirectX3}
{$UNDEF DirectX5}
{$UNDEF DirectX7}
{$DEFINE SupportDirectX3}
{$DEFINE SupportDirectX5}
{$DEFINE SupportDirectX6}
{$ENDIF}
 
{$IFDEF DirectX7}
{$UNDEF DirectX3}
{$UNDEF DirectX5}
{$UNDEF DirectX6}
{$DEFINE SupportDirectX3}
{$DEFINE SupportDirectX5}
{$DEFINE SupportDirectX6}
{$DEFINE SupportDirectX7}
{$ENDIF}
 
uses Windows, MMSystem, ActiveX;
 
const
{$IFDEF DirectX3}
DirectXUnitVersion = 3;
{$ENDIF}{$IFDEF DirectX5}
DirectXUnitVersion = 5;
{$ENDIF}{$IFDEF DirectX6}
DirectXUnitVersion = 6;
{$ENDIF}{$IFDEF DirectX7}
DirectXUnitVersion = 7;
{$ENDIF}
 
(*==========================================================================;
*
* Copyright (C) 1994-1997 Microsoft Corporation. All Rights Reserved.
* Copyright (C) Microsoft Corporation. All Rights Reserved.
*
* Files: ddraw.h dvp.h
* Content: DirectDraw and DirectDrawVideoPort include files
* File: ddraw.h
* Content: DirectDraw include file
*
* DirectX 7.0 Delphi adaptation by Erik Unger
*
* Modified: 10-Sep-2000
*
* Download: http://www.delphi-jedi.org/DelphiGraphics/
* E-Mail: DelphiDirectX@next-reality.com
*
*
***************************************************************************)
 
var
DDrawDLL : HMODULE = 0;
{ FOURCC codes for DX compressed-texture pixel formats }
 
function DDErrorString(Value: HResult) : string;
const
FOURCC_DXT1 = Ord('D') + Ord('X') shl 8 + Ord('T') shl 16 + Ord('1') shl 24;
FOURCC_DXT2 = Ord('D') + Ord('X') shl 8 + Ord('T') shl 16 + Ord('2') shl 24;
FOURCC_DXT3 = Ord('D') + Ord('X') shl 8 + Ord('T') shl 16 + Ord('3') shl 24;
FOURCC_DXT4 = Ord('D') + Ord('X') shl 8 + Ord('T') shl 16 + Ord('4') shl 24;
FOURCC_DXT5 = Ord('D') + Ord('X') shl 8 + Ord('T') shl 16 + Ord('5') shl 24;
 
function MAKEFOURCC(ch0, ch1, ch2, ch3: Char) : DWORD;
{ GUIDS used by DirectDraw objects }
 
(*
* FOURCC codes for DX compressed-texture pixel formats
*)
const
FOURCC_DXT1 = 'DXT1';
FOURCC_DXT2 = 'DXT2';
FOURCC_DXT3 = 'DXT3';
FOURCC_DXT4 = 'DXT4';
FOURCC_DXT5 = 'DXT5';
 
(*
* GUIDS used by DirectDraw objects
*)
const
CLSID_DirectDraw: TGUID = '{D7B70EE0-4340-11CF-B063-0020AFC2CD35}';
CLSID_DirectDraw7: TGUID = '{3c305196-50db-11d3-9cfe-00c04fd930c5}';
CLSID_DirectDrawClipper: TGUID = '{593817A0-7DB3-11CF-A2DE-00AA00b93356}';
CLSID_DirectDraw7: TGUID = '{3C305196-50DB-11D3-9CFE-00C04FD930C5}';
CLSID_DirectDrawClipper: TGUID = '{593817A0-7DB3-11CF-A2DE-00AA00B93356}';
IID_IDirectDraw: TGUID = '{6C14DB80-A733-11CE-A521-0020AF0BE560}';
IID_IDirectDraw2: TGUID = '{B3A6F3E0-2B43-11CF-A2DE-00AA00B93356}';
IID_IDirectDraw4: TGUID = '{9C59509A-39BD-11D1-8C4A-00C04FD930C5}';
IID_IDirectDraw7: TGUID = '{15E65EC0-3B9C-11D2-B92F-00609797EA5B}';
IID_IDirectDrawSurface: TGUID = '{6C14DB81-A733-11CE-A521-0020AF0BE560}';
IID_IDirectDrawSurface2: TGUID = '{57805885-6EEC-11CF-9441-A82303C10E27}';
IID_IDirectDrawSurface3: TGUID = '{DA044E00-69B2-11D0-A1D5-00AA00B8DFBB}';
IID_IDirectDrawSurface4: TGUID = '{0B2B8630-AD35-11D0-8EA6-00609797EA5B}';
IID_IDirectDrawSurface7: TGUID = '{06675A80-3B9B-11D2-B92F-00609797EA5B}';
IID_IDirectDrawPalette: TGUID = '{6C14DB84-A733-11CE-A521-0020AF0BE560}';
IID_IDirectDrawClipper: TGUID = '{6C14DB85-A733-11CE-A521-0020AF0BE560}';
IID_IDirectDrawColorControl: TGUID = '{4B9F0EE0-0D7E-11D0-9B06-00A0C903A3B8}';
IID_IDirectDrawGammaControl: TGUID = '{69C11C3E-B46B-11D1-AD7A-00C04FC29B4E}';
 
const
DD_ROP_SPACE = (256 div 32); // space required to store ROP array
DD_ROP_SPACE = 256 div 32; // space required to store ROP array
 
MAX_DDDEVICEID_STRING = 512;
 
(*
* Flags for the IDirectDraw4::GetDeviceIdentifier method
*)
{ DirectDraw Structures }
 
(*
* This flag causes GetDeviceIdentifier to return information about the host (typically 2D) adapter in a system equipped
* with a stacked secondary 3D adapter. Such an adapter appears to the application as if it were part of the
* host adapter, but is typically physcially located on a separate card. The stacked secondary's information is
* returned when GetDeviceIdentifier's dwFlags field is zero, since this most accurately reflects the qualities
* of the DirectDraw object involved.
*)
DDGDI_GETHOSTIDENTIFIER = $00000001;
 
(*============================================================================
*
* DirectDraw Structures
*
* Various structures used to invoke DirectDraw.
*
*==========================================================================*)
 
var
NilGUID : TGUID{$IfNDef VER6UP} absolute 0{$EndIf};
 
type
TRefGUID = packed record
case integer of
1: (guid : PGUID);
2: (dwFlags : DWORD);
end;
 
IDirectDraw = interface;
IDirectDraw2 = interface;
IDirectDraw4 = interface;
139,40 → 146,41
IDirectDrawSurface3 = interface;
IDirectDrawSurface4 = interface;
IDirectDrawSurface7 = interface;
 
IDirectDrawPalette = interface;
IDirectDrawClipper = interface;
IDirectDrawColorControl = interface;
IDirectDrawGammaControl = interface;
 
(*
* Generic pixel format with 8-bit RGB and alpha components
*)
{ TDDARGB structure }
 
PDDARGB = ^TDDARGB;
TDDARGB = packed record
blue: BYTE;
green: BYTE;
red: BYTE;
alpha: BYTE;
TDDARGB = record
Blue: Byte;
Green: Byte;
Red: Byte;
Alpha: Byte;
end;
 
(*
* This version of the structure remains for backwards source compatibility.
* The DDARGB structure is the one that should be used for all DirectDraw APIs.
*)
DDARGB = TDDARGB;
LPDDARGB = PDDARGB;
 
{ TDDRGBA structure }
 
PDDRGBA = ^TDDRGBA;
TDDRGBA = packed record
red : BYTE;
green : BYTE;
blue : BYTE;
alpha : BYTE;
TDDRGBA = record
Red: Byte;
Green: Byte;
Blue: Byte;
Alpha: Byte;
end;
 
(*
* TDDColorKey
*)
DDRGBA = TDDRGBA;
LPDDRGBA = PDDRGBA;
 
{ TDDColorKey structure }
 
PDDColorKey = ^TDDColorKey;
TDDColorKey = packed record
TDDColorKey = record
dwColorSpaceLowValue: DWORD; // low boundary of color space that is to
// be treated as Color Key, inclusive
dwColorSpaceHighValue: DWORD; // high boundary of color space that is
179,21 → 187,13
// to be treated as Color Key, inclusive
end;
 
// Delphi 5 can't handle interface in variant records
// so we have to use pointers instead (which can be type-casted into interfaces):
DDCOLORKEY = TDDColorKey;
LPDDCOLORKEY = PDDColorKey;
 
{$IFDEF VER5UP}
PDirectDrawSurface = Pointer;
{$ELSE}
PDirectDrawSurface = IDirectDrawSurface;
{$ENDIF}
{ TDDBltFX structure }
 
(*
* TDDBltFX
* Used to pass override information to the DIRECTDRAWSURFACE callback Blt.
*)
PDDBltFX = ^TDDBltFX;
TDDBltFX = packed record
TDDBltFX = record
dwSize : DWORD; // size of structure
dwDDFX : DWORD; // FX operations
dwROP : DWORD; // Win32 raster operations
204,88 → 204,89
dwZBufferHigh : DWORD; // High limit of Z buffer
dwZBufferBaseDest : DWORD; // Destination base value
dwZDestConstBitDepth : DWORD; // Bit depth used to specify Z constant for destination
case integer of
case Integer of
0: (
dwZDestConst : DWORD // Constant to use as Z buffer for dest
);
1: (
lpDDSZBufferDest : PDirectDrawSurface; // Surface to use as Z buffer for dest
dwZDestConst: DWORD; // Constant to use as Z buffer for dest
dwZSrcConstBitDepth : DWORD; // Bit depth used to specify Z constant for source
case integer of
0: (
dwZSrcConst : DWORD; // Constant to use as Z buffer for src
);
1: (
lpDDSZBufferSrc : PDirectDrawSurface; // Surface to use as Z buffer for src
dwAlphaEdgeBlendBitDepth : DWORD; // Bit depth used to specify constant for alpha edge blend
dwAlphaEdgeBlend : DWORD; // Alpha for edge blending
dwReserved : DWORD;
dwAlphaDestConstBitDepth : DWORD; // Bit depth used to specify alpha constant for destination
case integer of
0: (
dwAlphaDestConst : DWORD; // Constant to use as Alpha Channel
);
1: (
lpDDSAlphaDest : PDirectDrawSurface; // Surface to use as Alpha Channel
dwAlphaSrcConstBitDepth : DWORD; // Bit depth used to specify alpha constant for source
case integer of
0: (
dwAlphaSrcConst : DWORD; // Constant to use as Alpha Channel
);
1: (
lpDDSAlphaSrc : PDirectDrawSurface; // Surface to use as Alpha Channel
case integer of
0: (
dwFillColor : DWORD; // color in RGB or Palettized
ddckDestColorkey: TDDColorKey; // DestColorkey override
ddckSrcColorkey: TDDColorKey; // SrcColorkey override
);
1: (
lpDDSZBufferDest: Pointer{IDirectDrawSurface}; // Surface to use as Z buffer for dest
_union1b: DWORD;
lpDDSZBufferSrc: Pointer{IDirectDrawSurface}; // Surface to use as Z buffer for src
_union1d: DWORD;
_union1e: DWORD;
_union1f: DWORD;
_union1g: DWORD;
lpDDSAlphaDest: Pointer{IDirectDrawSurface}; // Surface to use as Alpha Channel
_union1i: DWORD;
lpDDSAlphaSrc: Pointer{IDirectDrawSurface}; // Surface to use as Alpha Channel
dwFillDepth : DWORD; // depth value for z-buffer
);
2: (
dwFillPixel : DWORD; // pixel value
_union2a: DWORD;
_union2b: DWORD;
_union2c: DWORD;
_union2d: DWORD;
_union2e: DWORD;
_union2f: DWORD;
_union2g: DWORD;
_union2h: DWORD;
_union2i: DWORD;
_union2j: DWORD;
lpDDSPattern: Pointer{IDirectDrawSurface}; // Surface to use as pattern
);
3: (
lpDDSPattern : PDirectDrawSurface; // Surface to use as pattern
ddckDestColorkey : TDDColorKey; // DestColorkey override
ddckSrcColorkey : TDDColorKey; // SrcColorkey override
)
)
)
)
)
end;
 
(*
* TDDSCaps
*)
DDBLTFX = TDDBltFX;
LPDDBLTFX = PDDBltFX;
 
{ TDDSCaps structure }
 
PDDSCaps = ^TDDSCaps;
TDDSCaps = packed record
TDDSCaps = record
dwCaps: DWORD; // capabilities of surface wanted
end;
 
(*
* TDDOSCaps
*)
DDSCAPS = TDDSCaps;
LPDDSCAPS = PDDSCaps;
{ TDDOSCaps structure }
 
PDDOSCaps = ^TDDOSCaps;
TDDOSCaps = packed record
TDDOSCaps = record
dwCaps: DWORD; // capabilities of surface wanted
end;
 
(*
* This structure is used internally by DirectDraw.
*)
DDOSCAPS = TDDOSCaps;
LPDDOSCAPS = PDDOSCaps;
 
 
{ TDDSCapsEx structure }
 
PDDSCapsEx = ^TDDSCapsEx;
TDDSCapsEx = packed record
TDDSCapsEx = record
dwCaps2 : DWORD;
dwCaps3 : DWORD;
dwCaps4 : DWORD;
end;
 
(*
* TDDSCaps2
*)
DDSCAPSEX = TDDSCapsEx;
LPDDSCAPSEX = PDDSCapsEx;
 
{ TDDSCaps2 structure }
 
PDDSCaps2 = ^TDDSCaps2;
TDDSCaps2 = packed record
TDDSCaps2 = record
dwCaps: DWORD; // capabilities of surface wanted
dwCaps2 : DWORD;
dwCaps3 : DWORD;
292,15 → 293,53
dwCaps4 : DWORD;
end;
 
(*
* TDDCaps
*)
(*
* This structure is the TDDCaps structure as it was in version 2 and 3 of Direct X.
* It is present for back compatability.
*)
DDSCAPS2 = TDDSCaps2;
LPDDSCAPS2 = PDDSCaps2;
 
{ TDDCaps structure }
 
PDDCaps_DX1 = ^TDDCaps_DX1;
TDDCaps_DX1 = record
dwSize: DWORD; // size of the DDDRIVERCAPS structure
dwCaps: DWORD; // driver specific capabilities
dwCaps2: DWORD; // more driver specific capabilites
dwCKeyCaps: DWORD; // color key capabilities of the surface
dwFXCaps: DWORD; // driver specific stretching and effects capabilites
dwFXAlphaCaps: DWORD; // alpha driver specific capabilities
dwPalCaps: DWORD; // palette capabilities
dwSVCaps: DWORD; // stereo vision capabilities
dwAlphaBltConstBitDepths: DWORD; // DDBD_2,4,8
dwAlphaBltPixelBitDepths: DWORD; // DDBD_1,2,4,8
dwAlphaBltSurfaceBitDepths: DWORD; // DDBD_1,2,4,8
dwAlphaOverlayConstBitDepths: DWORD; // DDBD_2,4,8
dwAlphaOverlayPixelBitDepths: DWORD; // DDBD_1,2,4,8
dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
dwZBufferBitDepths: DWORD; // DDBD_8,16,24,32
dwVidMemTotal: DWORD; // total amount of video memory
dwVidMemFree: DWORD; // amount of free video memory
dwMaxVisibleOverlays: DWORD; // maximum number of visible overlays
dwCurrVisibleOverlays: DWORD; // current number of visible overlays
dwNumFourCCCodes: DWORD; // number of four cc codes
dwAlignBoundarySrc: DWORD; // source rectangle alignment
dwAlignSizeSrc: DWORD; // source rectangle byte size
dwAlignBoundaryDest: DWORD; // dest rectangle alignment
dwAlignSizeDest: DWORD; // dest rectangle byte size
dwAlignStrideAlign: DWORD; // stride alignment
dwRops: array[0..DD_ROP_SPACE-1] of DWORD; // ROPS supported
ddsCaps: TDDSCaps; // TDDSCaps structure has all the general capabilities
dwMinOverlayStretch: DWORD; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMaxOverlayStretch: DWORD; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMinLiveVideoStretch: DWORD; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMaxLiveVideoStretch: DWORD; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMinHwCodecStretch: DWORD; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMaxHwCodecStretch: DWORD; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwReserved1: DWORD; // reserved
dwReserved2: DWORD; // reserved
dwReserved3: DWORD; // reserved
end;
 
PDDCaps_DX3 = ^TDDCaps_DX3;
TDDCaps_DX3 = packed record
TDDCaps_DX3 = record
dwSize: DWORD; // size of the DDDRIVERCAPS structure
dwCaps: DWORD; // driver specific capabilities
dwCaps2: DWORD; // more driver specific capabilites
326,7 → 365,7
dwAlignBoundaryDest: DWORD; // dest rectangle alignment
dwAlignSizeDest: DWORD; // dest rectangle byte size
dwAlignStrideAlign: DWORD; // stride alignment
dwRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported
dwRops: array[0..DD_ROP_SPACE-1] of DWORD; // ROPS supported
ddsCaps: TDDSCaps; // TDDSCaps structure has all the general capabilities
dwMinOverlayStretch: DWORD; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMaxOverlayStretch: DWORD; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
340,26 → 379,22
dwSVBCaps: DWORD; // driver specific capabilities for System->Vmem blts
dwSVBCKeyCaps: DWORD; // driver color key capabilities for System->Vmem blts
dwSVBFXCaps: DWORD; // driver FX capabilities for System->Vmem blts
dwSVBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
dwSVBRops: array[0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
dwVSBCaps: DWORD; // driver specific capabilities for Vmem->System blts
dwVSBCKeyCaps: DWORD; // driver color key capabilities for Vmem->System blts
dwVSBFXCaps: DWORD; // driver FX capabilities for Vmem->System blts
dwVSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
dwVSBRops: array[0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
dwSSBCaps: DWORD; // driver specific capabilities for System->System blts
dwSSBCKeyCaps: DWORD; // driver color key capabilities for System->System blts
dwSSBFXCaps: DWORD; // driver FX capabilities for System->System blts
dwSSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
dwReserved4 : DWORD;
dwReserved5 : DWORD;
dwReserved6 : DWORD;
dwSSBRops: array[0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
dwReserved4: DWORD; // reserved
dwReserved5: DWORD; // reserved
dwReserved6: DWORD; // reserved
end;
 
(*
* This structure is the TDDCaps structure as it was in version 5 of Direct X.
* It is present for back compatability.
*)
PDDCaps_DX5 = ^TDDCaps_DX5;
TDDCaps_DX5 = packed record
TDDCaps_DX5 = record
dwSize: DWORD; // size of the DDDRIVERCAPS structure
dwCaps: DWORD; // driver specific capabilities
dwCaps2: DWORD; // more driver specific capabilites
385,7 → 420,7
dwAlignBoundaryDest: DWORD; // dest rectangle alignment
dwAlignSizeDest: DWORD; // dest rectangle byte size
dwAlignStrideAlign: DWORD; // stride alignment
dwRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported
dwRops: array[0..DD_ROP_SPACE-1] of DWORD; // ROPS supported
ddsCaps: TDDSCaps; // TDDSCaps structure has all the general capabilities
dwMinOverlayStretch: DWORD; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMaxOverlayStretch: DWORD; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
399,16 → 434,16
dwSVBCaps: DWORD; // driver specific capabilities for System->Vmem blts
dwSVBCKeyCaps: DWORD; // driver color key capabilities for System->Vmem blts
dwSVBFXCaps: DWORD; // driver FX capabilities for System->Vmem blts
dwSVBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
dwSVBRops: array[0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
dwVSBCaps: DWORD; // driver specific capabilities for Vmem->System blts
dwVSBCKeyCaps: DWORD; // driver color key capabilities for Vmem->System blts
dwVSBFXCaps: DWORD; // driver FX capabilities for Vmem->System blts
dwVSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
dwVSBRops: array[0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
dwSSBCaps: DWORD; // driver specific capabilities for System->System blts
dwSSBCKeyCaps: DWORD; // driver color key capabilities for System->System blts
dwSSBFXCaps: DWORD; // driver FX capabilities for System->System blts
dwSSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
// Members added for DX5:
dwSSBRops: array[0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
{ Members added for DX5 }
dwMaxVideoPorts: DWORD; // maximum number of usable video ports
dwCurrVideoPorts: DWORD; // current number of video ports used
dwSVBCaps2: DWORD; // more driver specific capabilities for System->Vmem blts
416,16 → 451,79
dwNLVBCaps2: DWORD; // more driver specific capabilities non-local->local vidmem blts
dwNLVBCKeyCaps: DWORD; // driver color key capabilities for non-local->local vidmem blts
dwNLVBFXCaps: DWORD; // driver FX capabilities for non-local->local blts
dwNLVBRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for non-local->local blts
dwNLVBRops: array[0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for non-local->local blts
end;
 
PDDCaps_DX6 = ^TDDCaps_DX6;
TDDCaps_DX6 = packed record
TDDCaps_DX6 = record
dwSize: DWORD; // size of the DDDRIVERCAPS structure
dwCaps: DWORD; // driver specific capabilities
dwCaps2: DWORD; // more driver specific capabilites
dwCKeyCaps: DWORD; // color key capabilities of the surface
dwFXCaps: DWORD; // driver specific stretching and effects capabilites
dwFXAlphaCaps: DWORD; // alpha caps
dwPalCaps: DWORD; // palette capabilities
dwSVCaps: DWORD; // stereo vision capabilities
dwAlphaBltConstBitDepths: DWORD; // DDBD_2,4,8
dwAlphaBltPixelBitDepths: DWORD; // DDBD_1,2,4,8
dwAlphaBltSurfaceBitDepths: DWORD; // DDBD_1,2,4,8
dwAlphaOverlayConstBitDepths: DWORD; // DDBD_2,4,8
dwAlphaOverlayPixelBitDepths: DWORD; // DDBD_1,2,4,8
dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
dwZBufferBitDepths: DWORD; // DDBD_8,16,24,32
dwVidMemTotal: DWORD; // total amount of video memory
dwVidMemFree: DWORD; // amount of free video memory
dwMaxVisibleOverlays: DWORD; // maximum number of visible overlays
dwCurrVisibleOverlays: DWORD; // current number of visible overlays
dwNumFourCCCodes: DWORD; // number of four cc codes
dwAlignBoundarySrc: DWORD; // source rectangle alignment
dwAlignSizeSrc: DWORD; // source rectangle byte size
dwAlignBoundaryDest: DWORD; // dest rectangle alignment
dwAlignSizeDest: DWORD; // dest rectangle byte size
dwAlignStrideAlign: DWORD; // stride alignment
dwRops: array[0..DD_ROP_SPACE-1] of DWORD; // ROPS supported
ddsOldCaps: TDDSCaps; // Was TDDSCaps ddsCaps. ddsCaps is of type DDSCAPS2 for DX6
dwMinOverlayStretch: DWORD; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMaxOverlayStretch: DWORD; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMinLiveVideoStretch: DWORD; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMaxLiveVideoStretch: DWORD; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMinHwCodecStretch: DWORD; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMaxHwCodecStretch: DWORD; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwReserved1: DWORD; // reserved
dwReserved2: DWORD; // reserved
dwReserved3: DWORD; // reserved
dwSVBCaps: DWORD; // driver specific capabilities for System->Vmem blts
dwSVBCKeyCaps: DWORD; // driver color key capabilities for System->Vmem blts
dwSVBFXCaps: DWORD; // driver FX capabilities for System->Vmem blts
dwSVBRops: array[0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
dwVSBCaps: DWORD; // driver specific capabilities for Vmem->System blts
dwVSBCKeyCaps: DWORD; // driver color key capabilities for Vmem->System blts
dwVSBFXCaps: DWORD; // driver FX capabilities for Vmem->System blts
dwVSBRops: array[0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
dwSSBCaps: DWORD; // driver specific capabilities for System->System blts
dwSSBCKeyCaps: DWORD; // driver color key capabilities for System->System blts
dwSSBFXCaps: DWORD; // driver FX capabilities for System->System blts
dwSSBRops: array[0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
{ Members added for DX5 }
dwMaxVideoPorts: DWORD; // maximum number of usable video ports
dwCurrVideoPorts: DWORD; // current number of video ports used
dwSVBCaps2: DWORD; // more driver specific capabilities for System->Vmem blts
dwNLVBCaps: DWORD; // driver specific capabilities for non-local->local vidmem blts
dwNLVBCaps2: DWORD; // more driver specific capabilities non-local->local vidmem blts
dwNLVBCKeyCaps: DWORD; // driver color key capabilities for non-local->local vidmem blts
dwNLVBFXCaps: DWORD; // driver FX capabilities for non-local->local blts
dwNLVBRops: array[0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for non-local->local blts
{ Members added for DX6 }
ddsCaps: TDDSCaps2; // Surface Caps
end;
 
PDDCaps_DX7 = ^TDDCaps_DX7;
TDDCaps_DX7 = record
dwSize: DWORD; // size of the DDDRIVERCAPS structure
dwCaps: DWORD; // driver specific capabilities
dwCaps2: DWORD; // more driver specific capabilites
dwCKeyCaps: DWORD; // color key capabilities of the surface
dwFXCaps: DWORD; // driver specific stretching and effects capabilites
dwFXAlphaCaps: DWORD; // alpha driver specific capabilities
dwPalCaps: DWORD; // palette capabilities
dwSVCaps: DWORD; // stereo vision capabilities
446,8 → 544,8
dwAlignBoundaryDest: DWORD; // dest rectangle alignment
dwAlignSizeDest: DWORD; // dest rectangle byte size
dwAlignStrideAlign: DWORD; // stride alignment
dwRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported
ddsOldCaps: TDDSCaps; // Was dssCaps: TDDSCaps. ddsCaps is of type TDDScaps2 for DX6
dwRops: array[0..DD_ROP_SPACE-1] of DWORD; // ROPS supported
ddsOldCaps: TDDSCaps; // Was TDDSCaps ddsCaps. ddsCaps is of type DDSCAPS2 for DX6
dwMinOverlayStretch: DWORD; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMaxOverlayStretch: DWORD; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
dwMinLiveVideoStretch: DWORD; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
460,16 → 558,16
dwSVBCaps: DWORD; // driver specific capabilities for System->Vmem blts
dwSVBCKeyCaps: DWORD; // driver color key capabilities for System->Vmem blts
dwSVBFXCaps: DWORD; // driver FX capabilities for System->Vmem blts
dwSVBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
dwSVBRops: array[0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
dwVSBCaps: DWORD; // driver specific capabilities for Vmem->System blts
dwVSBCKeyCaps: DWORD; // driver color key capabilities for Vmem->System blts
dwVSBFXCaps: DWORD; // driver FX capabilities for Vmem->System blts
dwVSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
dwVSBRops: array[0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
dwSSBCaps: DWORD; // driver specific capabilities for System->System blts
dwSSBCKeyCaps: DWORD; // driver color key capabilities for System->System blts
dwSSBFXCaps: DWORD; // driver FX capabilities for System->System blts
dwSSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
// Members added for DX5:
dwSSBRops: array[0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
{ Members added for DX5 }
dwMaxVideoPorts: DWORD; // maximum number of usable video ports
dwCurrVideoPorts: DWORD; // current number of video ports used
dwSVBCaps2: DWORD; // more driver specific capabilities for System->Vmem blts
477,48 → 575,40
dwNLVBCaps2: DWORD; // more driver specific capabilities non-local->local vidmem blts
dwNLVBCKeyCaps: DWORD; // driver color key capabilities for non-local->local vidmem blts
dwNLVBFXCaps: DWORD; // driver FX capabilities for non-local->local blts
dwNLVBRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for non-local->local blts
// Members added for DX6 release
dwNLVBRops: array[0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for non-local->local blts
{ Members added for DX6 }
ddsCaps : TDDSCaps2 ; // Surface Caps
end;
 
TDDCaps_DX7 = TDDCaps_DX6;
PDDCaps = ^TDDCaps;
 
{$IFDEF DIRECTX3}
{$IFDEF DirectX1}
TDDCaps = TDDCaps_DX1;
PDDCaps = PDDCaps_DX1;
{$ENDIF}{$IFDEF DirectX3}
TDDCaps = TDDCaps_DX3;
{$ELSE}
{$IFDEF DIRECTX5}
PDDCaps = PDDCaps_DX3;
{$ENDIF}{$IFDEF DirectX5}
TDDCaps = TDDCaps_DX5;
{$ELSE}
{$IFDEF DIRECTX6}
PDDCaps = PDDCaps_DX5;
{$ENDIF}{$IFDEF DirectX6}
TDDCaps = TDDCaps_DX6;
{$ELSE}
PDDCaps = PDDCaps_DX6;
{$ENDIF}{$IFDEF DirectX7}
TDDCaps = TDDCaps_DX7;
PDDCaps = PDDCaps_DX7;
{$ENDIF}
{$ENDIF}
{$ENDIF}
 
DDCAPS = TDDCaps;
LPDDCAPS = PDDCaps;
 
{ TDDPixelFormat structure }
 
 
(*
* TDDPixelFormat
*)
PDDPixelFormat_DX5 = ^TDDPixelFormat_DX5;
TDDPixelFormat_DX5 = packed record
PDDPixelFormat = ^TDDPixelFormat;
TDDPixelFormat = record
dwSize: DWORD; // size of structure
dwFlags: DWORD; // pixel format flags
dwFourCC: DWORD; // (FOURCC code)
case Integer of
0: (
dwZBufferBitDepth: DWORD; // how many bits for z buffers
);
1: (
dwAlphaBitDepth: DWORD; // how many bits for alpha channels
);
2: (
dwRGBBitCount: DWORD; // how many bits per pixel
dwRBitMask: DWORD; // mask for red bit
dwGBitMask: DWORD; // mask for green bits
525,38 → 615,14
dwBBitMask: DWORD; // mask for blue bits
dwRGBAlphaBitMask: DWORD; // mask for alpha channel
);
3: (
dwYUVBitCount: DWORD; // how many bits per pixel
dwYBitMask: DWORD; // mask for Y bits
dwUBitMask: DWORD; // mask for U bits
dwVBitMask: DWORD; // mask for V bits
case Integer of
0: (
dwYUVAlphaBitMask: DWORD; // mask for alpha channel
);
1: (
dwRGBZBitMask: DWORD;
_union1a: DWORD;
_union1b: DWORD;
_union1c: DWORD;
_union1d: DWORD;
dwRGBZBitMask: DWORD; // mask for Z channel
);
2: (
dwYUVZBitMask: DWORD;
);
);
end;
 
PDDPixelFormat_DX6 = ^TDDPixelFormat_DX6;
TDDPixelFormat_DX6 = packed record
dwSize: DWORD; // size of structure
dwFlags: DWORD; // pixel format flags
dwFourCC: DWORD; // (FOURCC code)
case Integer of
1: (
dwRGBBitCount : DWORD; // how many bits per pixel
dwRBitMask : DWORD; // mask for red bit
dwGBitMask : DWORD; // mask for green bits
dwBBitMask : DWORD; // mask for blue bits
dwRGBAlphaBitMask : DWORD; // mask for alpha channel
);
2: (
dwYUVBitCount : DWORD; // how many bits per pixel
dwYBitMask : DWORD; // mask for Y bits
dwUBitMask : DWORD; // mask for U bits
564,52 → 630,43
dwYUVAlphaBitMask : DWORD; // mask for alpha channel
);
3: (
dwZBufferBitDepth : DWORD; // how many total bits/pixel in z buffer (including any stencil bits)
_union3a: DWORD;
_union3b: DWORD;
_union3c: DWORD;
_union3d: DWORD;
dwYUVZBitMask: DWORD; // mask for Z channel
);
4: (
dwZBufferBitDepth: DWORD; // how many bits for z buffers
dwStencilBitDepth : DWORD; // how many stencil bits (note: dwZBufferBitDepth-dwStencilBitDepth is total Z-only bits)
dwZBitMask : DWORD; // mask for Z bits
dwStencilBitMask : DWORD; // mask for stencil bits
dwLuminanceAlphaBitMask : DWORD;// mask for alpha channel
);
4: (
5: (
dwAlphaBitDepth : DWORD; // how many bits for alpha channels
);
6: (
dwLuminanceBitCount: DWORD; // how many bits per pixel
dwLuminanceBitMask : DWORD; // mask for luminance bits
_union6c: DWORD;
_union6d: DWORD;
dwLuminanceAlphaBitMask: DWORD;
);
7: (
dwBumpBitCount: DWORD; // how many bits per "buxel", total
dwBumpDuBitMask: DWORD; // mask for bump map U delta bits
dwBumpDvBitMask : DWORD; // mask for bump map V delta bits
dwBumpLuminanceBitMask : DWORD; // mask for luminance in bump map
dwRGBZBitMask : DWORD; // mask for Z channel
);
5: (
dwLuminanceBitCount : DWORD; // how many bits per pixel
dwBumpDuBitMask : DWORD; // mask for bump map U delta bits
Fill1, Fill2 : DWORD;
dwYUVZBitMask : DWORD; // mask for Z channel
);
6: ( dwBumpBitCount : DWORD; // how many bits per "buxel", total
);
end;
 
TDDPixelFormat_DX3 = TDDPixelFormat_DX5;
TDDPixelFormat_DX7 = TDDPixelFormat_DX6;
DDPIXELFORMAT = TDDPixelFormat;
LPDDPIXELFORMAT = PDDPixelFormat;
 
PDDPixelFormat = ^TDDPixelFormat;
{$IFDEF DIRECTX3}
TDDPixelFormat = TDDPixelFormat_DX3;
{$ELSE}
{$IFDEF DIRECTX5}
TDDPixelFormat = TDDPixelFormat_DX5;
{$ELSE}
{$IFDEF DIRECTX6}
TDDPixelFormat = TDDPixelFormat_DX6;
{$ELSE}
TDDPixelFormat = TDDPixelFormat_DX7;
{$ENDIF}
{$ENDIF}
{$ENDIF}
{ DDOVERLAYFX structure }
 
(*
* TDDOverlayFX
*)
PDDOverlayFX = ^TDDOverlayFX;
TDDOverlayFX = packed record
PDDOverlayFx = ^TDDOverlayFx;
TDDOverlayFx = record
dwSize: DWORD; // size of structure
dwAlphaEdgeBlendBitDepth: DWORD; // Bit depth used to specify constant for alpha edge blend
dwAlphaEdgeBlend: DWORD; // Constant to use as alpha for edge blend
626,40 → 683,157
dwFlags: DWORD; // flags
);
1: (
lpDDSAlphaDest: PDirectDrawSurface; // Surface to use as alpha channel for dest
filler: DWORD;
lpDDSAlphaSrc: PDirectDrawSurface; // Surface to use as alpha channel for src
lpDDSAlphaDest: Pointer{IDirectDrawSurface}; // Surface to use as alpha channel for dest
_union1b: DWORD;
lpDDSAlphaSrc: Pointer{IDirectDrawSurface}; // Surface to use as alpha channel for src
);
end;
 
(*
* TDDBltBatch: BltBatch entry structure
*)
DDOVERLAYFX = TDDOverlayFx;
LPDDOVERLAYFX = PDDOverlayFx;
 
{ TDDBltBatch structure }
 
PDDBltBatch = ^TDDBltBatch;
TDDBltBatch = packed record
TDDBltBatch = record
lprDest: PRect;
lpDDSSrc: IDirectDrawSurface;
lprSrc: PRect;
dwFlags: DWORD;
lpDDBltFx: TDDBltFX;
lpDDBltFx: PDDBltFX;
end;
 
(*
* TDDGammaRamp
*)
DDBLTBATCH = TDDBltBatch;
LPDDBLTBATCH = PDDBltBatch;
 
{ TDDSurfaceDesc structure }
 
PDDSurfaceDesc = ^TDDSurfaceDesc;
TDDSurfaceDesc = record
dwSize: DWORD; // size of the TDDSurfaceDesc structure
dwFlags: DWORD; // determines what fields are valid
dwHeight: DWORD; // height of surface to be created
dwWidth: DWORD; // width of input surface
case Integer of
0: (
lPitch: Longint;
dwBackBufferCount: DWORD; // number of back buffers requested
case Integer of
0: (
dwMipMapCount: DWORD; // number of mip-map levels requested
dwAlphaBitDepth: DWORD; // depth of alpha buffer requested
dwReserved: DWORD; // reserved
lpSurface: Pointer; // pointer to the associated surface memory
ddckCKDestOverlay: TDDColorKey;// color key for destination overlay use
ddckCKDestBlt: TDDColorKey; // color key for destination blt use
ddckCKSrcOverlay: TDDColorKey; // color key for source overlay use
ddckCKSrcBlt: TDDColorKey; // color key for source blt use
ddpfPixelFormat: TDDPixelFormat;// pixel format description of the surface
ddsCaps: TDDSCaps; // direct draw surface capabilities
);
1: (
dwZBufferBitDepth: DWORD; // depth of Z buffer requested
);
2: (
dwRefreshRate: DWORD; // refresh rate (used when display mode is described)
);
);
1: (
dwLinearSize: DWORD
);
end;
 
DDSURFACEDESC = TDDSurfaceDesc;
LPDDSURFACEDESC = PDDSurfaceDesc;
 
{ TDDSurfaceDesc2 structure }
 
PDDSurfaceDesc2 = ^TDDSurfaceDesc2;
TDDSurfaceDesc2 = record
dwSize: DWORD; // size of the TDDSurfaceDesc2 structure
dwFlags: DWORD; // determines what fields are valid
dwHeight: DWORD; // height of surface to be created
dwWidth: DWORD; // width of input surface
case Integer of
0: (
lPitch: Longint;
dwBackBufferCount: DWORD; // number of back buffers requested
case Integer of
0: (
dwMipMapCount: DWORD; // number of mip-map levels requested
dwAlphaBitDepth: DWORD; // depth of alpha buffer requested
dwReserved: DWORD; // reserved
lpSurface: Pointer; // pointer to the associated surface memory
ddckCKDestOverlay: TDDColorKey;// color key for destination overlay use
ddckCKDestBlt: TDDColorKey; // color key for destination blt use
ddckCKSrcOverlay: TDDColorKey; // color key for source overlay use
ddckCKSrcBlt: TDDColorKey; // color key for source blt use
ddpfPixelFormat: TDDPixelFormat;// pixel format description of the surface
ddsCaps: TDDSCaps2; // direct draw surface capabilities
dwTextureStage: DWORD; // stage in multitexture cascade
);
1: (
dwRefreshRate: DWORD; // refresh rate (used when display mode is described)
);
);
1: (
dwLinearSize: DWORD
);
end;
 
DDSURFACEDESC2 = TDDSurfaceDesc2;
LPDDSURFACEDESC2 = PDDSurfaceDesc2;
 
{ TDDOptSurfaceDesc structure }
 
PDDOptSurfaceDesc = ^TDDOptSurfaceDesc;
TDDOptSurfaceDesc = record
dwSize: DWORD; // size of the DDOPTSURFACEDESC structure
dwFlags: DWORD; // determines what fields are valid
ddSCaps: TDDSCaps2; // Common caps like: Memory type
ddOSCaps: TDDOSCaps; // Common caps like: Memory type
guid: TGUID; // Compression technique GUID
dwCompressionRatio: DWORD; // Compression ratio
end;
 
DDOPTSURFACEDESC = TDDOptSurfaceDesc;
LPDDOPTSURFACEDESC = PDDOptSurfaceDesc;
 
{ TDDColorControl structure }
 
PDDColorControl = ^TDDColorControl;
TDDColorControl = record
dwSize: DWORD;
dwFlags: DWORD;
lBrightness: Longint;
lContrast: Longint;
lHue: Longint;
lSaturation: Longint;
lSharpness: Longint;
lGamma: Longint;
lColorEnable: Longint;
dwReserved1: DWORD;
end;
 
DDCOLORCONTROL = TDDColorControl;
LPDDCOLORCONTROL = PDDCOLORCONTROL;
 
{ TDDGammaRamp structure }
 
PDDGammaRamp = ^TDDGammaRamp;
TDDGammaRamp = packed record
red : array[0..255] of WORD;
green : array[0..255] of WORD;
blue : array[0..255] of WORD;
TDDGammaRamp = record
Red: array[0..255] of Word;
Green: array[0..255] of Word;
Blue: array[0..255] of Word;
end;
 
(*
* This is the structure within which DirectDraw returns data about the current graphics driver and chipset
*)
DDGAMMARAMP = TDDGammaRamp;
LPDDGAMMARAMP = PDDGammaRamp;
 
{ TDDDeviceIdentifier structure }
 
PDDDeviceIdentifier = ^TDDDeviceIdentifier;
TDDDeviceIdentifier = packed record
TDDDeviceIdentifier = record
//
// These elements are for presentation to the user only. They should not be used to identify particular
// drivers, since this is unreliable and many different strings may be associated with the same
702,8 → 876,13
guidDeviceIdentifier: TGUID;
end;
 
DDDEVICEIDENTIFIER = TDDDeviceIdentifier;
LPDDDEVICEIDENTIFIER = PDDDeviceIdentifier;
 
{ TDDDeviceIdentifier2 structure }
 
PDDDeviceIdentifier2 = ^TDDDeviceIdentifier2;
TDDDeviceIdentifier2 = packed record
TDDDeviceIdentifier2 = record
//
// These elements are for presentation to the user only. They should not be used to identify particular
// drivers, since this is unreliable and many different strings may be associated with the same
745,432 → 924,247
//
guidDeviceIdentifier: TGUID;
 
(*
* This element is used to determine the Windows Hardware Quality Lab (WHQL)
* certification level for this driver/device pair.
*)
//
// This element is used to determine the Windows Hardware Quality Lab (WHQL)
// certification level for this driver/device pair.
//
dwWHQLLevel: DWORD;
end;
 
(*
* callbacks
*)
DDDEVICEIDENTIFIER2 = TDDDeviceIdentifier2;
LPDDDEVICEIDENTIFIER2 = PDDDeviceIdentifier2;
 
{ Callbacks }
 
TClipperCallback = function(lpDDClipper: IDirectDrawClipper; hWnd: HWND;
Code: DWORD; lpContext: Pointer): HResult; stdcall;
LPCLIPPERCALLBACK = TClipperCallback;
 
TSurfacesStreamingCallback = function(Arg: DWORD): HResult; stdcall;
LPSURFACESTREAMINGCALLBACK =TSurfacesStreamingCallback;
 
(*
* TDDSurfaceDesc
*)
PDDSurfaceDesc_DX5 = ^TDDSurfaceDesc_DX5;
TDDSurfaceDesc_DX5 = packed record
dwSize: DWORD; // size of the TDDSurfaceDesc structure
dwFlags: DWORD; // determines what fields are valid
dwHeight: DWORD; // height of surface to be created
dwWidth: DWORD; // width of input surface
case Integer of
0: (
dwLinearSize : DWORD; // unused at the moment
);
1: (
lPitch: LongInt; // distance to start of next line (return value only)
dwBackBufferCount: DWORD; // number of back buffers requested
case Integer of
0: (
dwMipMapCount: DWORD; // number of mip-map levels requested
dwAlphaBitDepth: DWORD; // depth of alpha buffer requested
dwReserved: DWORD; // reserved
lpSurface: Pointer; // pointer to the associated surface memory
ddckCKDestOverlay: TDDColorKey; // color key for destination overlay use
ddckCKDestBlt: TDDColorKey; // color key for destination blt use
ddckCKSrcOverlay: TDDColorKey; // color key for source overlay use
ddckCKSrcBlt: TDDColorKey; // color key for source blt use
ddpfPixelFormat: TDDPixelFormat_DX5; // pixel format description of the surface
ddsCaps: TDDSCaps; // direct draw surface capabilities
);
1: (
dwZBufferBitDepth: DWORD; // depth of Z buffer requested
);
2: (
dwRefreshRate: DWORD; // refresh rate (used when display mode is described)
);
);
end;
 
PDDSurfaceDesc_DX6 = ^TDDSurfaceDesc_DX6;
TDDSurfaceDesc_DX6 = packed record
dwSize: DWORD; // size of the TDDSurfaceDesc structure
dwFlags: DWORD; // determines what fields are valid
dwHeight: DWORD; // height of surface to be created
dwWidth: DWORD; // width of input surface
case Integer of
0: (
dwLinearSize : DWORD; // unused at the moment
);
1: (
lPitch: LongInt; // distance to start of next line (return value only)
dwBackBufferCount: DWORD; // number of back buffers requested
case Integer of
0: (
dwMipMapCount: DWORD; // number of mip-map levels requested
dwAlphaBitDepth: DWORD; // depth of alpha buffer requested
dwReserved: DWORD; // reserved
lpSurface: Pointer; // pointer to the associated surface memory
ddckCKDestOverlay: TDDColorKey; // color key for destination overlay use
ddckCKDestBlt: TDDColorKey; // color key for destination blt use
ddckCKSrcOverlay: TDDColorKey; // color key for source overlay use
ddckCKSrcBlt: TDDColorKey; // color key for source blt use
ddpfPixelFormat: TDDPixelFormat_DX6; // pixel format description of the surface
ddsCaps: TDDSCaps; // direct draw surface capabilities
);
1: (
dwZBufferBitDepth: DWORD; // depth of Z buffer requested
);
2: (
dwRefreshRate: DWORD; // refresh rate (used when display mode is described)
);
);
end;
 
PDDSurfaceDesc = ^TDDSurfaceDesc;
{$IFDEF DIRECTX5}
TDDSurfaceDesc = TDDSurfaceDesc_DX5;
{$ELSE}
TDDSurfaceDesc = TDDSurfaceDesc_DX6;
{$ENDIF}
 
 
(*
* TDDSurfaceDesc2
*)
PDDSurfaceDesc2 = ^TDDSurfaceDesc2;
TDDSurfaceDesc2 = packed record
dwSize: DWORD; // size of the TDDSurfaceDesc structure
dwFlags: DWORD; // determines what fields are valid
dwHeight: DWORD; // height of surface to be created
dwWidth: DWORD; // width of input surface
case Integer of
0: (
lPitch : LongInt; // distance to start of next line (return value only)
);
1: (
dwLinearSize : DWORD; // Formless late-allocated optimized surface size
dwBackBufferCount: DWORD; // number of back buffers requested
case Integer of
0: (
dwMipMapCount: DWORD; // number of mip-map levels requested
dwAlphaBitDepth: DWORD; // depth of alpha buffer requested
dwReserved: DWORD; // reserved
lpSurface: Pointer; // pointer to the associated surface memory
ddckCKDestOverlay: TDDColorKey; // color key for destination overlay use
ddckCKDestBlt: TDDColorKey; // color key for destination blt use
ddckCKSrcOverlay: TDDColorKey; // color key for source overlay use
ddckCKSrcBlt: TDDColorKey; // color key for source blt use
ddpfPixelFormat: TDDPixelFormat; // pixel format description of the surface
ddsCaps: TDDSCaps2; // direct draw surface capabilities
dwTextureStage: DWORD; // stage in multitexture cascade
);
1: (
dwRefreshRate: DWORD; // refresh rate (used when display mode is described)
);
);
end;
 
(*
* TDDOptSurfaceDesc
*)
 
PDDOptSurfaceDesc = ^TDDOptSurfaceDesc;
TDDOptSurfaceDesc = packed record
dwSize : DWORD; // size of the DDOPTSURFACEDESC structure
dwFlags : DWORD; // determines what fields are valid
ddSCaps : TDDSCaps2; // Common caps like: Memory type
ddOSCaps : TDDOSCaps; // Common caps like: Memory type
guid : TGUID; // Compression technique GUID
dwCompressionRatio : DWORD; // Compression ratio
end;
 
(*
* DDCOLORCONTROL
*)
PDDColorControl = ^TDDColorControl;
TDDColorControl = packed record
dwSize: DWORD;
dwFlags: DWORD;
lBrightness: LongInt;
lContrast: LongInt;
lHue: LongInt;
lSaturation: LongInt;
lSharpness: LongInt;
lGamma: LongInt;
lColorEnable: LongInt;
dwReserved1: DWORD;
end;
 
(*
* callbacks
*)
 
{$IFNDEF WINNT}
TDDEnumModesCallback = function (const lpDDSurfaceDesc: TDDSurfaceDesc;
lpContext: Pointer) : HResult; stdcall;
LPDDENUMMODESCALLBACK = TDDEnumModesCallback;
 
TDDEnumModesCallback2 = function (const lpDDSurfaceDesc: TDDSurfaceDesc2;
lpContext: Pointer) : HResult; stdcall;
LPDDENUMMODESCALLBACK2 = TDDEnumModesCallback2;
 
TDDEnumSurfacesCallback = function (lpDDSurface: IDirectDrawSurface;
const lpDDSurfaceDesc: TDDSurfaceDesc; lpContext: Pointer) : HResult; stdcall;
LPDDENUMSURFACESCALLBACK = TDDEnumSurfacesCallback;
 
TDDEnumSurfacesCallback2 = function (lpDDSurface: IDirectDrawSurface4;
const lpDDSurfaceDesc: TDDSurfaceDesc2; lpContext: Pointer) : HResult; stdcall;
LPDDENUMSURFACESCALLBACK2 = TDDEnumSurfacesCallback2;
 
TDDEnumSurfacesCallback7 = function (lpDDSurface: IDirectDrawSurface7;
const lpDDSurfaceDesc: TDDSurfaceDesc2; lpContext: Pointer) : HResult; stdcall;
{$ENDIF}
LPDDENUMSURFACESCALLBACK7 = TDDEnumSurfacesCallback7;
 
(*
* INTERACES FOLLOW:
* IDirectDraw
* IDirectDrawClipper
* IDirectDrawPalette
* IDirectDrawSurface
*)
{ IDirectDraw Interface }
 
(*
* IDirectDraw
*)
 
IDirectDraw = interface (IUnknown)
['{6C14DB80-A733-11CE-A521-0020AF0BE560}']
(*** IDirectDraw methods ***)
// IDirectDraw methods
function Compact: HResult; stdcall;
function CreateClipper (dwFlags: DWORD;
out lplpDDClipper: IDirectDrawClipper;
function CreateClipper(dwFlags: DWORD; out lplpDDClipper: IDirectDrawClipper;
pUnkOuter: IUnknown) : HResult; stdcall;
function CreatePalette (dwFlags: DWORD; lpColorTable: pointer;
out lplpDDPalette: IDirectDrawPalette;
pUnkOuter: IUnknown) : HResult; stdcall;
function CreateSurface (var lpDDSurfaceDesc: TDDSurfaceDesc;
out lplpDDSurface: IDirectDrawSurface;
pUnkOuter: IUnknown) : HResult; stdcall;
function CreatePalette(dwFlags: DWORD; lpColorTable: PPaletteEntry;
out lplpDDPalette: IDirectDrawPalette; pUnkOuter: IUnknown): HResult; stdcall;
function CreateSurface(const lpDDSurfaceDesc: TDDSurfaceDesc;
out lplpDDSurface: IDirectDrawSurface; pUnkOuter: IUnknown): HResult; stdcall;
function DuplicateSurface (lpDDSurface: IDirectDrawSurface;
out lplpDupDDSurface: IDirectDrawSurface) : HResult; stdcall;
function EnumDisplayModes (dwFlags: DWORD;
lpDDSurfaceDesc: PDDSurfaceDesc; lpContext: Pointer;
const lpDDSurfaceDesc: TDDSurfaceDesc; lpContext: Pointer;
lpEnumModesCallback: TDDEnumModesCallback) : HResult; stdcall;
function EnumSurfaces (dwFlags: DWORD; const lpDDSD: TDDSurfaceDesc;
lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback) :
HResult; stdcall;
lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback): HResult; stdcall;
function FlipToGDISurface: HResult; stdcall;
function GetCaps (lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps) : HResult; stdcall;
function GetDisplayMode (out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
function GetFourCCCodes (var lpNumCodes: DWORD; lpCodes: PDWORD) : HResult; stdcall;
function GetGDISurface (out lplpGDIDDSSurface: IDirectDrawSurface) :
HResult; stdcall;
function GetMonitorFrequency (out lpdwFrequency: DWORD) : HResult; stdcall;
function GetScanLine (out lpdwScanLine: DWORD) : HResult; stdcall;
function GetVerticalBlankStatus (out lpbIsInVB: BOOL) : HResult; stdcall;
function GetCaps(var lpDDDriverCaps: TDDCaps; var lpDDHELCaps: TDDCaps): HResult; stdcall;
function GetDisplayMode(var lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
function GetFourCCCodes(var lpNumCodes, lpCodes: DWORD): HResult; stdcall;
function GetGDISurface(out lplpGDIDDSSurface: IDirectDrawSurface): HResult; stdcall;
function GetMonitorFrequency(var lpdwFrequency: DWORD): HResult; stdcall;
function GetScanLine(var lpdwScanLine: DWORD): HResult; stdcall;
function GetVerticalBlankStatus(var lpbIsInVB: BOOL): HResult; stdcall;
function Initialize (lpGUID: PGUID) : HResult; stdcall;
function RestoreDisplayMode: HResult; stdcall;
function SetCooperativeLevel (hWnd: HWND; dwFlags: DWORD) : HResult; stdcall;
(*** Warning! SetDisplayMode differs between DirectDraw 1 and DirectDraw 2 ***)
function SetDisplayMode (dwWidth: DWORD; dwHeight: DWORD;
dwBpp: DWORD) : HResult; stdcall;
function WaitForVerticalBlank (dwFlags: DWORD; hEvent: THandle) :
HResult; stdcall;
function SetDisplayMode(dwWidth, dwHeight, dwBpp: DWORD): HResult; stdcall;
function WaitForVerticalBlank(dwFlags: DWORD; hEvent: THandle): HResult; stdcall;
end;
 
{ IDirectDraw2 Interface }
 
IDirectDraw2 = interface (IUnknown)
['{B3A6F3E0-2B43-11CF-A2DE-00AA00B93356}']
(*** IDirectDraw methods ***)
// IDirectDraw methods
function Compact: HResult; stdcall;
function CreateClipper (dwFlags: DWORD;
out lplpDDClipper: IDirectDrawClipper;
function CreateClipper(dwFlags: DWORD; out lplpDDClipper: IDirectDrawClipper;
pUnkOuter: IUnknown) : HResult; stdcall;
function CreatePalette (dwFlags: DWORD; lpColorTable: pointer;
out lplpDDPalette: IDirectDrawPalette;
pUnkOuter: IUnknown) : HResult; stdcall;
function CreateSurface (var lpDDSurfaceDesc: TDDSurfaceDesc;
out lplpDDSurface: IDirectDrawSurface;
pUnkOuter: IUnknown) : HResult; stdcall;
function CreatePalette(dwFlags: DWORD; lpColorTable: PPaletteEntry;
out lplpDDPalette: IDirectDrawPalette; pUnkOuter: IUnknown): HResult; stdcall;
function CreateSurface(const lpDDSurfaceDesc: TDDSurfaceDesc;
out lplpDDSurface: IDirectDrawSurface; pUnkOuter: IUnknown): HResult; stdcall;
function DuplicateSurface (lpDDSurface: IDirectDrawSurface;
out lplpDupDDSurface: IDirectDrawSurface) : HResult; stdcall;
function EnumDisplayModes (dwFlags: DWORD;
lpDDSurfaceDesc: PDDSurfaceDesc; lpContext: Pointer;
const lpDDSurfaceDesc: TDDSurfaceDesc; lpContext: Pointer;
lpEnumModesCallback: TDDEnumModesCallback) : HResult; stdcall;
function EnumSurfaces (dwFlags: DWORD; var lpDDSD: TDDSurfaceDesc;
lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback) :
HResult; stdcall;
function EnumSurfaces(dwFlags: DWORD; const lpDDSD: TDDSurfaceDesc;
lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback): HResult; stdcall;
function FlipToGDISurface: HResult; stdcall;
function GetCaps (lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps) : HResult; stdcall;
function GetDisplayMode (out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
function GetFourCCCodes (var lpNumCodes: DWORD; lpCodes: PDWORD) : HResult; stdcall;
function GetCaps(var lpDDDriverCaps: TDDCaps; var lpDDHELCaps: TDDCaps): HResult; stdcall;
function GetDisplayMode(var lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
function GetFourCCCodes(var lpNumCodes, lpCodes: DWORD): HResult; stdcall;
function GetGDISurface (out lplpGDIDDSSurface: IDirectDrawSurface) : HResult; stdcall;
function GetMonitorFrequency (out lpdwFrequency: DWORD) : HResult; stdcall;
function GetScanLine (out lpdwScanLine: DWORD) : HResult; stdcall;
function GetVerticalBlankStatus (out lpbIsInVB: BOOL) : HResult; stdcall;
function GetMonitorFrequency(var lpdwFrequency: DWORD): HResult; stdcall;
function GetScanLine(var lpdwScanLine: DWORD): HResult; stdcall;
function GetVerticalBlankStatus(var lpbIsInVB: BOOL): HResult; stdcall;
function Initialize (lpGUID: PGUID) : HResult; stdcall;
function RestoreDisplayMode: HResult; stdcall;
function SetCooperativeLevel (hWnd: HWND; dwFlags: DWORD) : HResult; stdcall;
(*** Warning! SetDisplayMode differs between DirectDraw 1 and DirectDraw 2 ***)
function SetDisplayMode (dwWidth: DWORD; dwHeight: DWORD; dwBPP: DWORD;
dwRefreshRate: DWORD; dwFlags: DWORD) : HResult; stdcall;
function WaitForVerticalBlank (dwFlags: DWORD; hEvent: THandle) :
HResult; stdcall;
(*** Added in the v2 interface ***)
function SetDisplayMode(dwWidth, dwHeight, dwBPP, dwRefreshRate: DWORD;
dwFlags: DWORD): HResult; stdcall;
function WaitForVerticalBlank(dwFlags: DWORD; hEvent: THandle): HResult; stdcall;
// IDirectDraw2 methods
function GetAvailableVidMem (var lpDDSCaps: TDDSCaps;
out lpdwTotal, lpdwFree: DWORD) : HResult; stdcall;
var lpdwTotal, lpdwFree: DWORD): HResult; stdcall;
end;
 
{ IDirectDraw4 Interface }
 
IDirectDraw4 = interface (IUnknown)
['{9c59509a-39bd-11d1-8c4a-00c04fd930c5}']
(*** IDirectDraw methods ***)
['{9C59509A-39BD-11D1-8C4A-00C04FD930C5}']
// IDirectDraw methods
function Compact: HResult; stdcall;
function CreateClipper (dwFlags: DWORD;
out lplpDDClipper: IDirectDrawClipper;
function CreateClipper(dwFlags: DWORD; out lplpDDClipper: IDirectDrawClipper;
pUnkOuter: IUnknown) : HResult; stdcall;
function CreatePalette (dwFlags: DWORD; lpColorTable: pointer;
out lplpDDPalette: IDirectDrawPalette;
pUnkOuter: IUnknown) : HResult; stdcall;
function CreatePalette(dwFlags: DWORD; lpColorTable: PPaletteEntry;
out lplpDDPalette: IDirectDrawPalette; pUnkOuter: IUnknown): HResult; stdcall;
function CreateSurface (const lpDDSurfaceDesc: TDDSurfaceDesc2;
out lplpDDSurface: IDirectDrawSurface4;
pUnkOuter: IUnknown) : HResult; stdcall;
out lplpDDSurface: IDirectDrawSurface4; pUnkOuter: IUnknown): HResult; stdcall;
function DuplicateSurface (lpDDSurface: IDirectDrawSurface4;
out lplpDupDDSurface: IDirectDrawSurface4) : HResult; stdcall;
function EnumDisplayModes (dwFlags: DWORD;
lpDDSurfaceDesc: PDDSurfaceDesc2; lpContext: Pointer;
const lpDDSurfaceDesc: TDDSurfaceDesc2; lpContext: Pointer;
lpEnumModesCallback: TDDEnumModesCallback2) : HResult; stdcall;
function EnumSurfaces (dwFlags: DWORD; const lpDDSD: TDDSurfaceDesc2;
lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback2) :
HResult; stdcall;
lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback2): HResult; stdcall;
function FlipToGDISurface: HResult; stdcall;
function GetCaps (lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps) : HResult; stdcall;
function GetDisplayMode (out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
function GetFourCCCodes (var lpNumCodes: DWORD; lpCodes: PDWORD) : HResult; stdcall;
function GetGDISurface (out lplpGDIDDSSurface: IDirectDrawSurface4) :
HResult; stdcall;
function GetMonitorFrequency (out lpdwFrequency: DWORD) : HResult; stdcall;
function GetScanLine (out lpdwScanLine: DWORD) : HResult; stdcall;
function GetVerticalBlankStatus (out lpbIsInVB: BOOL) : HResult; stdcall;
function GetCaps(var lpDDDriverCaps: TDDCaps; var lpDDHELCaps: TDDCaps): HResult; stdcall;
function GetDisplayMode(var lpDDSurfaceDesc: TDDSurfaceDesc2): HResult; stdcall;
function GetFourCCCodes(var lpNumCodes, lpCodes: DWORD): HResult; stdcall;
function GetGDISurface(out lplpGDIDDSSurface: IDirectDrawSurface2): HResult; stdcall;
function GetMonitorFrequency(var lpdwFrequency: DWORD): HResult; stdcall;
function GetScanLine(var lpdwScanLine: DWORD): HResult; stdcall;
function GetVerticalBlankStatus(var lpbIsInVB: BOOL): HResult; stdcall;
function Initialize (lpGUID: PGUID) : HResult; stdcall;
function RestoreDisplayMode: HResult; stdcall;
function SetCooperativeLevel (hWnd: HWND; dwFlags: DWORD) : HResult; stdcall;
(*** Warning! SetDisplayMode differs between DirectDraw 1 and DirectDraw 2 ***)
function SetDisplayMode (dwWidth: DWORD; dwHeight: DWORD; dwBPP: DWORD;
dwRefreshRate: DWORD; dwFlags: DWORD) : HResult; stdcall;
function WaitForVerticalBlank (dwFlags: DWORD; hEvent: THandle) :
HResult; stdcall;
(*** Added in the v2 interface ***)
function GetAvailableVidMem (const lpDDSCaps: TDDSCaps2;
out lpdwTotal, lpdwFree: DWORD) : HResult; stdcall;
(*** Added in the V4 Interface ***)
function GetSurfaceFromDC (hdc : Windows.HDC;
out lpDDS4: IDirectDrawSurface4) : HResult; stdcall;
function SetDisplayMode(dwWidth, dwHeight, dwBPP, dwRefreshRate: DWORD;
dwFlags: DWORD): HResult; stdcall;
function WaitForVerticalBlank(dwFlags: DWORD; hEvent: THandle): HResult; stdcall;
// IDirectDraw2 methods
function GetAvailableVidMem(var lpDDSCaps: TDDSCaps;
var lpdwTotal, lpdwFree: DWORD): HResult; stdcall;
// IDirectDraw4 methods
function GetSurfaceFromDC(hdc: HDC; lpDDS: IDirectDrawSurface4): HResult; stdcall;
function RestoreAllSurfaces : HResult; stdcall;
function TestCooperativeLevel : HResult; stdcall;
function GetDeviceIdentifier (out lpdddi: TDDDeviceIdentifier;
dwFlags: DWORD) : HResult; stdcall;
function GetDeviceIdentifier(var lpdddi: TDDDeviceIdentifier; dwFlags: DWORD): HResult; stdcall;
end;
 
{ IDirectDraw7 Interface }
 
IDirectDraw7 = interface (IUnknown)
['{15e65ec0-3b9c-11d2-b92f-00609797ea5b}']
(*** IDirectDraw methods ***)
['{15E65EC0-3B9C-11D2-B92F-00609797EA5B}']
// IDirectDraw methods
function Compact: HResult; stdcall;
function CreateClipper (dwFlags: DWORD;
out lplpDDClipper: IDirectDrawClipper;
function CreateClipper(dwFlags: DWORD; out lplpDDClipper: IDirectDrawClipper;
pUnkOuter: IUnknown) : HResult; stdcall;
function CreatePalette (dwFlags: DWORD; lpColorTable: pointer;
out lplpDDPalette: IDirectDrawPalette;
pUnkOuter: IUnknown) : HResult; stdcall;
function CreatePalette(dwFlags: DWORD; lpColorTable: PPaletteEntry;
out lplpDDPalette: IDirectDrawPalette; pUnkOuter: IUnknown): HResult; stdcall;
function CreateSurface (const lpDDSurfaceDesc: TDDSurfaceDesc2;
out lplpDDSurface: IDirectDrawSurface7;
pUnkOuter: IUnknown) : HResult; stdcall;
out lplpDDSurface: IDirectDrawSurface7; pUnkOuter: IUnknown): HResult; stdcall;
function DuplicateSurface (lpDDSurface: IDirectDrawSurface7;
out lplpDupDDSurface: IDirectDrawSurface7) : HResult; stdcall;
function EnumDisplayModes (dwFlags: DWORD;
lpDDSurfaceDesc: PDDSurfaceDesc2; lpContext: Pointer;
const lpDDSurfaceDesc: TDDSurfaceDesc2; lpContext: Pointer;
lpEnumModesCallback: TDDEnumModesCallback2) : HResult; stdcall;
function EnumSurfaces (dwFlags: DWORD; const lpDDSD: TDDSurfaceDesc2;
lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback7) :
HResult; stdcall;
lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback7): HResult; stdcall;
function FlipToGDISurface: HResult; stdcall;
function GetCaps (lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps) : HResult; stdcall;
function GetDisplayMode (out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
function GetFourCCCodes (var lpNumCodes: DWORD; lpCodes: PDWORD) : HResult; stdcall;
function GetGDISurface (out lplpGDIDDSSurface: IDirectDrawSurface7) :
HResult; stdcall;
function GetMonitorFrequency (out lpdwFrequency: DWORD) : HResult; stdcall;
function GetScanLine (out lpdwScanLine: DWORD) : HResult; stdcall;
function GetVerticalBlankStatus (out lpbIsInVB: BOOL) : HResult; stdcall;
function GetCaps(var lpDDDriverCaps: TDDCaps; var lpDDHELCaps: TDDCaps): HResult; stdcall;
function GetDisplayMode(var lpDDSurfaceDesc: TDDSurfaceDesc2): HResult; stdcall;
function GetFourCCCodes(var lpNumCodes, lpCodes: DWORD): HResult; stdcall;
function GetGDISurface(out lplpGDIDDSSurface: IDirectDrawSurface7): HResult; stdcall;
function GetMonitorFrequency(var lpdwFrequency: DWORD): HResult; stdcall;
function GetScanLine(var lpdwScanLine: DWORD): HResult; stdcall;
function GetVerticalBlankStatus(var lpbIsInVB: BOOL): HResult; stdcall;
function Initialize (lpGUID: PGUID) : HResult; stdcall;
function RestoreDisplayMode: HResult; stdcall;
function SetCooperativeLevel (hWnd: HWND; dwFlags: DWORD) : HResult; stdcall;
function SetDisplayMode (dwWidth: DWORD; dwHeight: DWORD; dwBPP: DWORD;
dwRefreshRate: DWORD; dwFlags: DWORD) : HResult; stdcall;
function WaitForVerticalBlank (dwFlags: DWORD; hEvent: THandle) :
HResult; stdcall;
(*** Added in the v2 interface ***)
function GetAvailableVidMem (const lpDDSCaps: TDDSCaps2;
out lpdwTotal, lpdwFree: DWORD) : HResult; stdcall;
(*** Added in the V4 Interface ***)
function GetSurfaceFromDC (hdc : Windows.HDC;
out lpDDS: IDirectDrawSurface7) : HResult; stdcall;
function SetDisplayMode(dwWidth, dwHeight, dwBPP, dwRefreshRate: DWORD;
dwFlags: DWORD): HResult; stdcall;
function WaitForVerticalBlank(dwFlags: DWORD; hEvent: THandle): HResult; stdcall;
// IDirectDraw2 methods
function GetAvailableVidMem(var lpDDSCaps: TDDSCaps;
var lpdwTotal, lpdwFree: DWORD): HResult; stdcall;
// IDirectDraw4 methods
function GetSurfaceFromDC(hdc: HDC; lpDDS: IDirectDrawSurface4): HResult; stdcall;
function RestoreAllSurfaces : HResult; stdcall;
function TestCooperativeLevel : HResult; stdcall;
function GetDeviceIdentifier (out lpdddi: TDDDeviceIdentifier2;
dwFlags: DWORD) : HResult; stdcall;
function StartModeTest(const lpModesToTest; dwNumEntries, dwFlags: DWORD) : HResult; stdcall;
function EvaluateMode(dwFlags: DWORD; out pSecondsUntilTimeout: DWORD) : HResult; stdcall;
function GetDeviceIdentifier(var lpdddi: TDDDeviceIdentifier; dwFlags: DWORD): HResult; stdcall;
// IDirectDraw7 methods
function StartModeTest(var lpModesToTest: TSize; dwNumEntries: DWORD; dwFlags: DWORD): HResult; stdcall;
function EvaluateMode(dwFlags: DWORD; var pSecondsUntilTimeout: DWORD): HResult; stdcall;
end;
 
{ IDirectDrawPalette Interface }
 
 
(*
* IDirectDrawPalette
*)
 
IDirectDrawPalette = interface (IUnknown)
['{6C14DB84-A733-11CE-A521-0020AF0BE560}']
(*** IDirectDrawPalette methods ***)
function GetCaps (out lpdwCaps: DWORD) : HResult; stdcall;
// IDirectDrawPalette methods
function GetCaps(varlpdwCaps: DWORD): HResult; stdcall;
function GetEntries (dwFlags: DWORD; dwBase: DWORD; dwNumEntries: DWORD;
lpEntries: pointer) : HResult; stdcall;
lpEntries: PPaletteEntry): HResult; stdcall;
function Initialize (lpDD: IDirectDraw; dwFlags: DWORD;
lpDDColorTable: pointer) : HResult; stdcall;
lpDDColorTable: PPaletteEntry): HResult; stdcall;
function SetEntries (dwFlags: DWORD; dwStartingEntry: DWORD;
dwCount: DWORD; lpEntries: pointer) : HResult; stdcall;
dwCount: DWORD; lpEntries: PPaletteEntry): HResult; stdcall;
end;
 
(*
* IDirectDrawClipper
*)
{ IDirectDrawClipper Interface }
 
IDirectDrawClipper = interface (IUnknown)
['{6C14DB85-A733-11CE-A521-0020AF0BE560}']
(*** IDirectDrawClipper methods ***)
function GetClipList (lpRect: PRect; lpClipList: PRgnData;
// IDirectDrawClipper methods
function GetClipList(const lpRect: TRect; lpClipList: PRgnData;
var lpdwSize: DWORD) : HResult; stdcall;
function GetHWnd (out lphWnd: HWND) : HResult; stdcall;
function GetHWnd(var lphWnd: HWND): HResult; stdcall;
function Initialize (lpDD: IDirectDraw; dwFlags: DWORD) : HResult; stdcall;
function IsClipListChanged (out lpbChanged: BOOL) : HResult; stdcall;
function IsClipListChanged(var lpbChanged: BOOL): HResult; stdcall;
function SetClipList (lpClipList: PRgnData; dwFlags: DWORD) : HResult; stdcall;
function SetHWnd (dwFlags: DWORD; hWnd: HWND) : HResult; stdcall;
end;
 
(*
* IDirectDrawSurface and related interfaces
*)
{ IDirectDrawSurface Interface }
 
IDirectDrawSurface = interface (IUnknown)
['{6C14DB81-A733-11CE-A521-0020AF0BE560}']
(*** IDirectDrawSurface methods ***)
function AddAttachedSurface (lpDDSAttachedSurface: IDirectDrawSurface) :
HResult; stdcall;
// IDirectDrawSurface methods
function AddAttachedSurface(lpDDSAttachedSurface: IDirectDrawSurface): HResult; stdcall;
function AddOverlayDirtyRect (const lpRect: TRect) : HResult; stdcall;
function Blt (lpDestRect: PRect;
lpDDSrcSurface: IDirectDrawSurface; lpSrcRect: PRect;
dwFlags: DWORD; lpDDBltFx: PDDBltFX) : HResult; stdcall;
function Blt(const lpDestRect: TRect; lpDDSrcSurface: IDirectDrawSurface;
const lpSrcRect: TRect; dwFlags: DWORD; const lpDDBltFx: TDDBltFX): HResult; stdcall;
function BltBatch (const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
dwFlags: DWORD) : HResult; stdcall;
function BltFast (dwX: DWORD; dwY: DWORD;
lpDDSrcSurface: IDirectDrawSurface; lpSrcRect: PRect;
dwTrans: DWORD) : HResult; stdcall;
function BltFast(dwX, dwY: DWORD; lpDDSrcSurface: IDirectDrawSurface;
const lpSrcRect: TRect; dwTrans: DWORD): HResult; stdcall;
function DeleteAttachedSurface (dwFlags: DWORD;
lpDDSAttachedSurface: IDirectDrawSurface) : HResult; stdcall;
function EnumAttachedSurfaces (lpContext: Pointer;
1180,57 → 1174,50
function Flip (lpDDSurfaceTargetOverride: IDirectDrawSurface;
dwFlags: DWORD) : HResult; stdcall;
function GetAttachedSurface (var lpDDSCaps: TDDSCaps;
(*out*)var lplpDDAttachedSurface: IDirectDrawSurface) : HResult; stdcall;
out lplpDDAttachedSurface: IDirectDrawSurface): HResult; stdcall;
function GetBltStatus (dwFlags: DWORD) : HResult; stdcall;
function GetCaps (out lpDDSCaps: TDDSCaps) : HResult; stdcall;
function GetCaps(var lpDDSCaps: TDDSCaps): HResult; stdcall;
function GetClipper (out lplpDDClipper: IDirectDrawClipper) : HResult; stdcall;
function GetColorKey (dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
HResult; stdcall;
function GetDC (out lphDC: HDC) : HResult; stdcall;
function GetColorKey(dwFlags: DWORD; var lpDDColorKey: TDDColorKey): HResult; stdcall;
function GetDC(var lphDC: HDC): HResult; stdcall;
function GetFlipStatus (dwFlags: DWORD) : HResult; stdcall;
function GetOverlayPosition (out lplX, lplY: LongInt) : HResult; stdcall;
function GetOverlayPosition(var lplX, lplY: Longint): HResult; stdcall;
function GetPalette (out lplpDDPalette: IDirectDrawPalette) : HResult; stdcall;
function GetPixelFormat (out lpDDPixelFormat: TDDPixelFormat) : HResult; stdcall;
function GetSurfaceDesc (out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
function GetPixelFormat(var lpDDPixelFormat: TDDPixelFormat): HResult; stdcall;
function GetSurfaceDesc(var lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
function Initialize (lpDD: IDirectDraw;
out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
const lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
function IsLost: HResult; stdcall;
function Lock (lpDestRect: PRect; out lpDDSurfaceDesc:
TDDSurfaceDesc; dwFlags: DWORD; hEvent: THandle) : HResult; stdcall;
function ReleaseDC (hDC: Windows.HDC) : HResult; stdcall;
function _Restore: HResult; stdcall;
function Lock(lpDestRect: PRect; var lpDDSurfaceDesc: TDDSurfaceDesc;
dwFlags: DWORD; hEvent: THandle): HResult; stdcall;
function ReleaseDC(hDC: HDC): HResult; stdcall;
function Restore: HResult; stdcall;
function SetClipper (lpDDClipper: IDirectDrawClipper) : HResult; stdcall;
function SetColorKey (dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
HResult; stdcall;
function SetOverlayPosition (lX, lY: LongInt) : HResult; stdcall;
function SetColorKey(dwFlags: DWORD; const lpDDColorKey: TDDColorKey): HResult; stdcall;
function SetOverlayPosition(lX, lY: Longint): HResult; stdcall;
function SetPalette (lpDDPalette: IDirectDrawPalette) : HResult; stdcall;
function Unlock (lpSurfaceData: Pointer) : HResult; stdcall;
function UpdateOverlay (lpSrcRect: PRect;
lpDDDestSurface: IDirectDrawSurface; lpDestRect: PRect;
dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX) : HResult; stdcall;
function UpdateOverlay(const lpSrcRect: TRect;
lpDDDestSurface: IDirectDrawSurface; const lpDestRect: TRect;
dwFlags: DWORD; const lpDDOverlayFx: TDDOverlayFX): HResult; stdcall;
function UpdateOverlayDisplay (dwFlags: DWORD) : HResult; stdcall;
function UpdateOverlayZOrder (dwFlags: DWORD;
lpDDSReference: IDirectDrawSurface) : HResult; stdcall;
end;
 
(*
* IDirectDrawSurface2 and related interfaces
*)
{ IDirectDrawSurface2 Interface }
 
IDirectDrawSurface2 = interface (IUnknown)
['{57805885-6eec-11cf-9441-a82303c10e27}']
(*** IDirectDrawSurface methods ***)
function AddAttachedSurface (lpDDSAttachedSurface: IDirectDrawSurface2) :
HResult; stdcall;
['{57805885-6EEC-11CF-9441-A82303C10E27}']
// IDirectDrawSurface methods
function AddAttachedSurface(lpDDSAttachedSurface: IDirectDrawSurface2): HResult; stdcall;
function AddOverlayDirtyRect (const lpRect: TRect) : HResult; stdcall;
function Blt (lpDestRect: PRect;
lpDDSrcSurface: IDirectDrawSurface2; lpSrcRect: PRect;
dwFlags: DWORD; lpDDBltFx: PDDBltFX) : HResult; stdcall;
function Blt(const lpDestRect: TRect; lpDDSrcSurface: IDirectDrawSurface2;
const lpSrcRect: TRect; dwFlags: DWORD; const lpDDBltFx: TDDBltFX): HResult; stdcall;
function BltBatch (const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
dwFlags: DWORD) : HResult; stdcall;
function BltFast (dwX: DWORD; dwY: DWORD;
lpDDSrcSurface: IDirectDrawSurface2; lpSrcRect: PRect;
dwTrans: DWORD) : HResult; stdcall;
function BltFast(dwX, dwY: DWORD; lpDDSrcSurface: IDirectDrawSurface2;
const lpSrcRect: TRect; dwTrans: DWORD): HResult; stdcall;
function DeleteAttachedSurface (dwFlags: DWORD;
lpDDSAttachedSurface: IDirectDrawSurface2) : HResult; stdcall;
function EnumAttachedSurfaces (lpContext: Pointer;
1242,56 → 1229,51
function GetAttachedSurface (var lpDDSCaps: TDDSCaps;
out lplpDDAttachedSurface: IDirectDrawSurface2) : HResult; stdcall;
function GetBltStatus (dwFlags: DWORD) : HResult; stdcall;
function GetCaps (out lpDDSCaps: TDDSCaps) : HResult; stdcall;
function GetCaps(var lpDDSCaps: TDDSCaps): HResult; stdcall;
function GetClipper (out lplpDDClipper: IDirectDrawClipper) : HResult; stdcall;
function GetColorKey (dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
HResult; stdcall;
function GetDC (out lphDC: HDC) : HResult; stdcall;
function GetColorKey(dwFlags: DWORD; var lpDDColorKey: TDDColorKey): HResult; stdcall;
function GetDC(var lphDC: HDC): HResult; stdcall;
function GetFlipStatus (dwFlags: DWORD) : HResult; stdcall;
function GetOverlayPosition (out lplX, lplY: LongInt) : HResult; stdcall;
function GetOverlayPosition(var lplX, lplY: Longint): HResult; stdcall;
function GetPalette (out lplpDDPalette: IDirectDrawPalette) : HResult; stdcall;
function GetPixelFormat (out lpDDPixelFormat: TDDPixelFormat) : HResult; stdcall;
function GetSurfaceDesc (out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
function Initialize (lpDD: IDirectDraw;
out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
function GetPixelFormat(var lpDDPixelFormat: TDDPixelFormat): HResult; stdcall;
function GetSurfaceDesc(var lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
function Initialize(lpDD: IDirectDraw; const lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
function IsLost: HResult; stdcall;
function Lock (lpDestRect: PRect;
out lpDDSurfaceDesc: TDDSurfaceDesc; dwFlags: DWORD;
hEvent: THandle) : HResult; stdcall;
function ReleaseDC (hDC: Windows.HDC) : HResult; stdcall;
function _Restore: HResult; stdcall;
function Lock(lpDestRect: PRect; const lpDDSurfaceDesc: TDDSurfaceDesc;
dwFlags: DWORD; hEvent: THandle): HResult; stdcall;
function ReleaseDC(hDC: HDC): HResult; stdcall;
function Restore: HResult; stdcall;
function SetClipper (lpDDClipper: IDirectDrawClipper) : HResult; stdcall;
function SetColorKey (dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
HResult; stdcall;
function SetOverlayPosition (lX, lY: LongInt) : HResult; stdcall;
function SetColorKey(dwFlags: DWORD; const lpDDColorKey: TDDColorKey): HResult; stdcall;
function SetOverlayPosition(lX, lY: Longint): HResult; stdcall;
function SetPalette (lpDDPalette: IDirectDrawPalette) : HResult; stdcall;
function Unlock (lpSurfaceData: Pointer) : HResult; stdcall;
function UpdateOverlay (lpSrcRect: PRect;
lpDDDestSurface: IDirectDrawSurface2; lpDestRect: PRect;
dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX) : HResult; stdcall;
function UpdateOverlay(const lpSrcRect: TRect;
lpDDDestSurface: IDirectDrawSurface2; const lpDestRect: TRect;
dwFlags: DWORD; const lpDDOverlayFx: TDDOverlayFX): HResult; stdcall;
function UpdateOverlayDisplay (dwFlags: DWORD) : HResult; stdcall;
function UpdateOverlayZOrder (dwFlags: DWORD;
lpDDSReference: IDirectDrawSurface2) : HResult; stdcall;
(*** Added in the v2 interface ***)
function GetDDInterface (var lplpDD: IDirectDraw) : HResult; stdcall;
// IDirectDrawSurface2 methods
function GetDDInterface(out lplpDD: IUnknown): HResult; stdcall;
function PageLock (dwFlags: DWORD) : HResult; stdcall;
function PageUnlock (dwFlags: DWORD) : HResult; stdcall;
end;
 
{ IDirectDrawSurface3 Interface }
 
IDirectDrawSurface3 = interface (IUnknown)
['{DA044E00-69B2-11D0-A1D5-00AA00B8DFBB}']
(*** IDirectDrawSurface methods ***)
function AddAttachedSurface (lpDDSAttachedSurface: IDirectDrawSurface3) :
HResult; stdcall;
// IDirectDrawSurface methods
function AddAttachedSurface(lpDDSAttachedSurface: IDirectDrawSurface3): HResult; stdcall;
function AddOverlayDirtyRect (const lpRect: TRect) : HResult; stdcall;
function Blt (lpDestRect: PRect;
lpDDSrcSurface: IDirectDrawSurface3; lpSrcRect: PRect;
dwFlags: DWORD; lpDDBltFx: PDDBltFX) : HResult; stdcall;
function Blt(const lpDestRect: TRect; lpDDSrcSurface: IDirectDrawSurface3;
const lpSrcRect: TRect; dwFlags: DWORD; const lpDDBltFx: TDDBltFX): HResult; stdcall;
function BltBatch (const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
dwFlags: DWORD) : HResult; stdcall;
function BltFast (dwX: DWORD; dwY: DWORD;
lpDDSrcSurface: IDirectDrawSurface3; lpSrcRect: PRect;
dwTrans: DWORD) : HResult; stdcall;
function BltFast(dwX, dwY: DWORD; lpDDSrcSurface: IDirectDrawSurface3;
const lpSrcRect: TRect; dwTrans: DWORD): HResult; stdcall;
function DeleteAttachedSurface (dwFlags: DWORD;
lpDDSAttachedSurface: IDirectDrawSurface3) : HResult; stdcall;
function EnumAttachedSurfaces (lpContext: Pointer;
1303,61 → 1285,53
function GetAttachedSurface (var lpDDSCaps: TDDSCaps;
out lplpDDAttachedSurface: IDirectDrawSurface3) : HResult; stdcall;
function GetBltStatus (dwFlags: DWORD) : HResult; stdcall;
function GetCaps (out lpDDSCaps: TDDSCaps) : HResult; stdcall;
function GetCaps(var lpDDSCaps: TDDSCaps): HResult; stdcall;
function GetClipper (out lplpDDClipper: IDirectDrawClipper) : HResult; stdcall;
function GetColorKey (dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
HResult; stdcall;
function GetDC (out lphDC: HDC) : HResult; stdcall;
function GetColorKey(dwFlags: DWORD; var lpDDColorKey: TDDColorKey): HResult; stdcall;
function GetDC(var lphDC: HDC): HResult; stdcall;
function GetFlipStatus (dwFlags: DWORD) : HResult; stdcall;
function GetOverlayPosition (out lplX, lplY: LongInt) : HResult; stdcall;
function GetOverlayPosition(var lplX, lplY: Longint): HResult; stdcall;
function GetPalette (out lplpDDPalette: IDirectDrawPalette) : HResult; stdcall;
function GetPixelFormat (out lpDDPixelFormat: TDDPixelFormat) : HResult; stdcall;
function GetSurfaceDesc (out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
function Initialize (lpDD: IDirectDraw;
out lpDDSurfaceDesc: TDDSurfaceDesc) : HResult; stdcall;
function GetPixelFormat(var lpDDPixelFormat: TDDPixelFormat): HResult; stdcall;
function GetSurfaceDesc(var lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
function Initialize(lpDD: IDirectDraw; const lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
function IsLost: HResult; stdcall;
function Lock (lpDestRect: PRect;
out lpDDSurfaceDesc: TDDSurfaceDesc; dwFlags: DWORD;
hEvent: THandle) : HResult; stdcall;
function ReleaseDC (hDC: Windows.HDC) : HResult; stdcall;
function _Restore: HResult; stdcall;
function Lock(lpDestRect: PRect; const lpDDSurfaceDesc: TDDSurfaceDesc;
dwFlags: DWORD; hEvent: THandle): HResult; stdcall;
function ReleaseDC(hDC: HDC): HResult; stdcall;
function Restore: HResult; stdcall;
function SetClipper (lpDDClipper: IDirectDrawClipper) : HResult; stdcall;
function SetColorKey (dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
HResult; stdcall;
function SetOverlayPosition (lX, lY: LongInt) : HResult; stdcall;
function SetColorKey(dwFlags: DWORD; const lpDDColorKey: TDDColorKey): HResult; stdcall;
function SetOverlayPosition(lX, lY: Longint): HResult; stdcall;
function SetPalette (lpDDPalette: IDirectDrawPalette) : HResult; stdcall;
function Unlock (lpSurfaceData: Pointer) : HResult; stdcall;
function UpdateOverlay (lpSrcRect: PRect;
lpDDDestSurface: IDirectDrawSurface3; lpDestRect: PRect;
dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX) : HResult; stdcall;
function UpdateOverlay(const lpSrcRect: TRect;
lpDDDestSurface: IDirectDrawSurface3; const lpDestRect: TRect;
dwFlags: DWORD; const lpDDOverlayFx: TDDOverlayFX): HResult; stdcall;
function UpdateOverlayDisplay (dwFlags: DWORD) : HResult; stdcall;
function UpdateOverlayZOrder (dwFlags: DWORD;
lpDDSReference: IDirectDrawSurface3) : HResult; stdcall;
(*** Added in the v2 interface ***)
function GetDDInterface (out lplpDD: IDirectDraw) : HResult; stdcall;
// IDirectDrawSurface2 methods
function GetDDInterface(out lplpDD: IUnknown): HResult; stdcall;
function PageLock (dwFlags: DWORD) : HResult; stdcall;
function PageUnlock (dwFlags: DWORD) : HResult; stdcall;
(*** Added in the V3 interface ***)
// IDirectDrawSurface3 methods
function SetSurfaceDesc(const lpddsd: TDDSurfaceDesc; dwFlags: DWORD) : HResult; stdcall;
end;
 
(*
* IDirectDrawSurface4 and related interfaces
*)
{ IDirectDrawSurface4 Interface }
 
IDirectDrawSurface4 = interface (IUnknown)
['{0B2B8630-AD35-11D0-8EA6-00609797EA5B}']
(*** IDirectDrawSurface methods ***)
function AddAttachedSurface (lpDDSAttachedSurface: IDirectDrawSurface4) :
HResult; stdcall;
// IDirectDrawSurface methods
function AddAttachedSurface(lpDDSAttachedSurface: IDirectDrawSurface4): HResult; stdcall;
function AddOverlayDirtyRect (const lpRect: TRect) : HResult; stdcall;
function Blt (lpDestRect: PRect;
lpDDSrcSurface: IDirectDrawSurface4; lpSrcRect: PRect;
dwFlags: DWORD; lpDDBltFx: PDDBltFX) : HResult; stdcall;
function Blt(const lpDestRect: TRect; lpDDSrcSurface: IDirectDrawSurface4;
const lpSrcRect: TRect; dwFlags: DWORD; const lpDDBltFx: TDDBltFX): HResult; stdcall;
function BltBatch (const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
dwFlags: DWORD) : HResult; stdcall;
function BltFast (dwX: DWORD; dwY: DWORD;
lpDDSrcSurface: IDirectDrawSurface4; lpSrcRect: PRect;
dwTrans: DWORD) : HResult; stdcall;
function BltFast(dwX, dwY: DWORD; lpDDSrcSurface: IDirectDrawSurface4;
const lpSrcRect: TRect; dwTrans: DWORD): HResult; stdcall;
function DeleteAttachedSurface (dwFlags: DWORD;
lpDDSAttachedSurface: IDirectDrawSurface4) : HResult; stdcall;
function EnumAttachedSurfaces (lpContext: Pointer;
1366,69 → 1340,62
lpfnCallback: TDDEnumSurfacesCallback2) : HResult; stdcall;
function Flip (lpDDSurfaceTargetOverride: IDirectDrawSurface4;
dwFlags: DWORD) : HResult; stdcall;
function GetAttachedSurface (const lpDDSCaps: TDDSCaps2;
function GetAttachedSurface(var lpDDSCaps: TDDSCaps2;
out lplpDDAttachedSurface: IDirectDrawSurface4) : HResult; stdcall;
function GetBltStatus (dwFlags: DWORD) : HResult; stdcall;
function GetCaps (out lpDDSCaps: TDDSCaps2) : HResult; stdcall;
function GetCaps(var lpDDSCaps: TDDSCaps2): HResult; stdcall;
function GetClipper (out lplpDDClipper: IDirectDrawClipper) : HResult; stdcall;
function GetColorKey (dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
HResult; stdcall;
function GetDC (out lphDC: HDC) : HResult; stdcall;
function GetColorKey(dwFlags: DWORD; var lpDDColorKey: TDDColorKey): HResult; stdcall;
function GetDC(var lphDC: HDC): HResult; stdcall;
function GetFlipStatus (dwFlags: DWORD) : HResult; stdcall;
function GetOverlayPosition (out lplX, lplY: LongInt) : HResult; stdcall;
function GetOverlayPosition(var lplX, lplY: Longint): HResult; stdcall;
function GetPalette (out lplpDDPalette: IDirectDrawPalette) : HResult; stdcall;
function GetPixelFormat (out lpDDPixelFormat: TDDPixelFormat) : HResult; stdcall;
function GetSurfaceDesc (out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
function Initialize (lpDD: IDirectDraw;
out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
function GetPixelFormat(var lpDDPixelFormat: TDDPixelFormat): HResult; stdcall;
function GetSurfaceDesc(var lpDDSurfaceDesc: TDDSurfaceDesc2): HResult; stdcall;
function Initialize(lpDD: IDirectDraw; const lpDDSurfaceDesc: TDDSurfaceDesc2): HResult; stdcall;
function IsLost: HResult; stdcall;
function Lock (lpDestRect: PRect;
out lpDDSurfaceDesc: TDDSurfaceDesc2; dwFlags: DWORD;
hEvent: THandle) : HResult; stdcall;
function ReleaseDC (hDC: Windows.HDC) : HResult; stdcall;
function _Restore: HResult; stdcall;
function Lock(lpDestRect: PRect; const lpDDSurfaceDesc: TDDSurfaceDesc2;
dwFlags: DWORD; hEvent: THandle): HResult; stdcall;
function ReleaseDC(hDC: HDC): HResult; stdcall;
function Restore: HResult; stdcall;
function SetClipper (lpDDClipper: IDirectDrawClipper) : HResult; stdcall;
function SetColorKey (dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
HResult; stdcall;
function SetOverlayPosition (lX, lY: LongInt) : HResult; stdcall;
function SetColorKey(dwFlags: DWORD; const lpDDColorKey: TDDColorKey): HResult; stdcall;
function SetOverlayPosition(lX, lY: Longint): HResult; stdcall;
function SetPalette (lpDDPalette: IDirectDrawPalette) : HResult; stdcall;
function Unlock (lpRect: PRect) : HResult; stdcall;
function UpdateOverlay (lpSrcRect: PRect;
lpDDDestSurface: IDirectDrawSurface4; lpDestRect: PRect;
dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX) : HResult; stdcall;
function Unlock(lpSurfaceData: Pointer): HResult; stdcall;
function UpdateOverlay(const lpSrcRect: TRect; lpDDDestSurface: IDirectDrawSurface4;
const lpDestRect: TRect; dwFlags: DWORD; const lpDDOverlayFx: TDDOverlayFX): HResult; stdcall;
function UpdateOverlayDisplay (dwFlags: DWORD) : HResult; stdcall;
function UpdateOverlayZOrder (dwFlags: DWORD;
lpDDSReference: IDirectDrawSurface4) : HResult; stdcall;
(*** Added in the v2 interface ***)
function UpdateOverlayZOrder(dwFlags: DWORD; lpDDSReference: IDirectDrawSurface4): HResult; stdcall;
// IDirectDrawSurface2 methods
function GetDDInterface (out lplpDD: IUnknown) : HResult; stdcall;
function PageLock (dwFlags: DWORD) : HResult; stdcall;
function PageUnlock (dwFlags: DWORD) : HResult; stdcall;
(*** Added in the V3 interface ***)
function SetSurfaceDesc(const lpddsd2: TDDSurfaceDesc2; dwFlags: DWORD) : HResult; stdcall;
(*** Added in the v4 interface ***)
function SetPrivateData(const guidTag: TGUID; lpData: pointer;
// IDirectDrawSurface3 methods
function SetSurfaceDesc(const lpddsd: TDDSurfaceDesc2; dwFlags: DWORD): HResult; stdcall;
// IDirectDrawSurface4 methods
function SetPrivateData(const guidTag: TGUID; lpData: Pointer;
cbSize: DWORD; dwFlags: DWORD) : HResult; stdcall;
function GetPrivateData(const guidTag: TGUID; lpBuffer: pointer;
var lpcbBufferSize: DWORD) : HResult; stdcall;
function GetPrivateData(const guidTag: TGUID; lpData: Pointer;
var cbSize: DWORD): HResult; stdcall;
function FreePrivateData(const guidTag: TGUID) : HResult; stdcall;
function GetUniquenessValue(out lpValue: DWORD) : HResult; stdcall;
function GetUniquenessValue(var lpValue: DWORD): HResult; stdcall;
function ChangeUniquenessValue : HResult; stdcall;
end;
 
{ IDirectDrawSurface7 Interface }
 
IDirectDrawSurface7 = interface (IUnknown)
['{06675a80-3b9b-11d2-b92f-00609797ea5b}']
(*** IDirectDrawSurface methods ***)
function AddAttachedSurface (lpDDSAttachedSurface: IDirectDrawSurface7) :
HResult; stdcall;
['{06675A80-3B9B-11D2-B92F-00609797EA5B}']
// IDirectDrawSurface methods
function AddAttachedSurface(lpDDSAttachedSurface: IDirectDrawSurface7): HResult; stdcall;
function AddOverlayDirtyRect (const lpRect: TRect) : HResult; stdcall;
function Blt (lpDestRect: PRect;
lpDDSrcSurface: IDirectDrawSurface7; lpSrcRect: PRect;
dwFlags: DWORD; lpDDBltFx: PDDBltFX) : HResult; stdcall;
function Blt(const lpDestRect: TRect; lpDDSrcSurface: IDirectDrawSurface7;
const lpSrcRect: TRect; dwFlags: DWORD; const lpDDBltFx: TDDBltFX): HResult; stdcall;
function BltBatch (const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
dwFlags: DWORD) : HResult; stdcall;
function BltFast (dwX: DWORD; dwY: DWORD;
lpDDSrcSurface: IDirectDrawSurface7; lpSrcRect: PRect;
dwTrans: DWORD) : HResult; stdcall;
function BltFast(dwX, dwY: DWORD; lpDDSrcSurface: IDirectDrawSurface7;
const lpSrcRect: TRect; dwTrans: DWORD): HResult; stdcall;
function DeleteAttachedSurface (dwFlags: DWORD;
lpDDSAttachedSurface: IDirectDrawSurface7) : HResult; stdcall;
function EnumAttachedSurfaces (lpContext: Pointer;
1437,2038 → 1404,438
lpfnCallback: TDDEnumSurfacesCallback7) : HResult; stdcall;
function Flip (lpDDSurfaceTargetOverride: IDirectDrawSurface7;
dwFlags: DWORD) : HResult; stdcall;
function GetAttachedSurface (const lpDDSCaps: TDDSCaps2;
function GetAttachedSurface(var lpDDSCaps: TDDSCaps2;
out lplpDDAttachedSurface: IDirectDrawSurface7) : HResult; stdcall;
function GetBltStatus (dwFlags: DWORD) : HResult; stdcall;
function GetCaps (out lpDDSCaps: TDDSCaps2) : HResult; stdcall;
function GetCaps(var lpDDSCaps: TDDSCaps2): HResult; stdcall;
function GetClipper (out lplpDDClipper: IDirectDrawClipper) : HResult; stdcall;
function GetColorKey (dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
HResult; stdcall;
function GetDC (out lphDC: HDC) : HResult; stdcall;
function GetColorKey(dwFlags: DWORD; var lpDDColorKey: TDDColorKey): HResult; stdcall;
function GetDC(var lphDC: HDC): HResult; stdcall;
function GetFlipStatus (dwFlags: DWORD) : HResult; stdcall;
function GetOverlayPosition (out lplX, lplY: LongInt) : HResult; stdcall;
function GetOverlayPosition(var lplX, lplY: Longint): HResult; stdcall;
function GetPalette (out lplpDDPalette: IDirectDrawPalette) : HResult; stdcall;
function GetPixelFormat (out lpDDPixelFormat: TDDPixelFormat) : HResult; stdcall;
function GetSurfaceDesc (out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
function Initialize (lpDD: IDirectDraw;
out lpDDSurfaceDesc: TDDSurfaceDesc2) : HResult; stdcall;
function GetPixelFormat(var lpDDPixelFormat: TDDPixelFormat): HResult; stdcall;
function GetSurfaceDesc(var lpDDSurfaceDesc: TDDSurfaceDesc2): HResult; stdcall;
function Initialize(lpDD: IDirectDraw; const lpDDSurfaceDesc: TDDSurfaceDesc2): HResult; stdcall;
function IsLost: HResult; stdcall;
function Lock (lpDestRect: PRect;
out lpDDSurfaceDesc: TDDSurfaceDesc2; dwFlags: DWORD;
hEvent: THandle) : HResult; stdcall;
function ReleaseDC (hDC: Windows.HDC) : HResult; stdcall;
function _Restore: HResult; stdcall;
function Lock(lpDestRect: PRect; const lpDDSurfaceDesc: TDDSurfaceDesc2;
dwFlags: DWORD; hEvent: THandle): HResult; stdcall;
function ReleaseDC(hDC: HDC): HResult; stdcall;
function Restore: HResult; stdcall;
function SetClipper (lpDDClipper: IDirectDrawClipper) : HResult; stdcall;
function SetColorKey (dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
HResult; stdcall;
function SetOverlayPosition (lX, lY: LongInt) : HResult; stdcall;
function SetColorKey(dwFlags: DWORD; const lpDDColorKey: TDDColorKey): HResult; stdcall;
function SetOverlayPosition(lX, lY: Longint): HResult; stdcall;
function SetPalette (lpDDPalette: IDirectDrawPalette) : HResult; stdcall;
function Unlock (lpRect: PRect) : HResult; stdcall;
function UpdateOverlay (lpSrcRect: PRect;
lpDDDestSurface: IDirectDrawSurface7; lpDestRect: PRect;
dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX) : HResult; stdcall;
function Unlock(lpSurfaceData: Pointer): HResult; stdcall;
function UpdateOverlay(const lpSrcRect: TRect; lpDDDestSurface: IDirectDrawSurface7;
const lpDestRect: TRect; dwFlags: DWORD; const lpDDOverlayFx: TDDOverlayFX): HResult; stdcall;
function UpdateOverlayDisplay (dwFlags: DWORD) : HResult; stdcall;
function UpdateOverlayZOrder (dwFlags: DWORD;
lpDDSReference: IDirectDrawSurface7) : HResult; stdcall;
(*** Added in the v2 interface ***)
function UpdateOverlayZOrder(dwFlags: DWORD; lpDDSReference: IDirectDrawSurface7): HResult; stdcall;
// IDirectDrawSurface2 methods
function GetDDInterface (out lplpDD: IUnknown) : HResult; stdcall;
function PageLock (dwFlags: DWORD) : HResult; stdcall;
function PageUnlock (dwFlags: DWORD) : HResult; stdcall;
(*** Added in the V3 interface ***)
function SetSurfaceDesc(const lpddsd2: TDDSurfaceDesc2; dwFlags: DWORD) : HResult; stdcall;
(*** Added in the v4 interface ***)
function SetPrivateData(const guidTag: TGUID; lpData: pointer;
// IDirectDrawSurface3 methods
function SetSurfaceDesc(const lpddsd: TDDSurfaceDesc2; dwFlags: DWORD): HResult; stdcall;
// IDirectDrawSurface4 methods
function SetPrivateData(const guidTag: TGUID; lpData: Pointer;
cbSize: DWORD; dwFlags: DWORD) : HResult; stdcall;
function GetPrivateData(const guidTag: TGUID; lpBuffer: pointer;
var lpcbBufferSize: DWORD) : HResult; stdcall;
function GetPrivateData(const guidTag: TGUID; lpData: Pointer;
var cbSize: DWORD): HResult; stdcall;
function FreePrivateData(const guidTag: TGUID) : HResult; stdcall;
function GetUniquenessValue(out lpValue: DWORD) : HResult; stdcall;
function GetUniquenessValue(var lpValue: DWORD): HResult; stdcall;
function ChangeUniquenessValue : HResult; stdcall;
(*** Moved Texture7 methods here ***)
// Moved Texture7 methods here
function SetPriority(dwPriority: DWORD) : HResult; stdcall;
function GetPriority(out lpdwPriority: DWORD) : HResult; stdcall;
function GetPriority(var lpdwPriority: DWORD): HResult; stdcall;
function SetLOD(dwMaxLOD: DWORD) : HResult; stdcall;
function GetLOD(out lpdwMaxLOD: DWORD) : HResult; stdcall;
function GetLOD(var lpdwMaxLOD: DWORD): HResult; stdcall;
end;
 
{ IDirectDrawColorControl Interface }
 
IDirectDrawColorControl = interface (IUnknown)
['{4B9F0EE0-0D7E-11D0-9B06-00A0C903A3B8}']
function GetColorControls(out lpColorControl: TDDColorControl) : HResult; stdcall;
// IDirectDrawColorControl methods
function GetColorControls(var lpColorControl: TDDColorControl): HResult; stdcall;
function SetColorControls(const lpColorControl: TDDColorControl) : HResult; stdcall;
end;
 
(*
* IDirectDrawGammaControl
*)
{ IDirectDrawGammaControl Interface }
 
IDirectDrawGammaControl = interface (IUnknown)
['{69C11C3E-B46B-11D1-AD7A-00C04FC29B4E}']
function GetGammaRamp (dwFlags: DWORD; out lpRampData: TDDGammaRamp)
: HResult; stdcall;
function SetGammaRamp (dwFlags: DWORD; const lpRampData: TDDGammaRamp)
: HResult; stdcall;
// IDirectDrawGammaControl methods
function GetGammaRamp(dwFlags: DWORD; var lpRampData: TDDGammaRamp): HResult; stdcall;
function SetGammaRamp(dwFlags: DWORD; const lpRampData: TDDGammaRamp): HResult; stdcall;
end;
 
type
IID_IDirectDraw = IDirectDraw;
IID_IDirectDraw2 = IDirectDraw2;
IID_IDirectDraw4 = IDirectDraw4;
IID_IDirectDraw7 = IDirectDraw7;
IID_IDirectDrawSurface = IDirectDrawSurface;
IID_IDirectDrawSurface2 = IDirectDrawSurface2;
IID_IDirectDrawSurface3 = IDirectDrawSurface3;
IID_IDirectDrawSurface4 = IDirectDrawSurface4;
IID_IDirectDrawSurface7 = IDirectDrawSurface7;
const
{ Flags for DirectDrawEnumerateEx }
DDENUM_ATTACHEDSECONDARYDEVICES = $00000001;
DDENUM_DETACHEDSECONDARYDEVICES = $00000002;
DDENUM_NONDISPLAYDEVICES = $00000004;
 
IID_IDirectDrawPalette = IDirectDrawPalette;
IID_IDirectDrawClipper = IDirectDrawClipper;
IID_IDirectDrawColorControl = IDirectDrawColorControl;
IID_IDirectDrawGammaControl = IDirectDrawGammaControl;
{ Flags for the IDirectDraw4.GetDeviceIdentifier method }
DDGDI_GETHOSTIDENTIFIER = $00000001;
 
const
(*
* ddsCaps field is valid.
*)
{ ddsCaps field is valid. }
DDSD_CAPS = $00000001; // default
 
(*
* dwHeight field is valid.
*)
DDSD_HEIGHT = $00000002;
 
(*
* dwWidth field is valid.
*)
DDSD_WIDTH = $00000004;
 
(*
* lPitch is valid.
*)
DDSD_PITCH = $00000008;
 
(*
* dwBackBufferCount is valid.
*)
DDSD_BACKBUFFERCOUNT = $00000020;
 
(*
* dwZBufferBitDepth is valid. (shouldnt be used in DDSURFACEDESC2)
*)
DDSD_ZBUFFERBITDEPTH = $00000040;
 
(*
* dwAlphaBitDepth is valid.
*)
DDSD_ALPHABITDEPTH = $00000080;
 
(*
* lpSurface is valid.
*)
DDSD_LPSURFACE = $00000800;
 
(*
* ddpfPixelFormat is valid.
*)
DDSD_PIXELFORMAT = $00001000;
 
(*
* ddckCKDestOverlay is valid.
*)
DDSD_CKDESTOVERLAY = $00002000;
 
(*
* ddckCKDestBlt is valid.
*)
DDSD_CKDESTBLT = $00004000;
 
(*
* ddckCKSrcOverlay is valid.
*)
DDSD_CKSRCOVERLAY = $00008000;
 
(*
* ddckCKSrcBlt is valid.
*)
DDSD_CKSRCBLT = $00010000;
 
(*
* dwMipMapCount is valid.
*)
DDSD_MIPMAPCOUNT = $00020000;
 
(*
* dwRefreshRate is valid
*)
DDSD_REFRESHRATE = $00040000;
 
(*
* dwLinearSize is valid
*)
DDSD_LINEARSIZE = $00080000;
 
(*
* dwTextureStage is valid
*)
DDSD_TEXTURESTAGE = $00100000;
DDSD_FVF = $00200000;
DDSD_SRCVBHANDLE = $00400000;
DDSD_ALL = $007ff9ee;
 
(*
* All input fields are valid.
*)
DDSD_ALL = $001ff9ee;
{ DirectDraw Driver Capability Flags }
 
 
(*
* guid field is valid.
*)
DDOSD_GUID = $00000001;
 
(*
* dwCompressionRatio field is valid.
*)
DDOSD_COMPRESSION_RATIO = $00000002;
 
(*
* ddSCaps field is valid.
*)
DDOSD_SCAPS = $00000004;
 
(*
* ddOSCaps field is valid.
*)
DDOSD_OSCAPS = $00000008;
 
(*
* All input fields are valid.
*)
DDOSD_ALL = $0000000f;
 
(*
* The surface's optimized pixelformat is compressed
*)
DDOSDCAPS_OPTCOMPRESSED = $00000001;
 
(*
* The surface's optimized pixelformat is reordered
*)
DDOSDCAPS_OPTREORDERED = $00000002;
 
(*
* The opt surface is a monolithic mipmap
*)
DDOSDCAPS_MONOLITHICMIPMAP = $00000004;
 
(*
* The valid Surf caps:
* DDSCAPS_SYSTEMMEMORY = $00000800;
* DDSCAPS_VIDEOMEMORY = $00004000;
* DDSCAPS_LOCALVIDMEM = $10000000;
* DDSCAPS_NONLOCALVIDMEM = $20000000;
*)
DDOSDCAPS_VALIDSCAPS = $30004800;
 
(*
* The valid OptSurf caps
*)
DDOSDCAPS_VALIDOSCAPS = $00000007;
 
 
(*
* DDCOLORCONTROL
*)
 
(*
* lBrightness field is valid.
*)
DDCOLOR_BRIGHTNESS = $00000001;
 
(*
* lContrast field is valid.
*)
DDCOLOR_CONTRAST = $00000002;
 
(*
* lHue field is valid.
*)
DDCOLOR_HUE = $00000004;
 
(*
* lSaturation field is valid.
*)
DDCOLOR_SATURATION = $00000008;
 
(*
* lSharpness field is valid.
*)
DDCOLOR_SHARPNESS = $00000010;
 
(*
* lGamma field is valid.
*)
DDCOLOR_GAMMA = $00000020;
 
(*
* lColorEnable field is valid.
*)
DDCOLOR_COLORENABLE = $00000040;
 
 
 
(*============================================================================
*
* Direct Draw Capability Flags
*
* These flags are used to describe the capabilities of a given Surface.
* All flags are bit flags.
*
*==========================================================================*)
 
(****************************************************************************
*
* DIRECTDRAWSURFACE CAPABILITY FLAGS
*
****************************************************************************)
(*
* This bit currently has no meaning.
*)
DDSCAPS_RESERVED1 = $00000001;
 
(*
* Indicates that this surface contains alpha-only information.
* (To determine if a surface is RGBA/YUVA, the pixel format must be
* interrogated.)
*)
DDSCAPS_ALPHA = $00000002;
 
(*
* Indicates that this surface is a backbuffer. It is generally
* set by CreateSurface when the DDSCAPS_FLIP capability bit is set.
* It indicates that this surface is THE back buffer of a surface
* flipping structure. DirectDraw supports N surfaces in a
* surface flipping structure. Only the surface that immediately
* precedeces the DDSCAPS_FRONTBUFFER has this capability bit set.
* The other surfaces are identified as back buffers by the presence
* of the DDSCAPS_FLIP capability, their attachment order, and the
* absence of the DDSCAPS_FRONTBUFFER and DDSCAPS_BACKBUFFER
* capabilities. The bit is sent to CreateSurface when a standalone
* back buffer is being created. This surface could be attached to
* a front buffer and/or back buffers to form a flipping surface
* structure after the CreateSurface call. See AddAttachments for
* a detailed description of the behaviors in this case.
*)
DDSCAPS_BACKBUFFER = $00000004;
 
(*
* Indicates a complex surface structure is being described. A
* complex surface structure results in the creation of more than
* one surface. The additional surfaces are attached to the root
* surface. The complex structure can only be destroyed by
* destroying the root.
*)
DDSCAPS_COMPLEX = $00000008;
 
(*
* Indicates that this surface is a part of a surface flipping structure.
* When it is passed to CreateSurface the DDSCAPS_FRONTBUFFER and
* DDSCAP_BACKBUFFER bits are not set. They are set by CreateSurface
* on the resulting creations. The dwBackBufferCount field in the
* TDDSurfaceDesc structure must be set to at least 1 in order for
* the CreateSurface call to succeed. The DDSCAPS_COMPLEX capability
* must always be set with creating multiple surfaces through CreateSurface.
*)
DDSCAPS_FLIP = $00000010;
 
(*
* Indicates that this surface is THE front buffer of a surface flipping
* structure. It is generally set by CreateSurface when the DDSCAPS_FLIP
* capability bit is set.
* If this capability is sent to CreateSurface then a standalonw front buffer
* is created. This surface will not have the DDSCAPS_FLIP capability.
* It can be attached to other back buffers to form a flipping structure.
* See AddAttachments for a detailed description of the behaviors in this
* case.
*)
DDSCAPS_FRONTBUFFER = $00000020;
 
(*
* Indicates that this surface is any offscreen surface that is not an overlay,
* texture, zbuffer, front buffer, back buffer, or alpha surface. It is used
* to identify plain vanilla surfaces.
*)
DDSCAPS_OFFSCREENPLAIN = $00000040;
 
(*
* Indicates that this surface is an overlay. It may or may not be directly visible
* depending on whether or not it is currently being overlayed onto the primary
* surface. DDSCAPS_VISIBLE can be used to determine whether or not it is being
* overlayed at the moment.
*)
DDSCAPS_OVERLAY = $00000080;
 
(*
* Indicates that unique DirectDrawPalette objects can be created and
* attached to this surface.
*)
DDSCAPS_PALETTE = $00000100;
 
(*
* Indicates that this surface is the primary surface. The primary
* surface represents what the user is seeing at the moment.
*)
DDSCAPS_PRIMARYSURFACE = $00000200;
 
(*
* This flag used to be DDSCAPS_PRIMARYSURFACELEFT, which is now
* obsolete.
*)
DDSCAPS_RESERVED3 = $00000400;
(*
* Indicates that this surface is the primary surface for the left eye.
* The primary surface for the left eye represents what the user is seeing
* at the moment with the users left eye. When this surface is created the
* DDSCAPS_PRIMARYSURFACE represents what the user is seeing with the users
* right eye.
*)
DDSCAPS_PRIMARYSURFACELEFT = DDSCAPS_RESERVED3;
 
(*
* Indicates that this surface memory was allocated in system memory
*)
DDSCAPS_SYSTEMMEMORY = $00000800;
 
(*
* Indicates that this surface can be used as a 3D texture. It does not
* indicate whether or not the surface is being used for that purpose.
*)
DDSCAPS_TEXTURE = $00001000;
 
(*
* Indicates that a surface may be a destination for 3D rendering. This
* bit must be set in order to query for a Direct3D Device Interface
* from this surface.
*)
DDSCAPS_3DDEVICE = $00002000;
 
(*
* Indicates that this surface exists in video memory.
*)
DDSCAPS_VIDEOMEMORY = $00004000;
 
(*
* Indicates that changes made to this surface are immediately visible.
* It is always set for the primary surface and is set for overlays while
* they are being overlayed and texture maps while they are being textured.
*)
DDSCAPS_VISIBLE = $00008000;
 
(*
* Indicates that only writes are permitted to the surface. Read accesses
* from the surface may or may not generate a protection fault, but the
* results of a read from this surface will not be meaningful. READ ONLY.
*)
DDSCAPS_WRITEONLY = $00010000;
 
(*
* Indicates that this surface is a z buffer. A z buffer does not contain
* displayable information. Instead it contains bit depth information that is
* used to determine which pixels are visible and which are obscured.
*)
DDSCAPS_ZBUFFER = $00020000;
 
(*
* Indicates surface will have a DC associated long term
*)
DDSCAPS_OWNDC = $00040000;
 
(*
* Indicates surface should be able to receive live video
*)
DDSCAPS_LIVEVIDEO = $00080000;
 
(*
* Indicates surface should be able to have a stream decompressed
* to it by the hardware.
*)
DDSCAPS_HWCODEC = $00100000;
 
(*
* Surface is a ModeX surface.
*
*)
DDSCAPS_MODEX = $00200000;
 
(*
* Indicates surface is one level of a mip-map. This surface will
* be attached to other DDSCAPS_MIPMAP surfaces to form the mip-map.
* This can be done explicitly, by creating a number of surfaces and
* attaching them with AddAttachedSurface or by implicitly by CreateSurface.
* If this bit is set then DDSCAPS_TEXTURE must also be set.
*)
DDSCAPS_MIPMAP = $00400000;
 
(*
* This bit is reserved. It should not be specified.
*)
DDSCAPS_RESERVED2 = $00800000;
 
(*
* Indicates that memory for the surface is not allocated until the surface
* is loaded (via the Direct3D texture Load() function).
*)
DDSCAPS_ALLOCONLOAD = $04000000;
 
(*
* Indicates that the surface will recieve data from a video port.
*)
DDSCAPS_VIDEOPORT = $08000000;
 
(*
* Indicates that a video memory surface is resident in true, local video
* memory rather than non-local video memory. If this flag is specified then
* so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with
* DDSCAPS_NONLOCALVIDMEM.
*)
DDSCAPS_LOCALVIDMEM = $10000000;
 
(*
* Indicates that a video memory surface is resident in non-local video
* memory rather than true, local video memory. If this flag is specified
* then so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with
* DDSCAPS_LOCALVIDMEM.
*)
DDSCAPS_NONLOCALVIDMEM = $20000000;
 
(*
* Indicates that this surface is a standard VGA mode surface, and not a
* ModeX surface. (This flag will never be set in combination with the
* DDSCAPS_MODEX flag).
*)
DDSCAPS_STANDARDVGAMODE = $40000000;
 
(*
* Indicates that this surface will be an optimized surface. This flag is
* currently only valid in conjunction with the DDSCAPS_TEXTURE flag. The surface
* will be created without any underlying video memory until loaded.
*)
DDSCAPS_OPTIMIZED = $80000000;
 
 
 
(*
* Indicates that this surface will receive data from a video port using
* the de-interlacing hardware. This allows the driver to allocate memory
* for any extra buffers that may be required. The DDSCAPS_VIDEOPORT and
* DDSCAPS_OVERLAY flags must also be set.
*)
DDSCAPS2_HARDWAREDEINTERLACE = $00000002;
 
(*
* Indicates to the driver that this surface will be locked very frequently
* (for procedural textures, dynamic lightmaps, etc). Surfaces with this cap
* set must also have DDSCAPS_TEXTURE. This cap cannot be used with
* DDSCAPS2_HINTSTATIC and DDSCAPS2_OPAQUE.
*)
DDSCAPS2_HINTDYNAMIC = $00000004;
 
(*
* Indicates to the driver that this surface can be re-ordered/retiled on
* load. This operation will not change the size of the texture. It is
* relatively fast and symmetrical, since the application may lock these
* bits (although it will take a performance hit when doing so). Surfaces
* with this cap set must also have DDSCAPS_TEXTURE. This cap cannot be
* used with DDSCAPS2_HINTDYNAMIC and DDSCAPS2_OPAQUE.
*)
DDSCAPS2_HINTSTATIC = $00000008;
 
(*
* Indicates that the client would like this texture surface to be managed by the
* DirectDraw/Direct3D runtime. Surfaces with this cap set must also have
* DDSCAPS_TEXTURE and DDSCAPS_SYSTEMMEMORY.
*)
DDSCAPS2_TEXTUREMANAGE = $00000010;
 
(*
* These bits are reserved for internal use *)
DDSCAPS2_RESERVED1 = $00000020;
DDSCAPS2_RESERVED2 = $00000040;
 
(*
* Indicates to the driver that this surface will never be locked again.
* The driver is free to optimize this surface via retiling and actual compression.
* All calls to Lock() or Blts from this surface will fail. Surfaces with this
* cap set must also have DDSCAPS_TEXTURE. This cap cannot be used with
* DDSCAPS2_HINTDYNAMIC and DDSCAPS2_HINTSTATIC.
*)
DDSCAPS2_OPAQUE = $00000080;
 
(*
* Applications should set this bit at CreateSurface time to indicate that they
* intend to use antialiasing. Only valid if DDSCAPS_3DDEVICE is also set.
*)
DDSCAPS2_HINTANTIALIASING = $00000100;
 
(*
* This flag is used at CreateSurface time to indicate that this set of
* surfaces is a cubic environment map
*)
DDSCAPS2_CUBEMAP = $00000200;
 
(*
* These flags preform two functions:
* - At CreateSurface time, they define which of the six cube faces are
* required by the application.
* - After creation, each face in the cubemap will have exactly one of these
* bits set.
*)
DDSCAPS2_CUBEMAP_POSITIVEX = $00000400;
DDSCAPS2_CUBEMAP_NEGATIVEX = $00000800;
DDSCAPS2_CUBEMAP_POSITIVEY = $00001000;
DDSCAPS2_CUBEMAP_NEGATIVEY = $00002000;
DDSCAPS2_CUBEMAP_POSITIVEZ = $00004000;
DDSCAPS2_CUBEMAP_NEGATIVEZ = $00008000;
 
(*
* This macro may be used to specify all faces of a cube map at CreateSurface time
*)
DDSCAPS2_CUBEMAP_ALLFACES = ( DDSCAPS2_CUBEMAP_POSITIVEX or
DDSCAPS2_CUBEMAP_NEGATIVEX or
DDSCAPS2_CUBEMAP_POSITIVEY or
DDSCAPS2_CUBEMAP_NEGATIVEY or
DDSCAPS2_CUBEMAP_POSITIVEZ or
DDSCAPS2_CUBEMAP_NEGATIVEZ );
 
 
(*
* This flag is an additional flag which is present on mipmap sublevels from DX7 onwards
* It enables easier use of GetAttachedSurface rather than EnumAttachedSurfaces for surface
* constructs such as Cube Maps, wherein there are more than one mipmap surface attached
* to the root surface.
* This caps bit is ignored by CreateSurface
*)
DDSCAPS2_MIPMAPSUBLEVEL = $00010000;
 
(* This flag indicates that the texture should be managed by D3D only *)
DDSCAPS2_D3DTEXTUREMANAGE = $00020000;
 
(* This flag indicates that the managed surface can be safely lost *)
DDSCAPS2_DONOTPERSIST = $00040000;
 
(* indicates that this surface is part of a stereo flipping chain *)
DDSCAPS2_STEREOSURFACELEFT = $00080000;
 
 
 
(****************************************************************************
*
* DIRECTDRAW DRIVER CAPABILITY FLAGS
*
****************************************************************************)
 
(*
* Display hardware has 3D acceleration.
*)
DDCAPS_3D = $00000001;
 
(*
* Indicates that DirectDraw will support only dest rectangles that are aligned
* on DIRECTDRAWCAPS.dwAlignBoundaryDest boundaries of the surface, respectively.
* READ ONLY.
*)
DDCAPS_ALIGNBOUNDARYDEST = $00000002;
 
(*
* Indicates that DirectDraw will support only source rectangles whose sizes in
* BYTEs are DIRECTDRAWCAPS.dwAlignSizeDest multiples, respectively. READ ONLY.
*)
DDCAPS_ALIGNSIZEDEST = $00000004;
(*
* Indicates that DirectDraw will support only source rectangles that are aligned
* on DIRECTDRAWCAPS.dwAlignBoundarySrc boundaries of the surface, respectively.
* READ ONLY.
*)
DDCAPS_ALIGNBOUNDARYSRC = $00000008;
 
(*
* Indicates that DirectDraw will support only source rectangles whose sizes in
* BYTEs are DIRECTDRAWCAPS.dwAlignSizeSrc multiples, respectively. READ ONLY.
*)
DDCAPS_ALIGNSIZESRC = $00000010;
 
(*
* Indicates that DirectDraw will create video memory surfaces that have a stride
* alignment equal to DIRECTDRAWCAPS.dwAlignStride. READ ONLY.
*)
DDCAPS_ALIGNSTRIDE = $00000020;
 
(*
* Display hardware is capable of blt operations.
*)
DDCAPS_BLT = $00000040;
 
(*
* Display hardware is capable of asynchronous blt operations.
*)
DDCAPS_BLTQUEUE = $00000080;
 
(*
* Display hardware is capable of color space conversions during the blt operation.
*)
DDCAPS_BLTFOURCC = $00000100;
 
(*
* Display hardware is capable of stretching during blt operations.
*)
DDCAPS_BLTSTRETCH = $00000200;
 
(*
* Display hardware is shared with GDI.
*)
DDCAPS_GDI = $00000400;
 
(*
* Display hardware can overlay.
*)
DDCAPS_OVERLAY = $00000800;
 
(*
* Set if display hardware supports overlays but can not clip them.
*)
DDCAPS_OVERLAYCANTCLIP = $00001000;
 
(*
* Indicates that overlay hardware is capable of color space conversions during
* the overlay operation.
*)
DDCAPS_OVERLAYFOURCC = $00002000;
 
(*
* Indicates that stretching can be done by the overlay hardware.
*)
DDCAPS_OVERLAYSTRETCH = $00004000;
 
(*
* Indicates that unique DirectDrawPalettes can be created for DirectDrawSurfaces
* other than the primary surface.
*)
DDCAPS_PALETTE = $00008000;
 
(*
* Indicates that palette changes can be syncd with the veritcal refresh.
*)
DDCAPS_PALETTEVSYNC = $00010000;
 
(*
* Display hardware can return the current scan line.
*)
DDCAPS_READSCANLINE = $00020000;
 
(*
* Display hardware has stereo vision capabilities. DDSCAPS_PRIMARYSURFACELEFT
* can be created.
*)
DDCAPS_STEREOVIEW = $00040000;
 
(*
* Display hardware is capable of generating a vertical blank interrupt.
*)
DDCAPS_VBI = $00080000;
 
(*
* Supports the use of z buffers with blt operations.
*)
DDCAPS_ZBLTS = $00100000;
 
(*
* Supports Z Ordering of overlays.
*)
DDCAPS_ZOVERLAYS = $00200000;
 
(*
* Supports color key
*)
DDCAPS_COLORKEY = $00400000;
 
(*
* Supports alpha surfaces
*)
DDCAPS_ALPHA = $00800000;
 
(*
* colorkey is hardware assisted(DDCAPS_COLORKEY will also be set)
*)
DDCAPS_COLORKEYHWASSIST = $01000000;
 
(*
* no hardware support at all
*)
DDCAPS_NOHARDWARE = $02000000;
 
(*
* Display hardware is capable of color fill with bltter
*)
DDCAPS_BLTCOLORFILL = $04000000;
 
(*
* Display hardware is bank switched, and potentially very slow at
* random access to VRAM.
*)
DDCAPS_BANKSWITCHED = $08000000;
 
(*
* Display hardware is capable of depth filling Z-buffers with bltter
*)
DDCAPS_BLTDEPTHFILL = $10000000;
 
(*
* Display hardware is capable of clipping while bltting.
*)
DDCAPS_CANCLIP = $20000000;
 
(*
* Display hardware is capable of clipping while stretch bltting.
*)
DDCAPS_CANCLIPSTRETCHED = $40000000;
 
(*
* Display hardware is capable of bltting to or from system memory
*)
DDCAPS_CANBLTSYSMEM = $80000000;
 
{ More DirectDraw Driver Capability Flags (dwCaps2) }
 
(****************************************************************************
*
* MORE DIRECTDRAW DRIVER CAPABILITY FLAGS (dwCaps2)
*
****************************************************************************)
 
(*
* Display hardware is certified
*)
DDCAPS2_CERTIFIED = $00000001;
 
(*
* Driver cannot interleave 2D operations (lock and blt) to surfaces with
* Direct3D rendering operations between calls to BeginScene() and EndScene()
*)
DDCAPS2_NO2DDURING3DSCENE = $00000002;
 
(*
* Display hardware contains a video port
*)
DDCAPS2_VIDEOPORT = $00000004;
 
(*
* The overlay can be automatically flipped according to the video port
* VSYNCs, providing automatic doubled buffered display of video port
* data using an overlay
*)
DDCAPS2_AUTOFLIPOVERLAY = $00000008;
 
(*
* Overlay can display each field of interlaced data individually while
* it is interleaved in memory without causing jittery artifacts.
*)
DDCAPS2_CANBOBINTERLEAVED = $00000010;
 
(*
* Overlay can display each field of interlaced data individually while
* it is not interleaved in memory without causing jittery artifacts.
*)
DDCAPS2_CANBOBNONINTERLEAVED = $00000020;
 
(*
* The overlay surface contains color controls (brightness, sharpness, etc.)
*)
DDCAPS2_COLORCONTROLOVERLAY = $00000040;
 
(*
* The primary surface contains color controls (gamma, etc.)
*)
DDCAPS2_COLORCONTROLPRIMARY = $00000080;
 
(*
* RGBZ -> RGB supported for 16:16 RGB:Z
*)
DDCAPS2_CANDROPZ16BIT = $00000100;
 
(*
* Driver supports non-local video memory.
*)
DDCAPS2_NONLOCALVIDMEM = $00000200;
 
(*
* Dirver supports non-local video memory but has different capabilities for
* non-local video memory surfaces. If this bit is set then so must
* DDCAPS2_NONLOCALVIDMEM.
*)
DDCAPS2_NONLOCALVIDMEMCAPS = $00000400;
 
(*
* Driver neither requires nor prefers surfaces to be pagelocked when performing
* blts involving system memory surfaces
*)
DDCAPS2_NOPAGELOCKREQUIRED = $00000800;
 
(*
* Driver can create surfaces which are wider than the primary surface
*)
DDCAPS2_WIDESURFACES = $00001000;
 
(*
* Driver supports bob without using a video port by handling the
* DDFLIP_ODD and DDFLIP_EVEN flags specified in Flip.
*)
DDCAPS2_CANFLIPODDEVEN = $00002000;
 
(*
* Driver supports bob using hardware
*)
DDCAPS2_CANBOBHARDWARE = $00004000;
 
(*
* Driver supports bltting any FOURCC surface to another surface of the same FOURCC
*)
DDCAPS2_COPYFOURCC = $00008000;
DDCAPS2_PRIMARYGAMMA = $00020000;
DDCAPS2_CANRENDERWINDOWED = $00080000;
DDCAPS2_CANCALIBRATEGAMMA = $00100000;
DDCAPS2_FLIPINTERVAL = $00200000;
DDCAPS2_FLIPNOVSYNC = $00400000;
DDCAPS2_CANMANAGETEXTURE = $00800000;
DDCAPS2_TEXMANINNONLOCALVIDMEM = $01000000;
DDCAPS2_STEREO = $02000000;
DDCAPS2_SYSTONONLOCAL_AS_SYSTOLOCAL = $04000000;
 
{ DirectDrawSurface Capability Flags }
 
(*
* Driver supports loadable gamma ramps for the primary surface
*)
DDCAPS2_PRIMARYGAMMA = $00020000;
DDSCAPS_RESERVED1 = $00000001; { DDSCAPS_3D }
DDSCAPS_ALPHA = $00000002;
DDSCAPS_BACKBUFFER = $00000004;
DDSCAPS_COMPLEX = $00000008;
DDSCAPS_FLIP = $00000010;
DDSCAPS_FRONTBUFFER = $00000020;
DDSCAPS_OFFSCREENPLAIN = $00000040;
DDSCAPS_OVERLAY = $00000080;
DDSCAPS_PALETTE = $00000100;
DDSCAPS_PRIMARYSURFACE = $00000200;
DDSCAPS_RESERVED3 = $00000400; { DDSCAPS_PRIMARYSURFACELEFT }
DDSCAPS_SYSTEMMEMORY = $00000800;
DDSCAPS_TEXTURE = $00001000;
DDSCAPS_3DDEVICE = $00002000;
DDSCAPS_VIDEOMEMORY = $00004000;
DDSCAPS_VISIBLE = $00008000;
DDSCAPS_WRITEONLY = $00010000;
DDSCAPS_ZBUFFER = $00020000;
DDSCAPS_OWNDC = $00040000;
DDSCAPS_LIVEVIDEO = $00080000;
DDSCAPS_HWCODEC = $00100000;
DDSCAPS_MODEX = $00200000;
DDSCAPS_MIPMAP = $00400000;
DDSCAPS_RESERVED2 = $00800000;
DDSCAPS_ALLOCONLOAD = $04000000;
DDSCAPS_VIDEOPORT = $08000000;
DDSCAPS_LOCALVIDMEM = $10000000;
DDSCAPS_NONLOCALVIDMEM = $20000000;
DDSCAPS_STANDARDVGAMODE = $40000000;
DDSCAPS_OPTIMIZED = $80000000;
 
(*
* Driver can render in windowed mode.
*)
DDCAPS2_CANRENDERWINDOWED = $00080000;
{ DirectDrawSurface Capability Flags 2 }
 
(*
* A calibrator is available to adjust the gamma ramp according to the
* physical display properties so that the result will be identical on
* all calibrated systems.
*)
DDCAPS2_CANCALIBRATEGAMMA = $00100000;
DDSCAPS2_HARDWAREDEINTERLACE = $00000002;
DDSCAPS2_HINTDYNAMIC = $00000004;
DDSCAPS2_HINTSTATIC = $00000008;
DDSCAPS2_TEXTUREMANAGE = $00000010;
DDSCAPS2_RESERVED1 = $00000020;
DDSCAPS2_RESERVED2 = $00000040;
DDSCAPS2_OPAQUE = $00000080;
DDSCAPS2_HINTANTIALIASING = $00000100;
DDSCAPS2_CUBEMAP = $00000200;
DDSCAPS2_CUBEMAP_POSITIVEX = $00000400;
DDSCAPS2_CUBEMAP_NEGATIVEX = $00000800;
DDSCAPS2_CUBEMAP_POSITIVEY = $00001000;
DDSCAPS2_CUBEMAP_NEGATIVEY = $00002000;
DDSCAPS2_CUBEMAP_POSITIVEZ = $00004000;
DDSCAPS2_CUBEMAP_NEGATIVEZ = $00008000;
 
(*
* Indicates that the driver will respond to DDFLIP_INTERVALn flags
*)
DDCAPS2_FLIPINTERVAL = $00200000;
DDSCAPS2_CUBEMAP_ALLFACES =
DDSCAPS2_CUBEMAP_POSITIVEX or DDSCAPS2_CUBEMAP_NEGATIVEX or
DDSCAPS2_CUBEMAP_POSITIVEY or DDSCAPS2_CUBEMAP_NEGATIVEY or
DDSCAPS2_CUBEMAP_POSITIVEZ or DDSCAPS2_CUBEMAP_NEGATIVEZ;
 
(*
* Indicates that the driver will respond to DDFLIP_NOVSYNC
*)
DDCAPS2_FLIPNOVSYNC = $00400000;
DDSCAPS2_MIPMAPSUBLEVEL = $00010000;
DDSCAPS2_D3DTEXTUREMANAGE = $00020000;
DDSCAPS2_DONOTPERSIST = $00040000;
DDSCAPS2_STEREOSURFACELEFT = $00080000;
 
(*
* Driver supports management of video memory, if this flag is ON,
* driver manages the texture if requested with DDSCAPS2_TEXTUREMANAGE on
* DirectX manages the texture if this flag is OFF and surface has DDSCAPS2_TEXTUREMANAGE on
*)
DDCAPS2_CANMANAGETEXTURE = $00800000;
{ TDDOptSurfaceDesc flags }
 
(*
* The Direct3D texture manager uses this cap to decide whether to put managed
* surfaces in non-local video memory. If the cap is set, the texture manager will
* put managed surfaces in non-local vidmem. Drivers that cannot texture from
* local vidmem SHOULD NOT set this cap.
*)
DDCAPS2_TEXMANINNONLOCALVIDMEM = $01000000;
DDOSD_GUID = $00000001;
DDOSD_COMPRESSION_RATIO = $00000002;
DDOSD_SCAPS = $00000004;
DDOSD_OSCAPS = $00000008;
DDOSD_ALL = $0000000F;
 
(*
* Indicates that the driver supports DX7 type of stereo in at least one mode (which may
* not necessarily be the current mode). Applications should use IDirectDraw7 (or higher)
* ::EnumDisplayModes and check the DDSURFACEDESC.ddsCaps.dwCaps2 field for the presence of
* DDSCAPS2_STEREOSURFACELEFT to check if a particular mode supports stereo. The application
* can also use IDirectDraw7(or higher)::GetDisplayMode to check the current mode.
*)
DDCAPS2_STEREO = $02000000;
{ ddOSCaps field is valid. }
 
(*
* This caps bit is intended for internal DirectDraw use.
* -It is only valid if DDCAPS2_NONLOCALVIDMEMCAPS is set.
* -If this bit is set, then DDCAPS_CANBLTSYSMEM MUST be set by the driver (and
* all the assoicated system memory blt caps must be correct).
* -It implies that the system->video blt caps in DDCAPS also apply to system to
* nonlocal blts. I.e. the dwSVBCaps, dwSVBCKeyCaps, dwSVBFXCaps and dwSVBRops
* members of DDCAPS (DDCORECAPS) are filled in correctly.
* -Any blt from system to nonlocal memory that matches these caps bits will
* be passed to the driver.
*
* NOTE: This is intended to enable the driver itself to do efficient reordering
* of textures. This is NOT meant to imply that hardware can write into AGP memory.
* This operation is not currently supported.
*)
DDCAPS2_SYSTONONLOCAL_AS_SYSTOLOCAL = $04000000;
DDOSDCAPS_OPTCOMPRESSED = $00000001;
DDOSDCAPS_OPTREORDERED = $00000002;
DDOSDCAPS_MONOLITHICMIPMAP = $00000004;
DDOSDCAPS_VALIDSCAPS = $30004800;
DDOSDCAPS_VALIDOSCAPS = $00000007;
 
(****************************************************************************
*
* DIRECTDRAW FX ALPHA CAPABILITY FLAGS
*
****************************************************************************)
{ DirectDraw FX Alpha Capability Flags }
 
(*
* Supports alpha blending around the edge of a source color keyed surface.
* For Blt.
*)
DDFXALPHACAPS_BLTALPHAEDGEBLEND = $00000001;
 
(*
* Supports alpha information in the pixel format. The bit depth of alpha
* information in the pixel format can be 1,2,4, or 8. The alpha value becomes
* more opaque as the alpha value increases. (0 is transparent.)
* For Blt.
*)
DDFXALPHACAPS_BLTALPHAPIXELS = $00000002;
 
(*
* Supports alpha information in the pixel format. The bit depth of alpha
* information in the pixel format can be 1,2,4, or 8. The alpha value
* becomes more transparent as the alpha value increases. (0 is opaque.)
* This flag can only be set if DDCAPS_ALPHA is set.
* For Blt.
*)
DDFXALPHACAPS_BLTALPHAPIXELSNEG = $00000004;
 
(*
* Supports alpha only surfaces. The bit depth of an alpha only surface can be
* 1,2,4, or 8. The alpha value becomes more opaque as the alpha value increases.
* (0 is transparent.)
* For Blt.
*)
DDFXALPHACAPS_BLTALPHASURFACES = $00000008;
 
(*
* The depth of the alpha channel data can range can be 1,2,4, or 8.
* The NEG suffix indicates that this alpha channel becomes more transparent
* as the alpha value increases. (0 is opaque.) This flag can only be set if
* DDCAPS_ALPHA is set.
* For Blt.
*)
DDFXALPHACAPS_BLTALPHASURFACESNEG = $00000010;
 
(*
* Supports alpha blending around the edge of a source color keyed surface.
* For Overlays.
*)
DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND = $00000020;
 
(*
* Supports alpha information in the pixel format. The bit depth of alpha
* information in the pixel format can be 1,2,4, or 8. The alpha value becomes
* more opaque as the alpha value increases. (0 is transparent.)
* For Overlays.
*)
DDFXALPHACAPS_OVERLAYALPHAPIXELS = $00000040;
 
(*
* Supports alpha information in the pixel format. The bit depth of alpha
* information in the pixel format can be 1,2,4, or 8. The alpha value
* becomes more transparent as the alpha value increases. (0 is opaque.)
* This flag can only be set if DDCAPS_ALPHA is set.
* For Overlays.
*)
DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG = $00000080;
 
(*
* Supports alpha only surfaces. The bit depth of an alpha only surface can be
* 1,2,4, or 8. The alpha value becomes more opaque as the alpha value increases.
* (0 is transparent.)
* For Overlays.
*)
DDFXALPHACAPS_OVERLAYALPHASURFACES = $00000100;
 
(*
* The depth of the alpha channel data can range can be 1,2,4, or 8.
* The NEG suffix indicates that this alpha channel becomes more transparent
* as the alpha value increases. (0 is opaque.) This flag can only be set if
* DDCAPS_ALPHA is set.
* For Overlays.
*)
DDFXALPHACAPS_OVERLAYALPHASURFACESNEG = $00000200;
 
(****************************************************************************
*
* DIRECTDRAW FX CAPABILITY FLAGS
*
****************************************************************************)
{ DirectDraw FX Capability Flags }
 
(*
* Uses arithmetic operations to stretch and shrink surfaces during blt
* rather than pixel doubling techniques. Along the Y axis.
*)
DDFXCAPS_BLTARITHSTRETCHY = $00000020;
 
(*
* Uses arithmetic operations to stretch during blt
* rather than pixel doubling techniques. Along the Y axis. Only
* works for x1, x2, etc.
*)
DDFXCAPS_BLTARITHSTRETCHYN = $00000010;
 
(*
* Supports mirroring left to right in blt.
*)
DDFXCAPS_BLTMIRRORLEFTRIGHT = $00000040;
 
(*
* Supports mirroring top to bottom in blt.
*)
DDFXCAPS_BLTMIRRORUPDOWN = $00000080;
 
(*
* Supports arbitrary rotation for blts.
*)
DDFXCAPS_BLTROTATION = $00000100;
 
(*
* Supports 90 degree rotations for blts.
*)
DDFXCAPS_BLTROTATION90 = $00000200;
 
(*
* DirectDraw supports arbitrary shrinking of a surface along the
* x axis (horizontal direction) for blts.
*)
DDFXCAPS_BLTSHRINKX = $00000400;
 
(*
* DirectDraw supports integer shrinking (1x,2x,) of a surface
* along the x axis (horizontal direction) for blts.
*)
DDFXCAPS_BLTSHRINKXN = $00000800;
 
(*
* DirectDraw supports arbitrary shrinking of a surface along the
* y axis (horizontal direction) for blts.
*)
DDFXCAPS_BLTSHRINKY = $00001000;
 
(*
* DirectDraw supports integer shrinking (1x,2x,) of a surface
* along the y axis (vertical direction) for blts.
*)
DDFXCAPS_BLTSHRINKYN = $00002000;
 
(*
* DirectDraw supports arbitrary stretching of a surface along the
* x axis (horizontal direction) for blts.
*)
DDFXCAPS_BLTSTRETCHX = $00004000;
 
(*
* DirectDraw supports integer stretching (1x,2x,) of a surface
* along the x axis (horizontal direction) for blts.
*)
DDFXCAPS_BLTSTRETCHXN = $00008000;
 
(*
* DirectDraw supports arbitrary stretching of a surface along the
* y axis (horizontal direction) for blts.
*)
DDFXCAPS_BLTSTRETCHY = $00010000;
 
(*
* DirectDraw supports integer stretching (1x,2x,) of a surface
* along the y axis (vertical direction) for blts.
*)
DDFXCAPS_BLTSTRETCHYN = $00020000;
 
(*
* Uses arithmetic operations to stretch and shrink surfaces during
* overlay rather than pixel doubling techniques. Along the Y axis
* for overlays.
*)
DDFXCAPS_OVERLAYARITHSTRETCHY = $00040000;
 
(*
* Uses arithmetic operations to stretch surfaces during
* overlay rather than pixel doubling techniques. Along the Y axis
* for overlays. Only works for x1, x2, etc.
*)
DDFXCAPS_OVERLAYARITHSTRETCHYN = $00000008;
 
(*
* DirectDraw supports arbitrary shrinking of a surface along the
* x axis (horizontal direction) for overlays.
*)
DDFXCAPS_OVERLAYSHRINKX = $00080000;
 
(*
* DirectDraw supports integer shrinking (1x,2x,) of a surface
* along the x axis (horizontal direction) for overlays.
*)
DDFXCAPS_OVERLAYSHRINKXN = $00100000;
 
(*
* DirectDraw supports arbitrary shrinking of a surface along the
* y axis (horizontal direction) for overlays.
*)
DDFXCAPS_OVERLAYSHRINKY = $00200000;
 
(*
* DirectDraw supports integer shrinking (1x,2x,) of a surface
* along the y axis (vertical direction) for overlays.
*)
DDFXCAPS_OVERLAYSHRINKYN = $00400000;
 
(*
* DirectDraw supports arbitrary stretching of a surface along the
* x axis (horizontal direction) for overlays.
*)
DDFXCAPS_OVERLAYSTRETCHX = $00800000;
 
(*
* DirectDraw supports integer stretching (1x,2x,) of a surface
* along the x axis (horizontal direction) for overlays.
*)
DDFXCAPS_OVERLAYSTRETCHXN = $01000000;
 
(*
* DirectDraw supports arbitrary stretching of a surface along the
* y axis (horizontal direction) for overlays.
*)
DDFXCAPS_OVERLAYSTRETCHY = $02000000;
 
(*
* DirectDraw supports integer stretching (1x,2x,) of a surface
* along the y axis (vertical direction) for overlays.
*)
DDFXCAPS_OVERLAYSTRETCHYN = $04000000;
 
(*
* DirectDraw supports mirroring of overlays across the vertical axis
*)
DDFXCAPS_OVERLAYMIRRORLEFTRIGHT = $08000000;
 
(*
* DirectDraw supports mirroring of overlays across the horizontal axis
*)
DDFXCAPS_OVERLAYMIRRORUPDOWN = $10000000;
 
(*
* Driver can do alpha blending for blits.
*)
DDFXCAPS_BLTALPHA = $00000001;
 
(*
* Driver can do geometric transformations (or warps) for blits.
*)
DDFXCAPS_BLTTRANSFORM = $00000002;
 
(*
* Driver can do surface-reconstruction filtering for warped blits.
*)
DDFXCAPS_BLTFILTER = DDFXCAPS_BLTARITHSTRETCHY;
 
(*
* Driver can do alpha blending for overlays.
*)
DDFXCAPS_OVERLAYALPHA = $00000004;
 
(*
* Driver can do geometric transformations (or warps) for overlays.
*)
DDFXCAPS_OVERLAYTRANSFORM = $20000000;
 
(*
* Driver can do surface-reconstruction filtering for warped overlays.
*)
DDFXCAPS_OVERLAYFILTER = DDFXCAPS_OVERLAYARITHSTRETCHY;
 
(****************************************************************************
*
* DIRECTDRAW STEREO VIEW CAPABILITIES
*
****************************************************************************)
{ DirectDraw Stereo View Capabilities }
 
(*
* This flag used to be DDSVCAPS_ENIGMA, which is now obsolete
* The stereo view is accomplished via enigma encoding.
*)
DDSVCAPS_RESERVED1 = $00000001;
DDSVCAPS_ENIGMA = DDSVCAPS_RESERVED1;
 
(*
* This flag used to be DDSVCAPS_FLICKER, which is now obsolete
* The stereo view is accomplished via high frequency flickering.
*)
DDSVCAPS_RESERVED2 = $00000002;
DDSVCAPS_FLICKER = DDSVCAPS_RESERVED2;
 
(*
* This flag used to be DDSVCAPS_REDBLUE, which is now obsolete
* The stereo view is accomplished via red and blue filters applied
* to the left and right eyes. All images must adapt their colorspaces
* for this process.
*)
DDSVCAPS_RESERVED3 = $00000004;
DDSVCAPS_REDBLUE = DDSVCAPS_RESERVED3;
 
(*
* This flag used to be DDSVCAPS_SPLIT, which is now obsolete
* The stereo view is accomplished with split screen technology.
*)
DDSVCAPS_RESERVED4 = $00000008;
DDSVCAPS_SPLIT = DDSVCAPS_RESERVED4;
 
(*
* The stereo view is accomplished with switching technology
*)
DDSVCAPS_STEREOSEQUENTIAL = $00000010;
 
(****************************************************************************
*
* DIRECTDRAWPALETTE CAPABILITIES
*
****************************************************************************)
{ DirectDrawPalette Capabilities }
 
(*
* Index is 4 bits. There are sixteen color entries in the palette table.
*)
DDPCAPS_4BIT = $00000001;
 
(*
* Index is onto a 8 bit color index. This field is only valid with the
* DDPCAPS_1BIT, DDPCAPS_2BIT or DDPCAPS_4BIT capability and the target
* surface is in 8bpp. Each color entry is one byte long and is an index
* into destination surface's 8bpp palette.
*)
DDPCAPS_8BITENTRIES = $00000002;
 
(*
* Index is 8 bits. There are 256 color entries in the palette table.
*)
DDPCAPS_8BIT = $00000004;
 
(*
* Indicates that this DIRECTDRAWPALETTE should use the palette color array
* passed into the lpDDColorArray parameter to initialize the DIRECTDRAWPALETTE
* object.
* This flag is obsolete. DirectDraw always initializes the color array from
* the lpDDColorArray parameter. The definition remains for source-level
* compatibility.
*)
DDPCAPS_INITIALIZE = $00000008;
 
(*
* This palette is the one attached to the primary surface. Changing this
* table has immediate effect on the display unless DDPSETPAL_VSYNC is specified
* and supported.
*)
DDPCAPS_PRIMARYSURFACE = $00000010;
 
(*
* This palette is the one attached to the primary surface left. Changing
* this table has immediate effect on the display for the left eye unless
* DDPSETPAL_VSYNC is specified and supported.
*)
DDPCAPS_PRIMARYSURFACELEFT = $00000020;
 
(*
* This palette can have all 256 entries defined
*)
DDPCAPS_ALLOW256 = $00000040;
 
(*
* This palette can have modifications to it synced with the monitors
* refresh rate.
*)
DDPCAPS_VSYNC = $00000080;
 
(*
* Index is 1 bit. There are two color entries in the palette table.
*)
DDPCAPS_1BIT = $00000100;
 
(*
* Index is 2 bit. There are four color entries in the palette table.
*)
DDPCAPS_2BIT = $00000200;
 
(*
* The peFlags member of PALETTEENTRY denotes an 8 bit alpha value
*)
DDPCAPS_ALPHA = $00000400;
 
(****************************************************************************
*
* DIRECTDRAWPALETTE SETENTRY CONSTANTS
*
****************************************************************************)
{ DirectDraw BitDepth Constants }
 
 
(****************************************************************************
*
* DIRECTDRAWPALETTE GETENTRY CONSTANTS
*
****************************************************************************)
 
(* 0 is the only legal value *)
 
(****************************************************************************
*
* DIRECTDRAWSURFACE SETPALETTE CONSTANTS
*
****************************************************************************)
 
(*
* The passed pointer is an IUnknown ptr. The cbData argument to SetPrivateData
* must be set to sizeof(IUnknown^). DirectDraw will call AddRef through this
* pointer and Release when the private data is destroyed. This includes when
* the surface or palette is destroyed before such priovate data is destroyed.
*)
DDSPD_IUNKNOWNPOINTER = $00000001;
 
(*
* Private data is only valid for the current state of the object,
* as determined by the uniqueness value.
*)
DDSPD_VOLATILE = $00000002;
 
(****************************************************************************
*
* DIRECTDRAWSURFACE SETPALETTE CONSTANTS
*
****************************************************************************)
 
 
(****************************************************************************
*
* DIRECTDRAW BITDEPTH CONSTANTS
*
* NOTE: These are only used to indicate supported bit depths. These
* are flags only, they are not to be used as an actual bit depth. The
* absolute numbers 1, 2, 4, 8, 16, 24 and 32 are used to indicate actual
* bit depths in a surface or for changing the display mode.
*
****************************************************************************)
 
(*
* 1 bit per pixel.
*)
DDBD_1 = $00004000;
 
(*
* 2 bits per pixel.
*)
DDBD_2 = $00002000;
 
(*
* 4 bits per pixel.
*)
DDBD_4 = $00001000;
 
(*
* 8 bits per pixel.
*)
DDBD_8 = $00000800;
 
(*
* 16 bits per pixel.
*)
DDBD_16 = $00000400;
 
(*
* 24 bits per pixel.
*)
DDBD_24 = $00000200;
 
(*
* 32 bits per pixel.
*)
DDBD_32 = $00000100;
 
(****************************************************************************
*
* DIRECTDRAWSURFACE SET/GET COLOR KEY FLAGS
*
****************************************************************************)
{ DirectDraw Set/Get Color Key Flags }
 
(*
* Set if the structure contains a color space. Not set if the structure
* contains a single color key.
*)
DDCKEY_COLORSPACE = $00000001;
 
(*
* Set if the structure specifies a color key or color space which is to be
* used as a destination color key for blt operations.
*)
DDCKEY_DESTBLT = $00000002;
 
(*
* Set if the structure specifies a color key or color space which is to be
* used as a destination color key for overlay operations.
*)
DDCKEY_DESTOVERLAY = $00000004;
 
(*
* Set if the structure specifies a color key or color space which is to be
* used as a source color key for blt operations.
*)
DDCKEY_SRCBLT = $00000008;
 
(*
* Set if the structure specifies a color key or color space which is to be
* used as a source color key for overlay operations.
*)
DDCKEY_SRCOVERLAY = $00000010;
 
{ DirectDraw Color Key Capability Flags }
 
(****************************************************************************
*
* DIRECTDRAW COLOR KEY CAPABILITY FLAGS
*
****************************************************************************)
 
(*
* Supports transparent blting using a color key to identify the replaceable
* bits of the destination surface for RGB colors.
*)
DDCKEYCAPS_DESTBLT = $00000001;
 
(*
* Supports transparent blting using a color space to identify the replaceable
* bits of the destination surface for RGB colors.
*)
DDCKEYCAPS_DESTBLTCLRSPACE = $00000002;
 
(*
* Supports transparent blting using a color space to identify the replaceable
* bits of the destination surface for YUV colors.
*)
DDCKEYCAPS_DESTBLTCLRSPACEYUV = $00000004;
 
(*
* Supports transparent blting using a color key to identify the replaceable
* bits of the destination surface for YUV colors.
*)
DDCKEYCAPS_DESTBLTYUV = $00000008;
 
(*
* Supports overlaying using colorkeying of the replaceable bits of the surface
* being overlayed for RGB colors.
*)
DDCKEYCAPS_DESTOVERLAY = $00000010;
 
(*
* Supports a color space as the color key for the destination for RGB colors.
*)
DDCKEYCAPS_DESTOVERLAYCLRSPACE = $00000020;
 
(*
* Supports a color space as the color key for the destination for YUV colors.
*)
DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV = $00000040;
 
(*
* Supports only one active destination color key value for visible overlay
* surfaces.
*)
DDCKEYCAPS_DESTOVERLAYONEACTIVE = $00000080;
 
(*
* Supports overlaying using colorkeying of the replaceable bits of the
* surface being overlayed for YUV colors.
*)
DDCKEYCAPS_DESTOVERLAYYUV = $00000100;
 
(*
* Supports transparent blting using the color key for the source with
* this surface for RGB colors.
*)
DDCKEYCAPS_SRCBLT = $00000200;
 
(*
* Supports transparent blting using a color space for the source with
* this surface for RGB colors.
*)
DDCKEYCAPS_SRCBLTCLRSPACE = $00000400;
 
(*
* Supports transparent blting using a color space for the source with
* this surface for YUV colors.
*)
DDCKEYCAPS_SRCBLTCLRSPACEYUV = $00000800;
 
(*
* Supports transparent blting using the color key for the source with
* this surface for YUV colors.
*)
DDCKEYCAPS_SRCBLTYUV = $00001000;
 
(*
* Supports overlays using the color key for the source with this
* overlay surface for RGB colors.
*)
DDCKEYCAPS_SRCOVERLAY = $00002000;
 
(*
* Supports overlays using a color space as the source color key for
* the overlay surface for RGB colors.
*)
DDCKEYCAPS_SRCOVERLAYCLRSPACE = $00004000;
 
(*
* Supports overlays using a color space as the source color key for
* the overlay surface for YUV colors.
*)
DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV = $00008000;
 
(*
* Supports only one active source color key value for visible
* overlay surfaces.
*)
DDCKEYCAPS_SRCOVERLAYONEACTIVE = $00010000;
 
(*
* Supports overlays using the color key for the source with this
* overlay surface for YUV colors.
*)
DDCKEYCAPS_SRCOVERLAYYUV = $00020000;
 
(*
* there are no bandwidth trade-offs for using colorkey with an overlay
*)
DDCKEYCAPS_NOCOSTOVERLAY = $00040000;
 
{ DirectDraw PixelFormat Flags }
 
(****************************************************************************
*
* DIRECTDRAW PIXELFORMAT FLAGS
*
****************************************************************************)
 
(*
* The surface has alpha channel information in the pixel format.
*)
DDPF_ALPHAPIXELS = $00000001;
 
(*
* The pixel format contains alpha only information
*)
DDPF_ALPHA = $00000002;
 
(*
* The FourCC code is valid.
*)
DDPF_FOURCC = $00000004;
 
(*
* The surface is 4-bit color indexed.
*)
DDPF_PALETTEINDEXED4 = $00000008;
 
(*
* The surface is indexed into a palette which stores indices
* into the destination surface's 8-bit palette.
*)
DDPF_PALETTEINDEXEDTO8 = $00000010;
 
(*
* The surface is 8-bit color indexed.
*)
DDPF_PALETTEINDEXED8 = $00000020;
 
(*
* The RGB data in the pixel format structure is valid.
*)
DDPF_RGB = $00000040;
 
(*
* The surface will accept pixel data in the format specified
* and compress it during the write.
*)
DDPF_COMPRESSED = $00000080;
 
(*
* The surface will accept RGB data and translate it during
* the write to YUV data. The format of the data to be written
* will be contained in the pixel format structure. The DDPF_RGB
* flag will be set.
*)
DDPF_RGBTOYUV = $00000100;
 
(*
* pixel format is YUV - YUV data in pixel format struct is valid
*)
DDPF_YUV = $00000200;
 
(*
* pixel format is a z buffer only surface
*)
DDPF_ZBUFFER = $00000400;
 
(*
* The surface is 1-bit color indexed.
*)
DDPF_PALETTEINDEXED1 = $00000800;
 
(*
* The surface is 2-bit color indexed.
*)
DDPF_PALETTEINDEXED2 = $00001000;
 
(*
* The surface contains Z information in the pixels
*)
DDPF_ZPIXELS = $00002000;
 
(*
* The surface contains stencil information along with Z
*)
DDPF_STENCILBUFFER = $00004000;
 
(*
* Premultiplied alpha format -- the color components have been
* premultiplied by the alpha component.
*)
DDPF_ALPHAPREMULT = $00008000;
DDPF_LUMINANCE = $00020000;
DDPF_BUMPLUMINANCE = $00040000;
DDPF_BUMPDUDV = $00080000;
 
{ DirectDraw SetDisplayMode Flags }
 
(*
* Luminance data in the pixel format is valid.
* Use this flag for luminance-only or luminance+alpha surfaces,
* the bit depth is then ddpf.dwLuminanceBitCount.
*)
DDPF_LUMINANCE = $00020000;
DDSDM_STANDARDVGAMODE = $00000001;
 
(*
* Luminance data in the pixel format is valid.
* Use this flag when hanging luminance off bumpmap surfaces,
* the bit mask for the luminance portion of the pixel is then
* ddpf.dwBumpLuminanceBitMask
*)
DDPF_BUMPLUMINANCE = $00040000;
{ DirectDraw EnumDisplayModes Flags }
 
(*
* Bump map dUdV data in the pixel format is valid.
*)
DDPF_BUMPDUDV = $00080000;
DDEDM_REFRESHRATES = $00000001;
DDEDM_STANDARDVGAMODES = $00000002;
 
(*===========================================================================
*
*
* DIRECTDRAW CALLBACK FLAGS
*
*
*==========================================================================*)
{ DirectDraw EnumSurfaces Flags }
 
(****************************************************************************
*
* DIRECTDRAW ENUMSURFACES FLAGS
*
****************************************************************************)
 
(*
* Enumerate all of the surfaces that meet the search criterion.
*)
DDENUMSURFACES_ALL = $00000001;
 
(*
* A search hit is a surface that matches the surface description.
*)
DDENUMSURFACES_MATCH = $00000002;
 
(*
* A search hit is a surface that does not match the surface description.
*)
DDENUMSURFACES_NOMATCH = $00000004;
 
(*
* Enumerate the first surface that can be created which meets the search criterion.
*)
DDENUMSURFACES_CANBECREATED = $00000008;
 
(*
* Enumerate the surfaces that already exist that meet the search criterion.
*)
DDENUMSURFACES_DOESEXIST = $00000010;
 
(****************************************************************************
*
* DIRECTDRAW SETDISPLAYMODE FLAGS
*
****************************************************************************)
{ DirectDraw SetCooperativeLevel Flags }
 
(*
* The desired mode is a standard VGA mode
*)
DDSDM_STANDARDVGAMODE = $00000001;
 
(****************************************************************************
*
* DIRECTDRAW ENUMDISPLAYMODES FLAGS
*
****************************************************************************)
 
(*
* Enumerate Modes with different refresh rates. EnumDisplayModes guarantees
* that a particular mode will be enumerated only once. This flag specifies whether
* the refresh rate is taken into account when determining if a mode is unique.
*)
DDEDM_REFRESHRATES = $00000001;
 
(*
* Enumerate VGA modes. Specify this flag if you wish to enumerate supported VGA
* modes such as mode 0x13 in addition to the usual ModeX modes (which are always
* enumerated if the application has previously called SetCooperativeLevel with the
* DDSCL_ALLOWMODEX flag set).
*)
DDEDM_STANDARDVGAMODES = $00000002;
 
 
(****************************************************************************
*
* DIRECTDRAW SETCOOPERATIVELEVEL FLAGS
*
****************************************************************************)
 
(*
* Exclusive mode owner will be responsible for the entire primary surface.
* GDI can be ignored. used with DD
*)
DDSCL_FULLSCREEN = $00000001;
 
(*
* allow CTRL_ALT_DEL to work while in fullscreen exclusive mode
*)
DDSCL_ALLOWREBOOT = $00000002;
 
(*
* prevents DDRAW from modifying the application window.
* prevents DDRAW from minimize/restore the application window on activation.
*)
DDSCL_NOWINDOWCHANGES = $00000004;
 
(*
* app wants to work as a regular Windows application
*)
DDSCL_NORMAL = $00000008;
 
(*
* app wants exclusive access
*)
DDSCL_EXCLUSIVE = $00000010;
 
 
(*
* app can deal with non-windows display modes
*)
DDSCL_ALLOWMODEX = $00000040;
 
(*
* this window will receive the focus messages
*)
DDSCL_SETFOCUSWINDOW = $00000080;
 
(*
* this window is associated with the DDRAW object and will
* cover the screen in fullscreen mode
*)
DDSCL_SETDEVICEWINDOW = $00000100;
 
(*
* app wants DDRAW to create a window to be associated with the
* DDRAW object
*)
DDSCL_CREATEDEVICEWINDOW = $00000200;
 
(*
* App explicitly asks DDRAW/D3D to be multithread safe. This makes D3D
* take the global crtisec more frequently.
*)
DDSCL_MULTITHREADED = $00000400;
 
(*
* App hints that it would like to keep the FPU set up for optimal Direct3D
* performance (single precision and exceptions disabled) so Direct3D
* does not need to explicitly set the FPU each time
*)
DDSCL_FPUSETUP = $00000800;
 
(*
* App specifies that it needs either double precision FPU or FPU exceptions
* enabled. This makes Direct3D explicitly set the FPU state eah time it is
* called. Setting the flag will reduce Direct3D performance. The flag is
* assumed by default in DirectX 6 and earlier. See also DDSCL_FPUSETUP
*)
DDSCL_FPUPRESERVE = $00001000;
 
(****************************************************************************
*
* DIRECTDRAW BLT FLAGS
*
****************************************************************************)
{ DirectDraw Blt Flags }
 
(*
* Use the alpha information in the pixel format or the alpha channel surface
* attached to the destination surface as the alpha channel for this blt.
*)
DDBLT_ALPHADEST = $00000001;
 
(*
* Use the dwConstAlphaDest field in the TDDBltFX structure as the alpha channel
* for the destination surface for this blt.
*)
DDBLT_ALPHADESTCONSTOVERRIDE = $00000002;
 
(*
* The NEG suffix indicates that the destination surface becomes more
* transparent as the alpha value increases. (0 is opaque)
*)
DDBLT_ALPHADESTNEG = $00000004;
 
(*
* Use the lpDDSAlphaDest field in the TDDBltFX structure as the alpha
* channel for the destination for this blt.
*)
DDBLT_ALPHADESTSURFACEOVERRIDE = $00000008;
 
(*
* Use the dwAlphaEdgeBlend field in the TDDBltFX structure as the alpha channel
* for the edges of the image that border the color key colors.
*)
DDBLT_ALPHAEDGEBLEND = $00000010;
 
(*
* Use the alpha information in the pixel format or the alpha channel surface
* attached to the source surface as the alpha channel for this blt.
*)
DDBLT_ALPHASRC = $00000020;
 
(*
* Use the dwConstAlphaSrc field in the TDDBltFX structure as the alpha channel
* for the source for this blt.
*)
DDBLT_ALPHASRCCONSTOVERRIDE = $00000040;
 
(*
* The NEG suffix indicates that the source surface becomes more transparent
* as the alpha value increases. (0 is opaque)
*)
DDBLT_ALPHASRCNEG = $00000080;
 
(*
* Use the lpDDSAlphaSrc field in the TDDBltFX structure as the alpha channel
* for the source for this blt.
*)
DDBLT_ALPHASRCSURFACEOVERRIDE = $00000100;
 
(*
* Do this blt asynchronously through the FIFO in the order received. If
* there is no room in the hardware FIFO fail the call.
*)
DDBLT_ASYNC = $00000200;
 
(*
* Uses the dwFillColor field in the TDDBltFX structure as the RGB color
* to fill the destination rectangle on the destination surface with.
*)
DDBLT_COLORFILL = $00000400;
 
(*
* Uses the dwDDFX field in the TDDBltFX structure to specify the effects
* to use for the blt.
*)
DDBLT_DDFX = $00000800;
 
(*
* Uses the dwDDROPS field in the TDDBltFX structure to specify the ROPS
* that are not part of the Win32 API.
*)
DDBLT_DDROPS = $00001000;
 
(*
* Use the color key associated with the destination surface.
*)
DDBLT_KEYDEST = $00002000;
 
(*
* Use the dckDestColorkey field in the TDDBltFX structure as the color key
* for the destination surface.
*)
DDBLT_KEYDESTOVERRIDE = $00004000;
 
(*
* Use the color key associated with the source surface.
*)
DDBLT_KEYSRC = $00008000;
 
(*
* Use the dckSrcColorkey field in the TDDBltFX structure as the color key
* for the source surface.
*)
DDBLT_KEYSRCOVERRIDE = $00010000;
 
(*
* Use the dwROP field in the TDDBltFX structure for the raster operation
* for this blt. These ROPs are the same as the ones defined in the Win32 API.
*)
DDBLT_ROP = $00020000;
 
(*
* Use the dwRotationAngle field in the TDDBltFX structure as the angle
* (specified in 1/100th of a degree) to rotate the surface.
*)
DDBLT_ROTATIONANGLE = $00040000;
 
(*
* Z-buffered blt using the z-buffers attached to the source and destination
* surfaces and the dwZBufferOpCode field in the TDDBltFX structure as the
* z-buffer opcode.
*)
DDBLT_ZBUFFER = $00080000;
 
(*
* Z-buffered blt using the dwConstDest Zfield and the dwZBufferOpCode field
* in the TDDBltFX structure as the z-buffer and z-buffer opcode respectively
* for the destination.
*)
DDBLT_ZBUFFERDESTCONSTOVERRIDE = $00100000;
 
(*
* Z-buffered blt using the lpDDSDestZBuffer field and the dwZBufferOpCode
* field in the TDDBltFX structure as the z-buffer and z-buffer opcode
* respectively for the destination.
*)
DDBLT_ZBUFFERDESTOVERRIDE = $00200000;
 
(*
* Z-buffered blt using the dwConstSrcZ field and the dwZBufferOpCode field
* in the TDDBltFX structure as the z-buffer and z-buffer opcode respectively
* for the source.
*)
DDBLT_ZBUFFERSRCCONSTOVERRIDE = $00400000;
 
(*
* Z-buffered blt using the lpDDSSrcZBuffer field and the dwZBufferOpCode
* field in the TDDBltFX structure as the z-buffer and z-buffer opcode
* respectively for the source.
*)
DDBLT_ZBUFFERSRCOVERRIDE = $00800000;
 
(*
* wait until the device is ready to handle the blt
* this will cause blt to not return DDERR_WASSTILLDRAWING
*)
DDBLT_WAIT = $01000000;
 
(*
* Uses the dwFillDepth field in the TDDBltFX structure as the depth value
* to fill the destination rectangle on the destination Z-buffer surface
* with.
*)
DDBLT_DEPTHFILL = $02000000;
 
(*
* wait until the device is ready to handle the blt
* this will cause blt to not return DDERR_WASSTILLDRAWING
*)
DDBLT_DONOTWAIT = $08000000;
 
(****************************************************************************
*
* BLTFAST FLAGS
*
****************************************************************************)
{ BltFast Flags }
 
DDBLTFAST_NOCOLORKEY = $00000000;
DDBLTFAST_SRCCOLORKEY = $00000001;
3476,1387 → 1843,310
DDBLTFAST_WAIT = $00000010;
DDBLTFAST_DONOTWAIT = $00000020;
 
(****************************************************************************
*
* FLIP FLAGS
*
****************************************************************************)
{ Flip Flags }
 
 
DDFLIP_WAIT = $00000001;
 
(*
* Indicates that the target surface contains the even field of video data.
* This flag is only valid with an overlay surface.
*)
DDFLIP_EVEN = $00000002;
 
(*
* Indicates that the target surface contains the odd field of video data.
* This flag is only valid with an overlay surface.
*)
DDFLIP_ODD = $00000004;
 
(*
* Causes DirectDraw to perform the physical flip immediately and return
* to the application. Typically, what was the front buffer but is now the back
* buffer will still be visible (depending on timing) until the next vertical
* retrace. Subsequent operations involving the two flipped surfaces will
* not check to see if the physical flip has finished (i.e. will not return
* DDERR_WASSTILLDRAWING for that reason (but may for other reasons)).
* This allows an application to perform Flips at a higher frequency than the
* monitor refresh rate, but may introduce visible artifacts.
* Only effective if DDCAPS2_FLIPNOVSYNC is set. If that bit is not set,
* DDFLIP_NOVSYNC has no effect.
*)
DDFLIP_NOVSYNC = $00000008;
 
 
(*
* Flip Interval Flags. These flags indicate how many vertical retraces to wait between
* each flip. The default is one. DirectDraw will return DDERR_WASSTILLDRAWING for each
* surface involved in the flip until the specified number of vertical retraces has
* ocurred. Only effective if DDCAPS2_FLIPINTERVAL is set. If that bit is not set,
* DDFLIP_INTERVALn has no effect.
*)
 
(*
* DirectDraw will flip on every other vertical sync
*)
DDFLIP_INTERVAL2 = $02000000;
 
 
(*
* DirectDraw will flip on every third vertical sync
*)
DDFLIP_INTERVAL3 = $03000000;
 
 
(*
* DirectDraw will flip on every fourth vertical sync
*)
DDFLIP_INTERVAL4 = $04000000;
 
(*
* DirectDraw will flip and display a main stereo surface
*)
DDFLIP_STEREO = $00000010;
 
(*
* On IDirectDrawSurface7 and higher interfaces, the default is DDFLIP_WAIT. If you wish
* to override the default and use time when the accelerator is busy (as denoted by
* the DDERR_WASSTILLDRAWING return code) then use DDFLIP_DONOTWAIT.
*)
DDFLIP_DONOTWAIT = $00000020;
 
(****************************************************************************
*
* DIRECTDRAW SURFACE OVERLAY FLAGS
*
****************************************************************************)
{ DirectDraw Surface Overlay Flags }
 
(*
* Use the alpha information in the pixel format or the alpha channel surface
* attached to the destination surface as the alpha channel for the
* destination overlay.
*)
DDOVER_ALPHADEST = $00000001;
 
(*
* Use the dwConstAlphaDest field in the TDDOverlayFX structure as the
* destination alpha channel for this overlay.
*)
DDOVER_ALPHADESTCONSTOVERRIDE = $00000002;
 
(*
* The NEG suffix indicates that the destination surface becomes more
* transparent as the alpha value increases.
*)
DDOVER_ALPHADESTNEG = $00000004;
 
(*
* Use the lpDDSAlphaDest field in the TDDOverlayFX structure as the alpha
* channel destination for this overlay.
*)
DDOVER_ALPHADESTSURFACEOVERRIDE = $00000008;
 
(*
* Use the dwAlphaEdgeBlend field in the TDDOverlayFX structure as the alpha
* channel for the edges of the image that border the color key colors.
*)
DDOVER_ALPHAEDGEBLEND = $00000010;
 
(*
* Use the alpha information in the pixel format or the alpha channel surface
* attached to the source surface as the source alpha channel for this overlay.
*)
DDOVER_ALPHASRC = $00000020;
 
(*
* Use the dwConstAlphaSrc field in the TDDOverlayFX structure as the source
* alpha channel for this overlay.
*)
DDOVER_ALPHASRCCONSTOVERRIDE = $00000040;
 
(*
* The NEG suffix indicates that the source surface becomes more transparent
* as the alpha value increases.
*)
DDOVER_ALPHASRCNEG = $00000080;
 
(*
* Use the lpDDSAlphaSrc field in the TDDOverlayFX structure as the alpha channel
* source for this overlay.
*)
DDOVER_ALPHASRCSURFACEOVERRIDE = $00000100;
 
(*
* Turn this overlay off.
*)
DDOVER_HIDE = $00000200;
 
(*
* Use the color key associated with the destination surface.
*)
DDOVER_KEYDEST = $00000400;
 
(*
* Use the dckDestColorkey field in the TDDOverlayFX structure as the color key
* for the destination surface
*)
DDOVER_KEYDESTOVERRIDE = $00000800;
 
(*
* Use the color key associated with the source surface.
*)
DDOVER_KEYSRC = $00001000;
 
(*
* Use the dckSrcColorkey field in the TDDOverlayFX structure as the color key
* for the source surface.
*)
DDOVER_KEYSRCOVERRIDE = $00002000;
 
(*
* Turn this overlay on.
*)
DDOVER_SHOW = $00004000;
 
(*
* Add a dirty rect to an emulated overlayed surface.
*)
DDOVER_ADDDIRTYRECT = $00008000;
 
(*
* Redraw all dirty rects on an emulated overlayed surface.
*)
DDOVER_REFRESHDIRTYRECTS = $00010000;
 
(*
* Redraw the entire surface on an emulated overlayed surface.
*)
DDOVER_REFRESHALL = $00020000;
 
(*
* Use the overlay FX flags to define special overlay FX
*)
DDOVER_DDFX = $00080000;
 
(*
* Autoflip the overlay when ever the video port autoflips
*)
DDOVER_AUTOFLIP = $00100000;
 
(*
* Display each field of video port data individually without
* causing any jittery artifacts
*)
DDOVER_BOB = $00200000;
 
(*
* Indicates that bob/weave decisions should not be overridden by other
* interfaces.
*)
DDOVER_OVERRIDEBOBWEAVE = $00400000;
 
(*
* Indicates that the surface memory is composed of interleaved fields.
*)
DDOVER_INTERLEAVED = $00800000;
 
(*
* Indicates that bob will be performed using hardware rather than
* software or emulated.
*)
DDOVER_BOBHARDWARE = $01000000;
 
(*
* Indicates that overlay FX structure contains valid ARGB scaling factors.
*)
DDOVER_ARGBSCALEFACTORS = $02000000;
 
(*
* Indicates that ARGB scaling factors can be degraded to fit driver capabilities.
*)
DDOVER_DEGRADEARGBSCALING = $04000000;
 
(****************************************************************************
*
* DIRECTDRAWSURFACE LOCK FLAGS
*
****************************************************************************)
{ DirectDrawSurface Lock Flags }
 
(*
* The default. Set to indicate that Lock should return a valid memory pointer
* to the top of the specified rectangle. If no rectangle is specified then a
* pointer to the top of the surface is returned.
*)
DDLOCK_SURFACEMEMORYPTR = $00000000; // = default
 
(*
* Set to indicate that Lock should wait until it can obtain a valid memory
* pointer before returning. If this bit is set, Lock will never return
* DDERR_WASSTILLDRAWING.
*)
DDLOCK_SURFACEMEMORYPTR = $00000000; // default
DDLOCK_WAIT = $00000001;
 
(*
* Set if an event handle is being passed to Lock. Lock will trigger the event
* when it can return the surface memory pointer requested.
*)
DDLOCK_EVENT = $00000002;
 
(*
* Indicates that the surface being locked will only be read from.
*)
DDLOCK_READONLY = $00000010;
 
(*
* Indicates that the surface being locked will only be written to
*)
DDLOCK_WRITEONLY = $00000020;
 
(*
* Indicates that a system wide lock should not be taken when this surface
* is locked. This has several advantages (cursor responsiveness, ability
* to call more Windows functions, easier debugging) when locking video
* memory surfaces. However, an application specifying this flag must
* comply with a number of conditions documented in the help file.
* Furthermore, this flag cannot be specified when locking the primary.
*)
DDLOCK_NOSYSLOCK = $00000800;
 
(*
* Used only with Direct3D Vertex Buffer Locks. Indicates that no vertices
* that were referred to in Draw*PrimtiveVB calls since the start of the
* frame (or the last lock without this flag) will be modified during the
* lock. This can be useful when one is only appending data to the vertex
* buffer
*)
DDLOCK_NOOVERWRITE = $00001000;
 
(*
* Indicates that no assumptions will be made about the contents of the
* surface or vertex buffer during this lock.
* This enables two things:
* - Direct3D or the driver may provide an alternative memory
* area as the vertex buffer. This is useful when one plans to clear the
* contents of the vertex buffer and fill in new data.
* - Drivers sometimes store surface data in a re-ordered format.
* When the application locks the surface, the driver is forced to un-re-order
* the surface data before allowing the application to see the surface contents.
* This flag is a hint to the driver that it can skip the un-re-ordering process
* since the application plans to overwrite every single pixel in the surface
* or locked rectangle (and so erase any un-re-ordered pixels anyway).
* Applications should always set this flag when they intend to overwrite the entire
* surface or locked rectangle.
*)
DDLOCK_DISCARDCONTENTS = $00002000;
(*
* DDLOCK_OKTOSWAP is an older, less informative name for DDLOCK_DISCARDCONTENTS
*)
DDLOCK_OKTOSWAP = $00002000;
 
(*
* On IDirectDrawSurface7 and higher interfaces, the default is DDLOCK_WAIT. If you wish
* to override the default and use time when the accelerator is busy (as denoted by
* the DDERR_WASSTILLDRAWING return code) then use DDLOCK_DONOTWAIT.
*)
DDLOCK_DONOTWAIT = $00004000;
 
{ DirectDrawSurface Blt FX Flags }
 
(****************************************************************************
*
* DIRECTDRAWSURFACE PAGELOCK FLAGS
*
****************************************************************************)
 
(*
* No flags defined at present
*)
 
 
(****************************************************************************
*
* DIRECTDRAWSURFACE PAGEUNLOCK FLAGS
*
****************************************************************************)
 
(*
* No flags defined at present
*)
 
 
(****************************************************************************
*
* DIRECTDRAWSURFACE BLT FX FLAGS
*
****************************************************************************)
 
(*
* If stretching, use arithmetic stretching along the Y axis for this blt.
*)
DDBLTFX_ARITHSTRETCHY = $00000001;
 
(*
* Do this blt mirroring the surface left to right. Spin the
* surface around its y-axis.
*)
DDBLTFX_MIRRORLEFTRIGHT = $00000002;
 
(*
* Do this blt mirroring the surface up and down. Spin the surface
* around its x-axis.
*)
DDBLTFX_MIRRORUPDOWN = $00000004;
 
(*
* Schedule this blt to avoid tearing.
*)
DDBLTFX_NOTEARING = $00000008;
 
(*
* Do this blt rotating the surface one hundred and eighty degrees.
*)
DDBLTFX_ROTATE180 = $00000010;
 
(*
* Do this blt rotating the surface two hundred and seventy degrees.
*)
DDBLTFX_ROTATE270 = $00000020;
 
(*
* Do this blt rotating the surface ninety degrees.
*)
DDBLTFX_ROTATE90 = $00000040;
 
(*
* Do this z blt using dwZBufferLow and dwZBufferHigh as range values
* specified to limit the bits copied from the source surface.
*)
DDBLTFX_ZBUFFERRANGE = $00000080;
 
(*
* Do this z blt adding the dwZBufferBaseDest to each of the sources z values
* before comparing it with the desting z values.
*)
DDBLTFX_ZBUFFERBASEDEST = $00000100;
 
(****************************************************************************
*
* DIRECTDRAWSURFACE OVERLAY FX FLAGS
*
****************************************************************************)
{ DirectDrawSurface Overlay FX Flags }
 
(*
* If stretching, use arithmetic stretching along the Y axis for this overlay.
*)
DDOVERFX_ARITHSTRETCHY = $00000001;
 
(*
* Mirror the overlay across the vertical axis
*)
DDOVERFX_MIRRORLEFTRIGHT = $00000002;
 
(*
* Mirror the overlay across the horizontal axis
*)
DDOVERFX_MIRRORUPDOWN = $00000004;
 
(****************************************************************************
*
* Flags for dwDDFX member of DDSPRITEFX structure
*
****************************************************************************)
(*
* Use affine transformation matrix in fTransform member.
*)
{ Flags for dwDDFX member of DDSPRITEFX structure }
 
DDSPRITEFX_AFFINETRANSFORM = $00000001;
 
(*
* Use RGBA scaling factors in ddrgbaScaleFactors member.
*)
DDSPRITEFX_RGBASCALING = $00000002;
 
(*
* Degrade RGBA scaling factors to accommodate driver's capabilities.
*)
DDSPRITEFX_DEGRADERGBASCALING = $00000004;
 
(*
* Do bilinear filtering of stretched or warped sprite.
*)
DDSPRITEFX_BILINEARFILTER = $00000008;
 
(*
* Do "blur" filtering of stretched or warped sprite.
*)
DDSPRITEFX_BLURFILTER = $00000010;
 
(*
* Do "flat" filtering of stretched or warped sprite.
*)
DDSPRITEFX_FLATFILTER = $00000020;
 
(*
* Degrade filtering operation to accommodate driver's capabilities.
*)
DDSPRITEFX_DEGRADEFILTER = $00000040;
 
(****************************************************************************
*
* DIRECTDRAW WAITFORVERTICALBLANK FLAGS
*
****************************************************************************)
{ DirectDraw WaitForVerticalBlank Flags }
 
(*
* return when the vertical blank interval begins
*)
DDWAITVB_BLOCKBEGIN = $00000001;
 
(*
* set up an event to trigger when the vertical blank begins
*)
DDWAITVB_BLOCKBEGINEVENT = $00000002;
 
(*
* return when the vertical blank interval ends and display begins
*)
DDWAITVB_BLOCKEND = $00000004;
 
(****************************************************************************
*
* DIRECTDRAW GETFLIPSTATUS FLAGS
*
****************************************************************************)
{ DirectDraw GetFlipStatus Flags }
 
(*
* is it OK to flip now?
*)
DDGFS_CANFLIP = $00000001;
 
(*
* is the last flip finished?
*)
DDGFS_ISFLIPDONE = $00000002;
 
(****************************************************************************
*
* DIRECTDRAW GETBLTSTATUS FLAGS
*
****************************************************************************)
{ DirectDraw GetBltStatus Flags }
 
(*
* is it OK to blt now?
*)
DDGBS_CANBLT = $00000001;
 
(*
* is the blt to the surface finished?
*)
DDGBS_ISBLTDONE = $00000002;
 
{ DirectDraw EnumOverlayZOrder Flags }
 
(****************************************************************************
*
* DIRECTDRAW ENUMOVERLAYZORDER FLAGS
*
****************************************************************************)
 
(*
* Enumerate overlays back to front.
*)
DDENUMOVERLAYZ_BACKTOFRONT = $00000000;
 
(*
* Enumerate overlays front to back
*)
DDENUMOVERLAYZ_FRONTTOBACK = $00000001;
 
(****************************************************************************
*
* DIRECTDRAW UPDATEOVERLAYZORDER FLAGS
*
****************************************************************************)
{ DirectDraw UpdateOverlayZOrder Flags }
 
(*
* Send overlay to front
*)
DDOVERZ_SENDTOFRONT = $00000000;
 
(*
* Send overlay to back
*)
DDOVERZ_SENDTOBACK = $00000001;
 
(*
* Move Overlay forward
*)
DDOVERZ_MOVEFORWARD = $00000002;
 
(*
* Move Overlay backward
*)
DDOVERZ_MOVEBACKWARD = $00000003;
 
(*
* Move Overlay in front of relative surface
*)
DDOVERZ_INSERTINFRONTOF = $00000004;
 
(*
* Move Overlay in back of relative surface
*)
DDOVERZ_INSERTINBACKOF = $00000005;
 
(****************************************************************************
*
* DIRECTDRAW SETGAMMARAMP FLAGS
*
****************************************************************************)
{ DirectDrawSurface SetPrivateData Constants }
 
(*
* Request calibrator to adjust the gamma ramp according to the physical
* properties of the display so that the result should appear identical
* on all systems.
*)
DDSPD_IUNKNOWNPOINTER = $00000001;
DDSPD_VOLATILE = $00000002;
 
{ TDDColorControl flags }
 
DDCOLOR_BRIGHTNESS = $00000001;
DDCOLOR_CONTRAST = $00000002;
DDCOLOR_HUE = $00000004;
DDCOLOR_SATURATION = $00000008;
DDCOLOR_SHARPNESS = $00000010;
DDCOLOR_GAMMA = $00000020;
DDCOLOR_COLORENABLE = $00000040;
 
{ DirectDraw SetGammaRamp Flags }
 
DDSGR_CALIBRATE = $00000001;
 
(****************************************************************************
*
* DIRECTDRAW STARTMODETEST FLAGS
*
****************************************************************************)
{ DirectDraw StartModeTest Flags }
 
(*
* Indicates that the mode being tested has passed
*)
DDSMT_ISTESTREQUIRED = $00000001;
 
{ DirectDraw EvaluateMode Flags }
 
(****************************************************************************
*
* DIRECTDRAW EVALUATEMODE FLAGS
*
****************************************************************************)
 
(*
* Indicates that the mode being tested has passed
*)
DDEM_MODEPASSED = $00000001;
 
(*
* Indicates that the mode being tested has failed
*)
DDEM_MODEFAILED = $00000002;
 
(*===========================================================================
*
*
* DIRECTDRAW RETURN CODES
*
* The return values from DirectDraw Commands and Surface that return an HResult
* are codes from DirectDraw concerning the results of the action
* requested by DirectDraw.
*
*==========================================================================*)
{ DirectDraw Return Codes }
 
(*
* Status is OK
*
* Issued by: DirectDraw Commands and all callbacks
*)
DD_OK = 0;
DD_FALSE = S_FALSE;
DD_OK = HResult(0);
DD_FALSE = HResult(S_FALSE);
 
(****************************************************************************
*
* DIRECTDRAW ENUMCALLBACK RETURN VALUES
*
* EnumCallback returns are used to control the flow of the DIRECTDRAW and
* DIRECTDRAWSURFACE object enumerations. They can only be returned by
* enumeration callback routines.
*
****************************************************************************)
{ DirectDraw EnumCallback Return Values }
 
(*
* stop the enumeration
*)
DDENUMRET_CANCEL = 0;
 
(*
* continue the enumeration
*)
DDENUMRET_OK = 1;
 
(****************************************************************************
*
* DIRECTDRAW ERRORS
*
* Errors are represented by negative values and cannot be combined.
*
****************************************************************************)
{ DirectDraw Error Codes }
 
_FACDD = $876;
MAKE_DDHRESULT = HResult(1 shl 31) or HResult(_FACDD shl 16);
DDERR_ALREADYINITIALIZED = HResult($88760000 + 5);
DDERR_CANNOTATTACHSURFACE = HResult($88760000 + 10);
DDERR_CANNOTDETACHSURFACE = HResult($88760000 + 20);
DDERR_CURRENTLYNOTAVAIL = HResult($88760000 + 40);
DDERR_EXCEPTION = HResult($88760000 + 55);
DDERR_GENERIC = HResult(E_FAIL);
DDERR_HEIGHTALIGN = HResult($88760000 + 90);
DDERR_INCOMPATIBLEPRIMARY = HResult($88760000 + 95);
DDERR_INVALIDCAPS = HResult($88760000 + 100);
DDERR_INVALIDCLIPLIST = HResult($88760000 + 110);
DDERR_INVALIDMODE = HResult($88760000 + 120);
DDERR_INVALIDOBJECT = HResult($88760000 + 130);
DDERR_INVALIDPARAMS = HResult(E_INVALIDARG);
DDERR_INVALIDPIXELFORMAT = HResult($88760000 + 145);
DDERR_INVALIDRECT = HResult($88760000 + 150);
DDERR_LOCKEDSURFACES = HResult($88760000 + 160);
DDERR_NO3D = HResult($88760000 + 170);
DDERR_NOALPHAHW = HResult($88760000 + 180);
DDERR_NOSTEREOHARDWARE = HResult($88760000 + 181);
DDERR_NOSURFACELEFT = HResult($88760000 + 182);
DDERR_NOCLIPLIST = HResult($88760000 + 205);
DDERR_NOCOLORCONVHW = HResult($88760000 + 210);
DDERR_NOCOOPERATIVELEVELSET = HResult($88760000 + 212);
DDERR_NOCOLORKEY = HResult($88760000 + 215);
DDERR_NOCOLORKEYHW = HResult($88760000 + 220);
DDERR_NODIRECTDRAWSUPPORT = HResult($88760000 + 222);
DDERR_NOEXCLUSIVEMODE = HResult($88760000 + 225);
DDERR_NOFLIPHW = HResult($88760000 + 230);
DDERR_NOGDI = HResult($88760000 + 240);
DDERR_NOMIRRORHW = HResult($88760000 + 250);
DDERR_NOTFOUND = HResult($88760000 + 255);
DDERR_NOOVERLAYHW = HResult($88760000 + 260);
DDERR_OVERLAPPINGRECTS = HResult($88760000 + 270);
DDERR_NORASTEROPHW = HResult($88760000 + 280);
DDERR_NOROTATIONHW = HResult($88760000 + 290);
DDERR_NOSTRETCHHW = HResult($88760000 + 310);
DDERR_NOT4BITCOLOR = HResult($88760000 + 316);
DDERR_NOT4BITCOLORINDEX = HResult($88760000 + 317);
DDERR_NOT8BITCOLOR = HResult($88760000 + 320);
DDERR_NOTEXTUREHW = HResult($88760000 + 330);
DDERR_NOVSYNCHW = HResult($88760000 + 335);
DDERR_NOZBUFFERHW = HResult($88760000 + 340);
DDERR_NOZOVERLAYHW = HResult($88760000 + 350);
DDERR_OUTOFCAPS = HResult($88760000 + 360);
DDERR_OUTOFMEMORY = HResult(E_OUTOFMEMORY);
DDERR_OUTOFVIDEOMEMORY = HResult($88760000 + 380);
DDERR_OVERLAYCANTCLIP = HResult($88760000 + 382);
DDERR_OVERLAYCOLORKEYONLYONEACTIVE = HResult($88760000 + 384);
DDERR_PALETTEBUSY = HResult($88760000 + 387);
DDERR_COLORKEYNOTSET = HResult($88760000 + 400);
DDERR_SURFACEALREADYATTACHED = HResult($88760000 + 410);
DDERR_SURFACEALREADYDEPENDENT = HResult($88760000 + 420);
DDERR_SURFACEBUSY = HResult($88760000 + 430);
DDERR_CANTLOCKSURFACE = HResult($88760000 + 435);
DDERR_SURFACEISOBSCURED = HResult($88760000 + 440);
DDERR_SURFACELOST = HResult($88760000 + 450);
DDERR_SURFACENOTATTACHED = HResult($88760000 + 460);
DDERR_TOOBIGHEIGHT = HResult($88760000 + 470);
DDERR_TOOBIGSIZE = HResult($88760000 + 480);
DDERR_TOOBIGWIDTH = HResult($88760000 + 490);
DDERR_UNSUPPORTED = HResult(E_NOTIMPL);
DDERR_UNSUPPORTEDFORMAT = HResult($88760000 + 510);
DDERR_UNSUPPORTEDMASK = HResult($88760000 + 520);
DDERR_INVALIDSTREAM = HResult($88760000 + 521);
DDERR_VERTICALBLANKINPROGRESS = HResult($88760000 + 537);
DDERR_WASSTILLDRAWING = HResult($88760000 + 540);
DDERR_DDSCAPSCOMPLEXREQUIRED = HResult($88760000 + 542);
DDERR_XALIGN = HResult($88760000 + 560);
DDERR_INVALIDDIRECTDRAWGUID = HResult($88760000 + 561);
DDERR_DIRECTDRAWALREADYCREATED = HResult($88760000 + 562);
DDERR_NODIRECTDRAWHW = HResult($88760000 + 563);
DDERR_PRIMARYSURFACEALREADYEXISTS = HResult($88760000 + 564);
DDERR_NOEMULATION = HResult($88760000 + 565);
DDERR_REGIONTOOSMALL = HResult($88760000 + 566);
DDERR_CLIPPERISUSINGHWND = HResult($88760000 + 567);
DDERR_NOCLIPPERATTACHED = HResult($88760000 + 568);
DDERR_NOHWND = HResult($88760000 + 569);
DDERR_HWNDSUBCLASSED = HResult($88760000 + 570);
DDERR_HWNDALREADYSET = HResult($88760000 + 571);
DDERR_NOPALETTEATTACHED = HResult($88760000 + 572);
DDERR_NOPALETTEHW = HResult($88760000 + 573);
DDERR_BLTFASTCANTCLIP = HResult($88760000 + 574);
DDERR_NOBLTHW = HResult($88760000 + 575);
DDERR_NODDROPSHW = HResult($88760000 + 576);
DDERR_OVERLAYNOTVISIBLE = HResult($88760000 + 577);
DDERR_NOOVERLAYDEST = HResult($88760000 + 578);
DDERR_INVALIDPOSITION = HResult($88760000 + 579);
DDERR_NOTAOVERLAYSURFACE = HResult($88760000 + 580);
DDERR_EXCLUSIVEMODEALREADYSET = HResult($88760000 + 581);
DDERR_NOTFLIPPABLE = HResult($88760000 + 582);
DDERR_CANTDUPLICATE = HResult($88760000 + 583);
DDERR_NOTLOCKED = HResult($88760000 + 584);
DDERR_CANTCREATEDC = HResult($88760000 + 585);
DDERR_NODC = HResult($88760000 + 586);
DDERR_WRONGMODE = HResult($88760000 + 587);
DDERR_IMPLICITLYCREATED = HResult($88760000 + 588);
DDERR_NOTPALETTIZED = HResult($88760000 + 589);
DDERR_UNSUPPORTEDMODE = HResult($88760000 + 590);
DDERR_NOMIPMAPHW = HResult($88760000 + 591);
DDERR_INVALIDSURFACETYPE = HResult($88760000 + 592);
DDERR_NOOPTIMIZEHW = HResult($88760000 + 600);
DDERR_NOTLOADED = HResult($88760000 + 601);
DDERR_NOFOCUSWINDOW = HResult($88760000 + 602);
DDERR_NOTONMIPMAPSUBLEVEL = HResult($88760000 + 603);
DDERR_DCALREADYCREATED = HResult($88760000 + 620);
DDERR_NONONLOCALVIDMEM = HResult($88760000 + 630);
DDERR_CANTPAGELOCK = HResult($88760000 + 640);
DDERR_CANTPAGEUNLOCK = HResult($88760000 + 660);
DDERR_NOTPAGELOCKED = HResult($88760000 + 680);
DDERR_MOREDATA = HResult($88760000 + 690);
DDERR_EXPIRED = HResult($88760000 + 691);
DDERR_TESTFINISHED = HResult($88760000 + 692);
DDERR_NEWMODE = HResult($88760000 + 693);
DDERR_D3DNOTINITIALIZED = HResult($88760000 + 694);
DDERR_VIDEONOTACTIVE = HResult($88760000 + 695);
DDERR_NOMONITORINFORMATION = HResult($88760000 + 696);
DDERR_NODRIVERSUPPORT = HResult($88760000 + 697);
DDERR_DEVICEDOESNTOWNSURFACE = HResult($88760000 + 699);
DDERR_NOTINITIALIZED = HResult(CO_E_NOTINITIALIZED);
 
{ API's }
 
(*
* This object is already initialized
*)
DDERR_ALREADYINITIALIZED = MAKE_DDHRESULT + 5;
function GET_WHQL_YEAR(dwWHQLLevel: DWORD): DWORD;
function GET_WHQL_MONTH(dwWHQLLevel: DWORD): DWORD;
function GET_WHQL_DAY(dwWHQLLevel: DWORD): DWORD;
 
(*
* This surface can not be attached to the requested surface.
*)
DDERR_CANNOTATTACHSURFACE = MAKE_DDHRESULT + 10;
 
(*
* This surface can not be detached from the requested surface.
*)
DDERR_CANNOTDETACHSURFACE = MAKE_DDHRESULT + 20;
 
(*
* Support is currently not available.
*)
DDERR_CURRENTLYNOTAVAIL = MAKE_DDHRESULT + 40;
 
(*
* An exception was encountered while performing the requested operation
*)
DDERR_EXCEPTION = MAKE_DDHRESULT + 55;
 
(*
* Generic failure.
*)
DDERR_GENERIC = E_FAIL;
 
(*
* Height of rectangle provided is not a multiple of reqd alignment
*)
DDERR_HEIGHTALIGN = MAKE_DDHRESULT + 90;
 
(*
* Unable to match primary surface creation request with existing
* primary surface.
*)
DDERR_INCOMPATIBLEPRIMARY = MAKE_DDHRESULT + 95;
 
(*
* One or more of the caps bits passed to the callback are incorrect.
*)
DDERR_INVALIDCAPS = MAKE_DDHRESULT + 100;
 
(*
* DirectDraw does not support provided Cliplist.
*)
DDERR_INVALIDCLIPLIST = MAKE_DDHRESULT + 110;
 
(*
* DirectDraw does not support the requested mode
*)
DDERR_INVALIDMODE = MAKE_DDHRESULT + 120;
 
(*
* DirectDraw received a pointer that was an invalid DIRECTDRAW object.
*)
DDERR_INVALIDOBJECT = MAKE_DDHRESULT + 130;
 
(*
* One or more of the parameters passed to the callback function are
* incorrect.
*)
DDERR_INVALIDPARAMS = E_INVALIDARG;
 
(*
* pixel format was invalid as specified
*)
DDERR_INVALIDPIXELFORMAT = MAKE_DDHRESULT + 145;
 
(*
* Rectangle provided was invalid.
*)
DDERR_INVALIDRECT = MAKE_DDHRESULT + 150;
 
(*
* Operation could not be carried out because one or more surfaces are locked
*)
DDERR_LOCKEDSURFACES = MAKE_DDHRESULT + 160;
 
(*
* There is no 3D present.
*)
DDERR_NO3D = MAKE_DDHRESULT + 170;
 
(*
* Operation could not be carried out because there is no alpha accleration
* hardware present or available.
*)
DDERR_NOALPHAHW = MAKE_DDHRESULT + 180;
 
(*
* Operation could not be carried out because there is no stereo
* hardware present or available.
*)
DDERR_NOSTEREOHARDWARE = MAKE_DDHRESULT + 181;
 
(*
* Operation could not be carried out because there is no hardware
* present which supports stereo surfaces
*)
DDERR_NOSURFACELEFT = MAKE_DDHRESULT + 182;
 
(*
* no clip list available
*)
DDERR_NOCLIPLIST = MAKE_DDHRESULT + 205;
 
(*
* Operation could not be carried out because there is no color conversion
* hardware present or available.
*)
DDERR_NOCOLORCONVHW = MAKE_DDHRESULT + 210;
 
(*
* Create function called without DirectDraw object method SetCooperativeLevel
* being called.
*)
DDERR_NOCOOPERATIVELEVELSET = MAKE_DDHRESULT + 212;
 
(*
* Surface doesn't currently have a color key
*)
DDERR_NOCOLORKEY = MAKE_DDHRESULT + 215;
 
(*
* Operation could not be carried out because there is no hardware support
* of the dest color key.
*)
DDERR_NOCOLORKEYHW = MAKE_DDHRESULT + 220;
 
(*
* No DirectDraw support possible with current display driver
*)
DDERR_NODIRECTDRAWSUPPORT = MAKE_DDHRESULT + 222;
 
(*
* Operation requires the application to have exclusive mode but the
* application does not have exclusive mode.
*)
DDERR_NOEXCLUSIVEMODE = MAKE_DDHRESULT + 225;
 
(*
* Flipping visible surfaces is not supported.
*)
DDERR_NOFLIPHW = MAKE_DDHRESULT + 230;
 
(*
* There is no GDI present.
*)
DDERR_NOGDI = MAKE_DDHRESULT + 240;
 
(*
* Operation could not be carried out because there is no hardware present
* or available.
*)
DDERR_NOMIRRORHW = MAKE_DDHRESULT + 250;
 
(*
* Requested item was not found
*)
DDERR_NOTFOUND = MAKE_DDHRESULT + 255;
 
(*
* Operation could not be carried out because there is no overlay hardware
* present or available.
*)
DDERR_NOOVERLAYHW = MAKE_DDHRESULT + 260;
 
(*
* Operation could not be carried out because the source and destination
* rectangles are on the same surface and overlap each other.
*)
DDERR_OVERLAPPINGRECTS = MAKE_DDHRESULT + 270;
 
(*
* Operation could not be carried out because there is no appropriate raster
* op hardware present or available.
*)
DDERR_NORASTEROPHW = MAKE_DDHRESULT + 280;
 
(*
* Operation could not be carried out because there is no rotation hardware
* present or available.
*)
DDERR_NOROTATIONHW = MAKE_DDHRESULT + 290;
 
(*
* Operation could not be carried out because there is no hardware support
* for stretching
*)
DDERR_NOSTRETCHHW = MAKE_DDHRESULT + 310;
 
(*
* DirectDrawSurface is not in 4 bit color palette and the requested operation
* requires 4 bit color palette.
*)
DDERR_NOT4BITCOLOR = MAKE_DDHRESULT + 316;
 
(*
* DirectDrawSurface is not in 4 bit color index palette and the requested
* operation requires 4 bit color index palette.
*)
DDERR_NOT4BITCOLORINDEX = MAKE_DDHRESULT + 317;
 
(*
* DirectDraw Surface is not in 8 bit color mode and the requested operation
* requires 8 bit color.
*)
DDERR_NOT8BITCOLOR = MAKE_DDHRESULT + 320;
 
(*
* Operation could not be carried out because there is no texture mapping
* hardware present or available.
*)
DDERR_NOTEXTUREHW = MAKE_DDHRESULT + 330;
 
(*
* Operation could not be carried out because there is no hardware support
* for vertical blank synchronized operations.
*)
DDERR_NOVSYNCHW = MAKE_DDHRESULT + 335;
 
(*
* Operation could not be carried out because there is no hardware support
* for zbuffer blting.
*)
DDERR_NOZBUFFERHW = MAKE_DDHRESULT + 340;
 
(*
* Overlay surfaces could not be z layered based on their BltOrder because
* the hardware does not support z layering of overlays.
*)
DDERR_NOZOVERLAYHW = MAKE_DDHRESULT + 350;
 
(*
* The hardware needed for the requested operation has already been
* allocated.
*)
DDERR_OUTOFCAPS = MAKE_DDHRESULT + 360;
 
(*
* DirectDraw does not have enough memory to perform the operation.
*)
DDERR_OUTOFMEMORY = E_OUTOFMEMORY;
 
(*
* DirectDraw does not have enough memory to perform the operation.
*)
DDERR_OUTOFVIDEOMEMORY = MAKE_DDHRESULT + 380;
 
(*
* hardware does not support clipped overlays
*)
DDERR_OVERLAYCANTCLIP = MAKE_DDHRESULT + 382;
 
(*
* Can only have ony color key active at one time for overlays
*)
DDERR_OVERLAYCOLORKEYONLYONEACTIVE = MAKE_DDHRESULT + 384;
 
(*
* Access to this palette is being refused because the palette is already
* locked by another thread.
*)
DDERR_PALETTEBUSY = MAKE_DDHRESULT + 387;
 
(*
* No src color key specified for this operation.
*)
DDERR_COLORKEYNOTSET = MAKE_DDHRESULT + 400;
 
(*
* This surface is already attached to the surface it is being attached to.
*)
DDERR_SURFACEALREADYATTACHED = MAKE_DDHRESULT + 410;
 
(*
* This surface is already a dependency of the surface it is being made a
* dependency of.
*)
DDERR_SURFACEALREADYDEPENDENT = MAKE_DDHRESULT + 420;
 
(*
* Access to this surface is being refused because the surface is already
* locked by another thread.
*)
DDERR_SURFACEBUSY = MAKE_DDHRESULT + 430;
 
(*
* Access to this surface is being refused because no driver exists
* which can supply a pointer to the surface.
* This is most likely to happen when attempting to lock the primary
* surface when no DCI provider is present.
* Will also happen on attempts to lock an optimized surface.
*)
DDERR_CANTLOCKSURFACE = MAKE_DDHRESULT + 435;
 
(*
* Access to Surface refused because Surface is obscured.
*)
DDERR_SURFACEISOBSCURED = MAKE_DDHRESULT + 440;
 
(*
* Access to this surface is being refused because the surface is gone.
* The DIRECTDRAWSURFACE object representing this surface should
* have Restore called on it.
*)
DDERR_SURFACELOST = MAKE_DDHRESULT + 450;
 
(*
* The requested surface is not attached.
*)
DDERR_SURFACENOTATTACHED = MAKE_DDHRESULT + 460;
 
(*
* Height requested by DirectDraw is too large.
*)
DDERR_TOOBIGHEIGHT = MAKE_DDHRESULT + 470;
 
(*
* Size requested by DirectDraw is too large -- The individual height and
* width are OK.
*)
DDERR_TOOBIGSIZE = MAKE_DDHRESULT + 480;
 
(*
* Width requested by DirectDraw is too large.
*)
DDERR_TOOBIGWIDTH = MAKE_DDHRESULT + 490;
 
(*
* Action not supported.
*)
DDERR_UNSUPPORTED = E_NOTIMPL;
 
(*
* FOURCC format requested is unsupported by DirectDraw
*)
DDERR_UNSUPPORTEDFORMAT = MAKE_DDHRESULT + 510;
 
(*
* Bitmask in the pixel format requested is unsupported by DirectDraw
*)
DDERR_UNSUPPORTEDMASK = MAKE_DDHRESULT + 520;
 
(*
* The specified stream contains invalid data
*)
DDERR_INVALIDSTREAM = MAKE_DDHRESULT + 521;
 
(*
* vertical blank is in progress
*)
DDERR_VERTICALBLANKINPROGRESS = MAKE_DDHRESULT + 537;
 
(*
* Informs DirectDraw that the previous Blt which is transfering information
* to or from this Surface is incomplete.
*)
DDERR_WASSTILLDRAWING = MAKE_DDHRESULT + 540;
 
(*
* The specified surface type requires specification of the COMPLEX flag
*)
DDERR_DDSCAPSCOMPLEXREQUIRED = MAKE_DDHRESULT + 542;
 
(*
* Rectangle provided was not horizontally aligned on reqd. boundary
*)
DDERR_XALIGN = MAKE_DDHRESULT + 560;
 
(*
* The GUID passed to DirectDrawCreate is not a valid DirectDraw driver
* identifier.
*)
DDERR_INVALIDDIRECTDRAWGUID = MAKE_DDHRESULT + 561;
 
(*
* A DirectDraw object representing this driver has already been created
* for this process.
*)
DDERR_DIRECTDRAWALREADYCREATED = MAKE_DDHRESULT + 562;
 
(*
* A hardware only DirectDraw object creation was attempted but the driver
* did not support any hardware.
*)
DDERR_NODIRECTDRAWHW = MAKE_DDHRESULT + 563;
 
(*
* this process already has created a primary surface
*)
DDERR_PRIMARYSURFACEALREADYEXISTS = MAKE_DDHRESULT + 564;
 
(*
* software emulation not available.
*)
DDERR_NOEMULATION = MAKE_DDHRESULT + 565;
 
(*
* region passed to Clipper::GetClipList is too small.
*)
DDERR_REGIONTOOSMALL = MAKE_DDHRESULT + 566;
 
(*
* an attempt was made to set a clip list for a clipper objec that
* is already monitoring an hwnd.
*)
DDERR_CLIPPERISUSINGHWND = MAKE_DDHRESULT + 567;
 
(*
* No clipper object attached to surface object
*)
DDERR_NOCLIPPERATTACHED = MAKE_DDHRESULT + 568;
 
(*
* Clipper notification requires an HWND or
* no HWND has previously been set as the CooperativeLevel HWND.
*)
DDERR_NOHWND = MAKE_DDHRESULT + 569;
 
(*
* HWND used by DirectDraw CooperativeLevel has been subclassed,
* this prevents DirectDraw from restoring state.
*)
DDERR_HWNDSUBCLASSED = MAKE_DDHRESULT + 570;
 
(*
* The CooperativeLevel HWND has already been set.
* It can not be reset while the process has surfaces or palettes created.
*)
DDERR_HWNDALREADYSET = MAKE_DDHRESULT + 571;
 
(*
* No palette object attached to this surface.
*)
DDERR_NOPALETTEATTACHED = MAKE_DDHRESULT + 572;
 
(*
* No hardware support for 16 or 256 color palettes.
*)
DDERR_NOPALETTEHW = MAKE_DDHRESULT + 573;
 
(*
* If a clipper object is attached to the source surface passed into a
* BltFast call.
*)
DDERR_BLTFASTCANTCLIP = MAKE_DDHRESULT + 574;
 
(*
* No blter.
*)
DDERR_NOBLTHW = MAKE_DDHRESULT + 575;
 
(*
* No DirectDraw ROP hardware.
*)
DDERR_NODDROPSHW = MAKE_DDHRESULT + 576;
 
(*
* returned when GetOverlayPosition is called on a hidden overlay
*)
DDERR_OVERLAYNOTVISIBLE = MAKE_DDHRESULT + 577;
 
(*
* returned when GetOverlayPosition is called on a overlay that UpdateOverlay
* has never been called on to establish a destionation.
*)
DDERR_NOOVERLAYDEST = MAKE_DDHRESULT + 578;
 
(*
* returned when the position of the overlay on the destionation is no longer
* legal for that destionation.
*)
DDERR_INVALIDPOSITION = MAKE_DDHRESULT + 579;
 
(*
* returned when an overlay member is called for a non-overlay surface
*)
DDERR_NOTAOVERLAYSURFACE = MAKE_DDHRESULT + 580;
 
(*
* An attempt was made to set the cooperative level when it was already
* set to exclusive.
*)
DDERR_EXCLUSIVEMODEALREADYSET = MAKE_DDHRESULT + 581;
 
(*
* An attempt has been made to flip a surface that is not flippable.
*)
DDERR_NOTFLIPPABLE = MAKE_DDHRESULT + 582;
 
(*
* Can't duplicate primary & 3D surfaces, or surfaces that are implicitly
* created.
*)
DDERR_CANTDUPLICATE = MAKE_DDHRESULT + 583;
 
(*
* Surface was not locked. An attempt to unlock a surface that was not
* locked at all, or by this process, has been attempted.
*)
DDERR_NOTLOCKED = MAKE_DDHRESULT + 584;
 
(*
* Windows can not create any more DCs, or a DC was requested for a paltte-indexed
* surface when the surface had no palette AND the display mode was not palette-indexed
* (in this case DirectDraw cannot select a proper palette into the DC)
*)
DDERR_CANTCREATEDC = MAKE_DDHRESULT + 585;
 
(*
* No DC was ever created for this surface.
*)
DDERR_NODC = MAKE_DDHRESULT + 586;
 
(*
* This surface can not be restored because it was created in a different
* mode.
*)
DDERR_WRONGMODE = MAKE_DDHRESULT + 587;
 
(*
* This surface can not be restored because it is an implicitly created
* surface.
*)
DDERR_IMPLICITLYCREATED = MAKE_DDHRESULT + 588;
 
(*
* The surface being used is not a palette-based surface
*)
DDERR_NOTPALETTIZED = MAKE_DDHRESULT + 589;
 
(*
* The display is currently in an unsupported mode
*)
DDERR_UNSUPPORTEDMODE = MAKE_DDHRESULT + 590;
 
(*
* Operation could not be carried out because there is no mip-map
* texture mapping hardware present or available.
*)
DDERR_NOMIPMAPHW = MAKE_DDHRESULT + 591;
 
(*
* The requested action could not be performed because the surface was of
* the wrong type.
*)
DDERR_INVALIDSURFACETYPE = MAKE_DDHRESULT + 592;
 
(*
* Device does not support optimized surfaces, therefore no video memory optimized surfaces
*)
DDERR_NOOPTIMIZEHW = MAKE_DDHRESULT + 600;
 
(*
* Surface is an optimized surface, but has not yet been allocated any memory
*)
DDERR_NOTLOADED = MAKE_DDHRESULT + 601;
 
(*
* Attempt was made to create or set a device window without first setting
* the focus window
*)
DDERR_NOFOCUSWINDOW = MAKE_DDHRESULT + 602;
 
(*
* Attempt was made to set a palette on a mipmap sublevel
*)
DDERR_NOTONMIPMAPSUBLEVEL = MAKE_DDHRESULT + 603;
 
(*
* A DC has already been returned for this surface. Only one DC can be
* retrieved per surface.
*)
DDERR_DCALREADYCREATED = MAKE_DDHRESULT + 620;
 
(*
* An attempt was made to allocate non-local video memory from a device
* that does not support non-local video memory.
*)
DDERR_NONONLOCALVIDMEM = MAKE_DDHRESULT + 630;
 
(*
* The attempt to page lock a surface failed.
*)
DDERR_CANTPAGELOCK = MAKE_DDHRESULT + 640;
 
(*
* The attempt to page unlock a surface failed.
*)
DDERR_CANTPAGEUNLOCK = MAKE_DDHRESULT + 660;
 
(*
* An attempt was made to page unlock a surface with no outstanding page locks.
*)
DDERR_NOTPAGELOCKED = MAKE_DDHRESULT + 680;
 
(*
* There is more data available than the specified buffer size could hold
*)
DDERR_MOREDATA = MAKE_DDHRESULT + 690;
 
(*
* The data has expired and is therefore no longer valid.
*)
DDERR_EXPIRED = MAKE_DDHRESULT + 691;
 
(*
* The mode test has finished executing.
*)
DDERR_TESTFINISHED = MAKE_DDHRESULT + 692;
 
(*
* The mode test has switched to a new mode.
*)
DDERR_NEWMODE = MAKE_DDHRESULT + 693;
 
(*
* D3D has not yet been initialized.
*)
DDERR_D3DNOTINITIALIZED = MAKE_DDHRESULT + 694;
 
(*
* The video port is not active
*)
DDERR_VIDEONOTACTIVE = MAKE_DDHRESULT + 695;
 
(*
* The monitor does not have EDID data.
*)
DDERR_NOMONITORINFORMATION = MAKE_DDHRESULT + 696;
 
(*
* The driver does not enumerate display mode refresh rates.
*)
DDERR_NODRIVERSUPPORT = MAKE_DDHRESULT + 697;
 
(*
* Surfaces created by one direct draw device cannot be used directly by
* another direct draw device.
*)
DDERR_DEVICEDOESNTOWNSURFACE = MAKE_DDHRESULT + 699;
 
(*
* An attempt was made to invoke an interface member of a DirectDraw object
* created by CoCreateInstance() before it was initialized.
*)
DDERR_NOTINITIALIZED = CO_E_NOTINITIALIZED;
 
(* Alpha bit depth constants *)
 
(*
* API's
*)
 
type
HMonitor = THandle;
 
TDDEnumCallbackA = function (lpGUID: PGUID; lpDriverDescription: PAnsiChar;
lpDriverName: PAnsiChar; lpContext: Pointer) : BOOL; stdcall;
TDDEnumCallbackW = function (lpGUID: PGUID; lpDriverDescription: PWideChar;
lpDriverName: PWideChar; lpContext: Pointer) : BOOL; stdcall;
{$IFDEF UNICODE}
TDDEnumCallback = TDDEnumCallbackW;
{$ELSE}
TDDEnumCallback = TDDEnumCallbackA;
{$ENDIF}
TDDEnumCallbackA = function(lpGUID: PGUID; lpDriverDescription: LPSTR;
lpDriverName: LPSTR; lpContext: Pointer): BOOL; stdcall;
LPDDENUMCALLBACKA = TDDEnumCallbackA;
 
TDDEnumCallbackExA = function (lpGUID: PGUID; lpDriverDescription: PAnsiChar;
lpDriverName: PAnsiChar; lpContext: Pointer; Monitor: HMonitor) : BOOL;
stdcall;
TDDEnumCallbackExW = function (lpGUID: PGUID; lpDriverDescription: PWideChar;
lpDriverName: PWideChar; lpContext: Pointer; Monitor: HMonitor) : BOOL;
stdcall;
TDDEnumCallbackW = function(lpGUID: PGUID; lpDriverDescription: LPWSTR;
lpDriverName: LPWSTR; lpContext: Pointer): BOOL; stdcall;
LPDDENUMCALLBACKW = TDDEnumCallbackW;
{$IFDEF UNICODE}
TDDEnumCallbackEx = TDDEnumCallbackExW;
{$ELSE}
TDDEnumCallbackEx = TDDEnumCallbackExA;
{$ENDIF}
TDDEnumCallback = TDDEnumCallbackA;
LPDDENUMCALLBACK = TDDEnumCallback;
 
var
DirectDrawEnumerateA : function (lpCallback: TDDEnumCallbackA;
lpContext: Pointer) : HResult; stdcall;
DirectDrawEnumerateW : function (lpCallback: TDDEnumCallbackW;
lpContext: Pointer) : HResult; stdcall;
DirectDrawEnumerate : function (lpCallback: TDDEnumCallback;
lpContext: Pointer) : HResult; stdcall;
TDDEnumCallbackExA = function(lpGUID: PGUID; lpDriverDescription: LPSTR;
lpDriverName: LPSTR; lpContext: Pointer; Monitor: HMonitor): BOOL; stdcall;
LPDDENUMCALLBACKEXA = TDDEnumCallbackExA;
 
DirectDrawEnumerateExA : function (lpCallback: TDDEnumCallbackExA;
lpContext: Pointer; dwFlags: DWORD) : HResult; stdcall;
DirectDrawEnumerateExW : function (lpCallback: TDDEnumCallbackExW;
lpContext: Pointer; dwFlags: DWORD) : HResult; stdcall;
DirectDrawEnumerateEx : function (lpCallback: TDDEnumCallbackEx;
lpContext: Pointer; dwFlags: DWORD) : HResult; stdcall;
TDDEnumCallbackExW = function(lpGUID: PGUID; lpDriverDescription: LPWSTR;
lpDriverName: LPWSTR; lpContext: Pointer; Monitor: HMonitor): BOOL; stdcall;
LPDDENUMCALLBACKEXW = TDDEnumCallbackExW;
 
DirectDrawCreate : function (lpGUID: PGUID;
out lplpDD: IDirectDraw;
pUnkOuter: IUnknown) : HResult; stdcall;
DirectDrawCreateEx : function (lpGUID: PGUID;
out lplpDD: IDirectDraw7; const iid: TGUID;
pUnkOuter: IUnknown) : HResult; stdcall;
DirectDrawCreateClipper : function (dwFlags: DWORD;
out lplpDDClipper: IDirectDrawClipper;
pUnkOuter: IUnknown) : HResult; stdcall;
TDDEnumCallbackEx = TDDEnumCallbackExA;
LPDDENUMCALLBACKEX = TDDEnumCallbackEx;
 
const
(*
* Flags for DirectDrawEnumerateEx
* DirectDrawEnumerateEx supercedes DirectDrawEnumerate. You must use GetProcAddress to
* obtain a function pointer (of type LPDIRECTDRAWENUMERATEEX) to DirectDrawEnumerateEx.
* By default, only the primary display device is enumerated.
* DirectDrawEnumerate is equivalent to DirectDrawEnumerate(,,DDENUM_NONDISPLAYDEVICES)
*)
 
(*
* This flag causes enumeration of any GDI display devices which are part of
* the Windows Desktop
*)
DDENUM_ATTACHEDSECONDARYDEVICES = $00000001;
 
(*
* This flag causes enumeration of any GDI display devices which are not
* part of the Windows Desktop
*)
DDENUM_DETACHEDSECONDARYDEVICES = $00000002;
 
(*
* This flag causes enumeration of non-display devices
*)
DDENUM_NONDISPLAYDEVICES = $00000004;
 
REGSTR_KEY_DDHW_DESCRIPTION = 'Description';
REGSTR_KEY_DDHW_DRIVERNAME = 'DriverName';
REGSTR_PATH_DDHW = 'Hardware\DirectDrawDrivers';
4864,14 → 2154,21
DDCREATE_HARDWAREONLY = $00000001;
DDCREATE_EMULATIONONLY = $00000002;
 
(*
* Macros for interpretting DDEVICEIDENTIFIER2.dwWHQLLevel
*)
function GET_WHQL_YEAR(dwWHQLLevel: DWORD) : DWORD;
function GET_WHQL_MONTH(dwWHQLLevel: DWORD) : DWORD;
function GET_WHQL_DAY(dwWHQLLevel: DWORD) : DWORD;
function DirectDrawEnumerateA(lpCallback: TDDEnumCallbackA; lpContext: Pointer): HResult; stdcall;
function DirectDrawEnumerateW(lpCallback: TDDEnumCallbackW; lpContext: Pointer): HResult; stdcall;
function DirectDrawEnumerate(lpCallback: TDDEnumCallbackA; lpContext: Pointer): HResult; stdcall;
 
function DirectDrawEnumerateExA(lpCallback: TDDEnumCallbackExA; lpContext: Pointer; dwFlags: DWORD): HResult; stdcall;
function DirectDrawEnumerateExW(lpCallback: TDDEnumCallbackExW; lpContext: Pointer; dwFlags: DWORD): HResult; stdcall;
function DirectDrawEnumerateEx(lpCallback: TDDEnumCallbackExA; lpContext: Pointer; dwFlags: DWORD): HResult; stdcall;
 
function DirectDrawCreate(lpGUID: PGUID; out lplpDD: IDirectDraw;
pUnkOuter: IUnknown): HResult; stdcall;
function DirectDrawCreateEx(lpGUID: PGUID; out lplpDD; const iid: TGUID;
pUnkOuter: IUnknown): HResult; stdcall;
function DirectDrawCreateClipper(dwFlags: DWORD; out lplpDDClipper: IDirectDrawClipper;
pUnkOuter: IUnknown): HResult; stdcall;
 
(*==========================================================================;
*
* Copyright (C) 1996-1997 Microsoft Corporation. All Rights Reserved.
4881,45 → 2178,31
*
***************************************************************************)
 
{ GUIDS used by DirectDrawVideoPort objects }
 
const
(*
* GUIDS used by DirectDrawVideoPort objects
*)
DDVPTYPE_E_HREFH_VREFH: TGUID =
(D1:$54F39980;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
DDVPTYPE_E_HREFH_VREFL: TGUID =
(D1:$92783220;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
DDVPTYPE_E_HREFL_VREFH: TGUID =
(D1:$A07A02E0;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
DDVPTYPE_E_HREFL_VREFL: TGUID =
(D1:$E09C77E0;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
DDVPTYPE_CCIR656: TGUID =
(D1:$FCA326A0;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
DDVPTYPE_BROOKTREE: TGUID =
(D1:$1352A560;D2:$DA61;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
DDVPTYPE_PHILIPS: TGUID =
(D1:$332CF160;D2:$DA61;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
IID_IDDVideoPortContainer: TGUID = '{6C142760-A733-11CE-A521-0020AF0BE560}';
IID_IDirectDrawVideoPort: TGUID = '{B36D93E0-2B43-11CF-A2DE-00AA00B93356}';
 
(*
* GUIDS used to describe connections
*)
DDVPTYPE_E_HREFH_VREFH: TGUID = '{54F39980-DA60-11CF-9B06-00A0C903A3B8}';
DDVPTYPE_E_HREFH_VREFL: TGUID = '{92783220-DA60-11CF-9B06-00A0C903A3B8}';
DDVPTYPE_E_HREFL_VREFH: TGUID = '{A07A02E0-DA60-11CF-9B06-00A0C903A3B8}';
DDVPTYPE_E_HREFL_VREFL: TGUID = '{E09C77E0-DA60-11CF-9B06-00A0C903A3B8}';
DDVPTYPE_CCIR656: TGUID = '{FCA326A0-DA60-11CF-9B06-00A0C903A3B8}';
DDVPTYPE_BROOKTREE: TGUID = '{1352A560-DA61-11CF-9B06-00A0C903A3B8}';
DDVPTYPE_PHILIPS: TGUID = '{332CF160-DA61-11CF-9B06-00A0C903A3B8}';
 
(*============================================================================
*
* DirectDraw Structures
*
* Various structures used to invoke DirectDraw.
*
*==========================================================================*)
{ DirectDraw Structures }
 
type
IDDVideoPortContainer = interface;
IDirectDrawVideoPort = interface;
 
(*
* TDDVideoPortConnect
*)
PDDVideoPortConnect = ^TDDVideoPortConnect;
TDDVideoPortConnect = packed record
dwSize: DWORD; // size of the TDDVideoPortConnect structure
{ TDDVideoportConnect structure }
 
PDDVideoportConnect = ^TDDVideoportConnect;
TDDVideoportConnect = record
dwSize: DWORD; // size of the TDDVideoportConnect structure
dwPortWidth: DWORD; // Width of the video port
guidTypeID: TGUID; // Description of video port connection
dwFlags: DWORD; // Connection flags
4926,12 → 2209,14
dwReserved1: DWORD; // Reserved, set to zero.
end;
 
(*
* TDDVideoPortCaps
*)
PDDVideoPortCaps = ^TDDVideoPortCaps;
TDDVideoPortCaps = packed record
dwSize: DWORD; // size of the TDDVideoPortCaps structure
DDVIDEOPORTCONNECT = TDDVideoportConnect;
LPDDVIDEOPORTCONNECT = PDDVideoportConnect;
 
{ TDDVideoportCaps structure }
 
PDDVideoportCaps = ^TDDVideoportCaps;
TDDVideoportCaps = record
dwSize: DWORD; // size of the TDDVideoportCaps structure
dwFlags: DWORD; // indicates which fields contain data
dwMaxWidth: DWORD; // max width of the video port field
dwMaxVBIWidth: DWORD; // max width of the VBI data
4952,59 → 2237,14
wNumFilterTapsY: WORD; // Number of taps the prescaler uses in the Y direction (0 - no prescale, 1 - replication, etc.)
end;
 
const
(*
* The dwMaxWidth and dwMaxVBIWidth members are valid
*)
DDVPD_WIDTH = $00000001;
DDVIDEOPORTCAPS = TDDVideoportCaps;
LPDDVIDEOPORTCAPS = PDDVideoportCaps;
 
(*
* The dwMaxHeight member is valid
*)
DDVPD_HEIGHT = $00000002;
{ TDDVideoportDesc structure }
 
(*
* The dwVideoPortID member is valid
*)
DDVPD_ID = $00000004;
 
(*
* The dwCaps member is valid
*)
DDVPD_CAPS = $00000008;
 
(*
* The dwFX member is valid
*)
DDVPD_FX = $00000010;
 
(*
* The dwNumAutoFlipSurfaces member is valid
*)
DDVPD_AUTOFLIP = $00000020;
 
(*
* All of the alignment members are valid
*)
DDVPD_ALIGN = $00000040;
 
(*
* The dwNumPreferredAutoflip member is valid
*)
DDVPD_PREFERREDAUTOFLIP = $00000080;
 
(*
* The wNumFilterTapsX and wNumFilterTapsY fields are valid
*)
DDVPD_FILTERQUALITY = $00000100;
 
type
(*
* TDDVideoPortDesc
*)
PDDVideoPortDesc = ^TDDVideoPortDesc;
TDDVideoPortDesc = packed record
dwSize: DWORD; // size of the TDDVideoPortDesc structure
PDDVideoportDesc = ^TDDVideoportDesc;
TDDVideoportDesc = record
dwSize: DWORD; // size of the TDDVideoportDesc structure
dwFieldWidth: DWORD; // width of the video port field
dwVBIWidth: DWORD; // width of the VBI data
dwFieldHeight: DWORD; // height of the video port field
5012,16 → 2252,18
dwMaxPixelsPerSecond: DWORD; // Maximum pixel rate per second
dwVideoPortID: DWORD; // Video port ID (0 - (dwMaxVideoPorts -1))
dwReserved1: DWORD; // Reserved for future use - set to zero
VideoPortType: TDDVideoPortConnect; // Description of video port connection
VideoPortType: TDDVideoportConnect; // Description of video port connection
dwReserved2: DWORD; // Reserved for future use - set to zero
dwReserved3: DWORD; // Reserved for future use - set to zero
end;
 
(*
* TDDVideoPortInfo
*)
PDDVideoPortInfo = ^TDDVideoPortInfo;
TDDVideoPortInfo = packed record
DDVIDEOPORTDESC = TDDVideoportDesc;
LPDDVIDEOPORTDESC = PDDVideoportDesc;
 
{ TDDVideoportInfo structure }
 
PDDVideoportInfo = ^TDDVideoportInfo;
TDDVideoportInfo = record
dwSize: DWORD; // Size of the structure
dwOriginX: DWORD; // Placement of the video data within the surface.
dwOriginY: DWORD; // Placement of the video data within the surface.
5037,11 → 2279,13
dwReserved2: DWORD; // Reserved for future use - set to zero
end;
 
(*
* TDDVideoPortBandWidth
*)
PDDVideoPortBandWidth = ^TDDVideoPortBandWidth;
TDDVideoPortBandWidth = packed record
DDVIDEOPORTINFO = TDDVideoportInfo;
LPDDVIDEOPORTINFO = PDDVideoportInfo;
 
{ TDDVideoportBandWidth structure }
 
PDDVideoportBandWidth = ^TDDVideoportBandWidth;
TDDVideoportBandWidth = record
dwSize: DWORD; // Size of the structure
dwCaps: DWORD;
dwOverlay: DWORD; // Zoom factor at which overlay is supported
5052,669 → 2296,226
dwReserved2: DWORD; // Reserved for future use - set to zero
end;
 
(*
* TDDVideoPortStatus
*)
PDDVideoPortStatus = ^TDDVideoPortStatus;
TDDVideoPortStatus = record
DDVIDEOPORTBANDWIDTH = TDDVideoportBandWidth;
LPDDVIDEOPORTBANDWIDTH = PDDVideoportBandWidth;
 
{ TDDVideoportStatus structure }
 
PDDVideoportStatus = ^TDDVideoportStatus;
TDDVideoportStatus = record
dwSize: DWORD; // Size of the structure
bInUse: BOOL; // TRUE if video port is currently being used
dwFlags: DWORD; // Currently not used
dwReserved1: DWORD; // Reserved for future use
VideoPortType: TDDVideoPortConnect; // Information about the connection
VideoPortType: TDDVideoportConnect; // Information about the connection
dwReserved2: DWORD; // Reserved for future use
dwReserved3: DWORD; // Reserved for future use
end;
 
DDVIDEOPORTSTATUS = TDDVideoportStatus;
LPDDVIDEOPORTSTATUS = PDDVideoportStatus;
 
{ API's }
 
TDDEnumVideoCallback = function(const lpDDVideoPortCaps: TDDVideoportCaps;
lpContext: Pointer): HResult; stdcall;
LPDDENUMVIDEOCALLBACK = TDDEnumVideoCallback;
 
{ IDirectDrawVideoPortContainer Interface }
 
IDDVideoPortContainer = interface(IUnknown)
['{6C142760-A733-11CE-A521-0020AF0BE560}']
// IDDVideoPortContainer methods
function CreateVideoPort(dwFlags: DWORD; const lpDDVideoPortDesc:
TDDVideoportDesc; out lplpDDVideoPort: IDirectDrawVideoPort;
pUnkOuter: IUnknown): HResult; stdcall;
function EnumVideoPorts(dwFlags: DWORD;
const lpDDVideoPortCaps: TDDVideoportCaps; lpContext: Pointer;
lpEnumVideoCallback: TDDEnumVideoCallback): HResult; stdcall;
function GetVideoPortConnectInfo(dwPortId: DWORD; var lpNumEntries: DWORD;
var lpConnectInfo: TDDVideoportConnect): HResult; stdcall;
function QueryVideoPortStatus(dwPortId: DWORD;
var lpVPStatus: TDDVideoportStatus): HResult; stdcall;
end;
 
{ IDirectDrawVideoPort Interface }
 
IDirectDrawVideoPort = interface(IUnknown)
['{B36D93E0-2B43-11CF-A2DE-00AA00B93356}']
// IDirectDrawVideoPort methods
function Flip(lpDDSurface: IDirectDrawSurface; dwFlags: DWORD): HResult; stdcall;
function GetBandwidthInfo(const lpddpfFormat: TDDPixelFormat; dwWidth: DWORD;
dwHeight: DWORD; dwFlags: DWORD; var lpBandwidth: TDDVideoportBandWidth): HResult; stdcall;
function GetColorControls(var lpColorControl: TDDColorControl): HResult; stdcall;
function GetInputFormats(var lpNumFormats: DWORD; var lpFormats:
TDDPixelFormat; dwFlags: DWORD): HResult; stdcall;
function GetOutputFormats(const lpInputFormat: TDDPixelFormat;
var lpNumFormats: DWORD; var lpFormats: TDDPixelFormat; dwFlags: DWORD): HResult; stdcall;
function GetFieldPolarity(var lpbVideoField: BOOL): HResult; stdcall;
function GetVideoLine(var lpdwLine: DWORD): HResult; stdcall;
function GetVideoSignalStatus(varlpdwStatus: DWORD): HResult; stdcall;
function SetColorControls(const lpColorControl: TDDColorControl): HResult; stdcall;
function SetTargetSurface(lpDDSurface: IDirectDrawSurface; dwFlags: DWORD): HResult; stdcall;
function StartVideo(const lpVideoInfo: TDDVideoportInfo): HResult; stdcall;
function StopVideo: HResult; stdcall;
function UpdateVideo(const lpVideoInfo: TDDVideoportInfo): HResult; stdcall;
function WaitForSync(dwFlags: DWORD; dwLine: DWORD; dwTimeout: DWORD): HResult; stdcall;
end;
 
 
const
(*============================================================================
*
* Video Port Flags
*
* All flags are bit flags.
*
*==========================================================================*)
{ Video Port Flags }
 
(****************************************************************************
*
* VIDEOPORT TDDVideoPortConnect FLAGS
*
****************************************************************************)
DDVPD_WIDTH = $00000001;
DDVPD_HEIGHT = $00000002;
DDVPD_ID = $00000004;
DDVPD_CAPS = $00000008;
DDVPD_FX = $00000010;
DDVPD_AUTOFLIP = $00000020;
DDVPD_ALIGN = $00000040;
DDVPD_PREFERREDAUTOFLIP = $00000080;
DDVPD_FILTERQUALITY = $00000100;
 
(*
* When this is set by the driver and passed to the client, this
* indicates that the video port is capable of double clocking the data.
* When this is set by the client, this indicates that the video port
* should enable double clocking. This flag is only valid with external
* syncs.
*)
{ TDDVideoportConnect flags }
 
DDVPCONNECT_DOUBLECLOCK = $00000001;
 
(*
* When this is set by the driver and passed to the client, this
* indicates that the video port is capable of using an external VACT
* signal. When this is set by the client, this indicates that the
* video port should use the external VACT signal.
*)
DDVPCONNECT_VACT = $00000002;
 
(*
* When this is set by the driver and passed to the client, this
* indicates that the video port is capable of treating even fields
* like odd fields and visa versa. When this is set by the client,
* this indicates that the video port should treat even fields like odd
* fields.
*)
DDVPCONNECT_INVERTPOLARITY = $00000004;
 
(*
* Indicates that any data written to the video port during the VREF
* period will not be written into the frame buffer. This flag is read only.
*)
DDVPCONNECT_DISCARDSVREFDATA = $00000008;
 
(*
* When this is set be the driver and passed to the client, this
* indicates that the device will write half lines into the frame buffer
* if half lines are provided by the decoder. If this is set by the client,
* this indicates that the decoder will be supplying half lines.
*)
DDVPCONNECT_HALFLINE = $00000010;
 
(*
* Indicates that the signal is interlaced. This flag is only
* set by the client.
*)
DDVPCONNECT_INTERLACED = $00000020;
 
(*
* Indicates that video port is shareable and that this video port
* will use the even fields. This flag is only set by the client.
*)
DDVPCONNECT_SHAREEVEN = $00000040;
 
(*
* Indicates that video port is shareable and that this video port
* will use the odd fields. This flag is only set by the client.
*)
DDVPCONNECT_SHAREODD = $00000080;
 
(****************************************************************************
*
* VIDEOPORT TDDVideoPortDesc CAPS
*
****************************************************************************)
{ TDDVideoportDesc caps }
 
(*
* Flip can be performed automatically to avoid tearing.
*)
DDVPCAPS_AUTOFLIP = $00000001;
 
(*
* Supports interlaced video
*)
DDVPCAPS_INTERLACED = $00000002;
 
(*
* Supports non-interlaced video
*)
DDVPCAPS_NONINTERLACED = $00000004;
 
(*
* Indicates that the device can return whether the current field
* of an interlaced signal is even or odd.
*)
DDVPCAPS_READBACKFIELD = $00000008;
 
(*
* Indicates that the device can return the current line of video
* being written into the frame buffer.
*)
DDVPCAPS_READBACKLINE = $00000010;
 
(*
* Allows two gen-locked video streams to share a single video port,
* where one stream uses the even fields and the other uses the odd
* fields. Separate parameters (including address, scaling,
* cropping, etc.) are maintained for both fields.)
*)
DDVPCAPS_SHAREABLE = $00000020;
 
(*
* Even fields of video can be automatically discarded.
*)
DDVPCAPS_SKIPEVENFIELDS = $00000040;
 
(*
* Odd fields of video can be automatically discarded.
*)
DDVPCAPS_SKIPODDFIELDS = $00000080;
 
(*
* Indicates that the device is capable of driving the graphics
* VSYNC with the video port VSYNC.
*)
DDVPCAPS_SYNCMASTER = $00000100;
 
(*
* Indicates that data within the vertical blanking interval can
* be written to a different surface.
*)
DDVPCAPS_VBISURFACE = $00000200;
 
(*
* Indicates that the video port can perform color operations
* on the incoming data before it is written to the frame buffer.
*)
DDVPCAPS_COLORCONTROL = $00000400;
 
(*
* Indicates that the video port can accept VBI data in a different
* width or format than the regular video data.
*)
DDVPCAPS_OVERSAMPLEDVBI = $00000800;
 
(*
* Indicates that the video port can write data directly to system memory
*)
DDVPCAPS_SYSTEMMEMORY = $00001000;
 
(*
* Indicates that the VBI and video portions of the video stream can
* be controlled by an independent processes.
*)
DDVPCAPS_VBIANDVIDEOINDEPENDENT = $00002000;
 
(*
* Indicates that the video port contains high quality hardware
* de-interlacing hardware that should be used instead of the
* bob/weave algorithms.
*)
DDVPCAPS_HARDWAREDEINTERLACE = $00004000;
 
(****************************************************************************
*
* VIDEOPORT TDDVideoPortDesc FX
*
****************************************************************************)
{ TDDVideoportDesc FX }
 
(*
* Limited cropping is available to crop out the vertical interval data.
*)
DDVPFX_CROPTOPDATA = $00000001;
 
(*
* Incoming data can be cropped in the X direction before it is written
* to the surface.
*)
DDVPFX_CROPX = $00000002;
 
(*
* Incoming data can be cropped in the Y direction before it is written
* to the surface.
*)
DDVPFX_CROPY = $00000004;
 
(*
* Supports interleaving interlaced fields in memory.
*)
DDVPFX_INTERLEAVE = $00000008;
 
(*
* Supports mirroring left to right as the video data is written
* into the frame buffer.
*)
DDVPFX_MIRRORLEFTRIGHT = $00000010;
 
(*
* Supports mirroring top to bottom as the video data is written
* into the frame buffer.
*)
DDVPFX_MIRRORUPDOWN = $00000020;
 
(*
* Data can be arbitrarily shrunk in the X direction before it
* is written to the surface.
*)
DDVPFX_PRESHRINKX = $00000040;
 
(*
* Data can be arbitrarily shrunk in the Y direction before it
* is written to the surface.
*)
DDVPFX_PRESHRINKY = $00000080;
 
(*
* Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the X
* direction before it is written to the surface.
*)
DDVPFX_PRESHRINKXB = $00000100;
 
(*
* Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the Y
* direction before it is written to the surface.
*)
DDVPFX_PRESHRINKYB = $00000200;
 
(*
* Data can be shrunk in increments of 1/x in the X direction
* (where X is specified in the TDDVideoPortCaps.dwPreshrinkXStep)
* before it is written to the surface.
*)
DDVPFX_PRESHRINKXS = $00000400;
 
(*
* Data can be shrunk in increments of 1/x in the Y direction
* (where X is specified in the TDDVideoPortCaps.dwPreshrinkYStep)
* before it is written to the surface.
*)
DDVPFX_PRESHRINKYS = $00000800;
 
(*
* Data can be arbitrarily stretched in the X direction before
* it is written to the surface.
*)
DDVPFX_PRESTRETCHX = $00001000;
 
(*
* Data can be arbitrarily stretched in the Y direction before
* it is written to the surface.
*)
DDVPFX_PRESTRETCHY = $00002000;
 
(*
* Data can be integer stretched in the X direction before it is
* written to the surface.
*)
DDVPFX_PRESTRETCHXN = $00004000;
 
(*
* Data can be integer stretched in the Y direction before it is
* written to the surface.
*)
DDVPFX_PRESTRETCHYN = $00008000;
 
(*
* Indicates that data within the vertical blanking interval can
* be converted independently of the remaining video data.
*)
DDVPFX_VBICONVERT = $00010000;
 
(*
* Indicates that scaling can be disabled for data within the
* vertical blanking interval.
*)
DDVPFX_VBINOSCALE = $00020000;
 
(*
* Indicates that the video data can ignore the left and right
* cropping coordinates when cropping oversampled VBI data.
*)
DDVPFX_IGNOREVBIXCROP = $00040000;
 
(*
* Indicates that interleaving can be disabled for data within the
* vertical blanking interval.
*)
DDVPFX_VBINOINTERLEAVE = $00080000;
 
(****************************************************************************
*
* VIDEOPORT TDDVideoPortInfo FLAGS
*
****************************************************************************)
{ TDDVideoportInfo flags }
 
(*
* Perform automatic flipping. Auto-flipping is performed between
* the overlay surface that was attached to the video port using
* IDirectDrawVideoPort::AttachSurface and the overlay surfaces that
* are attached to the surface via the IDirectDrawSurface::AttachSurface
* method. The flip order is the order in which the overlay surfaces
* were. attached.
*)
DDVP_AUTOFLIP = $00000001;
 
(*
* Perform conversion using the ddpfOutputFormat information.
*)
DDVP_CONVERT = $00000002;
 
(*
* Perform cropping using the specified rectangle.
*)
DDVP_CROP = $00000004;
 
(*
* Indicates that interlaced fields should be interleaved in memory.
*)
DDVP_INTERLEAVE = $00000008;
 
(*
* Indicates that the data should be mirrored left to right as it's
* written into the frame buffer.
*)
DDVP_MIRRORLEFTRIGHT = $00000010;
 
(*
* Indicates that the data should be mirrored top to bottom as it's
* written into the frame buffer.
*)
DDVP_MIRRORUPDOWN = $00000020;
 
(*
* Perform pre-scaling/zooming based on the pre-scale parameters.
*)
DDVP_PRESCALE = $00000040;
 
(*
* Ignore input of even fields.
*)
DDVP_SKIPEVENFIELDS = $00000080;
 
(*
* Ignore input of odd fields.
*)
DDVP_SKIPODDFIELDS = $00000100;
 
(*
* Drive the graphics VSYNCs using the video port VYSNCs.
*)
DDVP_SYNCMASTER = $00000200;
 
(*
* The ddpfVBIOutputFormatFormat member contains data that should be used
* to convert the data within the vertical blanking interval.
*)
DDVP_VBICONVERT = $00000400;
 
(*
* Indicates that data within the vertical blanking interval
* should not be scaled.
*)
DDVP_VBINOSCALE = $00000800;
 
(*
* Indicates that these bob/weave decisions should not be
* overriden by other interfaces.
*)
DDVP_OVERRIDEBOBWEAVE = $00001000;
 
(*
* Indicates that the video data should ignore the left and right
* cropping coordinates when cropping the VBI data.
*)
DDVP_IGNOREVBIXCROP = $00002000;
 
(*
* Indicates that interleaving can be disabled for data within the
* vertical blanking interval.
*)
DDVP_VBINOINTERLEAVE = $00004000;
 
(*
* Indicates that the video port should use the hardware
* de-interlacing hardware.
*)
DDVP_HARDWAREDEINTERLACE = $00008000;
 
(****************************************************************************
*
* DIRIRECTDRAWVIDEOPORT GETINPUTFORMAT/GETOUTPUTFORMAT FLAGS
*
****************************************************************************)
{ DirectDrawVideoport GetInputFormat/GetOutputFormat flags }
 
(*
* Return formats for the video data
*)
DDVPFORMAT_VIDEO = $00000001;
 
(*
* Return formats for the VBI data
*)
DDVPFORMAT_VBI = $00000002;
 
(****************************************************************************
*
* DIRIRECTDRAWVIDEOPORT SETTARGETSURFACE FLAGS
*
****************************************************************************)
{ DirectDrawVideoport SetTargetSurface flags }
 
(*
* Surface should receive video data (and VBI data if a surface
* is not explicitly attached for that purpose)
*)
DDVPTARGET_VIDEO = $00000001;
 
(*
* Surface should receive VBI data
*)
DDVPTARGET_VBI = $00000002;
 
(****************************************************************************
*
* DIRIRECTDRAWVIDEOPORT WAITFORSYNC FLAGS
*
****************************************************************************)
{ DirectDrawVideoport WaitForSync flags }
 
(*
* Waits until the beginning of the next VSYNC
*)
DDVPWAIT_BEGIN = $00000001;
 
(*
* Waits until the end of the next/current VSYNC
*)
DDVPWAIT_END = $00000002;
 
(*
* Waits until the beginning of the specified line
*)
DDVPWAIT_LINE = $00000003;
 
(****************************************************************************
*
* DIRECTDRAWVIDEOPORT FLIP FLAGS
*
****************************************************************************)
{ DirectDrawVideoport flip flags }
 
(*
* Flips the normal video surface
*)
DDVPFLIP_VIDEO = $00000001;
 
(*
* Flips the VBI surface
*)
DDVPFLIP_VBI = $00000002;
 
(****************************************************************************
*
* DIRIRECTDRAWVIDEOPORT GETVIDEOSIGNALSTATUS VALUES
*
****************************************************************************)
{ DirectDrawVideoport GetVideoSiginalStatus values }
 
(*
* No video signal is present at the video port
*)
DDVPSQ_NOSIGNAL = $00000001;
 
(*
* A valid video signal is present at the video port
*)
DDVPSQ_SIGNALOK = $00000002;
 
(****************************************************************************
*
* VIDEOPORTBANDWIDTH Flags
*
****************************************************************************)
{ TDDVideoportBandWidth Flags }
 
(*
* The specified height/width refer to the size of the video port data
* written into memory, after prescaling has occured.
*)
DDVPB_VIDEOPORT = $00000001;
 
(*
* The specified height/width refer to the source size of the overlay.
*)
DDVPB_OVERLAY = $00000002;
 
(*
* This is a query for the device to return which caps this device requires.
*)
DDVPB_TYPE = $00000004;
 
(****************************************************************************
*
* VIDEOPORTBANDWIDTH Caps
*
****************************************************************************)
{ TDDVideoportBandWidth Caps }
 
(*
* The bandwidth for this device is dependant on the overlay source size.
*)
DDVPBCAPS_SOURCE = $00000001;
 
(*
* The bandwidth for this device is dependant on the overlay destination
* size.
*)
DDVPBCAPS_DESTINATION = $00000002;
 
(****************************************************************************
*
* DDVIDEOPORTCONTAINER CreateVideoPort flags
*
****************************************************************************)
{ IDDVideoportContainer.CreateVideoPort flags }
 
(*
* The process only wants to control the VBI portion of the video stream.
*)
DDVPCREATE_VBIONLY = $00000001;
 
(*
* The process only wants to control the non-VBI (video) portion of
* the video stream.
*)
DDVPCREATE_VIDEOONLY = $00000002;
 
(****************************************************************************
*
* DDVIDEOPORTSTATUS flags
*
****************************************************************************)
{ TDDVideoportStatus flags }
 
(*
* The video port interface is only controlling the VBI portion of the
* video stream
*)
DDVPSTATUS_VBIONLY = $00000001;
 
(*
* The video port interface is only controlling the video portion of the
* video stream
*)
DDVPSTATUS_VIDEOONLY = $00000002;
 
 
type
(*
* API's
*)
 
TDDEnumVideoCallback = function (lpTDDVideoPortCaps: PDDVideoPortCaps;
lpContext: Pointer) : HResult; stdcall;
 
(*
* INTERACES FOLLOW:
* IDirectDrawVideoPort
* IVideoPort
*)
 
 
(*
* IDirectDrawVideoPort
*)
IDirectDrawVideoPort = interface (IUnknown)
['{B36D93E0-2B43-11CF-A2DE-00AA00B93356}']
(*** IDirectDrawVideoPort methods ***)
function Flip(lpDDSurface: IDirectDrawSurface; dwFlags: DWORD) : HResult; stdcall;
function GetBandwidthInfo(var lpddpfFormat: TDDPixelFormat;
dwWidth: DWORD; dwHeight: DWORD; dwFlags: DWORD;
var lpBandwidth: TDDVideoPortBandWidth) : HResult; stdcall;
function GetColorControls(var lpColorControl: TDDColorControl) : HResult; stdcall;
function GetInputFormats(var lpNumFormats: DWORD; var lpFormats:
TDDPixelFormat; dwFlags: DWORD) : HResult; stdcall;
function GetOutputFormats(var lpInputFormat: TDDPixelFormat;
var lpNumFormats: DWORD; lpFormats: PDDPixelFormat; dwFlags: DWORD)
: HResult; stdcall;
function GetFieldPolarity(var lpbVideoField: BOOL) : HResult; stdcall;
function GetVideoLine(var lpdwLine: DWORD) : HResult; stdcall;
function GetVideoSignalStatus(varlpdwStatus: DWORD) : HResult; stdcall;
function SetColorControls(var lpColorControl: TDDColorControl) : HResult; stdcall;
function SetTargetSurface(lpDDSurface: IDirectDrawSurface; dwFlags: DWORD) :
HResult; stdcall;
function StartVideo(var lpVideoInfo: TDDVideoPortInfo) : HResult; stdcall;
function StopVideo: HResult; stdcall;
function UpdateVideo(var lpVideoInfo: TDDVideoPortInfo) : HResult; stdcall;
function WaitForSync(dwFlags: DWORD; dwLine: DWORD; dwTimeout: DWORD) :
HResult; stdcall;
end;
 
(*
* IDirectDrawVideoPortContainer
*)
IDDVideoPortContainer = interface (IUnknown)
['{6C142760-A733-11CE-A521-0020AF0BE560}']
(*** IDDVideoPortContainer methods ***)
function CreateVideoPort(dwFlags: DWORD; var lpTDDVideoPortDesc:
TDDVideoPortDesc; var lplpDDVideoPort: IDirectDrawVideoPort;
pUnkOuter: IUnknown) : HResult; stdcall;
function EnumVideoPorts(dwFlags: DWORD;
lpTDDVideoPortCaps: PDDVideoPortCaps; lpContext: Pointer;
lpEnumVideoCallback: TDDEnumVideoCallback) : HResult; stdcall;
function GetVideoPortConnectInfo(dwPortId: DWORD; var lpNumEntries: DWORD;
lpConnectInfo: PDDVideoPortConnect) : HResult; stdcall;
function QueryVideoPortStatus(dwPortId: DWORD;
var lpVPStatus: TDDVideoPortStatus) : HResult; stdcall;
end;
 
IID_IDDVideoPortContainer = IDDVideoPortContainer;
IID_IDirectDrawVideoPort = IDirectDrawVideoPort;
 
 
//Direct3D file
(*==========================================================================;
*
* Copyright (C) 1995-1998 Microsoft Corporation. All Rights Reserved.
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
*
* Files: d3dtypes.h d3dcaps.h d3d.h
* File: d3dtypes.h
* Content: Direct3D types include file
*
* DirectX 7.0 Delphi adaptation by Erik Unger
*
* Modyfied: 26-Jun-2000
*
* Download: http://www.delphi-jedi.org/DelphiGraphics/
* E-Mail: DelphiDirectX@next-reality.com
*
***************************************************************************)
 
(* TD3DValue is the fundamental Direct3D fractional data type *)
 
type
TRefClsID = TGUID;
TD3DValue = Single;
D3DValue = TD3DValue;
 
type
TD3DValue = Single;
TD3DFixed = LongInt;
float = TD3DValue;
PD3DColor = ^TD3DColor;
TD3DFixed = Longint;
D3DFIXED = TD3DFixed;
 
TD3DColor = DWORD;
D3DCOLOR = TD3DColor;
 
function D3DVal(val: variant) : float;
function D3DDivide(a,b: double) : float;
function D3DMultiply(a,b: double) : float;
function D3DVALP(val: TD3DValue; prec: Integer): TD3DValue;
function D3DVAL(val: TD3DValue): TD3DValue;
function D3DDivide(a, b: TD3DValue): TD3DValue;
function D3DMultiply(a, b: TD3DValue): TD3DValue;
 
(*
* Format of CI colors is
5723,24 → 2524,13
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*)
 
// #define CI_GETALPHA(ci) ((ci) >> 24)
function CI_GETALPHA(ci: DWORD) : DWORD;
function CI_GETALPHA(ci: Integer): Byte;
function CI_GETINDEX(ci: Integer): Word;
function CI_GETFRACTION(ci: Integer): Byte;
function CI_ROUNDINDEX(ci: Integer): Integer;
function CI_MASKALPHA(ci: Integer): Integer;
function CI_MAKE(a: Byte; i: Word; f: Byte): Integer;
 
// #define CI_GETINDEX(ci) (((ci) >> 8) & 0xffff)
function CI_GETINDEX(ci: DWORD) : DWORD;
 
// #define CI_GETFRACTION(ci) ((ci) & 0xff)
function CI_GETFRACTION(ci: DWORD) : DWORD;
 
// #define CI_ROUNDINDEX(ci) CI_GETINDEX((ci) + 0x80)
function CI_ROUNDINDEX(ci: DWORD) : DWORD;
 
// #define CI_MASKALPHA(ci) ((ci) & 0xffffff)
function CI_MASKALPHA(ci: DWORD) : DWORD;
 
// #define CI_MAKE(a, i, f) (((a) << 24) | ((i) << 8) | (f))
function CI_MAKE(a,i,f: DWORD) : DWORD;
 
(*
* Format of RGBA colors is
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
5748,35 → 2538,19
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*)
 
// #define RGBA_GETALPHA(rgb) ((rgb) >> 24)
function RGBA_GETALPHA(rgb: TD3DColor) : DWORD;
function RGBA_GETALPHA(rgb: TD3DColor): Byte;
function RGBA_GETRED(rgb: TD3DColor): Byte;
function RGBA_GETGREEN(rgb: TD3DColor): Byte;
function RGBA_GETBLUE(rgb: TD3DColor): Byte;
function RGBA_MAKE(r, g, b, a: Byte): TD3DColor;
 
// #define RGBA_GETRED(rgb) (((rgb) >> 16) & 0xff)
function RGBA_GETRED(rgb: TD3DColor) : DWORD;
 
// #define RGBA_GETGREEN(rgb) (((rgb) >> 8) & 0xff)
function RGBA_GETGREEN(rgb: TD3DColor) : DWORD;
 
// #define RGBA_GETBLUE(rgb) ((rgb) & 0xff)
function RGBA_GETBLUE(rgb: TD3DColor) : DWORD;
 
// #define RGBA_MAKE(r, g, b, a) ((TD3DColor) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)))
function RGBA_MAKE(r, g, b, a: DWORD) : TD3DColor;
 
(* D3DRGB and D3DRGBA may be used as initialisers for D3DCOLORs
* The float values must be in the range 0..1
*)
 
// #define D3DRGB(r, g, b) \
// (0xff000000L | (((long)((r) * 255)) << 16) | (((long)((g) * 255)) << 8) | (long)((b) * 255))
function D3DRGB(r, g, b: float) : TD3DColor;
function D3DRGB(r, g, b: TD3DValue): TD3DColor;
function D3DRGBA(r, g, b, a: TD3DValue): TD3DColor;
 
// #define D3DRGBA(r, g, b, a) \
// ( (((long)((a) * 255)) << 24) | (((long)((r) * 255)) << 16) \
// | (((long)((g) * 255)) << 8) | (long)((b) * 255) \
// )
function D3DRGBA(r, g, b, a: float) : TD3DColor;
 
(*
* Format of RGB colors is
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
5784,64 → 2558,44
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*)
 
// #define RGB_GETRED(rgb) (((rgb) >> 16) & 0xff)
function RGB_GETRED(rgb: TD3DColor) : DWORD;
 
// #define RGB_GETGREEN(rgb) (((rgb) >> 8) & 0xff)
function RGB_GETGREEN(rgb: TD3DColor) : DWORD;
 
// #define RGB_GETBLUE(rgb) ((rgb) & 0xff)
function RGB_GETBLUE(rgb: TD3DColor) : DWORD;
 
// #define RGBA_SETALPHA(rgba, x) (((x) << 24) | ((rgba) & 0x00ffffff))
function RGBA_SETALPHA(rgba: TD3DColor; x: DWORD) : TD3DColor;
 
// #define RGB_MAKE(r, g, b) ((TD3DColor) (((r) << 16) | ((g) << 8) | (b)))
function RGB_MAKE(r, g, b: DWORD) : TD3DColor;
 
// #define RGBA_TORGB(rgba) ((TD3DColor) ((rgba) & 0xffffff))
function RGB_GETRED(rgb: TD3DColor): Byte;
function RGB_GETGREEN(rgb: TD3DColor): Byte;
function RGB_GETBLUE(rgb: TD3DColor): Byte;
function RGBA_SETALPHA(rgba: TD3DColor; x: Byte): TD3DColor;
function RGB_MAKE(r, g, b: Byte): TD3DColor;
function RGBA_TORGB(rgba: TD3DColor) : TD3DColor;
 
// #define RGB_TORGBA(rgb) ((TD3DColor) ((rgb) | 0xff000000))
function RGB_TORGBA(rgb: TD3DColor) : TD3DColor;
 
(*
* Flags for Enumerate functions
*)
const
{ Flags for Enumerate functions }
 
(*
* Stop the enumeration
*)
 
D3DENUMRET_CANCEL = DDENUMRET_CANCEL;
 
(*
* Continue the enumeration
*)
 
D3DENUMRET_OK = DDENUMRET_OK;
 
type
TD3DValidateCallback = function (lpUserArg: Pointer;
dwOffset: DWORD): HResult; stdcall;
TD3DEnumTextureFormatsCallback = function (var lpDdsd: TDDSurfaceDesc;
TD3DValidateCallback = function(lpUserArg: Pointer; dwOffset: DWORD): HResult; stdcall;
LPD3DVALIDATECALLBACK = TD3DValidateCallback;
 
TD3DEnumTextureFormatsCalback = function(const lpDdsd: TDDSurfaceDesc;
lpContext: Pointer): HResult; stdcall;
TD3DEnumPixelFormatsCallback = function (var lpDDPixFmt: TDDPixelFormat;
LPD3DENUMTEXTUREFORMATSCALLBACK = TD3DEnumTextureFormatsCalback;
 
TD3DEnumPixelFormatsCallback = function(const lpDDPixFmt: TDDPixelFormat;
lpContext: Pointer): HResult; stdcall;
 
 
PD3DMaterialHandle = ^TD3DMaterialHandle;
TD3DMaterialHandle = DWORD;
D3DMATERIALHANDLE = TD3DMaterialHandle;
 
PD3DTextureHandle = ^TD3DTextureHandle;
TD3DTextureHandle = DWORD;
D3DTEXTUREHANDLE = TD3DTextureHandle;
 
PD3DMatrixHandle = ^TD3DMatrixHandle;
TD3DMatrixHandle = DWORD;
D3DMATRIXHANDLE = TD3DMatrixHandle;
 
{ TD3DColorValue structure }
 
PD3DColorValue = ^TD3DColorValue;
TD3DColorValue = packed record
TD3DColorValue = record
case Integer of
0: (
r: TD3DValue;
5857,28 → 2611,34
);
end;
 
D3DCOLORVALUE = TD3DColorValue;
 
{ TD3DRect structure }
 
PD3DRect = ^TD3DRect;
TD3DRect = packed record
TD3DRect = record
case Integer of
0: (
x1: LongInt;
y1: LongInt;
x2: LongInt;
y2: LongInt;
x1: Longint;
y1: Longint;
x2: Longint;
y2: Longint;
);
1: (
lX1: LongInt;
lY1: LongInt;
lX2: LongInt;
lY2: LongInt;
lX1: Longint;
lY1: Longint;
lX2: Longint;
lY2: Longint;
);
2: (
a: array[0..3] of LongInt;
);
end;
 
D3DRECT = TD3DRect;
LPD3DRECT = PD3DRect;
 
{ TD3DVector structure }
 
PD3DVector = ^TD3DVector;
TD3DVector = packed record
TD3DVector = record
case Integer of
0: (
x: TD3DValue;
5892,25 → 2652,18
);
end;
 
(******************************************************************
* *
* D3DVec.inl *
* *
* Float-valued 3D vector class for Direct3D. *
* *
* Copyright (c) 1996-1998 Microsoft Corp. All rights reserved. *
* *
******************************************************************)
D3DVECTOR = TD3DVector;
LPD3DVECTOR = PD3DVector;
 
// Addition and subtraction
function VectorAdd(const v1, v2: TD3DVector) : TD3DVector;
function VectorSub(const v1, v2: TD3DVector) : TD3DVector;
function VectorAdd(v1, v2: TD3DVector) : TD3DVector;
function VectorSub(v1, v2: TD3DVector) : TD3DVector;
// Scalar multiplication and division
function VectorMulS(const v: TD3DVector; s: TD3DValue) : TD3DVector;
function VectorDivS(const v: TD3DVector; s: TD3DValue) : TD3DVector;
function VectorMulS(v: TD3DVector; s: TD3DValue) : TD3DVector;
function VectorDivS(v: TD3DVector; s: TD3DValue) : TD3DVector;
// Memberwise multiplication and division
function VectorMul(const v1, v2: TD3DVector) : TD3DVector;
function VectorDiv(const v1, v2: TD3DVector) : TD3DVector;
function VectorMul(v1, v2: TD3DVector) : TD3DVector;
function VectorDiv(v1, v2: TD3DVector) : TD3DVector;
// Vector dominance
function VectorSmaller(v1, v2: TD3DVector) : boolean;
function VectorSmallerEquel(v1, v2: TD3DVector) : boolean;
5920,29 → 2673,25
function VectorSquareMagnitude(v: TD3DVector) : TD3DValue;
function VectorMagnitude(v: TD3DVector) : TD3DValue;
// Returns vector with same direction and unit length
function VectorNormalize(const v: TD3DVector) : TD3DVector;
function VectorNormalize(v: TD3DVector) : TD3DVector;
// Return min/max component of the input vector
function VectorMin(v: TD3DVector) : TD3DValue;
function VectorMax(v: TD3DVector) : TD3DValue;
// Return memberwise min/max of input vectors
function VectorMinimize(const v1, v2: TD3DVector) : TD3DVector;
function VectorMaximize(const v1, v2: TD3DVector) : TD3DVector;
function VectorMinimize(v1, v2: TD3DVector) : TD3DVector;
function VectorMaximize(v1, v2: TD3DVector) : TD3DVector;
// Dot and cross product
function VectorDotProduct(v1, v2: TD3DVector) : TD3DValue;
function VectorCrossProduct(const v1, v2: TD3DVector) : TD3DVector;
function VectorCrossProduct(v1, v2: TD3DVector) : TD3DVector;
 
type
(*
* Vertex data types supported in an ExecuteBuffer.
*)
{ Vertex data types supported in an ExecuteBuffer. }
 
(*
* Homogeneous vertices
*)
{ TD3DHVertex structure }
 
PD3DHVertex = ^TD3DHVertex;
TD3DHVertex = packed record
dwFlags: DWORD; (* Homogeneous clipping flags *)
TD3DHVertex = record
dwFlags: DWORD; // Homogeneous clipping flags
case Integer of
0: (
hx: TD3DValue;
5956,21 → 2705,21
);
end;
 
(*
* Transformed/lit vertices
*)
D3DHVERTEX = TD3DHVertex;
 
{ TD3DTLVertex structure }
 
PD3DTLVertex = ^TD3DTLVertex;
TD3DTLVertex = packed record
TD3DTLVertex = record
case Integer of
0: (
sx: TD3DValue; (* Screen coordinates *)
sx: TD3DValue; // Screen coordinates
sy: TD3DValue;
sz: TD3DValue;
rhw: TD3DValue; (* Reciprocal of homogeneous w *)
color: TD3DColor; (* Vertex color *)
specular: TD3DColor; (* Specular component of vertex *)
tu: TD3DValue; (* Texture coordinates *)
rhw: TD3DValue; // Reciprocal of homogeneous w
color: TD3DColor; // Vertex color
specular: TD3DColor; // Specular component of vertex
tu: TD3DValue; // Texture coordinates
tv: TD3DValue;
);
1: (
5985,21 → 2734,21
);
end;
 
(*
* Untransformed/lit vertices
*)
D3DTLVERTEX = TD3DTLVertex;
 
{ TD3DLVertex structure }
 
PD3DLVertex = ^TD3DLVertex;
TD3DLVertex = packed record
TD3DLVertex = record
case Integer of
0: (
x: TD3DValue; (* Homogeneous coordinates *)
x: TD3DValue; // Homogeneous coordinates
y: TD3DValue;
z: TD3DValue;
dwReserved: DWORD;
color: TD3DColor; (* Vertex color *)
specular: TD3DColor; (* Specular component of vertex *)
tu: TD3DValue; (* Texture coordinates *)
color: TD3DColor; // Vertex color
specular: TD3DColor; // Specular component of vertex
tu: TD3DValue; // Texture coordinates
tv: TD3DValue;
);
1: (
6006,7 → 2755,7
dvX: TD3DValue;
dvY: TD3DValue;
dvZ: TD3DValue;
UNIONFILLER1d: DWORD;
_union1d: DWORD;
dcColor: TD3DColor;
dcSpecular: TD3DColor;
dvTU: TD3DValue;
6014,21 → 2763,21
);
end;
 
(*
* Untransformed/unlit vertices
*)
D3DLVERTEX = TD3DLVertex;
 
{ TD3DVertex structure }
 
PD3DVertex = ^TD3DVertex;
TD3DVertex = packed record
TD3DVertex = record
case Integer of
0: (
x: TD3DValue; (* Homogeneous coordinates *)
x: TD3DValue; // Homogeneous coordinates
y: TD3DValue;
z: TD3DValue;
nx: TD3DValue; (* Normal *)
nx: TD3DValue; // Normal
ny: TD3DValue;
nz: TD3DValue;
tu: TD3DValue; (* Texture coordinates *)
tu: TD3DValue; // Texture coordinates
tv: TD3DValue;
);
1: (
6043,78 → 2792,86
);
end;
 
(*
* Matrix, viewport, and tranformation structures and definitions.
*)
D3DVERTEX = TD3DVertex;
 
{ TD3DMatrix structure }
 
PD3DMatrix = ^TD3DMatrix;
TD3DMatrix = packed record
case integer of
0 : (_11, _12, _13, _14: TD3DValue;
TD3DMatrix = record
_11, _12, _13, _14: TD3DValue;
_21, _22, _23, _24: TD3DValue;
_31, _32, _33, _34: TD3DValue;
_41, _42, _43, _44: TD3DValue);
1 : (m : array [0..3, 0..3] of TD3DValue);
_41, _42, _43, _44: TD3DValue;
end;
 
D3DMATRIX = TD3DMatrix;
 
{ TD3DViewport structure }
 
PD3DViewport = ^TD3DViewport;
TD3DViewport = packed record
TD3DViewport = record
dwSize: DWORD;
dwX: DWORD;
dwY: DWORD; (* Top left *)
dwY: DWORD; // Top left
dwWidth: DWORD;
dwHeight: DWORD; (* Dimensions *)
dvScaleX: TD3DValue; (* Scale homogeneous to screen *)
dvScaleY: TD3DValue; (* Scale homogeneous to screen *)
dvMaxX: TD3DValue; (* Min/max homogeneous x coord *)
dvMaxY: TD3DValue; (* Min/max homogeneous y coord *)
dwHeight: DWORD; // Dimensions
dvScaleX: TD3DValue; // Scale homogeneous to screen
dvScaleY: TD3DValue; // Scale homogeneous to screen
dvMaxX: TD3DValue; // Min/max homogeneous x coord
dvMaxY: TD3DValue; // Min/max homogeneous y coord
dvMinZ: TD3DValue;
dvMaxZ: TD3DValue; (* Min/max homogeneous z coord *)
dvMaxZ: TD3DValue; // Min/max homogeneous z coord
end;
 
D3DVIEWPORT = TD3DViewport;
 
{ TD3DViewport2 structure }
 
PD3DViewport2 = ^TD3DViewport2;
TD3DViewport2 = packed record
TD3DViewport2 = record
dwSize: DWORD;
dwX: DWORD;
dwY: DWORD; (* Viewport Top left *)
dwY: DWORD; // Top left
dwWidth: DWORD;
dwHeight: DWORD; (* Viewport Dimensions *)
dvClipX: TD3DValue; (* Top left of clip volume *)
dwHeight: DWORD; // Dimensions
dvClipX: TD3DValue; // Top left of clip volume
dvClipY: TD3DValue;
dvClipWidth: TD3DValue; (* Clip Volume Dimensions *)
dvClipWidth: TD3DValue; // Clip Volume Dimensions
dvClipHeight: TD3DValue;
dvMinZ: TD3DValue; (* Min/max of clip Volume *)
dvMaxZ: TD3DValue;
dvMinZ: TD3DValue;
dvMaxZ: TD3DValue; // Min/max homogeneous z coord
end;
 
D3DVIEWPORT2 = TD3DViewport2;
 
{ TD3DViewport2 structure }
 
PD3DViewport7 = ^TD3DViewport7;
TD3DViewport7 = packed record
TD3DViewport7 = record
dwX: DWORD;
dwY: DWORD; (* Viewport Top left *)
dwY: DWORD; // Top left
dwWidth: DWORD;
dwHeight: DWORD; (* Viewport Dimensions *)
dvMinZ: TD3DValue; (* Min/max of clip Volume *)
dvMaxZ: TD3DValue;
dwHeight: DWORD; // Dimensions
dvMinZ: TD3DValue;
dvMaxZ: TD3DValue; // Min/max homogeneous z coord
end;
 
(*
* Values for clip fields.
*)
D3DVIEWPORT7 = TD3DViewport7;
 
const
// Max number of user clipping planes, supported in D3D.
{ Max number of user clipping planes, supported in D3D. }
D3DMAXUSERCLIPPLANES = 32;
 
// These bits could be ORed together to use with D3DRENDERSTATE_CLIPPLANEENABLE
//
D3DCLIPPLANE0 = (1 shl 0);
D3DCLIPPLANE1 = (1 shl 1);
D3DCLIPPLANE2 = (1 shl 2);
D3DCLIPPLANE3 = (1 shl 3);
D3DCLIPPLANE4 = (1 shl 4);
D3DCLIPPLANE5 = (1 shl 5);
{ These bits could be ORed together to use with D3DRENDERSTATE_CLIPPLANEENABLE }
D3DCLIPPLANE0 = 1 shl 0;
D3DCLIPPLANE1 = 1 shl 1;
D3DCLIPPLANE2 = 1 shl 2;
D3DCLIPPLANE3 = 1 shl 3;
D3DCLIPPLANE4 = 1 shl 4;
D3DCLIPPLANE5 = 1 shl 5;
 
const
{ Values for clip fields. }
 
D3DCLIP_LEFT = $00000001;
D3DCLIP_RIGHT = $00000002;
D3DCLIP_TOP = $00000004;
6128,9 → 2885,7
D3DCLIP_GEN4 = $00000400;
D3DCLIP_GEN5 = $00000800;
 
(*
* Values for d3d status.
*)
{ Values for d3d status. }
 
D3DSTATUS_CLIPUNIONLEFT = D3DCLIP_LEFT;
D3DSTATUS_CLIPUNIONRIGHT = D3DCLIP_RIGHT;
6158,9 → 2913,8
D3DSTATUS_CLIPINTERSECTIONGEN4 = $00400000;
D3DSTATUS_CLIPINTERSECTIONGEN5 = $00800000;
D3DSTATUS_ZNOTVISIBLE = $01000000;
(* Do not use 0x80000000 for any status flags in future as it is reserved *)
 
D3DSTATUS_CLIPUNIONALL = (
D3DSTATUS_CLIPUNIONALL =
D3DSTATUS_CLIPUNIONLEFT or
D3DSTATUS_CLIPUNIONRIGHT or
D3DSTATUS_CLIPUNIONTOP or
6172,9 → 2926,9
D3DSTATUS_CLIPUNIONGEN2 or
D3DSTATUS_CLIPUNIONGEN3 or
D3DSTATUS_CLIPUNIONGEN4 or
D3DSTATUS_CLIPUNIONGEN5);
D3DSTATUS_CLIPUNIONGEN5;
 
D3DSTATUS_CLIPINTERSECTIONALL = (
D3DSTATUS_CLIPINTERSECTIONALL =
D3DSTATUS_CLIPINTERSECTIONLEFT or
D3DSTATUS_CLIPINTERSECTIONRIGHT or
D3DSTATUS_CLIPINTERSECTIONTOP or
6186,59 → 2940,61
D3DSTATUS_CLIPINTERSECTIONGEN2 or
D3DSTATUS_CLIPINTERSECTIONGEN3 or
D3DSTATUS_CLIPINTERSECTIONGEN4 or
D3DSTATUS_CLIPINTERSECTIONGEN5);
D3DSTATUS_CLIPINTERSECTIONGEN5;
 
D3DSTATUS_DEFAULT = (
D3DSTATUS_CLIPINTERSECTIONALL or
D3DSTATUS_ZNOTVISIBLE);
 
(*
* Options for direct transform calls
*)
{ Options for direct transform calls }
 
D3DTRANSFORM_CLIPPED = $00000001;
D3DTRANSFORM_UNCLIPPED = $00000002;
 
type
{ TD3DTransformData structure }
 
PD3DTransformData = ^TD3DTransformData;
TD3DTransformData = packed record
TD3DTransformData = record
dwSize: DWORD;
lpIn: Pointer; (* Input vertices *)
dwInSize: DWORD; (* Stride of input vertices *)
lpOut: Pointer; (* Output vertices *)
dwOutSize: DWORD; (* Stride of output vertices *)
lpHOut: ^TD3DHVertex; (* Output homogeneous vertices *)
dwClip: DWORD; (* Clipping hint *)
lpIn: Pointer; // Input vertices
dwInSize: DWORD; // Stride of input vertices
lpOut: Pointer; // Output vertices
dwOutSize: DWORD; // Stride of output vertices
lpHOut: PD3DHVertex; // Output homogeneous vertices
dwClip: DWORD; // Clipping hint
dwClipIntersection: DWORD;
dwClipUnion: DWORD; (* Union of all clip flags *)
drExtent: TD3DRect; (* Extent of transformed vertices *)
dwClipUnion: DWORD; // Union of all clip flags
drExtent: TD3DRect; // Extent of transformed vertices
end;
 
(*
* Structure defining position and direction properties for lighting.
*)
D3DTRANSFORMDATA = TD3DTransformData;
LPD3DTRANSFORMDATA = PD3DTransformData;
 
{ TD3DLightingElement structure }
 
PD3DLightingElement = ^TD3DLightingElement;
TD3DLightingElement = packed record
dvPosition: TD3DVector; (* Lightable point in model space *)
dvNormal: TD3DVector; (* Normalised unit vector *)
TD3DLightingElement = record
dvPosition: TD3DVector; // Lightable point in model space
dvNormal: TD3DVector; // Normalised unit vector
end;
 
(*
* Structure defining material properties for lighting.
*)
D3DLIGHTINGELEMENT = TD3DLightingElement;
LPD3DLIGHTINGELEMENT = PD3DLightingElement;
 
{ TD3DMaterial structure }
 
PD3DMaterial = ^TD3DMaterial;
TD3DMaterial = packed record
TD3DMaterial = record
dwSize: DWORD;
case Integer of
0: (
diffuse: TD3DColorValue; (* Diffuse color RGBA *)
ambient: TD3DColorValue; (* Ambient color RGB *)
specular: TD3DColorValue; (* Specular 'shininess' *)
emissive: TD3DColorValue; (* Emissive color RGB *)
power: TD3DValue; (* Sharpness if specular highlight *)
hTexture: TD3DTextureHandle; (* Handle to texture map *)
diffuse: TD3DColorValue; // Diffuse color RGBA
ambient: TD3DColorValue; // Ambient color RGB
specular: TD3DColorValue; // Specular 'shininess'
emissive: TD3DColorValue; // Emissive color RGB
power: TD3DValue; // Sharpness if specular highlight
hTexture: TD3DTextureHandle; // Handle to texture map
dwRampSize: DWORD;
);
1: (
6250,15 → 3006,20
);
end;
 
D3DMATERIAL = TD3DMaterial;
LPD3DMATERIAL = PD3DMaterial;
 
{ TD3DMaterial7 structure }
 
PD3DMaterial7 = ^TD3DMaterial7;
TD3DMaterial7 = packed record
TD3DMaterial7 = record
case Integer of
0: (
diffuse: TD3DColorValue; (* Diffuse color RGBA *)
ambient: TD3DColorValue; (* Ambient color RGB *)
specular: TD3DColorValue; (* Specular 'shininess' *)
emissive: TD3DColorValue; (* Emissive color RGB *)
power: TD3DValue; (* Sharpness if specular highlight *)
diffuse: TD3DColorValue; // Diffuse color RGBA
ambient: TD3DColorValue; // Ambient color RGB
specular: TD3DColorValue; // Specular 'shininess'
emissive: TD3DColorValue; // Emissive color RGB
power: TD3DValue; // Sharpness if specular highlight
);
1: (
dcvDiffuse: TD3DColorValue;
6269,97 → 3030,117
);
end;
 
PD3DLightType = ^TD3DLightType;
D3DMATERIAL7 = TD3DMaterial7;
LPD3DMATERIAL7 = PD3DMaterial7;
 
{ TD3DLightType }
 
TD3DLightType = (
D3DLIGHT_INVALID_0,
D3DLIGHT_POINT,
D3DLIGHT_SPOT,
D3DLIGHT_DIRECTIONAL,
// Note: The following light type (D3DLIGHT_PARALLELPOINT)
// is no longer supported from D3D for DX7 onwards.
D3DLIGHT_PARALLELPOINT,
D3DLIGHT_GLSPOT);
D3DLIGHT_PARALLELPOINT
{$IFNDEF SupportDirectX5},D3DLIGHT_GLSPOT{$ENDIF}
);
 
(*
* Structure defining a light source and its properties.
*)
D3DLIGHTTYPE = TD3DLightType;
 
{ TD3DLight structure }
 
PD3DLight = ^TD3DLight;
TD3DLight = packed record
TD3DLight = record
dwSize: DWORD;
dltType: TD3DLightType; (* Type of light source *)
dcvColor: TD3DColorValue; (* Color of light *)
dvPosition: TD3DVector; (* Position in world space *)
dvDirection: TD3DVector; (* Direction in world space *)
dvRange: TD3DValue; (* Cutoff range *)
dvFalloff: TD3DValue; (* Falloff *)
dvAttenuation0: TD3DValue; (* Constant attenuation *)
dvAttenuation1: TD3DValue; (* Linear attenuation *)
dvAttenuation2: TD3DValue; (* Quadratic attenuation *)
dvTheta: TD3DValue; (* Inner angle of spotlight cone *)
dvPhi: TD3DValue; (* Outer angle of spotlight cone *)
dltType: TD3DLightType; // Type of light source
dcvColor: TD3DColorValue; // Color of light
dvPosition: TD3DVector; // Position in world space
dvDirection: TD3DVector; // Direction in world space
dvRange: TD3DValue; // Cutoff range
dvFalloff: TD3DValue; // Falloff
dvAttenuation0: TD3DValue; // Constant attenuation
dvAttenuation1: TD3DValue; // Linear attenuation
dvAttenuation2: TD3DValue; // Quadratic attenuation
dvTheta: TD3DValue; // Inner angle of spotlight cone
dvPhi: TD3DValue; // Outer angle of spotlight cone
end;
 
D3DLIGHT = TD3DLight;
LPD3DLIGHT = PD3DLight;
 
{ TD3DLight7 structure }
 
PD3DLight7 = ^TD3DLight7;
TD3DLight7 = packed record
dltType: TD3DLightType; (* Type of light source *)
dcvDiffuse: TD3DColorValue; (* Diffuse color of light *)
dcvSpecular: TD3DColorValue;(* Specular color of light *)
dcvAmbient: TD3DColorValue; (* Ambient color of light *)
dvPosition: TD3DVector; (* Position in world space *)
dvDirection: TD3DVector; (* Direction in world space *)
dvRange: TD3DValue; (* Cutoff range *)
dvFalloff: TD3DValue; (* Falloff *)
dvAttenuation0: TD3DValue; (* Constant attenuation *)
dvAttenuation1: TD3DValue; (* Linear attenuation *)
dvAttenuation2: TD3DValue; (* Quadratic attenuation *)
dvTheta: TD3DValue; (* Inner angle of spotlight cone *)
dvPhi: TD3DValue; (* Outer angle of spotlight cone *)
TD3DLight7 = record
dltType: TD3DLightType; // Type of light source
dcvDiffuse: TD3DColorValue; // Diffuse color of light
dcvSpecular: TD3DColorValue;// Specular color of light
dcvAmbient: TD3DColorValue; // Ambient color of light
dvPosition: TD3DVector; // Position in world space
dvDirection: TD3DVector; // Direction in world space
dvRange: TD3DValue; // Cutoff range
dvFalloff: TD3DValue; // Falloff
dvAttenuation0: TD3DValue; // Constant attenuation
dvAttenuation1: TD3DValue; // Linear attenuation
dvAttenuation2: TD3DValue; // Quadratic attenuation
dvTheta: TD3DValue; // Inner angle of spotlight cone
dvPhi: TD3DValue; // Outer angle of spotlight cone
end;
 
(*
* Structure defining a light source and its properties.
*)
D3DLIGHT7 = TD3DLight7;
LPD3DLIGHT7 = PD3DLight7;
 
(* flags bits *)
{ Structure defining a light source and its properties. }
 
const
{ flags bits }
 
D3DLIGHT_ACTIVE = $00000001;
D3DLIGHT_NO_SPECULAR = $00000002;
D3DLIGHT_ALL = D3DLIGHT_ACTIVE or D3DLIGHT_ACTIVE;
D3DLIGHT_ALL = D3DLIGHT_ACTIVE or D3DLIGHT_NO_SPECULAR;
 
(* maximum valid light range *)
D3DLIGHT_RANGE_MAX = 1.8439088915e+18; //sqrt(FLT_MAX);
{ maximum valid light range }
D3DLIGHT_RANGE_MAX: TD3DValue = 3.4 * 10e+38;
 
type
{ TD3DLight2 structure }
 
PD3DLight2 = ^TD3DLight2;
TD3DLight2 = packed record
TD3DLight2 = record
dwSize: DWORD;
dltType: TD3DLightType; (* Type of light source *)
dcvColor: TD3DColorValue; (* Color of light *)
dvPosition: TD3DVector; (* Position in world space *)
dvDirection: TD3DVector; (* Direction in world space *)
dvRange: TD3DValue; (* Cutoff range *)
dvFalloff: TD3DValue; (* Falloff *)
dvAttenuation0: TD3DValue; (* Constant attenuation *)
dvAttenuation1: TD3DValue; (* Linear attenuation *)
dvAttenuation2: TD3DValue; (* Quadratic attenuation *)
dvTheta: TD3DValue; (* Inner angle of spotlight cone *)
dvPhi: TD3DValue; (* Outer angle of spotlight cone *)
dltType: TD3DLightType; // Type of light source
dcvColor: TD3DColorValue; // Color of light
dvPosition: TD3DVector; // Position in world space
dvDirection: TD3DVector; // Direction in world space
dvRange: TD3DValue; // Cutoff range
dvFalloff: TD3DValue; // Falloff
dvAttenuation0: TD3DValue; // Constant attenuation
dvAttenuation1: TD3DValue; // Linear attenuation
dvAttenuation2: TD3DValue; // Quadratic attenuation
dvTheta: TD3DValue; // Inner angle of spotlight cone
dvPhi: TD3DValue; // Outer angle of spotlight cone
dwFlags: DWORD;
end;
 
D3DLIGHT2 = TD3DLight2;
LPD3DLIGHT2 = PD3DLight2;
 
{ TD3DLightData structure }
 
PD3DLightData = ^TD3DLightData;
TD3DLightData = packed record
TD3DLightData = record
dwSize: DWORD;
lpIn: ^TD3DLightingElement; (* Input positions and normals *)
dwInSize: DWORD; (* Stride of input elements *)
lpOut: ^TD3DTLVertex; (* Output colors *)
dwOutSize: DWORD; (* Stride of output colors *)
lpIn: PD3DLightingElement; // Input positions and normals
dwInSize: DWORD; // Stride of input elements
lpOut: PD3DTLVertex; // Output colors
dwOutSize: DWORD; // Stride of output colors
end;
 
D3DLIGHTDATA = TD3DLightData;
LPD3DLIGHTDATA = PD3DLightData;
 
(*
* Before DX5, these values were in an enum called
* TD3DColorModel. This was not correct, since they are
* D3DCOLORMODEL. This was not correct, since they are
* bit flags. A driver can surface either or both flags
* in the dcmColorModel member of D3DDEVICEDESC.
*)
6366,32 → 3147,23
 
type
TD3DColorModel = DWORD;
D3DCOLORMODEL = TD3DColorModel;
const
D3DCOLOR_INVALID_0 = 0;
D3DCOLOR_MONO = 1;
D3DCOLOR_RGB = 2;
 
(*
* Options for clearing
*)
{ Options for clearing }
 
const
D3DCLEAR_TARGET = $00000001; (* Clear target surface *)
D3DCLEAR_ZBUFFER = $00000002; (* Clear target z buffer *)
D3DCLEAR_STENCIL = $00000004; (* Clear stencil planes *)
D3DCLEAR_TARGET = $00000001; // Clear target surface
D3DCLEAR_ZBUFFER = $00000002; // Clear target z buffer
D3DCLEAR_STENCIL = $00000004; // Clear stencil planes
 
(*
* Execute buffers are allocated via Direct3D. These buffers may then
* be filled by the application with instructions to execute along with
* vertex data.
*)
{ Supported op codes for execute instructions. }
 
(*
* Supported op codes for execute instructions.
*)
 
type
PD3DOpcode = ^TD3DOpcode;
TD3DOpcode = (
D3DOP_INVALID_0,
D3DOP_POINT,
6407,63 → 3179,71
D3DOP_EXIT,
D3DOP_BRANCHFORWARD,
D3DOP_SPAN,
D3DOP_SETSTATUS);
D3DOP_SETSTATUS
);
 
PD3DInstruction = ^TD3DInstruction;
TD3DInstruction = packed record
bOpcode: BYTE; (* Instruction opcode *)
bSize: BYTE; (* Size of each instruction data unit *)
wCount: WORD; (* Count of instruction data units to follow *)
D3DOPCODE = TD3DOpcode;
 
{ TD3DInstruction structure }
 
TD3DInstruction = record
bOpcode: Byte; // Instruction opcode
bSize: Byte; // Size of each instruction data unit
wCount: WORD; // Count of instruction data units to follow
end;
D3DINSTRUCTION = TD3DInstruction;
 
(*
* Structure for texture loads
*)
{ TD3DTextureLoad structure }
 
PD3DTextureLoad = ^TD3DTextureLoad;
TD3DTextureLoad = packed record
TD3DTextureLoad = record
hDestTexture: TD3DTextureHandle;
hSrcTexture: TD3DTextureHandle;
end;
D3DTEXTURELOAD = TD3DTextureLoad;
 
(*
* Structure for picking
*)
{ TD3DPickRecord structure }
 
PD3DPickRecord = ^TD3DPickRecord;
TD3DPickRecord = packed record
TD3DPickRecord = record
bOpcode: BYTE;
bPad: BYTE;
dwOffset: DWORD;
dvZ: TD3DValue;
end;
D3DPICKRECORD = TD3DPickRecord;
 
(*
* The following defines the rendering states which can be set in the
* execute buffer.
*)
{ TD3DShadeMode }
 
PD3DShadeMode = ^TD3DShadeMode;
TD3DShadeMode = (
D3DSHADE_INVALID_0,
D3DSHADE_FLAT,
D3DSHADE_GOURAUD,
D3DSHADE_PHONG);
D3DSHADE_PHONG
);
 
PD3DFillMode = ^TD3DFillMode;
D3DSHADEMODE = TD3DShadeMode;
 
{ TD3DFillMode }
 
TD3DFillMode = (
D3DFILL_INVALID_0,
D3DFILL_POINT,
D3DFILL_WIREFRAME,
D3DFILL_SOLID);
D3DFILL_SOLID
);
 
PD3DLinePattern = ^TD3DLinePattern;
TD3DLinePattern = packed record
D3DFILLMODE = TD3DFillMode;
 
{ TD3DLinePattern structure }
 
TD3DLinePattern = record
wRepeatFactor: WORD;
wLinePattern: WORD;
end;
 
PD3DTextureFilter = ^TD3DTextureFilter;
D3DLINEPATTERN = TD3DLinePattern;
 
{ TD3DTextureFilter }
 
TD3DTextureFilter = (
D3DFILTER_INVALID_0,
D3DFILTER_NEAREST,
6471,9 → 3251,13
D3DFILTER_MIPNEAREST,
D3DFILTER_MIPLINEAR,
D3DFILTER_LINEARMIPNEAREST,
D3DFILTER_LINEARMIPLINEAR);
D3DFILTER_LINEARMIPLINEAR
);
 
PD3DBlend = ^TD3DBlend;
D3DTEXTUREFILTER = TD3DTextureFilter;
 
{ TD3DBlend }
 
TD3DBlend = (
D3DBLEND_INVALID_0,
D3DBLEND_ZERO,
6488,9 → 3272,13
D3DBLEND_INVDESTCOLOR,
D3DBLEND_SRCALPHASAT,
D3DBLEND_BOTHSRCALPHA,
D3DBLEND_BOTHINVSRCALPHA);
D3DBLEND_BOTHINVSRCALPHA
);
 
PD3DTextureBlend = ^TD3DTextureBlend;
D3DBLEND = TD3DBlend;
 
{ TD3DTextureBlend }
 
TD3DTextureBlend = (
D3DTBLEND_INVALID_0,
D3DTBLEND_DECAL,
6500,24 → 3288,36
D3DTBLEND_DECALMASK,
D3DTBLEND_MODULATEMASK,
D3DTBLEND_COPY,
D3DTBLEND_ADD);
D3DTBLEND_ADD
);
 
PD3DTextureAddress = ^TD3DTextureAddress;
D3DTEXTUREBLEND = TD3DTextureBlend;
 
{ TD3DTextureAddress }
 
TD3DTextureAddress = (
D3DTADDRESS_INVALID_0,
D3DTADDRESS_WRAP,
D3DTADDRESS_MIRROR,
D3DTADDRESS_CLAMP,
D3DTADDRESS_BORDER);
D3DTADDRESS_BORDER
);
 
PD3DCull = ^TD3DCull;
D3DTEXTUREADDRESS = TD3DTextureAddress;
 
{ TD3DCull }
 
TD3DCull = (
D3DCULL_INVALID_0,
D3DCULL_NONE,
D3DCULL_CW,
D3DCULL_CCW);
D3DCULL_CCW
);
 
PD3DCmpFunc = ^TD3DCmpFunc;
D3DCULL = TD3DCull;
 
{ TD3DCmpFunc }
 
TD3DCmpFunc = (
D3DCMP_INVALID_0,
D3DCMP_NEVER,
6527,9 → 3327,13
D3DCMP_GREATER,
D3DCMP_NOTEQUAL,
D3DCMP_GREATEREQUAL,
D3DCMP_ALWAYS);
D3DCMP_ALWAYS
);
 
PD3DStencilOp = ^TD3DStencilOp;
D3DCMPFUNC = TD3DCmpFunc;
 
{ TD3DStencilOp }
 
TD3DStencilOp = (
D3DSTENCILOP_INVALID_0,
D3DSTENCILOP_KEEP,
6539,37 → 3343,55
D3DSTENCILOP_DECRSAT,
D3DSTENCILOP_INVERT,
D3DSTENCILOP_INCR,
D3DSTENCILOP_DECR);
D3DSTENCILOP_DECR
);
PD3DFogMode = ^TD3DFogMode;
D3DSTENCILOP = TD3DStencilOp;
 
{ TD3DFogMode }
 
TD3DFogMode = (
D3DFOG_NONE,
D3DFOG_EXP,
D3DFOG_EXP2,
D3DFOG_LINEAR);
D3DFOG_LINEAR
);
 
PD3DZBufferType = ^TD3DZBufferType;
D3DFOGMODE = TD3DFogMode;
 
{ TD3DZBufferType }
 
TD3DZBufferType = (
D3DZB_FALSE,
D3DZB_TRUE, // Z buffering
D3DZB_USEW); // W buffering
D3DZB_USEW // W buffering
);
 
PD3DAntialiasMode = ^TD3DAntialiasMode;
D3DZBUFFERTYPE = TD3DZBufferType;
 
{ TD3DAntialiasMode }
 
TD3DAntialiasMode = (
D3DANTIALIAS_NONE,
D3DANTIALIAS_SORTDEPENDENT,
D3DANTIALIAS_SORTINDEPENDENT);
D3DANTIALIAS_SORTINDEPENDENT
);
 
// Vertex types supported by Direct3D
PD3DVertexType = ^TD3DVertexType;
D3DANTIALIASMODE = TD3DAntialiasMode;
 
{ TD3DVertexType }
 
TD3DVertexType = (
D3DVT_INVALID_0,
D3DVT_VERTEX,
D3DVT_LVERTEX,
D3DVT_TLVERTEX);
D3DVT_TLVERTEX
);
 
// Primitives supported by draw-primitive API
PD3DPrimitiveType = ^TD3DPrimitiveType;
D3DVERTEXTYPE = TD3DVertexType;
 
{ TD3DPrimitiveType }
 
TD3DPrimitiveType = (
D3DPT_INVALID_0,
D3DPT_POINTLIST,
6577,42 → 3399,55
D3DPT_LINESTRIP,
D3DPT_TRIANGLELIST,
D3DPT_TRIANGLESTRIP,
D3DPT_TRIANGLEFAN);
D3DPT_TRIANGLEFAN
);
 
(*
* Amount to add to a state to generate the override for that state.
*)
D3DPRIMITIVETYPE = TD3DPrimitiveType;
 
{ Amount to add to a state to generate the override for that state. }
 
const
D3DSTATE_OVERRIDE_BIAS = 256;
 
(*
* A state which sets the override flag for the specified state type.
*)
function D3DSTATE_OVERRIDE(typ: DWORD): DWORD;
 
function D3DSTATE_OVERRIDE(StateType: DWORD) : DWORD;
{ A state which sets the override flag for the specified state type. }
 
type
PD3DTransformStateType = ^TD3DTransformStateType;
TD3DTransformStateType = DWORD;
const
D3DTRANSFORMSTATE_WORLD = 1;
D3DTRANSFORMSTATE_VIEW = 2;
D3DTRANSFORMSTATE_PROJECTION = 3;
D3DTRANSFORMSTATE_WORLD1 = 4; // 2nd matrix to blend
D3DTRANSFORMSTATE_WORLD2 = 5; // 3rd matrix to blend
D3DTRANSFORMSTATE_WORLD3 = 6; // 4th matrix to blend
D3DTRANSFORMSTATE_TEXTURE0 = 16;
D3DTRANSFORMSTATE_TEXTURE1 = 17;
D3DTRANSFORMSTATE_TEXTURE2 = 18;
D3DTRANSFORMSTATE_TEXTURE3 = 19;
D3DTRANSFORMSTATE_TEXTURE4 = 20;
D3DTRANSFORMSTATE_TEXTURE5 = 21;
D3DTRANSFORMSTATE_TEXTURE6 = 22;
D3DTRANSFORMSTATE_TEXTURE7 = 23;
{ TD3DTransformStateType }
 
type
PD3DLightStateType = ^TD3DLightStateType;
TD3DTransformStateType = (
D3DTRANSFORMSTATE_INVALID_0,
D3DTRANSFORMSTATE_WORLD,
D3DTRANSFORMSTATE_VIEW,
D3DTRANSFORMSTATE_PROJECTION,
 
D3DTRANSFORMSTATE_WORLD1,
D3DTRANSFORMSTATE_WORLD2,
D3DTRANSFORMSTATE_WORLD3,
D3DTRANSFORMSTATE_INVALID_7,
D3DTRANSFORMSTATE_INVALID_8,
D3DTRANSFORMSTATE_INVALID_9,
D3DTRANSFORMSTATE_INVALID_10,
D3DTRANSFORMSTATE_INVALID_11,
D3DTRANSFORMSTATE_INVALID_12,
D3DTRANSFORMSTATE_INVALID_13,
D3DTRANSFORMSTATE_INVALID_14,
D3DTRANSFORMSTATE_INVALID_15,
D3DTRANSFORMSTATE_TEXTURE0,
D3DTRANSFORMSTATE_TEXTURE1,
D3DTRANSFORMSTATE_TEXTURE2,
D3DTRANSFORMSTATE_TEXTURE3,
D3DTRANSFORMSTATE_TEXTURE4,
D3DTRANSFORMSTATE_TEXTURE5,
D3DTRANSFORMSTATE_TEXTURE6,
D3DTRANSFORMSTATE_TEXTURE7
);
 
D3DTRANSFORMSTATETYPE = TD3DTransformStateType;
 
{ TD3DLightStateType }
 
TD3DLightStateType = (
D3DLIGHTSTATE_INVALID_0,
D3DLIGHTSTATE_MATERIAL,
6622,185 → 3457,216
D3DLIGHTSTATE_FOGSTART,
D3DLIGHTSTATE_FOGEND,
D3DLIGHTSTATE_FOGDENSITY,
D3DLIGHTSTATE_COLORVERTEX);
D3DLIGHTSTATE_COLORVERTEX
);
 
PD3DRenderStateType = ^TD3DRenderStateType;
TD3DRenderStateType = DWORD;
const
D3DRENDERSTATE_ANTIALIAS = 2; (* D3DANTIALIASMODE *)
D3DRENDERSTATE_TEXTUREPERSPECTIVE = 4; (* TRUE for perspective correction *)
D3DRENDERSTATE_ZENABLE = 7; (* D3DZBUFFERTYPE (or TRUE/FALSE for legacy) *)
D3DRENDERSTATE_FILLMODE = 8; (* D3DFILL_MODE *)
D3DRENDERSTATE_SHADEMODE = 9; (* D3DSHADEMODE *)
D3DRENDERSTATE_LINEPATTERN = 10; (* D3DLINEPATTERN *)
D3DRENDERSTATE_ZWRITEENABLE = 14; (* TRUE to enable z writes *)
D3DRENDERSTATE_ALPHATESTENABLE = 15; (* TRUE to enable alpha tests *)
D3DRENDERSTATE_LASTPIXEL = 16; (* TRUE for last-pixel on lines *)
D3DRENDERSTATE_SRCBLEND = 19; (* D3DBLEND *)
D3DRENDERSTATE_DESTBLEND = 20; (* D3DBLEND *)
D3DRENDERSTATE_CULLMODE = 22; (* D3DCULL *)
D3DRENDERSTATE_ZFUNC = 23; (* D3DCMPFUNC *)
D3DRENDERSTATE_ALPHAREF = 24; (* D3DFIXED *)
D3DRENDERSTATE_ALPHAFUNC = 25; (* D3DCMPFUNC *)
D3DRENDERSTATE_DITHERENABLE = 26; (* TRUE to enable dithering *)
D3DRENDERSTATE_ALPHABLENDENABLE = 27; (* TRUE to enable alpha blending *)
D3DRENDERSTATE_FOGENABLE = 28; (* TRUE to enable fog blending *)
D3DRENDERSTATE_SPECULARENABLE = 29; (* TRUE to enable specular *)
D3DRENDERSTATE_ZVISIBLE = 30; (* TRUE to enable z checking *)
D3DRENDERSTATE_STIPPLEDALPHA = 33; (* TRUE to enable stippled alpha (RGB device only) *)
D3DRENDERSTATE_FOGCOLOR = 34; (* D3DCOLOR *)
D3DRENDERSTATE_FOGTABLEMODE = 35; (* D3DFOGMODE *)
D3DRENDERSTATE_FOGSTART = 36; (* Fog start (for both vertex and pixel fog) *)
D3DRENDERSTATE_FOGEND = 37; (* Fog end *)
D3DRENDERSTATE_FOGDENSITY = 38; (* Fog density *)
D3DRENDERSTATE_EDGEANTIALIAS = 40; (* TRUE to enable edge antialiasing *)
D3DRENDERSTATE_COLORKEYENABLE = 41; (* TRUE to enable source colorkeyed textures *)
D3DRENDERSTATE_ZBIAS = 47; (* LONG Z bias *)
D3DRENDERSTATE_RANGEFOGENABLE = 48; (* Enables range-based fog *)
D3DLIGHTSTATETYPE = TD3DLightStateType;
 
D3DRENDERSTATE_STENCILENABLE = 52; (* BOOL enable/disable stenciling *)
D3DRENDERSTATE_STENCILFAIL = 53; (* D3DSTENCILOP to do if stencil test fails *)
D3DRENDERSTATE_STENCILZFAIL = 54; (* D3DSTENCILOP to do if stencil test passes and Z test fails *)
D3DRENDERSTATE_STENCILPASS = 55; (* D3DSTENCILOP to do if both stencil and Z tests pass *)
D3DRENDERSTATE_STENCILFUNC = 56; (* D3DCMPFUNC fn. Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true *)
D3DRENDERSTATE_STENCILREF = 57; (* Reference value used in stencil test *)
D3DRENDERSTATE_STENCILMASK = 58; (* Mask value used in stencil test *)
D3DRENDERSTATE_STENCILWRITEMASK = 59; (* Write mask applied to values written to stencil buffer *)
D3DRENDERSTATE_TEXTUREFACTOR = 60; (* D3DCOLOR used for multi-texture blend *)
{ TD3DRenderStateType }
 
(*
* 128 values [128; 255] are reserved for texture coordinate wrap flags.
* These are constructed with the D3DWRAP_U and D3DWRAP_V macros. Using
* a flags word preserves forward compatibility with texture coordinates
* that are >2D.
*)
D3DRENDERSTATE_WRAP0 = 128; (* wrap for 1st texture coord. set *)
D3DRENDERSTATE_WRAP1 = 129; (* wrap for 2nd texture coord. set *)
D3DRENDERSTATE_WRAP2 = 130; (* wrap for 3rd texture coord. set *)
D3DRENDERSTATE_WRAP3 = 131; (* wrap for 4th texture coord. set *)
D3DRENDERSTATE_WRAP4 = 132; (* wrap for 5th texture coord. set *)
D3DRENDERSTATE_WRAP5 = 133; (* wrap for 6th texture coord. set *)
D3DRENDERSTATE_WRAP6 = 134; (* wrap for 7th texture coord. set *)
D3DRENDERSTATE_WRAP7 = 135; (* wrap for 8th texture coord. set *)
D3DRENDERSTATE_CLIPPING = 136;
D3DRENDERSTATE_LIGHTING = 137;
D3DRENDERSTATE_EXTENTS = 138;
D3DRENDERSTATE_AMBIENT = 139;
D3DRENDERSTATE_FOGVERTEXMODE = 140;
D3DRENDERSTATE_COLORVERTEX = 141;
D3DRENDERSTATE_LOCALVIEWER = 142;
D3DRENDERSTATE_NORMALIZENORMALS = 143;
D3DRENDERSTATE_COLORKEYBLENDENABLE = 144;
D3DRENDERSTATE_DIFFUSEMATERIALSOURCE = 145;
D3DRENDERSTATE_SPECULARMATERIALSOURCE = 146;
D3DRENDERSTATE_AMBIENTMATERIALSOURCE = 147;
D3DRENDERSTATE_EMISSIVEMATERIALSOURCE = 148;
D3DRENDERSTATE_VERTEXBLEND = 151;
D3DRENDERSTATE_CLIPPLANEENABLE = 152;
 
TD3DRenderStateType = (
D3DRENDERSTATE_INVALID_0,
D3DRENDERSTATE_TEXTUREHANDLE, // Texture handle for legacy interfaces (Texture,Texture2)
D3DRENDERSTATE_ANTIALIAS, // TD3DAntialiasMode
D3DRENDERSTATE_TEXTUREADDRESS, // TD3DTextureAddress
D3DRENDERSTATE_TEXTUREPERSPECTIVE, // TRUE for perspective correction
D3DRENDERSTATE_WRAPU, // TRUE for wrapping in u
D3DRENDERSTATE_WRAPV, // TRUE for wrapping in v
D3DRENDERSTATE_ZENABLE, // TD3DZBufferType (or TRUE/FALSE for legacy)
D3DRENDERSTATE_FILLMODE, // TD3DFillMode
D3DRENDERSTATE_SHADEMODE, // TD3DShadeMode
D3DRENDERSTATE_LINEPATTERN, // TD3DLinePattern
D3DRENDERSTATE_MONOENABLE, // TRUE to enable mono rasterization
D3DRENDERSTATE_ROP2, // ROP2
D3DRENDERSTATE_PLANEMASK, // DWORD physical plane mask
D3DRENDERSTATE_ZWRITEENABLE, // TRUE to enable z writes
D3DRENDERSTATE_ALPHATESTENABLE, // TRUE to enable alpha tests
D3DRENDERSTATE_LASTPIXEL, // TRUE for last-pixel on lines
D3DRENDERSTATE_TEXTUREMAG, // TD3DTextureFilter
D3DRENDERSTATE_TEXTUREMIN, // TD3DTextureFilter
D3DRENDERSTATE_SRCBLEND, // TD3DBlend
D3DRENDERSTATE_DESTBLEND, // TD3DBlend
D3DRENDERSTATE_TEXTUREMAPBLEND, // TD3DTextureBlend
D3DRENDERSTATE_CULLMODE, // TD3DCull
D3DRENDERSTATE_ZFUNC, // TD3DCmpFunc
D3DRENDERSTATE_ALPHAREF, // TD3DFixed
D3DRENDERSTATE_ALPHAFUNC, // TD3DCmpFunc
D3DRENDERSTATE_DITHERENABLE, // TRUE to enable dithering
D3DRENDERSTATE_ALPHABLENDENABLE, // TRUE to enable alpha blending
D3DRENDERSTATE_FOGENABLE, // TRUE to enable fog
D3DRENDERSTATE_SPECULARENABLE, // TRUE to enable specular
D3DRENDERSTATE_ZVISIBLE, // TRUE to enable z checking
D3DRENDERSTATE_SUBPIXEL, // TRUE to enable subpixel correction
D3DRENDERSTATE_SUBPIXELX, // TRUE to enable correction in X only
D3DRENDERSTATE_STIPPLEDALPHA, // TRUE to enable stippled alpha
D3DRENDERSTATE_FOGCOLOR, // TD3DColor
D3DRENDERSTATE_FOGTABLEMODE, // TD3DFogMode
D3DRENDERSTATE_FOGSTART, // Fog start (for both vertex and pixel fog)
D3DRENDERSTATE_FOGEND, // Fog end
D3DRENDERSTATE_FOGDENSITY, // Fog density
D3DRENDERSTATE_STIPPLEENABLE, // TRUE to enable stippling
D3DRENDERSTATE_EDGEANTIALIAS, // TRUE to enable edge antialiasing
D3DRENDERSTATE_COLORKEYENABLE, // TRUE to enable source colorkeyed textures
D3DRENDERSTATE_BORDERCOLOR, // Border color for texturing w/border
D3DRENDERSTATE_TEXTUREADDRESSU, // Texture addressing mode for U coordinate
D3DRENDERSTATE_TEXTUREADDRESSV, // Texture addressing mode for V coordinate
D3DRENDERSTATE_MIPMAPLODBIAS, // TD3DValue Mipmap LOD bias
D3DRENDERSTATE_ZBIAS, // LONG Z bias
D3DRENDERSTATE_RANGEFOGENABLE, // Enables range-based fog
D3DRENDERSTATE_ANISOTROPY, // Max. anisotropy. 1 = no anisotropy
D3DRENDERSTATE_FLUSHBATCH, // Explicit flush for DP batching (DX5 Only)
D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT,// BOOL enable sort-independent transparency
D3DRENDERSTATE_STENCILENABLE, // BOOL enable/disable stenciling
D3DRENDERSTATE_STENCILFAIL, // TD3DStencilOp to do if stencil test fails
D3DRENDERSTATE_STENCILZFAIL, // TD3DStencilOp to do if stencil test passes and Z test fails
D3DRENDERSTATE_STENCILPASS, // TD3DStencilOp to do if both stencil and Z tests pass
D3DRENDERSTATE_STENCILFUNC , // TD3DCmpFunc fn. Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true
D3DRENDERSTATE_STENCILREF, // Reference value used in stencil test
D3DRENDERSTATE_STENCILMASK, // Mask value used in stencil test
D3DRENDERSTATE_STENCILWRITEMASK, // Write mask applied to values written to stencil buffer
D3DRENDERSTATE_TEXTUREFACTOR, // TD3DColor used for multi-texture blend
D3DRENDERSTATE_INVALID_61,
D3DRENDERSTATE_INVALID_62,
D3DRENDERSTATE_INVALID_63,
D3DRENDERSTATE_STIPPLEPATTERN00, // Stipple pattern 01...
D3DRENDERSTATE_STIPPLEPATTERN01,
D3DRENDERSTATE_STIPPLEPATTERN02,
D3DRENDERSTATE_STIPPLEPATTERN03,
D3DRENDERSTATE_STIPPLEPATTERN04,
D3DRENDERSTATE_STIPPLEPATTERN05,
D3DRENDERSTATE_STIPPLEPATTERN06,
D3DRENDERSTATE_STIPPLEPATTERN07,
D3DRENDERSTATE_STIPPLEPATTERN08,
D3DRENDERSTATE_STIPPLEPATTERN09,
D3DRENDERSTATE_STIPPLEPATTERN10,
D3DRENDERSTATE_STIPPLEPATTERN11,
D3DRENDERSTATE_STIPPLEPATTERN12,
D3DRENDERSTATE_STIPPLEPATTERN13,
D3DRENDERSTATE_STIPPLEPATTERN14,
D3DRENDERSTATE_STIPPLEPATTERN15,
D3DRENDERSTATE_STIPPLEPATTERN16,
D3DRENDERSTATE_STIPPLEPATTERN17,
D3DRENDERSTATE_STIPPLEPATTERN18,
D3DRENDERSTATE_STIPPLEPATTERN19,
D3DRENDERSTATE_STIPPLEPATTERN20,
D3DRENDERSTATE_STIPPLEPATTERN21,
D3DRENDERSTATE_STIPPLEPATTERN22,
D3DRENDERSTATE_STIPPLEPATTERN23,
D3DRENDERSTATE_STIPPLEPATTERN24,
D3DRENDERSTATE_STIPPLEPATTERN25,
D3DRENDERSTATE_STIPPLEPATTERN26,
D3DRENDERSTATE_STIPPLEPATTERN27,
D3DRENDERSTATE_STIPPLEPATTERN28,
D3DRENDERSTATE_STIPPLEPATTERN29,
D3DRENDERSTATE_STIPPLEPATTERN30,
D3DRENDERSTATE_STIPPLEPATTERN31,
D3DRENDERSTATE_INVALID_95,
D3DRENDERSTATE_INVALID_96,
D3DRENDERSTATE_INVALID_97,
D3DRENDERSTATE_INVALID_98,
D3DRENDERSTATE_INVALID_99,
D3DRENDERSTATE_INVALID_100,
D3DRENDERSTATE_INVALID_101,
D3DRENDERSTATE_INVALID_102,
D3DRENDERSTATE_INVALID_103,
D3DRENDERSTATE_INVALID_104,
D3DRENDERSTATE_INVALID_105,
D3DRENDERSTATE_INVALID_106,
D3DRENDERSTATE_INVALID_107,
D3DRENDERSTATE_INVALID_108,
D3DRENDERSTATE_INVALID_109,
D3DRENDERSTATE_INVALID_110,
D3DRENDERSTATE_INVALID_111,
D3DRENDERSTATE_INVALID_112,
D3DRENDERSTATE_INVALID_113,
D3DRENDERSTATE_INVALID_114,
D3DRENDERSTATE_INVALID_115,
D3DRENDERSTATE_INVALID_116,
D3DRENDERSTATE_INVALID_117,
D3DRENDERSTATE_INVALID_118,
D3DRENDERSTATE_INVALID_119,
D3DRENDERSTATE_INVALID_120,
D3DRENDERSTATE_INVALID_121,
D3DRENDERSTATE_INVALID_122,
D3DRENDERSTATE_INVALID_123,
D3DRENDERSTATE_INVALID_124,
D3DRENDERSTATE_INVALID_125,
D3DRENDERSTATE_INVALID_126,
D3DRENDERSTATE_INVALID_127,
//
// retired renderstates - not supported for DX7 interfaces
// 128 values [128, 255] are reserved for texture coordinate wrap flags.
// These are constructed with the D3DWRAP_U and D3DWRAP_V macros. Using
// a flags word preserves forward compatibility with texture coordinates
// that are >2D.
//
D3DRENDERSTATE_TEXTUREHANDLE = 1; (* Texture handle for legacy interfaces (Texture;Texture2) *)
D3DRENDERSTATE_TEXTUREADDRESS = 3; (* D3DTEXTUREADDRESS *)
D3DRENDERSTATE_WRAPU = 5; (* TRUE for wrapping in u *)
D3DRENDERSTATE_WRAPV = 6; (* TRUE for wrapping in v *)
D3DRENDERSTATE_MONOENABLE = 11; (* TRUE to enable mono rasterization *)
D3DRENDERSTATE_ROP2 = 12; (* ROP2 *)
D3DRENDERSTATE_PLANEMASK = 13; (* DWORD physical plane mask *)
D3DRENDERSTATE_TEXTUREMAG = 17; (* D3DTEXTUREFILTER *)
D3DRENDERSTATE_TEXTUREMIN = 18; (* D3DTEXTUREFILTER *)
D3DRENDERSTATE_TEXTUREMAPBLEND = 21; (* D3DTEXTUREBLEND *)
D3DRENDERSTATE_SUBPIXEL = 31; (* TRUE to enable subpixel correction *)
D3DRENDERSTATE_SUBPIXELX = 32; (* TRUE to enable correction in X only *)
D3DRENDERSTATE_STIPPLEENABLE = 39; (* TRUE to enable stippling *)
D3DRENDERSTATE_BORDERCOLOR = 43; (* Border color for texturing w/border *)
D3DRENDERSTATE_TEXTUREADDRESSU = 44; (* Texture addressing mode for U coordinate *)
D3DRENDERSTATE_TEXTUREADDRESSV = 45; (* Texture addressing mode for V coordinate *)
D3DRENDERSTATE_MIPMAPLODBIAS = 46; (* D3DVALUE Mipmap LOD bias *)
D3DRENDERSTATE_ANISOTROPY = 49; (* Max. anisotropy. 1 = no anisotropy *)
D3DRENDERSTATE_FLUSHBATCH = 50; (* Explicit flush for DP batching (DX5 Only) *)
D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT=51; (* BOOL enable sort-independent transparency *)
D3DRENDERSTATE_STIPPLEPATTERN00 = 64; (* Stipple pattern 01... *)
D3DRENDERSTATE_STIPPLEPATTERN01 = 65;
D3DRENDERSTATE_STIPPLEPATTERN02 = 66;
D3DRENDERSTATE_STIPPLEPATTERN03 = 67;
D3DRENDERSTATE_STIPPLEPATTERN04 = 68;
D3DRENDERSTATE_STIPPLEPATTERN05 = 69;
D3DRENDERSTATE_STIPPLEPATTERN06 = 70;
D3DRENDERSTATE_STIPPLEPATTERN07 = 71;
D3DRENDERSTATE_STIPPLEPATTERN08 = 72;
D3DRENDERSTATE_STIPPLEPATTERN09 = 73;
D3DRENDERSTATE_STIPPLEPATTERN10 = 74;
D3DRENDERSTATE_STIPPLEPATTERN11 = 75;
D3DRENDERSTATE_STIPPLEPATTERN12 = 76;
D3DRENDERSTATE_STIPPLEPATTERN13 = 77;
D3DRENDERSTATE_STIPPLEPATTERN14 = 78;
D3DRENDERSTATE_STIPPLEPATTERN15 = 79;
D3DRENDERSTATE_STIPPLEPATTERN16 = 80;
D3DRENDERSTATE_STIPPLEPATTERN17 = 81;
D3DRENDERSTATE_STIPPLEPATTERN18 = 82;
D3DRENDERSTATE_STIPPLEPATTERN19 = 83;
D3DRENDERSTATE_STIPPLEPATTERN20 = 84;
D3DRENDERSTATE_STIPPLEPATTERN21 = 85;
D3DRENDERSTATE_STIPPLEPATTERN22 = 86;
D3DRENDERSTATE_STIPPLEPATTERN23 = 87;
D3DRENDERSTATE_STIPPLEPATTERN24 = 88;
D3DRENDERSTATE_STIPPLEPATTERN25 = 89;
D3DRENDERSTATE_STIPPLEPATTERN26 = 90;
D3DRENDERSTATE_STIPPLEPATTERN27 = 91;
D3DRENDERSTATE_STIPPLEPATTERN28 = 92;
D3DRENDERSTATE_STIPPLEPATTERN29 = 93;
D3DRENDERSTATE_STIPPLEPATTERN30 = 94;
D3DRENDERSTATE_STIPPLEPATTERN31 = 95;
D3DRENDERSTATE_WRAP0, // wrap for 1st texture coord. set
D3DRENDERSTATE_WRAP1, // wrap for 2nd texture coord. set
D3DRENDERSTATE_WRAP2, // wrap for 3rd texture coord. set
D3DRENDERSTATE_WRAP3, // wrap for 4th texture coord. set
D3DRENDERSTATE_WRAP4, // wrap for 5th texture coord. set
D3DRENDERSTATE_WRAP5, // wrap for 6th texture coord. set
D3DRENDERSTATE_WRAP6, // wrap for 7th texture coord. set
D3DRENDERSTATE_WRAP7, // wrap for 8th texture coord. set
D3DRENDERSTATE_CLIPPING,
D3DRENDERSTATE_LIGHTING,
D3DRENDERSTATE_EXTENTS,
D3DRENDERSTATE_AMBIENT,
D3DRENDERSTATE_FOGVERTEXMODE,
D3DRENDERSTATE_COLORVERTEX,
D3DRENDERSTATE_LOCALVIEWER,
D3DRENDERSTATE_NORMALIZENORMALS,
D3DRENDERSTATE_COLORKEYBLENDENABLE,
D3DRENDERSTATE_DIFFUSEMATERIALSOURCE,
D3DRENDERSTATE_SPECULARMATERIALSOURCE,
D3DRENDERSTATE_AMBIENTMATERIALSOURCE,
D3DRENDERSTATE_EMISSIVEMATERIALSOURCE,
D3DRENDERSTATE_INVALID_149,
D3DRENDERSTATE_INVALID_150,
D3DRENDERSTATE_VERTEXBLEND,
D3DRENDERSTATE_CLIPPLANEENABLE
);
 
//
// retired renderstate names - the values are still used under new naming conventions
//
D3DRENDERSTATE_FOGTABLESTART = 36; (* Fog table start *)
D3DRENDERSTATE_FOGTABLEEND = 37; (* Fog table end *)
D3DRENDERSTATE_FOGTABLEDENSITY = 38; (* Fog table density *)
D3DRENDERSTATETYPE = TD3DRenderStateType;
 
type
// Values for material source
PD3DMateralColorSource = ^TD3DMateralColorSource;
TD3DMateralColorSource = (
TD3DMaterialColorSource = (
D3DMCS_MATERIAL, // Color from material is used
D3DMCS_COLOR1, // Diffuse vertex color is used
D3DMCS_COLOR2 // Specular vertex color is used
);
); // force 32-bit size enum
 
const
// For back-compatibility with legacy compilations
{ For back-compatibility with legacy compilations }
D3DRENDERSTATE_BLENDENABLE = D3DRENDERSTATE_ALPHABLENDENABLE;
D3DRENDERSTATE_FOGTABLESTART = D3DRENDERSTATE_FOGSTART;
D3DRENDERSTATE_FOGTABLEEND = D3DRENDERSTATE_FOGEND;
D3DRENDERSTATE_FOGTABLEDENSITY = D3DRENDERSTATE_FOGDENSITY;
 
{ Bias to apply to the texture coordinate set to apply a wrap to. }
D3DRENDERSTATE_WRAPBIAS = TD3DRenderStateType(128);
 
// Bias to apply to the texture coordinate set to apply a wrap to.
D3DRENDERSTATE_WRAPBIAS = 128;
 
(* Flags to construct the WRAP render states *)
{ Flags to construct the WRAP render states }
D3DWRAP_U = $00000001;
D3DWRAP_V = $00000002;
 
(* Flags to construct the WRAP render states for 1D thru 4D texture coordinates *)
{ Flags to construct the WRAP render states for 1D thru 4D texture coordinates }
D3DWRAPCOORD_0 = $00000001; // same as D3DWRAP_U
D3DWRAPCOORD_1 = $00000002; // same as D3DWRAP_V
D3DWRAPCOORD_2 = $00000004;
D3DWRAPCOORD_3 = $00000008;
 
function D3DRENDERSTATE_STIPPLEPATTERN(y: integer) : TD3DRenderStateType;
function D3DRENDERSTATE_STIPPLEPATTERN(y: DWORD): TD3DRenderStateType;
 
type
PD3DState = ^TD3DState;
TD3DState = packed record
 
TD3DState = record
case Integer of
0: (
dtstTransformStateType: TD3DTransformStateType;
dwArg: Array [ 0..0 ] of DWORD;
dwArg: array[0..0] of DWORD;
);
1: (
dlstLightStateType: TD3DLightStateType;
dvArg: Array [ 0..0 ] of TD3DValue;
dvArg: array[0..0] of TD3DValue;
);
2: (
drstRenderStateType: TD3DRenderStateType;
6807,39 → 3673,39
);
end;
 
(*
* Operation used to load matrices
* hDstMat = hSrcMat
*)
PD3DMatrixLoad = ^TD3DMatrixLoad;
TD3DMatrixLoad = packed record
hDestMatrix: TD3DMatrixHandle; (* Destination matrix *)
hSrcMatrix: TD3DMatrixHandle; (* Source matrix *)
D3DSTATE = TD3DState;
 
{ TD3DMatrixLoad structure }
 
TD3DMatrixLoad = record
hDestMatrix: TD3DMatrixHandle; // Destination matrix
hSrcMatrix: TD3DMatrixHandle; // Source matrix
end;
 
(*
* Operation used to multiply matrices
* hDstMat = hSrcMat1 * hSrcMat2
*)
PD3DMatrixMultiply = ^TD3DMatrixMultiply;
TD3DMatrixMultiply = packed record
hDestMatrix: TD3DMatrixHandle; (* Destination matrix *)
hSrcMatrix1: TD3DMatrixHandle; (* First source matrix *)
hSrcMatrix2: TD3DMatrixHandle; (* Second source matrix *)
D3DMATRIXLOAD = TD3DMatrixLoad;
 
{ TD3DMatrixMultiply structure }
 
TD3DMatrixMultiply = record
hDestMatrix: TD3DMatrixHandle; // Destination matrix
hSrcMatrix1: TD3DMatrixHandle; // First source matrix
hSrcMatrix2: TD3DMatrixHandle; // Second source matrix
end;
 
(*
* Operation used to transform and light vertices.
*)
PD3DProcessVertices = ^TD3DProcessVertices;
TD3DProcessVertices = packed record
dwFlags: DWORD; (* Do we transform or light or just copy? *)
wStart: WORD; (* Index to first vertex in source *)
wDest: WORD; (* Index to first vertex in local buffer *)
dwCount: DWORD; (* Number of vertices to be processed *)
dwReserved: DWORD; (* Must be zero *)
D3DMATRIXMULTIPLY = TD3DMatrixMultiply;
 
{ TD3DProcessVertices structure }
 
TD3DProcessVertices = record
dwFlags: DWORD; // Do we transform or light or just copy?
wStart: WORD; // Index to first vertex in source
wDest: WORD; // Index to first vertex in local buffer
dwCount: DWORD; // Number of vertices to be processed
dwReserved: DWORD; // Must be zero
end;
 
D3DPROCESSVERTICES = TD3DProcessVertices;
 
const
D3DPROCESSVERTICES_TRANSFORMLIGHT = $00000000;
D3DPROCESSVERTICES_TRANSFORM = $00000001;
6849,54 → 3715,52
D3DPROCESSVERTICES_UPDATEEXTENTS = $00000008;
D3DPROCESSVERTICES_NOCOLOR = $00000010;
 
{ TD3DTextureStagesStateType }
 
(*
* State enumerants for per-stage texture processing.
*)
type
PD3DTextureStageStateType = ^TD3DTextureStageStateType;
TD3DTextureStageStateType = DWORD;
TD3DTextureStagesStateType = (
D3DTSS_INVALID_0,
D3DTSS_COLOROP, // TD3DTextureOp - per-stage blending controls for color channels
D3DTSS_COLORARG1, // D3DTA_* (texture arg)
D3DTSS_COLORARG2, // D3DTA_* (texture arg)
D3DTSS_ALPHAOP, // TD3DTextureOp - per-stage blending controls for alpha channel
D3DTSS_ALPHAARG1, // D3DTA_* (texture arg)
D3DTSS_ALPHAARG2, // D3DTA_* (texture arg)
D3DTSS_BUMPENVMAT00, // TD3DValue (bump mapping matrix)
D3DTSS_BUMPENVMAT01, // TD3DValue (bump mapping matrix)
D3DTSS_BUMPENVMAT10, // TD3DValue (bump mapping matrix)
D3DTSS_BUMPENVMAT11, // TD3DValue (bump mapping matrix)
D3DTSS_TEXCOORDINDEX, // identifies which set of texture coordinates index this texture
D3DTSS_ADDRESS, // TD3DTextureAddress for both coordinates
D3DTSS_ADDRESSU, // TD3DTextureAddress for U coordinate
D3DTSS_ADDRESSV, // TD3DTextureAddress for V coordinate
D3DTSS_BORDERCOLOR, // TD3DColor
D3DTSS_MAGFILTER, // TD3DTextureMagFilter filter to use for magnification
D3DTSS_MINFILTER, // TD3DTextureMinFilter filter to use for minification
D3DTSS_MIPFILTER, // TD3DTextureMipFilter filter to use between mipmaps during minification
D3DTSS_MIPMAPLODBIAS, // D3DVALUE Mipmap LOD bias
D3DTSS_MAXMIPLEVEL, // DWORD 0..(n-1) LOD index of largest map to use (0 == largest)
D3DTSS_MAXANISOTROPY, // DWORD maximum anisotropy
D3DTSS_BUMPENVLSCALE, // TD3DValue scale for bump map luminance
D3DTSS_BUMPENVLOFFSET, // TD3DValue offset for bump map luminance
D3DTSS_TEXTURETRANSFORMFLAGS // D3DTEXTURETRANSFORMFLAGS controls texture transform
);
 
D3DTEXTURESTAGESTATETYPE = TD3DTextureStagesStateType;
 
const
D3DTSS_COLOROP = 1; (* D3DTEXTUREOP - per-stage blending controls for color channels *)
D3DTSS_COLORARG1 = 2; (* D3DTA_* (texture arg) *)
D3DTSS_COLORARG2 = 3; (* D3DTA_* (texture arg) *)
D3DTSS_ALPHAOP = 4; (* D3DTEXTUREOP - per-stage blending controls for alpha channel *)
D3DTSS_ALPHAARG1 = 5; (* D3DTA_* (texture arg) *)
D3DTSS_ALPHAARG2 = 6; (* D3DTA_* (texture arg) *)
D3DTSS_BUMPENVMAT00 = 7; (* D3DVALUE (bump mapping matrix) *)
D3DTSS_BUMPENVMAT01 = 8; (* D3DVALUE (bump mapping matrix) *)
D3DTSS_BUMPENVMAT10 = 9; (* D3DVALUE (bump mapping matrix) *)
D3DTSS_BUMPENVMAT11 = 10; (* D3DVALUE (bump mapping matrix) *)
D3DTSS_TEXCOORDINDEX = 11; (* identifies which set of texture coordinates index this texture *)
D3DTSS_ADDRESS = 12; (* D3DTEXTUREADDRESS for both coordinates *)
D3DTSS_ADDRESSU = 13; (* D3DTEXTUREADDRESS for U coordinate *)
D3DTSS_ADDRESSV = 14; (* D3DTEXTUREADDRESS for V coordinate *)
D3DTSS_BORDERCOLOR = 15; (* D3DCOLOR *)
D3DTSS_MAGFILTER = 16; (* D3DTEXTUREMAGFILTER filter to use for magnification *)
D3DTSS_MINFILTER = 17; (* D3DTEXTUREMINFILTER filter to use for minification *)
D3DTSS_MIPFILTER = 18; (* D3DTEXTUREMIPFILTER filter to use between mipmaps during minification *)
D3DTSS_MIPMAPLODBIAS = 19; (* D3DVALUE Mipmap LOD bias *)
D3DTSS_MAXMIPLEVEL = 20; (* DWORD 0..(n-1) LOD index of largest map to use (0 == largest) *)
D3DTSS_MAXANISOTROPY = 21; (* DWORD maximum anisotropy *)
D3DTSS_BUMPENVLSCALE = 22; (* D3DVALUE scale for bump map luminance *)
D3DTSS_BUMPENVLOFFSET = 23; (* D3DVALUE offset for bump map luminance *)
D3DTSS_TEXTURETRANSFORMFLAGS = 24; (* D3DTEXTURETRANSFORMFLAGS controls texture transform *)
{ Values, used with D3DTSS_TEXCOORDINDEX, to specify that the vertex data(position }
{ and normal in the camera space) should be taken as texture coordinates }
{ Low 16 bits are used to specify texture coordinate index, to take the WRAP mode from }
 
// Values, used with D3DTSS_TEXCOORDINDEX, to specify that the vertex data(position
// and normal in the camera space) should be taken as texture coordinates
// Low 16 bits are used to specify texture coordinate index, to take the WRAP mode from
//
D3DTSS_TCI_PASSTHRU = $00000000;
D3DTSS_TCI_CAMERASPACENORMAL = $00010000;
D3DTSS_TCI_CAMERASPACEPOSITION = $00020000;
D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR = $00030000;
 
{ TD3DTextureOp }
 
type
(*
* Enumerations for COLOROP and ALPHAOP texture blending operations set in
* texture processing stage controls in D3DRENDERSTATE.
*)
PD3DTextureOp = ^TD3DTextureOp;
TD3DTextureOp = (
D3DTOP_INVALID_0,
// Control
6903,12 → 3767,10
D3DTOP_DISABLE , // disables stage
D3DTOP_SELECTARG1, // the default
D3DTOP_SELECTARG2,
 
// Modulate
D3DTOP_MODULATE , // multiply args together
D3DTOP_MODULATE2X, // multiply and 1 bit
D3DTOP_MODULATE4X, // multiply and 2 bits
 
// Add
D3DTOP_ADD , // add arguments together
D3DTOP_ADDSIGNED , // add with -0.5 bias
6917,7 → 3779,6
D3DTOP_ADDSMOOTH , // add 2 args, subtract product
// Arg1 + Arg2 - Arg1*Arg2
// = Arg1 + (1-Arg1)*Arg2
 
// Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha)
D3DTOP_BLENDDIFFUSEALPHA , // iterated alpha
D3DTOP_BLENDTEXTUREALPHA , // texture alpha
6925,7 → 3786,6
// Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha)
D3DTOP_BLENDTEXTUREALPHAPM, // texture alpha
D3DTOP_BLENDCURRENTALPHA , // by alpha of current color
 
// Specular mapping
D3DTOP_PREMODULATE , // modulate with next texture before use
D3DTOP_MODULATEALPHA_ADDCOLOR, // Arg1.RGB + Arg1.A*Arg2.RGB
6936,7 → 3796,6
// COLOROP only
D3DTOP_MODULATEINVCOLOR_ADDALPHA, // (1-Arg1.RGB)*Arg2.RGB + Arg1.A
// COLOROP only
 
// Bump mapping
D3DTOP_BUMPENVMAP , // per pixel env map perturbation
D3DTOP_BUMPENVMAPLUMINANCE, // with luminance channel
6948,10 → 3807,11
D3DTOP_DOTPRODUCT3
);
 
(*
* Values for COLORARG1,2 and ALPHAARG1,2 texture blending operations
* set in texture processing stage controls in D3DRENDERSTATE.
*)
D3DTEXTUREOP = TD3DTextureOp;
 
{ Values for COLORARG1,2 and ALPHAARG1,2 texture blending operations
set in texture processing stage controls in D3DRENDERSTATE. }
 
const
D3DTA_SELECTMASK = $0000000f; // mask for arg selector
D3DTA_DIFFUSE = $00000000; // select diffuse color
6962,11 → 3822,9
D3DTA_COMPLEMENT = $00000010; // take 1.0 - x
D3DTA_ALPHAREPLICATE = $00000020; // replicate alpha to color components
 
(*
* IDirect3DTexture2 State Filter Types
*)
{ IDirect3DTexture2 State Filter Types }
 
type
PD3DTextureMagFilter = ^TD3DTextureMagFilter;
TD3DTextureMagFilter = (
D3DTFG_INVALID_0,
D3DTFG_POINT , // nearest
6976,7 → 3834,8
D3DTFG_ANISOTROPIC
);
 
PD3DTextureMinFilter = ^TD3DTextureMinFilter;
D3DTEXTUREMAGFILTER = TD3DTextureMagFilter;
 
TD3DTextureMinFilter = (
D3DTFN_INVALID_0,
D3DTFN_POINT , // nearest
6984,7 → 3843,8
D3DTFN_ANISOTROPIC
);
 
PD3DTextureMipFilter = ^TD3DTextureMipFilter;
D3DTEXTUREMINFILTER = TD3DTextureMinFilter;
 
TD3DTextureMipFilter = (
D3DTFP_INVALID_0,
D3DTFP_NONE , // mipmapping disabled (use MAG filter)
6992,55 → 3852,37
D3DTFP_LINEAR // linear interpolation
);
 
D3DTEXTUREMIPFILTER = TD3DTextureMipFilter;
 
(*
* Triangle flags
*)
{ Triangle flags }
 
(*
* Tri strip and fan flags.
* START loads all three vertices
* EVEN and ODD load just v3 with even or odd culling
* START_FLAT contains a count from 0 to 29 that allows the
* whole strip or fan to be culled in one hit.
* e.g. for a quad len = 1
*)
const
D3DTRIFLAG_START = $00000000;
// #define D3DTRIFLAG_STARTFLAT(len) (len) (* 0 < len < 30 *)
D3DTRIFLAG_ODD = $0000001e;
D3DTRIFLAG_EVEN = $0000001f;
 
function D3DTRIFLAG_STARTFLAT(len: DWORD) : DWORD;
 
{ Triangle edge flags }
 
const
D3DTRIFLAG_ODD = $0000001e;
D3DTRIFLAG_EVEN = $0000001f;
D3DTRIFLAG_EDGEENABLE1 = $00000100; // v0-v1 edge
D3DTRIFLAG_EDGEENABLE2 = $00000200; // v1-v2 edge
D3DTRIFLAG_EDGEENABLE3 = $00000400; // v2-v0 edge
D3DTRIFLAG_EDGEENABLETRIANGLE =
D3DTRIFLAG_EDGEENABLE1 or D3DTRIFLAG_EDGEENABLE2 or D3DTRIFLAG_EDGEENABLE3;
 
(*
* Triangle edge flags
* enable edges for wireframe or antialiasing
*)
D3DTRIFLAG_EDGEENABLE1 = $00000100; (* v0-v1 edge *)
D3DTRIFLAG_EDGEENABLE2 = $00000200; (* v1-v2 edge *)
D3DTRIFLAG_EDGEENABLE3 = $00000400; (* v2-v0 edge *)
D3DTRIFLAG_EDGEENABLETRIANGLE = (
D3DTRIFLAG_EDGEENABLE1 or D3DTRIFLAG_EDGEENABLE2 or D3DTRIFLAG_EDGEENABLE3);
{ TD3DTriangle structure }
 
(*
* Primitive structures and related defines. Vertex offsets are to types
* TD3DVertex, TD3DLVertex, or TD3DTLVertex.
*)
 
(*
* Triangle list primitive structure
*)
type
PD3DTriangle = ^TD3DTriangle;
TD3DTriangle = packed record
TD3DTriangle = record
case Integer of
0: (
v1: WORD; (* Vertex indices *)
v1: WORD; // Vertex indices
v2: WORD;
v3: WORD;
wFlags: WORD; (* Edge (and other) flags *)
wFlags: WORD; // Edge (and other) flags
);
1: (
wV1: WORD;
7049,15 → 3891,16
);
end;
 
(*
* Line strip structure.
* The instruction count - 1 defines the number of line segments.
*)
D3DTRIANGLE = TD3DTriangle;
LPD3DTRIANGLE = PD3DTriangle;
 
{ TD3DLine structure }
 
PD3DLine = ^TD3DLine;
TD3DLine = packed record
TD3DLine = record
case Integer of
0: (
v1: WORD; (* Vertex indices *)
v1: WORD; // Vertex indices
v2: WORD;
);
1: (
7066,77 → 3909,86
);
end;
 
(*
* Span structure
* Spans join a list of points with the same y value.
* If the y value changes, a new span is started.
*)
D3DLINE = TD3DLine;
LPD3DLINE = PD3DLine;
 
{ TD3DSpan structure }
 
PD3DSpan = ^TD3DSpan;
TD3DSpan = packed record
wCount: WORD; (* Number of spans *)
wFirst: WORD; (* Index to first vertex *)
TD3DSpan = record
wCount: WORD; // Number of spans
wFirst: WORD; // Index to first vertex
end;
 
(*
* Point structure
*)
D3DSPAN = TD3DSpan;
LPD3DSPAN = PD3DSpan;
 
{ TD3DPoint structure }
 
PD3DPoint = ^TD3DPoint;
TD3DPoint = packed record
wCount: WORD; (* number of points *)
wFirst: WORD; (* index to first vertex *)
TD3DPoint = record
wCount: WORD; // number of points
wFirst: WORD; // index to first vertex
end;
 
(*
* Forward branch structure.
* Mask is logically anded with the driver status mask
* if the result equals 'value', the branch is taken.
*)
D3DPOINT = TD3DPoint;
LPD3DPOINT = PD3DPoint;
 
{ TD3DBranch structure }
 
PD3DBranch = ^TD3DBranch;
TD3DBranch = packed record
dwMask: DWORD; (* Bitmask against D3D status *)
TD3DBranch = record
dwMask: DWORD; // Bitmask against D3D status
dwValue: DWORD;
bNegate: BOOL; (* TRUE to negate comparison *)
dwOffset: DWORD; (* How far to branch forward (0 for exit)*)
bNegate: BOOL; // TRUE to negate comparison
dwOffset: DWORD; // How far to branch forward (0 for exit)
end;
 
(*
* Status used for set status instruction.
* The D3D status is initialised on device creation
* and is modified by all execute calls.
*)
D3DBRANCH = TD3DBranch;
LPD3DBRANCH = PD3DBranch;
 
{ TD3DStatus structure }
 
PD3DStatus = ^TD3DStatus;
TD3DStatus = packed record
dwFlags: DWORD; (* Do we set extents or status *)
dwStatus: DWORD; (* D3D status *)
TD3DStatus = record
dwFlags: DWORD; // Do we set extents or status
dwStatus: DWORD; // D3D status
drExtent: TD3DRect;
end;
 
D3DSTATUS = TD3DStatus;
LPD3DSTATUS = PD3DStatus;
 
const
D3DSETSTATUS_STATUS = $00000001;
D3DSETSTATUS_EXTENTS = $00000002;
D3DSETSTATUS_ALL = (D3DSETSTATUS_STATUS or D3DSETSTATUS_EXTENTS);
D3DSETSTATUS_ALL = D3DSETSTATUS_STATUS or D3DSETSTATUS_EXTENTS;
 
{ TD3DClipStatus structure }
 
type
PD3DClipStatus = ^TD3DClipStatus;
TD3DClipStatus = packed record
dwFlags : DWORD; (* Do we set 2d extents, 3D extents or status *)
dwStatus : DWORD; (* Clip status *)
minx, maxx : float; (* X extents *)
miny, maxy : float; (* Y extents *)
minz, maxz : float; (* Z extents *)
TD3DClipStatus = record
dwFlags: DWORD; // Do we set 2d extents, 3D extents or status
dwStatus: DWORD; // Clip status
minx, maxx: Single; // X extents
miny, maxy: Single; // Y extents
minz, maxz: Single; // Z extents
end;
 
D3DCLIPSTATUS = TD3DClipStatus;
LPD3DCLIPSTATUS = PD3DClipStatus;
 
const
D3DCLIPSTATUS_STATUS = $00000001;
D3DCLIPSTATUS_EXTENTS2 = $00000002;
D3DCLIPSTATUS_EXTENTS3 = $00000004;
 
(*
* Statistics structure
*)
{ TD3DStats structure }
 
type
PD3DStats = ^TD3DStats;
TD3DStats = packed record
TD3DStats = record
dwSize: DWORD;
dwTrianglesDrawn: DWORD;
dwLinesDrawn: DWORD;
7145,18 → 3997,20
dwVerticesProcessed: DWORD;
end;
 
(*
* Execute options.
* When calling using D3DEXECUTE_UNCLIPPED all the primitives
* inside the buffer must be contained within the viewport.
*)
D3DSTATS = TD3DStats;
LPD3DSTATS = PD3DStats;
 
{ Execute options. }
 
const
D3DEXECUTE_CLIPPED = $00000001;
D3DEXECUTE_UNCLIPPED = $00000002;
 
{ TD3DExecuteData structure }
 
type
PD3DExecuteData = ^TD3DExecuteData;
TD3DExecuteData = packed record
TD3DExecuteData = record
dwSize: DWORD;
dwVertexOffset: DWORD;
dwVertexCount: DWORD;
7163,23 → 4017,24
dwInstructionOffset: DWORD;
dwInstructionLength: DWORD;
dwHVertexOffset: DWORD;
dsStatus: TD3DStatus; (* Status after execute *)
dsStatus: D3DSTATUS; // Status after execute
end;
 
(*
* Palette flags.
* This are or'ed with the peFlags in the PALETTEENTRYs passed to DirectDraw.
*)
D3DEXECUTEDATA = TD3DExecuteData;
LPD3DEXECUTEDATA = PD3DExecuteData;
 
{ Palette flags. }
 
const
D3DPAL_FREE = $00; (* Renderer may use this entry freely *)
D3DPAL_READONLY = $40; (* Renderer may not set this entry *)
D3DPAL_RESERVED = $80; (* Renderer may not use this entry *)
D3DPAL_FREE = $00; // Renderer may use this entry freely
D3DPAL_READONLY = $40; // Renderer may not set this entry
D3DPAL_RESERVED = $80; // Renderer may not use this entry
 
{ TD3DVertexBufferDesc structure }
 
type
PD3DVertexBufferDesc = ^TD3DVertexBufferDesc;
TD3DVertexBufferDesc = packed record
TD3DVertexBufferDesc = record
dwSize : DWORD;
dwCaps : DWORD;
dwFVF : DWORD;
7186,35 → 4041,36
dwNumVertices : DWORD;
end;
 
D3DVERTEXBUFFERDESC = TD3DVertexBufferDesc;
LPD3DVERTEXBUFFERDESC = PD3DVertexBufferDesc;
 
{ These correspond to DDSCAPS_* flags }
 
const
(* These correspond to DDSCAPS_* flags *)
D3DVBCAPS_SYSTEMMEMORY = $00000800;
D3DVBCAPS_WRITEONLY = $00010000;
D3DVBCAPS_OPTIMIZED = $80000000;
D3DVBCAPS_DONOTCLIP = $00000001;
 
(* Vertex Operations for ProcessVertices *)
D3DVOP_LIGHT = (1 shl 10);
D3DVOP_TRANSFORM = (1 shl 0);
D3DVOP_CLIP = (1 shl 2);
D3DVOP_EXTENTS = (1 shl 3);
{ Vertex Operations for ProcessVertices }
 
(* The maximum number of vertices user can pass to any d3d
drawing function or to create vertex buffer with
*)
D3DMAXNUMVERTICES = ((1 shl 16) - 1);
(* The maximum number of primitives user can pass to any d3d
drawing function.
*)
D3DMAXNUMPRIMITIVES = ((1 shl 16) - 1);
D3DVOP_LIGHT = 1 shl 10;
D3DVOP_TRANSFORM = 1 shl 0;
D3DVOP_CLIP = 1 shl 2;
D3DVOP_EXTENTS = 1 shl 3;
 
(* Bits for dwFlags in ProcessVertices call *)
D3DPV_DONOTCOPYDATA = (1 shl 0);
{ The maximum number of vertices user can pass to any d3d
drawing function or to create vertex buffer with }
D3DMAXNUMVERTICES = (1 shl 16)-1;
 
//-------------------------------------------------------------------
{ The maximum number of primitives user can pass to any d3d drawing function. }
D3DMAXNUMPRIMITIVES = (1 shl 16)-1;
 
// Flexible vertex format bits
//
{ Bits for dwFlags in ProcessVertices call }
D3DPV_DONOTCOPYDATA = 1 shl 0;
 
{ Flexible vertex format bits }
 
D3DFVF_RESERVED0 = $001;
D3DFVF_POSITION_MASK = $00E;
D3DFVF_XYZ = $002;
7224,12 → 4080,10
D3DFVF_XYZB3 = $00a;
D3DFVF_XYZB4 = $00c;
D3DFVF_XYZB5 = $00e;
 
D3DFVF_NORMAL = $010;
D3DFVF_RESERVED1 = $020;
D3DFVF_DIFFUSE = $040;
D3DFVF_SPECULAR = $080;
 
D3DFVF_TEXCOUNT_MASK = $f00;
D3DFVF_TEXCOUNT_SHIFT = 8;
D3DFVF_TEX0 = $000;
7242,27 → 4096,30
D3DFVF_TEX7 = $700;
D3DFVF_TEX8 = $800;
 
D3DFVF_RESERVED2 = $f000; // 4 reserved bits
D3DFVF_RESERVED2 = $F000; // 4 reserved bits
 
D3DFVF_VERTEX = ( D3DFVF_XYZ or D3DFVF_NORMAL or D3DFVF_TEX1 );
D3DFVF_LVERTEX = ( D3DFVF_XYZ or D3DFVF_RESERVED1 or D3DFVF_DIFFUSE or
D3DFVF_SPECULAR or D3DFVF_TEX1 );
D3DFVF_TLVERTEX = ( D3DFVF_XYZRHW or D3DFVF_DIFFUSE or D3DFVF_SPECULAR or
D3DFVF_TEX1 );
D3DFVF_VERTEX = D3DFVF_XYZ or D3DFVF_NORMAL or D3DFVF_TEX1;
D3DFVF_LVERTEX = D3DFVF_XYZ or D3DFVF_RESERVED1 or D3DFVF_DIFFUSE or
D3DFVF_SPECULAR or D3DFVF_TEX1;
D3DFVF_TLVERTEX = D3DFVF_XYZRHW or D3DFVF_DIFFUSE or D3DFVF_SPECULAR or
D3DFVF_TEX1;
 
{ TD3DDP_PtrStride }
 
type
PD3DDP_PtrStride = ^TD3DDP_PtrStride;
TD3DDP_PtrStride = packed record
lpvData : pointer;
TD3DDP_PtrStride = record
lpvData: Pointer;
dwStride : DWORD;
end;
 
D3DDP_PTRSTRIDE = TD3DDP_PtrStride;
 
const
D3DDP_MAXTEXCOORD = 8;
 
type
PD3DDrawPrimitiveStridedData = ^TD3DDrawPrimitiveStridedData;
TD3DDrawPrimitiveStridedData = packed record
TD3DDrawPrimitiveStridedData = record
position : TD3DDP_PtrStride;
normal : TD3DDP_PtrStride;
diffuse : TD3DDP_PtrStride;
7270,57 → 4127,62
textureCoords : array [0..D3DDP_MAXTEXCOORD-1] of TD3DDP_PtrStride;
end;
 
//---------------------------------------------------------------------
// ComputeSphereVisibility return values
//
D3DDRAWPRIMITIVESTRIDEDDATA = TD3DDrawPrimitiveStridedData;
LPD3DDRAWPRIMITIVESTRIDEDDATA = PD3DDrawPrimitiveStridedData;
 
{ ComputeSphereVisibility return values }
 
const
D3DVIS_INSIDE_FRUSTUM = 0;
D3DVIS_INTERSECT_FRUSTUM = 1;
D3DVIS_OUTSIDE_FRUSTUM = 2;
D3DVIS_INSIDE_LEFT = 0;
D3DVIS_INTERSECT_LEFT = (1 shl 2);
D3DVIS_OUTSIDE_LEFT = (2 shl 2);
D3DVIS_INTERSECT_LEFT = 1 shl 2;
D3DVIS_OUTSIDE_LEFT = 2 shl 2;
D3DVIS_INSIDE_RIGHT = 0;
D3DVIS_INTERSECT_RIGHT = (1 shl 4);
D3DVIS_OUTSIDE_RIGHT = (2 shl 4);
D3DVIS_INTERSECT_RIGHT = 1 shl 4;
D3DVIS_OUTSIDE_RIGHT = 2 shl 4;
D3DVIS_INSIDE_TOP = 0;
D3DVIS_INTERSECT_TOP = (1 shl 6);
D3DVIS_OUTSIDE_TOP = (2 shl 6);
D3DVIS_INTERSECT_TOP = 1 shl 6;
D3DVIS_OUTSIDE_TOP = 2 shl 6;
D3DVIS_INSIDE_BOTTOM = 0;
D3DVIS_INTERSECT_BOTTOM = (1 shl 8);
D3DVIS_OUTSIDE_BOTTOM = (2 shl 8);
D3DVIS_INTERSECT_BOTTOM = 1 shl 8;
D3DVIS_OUTSIDE_BOTTOM = 2 shl 8;
D3DVIS_INSIDE_NEAR = 0;
D3DVIS_INTERSECT_NEAR = (1 shl 10);
D3DVIS_OUTSIDE_NEAR = (2 shl 10);
D3DVIS_INTERSECT_NEAR = 1 shl 10;
D3DVIS_OUTSIDE_NEAR = 2 shl 10;
D3DVIS_INSIDE_FAR = 0;
D3DVIS_INTERSECT_FAR = (1 shl 12);
D3DVIS_OUTSIDE_FAR = (2 shl 12);
D3DVIS_INTERSECT_FAR = 1 shl 12;
D3DVIS_OUTSIDE_FAR = 2 shl 12;
 
D3DVIS_MASK_FRUSTUM = (3 shl 0);
D3DVIS_MASK_LEFT = (3 shl 2);
D3DVIS_MASK_RIGHT = (3 shl 4);
D3DVIS_MASK_TOP = (3 shl 6);
D3DVIS_MASK_BOTTOM = (3 shl 8);
D3DVIS_MASK_NEAR = (3 shl 10);
D3DVIS_MASK_FAR = (3 shl 12);
D3DVIS_MASK_FRUSTUM = 3 shl 0;
D3DVIS_MASK_LEFT = 3 shl 2;
D3DVIS_MASK_RIGHT = 3 shl 4;
D3DVIS_MASK_TOP = 3 shl 6;
D3DVIS_MASK_BOTTOM = 3 shl 8;
D3DVIS_MASK_NEAR = 3 shl 10;
D3DVIS_MASK_FAR = 3 shl 12;
 
// To be used with GetInfo()
{ To be used with GetInfo() }
 
D3DDEVINFOID_TEXTUREMANAGER = 1;
D3DDEVINFOID_D3DTEXTUREMANAGER = 2;
D3DDEVINFOID_TEXTURING = 3;
 
type
PD3DStateBlockType = ^TD3DStateBlockType;
 
{ TD3DStateBlockType }
 
TD3DStateBlockType = (
D3DSBT_INVALID_0 ,
D3DSBT_ALL , // capture all state
D3DBST_INVALID_0,
D3DSBT_PIXELSTATE , // capture pixel state
D3DSBT_VERTEXSTATE // capture vertex state
);
 
// The D3DVERTEXBLENDFLAGS type is used with D3DRENDERSTATE_VERTEXBLEND state.
//
PD3DVertexBlendFlags = ^TD3DVertexBlendFlags;
D3DSTATEBLOCKTYPE = TD3DStateBlockType;
 
{ TD3DVertexBlendFlags }
 
TD3DVertexBlendFlags = (
D3DVBLEND_DISABLE , // Disable vertex blending
D3DVBLEND_1WEIGHT , // blend between 2 matrices
7328,20 → 4190,273
D3DVBLEND_3WEIGHTS // blend between 4 matrices
);
 
PD3DTextureTransformFlags = ^TD3DTextureTransformFlags;
D3DVERTEXBLENDFLAGS = TD3DVertexBlendFlags;
 
{ TD3DTextureTransformFlags }
 
TD3DTextureTransformFlags = (
D3DTTFF_DISABLE , // texture coordinates are passed directly
D3DTTFF_COUNT1 , // rasterizer should expect 1-D texture coords
D3DTTFF_COUNT2 , // rasterizer should expect 2-D texture coords
D3DTTFF_COUNT3 , // rasterizer should expect 3-D texture coords
D3DTTFF_COUNT4 // rasterizer should expect 4-D texture coords
D3DTTFF_COUNT4, // rasterizer should expect 4-D texture coords
D3DTIFF_INVALID_5,
D3DTIFF_INVALID_6,
D3DTIFF_INVALID_7,
D3DTIFF_INVALID_8,
D3DTIFF_INVALID_9,
D3DTIFF_INVALID_10,
D3DTIFF_INVALID_11,
D3DTIFF_INVALID_12,
D3DTIFF_INVALID_13,
D3DTIFF_INVALID_14,
D3DTIFF_INVALID_15,
D3DTIFF_INVALID_16,
D3DTIFF_INVALID_17,
D3DTIFF_INVALID_18,
D3DTIFF_INVALID_19,
D3DTIFF_INVALID_20,
D3DTIFF_INVALID_21,
D3DTIFF_INVALID_22,
D3DTIFF_INVALID_23,
D3DTIFF_INVALID_24,
D3DTIFF_INVALID_25,
D3DTIFF_INVALID_26,
D3DTIFF_INVALID_27,
D3DTIFF_INVALID_28,
D3DTIFF_INVALID_29,
D3DTIFF_INVALID_30,
D3DTIFF_INVALID_31,
D3DTIFF_INVALID_32,
D3DTIFF_INVALID_33,
D3DTIFF_INVALID_34,
D3DTIFF_INVALID_35,
D3DTIFF_INVALID_36,
D3DTIFF_INVALID_37,
D3DTIFF_INVALID_38,
D3DTIFF_INVALID_39,
D3DTIFF_INVALID_40,
D3DTIFF_INVALID_41,
D3DTIFF_INVALID_42,
D3DTIFF_INVALID_43,
D3DTIFF_INVALID_44,
D3DTIFF_INVALID_45,
D3DTIFF_INVALID_46,
D3DTIFF_INVALID_47,
D3DTIFF_INVALID_48,
D3DTIFF_INVALID_49,
D3DTIFF_INVALID_50,
D3DTIFF_INVALID_51,
D3DTIFF_INVALID_52,
D3DTIFF_INVALID_53,
D3DTIFF_INVALID_54,
D3DTIFF_INVALID_55,
D3DTIFF_INVALID_56,
D3DTIFF_INVALID_57,
D3DTIFF_INVALID_58,
D3DTIFF_INVALID_59,
D3DTIFF_INVALID_60,
D3DTIFF_INVALID_61,
D3DTIFF_INVALID_62,
D3DTIFF_INVALID_63,
D3DTIFF_INVALID_64,
D3DTIFF_INVALID_65,
D3DTIFF_INVALID_66,
D3DTIFF_INVALID_67,
D3DTIFF_INVALID_68,
D3DTIFF_INVALID_69,
D3DTIFF_INVALID_70,
D3DTIFF_INVALID_71,
D3DTIFF_INVALID_72,
D3DTIFF_INVALID_73,
D3DTIFF_INVALID_74,
D3DTIFF_INVALID_75,
D3DTIFF_INVALID_76,
D3DTIFF_INVALID_77,
D3DTIFF_INVALID_78,
D3DTIFF_INVALID_79,
D3DTIFF_INVALID_80,
D3DTIFF_INVALID_81,
D3DTIFF_INVALID_82,
D3DTIFF_INVALID_83,
D3DTIFF_INVALID_84,
D3DTIFF_INVALID_85,
D3DTIFF_INVALID_86,
D3DTIFF_INVALID_87,
D3DTIFF_INVALID_88,
D3DTIFF_INVALID_89,
D3DTIFF_INVALID_90,
D3DTIFF_INVALID_91,
D3DTIFF_INVALID_92,
D3DTIFF_INVALID_93,
D3DTIFF_INVALID_94,
D3DTIFF_INVALID_95,
D3DTIFF_INVALID_96,
D3DTIFF_INVALID_97,
D3DTIFF_INVALID_98,
D3DTIFF_INVALID_99,
D3DTIFF_INVALID_100,
D3DTIFF_INVALID_101,
D3DTIFF_INVALID_102,
D3DTIFF_INVALID_103,
D3DTIFF_INVALID_104,
D3DTIFF_INVALID_105,
D3DTIFF_INVALID_106,
D3DTIFF_INVALID_107,
D3DTIFF_INVALID_108,
D3DTIFF_INVALID_109,
D3DTIFF_INVALID_110,
D3DTIFF_INVALID_111,
D3DTIFF_INVALID_112,
D3DTIFF_INVALID_113,
D3DTIFF_INVALID_114,
D3DTIFF_INVALID_115,
D3DTIFF_INVALID_116,
D3DTIFF_INVALID_117,
D3DTIFF_INVALID_118,
D3DTIFF_INVALID_119,
D3DTIFF_INVALID_120,
D3DTIFF_INVALID_121,
D3DTIFF_INVALID_122,
D3DTIFF_INVALID_123,
D3DTIFF_INVALID_124,
D3DTIFF_INVALID_125,
D3DTIFF_INVALID_126,
D3DTIFF_INVALID_127,
D3DTIFF_INVALID_128,
D3DTIFF_INVALID_129,
D3DTIFF_INVALID_130,
D3DTIFF_INVALID_131,
D3DTIFF_INVALID_132,
D3DTIFF_INVALID_133,
D3DTIFF_INVALID_134,
D3DTIFF_INVALID_135,
D3DTIFF_INVALID_136,
D3DTIFF_INVALID_137,
D3DTIFF_INVALID_138,
D3DTIFF_INVALID_139,
D3DTIFF_INVALID_140,
D3DTIFF_INVALID_141,
D3DTIFF_INVALID_142,
D3DTIFF_INVALID_143,
D3DTIFF_INVALID_144,
D3DTIFF_INVALID_145,
D3DTIFF_INVALID_146,
D3DTIFF_INVALID_147,
D3DTIFF_INVALID_148,
D3DTIFF_INVALID_149,
D3DTIFF_INVALID_150,
D3DTIFF_INVALID_151,
D3DTIFF_INVALID_152,
D3DTIFF_INVALID_153,
D3DTIFF_INVALID_154,
D3DTIFF_INVALID_155,
D3DTIFF_INVALID_156,
D3DTIFF_INVALID_157,
D3DTIFF_INVALID_158,
D3DTIFF_INVALID_159,
D3DTIFF_INVALID_160,
D3DTIFF_INVALID_161,
D3DTIFF_INVALID_162,
D3DTIFF_INVALID_163,
D3DTIFF_INVALID_164,
D3DTIFF_INVALID_165,
D3DTIFF_INVALID_166,
D3DTIFF_INVALID_167,
D3DTIFF_INVALID_168,
D3DTIFF_INVALID_169,
D3DTIFF_INVALID_170,
D3DTIFF_INVALID_171,
D3DTIFF_INVALID_172,
D3DTIFF_INVALID_173,
D3DTIFF_INVALID_174,
D3DTIFF_INVALID_175,
D3DTIFF_INVALID_176,
D3DTIFF_INVALID_177,
D3DTIFF_INVALID_178,
D3DTIFF_INVALID_179,
D3DTIFF_INVALID_180,
D3DTIFF_INVALID_181,
D3DTIFF_INVALID_182,
D3DTIFF_INVALID_183,
D3DTIFF_INVALID_184,
D3DTIFF_INVALID_185,
D3DTIFF_INVALID_186,
D3DTIFF_INVALID_187,
D3DTIFF_INVALID_188,
D3DTIFF_INVALID_189,
D3DTIFF_INVALID_190,
D3DTIFF_INVALID_191,
D3DTIFF_INVALID_192,
D3DTIFF_INVALID_193,
D3DTIFF_INVALID_194,
D3DTIFF_INVALID_195,
D3DTIFF_INVALID_196,
D3DTIFF_INVALID_197,
D3DTIFF_INVALID_198,
D3DTIFF_INVALID_199,
D3DTIFF_INVALID_200,
D3DTIFF_INVALID_201,
D3DTIFF_INVALID_202,
D3DTIFF_INVALID_203,
D3DTIFF_INVALID_204,
D3DTIFF_INVALID_205,
D3DTIFF_INVALID_206,
D3DTIFF_INVALID_207,
D3DTIFF_INVALID_208,
D3DTIFF_INVALID_209,
D3DTIFF_INVALID_210,
D3DTIFF_INVALID_211,
D3DTIFF_INVALID_212,
D3DTIFF_INVALID_213,
D3DTIFF_INVALID_214,
D3DTIFF_INVALID_215,
D3DTIFF_INVALID_216,
D3DTIFF_INVALID_217,
D3DTIFF_INVALID_218,
D3DTIFF_INVALID_219,
D3DTIFF_INVALID_220,
D3DTIFF_INVALID_221,
D3DTIFF_INVALID_222,
D3DTIFF_INVALID_223,
D3DTIFF_INVALID_224,
D3DTIFF_INVALID_225,
D3DTIFF_INVALID_226,
D3DTIFF_INVALID_227,
D3DTIFF_INVALID_228,
D3DTIFF_INVALID_229,
D3DTIFF_INVALID_230,
D3DTIFF_INVALID_231,
D3DTIFF_INVALID_232,
D3DTIFF_INVALID_233,
D3DTIFF_INVALID_234,
D3DTIFF_INVALID_235,
D3DTIFF_INVALID_236,
D3DTIFF_INVALID_237,
D3DTIFF_INVALID_238,
D3DTIFF_INVALID_239,
D3DTIFF_INVALID_240,
D3DTIFF_INVALID_241,
D3DTIFF_INVALID_242,
D3DTIFF_INVALID_243,
D3DTIFF_INVALID_244,
D3DTIFF_INVALID_245,
D3DTIFF_INVALID_246,
D3DTIFF_INVALID_247,
D3DTIFF_INVALID_248,
D3DTIFF_INVALID_249,
D3DTIFF_INVALID_250,
D3DTIFF_INVALID_251,
D3DTIFF_INVALID_252,
D3DTIFF_INVALID_253,
D3DTIFF_INVALID_254,
D3DTIFF_INVALID_255,
D3DTTFF_PROJECTED // texcoords to be divided by COUNTth element
);
 
{ Macros to set texture coordinate format bits in the FVF id }
 
const
D3DTTFF_PROJECTED = TD3DTextureTransformFlags(256); // texcoords to be divided by COUNTth element
 
// Macros to set texture coordinate format bits in the FVF id
 
D3DFVF_TEXTUREFORMAT2 = 0; // Two floating point values
D3DFVF_TEXTUREFORMAT1 = 3; // One floating point value
D3DFVF_TEXTUREFORMAT3 = 1; // Three floating point values
7354,6 → 4469,7
 
(*==========================================================================;
*
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
*
* File: d3dcaps.h
* Content: Direct3D capabilities include file
7360,46 → 4476,52
*
***************************************************************************)
 
(* Description of capabilities of transform *)
{ Description of capabilities of transform }
 
type
PD3DTransformCaps = ^TD3DTransformCaps;
TD3DTransformCaps = packed record
TD3DTransformCaps = record
dwSize: DWORD;
dwCaps: DWORD;
end;
 
D3DTRANSFORMCAPS = TD3DTransformCaps;
LPD3DTRANSFORMCAPS = PD3DTransformCaps;
 
const
D3DTRANSFORMCAPS_CLIP = $00000001; (* Will clip whilst transforming *)
D3DTRANSFORMCAPS_CLIP = $00000001; // Will clip whilst transforming
 
(* Description of capabilities of lighting *)
{ Description of capabilities of lighting }
 
type
PD3DLightingCaps = ^TD3DLightingCaps;
TD3DLightingCaps = packed record
TD3DLightingCaps = record
dwSize: DWORD;
dwCaps: DWORD; (* Lighting caps *)
dwLightingModel: DWORD; (* Lighting model - RGB or mono *)
dwNumLights: DWORD; (* Number of lights that can be handled *)
dwCaps: DWORD; // Lighting caps
dwLightingModel: DWORD; // Lighting model - RGB or mono
dwNumLights: DWORD; // Number of lights that can be handled
end;
 
D3DLIGHTINGCAPS = TD3DLightingCaps;
LPD3DLIGHTINGCAPS = PD3DLightingCaps;
 
const
D3DLIGHTINGMODEL_RGB = $00000001;
D3DLIGHTINGMODEL_MONO = $00000002;
 
D3DLIGHTCAPS_POINT = $00000001; (* Point lights supported *)
D3DLIGHTCAPS_SPOT = $00000002; (* Spot lights supported *)
D3DLIGHTCAPS_DIRECTIONAL = $00000004; (* Directional lights supported *)
D3DLIGHTCAPS_PARALLELPOINT = $00000008; (* Parallel point lights supported *)
D3DLIGHTCAPS_GLSPOT = $00000010; (* GL syle spot lights supported *)
D3DLIGHTCAPS_POINT = $00000001; // Point lights supported
D3DLIGHTCAPS_SPOT = $00000002; // Spot lights supported
D3DLIGHTCAPS_DIRECTIONAL = $00000004; // Directional lights supported
D3DLIGHTCAPS_PARALLELPOINT = $00000008; // Parallel point lights supported
D3DLIGHTCAPS_GLSPOT = $00000010; // GL syle spot lights supported
 
(* Description of capabilities for each primitive type *)
{ Description of capabilities for each primitive type }
 
type
PD3DPrimCaps = ^TD3DPrimCaps;
TD3DPrimCaps = packed record
TD3DPrimCaps = record
dwSize: DWORD;
dwMiscCaps: DWORD; (* Capability flags *)
dwMiscCaps: DWORD; // Capability flags
dwRasterCaps: DWORD;
dwZCmpCaps: DWORD;
dwSrcBlendCaps: DWORD;
7410,13 → 4532,16
dwTextureFilterCaps: DWORD;
dwTextureBlendCaps: DWORD;
dwTextureAddressCaps: DWORD;
dwStippleWidth: DWORD; (* maximum width and height of *)
dwStippleHeight: DWORD; (* of supported stipple (up to 32x32) *)
dwStippleWidth: DWORD; // maximum width and height of
dwStippleHeight: DWORD; // of supported stipple (up to 32x32)
end;
 
D3DPRIMCAPS = TD3DPrimCaps;
LPD3DPRIMCAPS = PD3DPrimCaps;
 
{ TD3DPrimCaps dwMiscCaps }
 
const
(* TD3DPrimCaps dwMiscCaps *)
 
D3DPMISCCAPS_MASKPLANES = $00000001;
D3DPMISCCAPS_MASKZ = $00000002;
D3DPMISCCAPS_LINEPATTERNREP = $00000004;
7425,7 → 4550,7
D3DPMISCCAPS_CULLCW = $00000020;
D3DPMISCCAPS_CULLCCW = $00000040;
 
(* TD3DPrimCaps dwRasterCaps *)
{ TD3DPrimCaps dwRasterCaps }
 
D3DPRASTERCAPS_DITHER = $00000001;
D3DPRASTERCAPS_ROP2 = $00000002;
7450,9 → 4575,8
D3DPRASTERCAPS_WFOG = $00100000;
D3DPRASTERCAPS_ZFOG = $00200000;
 
(* TD3DPrimCaps dwZCmpCaps, dwAlphaCmpCaps *)
{ TD3DPrimCaps dwZCmpCaps, dwAlphaCmpCaps }
 
const
D3DPCMPCAPS_NEVER = $00000001;
D3DPCMPCAPS_LESS = $00000002;
D3DPCMPCAPS_EQUAL = $00000004;
7462,7 → 4586,7
D3DPCMPCAPS_GREATEREQUAL = $00000040;
D3DPCMPCAPS_ALWAYS = $00000080;
 
(* TD3DPrimCaps dwSourceBlendCaps, dwDestBlendCaps *)
{ TD3DPrimCaps dwSourceBlendCaps, dwDestBlendCaps }
 
D3DPBLENDCAPS_ZERO = $00000001;
D3DPBLENDCAPS_ONE = $00000002;
7478,7 → 4602,7
D3DPBLENDCAPS_BOTHSRCALPHA = $00000800;
D3DPBLENDCAPS_BOTHINVSRCALPHA = $00001000;
 
(* TD3DPrimCaps dwShadeCaps *)
{ TD3DPrimCaps dwShadeCaps }
 
D3DPSHADECAPS_COLORFLATMONO = $00000001;
D3DPSHADECAPS_COLORFLATRGB = $00000002;
7505,75 → 4629,23
D3DPSHADECAPS_FOGGOURAUD = $00080000;
D3DPSHADECAPS_FOGPHONG = $00100000;
 
(* TD3DPrimCaps dwTextureCaps *)
{ TD3DPrimCaps dwTextureCaps }
 
(*
* Perspective-correct texturing is supported
*)
D3DPTEXTURECAPS_PERSPECTIVE = $00000001;
 
(*
* Power-of-2 texture dimensions are required
*)
D3DPTEXTURECAPS_POW2 = $00000002;
 
(*
* Alpha in texture pixels is supported
*)
D3DPTEXTURECAPS_ALPHA = $00000004;
 
(*
* Color-keyed textures are supported
*)
D3DPTEXTURECAPS_TRANSPARENCY = $00000008;
 
(*
* obsolete, see D3DPTADDRESSCAPS_BORDER
*)
D3DPTEXTURECAPS_BORDER = $00000010;
 
(*
* Only square textures are supported
*)
D3DPTEXTURECAPS_SQUAREONLY = $00000020;
 
(*
* Texture indices are not scaled by the texture size prior
* to interpolation.
*)
D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE = $00000040;
 
(*
* Device can draw alpha from texture palettes
*)
D3DPTEXTURECAPS_ALPHAPALETTE = $00000080;
 
(*
* Device can use non-POW2 textures if:
* 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage
* 2) D3DRS_WRAP(N) is zero for this texture's coordinates
* 3) mip mapping is not enabled (use magnification filter only)
*)
D3DPTEXTURECAPS_NONPOW2CONDITIONAL = $00000100;
 
// 0x00000200L unused
 
(*
* Device can divide transformed texture coordinates by the
* COUNTth texture coordinate (can do D3DTTFF_PROJECTED)
*)
D3DPTEXTURECAPS_PROJECTED = $00000400;
 
(*
* Device can do cubemap textures
*)
D3DPTEXTURECAPS_CUBEMAP = $00000800;
 
D3DPTEXTURECAPS_COLORKEYBLEND = $00001000;
 
{ TD3DPrimCaps dwTextureFilterCaps }
 
(* TD3DPrimCaps dwTextureFilterCaps *)
 
D3DPTFILTERCAPS_NEAREST = $00000001;
D3DPTFILTERCAPS_LINEAR = $00000002;
D3DPTFILTERCAPS_MIPNEAREST = $00000004;
7581,16 → 4653,19
D3DPTFILTERCAPS_LINEARMIPNEAREST = $00000010;
D3DPTFILTERCAPS_LINEARMIPLINEAR = $00000020;
 
(* Device3 Min Filter *)
{ Device3 Min Filter }
 
D3DPTFILTERCAPS_MINFPOINT = $00000100;
D3DPTFILTERCAPS_MINFLINEAR = $00000200;
D3DPTFILTERCAPS_MINFANISOTROPIC = $00000400;
 
(* Device3 Mip Filter *)
{ Device3 Mip Filter }
 
D3DPTFILTERCAPS_MIPFPOINT = $00010000;
D3DPTFILTERCAPS_MIPFLINEAR = $00020000;
 
(* Device3 Mag Filter *)
{ Device3 Mag Filter }
 
D3DPTFILTERCAPS_MAGFPOINT = $01000000;
D3DPTFILTERCAPS_MAGFLINEAR = $02000000;
D3DPTFILTERCAPS_MAGFANISOTROPIC = $04000000;
7597,7 → 4672,7
D3DPTFILTERCAPS_MAGFAFLATCUBIC = $08000000;
D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC = $10000000;
 
(* TD3DPrimCaps dwTextureBlendCaps *)
{ TD3DPrimCaps dwTextureBlendCaps }
 
D3DPTBLENDCAPS_DECAL = $00000001;
D3DPTBLENDCAPS_MODULATE = $00000002;
7608,7 → 4683,8
D3DPTBLENDCAPS_COPY = $00000040;
D3DPTBLENDCAPS_ADD = $00000080;
 
(* TD3DPrimCaps dwTextureAddressCaps *)
{ TD3DPrimCaps dwTextureAddressCaps }
 
D3DPTADDRESSCAPS_WRAP = $00000001;
D3DPTADDRESSCAPS_MIRROR = $00000002;
D3DPTADDRESSCAPS_CLAMP = $00000004;
7615,7 → 4691,7
D3DPTADDRESSCAPS_BORDER = $00000008;
D3DPTADDRESSCAPS_INDEPENDENTUV = $00000010;
 
(* D3DDEVICEDESC dwStencilCaps *)
{ D3DDEVICEDESC dwStencilCaps }
 
D3DSTENCILCAPS_KEEP = $00000001;
D3DSTENCILCAPS_ZERO = $00000002;
7626,7 → 4702,7
D3DSTENCILCAPS_INCR = $00000040;
D3DSTENCILCAPS_DECR = $00000080;
 
(* D3DDEVICEDESC dwTextureOpCaps *)
{ D3DDEVICEDESC dwTextureOpCaps }
 
D3DTEXOPCAPS_DISABLE = $00000001;
D3DTEXOPCAPS_SELECTARG1 = $00000002;
7653,41 → 4729,77
D3DTEXOPCAPS_BUMPENVMAPLUMINANCE = $00400000;
D3DTEXOPCAPS_DOTPRODUCT3 = $00800000;
 
(* D3DDEVICEDESC dwFVFCaps flags *)
{ D3DDEVICEDESC dwFVFCaps flags }
 
D3DFVFCAPS_TEXCOORDCOUNTMASK = $0000ffff; (* mask for texture coordinate count field *)
D3DFVFCAPS_DONOTSTRIPELEMENTS = $00080000; (* Device prefers that vertex elements not be stripped *)
D3DFVFCAPS_TEXCOORDCOUNTMASK = $0000ffff; // mask for texture coordinate count field
D3DFVFCAPS_DONOTSTRIPELEMENTS = $00080000; // Device prefers that vertex elements not be stripped
 
(*
* Description for a device.
* This is used to describe a device that is to be created or to query
* the current device.
*)
{ Description for a device. }
 
type
PD3DDeviceDesc = ^TD3DDeviceDesc;
TD3DDeviceDesc = packed record
dwSize: DWORD; (* Size of TD3DDeviceDesc structure *)
dwFlags: DWORD; (* Indicates which fields have valid data *)
dcmColorModel: TD3DColorModel; (* Color model of device *)
dwDevCaps: DWORD; (* Capabilities of device *)
dtcTransformCaps: TD3DTransformCaps; (* Capabilities of transform *)
bClipping: BOOL; (* Device can do 3D clipping *)
dlcLightingCaps: TD3DLightingCaps; (* Capabilities of lighting *)
PD3DDeviceDesc_DX3 = ^TD3DDeviceDesc_DX3;
TD3DDeviceDesc_DX3 = record
dwSize: DWORD; // Size of D3DDEVICEDESC structure
dwFlags: DWORD; // Indicates which fields have valid data
dcmColorModel: TD3DColorModel; // Color model of device
dwDevCaps: DWORD; // Capabilities of device
dtcTransformCaps: TD3DTransformCaps; // Capabilities of transform
bClipping: BOOL; // Device can do 3D clipping
dlcLightingCaps: TD3DLightingCaps; // Capabilities of lighting
dpcLineCaps: TD3DPrimCaps;
dpcTriCaps: TD3DPrimCaps;
dwDeviceRenderBitDepth: DWORD; (* One of DDBB_8, 16, etc.. *)
dwDeviceZBufferBitDepth: DWORD; (* One of DDBD_16, 32, etc.. *)
dwMaxBufferSize: DWORD; (* Maximum execute buffer size *)
dwMaxVertexCount: DWORD; (* Maximum vertex count *)
// *** New fields for DX5 *** //
dwDeviceRenderBitDepth: DWORD; // One of DDBB_8, 16, etc..
dwDeviceZBufferBitDepth: DWORD; // One of DDBD_16, 32, etc..
dwMaxBufferSize: DWORD; // Maximum execute buffer size
dwMaxVertexCount: DWORD; // Maximum vertex count
end;
 
PD3DDeviceDesc_DX5 = ^TD3DDeviceDesc_DX5;
TD3DDeviceDesc_DX5 = record
dwSize: DWORD; // Size of D3DDEVICEDESC structure
dwFlags: DWORD; // Indicates which fields have valid data
dcmColorModel: TD3DColorModel; // Color model of device
dwDevCaps: DWORD; // Capabilities of device
dtcTransformCaps: TD3DTransformCaps; // Capabilities of transform
bClipping: BOOL; // Device can do 3D clipping
dlcLightingCaps: TD3DLightingCaps; // Capabilities of lighting
dpcLineCaps: TD3DPrimCaps;
dpcTriCaps: TD3DPrimCaps;
dwDeviceRenderBitDepth: DWORD; // One of DDBB_8, 16, etc..
dwDeviceZBufferBitDepth: DWORD; // One of DDBD_16, 32, etc..
dwMaxBufferSize: DWORD; // Maximum execute buffer size
dwMaxVertexCount: DWORD; // Maximum vertex count
// New fields for DX5
// Width and height caps are 0 for legacy HALs.
dwMinTextureWidth, dwMinTextureHeight : DWORD;
dwMaxTextureWidth, dwMaxTextureHeight : DWORD;
dwMinStippleWidth, dwMaxStippleWidth : DWORD;
dwMinStippleHeight, dwMaxStippleHeight : DWORD;
end;
 
PD3DDeviceDesc_DX6 = ^TD3DDeviceDesc_DX6;
TD3DDeviceDesc_DX6 = record
dwSize: DWORD; // Size of D3DDEVICEDESC structure
dwFlags: DWORD; // Indicates which fields have valid data
dcmColorModel: TD3DColorModel; // Color model of device
dwDevCaps: DWORD; // Capabilities of device
dtcTransformCaps: TD3DTransformCaps; // Capabilities of transform
bClipping: BOOL; // Device can do 3D clipping
dlcLightingCaps: TD3DLightingCaps; // Capabilities of lighting
dpcLineCaps: TD3DPrimCaps;
dpcTriCaps: TD3DPrimCaps;
dwDeviceRenderBitDepth: DWORD; // One of DDBB_8, 16, etc..
dwDeviceZBufferBitDepth: DWORD; // One of DDBD_16, 32, etc..
dwMaxBufferSize: DWORD; // Maximum execute buffer size
dwMaxVertexCount: DWORD; // Maximum vertex count
 
// New fields for DX5
// Width and height caps are 0 for legacy HALs.
dwMinTextureWidth, dwMinTextureHeight : DWORD;
dwMaxTextureWidth, dwMaxTextureHeight : DWORD;
dwMinStippleWidth, dwMaxStippleWidth : DWORD;
dwMinStippleHeight, dwMaxStippleHeight : DWORD;
 
// New fields for DX6
dwMaxTextureRepeat : DWORD;
dwMaxTextureAspectRatio : DWORD;
7700,26 → 4812,43
dvGuardBandTop : TD3DValue;
dvGuardBandRight : TD3DValue;
dvGuardBandBottom : TD3DValue;
 
dvExtentsAdjust : TD3DValue;
dwStencilCaps : DWORD;
 
dwFVFCaps : DWORD; (* low 4 bits: 0 implies TLVERTEX only, 1..8 imply FVF aware *)
dwFVFCaps: DWORD; // low 4 bits: 0 implies TLVERTEX only, 1..8 imply FVF aware
dwTextureOpCaps : DWORD;
wMaxTextureBlendStages : WORD;
wMaxSimultaneousTextures : WORD;
wMaxTextureBlendStages: Word;
wMaxSimultaneousTextures: Word;
end;
 
{$IFDEF DirectX3}
TD3DDeviceDesc = TD3DDeviceDesc_DX3;
PD3DDeviceDesc = PD3DDeviceDesc_DX3;
{$ENDIF}{$IFDEF DirectX5}
TD3DDeviceDesc = TD3DDeviceDesc_DX5;
PD3DDeviceDesc = PD3DDeviceDesc_DX5;
{$ENDIF}{$IFDEF DirectX6}
TD3DDeviceDesc = TD3DDeviceDesc_DX6;
PD3DDeviceDesc = PD3DDeviceDesc_DX6;
{$ENDIF}{$IFDEF DirectX7}
TD3DDeviceDesc = TD3DDeviceDesc_DX6;
PD3DDeviceDesc = PD3DDeviceDesc_DX6;
{$ENDIF}
 
D3DDEVICEDESC = TD3DDeviceDesc;
LPD3DDEVICEDESC = PD3DDeviceDesc;
 
PD3DDeviceDesc7 = ^TD3DDeviceDesc7;
TD3DDeviceDesc7 = packed record
dwDevCaps: DWORD; (* Capabilities of device *)
TD3DDeviceDesc7 = record
dwDevCaps: DWORD;
dpcLineCaps: TD3DPrimCaps;
dpcTriCaps: TD3DPrimCaps;
dwDeviceRenderBitDepth: DWORD; (* One of DDBB_8, 16, etc.. *)
dwDeviceZBufferBitDepth: DWORD; (* One of DDBD_16, 32, etc.. *)
dwDeviceRenderBitDepth: DWORD;
dwDeviceZBufferBitDepth: DWORD;
 
dwMinTextureWidth, dwMinTextureHeight: DWORD;
dwMaxTextureWidth, dwMaxTextureHeight: DWORD;
dwMinTextureWidth: DWORD;
dwMinTextureHeight: DWORD;
dwMaxTextureWidth: DWORD;
dwMaxTextureHeight: DWORD;
 
dwMaxTextureRepeat: DWORD;
dwMaxTextureAspectRatio: DWORD;
7735,15 → 4864,15
 
dwFVFCaps: DWORD;
dwTextureOpCaps: DWORD;
wMaxTextureBlendStages: WORD;
wMaxSimultaneousTextures: WORD;
wMaxTextureBlendStages: Word;
wMaxSimultaneousTextures: Word;
 
dwMaxActiveLights: DWORD;
dvMaxVertexW: TD3DValue;
deviceGUID: TGUID;
 
wMaxUserClipPlanes: WORD;
wMaxVertexBlendMatrices: WORD;
wMaxUserClipPlanes: Word;
wMaxVertexBlendMatrices: Word;
 
dwVertexProcessingCaps: DWORD;
 
7753,102 → 4882,91
dwReserved4: DWORD;
end;
 
const
D3DDEVICEDESCSIZE = sizeof(TD3DDeviceDesc);
D3DDEVICEDESC7SIZE = sizeof(TD3DDeviceDesc7);
 
type
TD3DEnumDevicesCallbackA = function (lpGuid: PGUID; // nil for the default device
lpDeviceDescription: PAnsiChar; lpDeviceName: PAnsiChar;
var lpD3DHWDeviceDesc: TD3DDeviceDesc;
var lpD3DHELDeviceDesc: TD3DDeviceDesc;
lpContext : pointer) : HResult; stdcall;
TD3DEnumDevicesCallback = TD3DEnumDevicesCallbackA;
TD3DEnumDevicesCallback = function(const lpGuid: TGUID;
lpDeviceDescription: LPSTR; lpDeviceName: LPSTR;
const lpD3DHWDeviceDesc: TD3DDeviceDesc;
const lpD3DHELDeviceDesc: TD3DDeviceDesc;
lpUserArg: Pointer): HResult; stdcall;
 
TD3DEnumDevicesCallback7A = function (
lpDeviceDescription: PAnsiChar; lpDeviceName: PAnsiChar;
const lpD3DDeviceDesc: TD3DDeviceDesc7; lpContext: Pointer) : HResult; stdcall;
TD3DEnumDevicesCallback7 = TD3DEnumDevicesCallback7A;
LPD3DENUMDEVICESCALLBACK = TD3DEnumDevicesCallback;
 
(* TD3DDeviceDesc dwFlags indicating valid fields *)
TD3DEnumDevicesCallback7 = function(lpDeviceDescription: LPSTR; lpDeviceName: LPSTR;
const lpD3DDeviceDesc: TD3DDeviceDesc7; lpUserArg: Pointer): HResult; stdcall;
 
LPD3DENUMDEVICESCALLBACK7 = TD3DEnumDevicesCallback7;
 
{ TD3DDeviceDesc dwFlags indicating valid fields }
 
const
D3DDD_COLORMODEL = $00000001; (* dcmColorModel is valid *)
D3DDD_DEVCAPS = $00000002; (* dwDevCaps is valid *)
D3DDD_TRANSFORMCAPS = $00000004; (* dtcTransformCaps is valid *)
D3DDD_LIGHTINGCAPS = $00000008; (* dlcLightingCaps is valid *)
D3DDD_BCLIPPING = $00000010; (* bClipping is valid *)
D3DDD_LINECAPS = $00000020; (* dpcLineCaps is valid *)
D3DDD_TRICAPS = $00000040; (* dpcTriCaps is valid *)
D3DDD_DEVICERENDERBITDEPTH = $00000080; (* dwDeviceRenderBitDepth is valid *)
D3DDD_DEVICEZBUFFERBITDEPTH = $00000100; (* dwDeviceZBufferBitDepth is valid *)
D3DDD_MAXBUFFERSIZE = $00000200; (* dwMaxBufferSize is valid *)
D3DDD_MAXVERTEXCOUNT = $00000400; (* dwMaxVertexCount is valid *)
D3DDD_COLORMODEL = $00000001; // dcmColorModel is valid
D3DDD_DEVCAPS = $00000002; // dwDevCaps is valid
D3DDD_TRANSFORMCAPS = $00000004; // dtcTransformCaps is valid
D3DDD_LIGHTINGCAPS = $00000008; // dlcLightingCaps is valid
D3DDD_BCLIPPING = $00000010; // bClipping is valid
D3DDD_LINECAPS = $00000020; // dpcLineCaps is valid
D3DDD_TRICAPS = $00000040; // dpcTriCaps is valid
D3DDD_DEVICERENDERBITDEPTH = $00000080; // dwDeviceRenderBitDepth is valid
D3DDD_DEVICEZBUFFERBITDEPTH = $00000100; // dwDeviceZBufferBitDepth is valid
D3DDD_MAXBUFFERSIZE = $00000200; // dwMaxBufferSize is valid
D3DDD_MAXVERTEXCOUNT = $00000400; // dwMaxVertexCount is valid
 
(* TD3DDeviceDesc dwDevCaps flags *)
{ TD3DDeviceDesc dwDevCaps flags }
 
D3DDEVCAPS_FLOATTLVERTEX = $00000001; (* Device accepts floating point *)
(* for post-transform vertex data *)
D3DDEVCAPS_SORTINCREASINGZ = $00000002; (* Device needs data sorted for increasing Z*)
D3DDEVCAPS_SORTDECREASINGZ = $00000004; (* Device needs data sorted for decreasing Z*)
D3DDEVCAPS_SORTEXACT = $00000008; (* Device needs data sorted exactly *)
D3DDEVCAPS_FLOATTLVERTEX = $00000001; // Device accepts floating point
// for post-transform vertex data
D3DDEVCAPS_SORTINCREASINGZ = $00000002; // Device needs data sorted for increasing Z
D3DDEVCAPS_SORTDECREASINGZ = $00000004; // Device needs data sorted for decreasing Z
D3DDEVCAPS_SORTEXACT = $00000008; // Device needs data sorted exactly
 
D3DDEVCAPS_EXECUTESYSTEMMEMORY = $00000010; (* Device can use execute buffers from system memory *)
D3DDEVCAPS_EXECUTEVIDEOMEMORY = $00000020; (* Device can use execute buffers from video memory *)
D3DDEVCAPS_TLVERTEXSYSTEMMEMORY = $00000040; (* Device can use TL buffers from system memory *)
D3DDEVCAPS_TLVERTEXVIDEOMEMORY = $00000080; (* Device can use TL buffers from video memory *)
D3DDEVCAPS_TEXTURESYSTEMMEMORY = $00000100; (* Device can texture from system memory *)
D3DDEVCAPS_TEXTUREVIDEOMEMORY = $00000200; (* Device can texture from device memory *)
D3DDEVCAPS_DRAWPRIMTLVERTEX = $00000400; (* Device can draw TLVERTEX primitives *)
D3DDEVCAPS_CANRENDERAFTERFLIP = $00000800; (* Device can render without waiting for flip to complete *)
D3DDEVCAPS_TEXTURENONLOCALVIDMEM = $00001000; (* Device can texture from nonlocal video memory *)
D3DDEVCAPS_DRAWPRIMITIVES2 = $00002000; (* Device can support DrawPrimitives2 *)
D3DDEVCAPS_SEPARATETEXTUREMEMORIES = $00004000; (* Device is texturing from separate memory pools *)
D3DDEVCAPS_DRAWPRIMITIVES2EX = $00008000; (* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*)
D3DDEVCAPS_HWTRANSFORMANDLIGHT = $00010000; (* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also *)
D3DDEVCAPS_CANBLTSYSTONONLOCAL = $00020000; (* Device supports a Tex Blt from system memory to non-local vidmem *)
D3DDEVCAPS_HWRASTERIZATION = $00080000; (* Device has HW acceleration for rasterization *)
D3DDEVCAPS_EXECUTESYSTEMMEMORY = $00000010; // Device can use execute buffers from system memory
D3DDEVCAPS_EXECUTEVIDEOMEMORY = $00000020; // Device can use execute buffers from video memory
D3DDEVCAPS_TLVERTEXSYSTEMMEMORY = $00000040; // Device can use TL buffers from system memory
D3DDEVCAPS_TLVERTEXVIDEOMEMORY = $00000080; // Device can use TL buffers from video memory
D3DDEVCAPS_TEXTURESYSTEMMEMORY = $00000100; // Device can texture from system memory
D3DDEVCAPS_TEXTUREVIDEOMEMORY = $00000200; // Device can texture from device memory
D3DDEVCAPS_DRAWPRIMTLVERTEX = $00000400; // Device can draw TLVERTEX primitives
D3DDEVCAPS_CANRENDERAFTERFLIP = $00000800; // Device can render without waiting for flip to complete
D3DDEVCAPS_TEXTURENONLOCALVIDMEM = $00001000; // Device can texture from nonlocal video memory
D3DDEVCAPS_DRAWPRIMITIVES2 = $00002000; // Device can support DrawPrimitives2
D3DDEVCAPS_SEPARATETEXTUREMEMORIES = $00004000; // Device is texturing from separate memory pools
D3DDEVCAPS_DRAWPRIMITIVES2EX = $00008000; // Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver
D3DDEVCAPS_HWTRANSFORMANDLIGHT = $00010000; // Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also
D3DDEVCAPS_CANBLTSYSTONONLOCAL = $00020000; // Device supports a Tex Blt from system memory to non-local vidmem
D3DDEVCAPS_HWRASTERIZATION = $00080000; // Device has HW acceleration for rasterization
 
(*
* These are the flags in the D3DDEVICEDESC7.dwVertexProcessingCaps field
*)
{ TD3DDeviceDesc7.dwVertexProcessingCaps field }
 
(* device can do texgen *)
D3DVTXPCAPS_TEXGEN = $00000001;
(* device can do IDirect3DDevice7 colormaterialsource ops *)
D3DVTXPCAPS_MATERIALSOURCE7 = $00000002;
(* device can do vertex fog *)
D3DVTXPCAPS_VERTEXFOG = $00000004;
(* device can do directional lights *)
D3DVTXPCAPS_DIRECTIONALLIGHTS = $00000008;
(* device can do positional lights (includes point and spot) *)
D3DVTXPCAPS_POSITIONALLIGHTS = $00000010;
(* device can do local viewer *)
D3DVTXPCAPS_LOCALVIEWER = $00000020;
 
D3DFDS_COLORMODEL = $00000001; (* Match color model *)
D3DFDS_GUID = $00000002; (* Match guid *)
D3DFDS_HARDWARE = $00000004; (* Match hardware/software *)
D3DFDS_TRIANGLES = $00000008; (* Match in triCaps *)
D3DFDS_LINES = $00000010; (* Match in lineCaps *)
D3DFDS_MISCCAPS = $00000020; (* Match primCaps.dwMiscCaps *)
D3DFDS_RASTERCAPS = $00000040; (* Match primCaps.dwRasterCaps *)
D3DFDS_ZCMPCAPS = $00000080; (* Match primCaps.dwZCmpCaps *)
D3DFDS_ALPHACMPCAPS = $00000100; (* Match primCaps.dwAlphaCmpCaps *)
D3DFDS_SRCBLENDCAPS = $00000200; (* Match primCaps.dwSourceBlendCaps *)
D3DFDS_DSTBLENDCAPS = $00000400; (* Match primCaps.dwDestBlendCaps *)
D3DFDS_SHADECAPS = $00000800; (* Match primCaps.dwShadeCaps *)
D3DFDS_TEXTURECAPS = $00001000; (* Match primCaps.dwTextureCaps *)
D3DFDS_TEXTUREFILTERCAPS = $00002000; (* Match primCaps.dwTextureFilterCaps *)
D3DFDS_TEXTUREBLENDCAPS = $00004000; (* Match primCaps.dwTextureBlendCaps *)
D3DFDS_TEXTUREADDRESSCAPS = $00008000; (* Match primCaps.dwTextureBlendCaps *)
D3DFDS_COLORMODEL = $00000001; // Match color model
D3DFDS_GUID = $00000002; // Match guid
D3DFDS_HARDWARE = $00000004; // Match hardware/software
D3DFDS_TRIANGLES = $00000008; // Match in triCaps
D3DFDS_LINES = $00000010; // Match in lineCaps
D3DFDS_MISCCAPS = $00000020; // Match primCaps.dwMiscCaps
D3DFDS_RASTERCAPS = $00000040; // Match primCaps.dwRasterCaps
D3DFDS_ZCMPCAPS = $00000080; // Match primCaps.dwZCmpCaps
D3DFDS_ALPHACMPCAPS = $00000100; // Match primCaps.dwAlphaCmpCaps
D3DFDS_SRCBLENDCAPS = $00000200; // Match primCaps.dwSourceBlendCaps
D3DFDS_DSTBLENDCAPS = $00000400; // Match primCaps.dwDestBlendCaps
D3DFDS_SHADECAPS = $00000800; // Match primCaps.dwShadeCaps
D3DFDS_TEXTURECAPS = $00001000; // Match primCaps.dwTextureCaps
D3DFDS_TEXTUREFILTERCAPS = $00002000; // Match primCaps.dwTextureFilterCaps
D3DFDS_TEXTUREBLENDCAPS = $00004000; // Match primCaps.dwTextureBlendCaps
D3DFDS_TEXTUREADDRESSCAPS = $00008000; // Match primCaps.dwTextureBlendCaps
 
(*
* FindDevice arguments
*)
{ FindDevice arguments }
 
type
PD3DFindDeviceSearch = ^TD3DFindDeviceSearch;
TD3DFindDeviceSearch = packed record
TD3DFindDeviceSearch = record
dwSize: DWORD;
dwFlags: DWORD;
bHardware: BOOL;
7858,103 → 4976,133
dpcPrimCaps: TD3DPrimCaps;
end;
 
D3DFINDDEVICESEARCH = TD3DFindDeviceSearch;
LPD3DFINDDEVICESEARCH = PD3DFindDeviceSearch;
 
PD3DFindDeviceResult = ^TD3DFindDeviceResult;
TD3DFindDeviceResult = packed record
TD3DFindDeviceResult = record
dwSize: DWORD;
guid: TGUID; (* guid which matched *)
ddHwDesc: TD3DDeviceDesc; (* hardware TD3DDeviceDesc *)
ddSwDesc: TD3DDeviceDesc; (* software TD3DDeviceDesc *)
guid: TGUID; // guid which matched
ddHwDesc: TD3DDeviceDesc; // hardware TD3DDeviceDesc
ddSwDesc: TD3DDeviceDesc; // software TD3DDeviceDesc
end;
 
(*
* Description of execute buffer.
*)
D3DFINDDEVICERESULT = TD3DFindDeviceResult;
LPD3DFINDDEVICERESULT = PD3DFindDeviceResult;
 
{ Description of execute buffer. }
 
PD3DExecuteBufferDesc = ^TD3DExecuteBufferDesc;
TD3DExecuteBufferDesc = packed record
dwSize: DWORD; (* size of this structure *)
dwFlags: DWORD; (* flags indicating which fields are valid *)
dwCaps: DWORD; (* capabilities of execute buffer *)
dwBufferSize: DWORD; (* size of execute buffer data *)
lpData: Pointer; (* pointer to actual data *)
TD3DExecuteBufferDesc = record
dwSize: DWORD; // size of this structure
dwFlags: DWORD; // flags indicating which fields are valid
dwCaps: DWORD; // capabilities of execute buffer
dwBufferSize: DWORD; // size of execute buffer data
lpData: Pointer; // pointer to actual data
end;
 
(* D3DEXECUTEBUFFER dwFlags indicating valid fields *)
D3DEXECUTEBUFFERDESC = TD3DExecuteBufferDesc;
LPD3DEXECUTEBUFFERDESC = PD3DExecuteBufferDesc;
 
{ D3DEXECUTEBUFFER dwFlags indicating valid fields }
 
const
D3DDEB_BUFSIZE = $00000001; (* buffer size valid *)
D3DDEB_CAPS = $00000002; (* caps valid *)
D3DDEB_LPDATA = $00000004; (* lpData valid *)
D3DDEB_BUFSIZE = $00000001; // buffer size valid
D3DDEB_CAPS = $00000002; // caps valid
D3DDEB_LPDATA = $00000004; // lpData valid
 
(* D3DEXECUTEBUFFER dwCaps *)
{ D3DEXECUTEBUFFER dwCaps }
 
D3DDEBCAPS_SYSTEMMEMORY = $00000001; (* buffer in system memory *)
D3DDEBCAPS_VIDEOMEMORY = $00000002; (* buffer in device memory *)
D3DDEBCAPS_MEM = (D3DDEBCAPS_SYSTEMMEMORY or D3DDEBCAPS_VIDEOMEMORY);
D3DDEBCAPS_SYSTEMMEMORY = $00000001; // buffer in system memory
D3DDEBCAPS_VIDEOMEMORY = $00000002; // buffer in device memory
D3DDEBCAPS_MEM = D3DDEBCAPS_SYSTEMMEMORY or D3DDEBCAPS_VIDEOMEMORY;
 
type
 
{ TD3DDevInfo_TextureManager }
 
PD3DDevInfo_TextureManager = ^TD3DDevInfo_TextureManager;
TD3DDevInfo_TextureManager = packed record
bThrashing: BOOL; (* indicates if thrashing *)
dwApproxBytesDownloaded: DWORD; (* Approximate number of bytes downloaded by texture manager *)
dwNumEvicts: DWORD; (* number of textures evicted *)
dwNumVidCreates: DWORD; (* number of textures created in video memory *)
dwNumTexturesUsed: DWORD; (* number of textures used *)
dwNumUsedTexInVid: DWORD; (* number of used textures present in video memory *)
dwWorkingSet: DWORD; (* number of textures in video memory *)
dwWorkingSetBytes: DWORD; (* number of bytes in video memory *)
dwTotalManaged: DWORD; (* total number of managed textures *)
dwTotalBytes: DWORD; (* total number of bytes of managed textures *)
dwLastPri: DWORD; (* priority of last texture evicted *)
TD3DDevInfo_TextureManager = record
bThrashing: BOOL; // indicates if thrashing
dwApproxBytesDownloaded: DWORD; // Approximate number of bytes downloaded by texture manager
dwNumEvicts: DWORD; // number of textures evicted
dwNumVidCreates: DWORD; // number of textures created in video memory
dwNumTexturesUsed: DWORD; // number of textures used
dwNumUsedTexInVid: DWORD; // number of used textures present in video memory
dwWorkingSet: DWORD; // number of textures in video memory
dwWorkingSetBytes: DWORD; // number of bytes in video memory
dwTotalManaged: DWORD; // total number of managed textures
dwTotalBytes: DWORD; // total number of bytes of managed textures
dwLastPri: DWORD; // priority of last texture evicted
end;
 
D3DDEVINFO_TEXTUREMANAGER = TD3DDevInfo_TextureManager;
LPD3DDEVINFO_TEXTUREMANAGER = PD3DDevInfo_TextureManager;
 
{ TD3DDevInfo_Texturing }
 
PD3DDevInfo_Texturing = ^TD3DDevInfo_Texturing;
TD3DDevInfo_Texturing = packed record
dwNumLoads: DWORD; (* counts Load() API calls *)
dwApproxBytesLoaded: DWORD; (* Approximate number bytes loaded via Load() *)
dwNumPreLoads: DWORD; (* counts PreLoad() API calls *)
dwNumSet: DWORD; (* counts SetTexture() API calls *)
dwNumCreates: DWORD; (* counts texture creates *)
dwNumDestroys: DWORD; (* counts texture destroys *)
dwNumSetPriorities: DWORD; (* counts SetPriority() API calls *)
dwNumSetLODs: DWORD; (* counts SetLOD() API calls *)
dwNumLocks: DWORD; (* counts number of texture locks *)
dwNumGetDCs: DWORD; (* counts number of GetDCs to textures *)
TD3DDevInfo_Texturing = record
dwNumLoads: DWORD; // counts Load() API calls
dwApproxBytesLoaded: DWORD; // Approximate number bytes loaded via Load()
dwNumPreLoads: DWORD; // counts PreLoad() API calls
dwNumSet: DWORD; // counts SetTexture() API calls
dwNumCreates: DWORD; // counts texture creates
dwNumDestroys: DWORD; // counts texture destroys
dwNumSetPriorities: DWORD; // counts SetPriority() API calls
dwNumSetLODs: DWORD; // counts SetLOD() API calls
dwNumLocks: DWORD; // counts number of texture locks
dwNumGetDCs: DWORD; // counts number of GetDCs to textures
end;
 
D3DDEVINFO_TEXTURING = TD3DDevInfo_Texturing;
LPD3DDEVINFO_TEXTURING = PD3DDevInfo_Texturing;
 
(*==========================================================================;
*
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
*
* File: d3d.h
* Content: Direct3D include file
*
****************************************************************************)
***************************************************************************)
 
function D3DErrorString(Value: HResult) : string;
{ Interface IID's }
 
(*
* Interface IID's
*)
 
const
(*
* Internal Guid to distinguish requested MMX from MMX being used as an RGB rasterizer
*)
IID_IDirect3DRampDevice: TGUID =
(D1:$F2086B20;D2:$259F;D3:$11CF;D4:($A3,$1A,$00,$AA,$00,$B9,$33,$56));
IID_IDirect3DRGBDevice: TGUID =
(D1:$A4665C60;D2:$2673;D3:$11CF;D4:($A3,$1A,$00,$AA,$00,$B9,$33,$56));
IID_IDirect3DHALDevice: TGUID =
(D1:$84E63dE0;D2:$46AA;D3:$11CF;D4:($81,$6F,$00,$00,$C0,$20,$15,$6E));
IID_IDirect3DMMXDevice: TGUID =
(D1:$881949a1;D2:$d6f3;D3:$11d0;D4:($89,$ab,$00,$a0,$c9,$05,$41,$29));
IID_IDirect3D: TGUID = '{3BBA0080-2421-11CF-A31A-00AA00B93356}';
IID_IDirect3D2: TGUID = '{6AAE1EC1-662A-11D0-889D-00AA00BBB76A}';
IID_IDirect3D3: TGUID = '{BB223240-E72B-11D0-A9B4-00AA00C0993E}';
IID_IDirect3D7: TGUID = '{F5049E77-4861-11D2-A407-00A0C90629A8}';
 
IID_IDirect3DRefDevice: TGUID =
(D1:$50936643;D2:$13e9;D3:$11d1;D4:($89,$aa,$00,$a0,$c9,$05,$41,$29));
IID_IDirect3DNullDevice: TGUID =
(D1:$8767df22;D2:$bacc;D3:$11d1;D4:($89,$69,$00,$a0,$c9,$06,$29,$a8));
IID_IDirect3DRampDevice: TGUID = '{F2086B20-259F-11CF-A31A-00AA00B93356}';
IID_IDirect3DRGBDevice: TGUID = '{A4665C60-2673-11CF-A31A-00AA00B93356}';
IID_IDirect3DHALDevice: TGUID = '{84E63DE0-46AA-11CF-816F-0000C020156E}';
IID_IDirect3DMMXDevice: TGUID = '{881949A1-D6F3-11D0-89AB-00A0C9054129}';
IID_IDirect3DRefDevice: TGUID = '{50936643-13E9-11D1-89AA-00A0C9054129}';
IID_IDirect3DNullDevice: TGUID = '{8767DF22-BACC-11D1-8969-00A0C90629A8}';
IID_IDirect3DTnLHalDevice: TGUID = '{F5049E78-4861-11D2-A407-00A0C90629A8}';
 
IID_IDirect3DTnLHalDevice: TGUID = '{f5049e78-4861-11d2-a407-00a0c90629a8}';
IID_IDirect3DDevice: TGUID = '{64108800-957D-11D0-89AB-00A0C9054129}';
IID_IDirect3DDevice2: TGUID = '{93281501-8CF8-11D0-89AB-00A0C9054129}';
IID_IDirect3DDevice3: TGUID = '{B0AB3B60-33D7-11D1-A981-00C04FD7B174}';
IID_IDirect3DDevice7: TGUID = '{F5049E79-4861-11D2-A407-00A0C90629A8}';
 
IID_IDirect3DTexture: TGUID ='{2CDCD9E0-25A0-11CF-A31A-00AA00B93356}';
IID_IDirect3DTexture2: TGUID = '{93281502-8CF8-11D0-89AB-00A0C9054129}';
IID_IDirect3DLight: TGUID = '{4417C142-33AD-11CF-816F-0000C020156E}';
IID_IDirect3DMaterial: TGUID = '{4417C144-33AD-11CF-816F-0000C020156E}';
IID_IDirect3DMaterial2: TGUID = '{93281503-8CF8-11D0-89AB-00A0C9054129}';
IID_IDirect3DMaterial3: TGUID = '{CA9C46F4-D3C5-11D1-B75A-00600852B312}';
IID_IDirect3DExecuteBuffer: TGUID = '{4417C145-33AD-11CF-816F-0000C020156E}';
IID_IDirect3DViewport: TGUID = '{4417C146-33AD-11CF-816F-0000C020156E}';
IID_IDirect3DViewport2: TGUID = '{93281500-8CF8-11D0-89AB-00A0C9054129}';
IID_IDirect3DViewport3: TGUID = '{B0AB3B61-33D7-11D1-A981-00C04FD7B174}';
IID_IDirect3DVertexBuffer: TGUID = '{7A503555-4A83-11D1-A5DB-00A0C90367F8}';
IID_IDirect3DVertexBuffer7: TGUID = '{F5049E7D-4861-11D2-A407-00A0C90629A8}';
 
{ Data structures }
 
type
IDirect3D = interface;
IDirect3D2 = interface;
7977,96 → 5125,89
IDirect3DVertexBuffer = interface;
IDirect3DVertexBuffer7 = interface;
 
(*
* Direct3D interfaces
*)
 
IDirect3D = interface (IUnknown)
['{3BBA0080-2421-11CF-A31A-00AA00B93356}']
(*** IDirect3D methods ***)
function Initialize (lpREFIID: {REFIID} PGUID) : HResult; stdcall;
// IDirect3D methods
function Initialize(const lpREFIID: TGUID): HResult; stdcall;
function EnumDevices (lpEnumDevicesCallback: TD3DEnumDevicesCallback;
lpUserArg: Pointer) : HResult; stdcall;
function CreateLight (var lplpDirect3Dlight: IDirect3DLight;
function CreateLight(out lplpDirect3Dlight: IDirect3DLight;
pUnkOuter: IUnknown) : HResult; stdcall;
function CreateMaterial (var lplpDirect3DMaterial: IDirect3DMaterial;
function CreateMaterial(out lplpDirect3DMaterial: IDirect3DMaterial;
pUnkOuter: IUnknown) : HResult; stdcall;
function CreateViewport (var lplpD3DViewport: IDirect3DViewport;
function CreateViewport(out lplpD3DViewport: IDirect3DViewport;
pUnkOuter: IUnknown) : HResult; stdcall;
function FindDevice (var lpD3DFDS: TD3DFindDeviceSearch;
function FindDevice(const lpD3DFDS: TD3DFindDeviceSearch;
var lpD3DFDR: TD3DFindDeviceResult) : HResult; stdcall;
end;
 
IDirect3D2 = interface (IUnknown)
['{6aae1ec1-662a-11d0-889d-00aa00bbb76a}']
(*** IDirect3D2 methods ***)
['{6AAE1EC1-662A-11D0-889D-00AA00BBB76A}']
// IDirect3D methods
function EnumDevices(lpEnumDevicesCallback: TD3DEnumDevicesCallback;
lpUserArg: pointer) : HResult; stdcall;
function CreateLight (var lplpDirect3Dlight: IDirect3DLight;
lpUserArg: Pointer): HResult; stdcall;
function CreateLight(out lplpDirect3Dlight: IDirect3DLight;
pUnkOuter: IUnknown) : HResult; stdcall;
function CreateMaterial (var lplpDirect3DMaterial2: IDirect3DMaterial2;
function CreateMaterial(out lplpDirect3DMaterial: IDirect3DMaterial2;
pUnkOuter: IUnknown) : HResult; stdcall;
function CreateViewport (var lplpD3DViewport2: IDirect3DViewport2;
function CreateViewport(out lplpD3DViewport: IDirect3DViewport2;
pUnkOuter: IUnknown) : HResult; stdcall;
function FindDevice (var lpD3DFDS: TD3DFindDeviceSearch;
function FindDevice(const lpD3DFDS: TD3DFindDeviceSearch;
var lpD3DFDR: TD3DFindDeviceResult) : HResult; stdcall;
function CreateDevice (const rclsid: TRefClsID; lpDDS: IDirectDrawSurface;
// IDirect3D2 methods
function CreateDevice(const rclsid: TGUID; lpDDS: IDirectDrawSurface;
out lplpD3DDevice2: IDirect3DDevice2) : HResult; stdcall;
end;
 
IDirect3D3 = interface (IUnknown)
['{bb223240-e72b-11d0-a9b4-00aa00c0993e}']
(*** IDirect3D3 methods ***)
['{BB223240-E72B-11D0-A9B4-00AA00C0993E}']
// IDirect3D methods
function EnumDevices(lpEnumDevicesCallback: TD3DEnumDevicesCallback;
lpUserArg: pointer) : HResult; stdcall;
function CreateLight (var lplpDirect3Dlight: IDirect3DLight;
lpUserArg: Pointer): HResult; stdcall;
function CreateLight(out lplpDirect3Dlight: IDirect3DLight;
pUnkOuter: IUnknown) : HResult; stdcall;
function CreateMaterial (var lplpDirect3DMaterial3: IDirect3DMaterial3;
function CreateMaterial(out lplpDirect3DMaterial: IDirect3DMaterial3;
pUnkOuter: IUnknown) : HResult; stdcall;
function CreateViewport (var lplpD3DViewport3: IDirect3DViewport3;
function CreateViewport(out lplpD3DViewport: IDirect3DViewport3;
pUnkOuter: IUnknown) : HResult; stdcall;
function FindDevice (var lpD3DFDS: TD3DFindDeviceSearch;
function FindDevice(const lpD3DFDS: TD3DFindDeviceSearch;
var lpD3DFDR: TD3DFindDeviceResult) : HResult; stdcall;
function CreateDevice (const rclsid: TRefClsID; lpDDS: IDirectDrawSurface4;
out lplpD3DDevice: IDirect3DDevice3; pUnkOuter: IUnknown) : HResult; stdcall;
function CreateVertexBuffer (var lpVBDesc: TD3DVertexBufferDesc;
var lpD3DVertexBuffer: IDirect3DVertexBuffer;
dwFlags: DWORD; pUnkOuter: IUnknown) : HResult; stdcall;
function EnumZBufferFormats (const riidDevice: TRefClsID; lpEnumCallback:
TD3DEnumPixelFormatsCallback; lpContext: pointer) : HResult; stdcall;
// IDirect3D2 methods
function CreateDevice(const rclsid: TGUID; lpDDS: IDirectDrawSurface4;
out lplpD3DDevice2: IDirect3DDevice3; pUnkOuter: IUnknown): HResult; stdcall;
// IDirect3D3 methods
function CreateVertexBuffer(const lpVBDesc: TD3DVertexBufferDesc;
out lpD3DVertexBuffer: IDirect3DVertexBuffer; dwFlags: DWORD; pUnkOuter: IUnknown): HResult; stdcall;
function EnumZBufferFormats(const riidDevice: TGUID; lpEnumCallback: TD3DEnumPixelFormatsCallback;
lpContext: Pointer): HResult; stdcall;
function EvictManagedTextures : HResult; stdcall;
end;
 
IDirect3D7 = interface (IUnknown)
['{f5049e77-4861-11d2-a407-00a0c90629a8}']
(*** IDirect3D7 methods ***)
['{F5049E77-4861-11D2-A407-00A0C90629A8}']
// IDirect3D7 methods
function EnumDevices(lpEnumDevicesCallback: TD3DEnumDevicesCallback7;
lpUserArg: pointer) : HResult; stdcall;
lpUserArg: Pointer): HResult; stdcall;
function CreateDevice (const rclsid: TGUID; lpDDS: IDirectDrawSurface7;
out lplpD3DDevice: IDirect3DDevice7) : HResult; stdcall;
out lplpD3DDevice7: IDirect3DDevice7): HResult; stdcall;
function CreateVertexBuffer (const lpVBDesc: TD3DVertexBufferDesc;
out lplpD3DVertexBuffer: IDirect3DVertexBuffer7;
dwFlags: DWORD) : HResult; stdcall;
function EnumZBufferFormats (const riidDevice: TGUID; lpEnumCallback:
TD3DEnumPixelFormatsCallback; lpContext: pointer) : HResult; stdcall;
out lpD3DVertexBuffer: IDirect3DVertexBuffer7; dwFlags: DWORD): HResult; stdcall;
function EnumZBufferFormats(const riidDevice: TGUID; lpEnumCallback: TD3DEnumPixelFormatsCallback;
lpContext: Pointer): HResult; stdcall;
function EvictManagedTextures : HResult; stdcall;
end;
(*
* Direct3D Device interfaces
*)
 
IDirect3DDevice = interface (IUnknown)
['{64108800-957d-11d0-89ab-00a0c9054129}']
(*** IDirect3DDevice methods ***)
function Initialize (lpd3d: IDirect3D; lpGUID: PGUID;
var lpd3ddvdesc: TD3DDeviceDesc) : HResult; stdcall;
['{64108800-957D-11D0-89AB-00A0C9054129}']
// IDirect3DDevice methods
function Initialize(lpd3d: IDirect3D; const lpGUID: TGUID;
const lpd3ddvdesc: TD3DDeviceDesc): HResult; stdcall;
function GetCaps (var lpD3DHWDevDesc: TD3DDeviceDesc;
var lpD3DHELDevDesc: TD3DDeviceDesc) : HResult; stdcall;
function SwapTextureHandles (lpD3DTex1: IDirect3DTexture;
lpD3DTex2: IDirect3DTexture) : HResult; stdcall;
function CreateExecuteBuffer (var lpDesc: TD3DExecuteBufferDesc ;
var lplpDirect3DExecuteBuffer: IDirect3DExecuteBuffer;
function CreateExecuteBuffer(const lpDesc: TD3DExecuteBufferDesc;
out lplpDirect3DExecuteBuffer: IDirect3DExecuteBuffer;
pUnkOuter: IUnknown) : HResult; stdcall;
function GetStats (var lpD3DStats: TD3DStats) : HResult; stdcall;
function Execute (lpDirect3DExecuteBuffer: IDirect3DExecuteBuffer;
8074,94 → 5215,82
function AddViewport (lpDirect3DViewport: IDirect3DViewport) : HResult; stdcall;
function DeleteViewport (lpDirect3DViewport: IDirect3DViewport) : HResult; stdcall;
function NextViewport (lpDirect3DViewport: IDirect3DViewport;
var lplpDirect3DViewport: IDirect3DViewport; dwFlags: DWORD) : HResult; stdcall;
out lplpDirect3DViewport: IDirect3DViewport; dwFlags: DWORD): HResult; stdcall;
function Pick (lpDirect3DExecuteBuffer: IDirect3DExecuteBuffer;
lpDirect3DViewport: IDirect3DViewport; dwFlags: DWORD;
var lpRect: TD3DRect) : HResult; stdcall;
const lpRect: TD3DRect): HResult; stdcall;
function GetPickRecords (var lpCount: DWORD;
var lpD3DPickRec: TD3DPickRecord) : HResult; stdcall;
function EnumTextureFormats (lpd3dEnumTextureProc:
TD3DEnumTextureFormatsCallback; lpArg: Pointer) :
HResult; stdcall;
function EnumTextureFormats(lpd3dEnumTextureProc: TD3DEnumTextureFormatsCalback;
lpArg: Pointer): HResult; stdcall;
function CreateMatrix (var lpD3DMatHandle: TD3DMatrixHandle) : HResult; stdcall;
function SetMatrix (d3dMatHandle: TD3DMatrixHandle;
const lpD3DMatrix: TD3DMatrix): HResult; stdcall;
function GetMatrix(lpD3DMatHandle: TD3DMatrixHandle;
var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
function GetMatrix (var lpD3DMatHandle: TD3DMatrixHandle;
var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
function DeleteMatrix (d3dMatHandle: TD3DMatrixHandle) : HResult; stdcall;
function BeginScene: HResult; stdcall;
function EndScene: HResult; stdcall;
function GetDirect3D (var lpD3D: IDirect3D) : HResult; stdcall;
function GetDirect3D(out lpD3D: IDirect3D): HResult; stdcall;
end;
 
IDirect3DDevice2 = interface (IUnknown)
['{93281501-8cf8-11d0-89ab-00a0c9054129}']
(*** IDirect3DDevice2 methods ***)
['{93281501-8CF8-11D0-89AB-00A0C9054129}']
// IDirect3DDevice2 methods
function GetCaps (var lpD3DHWDevDesc: TD3DDeviceDesc;
var lpD3DHELDevDesc: TD3DDeviceDesc) : HResult; stdcall;
function SwapTextureHandles (lpD3DTex1: IDirect3DTexture2;
lpD3DTex2: IDirect3DTexture2) : HResult; stdcall;
function GetStats (var lpD3DStats: TD3DStats) : HResult; stdcall;
function AddViewport (lpDirect3DViewport2: IDirect3DViewport2) : HResult; stdcall;
function AddViewport(lpDirect3DViewport: IDirect3DViewport2): HResult; stdcall;
function DeleteViewport (lpDirect3DViewport: IDirect3DViewport2) : HResult; stdcall;
function NextViewport (lpDirect3DViewport: IDirect3DViewport2;
var lplpDirect3DViewport: IDirect3DViewport2; dwFlags: DWORD) :
HResult; stdcall;
function EnumTextureFormats (
lpd3dEnumTextureProc: TD3DEnumTextureFormatsCallback; lpArg: Pointer) :
HResult; stdcall;
out lplpDirect3DViewport: IDirect3DViewport2; dwFlags: DWORD): HResult; stdcall;
function EnumTextureFormats(lpd3dEnumTextureProc: TD3DEnumTextureFormatsCalback;
lpArg: Pointer): HResult; stdcall;
function BeginScene: HResult; stdcall;
function EndScene: HResult; stdcall;
function GetDirect3D (var lpD3D: IDirect3D2) : HResult; stdcall;
 
(*** DrawPrimitive API ***)
function SetCurrentViewport (lpd3dViewport2: IDirect3DViewport2)
: HResult; stdcall;
function GetCurrentViewport (var lplpd3dViewport2: IDirect3DViewport2)
: HResult; stdcall;
 
function SetRenderTarget (lpNewRenderTarget: IDirectDrawSurface)
: HResult; stdcall;
function GetRenderTarget (var lplpNewRenderTarget: IDirectDrawSurface)
: HResult; stdcall;
 
function GetDirect3D(out lpD3D: IDirect3D2): HResult; stdcall;
function SetCurrentViewport(lpd3dViewport2: IDirect3DViewport2): HResult; stdcall;
function GetCurrentViewport(out lplpd3dViewport2: IDirect3DViewport2): HResult; stdcall;
function SetRenderTarget(lpNewRenderTarget: IDirectDrawSurface): HResult; stdcall;
function GetRenderTarget(out lplpNewRenderTarget: IDirectDrawSurface): HResult; stdcall;
function Begin_ (d3dpt: TD3DPrimitiveType; d3dvt: TD3DVertexType;
dwFlags: DWORD) : HResult; stdcall;
function BeginIndexed (dptPrimitiveType: TD3DPrimitiveType; dvtVertexType:
TD3DVertexType; lpvVertices: pointer; dwNumVertices: DWORD;
TD3DVertexType; const lpvVertices; dwNumVertices: DWORD;
dwFlags: DWORD) : HResult; stdcall;
function Vertex (lpVertexType: pointer) : HResult; stdcall;
function Vertex(const lpVertexType): HResult; stdcall;
function Index (wVertexIndex: WORD) : HResult; stdcall;
function End_ (dwFlags: DWORD) : HResult; stdcall;
 
function GetRenderState (dwRenderStateType: TD3DRenderStateType;
var lpdwRenderState) : HResult; stdcall;
var lpdwRenderState: DWORD): HResult; stdcall;
function SetRenderState (dwRenderStateType: TD3DRenderStateType;
dwRenderState: DWORD) : HResult; stdcall;
function GetLightState (dwLightStateType: TD3DLightStateType;
var lpdwLightState) : HResult; stdcall;
var lpdwLightState: DWORD): HResult; stdcall;
function SetLightState (dwLightStateType: TD3DLightStateType;
dwLightState: DWORD) : HResult; stdcall;
function SetTransform (dtstTransformStateType: TD3DTransformStateType;
var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
const lpD3DMatrix: TD3DMatrix): HResult; stdcall;
function GetTransform (dtstTransformStateType: TD3DTransformStateType;
var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
function MultiplyTransform (dtstTransformStateType: TD3DTransformStateType;
var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
 
function DrawPrimitive (dptPrimitiveType: TD3DPrimitiveType;
dvtVertexType: TD3DVertexType; var lpvVertices; dwVertexCount,
dvtVertexType: TD3DVertexType; const lpvVertices; dwVertexCount,
dwFlags: DWORD) : HResult; stdcall;
function DrawIndexedPrimitive (dptPrimitiveType: TD3DPrimitiveType;
dwVertexTypeDesc: DWORD; lpvVertices: pointer; dwVertexCount: DWORD;
var lpwIndices: WORD; dwIndexCount, dwFlags: DWORD) : HResult; stdcall;
function SetClipStatus (var lpD3DClipStatus: TD3DClipStatus) : HResult; stdcall;
dvtVertexType: TD3DVertexType; const lpvVertices;
dwVertexCount: DWORD; const dwIndices; dwIndexCount: DWORD;
dwFlags: DWORD): HResult; stdcall;
function SetClipStatus(const lpD3DClipStatus: TD3DClipStatus): HResult; stdcall;
function GetClipStatus (var lpD3DClipStatus: TD3DClipStatus) : HResult; stdcall;
end;
 
IDirect3DDevice3 = interface (IUnknown)
['{b0ab3b60-33d7-11d1-a981-00c04fd7b174}']
(*** IDirect3DDevice2 methods ***)
['{B0AB3B60-33D7-11D1-A981-00C04FD7B174}']
// IDirect3DDevice3 methods
function GetCaps (var lpD3DHWDevDesc: TD3DDeviceDesc;
var lpD3DHELDevDesc: TD3DDeviceDesc) : HResult; stdcall;
function GetStats (var lpD3DStats: TD3DStats) : HResult; stdcall;
8168,193 → 5297,155
function AddViewport (lpDirect3DViewport: IDirect3DViewport3) : HResult; stdcall;
function DeleteViewport (lpDirect3DViewport: IDirect3DViewport3) : HResult; stdcall;
function NextViewport (lpDirect3DViewport: IDirect3DViewport3;
var lplpAnotherViewport: IDirect3DViewport3; dwFlags: DWORD) : HResult; stdcall;
function EnumTextureFormats (
lpd3dEnumPixelProc: TD3DEnumPixelFormatsCallback; lpArg: Pointer) :
HResult; stdcall;
out lplpDirect3DViewport: IDirect3DViewport3; dwFlags: DWORD): HResult; stdcall;
function EnumTextureFormats(lpd3dEnumPixelProc: TD3DEnumPixelFormatsCallback;
lpArg: Pointer): HResult; stdcall;
function BeginScene: HResult; stdcall;
function EndScene: HResult; stdcall;
function GetDirect3D (var lpD3D: IDirect3D3) : HResult; stdcall;
function SetCurrentViewport (lpd3dViewport: IDirect3DViewport3)
: HResult; stdcall;
function GetCurrentViewport (var lplpd3dViewport: IDirect3DViewport3)
: HResult; stdcall;
function SetRenderTarget (lpNewRenderTarget: IDirectDrawSurface4)
: HResult; stdcall;
function GetRenderTarget (var lplpNewRenderTarget: IDirectDrawSurface4)
: HResult; stdcall;
function GetDirect3D(out lpD3D: IDirect3D3): HResult; stdcall;
function SetCurrentViewport(lpd3dViewport: IDirect3DViewport3): HResult; stdcall;
function GetCurrentViewport(out lplpd3dViewport: IDirect3DViewport3): HResult; stdcall;
function SetRenderTarget(lpNewRenderTarget: IDirectDrawSurface4): HResult; stdcall;
function GetRenderTarget(out lplpNewRenderTarget: IDirectDrawSurface4): HResult; stdcall;
function Begin_ (d3dpt: TD3DPrimitiveType; dwVertexTypeDesc: DWORD;
dwFlags: DWORD) : HResult; stdcall;
function BeginIndexed (dptPrimitiveType: TD3DPrimitiveType;
dwVertexTypeDesc: DWORD; lpvVertices: pointer; dwNumVertices: DWORD;
dwFlags: DWORD) : HResult; stdcall;
function Vertex (lpVertex: pointer) : HResult; stdcall;
function BeginIndexed(dptPrimitiveType: TD3DPrimitiveType; dwVertexTypeDesc: DWORD;
const lpvVertices; dwNumVertices: DWORD; dwFlags: DWORD): HResult; stdcall;
function Vertex(const lpVertexType): HResult; stdcall;
function Index (wVertexIndex: WORD) : HResult; stdcall;
function End_ (dwFlags: DWORD) : HResult; stdcall;
function GetRenderState (dwRenderStateType: TD3DRenderStateType;
var lpdwRenderState) : HResult; stdcall;
var lpdwRenderState: DWORD): HResult; stdcall;
function SetRenderState (dwRenderStateType: TD3DRenderStateType;
dwRenderState: DWORD) : HResult; stdcall;
function GetLightState (dwLightStateType: TD3DLightStateType;
var lpdwLightState) : HResult; stdcall;
var lpdwLightState: DWORD): HResult; stdcall;
function SetLightState (dwLightStateType: TD3DLightStateType;
dwLightState: DWORD) : HResult; stdcall;
function SetTransform (dtstTransformStateType: TD3DTransformStateType;
var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
const lpD3DMatrix: TD3DMatrix): HResult; stdcall;
function GetTransform (dtstTransformStateType: TD3DTransformStateType;
var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
function MultiplyTransform (dtstTransformStateType: TD3DTransformStateType;
var lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
function DrawPrimitive (dptPrimitiveType: TD3DPrimitiveType;
dwVertexTypeDesc: DWORD; const lpvVertices; dwVertexCount,
dwFlags: DWORD): HResult; stdcall;
function DrawIndexedPrimitive(dptPrimitiveType: TD3DPrimitiveType;
dwVertexTypeDesc: DWORD; const lpvVertices;
dwVertexCount, dwFlags: DWORD) : HResult; stdcall;
function DrawIndexedPrimitive (dptPrimitiveType: TD3DPrimitiveType;
dwVertexTypeDesc: DWORD; const lpvVertices; dwVertexCount: DWORD;
var lpwIndices: WORD; dwIndexCount, dwFlags: DWORD) : HResult; stdcall;
function SetClipStatus (var lpD3DClipStatus: TD3DClipStatus) : HResult; stdcall;
dwVertexCount: DWORD; const dwIndices; dwIndexCount: DWORD;
dwFlags: DWORD): HResult; stdcall;
function SetClipStatus(const lpD3DClipStatus: TD3DClipStatus): HResult; stdcall;
function GetClipStatus (var lpD3DClipStatus: TD3DClipStatus) : HResult; stdcall;
function DrawPrimitiveStrided (dptPrimitiveType: TD3DPrimitiveType;
dwVertexTypeDesc : DWORD;
var lpVertexArray: TD3DDrawPrimitiveStridedData;
dwVertexCount, dwFlags: DWORD) : HResult; stdcall;
dwVertexTypeDesc: DWORD; const lpVertexArray;
dwVertexCount: DWORD; dwFlags: DWORD): HResult; stdcall;
function DrawIndexedPrimitiveStrided (dptPrimitiveType: TD3DPrimitiveType;
dwVertexTypeDesc : DWORD;
var lpVertexArray: TD3DDrawPrimitiveStridedData; dwVertexCount: DWORD;
var lpwIndices: WORD; dwIndexCount, dwFlags: DWORD) : HResult; stdcall;
dwVertexTypeDesc: DWORD; const lpVertexArray;
dwVertexCount: DWORD; const lpwIndices; dwIndexCount: DWORD; dwFlags: DWORD): HResult; stdcall;
function DrawPrimitiveVB (dptPrimitiveType: TD3DPrimitiveType;
lpd3dVertexBuffer: IDirect3DVertexBuffer;
dwStartVertex, dwNumVertices, dwFlags: DWORD) : HResult; stdcall;
lpd3dVertexBuffer: IDirect3DVertexBuffer; dwStartVertex, dwNumVertices: DWORD;
dwFlags: DWORD): HResult; stdcall;
function DrawIndexedPrimitiveVB (dptPrimitiveType: TD3DPrimitiveType;
lpd3dVertexBuffer: IDirect3DVertexBuffer; var lpwIndices: WORD;
dwIndexCount, dwFlags: DWORD) : HResult; stdcall;
function ComputeSphereVisibility (var lpCenters: TD3DVector;
var lpRadii: TD3DValue; dwNumSpheres, dwFlags: DWORD;
var lpdwReturnValues: DWORD) : HResult; stdcall;
function GetTexture (dwStage: DWORD; var lplpTexture: IDirect3DTexture2)
: HResult; stdcall;
function SetTexture (dwStage: DWORD; lplpTexture: IDirect3DTexture2)
: HResult; stdcall;
function GetTextureStageState (dwStage: DWORD;
dwState: TD3DTextureStageStateType; var lpdwValue: DWORD) : HResult; stdcall;
function SetTextureStageState (dwStage: DWORD;
dwState: TD3DTextureStageStateType; lpdwValue: DWORD) : HResult; stdcall;
function ValidateDevice (var lpdwExtraPasses: DWORD) : HResult; stdcall;
lpd3dVertexBuffer: IDirect3DVertexBuffer; const lpwIndices; dwIndexCount: DWORD;
dwFlags: DWORD): HResult; stdcall;
function ComputeSphereVisibility(const lpCenters; const lpRadii;
dwNumSpheres: DWORD; dwFlags: DWORD; var lpdwReturnValues): HResult; stdcall;
function GetTexture(dwStage: DWORD; out lplpTexture: IDirect3DTexture2): HResult; stdcall;
function SetTexture(dwStage: DWORD; lpTexture: IDirect3DTexture2): HResult; stdcall;
function GetTextureStageState(dwStage: DWORD; dwState: TD3DTextureStagesStateType;
var lpdwValue: DWORD): HResult; stdcall;
function SetTextureStageState(dwStage: DWORD; dwState: TD3DTextureStagesStateType;
lpdwValue: DWORD): HResult; stdcall;
function ValidateDevice(var lpdwPasses: DWORD): HResult; stdcall;
end;
 
IDirect3DDevice7 = interface (IUnknown)
['{f5049e79-4861-11d2-a407-00a0c90629a8}']
(*** IDirect3DDevice7 methods ***)
function GetCaps(out lpD3DDevDesc: TD3DDeviceDesc7) : HResult; stdcall;
function EnumTextureFormats(lpd3dEnumPixelProc: TD3DEnumPixelFormatsCallback; lpArg: Pointer) : HResult; stdcall;
['{F5049E79-4861-11D2-A407-00A0C90629A8}']
// IDirect3DDevice7 methods
function GetCaps(var lpD3DDeviceDesc: TD3DDeviceDesc7): HResult; stdcall;
function EnumTextureFormats(lpd3dEnumPixelProc: TD3DEnumPixelFormatsCallback;
lpArg: Pointer): HResult; stdcall;
function BeginScene: HResult; stdcall;
function EndScene: HResult; stdcall;
function GetDirect3D(out lpD3D: IDirect3D7) : HResult; stdcall;
function GetDirect3D(out lplpD3D: IDirect3D7): HResult; stdcall;
function SetRenderTarget(lpNewRenderTarget: IDirectDrawSurface7; dwFlags: DWORD) : HResult; stdcall;
function GetRenderTarget(out lplpRenderTarget: IDirectDrawSurface7) : HResult; stdcall;
function Clear(dwCount: DWORD; lpRects: PD3DRect; dwFlags, dwColor: DWORD; dvZ: TD3DValue; dwStencil: DWORD) : HResult; stdcall;
function SetTransform(dtstTransformStateType: TD3DTransformStateType;
const lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
function GetTransform(dtstTransformStateType: TD3DTransformStateType;
out lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
function Clear(dwCount: DWORD; const lpRects: TD3DRect; dwFlags: DWORD; dwColor: TD3DColor;
dvZ: TD3DValue; dwStencil: DWORD): HResult; stdcall;
function SetTransform(dtstTransformStateType: TD3DTransformStateType; const lpD3DMatrix: TD3DMatrix): HResult; stdcall;
function GetTransform(dtstTransformStateType: TD3DTransformStateType; var lpD3DMatrix: TD3DMatrix): HResult; stdcall;
function SetViewport(const lpViewport: TD3DViewport7) : HResult; stdcall;
function MultiplyTransform(dtstTransformStateType: TD3DTransformStateType;
const lpD3DMatrix: TD3DMatrix) : HResult; stdcall;
function GetViewport(out lpViewport: TD3DViewport7) : HResult; stdcall;
function MultiplyTransform(dtstTransformStateType: TD3DTransformStateType; const lpD3DMatrix: TD3DMatrix): HResult; stdcall;
function GetViewport(var lpViewport: TD3DViewport7): HResult; stdcall;
function SetMaterial(const lpMaterial: TD3DMaterial7) : HResult; stdcall;
function GetMaterial(out lpMaterial: TD3DMaterial7) : HResult; stdcall;
function GetMaterial(var lpMaterial: TD3DMaterial7): HResult; stdcall;
function SetLight(dwLightIndex: DWORD; const lpLight: TD3DLight7) : HResult; stdcall;
function GetLight(dwLightIndex: DWORD; out lpLight: TD3DLight7) : HResult; stdcall;
function GetLight(dwLightIndex: DWORD; var lpLight: TD3DLight7): HResult; stdcall;
function SetRenderState(dwRenderStateType: TD3DRenderStateType; dwRenderState: DWORD) : HResult; stdcall;
function GetRenderState(dwRenderStateType: TD3DRenderStateType; out dwRenderState: DWORD) : HResult; stdcall;
function GetRenderState(dwRenderStateType: TD3DRenderStateType; var lpdwRenderState: DWORD): HResult; stdcall;
function BeginStateBlock : HResult; stdcall;
function EndStateBlock(out lpdwBlockHandle: DWORD) : HResult; stdcall;
function EndStateBlock(var lpdwBlockHandle: DWORD): HResult; stdcall;
function PreLoad(lpddsTexture: IDirectDrawSurface7) : HResult; stdcall;
function DrawPrimitive(dptPrimitiveType: TD3DPrimitiveType;
dwVertexTypeDesc: DWORD; const lpvVertices;
dwVertexCount, dwFlags: DWORD) : HResult; stdcall;
function DrawIndexedPrimitive(dptPrimitiveType: TD3DPrimitiveType;
dwVertexTypeDesc: DWORD; const lpvVertices; dwVertexCount: DWORD;
const lpwIndices; dwIndexCount, dwFlags: DWORD) : HResult; stdcall;
function DrawPrimitive(dptPrimitiveType: TD3DPrimitiveType; dwVertexTypeDesc: DWORD;
const lpvVertices; dwVertexCount: DWORD; dwFlags: DWORD): HResult; stdcall;
function DrawIndexedPrimitive(d3dptPrimitiveType: TD3DPrimitiveType; dwVertexTypeDesc: DWORD;
const lpvVertices; dwVertexCount: DWORD; const lpwIndices; dwIndexCount: DWORD; dwFlags: DWORD): HResult; stdcall;
function SetClipStatus(const lpD3DClipStatus: TD3DClipStatus) : HResult; stdcall;
function GetClipStatus(out lpD3DClipStatus: TD3DClipStatus) : HResult; stdcall;
function DrawPrimitiveStrided(dptPrimitiveType: TD3DPrimitiveType;
dwVertexTypeDesc : DWORD;
const lpVertexArray: TD3DDrawPrimitiveStridedData;
dwVertexCount, dwFlags: DWORD) : HResult; stdcall;
function DrawIndexedPrimitiveStrided(dptPrimitiveType: TD3DPrimitiveType;
dwVertexTypeDesc : DWORD;
const lpVertexArray: TD3DDrawPrimitiveStridedData; dwVertexCount: DWORD;
var lpwIndices: WORD; dwIndexCount, dwFlags: DWORD) : HResult; stdcall;
function DrawPrimitiveVB(dptPrimitiveType: TD3DPrimitiveType;
lpd3dVertexBuffer: IDirect3DVertexBuffer7;
dwStartVertex, dwNumVertices, dwFlags: DWORD) : HResult; stdcall;
function DrawIndexedPrimitiveVB(dptPrimitiveType: TD3DPrimitiveType;
lpd3dVertexBuffer: IDirect3DVertexBuffer7; dwStartVertex, dwNumVertices: DWORD;
var lpwIndices: WORD; dwIndexCount, dwFlags: DWORD) : HResult; stdcall;
function ComputeSphereVisibility(const lpCenters: TD3DVector;
var lpRadii: TD3DValue; dwNumSpheres, dwFlags: DWORD;
var lpdwReturnValues: DWORD) : HResult; stdcall;
function GetClipStatus(var lpD3DClipStatus: TD3DClipStatus): HResult; stdcall;
function DrawPrimitiveStrided(dptPrimitiveType: TD3DPrimitiveType; dwVertexTypeDesc: DWORD;
const lpVertexArray; dwVertexCount: DWORD; dwFlags: DWORD): HResult; stdcall;
function DrawIndexedPrimitiveStrided(d3dptPrimitiveType: TD3DPrimitiveType; dwVertexTypeDesc: DWORD;
const lpVertexArray; dwVertexCount: DWORD; const lpwIndices; dwIndexCount: DWORD; dwFlags: DWORD): HResult; stdcall;
function DrawPrimitiveVB(d3dptPrimitiveType: TD3DPrimitiveType; lpd3dVertexBuffer: IDirect3DVertexBuffer7;
dwStartVertex: DWORD; dwNumVertices: DWORD; dwFlags: DWORD): HResult; stdcall;
function DrawIndexedPrimitiveVB(d3dptPrimitiveType: TD3DPrimitiveType; lpd3dVertexBuffer: IDirect3DVertexBuffer7;
dwStartVertex: DWORD; dwNumVertices: DWORD; const lpwIndices; dwIndexCount: DWORD; dwFlags: DWORD): HResult; stdcall;
function ComputeSphereVisibility(const lpCenters; const lpRadii; dwNumSpheres: DWORD; dwFlags: DWORD; var lpdwReturnValue): HResult; stdcall;
function GetTexture(dwStage: DWORD; out lplpTexture: IDirectDrawSurface7) : HResult; stdcall;
function SetTexture(dwStage: DWORD; lpTexture: IDirectDrawSurface7) : HResult; stdcall;
function GetTextureStageState(dwStage: DWORD;
dwState: TD3DTextureStageStateType; out lpdwValue: DWORD) : HResult; stdcall;
function SetTextureStageState(dwStage: DWORD;
dwState: TD3DTextureStageStateType; lpdwValue: DWORD) : HResult; stdcall;
function ValidateDevice(out lpdwExtraPasses: DWORD) : HResult; stdcall;
function GetTextureStageState(dwStage: DWORD; dwState: TD3DTextureStagesStateType; var lpdwValue: DWORD): HResult; stdcall;
function SetTextureStageState(dwStage: DWORD; dwState: TD3DTextureStagesStateType; dwValue: DWORD): HResult; stdcall;
function ValidateDevice(var lpdwPasses: DWORD): HResult; stdcall;
function ApplyStateBlock(dwBlockHandle: DWORD) : HResult; stdcall;
function CaptureStateBlock(dwBlockHandle: DWORD) : HResult; stdcall;
function DeleteStateBlock(dwBlockHandle: DWORD) : HResult; stdcall;
function CreateStateBlock(d3dsbType: TD3DStateBlockType; out lpdwBlockHandle: DWORD) : HResult; stdcall;
function Load(lpDestTex: IDirectDrawSurface7; lpDestPoint: PPoint;
lpSrcTex: IDirectDrawSurface7; lprcSrcRect: PRect; dwFlags: DWORD) : HResult; stdcall;
function CreateStateBlock(d3dsbType: TD3DSTATEBLOCKTYPE; var lpdwBlockHandle: DWORD): HResult; stdcall;
function Load(lpDestTex: IDirectDrawSurface7; const lpDestPoint: TPoint; lpSrcTex: IDirectDrawSurface7; const lprcSrcRect: TRect; dwFlags: DWORD): HResult; stdcall;
function LightEnable(dwLightIndex: DWORD; bEnable: BOOL) : HResult; stdcall;
function GetLightEnable(dwLightIndex: DWORD; out bEnable: BOOL) : HResult; stdcall;
function SetClipPlane(dwIndex: DWORD; var pPlaneEquation: TD3DValue) : HResult; stdcall;
function GetClipPlane(dwIndex: DWORD; out pPlaneEquation: TD3DValue) : HResult; stdcall;
function GetLightEnable(dwLightIndex: DWORD; var pbEnable: BOOL): HResult; stdcall;
function SetClipPlane(dwIndex: DWORD; const pPlaneEquation): HResult; stdcall;
function GetClipPlane(dwIndex: DWORD; var pPlaneEquation): HResult; stdcall;
function GetInfo(dwDevInfoID: DWORD; pDevInfoStruct: Pointer; dwSize: DWORD) : HResult; stdcall;
end;
(*
* Execute Buffer interface
*)
 
IDirect3DExecuteBuffer = interface (IUnknown)
['{4417C145-33AD-11CF-816F-0000C020156E}']
(*** IDirect3DExecuteBuffer methods ***)
// IDirect3DExecuteBuffer methods
function Initialize (lpDirect3DDevice: IDirect3DDevice;
var lpDesc: TD3DExecuteBufferDesc) : HResult; stdcall;
const lpDesc: TD3DExecuteBufferDesc): HResult; stdcall;
function Lock (var lpDesc: TD3DExecuteBufferDesc) : HResult; stdcall;
function Unlock: HResult; stdcall;
function SetExecuteData (var lpData: TD3DExecuteData) : HResult; stdcall;
function SetExecuteData(const lpData: TD3DExecuteData): HResult; stdcall;
function GetExecuteData (var lpData: TD3DExecuteData) : HResult; stdcall;
function Validate (var lpdwOffset: DWORD; lpFunc: TD3DValidateCallback;
lpUserArg: Pointer; dwReserved: DWORD) : HResult; stdcall;
(*** Warning! Optimize is defined differently in the header files
and the online documentation ***)
function Optimize (dwFlags: DWORD) : HResult; stdcall;
end;
 
(*
* Light interfaces
*)
 
IDirect3DLight = interface (IUnknown)
['{4417C142-33AD-11CF-816F-0000C020156E}']
(*** IDirect3DLight methods ***)
// IDirect3DLight methods
function Initialize (lpDirect3D: IDirect3D) : HResult; stdcall;
function SetLight (var lpLight: TD3DLight2) : HResult; stdcall;
function GetLight (var lpLight: TD3DLight2) : HResult; stdcall;
function SetLight(const lpLight: TD3DLight): HResult; stdcall;
function GetLight(var lpLight: TD3DLight): HResult; stdcall;
end;
 
(*
* Material interfaces
*)
 
IDirect3DMaterial = interface (IUnknown)
['{4417C144-33AD-11CF-816F-0000C020156E}']
(*** IDirect3DMaterial methods ***)
// IDirect3DMaterial methods
function Initialize (lpDirect3D: IDirect3D) : HResult; stdcall;
function SetMaterial (var lpMat: TD3DMaterial) : HResult; stdcall;
function SetMaterial(const lpMat: TD3DMaterial): HResult; stdcall;
function GetMaterial (var lpMat: TD3DMaterial) : HResult; stdcall;
function GetHandle (lpDirect3DDevice: IDirect3DDevice;
var lpHandle: TD3DMaterialHandle) : HResult; stdcall;
8363,9 → 5454,9
end;
 
IDirect3DMaterial2 = interface (IUnknown)
['{93281503-8cf8-11d0-89ab-00a0c9054129}']
(*** IDirect3DMaterial2 methods ***)
function SetMaterial (var lpMat: TD3DMaterial) : HResult; stdcall;
['{93281503-8CF8-11D0-89AB-00A0C9054129}']
// IDirect3DMaterial2 methods
function SetMaterial(const lpMat: TD3DMaterial): HResult; stdcall;
function GetMaterial (var lpMat: TD3DMaterial) : HResult; stdcall;
function GetHandle (lpDirect3DDevice: IDirect3DDevice2;
var lpHandle: TD3DMaterialHandle) : HResult; stdcall;
8372,21 → 5463,17
end;
 
IDirect3DMaterial3 = interface (IUnknown)
['{ca9c46f4-d3c5-11d1-b75a-00600852b312}']
(*** IDirect3DMaterial2 methods ***)
function SetMaterial (var lpMat: TD3DMaterial) : HResult; stdcall;
['{CA9C46F4-D3C5-11D1-B75A-00600852B312}']
// IDirect3DMaterial3 methods
function SetMaterial(const lpMat: TD3DMaterial): HResult; stdcall;
function GetMaterial (var lpMat: TD3DMaterial) : HResult; stdcall;
function GetHandle (lpDirect3DDevice: IDirect3DDevice3;
var lpHandle: TD3DMaterialHandle) : HResult; stdcall;
end;
 
(*
* Texture interfaces
*)
 
IDirect3DTexture = interface (IUnknown)
['{2CDCD9E0-25A0-11CF-A31A-00AA00B93356}']
(*** IDirect3DTexture methods ***)
// IDirect3DTexture methods
function Initialize (lpD3DDevice: IDirect3DDevice;
lpDDSurface: IDirectDrawSurface) : HResult; stdcall;
function GetHandle (lpDirect3DDevice: IDirect3DDevice;
8397,37 → 5484,31
end;
 
IDirect3DTexture2 = interface (IUnknown)
['{93281502-8cf8-11d0-89ab-00a0c9054129}']
(*** IDirect3DTexture2 methods ***)
function GetHandle (lpDirect3DDevice: IDirect3DDevice2;
['{93281502-8CF8-11D0-89AB-00A0C9054129}']
// IDirect3DTexture2 methods
function GetHandle(lpDirect3DDevice2: IDirect3DDevice2;
var lpHandle: TD3DTextureHandle) : HResult; stdcall;
function PaletteChanged (dwStart: DWORD; dwCount: DWORD) : HResult; stdcall;
function Load (lpD3DTexture: IDirect3DTexture2) : HResult; stdcall;
function Load(lpD3DTexture2: IDirect3DTexture2): HResult; stdcall;
end;
 
(*
* Viewport interfaces
*)
 
IDirect3DViewport = interface (IUnknown)
['{4417C146-33AD-11CF-816F-0000C020156E}']
(*** IDirect3DViewport methods ***)
// IDirect3DViewport methods
function Initialize (lpDirect3D: IDirect3D) : HResult; stdcall;
function GetViewport (out lpData: TD3DViewport) : HResult; stdcall;
function GetViewport(var lpData: TD3DViewport): HResult; stdcall;
function SetViewport (const lpData: TD3DViewport) : HResult; stdcall;
function TransformVertices (dwVertexCount: DWORD;
const lpData: TD3DTransformData; dwFlags: DWORD;
out lpOffscreen: DWORD) : HResult; stdcall;
var lpData: TD3DTransformData; dwFlags: DWORD;
var lpOffscreen: DWORD): HResult; stdcall;
function LightElements (dwElementCount: DWORD;
var lpData: TD3DLightData) : HResult; stdcall;
function SetBackground (hMat: TD3DMaterialHandle) : HResult; stdcall;
function GetBackground (out hMat: TD3DMaterialHandle) : HResult; stdcall;
function SetBackgroundDepth (lpDDSurface: IDirectDrawSurface) :
HResult; stdcall;
function GetBackground(hMat: TD3DMaterialHandle): HResult; stdcall;
function SetBackgroundDepth(lpDDSurface: IDirectDrawSurface): HResult; stdcall;
function GetBackgroundDepth (out lplpDDSurface: IDirectDrawSurface;
out lpValid: BOOL) : HResult; stdcall;
function Clear (dwCount: DWORD; const lpRects: TD3DRect; dwFlags: DWORD) :
HResult; stdcall;
var lpValid: BOOL): HResult; stdcall;
function Clear(dwCount: DWORD; const lpRects: TD3DRect; dwFlags: DWORD): HResult; stdcall;
function AddLight (lpDirect3DLight: IDirect3DLight) : HResult; stdcall;
function DeleteLight (lpDirect3DLight: IDirect3DLight) : HResult; stdcall;
function NextLight (lpDirect3DLight: IDirect3DLight;
8434,74 → 5515,28
out lplpDirect3DLight: IDirect3DLight; dwFlags: DWORD) : HResult; stdcall;
end;
 
IDirect3DViewport2 = interface (IUnknown)
['{93281500-8cf8-11d0-89ab-00a0c9054129}']
(*** IDirect3DViewport2 methods ***)
function Initialize (lpDirect3D: IDirect3D) : HResult; stdcall;
function GetViewport (out lpData: TD3DViewport) : HResult; stdcall;
function SetViewport (const lpData: TD3DViewport) : HResult; stdcall;
function TransformVertices (dwVertexCount: DWORD;
const lpData: TD3DTransformData; dwFlags: DWORD;
out lpOffscreen: DWORD) : HResult; stdcall;
function LightElements (dwElementCount: DWORD;
var lpData: TD3DLightData) : HResult; stdcall;
function SetBackground (hMat: TD3DMaterialHandle) : HResult; stdcall;
function GetBackground (out hMat: TD3DMaterialHandle) : HResult; stdcall;
function SetBackgroundDepth (lpDDSurface: IDirectDrawSurface) :
HResult; stdcall;
function GetBackgroundDepth (out lplpDDSurface: IDirectDrawSurface;
out lpValid: BOOL) : HResult; stdcall;
function Clear (dwCount: DWORD; const lpRects: TD3DRect; dwFlags: DWORD) :
HResult; stdcall;
function AddLight (lpDirect3DLight: IDirect3DLight) : HResult; stdcall;
function DeleteLight (lpDirect3DLight: IDirect3DLight) : HResult; stdcall;
function NextLight (lpDirect3DLight: IDirect3DLight;
out lplpDirect3DLight: IDirect3DLight; dwFlags: DWORD) : HResult; stdcall;
(*** IDirect3DViewport2 methods ***)
function GetViewport2 (out lpData: TD3DViewport2) : HResult; stdcall;
IDirect3DViewport2 = interface(IDirect3DViewport)
['{93281500-8CF8-11D0-89AB-00A0C9054129}']
// IDirect3DViewport2 methods
function GetViewport2(var lpData: TD3DViewport2): HResult; stdcall;
function SetViewport2 (const lpData: TD3DViewport2) : HResult; stdcall;
end;
 
IDirect3DViewport3 = interface (IUnknown)
['{b0ab3b61-33d7-11d1-a981-00c04fd7b174}']
(*** IDirect3DViewport3 methods ***)
function Initialize (lpDirect3D: IDirect3D) : HResult; stdcall;
function GetViewport (out lpData: TD3DViewport) : HResult; stdcall;
function SetViewport (const lpData: TD3DViewport) : HResult; stdcall;
function TransformVertices (dwVertexCount: DWORD;
const lpData: TD3DTransformData; dwFlags: DWORD;
out lpOffscreen: DWORD) : HResult; stdcall;
function LightElements (dwElementCount: DWORD;
var lpData: TD3DLightData) : HResult; stdcall;
function SetBackground (hMat: TD3DMaterialHandle) : HResult; stdcall;
function GetBackground (var hMat: TD3DMaterialHandle) : HResult; stdcall;
function SetBackgroundDepth (
lpDDSurface: IDirectDrawSurface) : HResult; stdcall;
function GetBackgroundDepth (out lplpDDSurface: IDirectDrawSurface;
out lpValid: BOOL) : HResult; stdcall;
function Clear (dwCount: DWORD; const lpRects: TD3DRect; dwFlags: DWORD) :
HResult; stdcall;
function AddLight (lpDirect3DLight: IDirect3DLight) : HResult; stdcall;
function DeleteLight (lpDirect3DLight: IDirect3DLight) : HResult; stdcall;
function NextLight (lpDirect3DLight: IDirect3DLight;
out lplpDirect3DLight: IDirect3DLight; dwFlags: DWORD) : HResult; stdcall;
function GetViewport2 (out lpData: TD3DViewport2) : HResult; stdcall;
function SetViewport2 (const lpData: TD3DViewport2) : HResult; stdcall;
function SetBackgroundDepth2 (
lpDDSurface: IDirectDrawSurface4) : HResult; stdcall;
function GetBackgroundDepth2 (out lplpDDSurface: IDirectDrawSurface4;
out lpValid: BOOL) : HResult; stdcall;
IDirect3DViewport3 = interface(IDirect3DViewport2)
['{B0AB3B61-33D7-11D1-A981-00C04FD7B174}']
// IDirect3DViewport3 methods
function SetBackgroundDepth2(lpDDS: IDirectDrawSurface4): HResult; stdcall;
function GetBackgroundDepth2(out lplpDDS: IDirectDrawSurface4; var lpValid: BOOL): HResult; stdcall;
function Clear2 (dwCount: DWORD; const lpRects: TD3DRect; dwFlags: DWORD;
dwColor: DWORD; dvZ: TD3DValue; dwStencil: DWORD) : HResult; stdcall;
end;
 
IDirect3DVertexBuffer = interface (IUnknown)
['{7a503555-4a83-11d1-a5db-00a0c90367f8}']
(*** IDirect3DVertexBuffer methods ***)
function Lock (dwFlags: DWORD; var lplpData: pointer; var lpdwSize: DWORD)
: HResult; stdcall;
['{7A503555-4A83-11D1-A5DB-00A0C90367F8}']
// IDirect3DVertexBuffer methods
function Lock(dwFlags: DWORD; var lplpData: Pointer; var lpdwSize: DWORD): HResult; stdcall;
function Unlock : HResult; stdcall;
function ProcessVertices (dwVertexOp, dwDestIndex, dwCount: DWORD;
function ProcessVertices(dwVertexOp: DWORD; dwDestIndex: DWORD; dwCount: DWORD;
lpSrcBuffer: IDirect3DVertexBuffer; dwSrcIndex: DWORD;
lpD3DDevice: IDirect3DDevice3; dwFlags: DWORD) : HResult; stdcall;
function GetVertexBufferDesc (var lpVBDesc: TD3DVertexBufferDesc) : HResult; stdcall;
8509,770 → 5544,145
end;
 
IDirect3DVertexBuffer7 = interface (IUnknown)
['{f5049e7d-4861-11d2-a407-00a0c90629a8}']
(*** IDirect3DVertexBuffer methods ***)
function Lock (dwFlags: DWORD; out lplpData: Pointer; out lpdwSize: DWORD) : HResult; stdcall;
['{F5049E7D-4861-11D2-A407-00A0C90629A8}']
// IDirect3DVertexBuffer7 methods
function Lock(dwFlags: DWORD; var lplpData: Pointer; var lpdwSize: DWORD): HResult; stdcall;
function Unlock : HResult; stdcall;
function ProcessVertices (dwVertexOp, dwDestIndex, dwCount: DWORD;
lpSrcBuffer: IDirect3DVertexBuffer7; dwSrcIndex: DWORD;
lpD3DDevice: IDirect3DDevice7; dwFlags: DWORD) : HResult; stdcall;
function GetVertexBufferDesc (out lpVBDesc: TD3DVertexBufferDesc) : HResult; stdcall;
function ProcessVertices(dwVertexOp: DWORD; dwDestIndex: DWORD; dwCount: DWORD;
lpSrcBuffer: IDirect3DVertexBuffer7; dwSrcIndex: DWORD; lpD3DDevice: IDirect3DDevice7; dwFlags: DWORD): HResult; stdcall;
function GetVertexBufferDesc(var lpVBDesc: TD3DVertexBufferDesc): HResult; stdcall;
function Optimize(lpD3DDevice: IDirect3DDevice7; dwFlags: DWORD) : HResult; stdcall;
function ProcessVerticesStrided(dwVertexOp, dwDestIndex, dwCount: DWORD;
lpVertexArray: TD3DDrawPrimitiveStridedData; dwVertexTypeDesc: DWORD;
lpD3DDevice: IDirect3DDevice7; dwFlags: DWORD) : HResult; stdcall;
function ProcessVerticesStrided(dwVertexOp: DWORD; dwDestIndex: DWORD; dwCount: DWORD;
const lpVertexArray; dwSrcIndex: DWORD; lpD3DDevice: IDirect3DDevice7; dwFlags: DWORD): HResult; stdcall;
end;
 
type
IID_IDirect3D = IDirect3D;
IID_IDirect3D2 = IDirect3D2;
IID_IDirect3D3 = IDirect3D3;
IID_IDirect3D7 = IDirect3D7;
const
 
IID_IDirect3DDevice = IDirect3DDevice;
IID_IDirect3DDevice2 = IDirect3DDevice2;
IID_IDirect3DDevice3 = IDirect3DDevice3;
IID_IDirect3DDevice7 = IDirect3DDevice7;
{ Flags for IDirect3DDevice::NextViewport }
 
IID_IDirect3DTexture = IDirect3DTexture;
IID_IDirect3DTexture2 = IDirect3DTexture2;
IID_IDirect3DLight = IDirect3DLight;
IID_IDirect3DMaterial = IDirect3DMaterial;
IID_IDirect3DMaterial2 = IDirect3DMaterial2;
IID_IDirect3DMaterial3 = IDirect3DMaterial3;
IID_IDirect3DExecuteBuffer = IDirect3DExecuteBuffer;
IID_IDirect3DViewport = IDirect3DViewport;
IID_IDirect3DViewport2 = IDirect3DViewport2;
IID_IDirect3DViewport3 = IDirect3DViewport3;
IID_IDirect3DVertexBuffer = IDirect3DVertexBuffer;
IID_IDirect3DVertexBuffer7 = IDirect3DVertexBuffer7;
 
 
const
(****************************************************************************
*
* Flags for IDirect3DDevice::NextViewport
*
****************************************************************************)
 
(*
* Return the next viewport
*)
D3DNEXT_NEXT = $00000001;
 
(*
* Return the first viewport
*)
D3DNEXT_HEAD = $00000002;
 
(*
* Return the last viewport
*)
D3DNEXT_TAIL = $00000004;
 
{ Flags for DrawPrimitive/DrawIndexedPrimitive
Also valid for Begin/BeginIndexed }
 
(****************************************************************************
*
* Flags for DrawPrimitive/DrawIndexedPrimitive
* Also valid for Begin/BeginIndexed
* Also valid for VertexBuffer::CreateVertexBuffer
****************************************************************************)
 
(*
* Wait until the device is ready to draw the primitive
* This will cause DP to not return DDERR_WASSTILLDRAWING
*)
D3DDP_WAIT = $00000001;
 
(*
* Hint that it is acceptable to render the primitive out of order.
*)
D3DDP_OUTOFORDER = $00000002;
 
(*
* Hint that the primitives have been clipped by the application.
*)
D3DDP_DONOTCLIP = $00000004;
 
(*
* Hint that the extents need not be updated.
*)
D3DDP_DONOTUPDATEEXTENTS = $00000008;
 
(*
* Hint that the lighting should not be applied on vertices.
*)
 
D3DDP_DONOTLIGHT = $00000010;
 
{ Direct3D Errors }
 
(*
* Direct3D Errors
* DirectDraw error codes are used when errors not specified here.
*)
 
const
MAKE_D3DHRESULT = HResult($88760000);
D3D_OK = HResult(DD_OK);
D3DERR_BADMAJORVERSION = HResult($88760000 + 700);
D3DERR_BADMINORVERSION = HResult($88760000 + 701);
 
D3D_OK = DD_OK;
D3DERR_BADMAJORVERSION = MAKE_D3DHRESULT + 700;
D3DERR_BADMINORVERSION = MAKE_D3DHRESULT + 701;
{ An invalid device was requested by the application. }
 
(*
* An invalid device was requested by the application.
*)
D3DERR_INVALID_DEVICE = MAKE_D3DHRESULT + 705;
D3DERR_INITFAILED = MAKE_D3DHRESULT + 706;
D3DERR_INVALID_DEVICE = HResult($88760000 + 705);
D3DERR_INITFAILED = HResult($88760000 + 706);
 
(*
* SetRenderTarget attempted on a device that was
* QI'd off the render target.
*)
D3DERR_DEVICEAGGREGATED = MAKE_D3DHRESULT + 707;
{ SetRenderTarget attempted on a device that was
QI'd off the render target. }
 
D3DERR_EXECUTE_CREATE_FAILED = MAKE_D3DHRESULT + 710;
D3DERR_EXECUTE_DESTROY_FAILED = MAKE_D3DHRESULT + 711;
D3DERR_EXECUTE_LOCK_FAILED = MAKE_D3DHRESULT + 712;
D3DERR_EXECUTE_UNLOCK_FAILED = MAKE_D3DHRESULT + 713;
D3DERR_EXECUTE_LOCKED = MAKE_D3DHRESULT + 714;
D3DERR_EXECUTE_NOT_LOCKED = MAKE_D3DHRESULT + 715;
D3DERR_DEVICEAGGREGATED = HResult($88760000 + 707);
 
D3DERR_EXECUTE_FAILED = MAKE_D3DHRESULT + 716;
D3DERR_EXECUTE_CLIPPED_FAILED = MAKE_D3DHRESULT + 717;
D3DERR_EXECUTE_CREATE_FAILED = HResult($88760000 + 710);
D3DERR_EXECUTE_DESTROY_FAILED = HResult($88760000 + 711);
D3DERR_EXECUTE_LOCK_FAILED = HResult($88760000 + 712);
D3DERR_EXECUTE_UNLOCK_FAILED = HResult($88760000 + 713);
D3DERR_EXECUTE_LOCKED = HResult($88760000 + 714);
D3DERR_EXECUTE_NOT_LOCKED = HResult($88760000 + 715);
 
D3DERR_TEXTURE_NO_SUPPORT = MAKE_D3DHRESULT + 720;
D3DERR_TEXTURE_CREATE_FAILED = MAKE_D3DHRESULT + 721;
D3DERR_TEXTURE_DESTROY_FAILED = MAKE_D3DHRESULT + 722;
D3DERR_TEXTURE_LOCK_FAILED = MAKE_D3DHRESULT + 723;
D3DERR_TEXTURE_UNLOCK_FAILED = MAKE_D3DHRESULT + 724;
D3DERR_TEXTURE_LOAD_FAILED = MAKE_D3DHRESULT + 725;
D3DERR_TEXTURE_SWAP_FAILED = MAKE_D3DHRESULT + 726;
D3DERR_TEXTURE_LOCKED = MAKE_D3DHRESULT + 727;
D3DERR_TEXTURE_NOT_LOCKED = MAKE_D3DHRESULT + 728;
D3DERR_TEXTURE_GETSURF_FAILED = MAKE_D3DHRESULT + 729;
D3DERR_EXECUTE_FAILED = HResult($88760000 + 716);
D3DERR_EXECUTE_CLIPPED_FAILED = HResult($88760000 + 717);
 
D3DERR_MATRIX_CREATE_FAILED = MAKE_D3DHRESULT + 730;
D3DERR_MATRIX_DESTROY_FAILED = MAKE_D3DHRESULT + 731;
D3DERR_MATRIX_SETDATA_FAILED = MAKE_D3DHRESULT + 732;
D3DERR_MATRIX_GETDATA_FAILED = MAKE_D3DHRESULT + 733;
D3DERR_SETVIEWPORTDATA_FAILED = MAKE_D3DHRESULT + 734;
D3DERR_TEXTURE_NO_SUPPORT = HResult($88760000 + 720);
D3DERR_TEXTURE_CREATE_FAILED = HResult($88760000 + 721);
D3DERR_TEXTURE_DESTROY_FAILED = HResult($88760000 + 722);
D3DERR_TEXTURE_LOCK_FAILED = HResult($88760000 + 723);
D3DERR_TEXTURE_UNLOCK_FAILED = HResult($88760000 + 724);
D3DERR_TEXTURE_LOAD_FAILED = HResult($88760000 + 725);
D3DERR_TEXTURE_SWAP_FAILED = HResult($88760000 + 726);
D3DERR_TEXTURE_LOCKED = HResult($88760000 + 727);
D3DERR_TEXTURE_NOT_LOCKED = HResult($88760000 + 728);
D3DERR_TEXTURE_GETSURF_FAILED = HResult($88760000 + 729);
 
D3DERR_INVALIDCURRENTVIEWPORT = MAKE_D3DHRESULT + 735;
D3DERR_INVALIDPRIMITIVETYPE = MAKE_D3DHRESULT + 736;
D3DERR_INVALIDVERTEXTYPE = MAKE_D3DHRESULT + 737;
D3DERR_TEXTURE_BADSIZE = MAKE_D3DHRESULT + 738;
D3DERR_INVALIDRAMPTEXTURE = MAKE_D3DHRESULT + 739;
D3DERR_MATRIX_CREATE_FAILED = HResult($88760000 + 730);
D3DERR_MATRIX_DESTROY_FAILED = HResult($88760000 + 731);
D3DERR_MATRIX_SETDATA_FAILED = HResult($88760000 + 732);
D3DERR_MATRIX_GETDATA_FAILED = HResult($88760000 + 733);
D3DERR_SETVIEWPORTDATA_FAILED = HResult($88760000 + 734);
 
D3DERR_MATERIAL_CREATE_FAILED = MAKE_D3DHRESULT + 740;
D3DERR_MATERIAL_DESTROY_FAILED = MAKE_D3DHRESULT + 741;
D3DERR_MATERIAL_SETDATA_FAILED = MAKE_D3DHRESULT + 742;
D3DERR_MATERIAL_GETDATA_FAILED = MAKE_D3DHRESULT + 743;
D3DERR_INVALIDCURRENTVIEWPORT = HResult($88760000 + 735);
D3DERR_INVALIDPRIMITIVETYPE = HResult($88760000 + 736);
D3DERR_INVALIDVERTEXTYPE = HResult($88760000 + 737);
D3DERR_TEXTURE_BADSIZE = HResult($88760000 + 738);
D3DERR_INVALIDRAMPTEXTURE = HResult($88760000 + 739);
 
D3DERR_INVALIDPALETTE = MAKE_D3DHRESULT + 744;
D3DERR_MATERIAL_CREATE_FAILED = HResult($88760000 + 740);
D3DERR_MATERIAL_DESTROY_FAILED = HResult($88760000 + 741);
D3DERR_MATERIAL_SETDATA_FAILED = HResult($88760000 + 742);
D3DERR_MATERIAL_GETDATA_FAILED = HResult($88760000 + 743);
 
D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY = MAKE_D3DHRESULT + 745;
D3DERR_ZBUFF_NEEDS_VIDEOMEMORY = MAKE_D3DHRESULT + 746;
D3DERR_SURFACENOTINVIDMEM = MAKE_D3DHRESULT + 747;
D3DERR_INVALIDPALETTE = HResult($88760000 + 744);
 
D3DERR_LIGHT_SET_FAILED = MAKE_D3DHRESULT + 750;
D3DERR_LIGHTHASVIEWPORT = MAKE_D3DHRESULT + 751;
D3DERR_LIGHTNOTINTHISVIEWPORT = MAKE_D3DHRESULT + 752;
D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY = HResult($88760000 + 745);
D3DERR_ZBUFF_NEEDS_VIDEOMEMORY = HResult($88760000 + 746);
D3DERR_SURFACENOTINVIDMEM = HResult($88760000 + 747);
 
D3DERR_SCENE_IN_SCENE = MAKE_D3DHRESULT + 760;
D3DERR_SCENE_NOT_IN_SCENE = MAKE_D3DHRESULT + 761;
D3DERR_SCENE_BEGIN_FAILED = MAKE_D3DHRESULT + 762;
D3DERR_SCENE_END_FAILED = MAKE_D3DHRESULT + 763;
D3DERR_LIGHT_SET_FAILED = HResult($88760000 + 750);
D3DERR_LIGHTHASVIEWPORT = HResult($88760000 + 751);
D3DERR_LIGHTNOTINTHISVIEWPORT = HResult($88760000 + 752);
 
D3DERR_INBEGIN = MAKE_D3DHRESULT + 770;
D3DERR_NOTINBEGIN = MAKE_D3DHRESULT + 771;
D3DERR_NOVIEWPORTS = MAKE_D3DHRESULT + 772;
D3DERR_VIEWPORTDATANOTSET = MAKE_D3DHRESULT + 773;
D3DERR_VIEWPORTHASNODEVICE = MAKE_D3DHRESULT + 774;
D3DERR_NOCURRENTVIEWPORT = MAKE_D3DHRESULT + 775;
D3DERR_SCENE_IN_SCENE = HResult($88760000 + 760);
D3DERR_SCENE_NOT_IN_SCENE = HResult($88760000 + 761);
D3DERR_SCENE_BEGIN_FAILED = HResult($88760000 + 762);
D3DERR_SCENE_END_FAILED = HResult($88760000 + 763);
 
D3DERR_INVALIDVERTEXFORMAT = MAKE_D3DHRESULT + 2048;
D3DERR_INBEGIN = HResult($88760000 + 770);
D3DERR_NOTINBEGIN = HResult($88760000 + 771);
D3DERR_NOVIEWPORTS = HResult($88760000 + 772);
D3DERR_VIEWPORTDATANOTSET = HResult($88760000 + 773);
D3DERR_VIEWPORTHASNODEVICE = HResult($88760000 + 774);
D3DERR_NOCURRENTVIEWPORT = HResult($88760000 + 775);
 
(*
* Attempted to CreateTexture on a surface that had a color key
*)
D3DERR_COLORKEYATTACHED = MAKE_D3DHRESULT + 2050;
D3DERR_INVALIDVERTEXFORMAT = HResult($88760000 + 2048);
 
D3DERR_VERTEXBUFFEROPTIMIZED = MAKE_D3DHRESULT + 2060;
D3DERR_VBUF_CREATE_FAILED = MAKE_D3DHRESULT + 2061;
D3DERR_VERTEXBUFFERLOCKED = MAKE_D3DHRESULT + 2062;
D3DERR_COLORKEYATTACHED = HResult($88760000 + 2050);
 
D3DERR_ZBUFFER_NOTPRESENT = MAKE_D3DHRESULT + 2070;
D3DERR_STENCILBUFFER_NOTPRESENT = MAKE_D3DHRESULT + 2071;
D3DERR_VERTEXBUFFEROPTIMIZED = HResult($88760000 + 2060);
D3DERR_VBUF_CREATE_FAILED = HResult($88760000 + 2061);
D3DERR_VERTEXBUFFERLOCKED = HResult($88760000 + 2062);
D3DERR_VERTEXBUFFERUNLOCKFAILED = HResult($88760000 + 2063);
 
D3DERR_WRONGTEXTUREFORMAT = MAKE_D3DHRESULT + 2072;
D3DERR_UNSUPPORTEDCOLOROPERATION = MAKE_D3DHRESULT + 2073;
D3DERR_UNSUPPORTEDCOLORARG = MAKE_D3DHRESULT + 2074;
D3DERR_UNSUPPORTEDALPHAOPERATION = MAKE_D3DHRESULT + 2075;
D3DERR_UNSUPPORTEDALPHAARG = MAKE_D3DHRESULT + 2076;
D3DERR_TOOMANYOPERATIONS = MAKE_D3DHRESULT + 2077;
D3DERR_CONFLICTINGTEXTUREFILTER = MAKE_D3DHRESULT + 2078;
D3DERR_UNSUPPORTEDFACTORVALUE = MAKE_D3DHRESULT + 2079;
D3DERR_CONFLICTINGRENDERSTATE = MAKE_D3DHRESULT + 2081;
D3DERR_UNSUPPORTEDTEXTUREFILTER = MAKE_D3DHRESULT + 2082;
D3DERR_TOOMANYPRIMITIVES = MAKE_D3DHRESULT + 2083;
D3DERR_INVALIDMATRIX = MAKE_D3DHRESULT + 2084;
D3DERR_TOOMANYVERTICES = MAKE_D3DHRESULT + 2085;
D3DERR_CONFLICTINGTEXTUREPALETTE = MAKE_D3DHRESULT + 2086;
D3DERR_ZBUFFER_NOTPRESENT = HResult($88760000 + 2070);
D3DERR_STENCILBUFFER_NOTPRESENT = HResult($88760000 + 2071);
 
D3DERR_INVALIDSTATEBLOCK = MAKE_D3DHRESULT + 2100;
D3DERR_INBEGINSTATEBLOCK = MAKE_D3DHRESULT + 2101;
D3DERR_NOTINBEGINSTATEBLOCK = MAKE_D3DHRESULT + 2102;
D3DERR_WRONGTEXTUREFORMAT = HResult($88760000 + 2072);
D3DERR_UNSUPPORTEDCOLOROPERATION = HResult($88760000 + 2073);
D3DERR_UNSUPPORTEDCOLORARG = HResult($88760000 + 2074);
D3DERR_UNSUPPORTEDALPHAOPERATION = HResult($88760000 + 2075);
D3DERR_UNSUPPORTEDALPHAARG = HResult($88760000 + 2076);
D3DERR_TOOMANYOPERATIONS = HResult($88760000 + 2077);
D3DERR_CONFLICTINGTEXTUREFILTER = HResult($88760000 + 2078);
D3DERR_UNSUPPORTEDFACTORVALUE = HResult($88760000 + 2079);
D3DERR_CONFLICTINGRENDERSTATE = HResult($88760000 + 2081);
D3DERR_UNSUPPORTEDTEXTUREFILTER = HResult($88760000 + 2082);
D3DERR_TOOMANYPRIMITIVES = HResult($88760000 + 2083);
D3DERR_INVALIDMATRIX = HResult($88760000 + 2084);
D3DERR_TOOMANYVERTICES = HResult($88760000 + 2085);
D3DERR_CONFLICTINGTEXTUREPALETTE = HResult($88760000 + 2086);
 
procedure DisableFPUExceptions;
procedure EnableFPUExceptions;
D3DERR_INVALIDSTATEBLOCK = HResult($88760000 + 2100);
D3DERR_INBEGINSTATEBLOCK = HResult($88760000 + 2101);
D3DERR_NOTINBEGINSTATEBLOCK = HResult($88760000 + 2102);
 
(***************************************************************************
*
* Copyright (C) 1998-1999 Microsoft Corporation. All Rights Reserved.
*
* File: dxfile.h
*
* Content: DirectX File public header file
*
***************************************************************************)
 
var
DXFileDLL : HMODULE;
 
function DXFileErrorString(Value: HResult) : string;
 
type
TDXFileFormat = (
DXFILEFORMAT_BINARY,
DXFILEFORMAT_TEXT,
DXFILEFORMAT_COMPRESSED
);
 
TDXFileLoadOptions = (
DXFILELOAD_FROMFILE,
DXFILELOAD_FROMRESOURCE,
DXFILELOAD_FROMMEMORY,
DXFILELOAD_INVALID_3,
DXFILELOAD_FROMSTREAM,
DXFILELOAD_INVALID_5,
DXFILELOAD_INVALID_6,
DXFILELOAD_INVALID_7,
DXFILELOAD_FROMURL
);
 
PDXFileLoadResource = ^TDXFileLoadResource;
TDXFileLoadResource = packed record
hModule: HModule;
lpName: PAnsiChar;
lpType: PAnsiChar;
end;
 
PDXFileLoadMemory = ^TDXFileLoadMemory;
TDXFileLoadMemory = packed record
lpMemory: Pointer;
dSize: DWORD;
end;
 
(*
* DirectX File object types.
*)
 
IDirectXFile = interface;
IDirectXFileEnumObject = interface;
IDirectXFileSaveObject = interface;
IDirectXFileObject = interface;
IDirectXFileData = interface;
IDirectXFileDataReference = interface;
IDirectXFileBinary = interface;
 
(*
* DirectX File interfaces.
*)
 
IDirectXFile = interface (IUnknown)
['{3d82ab40-62da-11cf-ab39-0020af71e433}']
function CreateEnumObject (pvSource: Pointer;
dwLoadOptions: TDXFileLoadOptions;
var ppEnumObj: IDirectXFileEnumObject) : HResult; stdcall;
function CreateSaveObject (szFileName: PChar; dwFileFormat: TDXFileFormat;
var ppSaveObj: IDirectXFileSaveObject) : HResult; stdcall;
function RegisterTemplates (pvData: Pointer; cbSize: DWORD) : HResult; stdcall;
end;
 
IDirectXFileEnumObject = interface (IUnknown)
['{3d82ab41-62da-11cf-ab39-0020af71e433}']
function GetNextDataObject (var ppDataObj: IDirectXFileData) : HResult; stdcall;
function GetDataObjectById
(const rguid: TGUID; var ppDataObj: IDirectXFileData) : HResult; stdcall;
function GetDataObjectByName
(szName: PChar; var ppDataObj: IDirectXFileData) : HResult; stdcall;
end;
 
IDirectXFileSaveObject = interface (IUnknown)
['{3d82ab42-62da-11cf-ab39-0020af71e433}']
function SaveTemplates
(cTemplates: DWORD; var ppguidTemplates: PGUID) : HResult; stdcall;
function CreateDataObject (const rguidTemplate: TGUID; szName: PChar;
pguid: PGUID; cbSize: DWORD; pvData: Pointer;
var ppDataObj: IDirectXFileData) : HResult; stdcall;
function SaveData (pDataObj: IDirectXFileData) : HResult; stdcall;
end;
 
IDirectXFileObject = interface (IUnknown)
['{3d82ab43-62da-11cf-ab39-0020af71e433}']
function GetName (pstrNameBuf: PChar; var dwBufLen: DWORD) : HResult; stdcall;
function GetId (var pGuidBuf: TGUID) : HResult; stdcall;
end;
 
IDirectXFileData = interface (IDirectXFileObject)
['{3d82ab44-62da-11cf-ab39-0020af71e433}']
function GetData
(szMember: PChar; var pcbSize: DWORD; var ppvData: Pointer) : HResult; stdcall;
function GetType (var ppguid: PGUID) : HResult; stdcall;
function GetNextObject (var ppChildObj: IDirectXFileObject) : HResult; stdcall;
function AddDataObject (pDataObj: IDirectXFileData) : HResult; stdcall;
function AddDataReference (szRef: PChar; pguidRef: PGUID) : HResult; stdcall;
function AddBinaryObject (szName: PChar; pguid: PGUID; szMimeType: PChar;
pvData: Pointer; cbSize: DWORD) : HResult; stdcall;
end;
 
IDirectXFileDataReference = interface (IDirectXFileObject)
['{3d82ab45-62da-11cf-ab39-0020af71e433}']
function Resolve (var ppDataObj: IDirectXFileData) : HResult; stdcall;
end;
 
IDirectXFileBinary = interface (IDirectXFileObject)
['{3d82ab46-62da-11cf-ab39-0020af71e433}']
function GetSize (var pcbSize: DWORD) : HResult; stdcall;
function GetMimeType (var pszMimeType: PChar) : HResult; stdcall;
function Read(pvData: Pointer; cbSize: DWORD; pcbRead: PDWORD{?}) : HResult; stdcall;
end;
 
const
 
(*
* DirectXFile Object Class Id (for CoCreateInstance())
*)
 
CLSID_CDirectXFile: TGUID =
(D1:$4516ec43;D2:$8f20;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
 
(*
* DirectX File Interface GUIDs.
*)
 
type
IID_IDirectXFile = IDirectXFile;
IID_IDirectXFileEnumObject = IDirectXFileEnumObject;
IID_IDirectXFileSaveObject = IDirectXFileSaveObject;
IID_IDirectXFileObject = IDirectXFileObject;
IID_IDirectXFileData = IDirectXFileData;
IID_IDirectXFileDataReference = IDirectXFileDataReference;
IID_IDirectXFileBinary = IDirectXFileBinary;
 
(*
* DirectX File Header template's GUID.
*)
const
TID_DXFILEHeader: TGUID =
(D1:$3d82ab43;D2:$62da;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
 
(*
* DirectX File errors.
*)
 
const
DXFILE_OK = 0;
 
DXFILEERR_BADOBJECT = MAKE_D3DHRESULT or 850;
DXFILEERR_BADVALUE = MAKE_D3DHRESULT or 851;
DXFILEERR_BADTYPE = MAKE_D3DHRESULT or 852;
DXFILEERR_BADSTREAMHANDLE = MAKE_D3DHRESULT or 853;
DXFILEERR_BADALLOC = MAKE_D3DHRESULT or 854;
DXFILEERR_NOTFOUND = MAKE_D3DHRESULT or 855;
DXFILEERR_NOTDONEYET = MAKE_D3DHRESULT or 856;
DXFILEERR_FILENOTFOUND = MAKE_D3DHRESULT or 857;
DXFILEERR_RESOURCENOTFOUND = MAKE_D3DHRESULT or 858;
DXFILEERR_URLNOTFOUND = MAKE_D3DHRESULT or 859;
DXFILEERR_BADRESOURCE = MAKE_D3DHRESULT or 860;
DXFILEERR_BADFILETYPE = MAKE_D3DHRESULT or 861;
DXFILEERR_BADFILEVERSION = MAKE_D3DHRESULT or 862;
DXFILEERR_BADFILEFLOATSIZE = MAKE_D3DHRESULT or 863;
DXFILEERR_BADFILECOMPRESSIONTYPE = MAKE_D3DHRESULT or 864;
DXFILEERR_BADFILE = MAKE_D3DHRESULT or 865;
DXFILEERR_PARSEERROR = MAKE_D3DHRESULT or 866;
DXFILEERR_NOTEMPLATE = MAKE_D3DHRESULT or 867;
DXFILEERR_BADARRAYSIZE = MAKE_D3DHRESULT or 868;
DXFILEERR_BADDATAREFERENCE = MAKE_D3DHRESULT or 869;
DXFILEERR_INTERNALERROR = MAKE_D3DHRESULT or 870;
DXFILEERR_NOMOREOBJECTS = MAKE_D3DHRESULT or 871;
DXFILEERR_BADINTRINSICS = MAKE_D3DHRESULT or 872;
DXFILEERR_NOMORESTREAMHANDLES = MAKE_D3DHRESULT or 873;
DXFILEERR_NOMOREDATA = MAKE_D3DHRESULT or 874;
DXFILEERR_BADCACHEFILE = MAKE_D3DHRESULT or 875;
DXFILEERR_NOINTERNET = MAKE_D3DHRESULT or 876;
 
{$IFDEF D3DRM}
(*
* API for creating IDirectXFile interface.
*)
 
var
DirectXFileCreate : function
(out lplpDirectXFile: IDirectXFile) : HResult; stdcall;
 
(* D3DRM XFile templates in binary form *)
const
D3DRM_XTEMPLATE_BYTES = 3215;
D3DRM_XTEMPLATES: array [0..D3DRM_XTEMPLATE_BYTES-1] of byte = (
$78, $6f, $66, $20, $30, $33, $30, $32, $62,
$69, $6e, $20, $30, $30, $36, $34, $1f, 0, $1,
0, $6, 0, 0, 0, $48, $65, $61, $64, $65,
$72, $a, 0, $5, 0, $43, $ab, $82, $3d, $da,
$62, $cf, $11, $ab, $39, 0, $20, $af, $71, $e4,
$33, $28, 0, $1, 0, $5, 0, 0, 0, $6d,
$61, $6a, $6f, $72, $14, 0, $28, 0, $1, 0,
$5, 0, 0, 0, $6d, $69, $6e, $6f, $72, $14,
0, $29, 0, $1, 0, $5, 0, 0, 0, $66,
$6c, $61, $67, $73, $14, 0, $b, 0, $1f, 0,
$1, 0, $6, 0, 0, 0, $56, $65, $63, $74,
$6f, $72, $a, 0, $5, 0, $5e, $ab, $82, $3d,
$da, $62, $cf, $11, $ab, $39, 0, $20, $af, $71,
$e4, $33, $2a, 0, $1, 0, $1, 0, 0, 0,
$78, $14, 0, $2a, 0, $1, 0, $1, 0, 0,
0, $79, $14, 0, $2a, 0, $1, 0, $1, 0,
0, 0, $7a, $14, 0, $b, 0, $1f, 0, $1,
0, $8, 0, 0, 0, $43, $6f, $6f, $72, $64,
$73, $32, $64, $a, 0, $5, 0, $44, $3f, $f2,
$f6, $86, $76, $cf, $11, $8f, $52, 0, $40, $33,
$35, $94, $a3, $2a, 0, $1, 0, $1, 0, 0,
0, $75, $14, 0, $2a, 0, $1, 0, $1, 0,
0, 0, $76, $14, 0, $b, 0, $1f, 0, $1,
0, $9, 0, 0, 0, $4d, $61, $74, $72, $69,
$78, $34, $78, $34, $a, 0, $5, 0, $45, $3f,
$f2, $f6, $86, $76, $cf, $11, $8f, $52, 0, $40,
$33, $35, $94, $a3, $34, 0, $2a, 0, $1, 0,
$6, 0, 0, 0, $6d, $61, $74, $72, $69, $78,
$e, 0, $3, 0, $10, 0, 0, 0, $f, 0,
$14, 0, $b, 0, $1f, 0, $1, 0, $9, 0,
0, 0, $43, $6f, $6c, $6f, $72, $52, $47, $42,
$41, $a, 0, $5, 0, $e0, $44, $ff, $35, $7c,
$6c, $cf, $11, $8f, $52, 0, $40, $33, $35, $94,
$a3, $2a, 0, $1, 0, $3, 0, 0, 0, $72,
$65, $64, $14, 0, $2a, 0, $1, 0, $5, 0,
0, 0, $67, $72, $65, $65, $6e, $14, 0, $2a,
0, $1, 0, $4, 0, 0, 0, $62, $6c, $75,
$65, $14, 0, $2a, 0, $1, 0, $5, 0, 0,
0, $61, $6c, $70, $68, $61, $14, 0, $b, 0,
$1f, 0, $1, 0, $8, 0, 0, 0, $43, $6f,
$6c, $6f, $72, $52, $47, $42, $a, 0, $5, 0,
$81, $6e, $e1, $d3, $35, $78, $cf, $11, $8f, $52,
0, $40, $33, $35, $94, $a3, $2a, 0, $1, 0,
$3, 0, 0, 0, $72, $65, $64, $14, 0, $2a,
0, $1, 0, $5, 0, 0, 0, $67, $72, $65,
$65, $6e, $14, 0, $2a, 0, $1, 0, $4, 0,
0, 0, $62, $6c, $75, $65, $14, 0, $b, 0,
$1f, 0, $1, 0, $c, 0, 0, 0, $49, $6e,
$64, $65, $78, $65, $64, $43, $6f, $6c, $6f, $72,
$a, 0, $5, 0, $20, $b8, $30, $16, $42, $78,
$cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3,
$29, 0, $1, 0, $5, 0, 0, 0, $69, $6e,
$64, $65, $78, $14, 0, $1, 0, $9, 0, 0,
0, $43, $6f, $6c, $6f, $72, $52, $47, $42, $41,
$1, 0, $a, 0, 0, 0, $69, $6e, $64, $65,
$78, $43, $6f, $6c, $6f, $72, $14, 0, $b, 0,
$1f, 0, $1, 0, $7, 0, 0, 0, $42, $6f,
$6f, $6c, $65, $61, $6e, $a, 0, $5, 0, $a0,
$a6, $7d, $53, $37, $ca, $d0, $11, $94, $1c, 0,
$80, $c8, $c, $fa, $7b, $29, 0, $1, 0, $9,
0, 0, 0, $74, $72, $75, $65, $66, $61, $6c,
$73, $65, $14, 0, $b, 0, $1f, 0, $1, 0,
$9, 0, 0, 0, $42, $6f, $6f, $6c, $65, $61,
$6e, $32, $64, $a, 0, $5, 0, $63, $ae, $85,
$48, $e8, $78, $cf, $11, $8f, $52, 0, $40, $33,
$35, $94, $a3, $1, 0, $7, 0, 0, 0, $42,
$6f, $6f, $6c, $65, $61, $6e, $1, 0, $1, 0,
0, 0, $75, $14, 0, $1, 0, $7, 0, 0,
0, $42, $6f, $6f, $6c, $65, $61, $6e, $1, 0,
$1, 0, 0, 0, $76, $14, 0, $b, 0, $1f,
0, $1, 0, $c, 0, 0, 0, $4d, $61, $74,
$65, $72, $69, $61, $6c, $57, $72, $61, $70, $a,
0, $5, 0, $60, $ae, $85, $48, $e8, $78, $cf,
$11, $8f, $52, 0, $40, $33, $35, $94, $a3, $1,
0, $7, 0, 0, 0, $42, $6f, $6f, $6c, $65,
$61, $6e, $1, 0, $1, 0, 0, 0, $75, $14,
0, $1, 0, $7, 0, 0, 0, $42, $6f, $6f,
$6c, $65, $61, $6e, $1, 0, $1, 0, 0, 0,
$76, $14, 0, $b, 0, $1f, 0, $1, 0, $f,
0, 0, 0, $54, $65, $78, $74, $75, $72, $65,
$46, $69, $6c, $65, $6e, $61, $6d, $65, $a, 0,
$5, 0, $e1, $90, $27, $a4, $10, $78, $cf, $11,
$8f, $52, 0, $40, $33, $35, $94, $a3, $31, 0,
$1, 0, $8, 0, 0, 0, $66, $69, $6c, $65,
$6e, $61, $6d, $65, $14, 0, $b, 0, $1f, 0,
$1, 0, $8, 0, 0, 0, $4d, $61, $74, $65,
$72, $69, $61, $6c, $a, 0, $5, 0, $4d, $ab,
$82, $3d, $da, $62, $cf, $11, $ab, $39, 0, $20,
$af, $71, $e4, $33, $1, 0, $9, 0, 0, 0,
$43, $6f, $6c, $6f, $72, $52, $47, $42, $41, $1,
0, $9, 0, 0, 0, $66, $61, $63, $65, $43,
$6f, $6c, $6f, $72, $14, 0, $2a, 0, $1, 0,
$5, 0, 0, 0, $70, $6f, $77, $65, $72, $14,
0, $1, 0, $8, 0, 0, 0, $43, $6f, $6c,
$6f, $72, $52, $47, $42, $1, 0, $d, 0, 0,
0, $73, $70, $65, $63, $75, $6c, $61, $72, $43,
$6f, $6c, $6f, $72, $14, 0, $1, 0, $8, 0,
0, 0, $43, $6f, $6c, $6f, $72, $52, $47, $42,
$1, 0, $d, 0, 0, 0, $65, $6d, $69, $73,
$73, $69, $76, $65, $43, $6f, $6c, $6f, $72, $14,
0, $e, 0, $12, 0, $12, 0, $12, 0, $f,
0, $b, 0, $1f, 0, $1, 0, $8, 0, 0,
0, $4d, $65, $73, $68, $46, $61, $63, $65, $a,
0, $5, 0, $5f, $ab, $82, $3d, $da, $62, $cf,
$11, $ab, $39, 0, $20, $af, $71, $e4, $33, $29,
0, $1, 0, $12, 0, 0, 0, $6e, $46, $61,
$63, $65, $56, $65, $72, $74, $65, $78, $49, $6e,
$64, $69, $63, $65, $73, $14, 0, $34, 0, $29,
0, $1, 0, $11, 0, 0, 0, $66, $61, $63,
$65, $56, $65, $72, $74, $65, $78, $49, $6e, $64,
$69, $63, $65, $73, $e, 0, $1, 0, $12, 0,
0, 0, $6e, $46, $61, $63, $65, $56, $65, $72,
$74, $65, $78, $49, $6e, $64, $69, $63, $65, $73,
$f, 0, $14, 0, $b, 0, $1f, 0, $1, 0,
$d, 0, 0, 0, $4d, $65, $73, $68, $46, $61,
$63, $65, $57, $72, $61, $70, $73, $a, 0, $5,
0, $c0, $c5, $1e, $ed, $a8, $c0, $d0, $11, $94,
$1c, 0, $80, $c8, $c, $fa, $7b, $29, 0, $1,
0, $f, 0, 0, 0, $6e, $46, $61, $63, $65,
$57, $72, $61, $70, $56, $61, $6c, $75, $65, $73,
$14, 0, $34, 0, $1, 0, $9, 0, 0, 0,
$42, $6f, $6f, $6c, $65, $61, $6e, $32, $64, $1,
0, $e, 0, 0, 0, $66, $61, $63, $65, $57,
$72, $61, $70, $56, $61, $6c, $75, $65, $73, $e,
0, $1, 0, $f, 0, 0, 0, $6e, $46, $61,
$63, $65, $57, $72, $61, $70, $56, $61, $6c, $75,
$65, $73, $f, 0, $14, 0, $b, 0, $1f, 0,
$1, 0, $11, 0, 0, 0, $4d, $65, $73, $68,
$54, $65, $78, $74, $75, $72, $65, $43, $6f, $6f,
$72, $64, $73, $a, 0, $5, 0, $40, $3f, $f2,
$f6, $86, $76, $cf, $11, $8f, $52, 0, $40, $33,
$35, $94, $a3, $29, 0, $1, 0, $e, 0, 0,
0, $6e, $54, $65, $78, $74, $75, $72, $65, $43,
$6f, $6f, $72, $64, $73, $14, 0, $34, 0, $1,
0, $8, 0, 0, 0, $43, $6f, $6f, $72, $64,
$73, $32, $64, $1, 0, $d, 0, 0, 0, $74,
$65, $78, $74, $75, $72, $65, $43, $6f, $6f, $72,
$64, $73, $e, 0, $1, 0, $e, 0, 0, 0,
$6e, $54, $65, $78, $74, $75, $72, $65, $43, $6f,
$6f, $72, $64, $73, $f, 0, $14, 0, $b, 0,
$1f, 0, $1, 0, $10, 0, 0, 0, $4d, $65,
$73, $68, $4d, $61, $74, $65, $72, $69, $61, $6c,
$4c, $69, $73, $74, $a, 0, $5, 0, $42, $3f,
$f2, $f6, $86, $76, $cf, $11, $8f, $52, 0, $40,
$33, $35, $94, $a3, $29, 0, $1, 0, $a, 0,
0, 0, $6e, $4d, $61, $74, $65, $72, $69, $61,
$6c, $73, $14, 0, $29, 0, $1, 0, $c, 0,
0, 0, $6e, $46, $61, $63, $65, $49, $6e, $64,
$65, $78, $65, $73, $14, 0, $34, 0, $29, 0,
$1, 0, $b, 0, 0, 0, $66, $61, $63, $65,
$49, $6e, $64, $65, $78, $65, $73, $e, 0, $1,
0, $c, 0, 0, 0, $6e, $46, $61, $63, $65,
$49, $6e, $64, $65, $78, $65, $73, $f, 0, $14,
0, $e, 0, $1, 0, $8, 0, 0, 0, $4d,
$61, $74, $65, $72, $69, $61, $6c, $f, 0, $b,
0, $1f, 0, $1, 0, $b, 0, 0, 0, $4d,
$65, $73, $68, $4e, $6f, $72, $6d, $61, $6c, $73,
$a, 0, $5, 0, $43, $3f, $f2, $f6, $86, $76,
$cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3,
$29, 0, $1, 0, $8, 0, 0, 0, $6e, $4e,
$6f, $72, $6d, $61, $6c, $73, $14, 0, $34, 0,
$1, 0, $6, 0, 0, 0, $56, $65, $63, $74,
$6f, $72, $1, 0, $7, 0, 0, 0, $6e, $6f,
$72, $6d, $61, $6c, $73, $e, 0, $1, 0, $8,
0, 0, 0, $6e, $4e, $6f, $72, $6d, $61, $6c,
$73, $f, 0, $14, 0, $29, 0, $1, 0, $c,
0, 0, 0, $6e, $46, $61, $63, $65, $4e, $6f,
$72, $6d, $61, $6c, $73, $14, 0, $34, 0, $1,
0, $8, 0, 0, 0, $4d, $65, $73, $68, $46,
$61, $63, $65, $1, 0, $b, 0, 0, 0, $66,
$61, $63, $65, $4e, $6f, $72, $6d, $61, $6c, $73,
$e, 0, $1, 0, $c, 0, 0, 0, $6e, $46,
$61, $63, $65, $4e, $6f, $72, $6d, $61, $6c, $73,
$f, 0, $14, 0, $b, 0, $1f, 0, $1, 0,
$10, 0, 0, 0, $4d, $65, $73, $68, $56, $65,
$72, $74, $65, $78, $43, $6f, $6c, $6f, $72, $73,
$a, 0, $5, 0, $21, $b8, $30, $16, $42, $78,
$cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3,
$29, 0, $1, 0, $d, 0, 0, 0, $6e, $56,
$65, $72, $74, $65, $78, $43, $6f, $6c, $6f, $72,
$73, $14, 0, $34, 0, $1, 0, $c, 0, 0,
0, $49, $6e, $64, $65, $78, $65, $64, $43, $6f,
$6c, $6f, $72, $1, 0, $c, 0, 0, 0, $76,
$65, $72, $74, $65, $78, $43, $6f, $6c, $6f, $72,
$73, $e, 0, $1, 0, $d, 0, 0, 0, $6e,
$56, $65, $72, $74, $65, $78, $43, $6f, $6c, $6f,
$72, $73, $f, 0, $14, 0, $b, 0, $1f, 0,
$1, 0, $4, 0, 0, 0, $4d, $65, $73, $68,
$a, 0, $5, 0, $44, $ab, $82, $3d, $da, $62,
$cf, $11, $ab, $39, 0, $20, $af, $71, $e4, $33,
$29, 0, $1, 0, $9, 0, 0, 0, $6e, $56,
$65, $72, $74, $69, $63, $65, $73, $14, 0, $34,
0, $1, 0, $6, 0, 0, 0, $56, $65, $63,
$74, $6f, $72, $1, 0, $8, 0, 0, 0, $76,
$65, $72, $74, $69, $63, $65, $73, $e, 0, $1,
0, $9, 0, 0, 0, $6e, $56, $65, $72, $74,
$69, $63, $65, $73, $f, 0, $14, 0, $29, 0,
$1, 0, $6, 0, 0, 0, $6e, $46, $61, $63,
$65, $73, $14, 0, $34, 0, $1, 0, $8, 0,
0, 0, $4d, $65, $73, $68, $46, $61, $63, $65,
$1, 0, $5, 0, 0, 0, $66, $61, $63, $65,
$73, $e, 0, $1, 0, $6, 0, 0, 0, $6e,
$46, $61, $63, $65, $73, $f, 0, $14, 0, $e,
0, $12, 0, $12, 0, $12, 0, $f, 0, $b,
0, $1f, 0, $1, 0, $14, 0, 0, 0, $46,
$72, $61, $6d, $65, $54, $72, $61, $6e, $73, $66,
$6f, $72, $6d, $4d, $61, $74, $72, $69, $78, $a,
0, $5, 0, $41, $3f, $f2, $f6, $86, $76, $cf,
$11, $8f, $52, 0, $40, $33, $35, $94, $a3, $1,
0, $9, 0, 0, 0, $4d, $61, $74, $72, $69,
$78, $34, $78, $34, $1, 0, $b, 0, 0, 0,
$66, $72, $61, $6d, $65, $4d, $61, $74, $72, $69,
$78, $14, 0, $b, 0, $1f, 0, $1, 0, $5,
0, 0, 0, $46, $72, $61, $6d, $65, $a, 0,
$5, 0, $46, $ab, $82, $3d, $da, $62, $cf, $11,
$ab, $39, 0, $20, $af, $71, $e4, $33, $e, 0,
$12, 0, $12, 0, $12, 0, $f, 0, $b, 0,
$1f, 0, $1, 0, $9, 0, 0, 0, $46, $6c,
$6f, $61, $74, $4b, $65, $79, $73, $a, 0, $5,
0, $a9, $46, $dd, $10, $5b, $77, $cf, $11, $8f,
$52, 0, $40, $33, $35, $94, $a3, $29, 0, $1,
0, $7, 0, 0, 0, $6e, $56, $61, $6c, $75,
$65, $73, $14, 0, $34, 0, $2a, 0, $1, 0,
$6, 0, 0, 0, $76, $61, $6c, $75, $65, $73,
$e, 0, $1, 0, $7, 0, 0, 0, $6e, $56,
$61, $6c, $75, $65, $73, $f, 0, $14, 0, $b,
0, $1f, 0, $1, 0, $e, 0, 0, 0, $54,
$69, $6d, $65, $64, $46, $6c, $6f, $61, $74, $4b,
$65, $79, $73, $a, 0, $5, 0, $80, $b1, $6,
$f4, $3b, $7b, $cf, $11, $8f, $52, 0, $40, $33,
$35, $94, $a3, $29, 0, $1, 0, $4, 0, 0,
0, $74, $69, $6d, $65, $14, 0, $1, 0, $9,
0, 0, 0, $46, $6c, $6f, $61, $74, $4b, $65,
$79, $73, $1, 0, $6, 0, 0, 0, $74, $66,
$6b, $65, $79, $73, $14, 0, $b, 0, $1f, 0,
$1, 0, $c, 0, 0, 0, $41, $6e, $69, $6d,
$61, $74, $69, $6f, $6e, $4b, $65, $79, $a, 0,
$5, 0, $a8, $46, $dd, $10, $5b, $77, $cf, $11,
$8f, $52, 0, $40, $33, $35, $94, $a3, $29, 0,
$1, 0, $7, 0, 0, 0, $6b, $65, $79, $54,
$79, $70, $65, $14, 0, $29, 0, $1, 0, $5,
0, 0, 0, $6e, $4b, $65, $79, $73, $14, 0,
$34, 0, $1, 0, $e, 0, 0, 0, $54, $69,
$6d, $65, $64, $46, $6c, $6f, $61, $74, $4b, $65,
$79, $73, $1, 0, $4, 0, 0, 0, $6b, $65,
$79, $73, $e, 0, $1, 0, $5, 0, 0, 0,
$6e, $4b, $65, $79, $73, $f, 0, $14, 0, $b,
0, $1f, 0, $1, 0, $10, 0, 0, 0, $41,
$6e, $69, $6d, $61, $74, $69, $6f, $6e, $4f, $70,
$74, $69, $6f, $6e, $73, $a, 0, $5, 0, $c0,
$56, $bf, $e2, $f, $84, $cf, $11, $8f, $52, 0,
$40, $33, $35, $94, $a3, $29, 0, $1, 0, $a,
0, 0, 0, $6f, $70, $65, $6e, $63, $6c, $6f,
$73, $65, $64, $14, 0, $29, 0, $1, 0, $f,
0, 0, 0, $70, $6f, $73, $69, $74, $69, $6f,
$6e, $71, $75, $61, $6c, $69, $74, $79, $14, 0,
$b, 0, $1f, 0, $1, 0, $9, 0, 0, 0,
$41, $6e, $69, $6d, $61, $74, $69, $6f, $6e, $a,
0, $5, 0, $4f, $ab, $82, $3d, $da, $62, $cf,
$11, $ab, $39, 0, $20, $af, $71, $e4, $33, $e,
0, $12, 0, $12, 0, $12, 0, $f, 0, $b,
0, $1f, 0, $1, 0, $c, 0, 0, 0, $41,
$6e, $69, $6d, $61, $74, $69, $6f, $6e, $53, $65,
$74, $a, 0, $5, 0, $50, $ab, $82, $3d, $da,
$62, $cf, $11, $ab, $39, 0, $20, $af, $71, $e4,
$33, $e, 0, $1, 0, $9, 0, 0, 0, $41,
$6e, $69, $6d, $61, $74, $69, $6f, $6e, $f, 0,
$b, 0, $1f, 0, $1, 0, $a, 0, 0, 0,
$49, $6e, $6c, $69, $6e, $65, $44, $61, $74, $61,
$a, 0, $5, 0, $a0, $ee, $23, $3a, $b1, $94,
$d0, $11, $ab, $39, 0, $20, $af, $71, $e4, $33,
$e, 0, $1, 0, $6, 0, 0, 0, $42, $49,
$4e, $41, $52, $59, $f, 0, $b, 0, $1f, 0,
$1, 0, $3, 0, 0, 0, $55, $72, $6c, $a,
0, $5, 0, $a1, $ee, $23, $3a, $b1, $94, $d0,
$11, $ab, $39, 0, $20, $af, $71, $e4, $33, $29,
0, $1, 0, $5, 0, 0, 0, $6e, $55, $72,
$6c, $73, $14, 0, $34, 0, $31, 0, $1, 0,
$4, 0, 0, 0, $75, $72, $6c, $73, $e, 0,
$1, 0, $5, 0, 0, 0, $6e, $55, $72, $6c,
$73, $f, 0, $14, 0, $b, 0, $1f, 0, $1,
0, $f, 0, 0, 0, $50, $72, $6f, $67, $72,
$65, $73, $73, $69, $76, $65, $4d, $65, $73, $68,
$a, 0, $5, 0, $60, $c3, $63, $8a, $7d, $99,
$d0, $11, $94, $1c, 0, $80, $c8, $c, $fa, $7b,
$e, 0, $1, 0, $3, 0, 0, 0, $55, $72,
$6c, $13, 0, $1, 0, $a, 0, 0, 0, $49,
$6e, $6c, $69, $6e, $65, $44, $61, $74, $61, $f,
0, $b, 0, $1f, 0, $1, 0, $4, 0, 0,
0, $47, $75, $69, $64, $a, 0, $5, 0, $e0,
$90, $27, $a4, $10, $78, $cf, $11, $8f, $52, 0,
$40, $33, $35, $94, $a3, $29, 0, $1, 0, $5,
0, 0, 0, $64, $61, $74, $61, $31, $14, 0,
$28, 0, $1, 0, $5, 0, 0, 0, $64, $61,
$74, $61, $32, $14, 0, $28, 0, $1, 0, $5,
0, 0, 0, $64, $61, $74, $61, $33, $14, 0,
$34, 0, $2d, 0, $1, 0, $5, 0, 0, 0,
$64, $61, $74, $61, $34, $e, 0, $3, 0, $8,
0, 0, 0, $f, 0, $14, 0, $b, 0, $1f,
0, $1, 0, $e, 0, 0, 0, $53, $74, $72,
$69, $6e, $67, $50, $72, $6f, $70, $65, $72, $74,
$79, $a, 0, $5, 0, $e0, $21, $f, $7f, $e1,
$bf, $d1, $11, $82, $c0, 0, $a0, $c9, $69, $72,
$71, $31, 0, $1, 0, $3, 0, 0, 0, $6b,
$65, $79, $14, 0, $31, 0, $1, 0, $5, 0,
0, 0, $76, $61, $6c, $75, $65, $14, 0, $b,
0, $1f, 0, $1, 0, $b, 0, 0, 0, $50,
$72, $6f, $70, $65, $72, $74, $79, $42, $61, $67,
$a, 0, $5, 0, $e1, $21, $f, $7f, $e1, $bf,
$d1, $11, $82, $c0, 0, $a0, $c9, $69, $72, $71,
$e, 0, $1, 0, $e, 0, 0, 0, $53, $74,
$72, $69, $6e, $67, $50, $72, $6f, $70, $65, $72,
$74, $79, $f, 0, $b, 0, $1f, 0, $1, 0,
$e, 0, 0, 0, $45, $78, $74, $65, $72, $6e,
$61, $6c, $56, $69, $73, $75, $61, $6c, $a, 0,
$5, 0, $a0, $6a, $11, $98, $ba, $bd, $d1, $11,
$82, $c0, 0, $a0, $c9, $69, $72, $71, $1, 0,
$4, 0, 0, 0, $47, $75, $69, $64, $1, 0,
$12, 0, 0, 0, $67, $75, $69, $64, $45, $78,
$74, $65, $72, $6e, $61, $6c, $56, $69, $73, $75,
$61, $6c, $14, 0, $e, 0, $12, 0, $12, 0,
$12, 0, $f, 0, $b, 0);
 
//---------------
 
//Direct3DRM file
(*==========================================================================;
*
* Copyright (C) 1994-1997 Microsoft Corporation. All Rights Reserved.
*
* Files: D3DRMDef.h D3DRMObj.h D3DRM.h D3DRMWin.h RMXFGUID.h RMXFTmpl.h
* Content: Direct3D Retained Mode include files
*
* DirectX 7.0 Delphi adaptation by Erik Unger
*
* Modified: 10-Sep-2000
*
* Download: http://www.delphi-jedi.org/DelphiGraphics/
* E-Mail: DelphiDirectX@next-reality.com
*
*
***************************************************************************)
 
var
D3DRMDLL : HMODULE = 0;
 
(*==========================================================================;
*
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
*
* File: d3drmdef.h
9280,37 → 5690,64
*
***************************************************************************)
 
{ TD3DRMVector4D structure }
 
type
PD3DRMVector4D = ^TD3DRMVector4D;
TD3DRMVector4D = packed record
TD3DRMVector4D = record
x, y, z, w: TD3DValue;
end;
 
PD3DRMMatrix4D = ^TD3DRMMatrix4D;
D3DRMVECTOR4D = TD3DRMVector4D;
LPD3DRMVECTOR4D = PD3DRMVector4D;
 
{ TD3DRMMatrix4D structure }
 
TD3DRMMatrix4D = array [0..3, 0..3] of TD3DValue;
D3DRMMATRIX4D = TD3DRMMatrix4D;
 
{ TD3DRMQuaternion structure }
 
PD3DRMQuaternion = ^TD3DRMQuaternion;
TD3DRMQuaternion = packed record
TD3DRMQuaternion = record
s: TD3DValue;
v: TD3DVector;
end;
 
D3DRMQUATERNION = TD3DRMQuaternion;
LPD3DRMQUATERNION = PD3DRMQUATERNION;
 
{ TD3DRMRay structure }
 
PD3DRMRay = ^TD3DRMRay;
TD3DRMRay = packed record
TD3DRMRay = record
dvDir: TD3DVector;
dvPos: TD3DVector;
end;
 
D3DRMRAY = TD3DRMRay;
LPD3DRMRAY = PD3DRMRay;
 
{ TD3DRMBox structure }
 
PD3DRMBox = ^TD3DRMBox;
TD3DRMBox = packed record
TD3DRMBox = record
min, max: TD3DVector;
end;
 
TD3DRMWrapCallback = procedure (var lpD3DVector: TD3DVector;
var lpU, lpV: Integer; var lpD3DRMVA, lpD3DRMVB: TD3DVector; lpArg:
Pointer); stdcall; // unused ?
D3DRMBOX = TD3DRMBox;
LPD3DRMBOX = PD3DRMBox;
 
PD3DRMLightType = ^TD3DRMLightType; // is it 16 or 32 bit ?
{ TD3DRMWrapCallback }
 
TD3DRMWrapCallback = procedure(var lpD3DVector: TD3DVector; var lpU: Integer;
var lpV: Integer; var lpD3DRMVA: TD3DVector; lpD3DRMVB: TD3DVector;
lpArg: Pointer); stdcall;
 
D3DRMWRAPCALLBACK = TD3DRMWrapCallback;
 
{ TD3DRMLightType }
 
TD3DRMLightType = (
D3DRMLIGHT_AMBIENT,
D3DRMLIGHT_POINT,
9319,9 → 5756,13
D3DRMLIGHT_PARALLELPOINT
);
 
PD3DRMShadeMode = ^TD3DRMShadeMode;
TD3DRMShadeMode = WORD;
D3DRMLIGHTTYPE = TD3DRMLightType;
 
{ TD3DRMShadeMode }
 
TD3DRMShadeMode = Word;
D3DRMSHADEMODE = TD3DRMShadeMode;
 
const
D3DRMSHADE_FLAT = 0;
D3DRMSHADE_GOURAUD = 1;
9329,9 → 5770,11
D3DRMSHADE_MASK = 7;
D3DRMSHADE_MAX = 8;
 
{ TD3DRMLightMode }
 
type
PD3DRMLightMode = ^TD3DRMLightMode;
TD3DRMLightMode = WORD;
TD3DRMLightMode = Word;
D3DRMLIGHTMODE = TD3DRMLightMode;
 
const
D3DRMLIGHT_OFF = 0 * D3DRMSHADE_MAX;
9339,9 → 5782,11
D3DRMLIGHT_MASK = 7 * D3DRMSHADE_MAX;
D3DRMLIGHT_MAX = 8 * D3DRMSHADE_MAX;
 
{ TD3DRMFillMode }
 
type
PD3DRMFillMode = ^TD3DRMFillMode;
TD3DRMFillMode = WORD;
TD3DRMFillMode = Word;
D3DRMFILLMODE = TD3DRMFillMode;
 
const
D3DRMFILL_POINTS = 0 * D3DRMLIGHT_MAX;
9350,59 → 5795,60
D3DRMFILL_MASK = 7 * D3DRMLIGHT_MAX;
D3DRMFILL_MAX = 8 * D3DRMLIGHT_MAX;
 
{ TD3DRMRenderQuality }
 
type
PD3DRMRenderQuality = ^TD3DRMRenderQuality;
TD3DRMRenderQuality = DWORD;
D3DRMRENDERQUALITY = TD3DRMRenderQuality;
 
const
D3DRMRENDER_WIREFRAME =
(D3DRMSHADE_FLAT + D3DRMLIGHT_OFF + D3DRMFILL_WIREFRAME);
D3DRMRENDER_UNLITFLAT =
(D3DRMSHADE_FLAT + D3DRMLIGHT_OFF + D3DRMFILL_SOLID);
D3DRMRENDER_FLAT =
(D3DRMSHADE_FLAT + D3DRMLIGHT_ON + D3DRMFILL_SOLID);
D3DRMRENDER_GOURAUD =
(D3DRMSHADE_GOURAUD + D3DRMLIGHT_ON + D3DRMFILL_SOLID);
D3DRMRENDER_PHONG =
(D3DRMSHADE_PHONG + D3DRMLIGHT_ON + D3DRMFILL_SOLID);
D3DRMRENDER_WIREFRAME = D3DRMSHADE_FLAT + D3DRMLIGHT_OFF + D3DRMFILL_WIREFRAME;
D3DRMRENDER_UNLITFLAT = D3DRMSHADE_FLAT + D3DRMLIGHT_OFF + D3DRMFILL_SOLID;
D3DRMRENDER_FLAT = D3DRMSHADE_FLAT + D3DRMLIGHT_ON + D3DRMFILL_SOLID;
D3DRMRENDER_GOURAUD = D3DRMSHADE_GOURAUD + D3DRMLIGHT_ON + D3DRMFILL_SOLID;
D3DRMRENDER_PHONG = D3DRMSHADE_PHONG + D3DRMLIGHT_ON + D3DRMFILL_SOLID;
 
D3DRMRENDERMODE_BLENDEDTRANSPARENCY = 1;
D3DRMRENDERMODE_SORTEDTRANSPARENCY = 2;
D3DRMRENDERMODE_LIGHTINMODELSPACE = 8;
D3DRMRENDERMODE_VIEWDEPENDENTSPECULAR = 16;
D3DRMRENDERMODE_DISABLESORTEDALPHAZWRITE = 32;
 
{ TD3DRMTextureQuality }
 
type
PD3DRMTextureQuality = ^TD3DRMTextureQuality;
TD3DRMTextureQuality = (
D3DRMTEXTURE_NEAREST, (* choose nearest texel *)
D3DRMTEXTURE_LINEAR, (* interpolate 4 texels *)
D3DRMTEXTURE_MIPNEAREST, (* nearest texel in nearest mipmap *)
D3DRMTEXTURE_MIPLINEAR, (* interpolate 2 texels from 2 mipmaps *)
D3DRMTEXTURE_LINEARMIPNEAREST, (* interpolate 4 texels in nearest mipmap *)
D3DRMTEXTURE_LINEARMIPLINEAR (* interpolate 8 texels from 2 mipmaps *)
D3DRMTEXTURE_NEAREST, // choose nearest texel
D3DRMTEXTURE_LINEAR, // interpolate 4 texels
D3DRMTEXTURE_MIPNEAREST, // nearest texel in nearest mipmap
D3DRMTEXTURE_MIPLINEAR, // interpolate 2 texels from 2 mipmaps
D3DRMTEXTURE_LINEARMIPNEAREST, // interpolate 4 texels in nearest mipmap
D3DRMTEXTURE_LINEARMIPLINEAR // interpolate 8 texels from 2 mipmaps
);
 
D3DRMTEXTUREQUALITY = TD3DRMTextureQuality;
 
{ Texture flags }
 
const
(*
* Texture flags
*)
D3DRMTEXTURE_FORCERESIDENT = $00000001; (* texture should be kept in video memory *)
D3DRMTEXTURE_STATIC = $00000002; (* texture will not change *)
D3DRMTEXTURE_DOWNSAMPLEPOINT = $00000004; (* point filtering should be used when downsampling *)
D3DRMTEXTURE_DOWNSAMPLEBILINEAR = $00000008; (* bilinear filtering should be used when downsampling *)
D3DRMTEXTURE_DOWNSAMPLEREDUCEDEPTH = $00000010; (* reduce bit depth when downsampling *)
D3DRMTEXTURE_DOWNSAMPLENONE = $00000020; (* texture should never be downsampled *)
D3DRMTEXTURE_CHANGEDPIXELS = $00000040; (* pixels have changed *)
D3DRMTEXTURE_CHANGEDPALETTE = $00000080; (* palette has changed *)
D3DRMTEXTURE_INVALIDATEONLY = $00000100; (* dirty regions are invalid *)
D3DRMTEXTURE_FORCERESIDENT = $00000001; // texture should be kept in video memory
D3DRMTEXTURE_STATIC = $00000002; // texture will not change
D3DRMTEXTURE_DOWNSAMPLEPOINT = $00000004; // point filtering should be used when downsampling
D3DRMTEXTURE_DOWNSAMPLEBILINEAR = $00000008; // bilinear filtering should be used when downsampling
D3DRMTEXTURE_DOWNSAMPLEREDUCEDEPTH = $00000010; // reduce bit depth when downsampling
D3DRMTEXTURE_DOWNSAMPLENONE = $00000020; // texture should never be downsampled
D3DRMTEXTURE_CHANGEDPIXELS = $00000040; // pixels have changed
D3DRMTEXTURE_CHANGEDPALETTE = $00000080; // palette has changed
D3DRMTEXTURE_INVALIDATEONLY = $00000100; // dirty regions are invalid
 
(*
* Shadow flags
*)
D3DRMSHADOW_TRUEALPHA = $00000001; (* shadow should render without artifacts when true alpha is on *)
{ Shadow flags }
 
const
D3DRMSHADOW_TRUEALPHA = $00000001; // shadow should render without artifacts when true alpha is on
 
{ TD3DRMCombineType }
 
type
PD3DRMCombineType = ^TD3DRMCombineType;
TD3DRMCombineType = (
D3DRMCOMBINE_REPLACE,
D3DRMCOMBINE_BEFORE,
9409,26 → 5855,40
D3DRMCOMBINE_AFTER
);
 
PD3DRMColorModel = ^TD3DRMColorModel;
D3DRMCOMBINETYPE = TD3DRMCombineType;
 
{ TD3DRMColorModel }
 
TD3DRMColorModel = TD3DColorModel;
D3DRMCOLORMODEL = TD3DRMColorModel;
 
PD3DRMPaletteFlags = ^TD3DRMPaletteFlags;
{ TD3DRMPaletteFlags }
 
TD3DRMPaletteFlags = (
D3DRMPALETTE_FREE, (* renderer may use this entry freely *)
D3DRMPALETTE_READONLY, (* fixed but may be used by renderer *)
D3DRMPALETTE_RESERVED (* may not be used by renderer *)
D3DRMPALETTE_FREE, // renderer may use this entry freely
D3DRMPALETTE_READONLY, // fixed but may be used by renderer
D3DRMPALETTE_RESERVED // may not be used by renderer
);
 
D3DRMPALETTEFLAGS = TD3DRMPaletteFlags;
 
{ TD3DRMPaletteEntry structure }
 
PD3DRMPaletteEntry = ^TD3DRMPaletteEntry;
TD3DRMPaletteEntry = packed record
red: Byte; (* 0 .. 255 *)
green: Byte; (* 0 .. 255 *)
blue: Byte; (* 0 .. 255 *)
flags: Byte; (* one of D3DRMPALETTEFLAGS *)
TD3DRMPaletteEntry = record
red: Byte; // 0 .. 255
green: Byte; // 0 .. 255
blue: Byte; // 0 .. 255
flags: Byte; // one of TD3DRMPaletteFlags
end;
 
D3DRMPALETTEENTRY = TD3DRMPaletteEntry;
LPD3DRMPALETTEENTRY = PD3DRMPaletteEntry;
 
{ TD3DRMImage structure }
 
PD3DRMImage = ^TD3DRMImage;
TD3DRMImage = packed record
TD3DRMImage = record
width, height: Integer; (* width and height in pixels *)
aspectx, aspecty: Integer; (* aspect ratio for non-square pixels *)
depth: Integer; (* bits per pixel *)
9442,10 → 5902,10
buffer2: Pointer; (* second rendering buffer for double
buffering, set to NULL for single
buffering. *)
red_mask: DWORD;
green_mask: DWORD;
blue_mask: DWORD;
alpha_mask: DWORD; (* if rgb is true, these are masks for
red_mask: Longint;
green_mask: Longint;
blue_mask: Longint;
alpha_mask: Longint; (* if rgb is true, these are masks for
the red, green and blue parts of a
pixel. Otherwise, these are masks
for the significant bits of the
9460,7 → 5920,11
elements. *)
end;
 
PD3DRMWrapType = ^TD3DRMWrapType;
D3DRMIMAGE = TD3DRMImage;
LPD3DRMIMAGE = PD3DRMImage;
 
{ TD3DRMWrapType }
 
TD3DRMWrapType = (
D3DRMWRAP_FLAT,
D3DRMWRAP_CYLINDER,
9470,29 → 5934,31
D3DRMWRAP_BOX
);
 
D3DRMWRAPTYPE = TD3DRMWrapType;
 
const
D3DRMWIREFRAME_CULL = 1; (* cull backfaces *)
D3DRMWIREFRAME_HIDDENLINE = 2; (* lines are obscured by closer objects *)
D3DRMWIREFRAME_CULL = 1; // cull backfaces
D3DRMWIREFRAME_HIDDENLINE = 2; // lines are obscured by closer objects
 
{ TD3DRMProjectionType }
 
type
(*
* Do not use righthanded perspective in Viewport2::SetProjection().
* Set up righthanded mode by using IDirect3DRM3::SetOptions().
*)
PD3DRMProjectionType = ^TD3DRMProjectionType;
TD3DRMProjectionType = (
D3DRMPROJECT_PERSPECTIVE,
D3DRMPROJECT_ORTHOGRAPHIC,
D3DRMPROJECT_RIGHTHANDPERSPECTIVE, (* Only valid pre-DX6 *)
D3DRMPROJECT_RIGHTHANDORTHOGRAPHIC (* Only valid pre-DX6 *)
D3DRMPROJECT_RIGHTHANDPERSPECTIVE, // Only valid pre-DX6
D3DRMPROJECT_RIGHTHANDORTHOGRAPHIC // Only valid pre-DX6
);
 
D3DRMPROJECTIONTYPE = TD3DRMProjectionType;
 
const
D3DRMOPTIONS_LEFTHANDED = 00000001; (* Default *)
D3DRMOPTIONS_RIGHTHANDED = 00000002;
D3DRMOPTIONS_LEFTHANDED = $00000001; // Default
D3DRMOPTIONS_RIGHTHANDED = $00000002;
 
{ TD3DRMXOFFormat }
 
type
PD3DRMXOFFormat = ^TD3DRMXOFFormat;
TD3DRMXOFFormat = (
D3DRMXOF_BINARY,
D3DRMXOF_COMPRESSED,
9499,7 → 5965,13
D3DRMXOF_TEXT
);
 
D3DRMXOFFORMAT = TD3DRMXOFFormat;
 
{ TD3DRMSaveOptions }
 
TD3DRMSaveOptions = DWORD;
D3DRMSAVEOPTIONS = TD3DRMSaveOptions;
 
const
D3DRMXOFSAVE_NORMALS = 1;
D3DRMXOFSAVE_TEXTURECOORDINATES = 2;
9509,21 → 5981,28
D3DRMXOFSAVE_TEMPLATES = 16;
D3DRMXOFSAVE_TEXTURETOPOLOGY = 32;
 
{ TD3DRMColorSource }
 
type
PD3DRMColorSource = ^TD3DRMColorSource;
TD3DRMColorSource = (
D3DRMCOLOR_FROMFACE,
D3DRMCOLOR_FROMVERTEX
);
 
PD3DRMFrameConstraint = ^TD3DRMFrameConstraint;
D3DRMCOLORSOURCE = TD3DRMColorSource;
 
{ TD3DRMFrameConstraint }
 
TD3DRMFrameConstraint = (
D3DRMCONSTRAIN_Z, (* use only X and Y rotations *)
D3DRMCONSTRAIN_Y, (* use only X and Z rotations *)
D3DRMCONSTRAIN_X (* use only Y and Z rotations *)
D3DRMCONSTRAIN_Z, // use only X and Y rotations
D3DRMCONSTRAIN_Y, // use only X and Z rotations
D3DRMCONSTRAIN_X // use only Y and Z rotations
);
 
PD3DRMMaterialMode = ^TD3DRMMaterialMode;
D3DRMFRAMECONSTRAINT = TD3DRMFrameConstraint;
 
{ TD3DRMMaterialMode }
 
TD3DRMMaterialMode = (
D3DRMMATERIAL_FROMMESH,
D3DRMMATERIAL_FROMPARENT,
9530,39 → 6009,56
D3DRMMATERIAL_FROMFRAME
);
 
PD3DRMFogMode = ^TD3DRMFogMode;
D3DRMMATERIALMODE = TD3DRMMaterialMode;
 
{ TD3DRMFogMode }
 
TD3DRMFogMode = (
D3DRMFOG_LINEAR, (* linear between start and end *)
D3DRMFOG_EXPONENTIAL, (* density * exp(-distance) *)
D3DRMFOG_EXPONENTIALSQUARED (* density * exp(-distance*distance) *)
D3DRMFOG_LINEAR, // linear between start and end
D3DRMFOG_EXPONENTIAL, // density * exp(-distance)
D3DRMFOG_EXPONENTIALSQUARED // density * exp(-distance*distance)
);
 
PD3DRMZBufferMode = ^TD3DRMZBufferMode;
D3DRMFOGMODE = TD3DRMFogMode;
 
{ TD3DRMZBufferMode }
 
TD3DRMZBufferMode = (
D3DRMZBUFFER_FROMPARENT, (* default *)
D3DRMZBUFFER_ENABLE, (* enable zbuffering *)
D3DRMZBUFFER_DISABLE (* disable zbuffering *)
D3DRMZBUFFER_FROMPARENT, // default
D3DRMZBUFFER_ENABLE, // enable zbuffering
D3DRMZBUFFER_DISABLE // disable zbuffering
);
 
PD3DRMSortMode = ^TD3DRMSortMode;
D3DRMZBUFFERMODE = TD3DRMZBufferMode;
 
{ TD3DRMSortMode }
 
TD3DRMSortMode = (
D3DRMSORT_FROMPARENT, (* default *)
D3DRMSORT_NONE, (* don't sort child frames *)
D3DRMSORT_FRONTTOBACK, (* sort child frames front-to-back *)
D3DRMSORT_BACKTOFRONT (* sort child frames back-to-front *)
D3DRMSORT_FROMPARENT, // default
D3DRMSORT_NONE, // don't sort child frames
D3DRMSORT_FRONTTOBACK, // sort child frames front-to-back
D3DRMSORT_BACKTOFRONT // sort child frames back-to-front
);
 
TD3DRMMaterialOverride = packed record
dwSize : DWORD; (* Size of this structure *)
dwFlags : DWORD; (* Indicate which fields are valid *)
dcDiffuse : TD3DColorValue; (* RGBA *)
dcAmbient : TD3DColorValue; (* RGB *)
dcEmissive : TD3DColorValue; (* RGB *)
dcSpecular : TD3DColorValue; (* RGB *)
D3DRMSORTMODE = TD3DRMSortMode;
 
{ TD3DRMMaterialOverride structure }
 
PD3DRMMaterialOverride = ^TD3DRMMaterialOverride;
TD3DRMMaterialOverride = record
dwSize: DWORD; // Size of this structure
dwFlags: DWORD; // Indicate which fields are valid
dcDiffuse: TD3DColorValue; // RGBA
dcAmbient: TD3DColorValue; // RGB
dcEmissive: TD3DColorValue; // RGB
dcSpecular: TD3DColorValue; // RGB
dvPower : TD3DValue;
lpD3DRMTex : IUnknown;
end;
 
D3DRMMATERIALOVERRIDE = TD3DRMMaterialOverride;
LPD3DRMMATERIALOVERRIDE = PD3DRMMaterialOverride;
 
const
D3DRMMATERIALOVERRIDE_DIFFUSE_ALPHAONLY = $00000001;
D3DRMMATERIALOVERRIDE_DIFFUSE_RGBONLY = $00000002;
9586,27 → 6082,23
D3DRMSTATECHANGE_RENDER = $000000020;
D3DRMSTATECHANGE_LIGHT = $000000040;
 
(*
* Values for flags in RM3::CreateDeviceFromSurface
*)
{ Values for flags in RM3::CreateDeviceFromSurface }
 
D3DRMDEVICE_NOZBUFFER = $00000001;
 
(*
* Values for flags in Object2::SetClientData
*)
{ Values for flags in Object2::SetClientData }
 
D3DRMCLIENTDATA_NONE = $00000001;
D3DRMCLIENTDATA_LOCALFREE = $00000002;
D3DRMCLIENTDATA_IUNKNOWN = $00000004;
 
(*
* Values for flags in Frame2::AddMoveCallback.
*)
{ Values for flags in Frame2::AddMoveCallback. }
 
D3DRMCALLBACK_PREORDER = 0;
D3DRMCALLBACK_POSTORDER = 1;
 
(*
* Values for flags in MeshBuilder2::RayPick.
*)
{ Values for flags in MeshBuilder2::RayPick. }
 
D3DRMRAYPICK_ONLYBOUNDINGBOXES = 1;
D3DRMRAYPICK_IGNOREFURTHERPRIMITIVES = 2;
D3DRMRAYPICK_INTERPOLATEUV = 4;
9613,39 → 6105,37
D3DRMRAYPICK_INTERPOLATECOLOR = 8;
D3DRMRAYPICK_INTERPOLATENORMAL = $10;
 
(*
* Values for flags in MeshBuilder3::AddFacesIndexed.
*)
{ Values for flags in MeshBuilder3::AddFacesIndexed. }
 
D3DRMADDFACES_VERTICESONLY = 1;
 
(*
* Values for flags in MeshBuilder2::GenerateNormals.
*)
 
{ Values for flags in MeshBuilder2::GenerateNormals. }
 
D3DRMGENERATENORMALS_PRECOMPACT = 1;
D3DRMGENERATENORMALS_USECREASEANGLE = 2;
 
(*
* Values for MeshBuilder3::GetParentMesh
*)
{ Values for MeshBuilder3::GetParentMesh }
 
D3DRMMESHBUILDER_DIRECTPARENT = 1;
D3DRMMESHBUILDER_ROOTMESH = 2;
 
(*
* Flags for MeshBuilder3::Enable
*)
{ Flags for MeshBuilder3::Enable }
D3DRMMESHBUILDER_RENDERENABLE = $00000001;
D3DRMMESHBUILDER_PICKENABLE = $00000002;
 
(*
* Flags for Object2::GetAge when used with MeshBuilders
*)
{ Flags for MeshBuilder3::AddMeshBuilder }
D3DRMADDMESHBUILDER_DONTCOPYAPPDATA = 1;
D3DRMADDMESHBUILDER_FLATTENSUBMESHES = 2;
D3DRMADDMESHBUILDER_NOSUBMESHES = 4;
 
{ Flags for Object2::GetAge when used with MeshBuilders }
D3DRMMESHBUILDERAGE_GEOMETRY = $00000001;
D3DRMMESHBUILDERAGE_MATERIALS = $00000002;
D3DRMMESHBUILDERAGE_TEXTURES = $00000004;
 
(*
* Format flags for MeshBuilder3::AddTriangles.
*)
{ Format flags for MeshBuilder3::AddTriangles. }
 
D3DRMFVF_TYPE = $00000001;
D3DRMFVF_NORMAL = $00000002;
D3DRMFVF_COLOR = $00000004;
9655,31 → 6145,29
D3DRMVERTEX_FAN = $00000002;
D3DRMVERTEX_LIST = $00000004;
 
(*
* Values for flags in Viewport2::Clear2
*)
{ Values for flags in Viewport2::Clear2 }
 
D3DRMCLEAR_TARGET = $00000001;
D3DRMCLEAR_ZBUFFER = $00000002;
D3DRMCLEAR_DIRTYRECTS = $00000004;
D3DRMCLEAR_ALL = (D3DRMCLEAR_TARGET or
D3DRMCLEAR_ZBUFFER or
D3DRMCLEAR_DIRTYRECTS);
D3DRMCLEAR_ALL = D3DRMCLEAR_TARGET or D3DRMCLEAR_ZBUFFER or D3DRMCLEAR_DIRTYRECTS;
 
(*
* Values for flags in Frame3::SetSceneFogMethod
*)
{ Values for flags in Frame3::SetSceneFogMethod }
 
D3DRMFOGMETHOD_VERTEX = $00000001;
D3DRMFOGMETHOD_TABLE = $00000002;
D3DRMFOGMETHOD_ANY = $00000004;
 
(*
* Values for flags in Frame3::SetTraversalOptions
*)
{ Values for flags in Frame3::SetTraversalOptions }
 
D3DRMFRAME_RENDERENABLE = $00000001;
D3DRMFRAME_PICKENABLE = $00000002;
 
{ TD3DRMAnimationOptions }
 
type
TD3DRMAnimationOptions = DWORD;
D3DRMANIMATIONOPTIONS = TD3DRMAnimationOptions;
 
const
D3DRMANIMATION_OPEN = $01;
9689,8 → 6177,12
D3DRMANIMATION_SCALEANDROTATION = $00000010;
D3DRMANIMATION_POSITION = $00000020;
 
{ TD3DRMInterpolationOptions }
 
type
TD3DRMInterpolationOptions = DWORD;
D3DRMINTERPOLATIONOPTIONS = TD3DRMInterpolationOptions;
 
const
D3DRMINTERPOLATION_OPEN = $01;
D3DRMINTERPOLATION_CLOSED = $02;
9700,8 → 6192,11
D3DRMINTERPOLATION_VERTEXCOLOR = $40;
D3DRMINTERPOLATION_SLERPNORMALS = $80;
 
{ TD3DRMLoadOptions }
 
type
TD3DRMLoadOptions = DWORD;
D3DRMLOADOPTIONS = TD3DRMLoadOptions;
 
const
D3DRMLOAD_FROMFILE = $00;
9720,20 → 6215,30
 
D3DRMLOAD_ASYNCHRONOUS = $400;
 
{ TD3DRMLoadReource }
 
type
PD3DRMLoadResource = ^TD3DRMLoadResource;
TD3DRMLoadResource = packed record
PD3DRMLoadReource = ^TD3DRMLoadReource;
TD3DRMLoadReource = record
hModule: HMODULE;
lpName: PAnsiChar;
lpType: PAnsiChar;
lpName: PChar;
lpType: PChar;
end;
 
D3DRMLOADRESOURCE = TD3DRMLoadReource;
LPD3DRMLOADRESOURCE = PD3DRMLoadReource;
 
{ TD3DRMLoadMemory }
 
PD3DRMLoadMemory = ^TD3DRMLoadMemory;
TD3DRMLoadMemory = packed record
TD3DRMLoadMemory = record
lpMemory: Pointer;
dwSize: DWORD;
dSize: DWORD;
end;
 
D3DRMLOADMEMORY = TD3DRMLoadMemory;
LPD3DRMLOADMEMORY = PD3DRMLoadMemory;
 
const
D3DRMPMESHSTATUS_VALID = $01;
D3DRMPMESHSTATUS_INTERRUPTED = $02;
9744,32 → 6249,43
D3DRMPMESHEVENT_BASEMESH = $01;
D3DRMPMESHEVENT_COMPLETE = $02;
 
{ TD3DRMPMeshLoadStatus }
 
type
PD3DRMPMeshLoadStatus = ^TD3DRMPMeshLoadStatus;
TD3DRMPMeshLoadStatus = packed record
dwSize, // Size of this structure
dwPMeshSize, // Total Size (bytes)
dwBaseMeshSize, // Total Size of the Base Mesh
dwBytesLoaded, // Total bytes loaded
dwVerticesLoaded, // Number of vertices loaded
TD3DRMPMeshLoadStatus = record
dwSize: DWORD; // Size of this structure
dwPMeshSize: DWORD; // Total Size (bytes)
dwBaseMeshSize: DWORD; // Total Size of the Base Mesh
dwBytesLoaded: DWORD; // Total bytes loaded
dwVerticesLoaded: DWORD; // Number of vertices loaded
dwFacesLoaded : DWORD; // Number of faces loaded
dwLoadResult : HResult; // Result of the load operation
dwFlags : DWORD;
end;
 
PD3DRMUserVisualReason = ^TD3DRMUserVisualReason;
D3DRMPMESHLOADSTATUS = TD3DRMPMeshLoadStatus;
LPD3DRMPMESHLOADSTATUS = PD3DRMPMeshLoadStatus;
 
{ TD3DRMUserVisualReason }
 
TD3DRMUserVisualReason = (
D3DRMUSERVISUAL_CANSEE,
D3DRMUSERVISUAL_RENDER
);
 
D3DRMUSERVISUALREASON = TD3DRMUserVisualReason;
 
{ TD3DRMAnimationKey }
 
PD3DRMAnimationKey = ^TD3DRMAnimationKey;
TD3DRMAnimationKey = packed record
TD3DRMAnimationKey = record
dwSize : DWORD;
dwKeyType : DWORD;
dvTime : TD3DValue;
dwID : DWORD;
case integer of
 
case Integer of
0 : (dqRotateKey : TD3DRMQuaternion);
1 : (dvScaleKey : TD3DVector);
2 : (dvPositionKey : TD3DVector);
9776,33 → 6292,31
3 : (dvK : array [0..3] of TD3DValue);
end;
 
procedure D3DRMAnimationGetRotateKey
(var rmKey: TD3DRMAnimationKey; var rmQuat: TD3DRMQuaternion);
D3DRMANIMATIONKEY = TD3DRMAnimationKey;
LPD3DRMANIMATIONKEY = PD3DRMAnimationKey;
 
procedure D3DRMAnimationGetScaleKey
(var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
procedure D3DRMAnimationGetRotateKey(const rmKey: TD3DRMAnimationKey; var rmQuat: TD3DRMQuaternion);
procedure D3DRMAnimationGetScaleKey(const rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
procedure D3DRMAnimationGetPositionKey(const rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
procedure D3DRMAnimationSetRotateKey(var rmKey: TD3DRMAnimationKey; const rmQuat: TD3DRMQuaternion);
procedure D3DRMAnimationSetScaleKey(var rmKey: TD3DRMAnimationKey; const dvVec: TD3DVector);
procedure D3DRMAnimationSetPositionKey(var rmKey: TD3DRMAnimationKey; const dvVec: TD3DVector);
 
procedure D3DRMAnimationGetPositionKey
(var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
const
D3DRMANIMATION_ROTATEKEY = $01;
D3DRMANIMATION_SCALEKEY = $02;
D3DRMANIMATION_POSITIONKEY = $03;
 
procedure D3DRMAnimatioSetRotateKey
(var rmKey: TD3DRMAnimationKey; var rmQuat: TD3DRMQuaternion);
{ TD3DRMMapping }
 
procedure D3DRMAnimationSetScaleKey
(var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
type
TD3DRMMapping = DWORD;
D3DRMMAPPING = TD3DRMMapping;
 
procedure D3DRMAnimationSetPositionKey
(var rmKey: TD3DRMAnimationKey; var dvVec: TD3DVector);
{ TD3DRMMappingFlag }
 
const
D3DRMANIMATION_ROTATEKEY = 01;
D3DRMANIMATION_SCALEKEY = 02;
D3DRMANIMATION_POSITIONKEY = 03;
 
type
TD3DRMMapping = DWORD;
PD3DRMMappingFlag = ^TD3DRMMappingFlag;
TD3DRMMappingFlag = DWORD;
D3DRMMAPPINGFLAG = TD3DRMMappingFlag;
 
const
D3DRMMAP_WRAPU = 1;
9809,9 → 6323,11
D3DRMMAP_WRAPV = 2;
D3DRMMAP_PERSPCORRECT = 4;
 
{ TD3DRMVertex }
 
type
PD3DRMVertex = ^TD3DRMVertex;
TD3DRMVertex = packed record
TD3DRMVertex = record
position: TD3DVector;
normal: TD3DVector;
tu, tv: TD3DValue;
9818,197 → 6334,173
color: TD3DColor;
end;
 
TD3DRMGroupIndex = LongInt; (* group indexes begin a 0 *)
D3DRMVERTEX = TD3DRMVertex;
LPD3DRMVERTEX = PD3DRMVertex;
 
{ TD3DRMGroupIndex }
 
TD3DRMGroupIndex = Longint;
D3DRMGROUPINDEX = TD3DRMGroupIndex; // group indexes begin a 0
 
const
D3DRMGROUP_ALLGROUPS = -1;
 
var
(*
* Create a color from three components in the range 0-1 inclusive.
*)
D3DRMCreateColorRGB : function (red, green, blue: TD3DValue) : TD3DColor;
stdcall;
{ Create a color from three components in the range 0-1 inclusive. }
function D3DRMCreateColorRGB(red, green, blue: TD3DValue): TD3DColor; stdcall;
 
(*
* Create a color from four components in the range 0-1 inclusive.
*)
D3DRMCreateColorRGBA : function (red, green, blue, alpha: TD3DValue)
: TD3DColor; stdcall;
{ Create a color from four components in the range 0-1 inclusive. }
function D3DRMCreateColorRGBA(red, green, blue, alpha: TD3DValue): TD3DColor; stdcall;
 
(*
* Get the red component of a color.
*)
D3DRMColorGetRed : function (d3drmc: TD3DColor) : TD3DValue; stdcall;
{ Get the red component of a color. }
function D3DRMColorGetRed(d3drmc: TD3DColor): TD3DValue; stdcall;
 
(*
* Get the green component of a color.
*)
D3DRMColorGetGreen : function (d3drmc: TD3DColor) : TD3DValue; stdcall;
{ Get the green component of a color. }
function D3DRMColorGetGreen(d3drmc: TD3DColor): TD3DValue; stdcall;
 
(*
* Get the blue component of a color.
*)
D3DRMColorGetBlue : function (d3drmc: TD3DColor) : TD3DValue; stdcall;
{ Get the blue component of a color. }
function D3DRMColorGetBlue(d3drmc: TD3DColor): TD3DValue; stdcall;
 
(*
* Get the alpha component of a color.
*)
D3DRMColorGetAlpha : function (d3drmc: TD3DColor) : TD3DValue; stdcall;
{ Get the alpha component of a color. }
function D3DRMColorGetAlpha(d3drmc: TD3DColor): TD3DValue; stdcall;
 
(*
* Add two vectors. Returns its first argument.
*)
D3DRMVectorAdd : function (var d, s1, s2: TD3DVector) : PD3DVector; stdcall;
{ Add two vectors. Returns its first argument. }
function D3DRMVectorAdd(var d, s1, s2: TD3DVector): PD3DVector; stdcall;
 
(*
* Subtract two vectors. Returns its first argument.
*)
D3DRMVectorSubtract : function (var d, s1, s2: TD3DVector) : PD3DVector;
stdcall;
{ Subtract two vectors. Returns its first argument. }
function D3DRMVectorSubtract(var d, s1, s2: TD3DVector): PD3DVector; stdcall;
 
(*
* Reflect a ray about a given normal. Returns its first argument.
*)
D3DRMVectorReflect : function (var d, ray, norm: TD3DVector) : PD3DVector;
stdcall;
{ Reflect a ray about a given normal. Returns its first argument. }
function D3DRMVectorReflect(var d, ray, norm: TD3DVector): PD3DVector; stdcall;
 
(*
* Calculate the vector cross product. Returns its first argument.
*)
D3DRMVectorCrossProduct : function (var d, s1, s2: TD3DVector) : PD3DVector;
stdcall;
{ Calculate the vector cross product. Returns its first argument. }
function D3DRMVectorCrossProduct(var d, s1, s2: TD3DVector): PD3DVector; stdcall;
 
(*
* Return the vector dot product.
*)
D3DRMVectorDotProduct : function (var s1, s2: TD3DVector) : TD3DValue;
stdcall;
{ Return the vector dot product. }
function D3DRMVectorDotProduct(var s1, s2: TD3DVector): TD3DValue; stdcall;
 
(*
* Scale a vector so that its modulus is 1. Returns its argument or
* NULL if there was an error (e.g. a zero vector was passed).
*)
D3DRMVectorNormalize : function (var lpv: TD3DVector) : PD3DVector; stdcall;
{ Scale a vector so that its modulus is 1. Returns its argument or
NULL if there was an error (e.g. a zero vector was passed). }
function D3DRMVectorNormalize(var lpv: TD3DVector): PD3DVector; stdcall;
 
(*
* Return the length of a vector (e.g. sqrt(x*x + y*y + z*z)).
*)
D3DRMVectorModulus : function (var v: TD3DVector) : TD3DValue; stdcall;
{ Return the length of a vector (e.g. sqrt(x*x + y*y + z*z)). }
function D3DRMVectorModulus(var v: TD3DVector): TD3DValue; stdcall;
 
(*
* Set the rotation part of a matrix to be a rotation of theta radians
* around the given axis.
*)
D3DRMVectorRotate : function (var r, v, axis: TD3DVector; theta: TD3DValue) :
PD3DVector; stdcall;
{ Set the rotation part of a matrix to be a rotation of theta radians
around the given axis. }
function D3DRMVectorRotate(var r, v, axis: TD3DVector; theta: TD3DValue): PD3DVector; stdcall;
 
(*
* Scale a vector uniformly in all three axes
*)
D3DRMVectorScale : function (var d, s: TD3DVector; factor: TD3DValue) :
PD3DVector; stdcall;
{ Scale a vector uniformly in all three axes }
function D3DRMVectorScale( var d, s: TD3DVector; factor: TD3DValue): PD3DVector; stdcall;
 
(*
* Return a random unit vector
*)
D3DRMVectorRandom : function (var d: TD3DVector) : PD3DVector; stdcall;
{ Return a random unit vector }
function D3DRMVectorRandom(var d: TD3DVector): PD3DVector; stdcall;
 
(*
* Returns a unit quaternion that represents a rotation of theta radians
* around the given axis.
*)
 
D3DRMQuaternionFromRotation : function (var quat: TD3DRMQuaternion;
{ Returns a unit quaternion that represents a rotation of theta radians
around the given axis. }
function D3DRMQuaternionFromRotation(var quat: PD3DRMQuaternion;
var v: TD3DVector; theta: TD3DValue) : PD3DRMQuaternion; stdcall;
 
(*
* Calculate the product of two quaternions
*)
D3DRMQuaternionMultiply : function (var q, a, b: TD3DRMQuaternion) :
PD3DRMQuaternion; stdcall;
{ Calculate the product of two quaternions }
function D3DRMQuaternionMultiply(var q, a, b: TD3DRMQuaternion): PD3DRMQuaternion; stdcall;
 
(*
* Interpolate between two quaternions
*)
D3DRMQuaternionSlerp : function (var q, a, b: TD3DRMQuaternion;
alpha: TD3DValue) : PD3DRMQuaternion; stdcall;
{ Interpolate between two quaternions }
function D3DRMQuaternionSlerp(var q, a, b: TD3DRMQuaternion; alpha: TD3DValue): PD3DRMQuaternion; stdcall;
 
(*
* Calculate the matrix for the rotation that a unit quaternion represents
*)
D3DRMMatrixFromQuaternion : procedure (dmMat: TD3DRMMatrix4D; var lpDqQuat:
TD3DRMQuaternion); stdcall;
{ Calculate the matrix for the rotation that a unit quaternion represents }
procedure D3DRMMatrixFromQuaternion(dmMat: TD3DRMMatrix4D; var lpDqQuat: TD3DRMQuaternion); stdcall;
 
(*
* Calculate the quaternion that corresponds to a rotation matrix
*)
D3DRMQuaternionFromMatrix : function (var lpQuat: TD3DRMQuaternion;
Mat: TD3DRMMatrix4D) : PD3DRMQuaternion; stdcall;
{ Calculate the quaternion that corresponds to a rotation matrix }
function D3DRMQuaternionFromMatrix(var lpQuat: TD3DRMQuaternion; Mat: TD3DRMMatrix4D): PD3DRMQuaternion;
 
(*==========================================================================;
*
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
*
* File: d3drmobj.h
* File: d3drm.h, d3drmobj.h, d3drmwin.h
* Content: Direct3DRM include file
*
***************************************************************************)
 
(*
* Direct3DRM Object classes
*)
 
{ Direct3DRM Object classes }
const
CLSID_CDirect3DRMDevice: TGUID =
(D1:$4fa3568e;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
CLSID_CDirect3DRMViewport: TGUID =
(D1:$4fa3568f;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
CLSID_CDirect3DRMFrame: TGUID =
(D1:$4fa35690;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
CLSID_CDirect3DRMMesh: TGUID =
(D1:$4fa35691;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
CLSID_CDirect3DRMMeshBuilder: TGUID =
(D1:$4fa35692;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
CLSID_CDirect3DRMFace: TGUID =
(D1:$4fa35693;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
CLSID_CDirect3DRMLight: TGUID =
(D1:$4fa35694;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
CLSID_CDirect3DRMTexture: TGUID =
(D1:$4fa35695;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
CLSID_CDirect3DRMWrap: TGUID =
(D1:$4fa35696;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
CLSID_CDirect3DRMMaterial: TGUID =
(D1:$4fa35697;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
CLSID_CDirect3DRMAnimation: TGUID =
(D1:$4fa35698;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
CLSID_CDirect3DRMAnimationSet: TGUID =
(D1:$4fa35699;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
CLSID_CDirect3DRMUserVisual: TGUID =
(D1:$4fa3569a;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
CLSID_CDirect3DRMShadow: TGUID =
(D1:$4fa3569b;D2:$623f;D3:$11cf;D4:($ac,$4a,$00,$00,$c0,$38,$25,$a1));
CLSID_CDirect3DRMViewportInterpolator: TGUID =
(D1:$0de9eaa1;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
CLSID_CDirect3DRMFrameInterpolator: TGUID =
(D1:$0de9eaa2;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
CLSID_CDirect3DRMMeshInterpolator: TGUID =
(D1:$0de9eaa3;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
CLSID_CDirect3DRMLightInterpolator: TGUID =
(D1:$0de9eaa6;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
CLSID_CDirect3DRMMaterialInterpolator: TGUID =
(D1:$0de9eaa7;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
CLSID_CDirect3DRMTextureInterpolator: TGUID =
(D1:$0de9eaa8;D2:$3b84;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
CLSID_CDirect3DRMProgressiveMesh: TGUID =
(D1:$4516ec40;D2:$8f20;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
CLSID_CDirect3DRMClippedVisual: TGUID =
(D1:$5434e72d;D2:$6d66;D3:$11d1;D4:($bb,$0b,$00,$00,$f8,$75,$86,$5a));
CLSID_CDirect3DRMDevice: TGUID = '{4FA3568E-623F-11CF-AC4A-0000C03825A1}';
CLSID_CDirect3DRMViewport: TGUID = '{4FA3568F-623F-11CF-AC4A-0000C03825A1}';
CLSID_CDirect3DRMFrame: TGUID = '{4FA35690-623F-11CF-AC4A-0000C03825A1}';
CLSID_CDirect3DRMMesh: TGUID = '{4FA35691-623F-11CF-AC4A-0000C03825A1}';
CLSID_CDirect3DRMMeshBuilder: TGUID = '{4FA35692-623F-11CF-AC4A-0000C03825A1}';
CLSID_CDirect3DRMFace: TGUID = '{4FA35693-623F-11CF-AC4A-0000C03825A1}';
CLSID_CDirect3DRMLight: TGUID = '{4FA35694-623F-11CF-AC4A-0000C03825A1}';
CLSID_CDirect3DRMTexture: TGUID = '{4FA35695-623F-11CF-AC4A-0000C03825A1}';
CLSID_CDirect3DRMWrap: TGUID = '{4FA35696-623F-11CF-AC4A-0000C03825A1}';
CLSID_CDirect3DRMMaterial: TGUID = '{4FA35697-623F-11CF-AC4A-0000C03825A1}';
CLSID_CDirect3DRMAnimation: TGUID = '{4FA35698-623F-11CF-AC4A-0000C03825A1}';
CLSID_CDirect3DRMAnimationSet: TGUID = '{4FA35699-623F-11CF-AC4A-0000C03825A1}';
CLSID_CDirect3DRMUserVisual: TGUID = '{4FA3569A-623F-11CF-AC4A-0000C03825A1}';
CLSID_CDirect3DRMShadow: TGUID = '{4FA3569B-623F-11CF-AC4A-0000C03825A1}';
CLSID_CDirect3DRMViewportInterpolator: TGUID = '{0DE9EAA1-3B84-11D0-9B6D-0000C0781BC3}';
CLSID_CDirect3DRMFrameInterpolator: TGUID = '{0DE9EAA2-3B84-11D0-9B6D-0000C0781BC3}';
CLSID_CDirect3DRMMeshInterpolator: TGUID = '{0DE9EAA3-3B84-11D0-9B6D-0000C0781BC3}';
CLSID_CDirect3DRMLightInterpolator: TGUID = '{0DE9EAA6-3B84-11D0-9B6D-0000C0781BC3}';
CLSID_CDirect3DRMMaterialInterpolator: TGUID = '{0DE9EAA7-3B84-11D0-9B6D-0000C0781BC3}';
CLSID_CDirect3DRMTextureInterpolator: TGUID = '{0DE9EAA8-3B84-11D0-9B6D-0000C0781BC3}';
CLSID_CDirect3DRMProgressiveMesh: TGUID = '{4516EC40-8F20-11D0-9B6D-0000C0781BC3}';
CLSID_CDirect3DRMClippedVisual: TGUID = '{5434E72D-6D66-11D1-BB0B-0000F875865A}';
 
{ Direct3DRM Object interfaces }
 
IID_IDirect3DRMObject: TGUID = '{EB16CB00-D271-11CE-AC48-0000C03825A1}';
IID_IDirect3DRMObject2: TGUID = '{4516EC7C-8F20-11D0-9B6D-0000C0781BC3}';
IID_IDirect3DRMDevice: TGUID = '{E9E19280-6E05-11CF-AC4A-0000C03825A1}';
IID_IDirect3DRMDevice2: TGUID = '{4516EC78-8F20-11D0-9B6D-0000C0781BC3}';
IID_IDirect3DRMDevice3: TGUID = '{549F498B-BFEB-11D1-8ED8-00A0C967A482}';
IID_IDirect3DRMViewport: TGUID = '{EB16CB02-D271-11CE-AC48-0000C03825A1}';
IID_IDirect3DRMViewport2: TGUID = '{4A1B1BE6-BFED-11D1-8ED8-00A0C967A482}';
IID_IDirect3DRMFrame: TGUID = '{EB16CB03-D271-11CE-AC48-0000C03825A1}';
IID_IDirect3DRMFrame2: TGUID = '{C3DFBD60-3988-11D0-9EC2-0000C0291AC3}';
IID_IDirect3DRMFrame3: TGUID = '{FF6B7F70-A40E-11D1-91F9-0000F8758E66}';
IID_IDirect3DRMVisual: TGUID = '{EB16CB04-D271-11CE-AC48-0000C03825A1}';
IID_IDirect3DRMMesh: TGUID = '{A3A80D01-6E12-11CF-AC4A-0000C03825A1}';
IID_IDirect3DRMMeshBuilder: TGUID = '{A3A80D02-6E12-11CF-AC4A-0000C03825A1}';
IID_IDirect3DRMMeshBuilder2: TGUID = '{4516EC77-8F20-11D0-9B6D-0000C0781BC3}';
IID_IDirect3DRMMeshBuilder3: TGUID = '{4516EC82-8F20-11D0-9B6D-0000C0781BC3}';
IID_IDirect3DRMFace: TGUID = '{EB16CB07-D271-11CE-AC48-0000C03825A1}';
IID_IDirect3DRMFace2: TGUID = '{4516EC81-8F20-11D0-9B6D-0000C0781BC3}';
IID_IDirect3DRMLight: TGUID = '{EB16CB08-D271-11CE-AC48-0000C03825A1}';
IID_IDirect3DRMTexture: TGUID = '{EB16CB09-D271-11CE-AC48-0000C03825A1}';
IID_IDirect3DRMTexture2: TGUID = '{120F30C0-1629-11D0-941C-0080C80CFA7B}';
IID_IDirect3DRMTexture3: TGUID = '{FF6B7F73-A40E-11D1-91F9-0000F8758E66}';
IID_IDirect3DRMWrap: TGUID = '{EB16CB0A-D271-11CE-AC48-0000C03825A1}';
IID_IDirect3DRMMaterial: TGUID = '{EB16CB0B-D271-11CE-AC48-0000C03825A1}';
IID_IDirect3DRMMaterial2: TGUID = '{FF6B7F75-A40E-11D1-91F9-0000F8758E66}';
IID_IDirect3DRMAnimation: TGUID = '{EB16CB0D-D271-11CE-AC48-0000C03825A1}';
IID_IDirect3DRMAnimation2: TGUID = '{FF6B7F77-A40E-11D1-91F9-0000F8758E66}';
IID_IDirect3DRMAnimationSet: TGUID = '{EB16CB0E-D271-11CE-AC48-0000C03825A1}';
IID_IDirect3DRMAnimationSet2: TGUID = '{FF6B7F79-A40E-11D1-91F9-0000F8758E66}';
IID_IDirect3DRMObjectArray: TGUID = '{242F6BC2-3849-11D0-9B6D-0000C0781BC3}';
IID_IDirect3DRMDeviceArray: TGUID = '{EB16CB10-D271-11CE-AC48-0000C03825A1}';
IID_IDirect3DRMViewportArray: TGUID = '{EB16CB11-D271-11CE-AC48-0000C03825A1}';
IID_IDirect3DRMFrameArray: TGUID = '{EB16CB12-D271-11CE-AC48-0000C03825A1}';
IID_IDirect3DRMVisualArray: TGUID = '{EB16CB13-D271-11CE-AC48-0000C03825A1}';
IID_IDirect3DRMLightArray: TGUID = '{EB16CB14-D271-11CE-AC48-0000C03825A1}';
IID_IDirect3DRMPickedArray: TGUID = '{EB16CB16-D271-11CE-AC48-0000C03825A1}';
IID_IDirect3DRMFaceArray: TGUID = '{EB16CB17-D271-11CE-AC48-0000C03825A1}';
IID_IDirect3DRMAnimationArray: TGUID = '{D5F1CAE0-4BD7-11D1-B974-0060083E45F3}';
IID_IDirect3DRMUserVisual: TGUID = '{59163DE0-6D43-11CF-AC4A-0000C03825A1}';
IID_IDirect3DRMShadow: TGUID = '{AF359780-6BA3-11CF-AC4A-0000C03825A1}';
IID_IDirect3DRMShadow2: TGUID = '{86B44E25-9C82-11D1-BB0B-00A0C981A0A6}';
IID_IDirect3DRMInterpolator: TGUID = '{242F6BC1-3849-11D0-9B6D-0000C0781BC3}';
IID_IDirect3DRMProgressiveMesh: TGUID = '{4516EC79-8F20-11D0-9B6D-0000C0781BC3}';
IID_IDirect3DRMPicked2Array: TGUID = '{4516EC7B-8F20-11D0-9B6D-0000C0781BC3}';
IID_IDirect3DRMClippedVisual: TGUID = '{5434E733-6D66-11D1-BB0B-0000F875865A}';
 
IID_IDirect3DRMWinDevice: TGUID = '{C5016CC0-D273-11CE-AC48-0000C03825A1}';
IID_IDirect3DRM: TGUID = '{2BC49361-8327-11CF-AC4A-0000C03825A1}';
IID_IDirect3DRM2: TGUID = '{4516ECC8-8F20-11D0-9B6D-0000C0781BC3}';
IID_IDirect3DRM3: TGUID = '{4516EC83-8F20-11D0-9B6D-0000C0781BC3}';
 
type
IDirect3DRMObject = interface;
IDirect3DRMObject2 = interface;
IDirect3DRMDevice = interface;
IDirect3DRMDevice2 = interface;
IDirect3DRMDevice3 = interface;
10031,117 → 6523,94
IDirect3DRMWrap = interface;
IDirect3DRMMaterial = interface;
IDirect3DRMMaterial2 = interface;
IDirect3DRMInterpolator = interface;
IDirect3DRMAnimation = interface;
IDirect3DRMAnimation2 = interface;
IDirect3DRMAnimationSet = interface;
IDirect3DRMAnimationSet2 = interface;
IDirect3DRMUserVisual = interface;
IDirect3DRMShadow = interface;
IDirect3DRMShadow2 = interface;
IDirect3DRMArray = interface;
IDirect3DRMObjectArray = interface;
IDirect3DRMDeviceArray = interface;
IDirect3DRMFaceArray = interface;
IDirect3DRMViewportArray = interface;
IDirect3DRMFrameArray = interface;
IDirect3DRMAnimationArray = interface;
IDirect3DRMVisualArray = interface;
IDirect3DRMPickedArray = interface;
IDirect3DRMPicked2Array = interface;
IDirect3DRMLightArray = interface;
IDirect3DRMPickedArray = interface;
IDirect3DRMFaceArray = interface;
IDirect3DRMAnimationArray = interface;
IDirect3DRMUserVisual = interface;
IDirect3DRMShadow = interface;
IDirect3DRMShadow2 = interface;
IDirect3DRMInterpolator = interface;
IDirect3DRMProgressiveMesh = interface;
IDirect3DRMPicked2Array = interface;
IDirect3DRMClippedVisual = interface;
 
(*
* Direct3DRM Object interfaces
*)
IID_IDirect3DRMObject = IDirect3DRMObject;
IID_IDirect3DRMDevice = IDirect3DRMDevice;
IID_IDirect3DRMDevice2 = IDirect3DRMDevice2;
IID_IDirect3DRMDevice3 = IDirect3DRMDevice3;
IID_IDirect3DRMViewport = IDirect3DRMViewport;
IID_IDirect3DRMViewport2 = IDirect3DRMViewport2;
IID_IDirect3DRMFrame = IDirect3DRMFrame;
IID_IDirect3DRMFrame2 = IDirect3DRMFrame2;
IID_IDirect3DRMFrame3 = IDirect3DRMFrame3;
IID_IDirect3DRMVisual = IDirect3DRMVisual;
IID_IDirect3DRMMesh = IDirect3DRMMesh;
IID_IDirect3DRMMeshBuilder = IDirect3DRMMeshBuilder;
IID_IDirect3DRMMeshBuilder2 = IDirect3DRMMeshBuilder2;
IID_IDirect3DRMMeshBuilder3 = IDirect3DRMMeshBuilder3;
IID_IDirect3DRMFace = IDirect3DRMFace;
IID_IDirect3DRMFace2 = IDirect3DRMFace2;
IID_IDirect3DRMLight = IDirect3DRMLight;
IID_IDirect3DRMTexture = IDirect3DRMTexture;
IID_IDirect3DRMTexture2 = IDirect3DRMTexture2;
IID_IDirect3DRMTexture3 = IDirect3DRMTexture3;
IID_IDirect3DRMWrap = IDirect3DRMWrap;
IID_IDirect3DRMMaterial = IDirect3DRMMaterial;
IID_IDirect3DRMMaterial2 = IDirect3DRMMaterial2;
IID_IDirect3DRMAnimation = IDirect3DRMAnimation;
IID_IDirect3DRMAnimation2 = IDirect3DRMAnimation2;
IID_IDir